Refactor cancellation checks in CampaignInfo and related contracts#37
Refactor cancellation checks in CampaignInfo and related contracts#37mahabubAlahi wants to merge 1 commit intooz-audit-fixesfrom
Conversation
mahabubAlahi
commented
Mar 3, 2026
- Updated cancellation checks to use the PausableCancellable interface instead of ICampaignTreasury.
- Removed redundant cancelled() function definitions from ICampaignInfo, ICampaignPaymentTreasury, and ICampaignTreasury interfaces.
- Adjusted internal logic in BasePaymentTreasury and BaseTreasury to align with the new cancellation checks.
- Updated cancellation checks to use the PausableCancellable interface instead of ICampaignTreasury. - Removed redundant cancelled() function definitions from ICampaignInfo, ICampaignPaymentTreasury, and ICampaignTreasury interfaces. - Adjusted internal logic in BasePaymentTreasury and BaseTreasury to align with the new cancellation checks.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42df4b5067
ℹ️ 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".
| tempTreasury = s_platformTreasuryAddress[tempPlatforms[i]]; | ||
| // Skip cancelled treasuries | ||
| if (!ICampaignTreasury(tempTreasury).cancelled()) { | ||
| if (!PausableCancellable(tempTreasury).cancelled()) { |
There was a problem hiding this comment.
Keep treasury cancellation check tied to declared interface
This call now assumes every treasury implements PausableCancellable.cancelled() even though ICampaignTreasury no longer declares cancelled, so a treasury implementation can be valid per interface and still cause getTotalRaisedAmount / getTotalCancelledAmount to revert at runtime when cancelled() is queried. Because TreasuryFactory accepts arbitrary approved implementations, this change removes compile-time enforcement of a function that these aggregation paths still require.
Useful? React with 👍 / 👎.