Add pre campaign launch constraint to removeReward#40
Add pre campaign launch constraint to removeReward#40adnanhq wants to merge 1 commit intooz-audit-fixesfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bfd8732873
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| function removeReward(bytes32 rewardName) | ||
| external | ||
| onlyCampaignOwner | ||
| currentTimeIsLess(INFO.getLaunchTime()) |
There was a problem hiding this comment.
Gate reward removal on treasury launch time
removeReward now checks currentTimeIsLess(INFO.getLaunchTime()), but this contract’s runtime schedule is driven by s_campaignData.launchTime (set in configureTreasury) and pledge gating uses getLaunchTime(). Because configureTreasury does not enforce campaignData.launchTime == INFO.getLaunchTime(), these values can diverge, so reward removal can be incorrectly blocked before this treasury’s launch or incorrectly allowed after it, depending on which timestamp is earlier.
Useful? React with 👍 / 👎.
Changes
removeRewardinAllOrNothing.solby adding thecurrentTimeIsLess(INFO.getLaunchTime())modifier so rewards can only be removed before campaign launch.removeRewardinKeepWhatsRaised.solby adding thecurrentTimeIsLess(INFO.getLaunchTime())modifier so rewards can only be removed before campaign launch.