Closed bitcoinbrisbane closed 3 weeks ago
The changes in this pull request primarily involve the DynamicEater
contract, which now includes a new public function for setting a maximum token supply and modifies existing merging functionalities to enforce this limit. The internal variable _currentHeld
has been replaced with _totalMerged
to track the total merged amount. Additionally, test cases have been added to verify the behavior of the merging functions concerning the new maximum supply logic, while certain tests in the Farm
contract have been skipped due to an "out of gas" error.
File | Change Summary |
---|---|
contracts/core/merge/DynamicEater.sol | - Added setMaxSupply(uint256 value) function.- Replaced _currentHeld with _totalMerged .- Updated _merge function to enforce maximum supply checks.- Modified merge and mergeAll functions for new max supply logic.- Commented out whenLessThanMaxSupply modifier. |
test/DynamicEater.test.ts | - Added test case for merging with max supply constraints. - Verified successful merging and revert behavior when exceeding max supply. |
test/Farm.test.ts | - Skipped two test cases due to "out of gas" error. - Maintained core functionality of remaining tests. |
Objective | Addressed | Explanation |
---|---|---|
Adjust merge SC to include caps on how much can be merged (#[94]) | ✅ |
enhancement
, eat-all-the-tokens
🐰 In the garden where tokens play,
A cap on merging leads the way.
With limits set, we hop with glee,
Ensuring balance, wild and free!
Let's merge with care, and never stray,
For a bountiful harvest, come what may! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Closes #94
Summary by CodeRabbit
New Features
setMaxSupply
function to allow the owner to set and manage token supply limits.Bug Fixes
Tests