The holdingPeriodInSeconds parameter lacks validation in both createPointsCampaign and createPointsCampaigns functions within the NudgePointsCampaigns contract, allowing privileged users to create campaigns with a zero holding period. This contradicts the core design principle of the protocols token holding incentive mechanism.
In the NudgePointsCampaigns contract, the protocol validates the targetToken parameter but fails to validate whether the holdingPeriodInSeconds is greater than zero. This oversight allows administrators to create campaigns that dont enforce any actual holding period.
The holdingPeriodInSeconds parameter represents the duration users must hold tokens to qualify for rewards, which is a fundamental mechanic of the protocols incentive system. A holding period of 0 seconds essentially bypasses this core requirement.
Affected functions:
If holdingPeriodInSeconds is set to 0:
While this wouldnt directly lead to financial loss, it could be exploited to distribute rewards in a manner inconsistent with the protocols stated objectives and potentially allow for gaming of the reward mechanism.
In NudgePointsCampaigns.sol, the validation for the createPointsCampaign function:
Similarly, in the createPointsCampaigns function (lines 86-105), batch campaign creation has the same validation gap.
Add validation for holdingPeriodInSeconds in both functions to ensure its greater than zero:
For createPointsCampaign:
For createPointsCampaigns:
Also, add the custom error definition at the contract level:
