Skip to content

Enhance contract simulations and streamline error handling#84

Merged
mahabubAlahi merged 4 commits intofeat/contract-sdkfrom
fix/contract-sdk
Mar 31, 2026
Merged

Enhance contract simulations and streamline error handling#84
mahabubAlahi merged 4 commits intofeat/contract-sdkfrom
fix/contract-sdk

Conversation

@mahabubAlahi
Copy link
Copy Markdown
Contributor

Summary

  • Added 21 missing simulation methods across 4 contract entities (AllOrNothing, CampaignInfo, GlobalParams, CampaignInfoFactory) to ensure every write operation has a corresponding simulate.* counterpart
  • Consolidated import statements across all simulate files, removing unused parseContractError and getRevertData imports
  • Unified simulation error handling to use simulateWithErrorDecode consistently across all 8 contract modules
  • Reordered CampaignInfo simulate methods to match the declaration order in writes for maintainability
  • Updated types and unit tests to reflect all new simulation methods with comprehensive coverage

- Added new simulation methods for AllOrNothing contract: pauseTreasury, unpauseTreasury, cancelTreasury, addRewards, removeReward, burn, approve, setApprovalForAll, safeTransferFrom, and transferFrom.
- Expanded CampaignInfo contract simulations with setImageURI, updateContractURI, unpauseCampaign, setPlatformInfo, transferOwnership, and renounceOwnership methods.
- Updated corresponding types to reflect the new simulation methods in AllOrNothing and CampaignInfo contracts.
- Introduced similar ownership transfer and renouncement methods in GlobalParams and CampaignInfoFactory contracts.
- Introduced tests for ownership transfer and renouncement in GlobalParams, CampaignInfoFactory, and CampaignInfo contracts.
- Added new simulation methods for CampaignInfo: setImageURI, updateContractURI, unpauseCampaign, and setPlatformInfo.
- Enhanced AllOrNothing contract tests with pauseTreasury, unpauseTreasury, cancelTreasury, addRewards, removeReward, burn, approve, setApprovalForAll, safeTransferFrom, and transferFrom methods.
- Updated existing tests to ensure comprehensive coverage of new functionalities.
- Consolidated import statements in various simulation files to enhance clarity and reduce redundancy.
- Updated simulation methods across multiple contracts to utilize `simulateWithErrorDecode` for error handling, replacing `parseContractError`.
- Renamed and reorganized methods in the CampaignInfo contract to improve consistency and readability, including updates to `setImageURI`, `updateContractURI`, and `pauseCampaign`.
- Adjusted types in the CampaignInfo and KeepWhatsRaised contracts to reflect the new method signatures and ensure type safety.
- Renamed the test description for the GlobalParams entity to clarify that the events object is expected to be empty.
@mahabubAlahi mahabubAlahi self-assigned this Mar 31, 2026
@mahabubAlahi mahabubAlahi added the enhancement New feature or request label Mar 31, 2026
@mahabubAlahi mahabubAlahi merged commit 0ec7d2d into feat/contract-sdk Mar 31, 2026
1 check passed
@mahabubAlahi mahabubAlahi deleted the fix/contract-sdk branch March 31, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant