The deployCampaign and deployAndFundCampaign functions in the NudgeCampaignFactory contract do not validate that the rewardPPQ parameter is greater than zero and less than PPQ_DENOMINATOR; potentially allowing campaigns to be created with zero or excessive rewards.
The rewardPPQ parameter represents the reward factor in parts per quadrillion (PPQ) used to calculate campaign rewards. This critical parameter lacks validation in both deployment functions.
When rewardPPQ is zero, the campaign would function normally but would never distribute any rewards to participants, as the reward calculation would always result in zero. This creates a dysfunctional campaign that contradicts the core purpose of the protocol.
Additionally, if rewardPPQ is equal to or greater than PPQ_DENOMINATOR (1e15), rewards would be equal to or greater than the original amount allocated, which could lead to excessive and potentially unsustainable reward distributions.
In NudgeCampaignFactory.sol:
The impact can be seen in NudgeCampaign.sol where rewards are calculated:
Add validation checks in both campaign deployment functions to ensure the reward rate is within valid bounds:
Also, add the corresponding error definitions:
