Closed bitcoinbrisbane closed 1 week ago
The pull request introduces enhancements to the Eater
, GenericMerge
, and MergeWithMarket
contracts. A new public state variable minAmount
is added to the Eater
contract, along with a function to set this amount and a modifier to check solvent status. The GenericMerge
and MergeWithMarket
contracts are updated to include the whenSolvent
modifier in their merging functions, ensuring that these operations can only proceed if the contract meets the minimum balance requirement.
File | Change Summary |
---|---|
contracts/core/merge/Eater.sol | - Added uint256 public minAmount variable. - Added function setMinAmount(uint256 amount) external onlyOwner . - Added modifier whenSolvent(uint256 amountToMerge) . - Added uint256 public sumOfVested variable. - Updated uint8 internal vestingDuration to uint32 public vestingDuration . - Updated _merge function to use sumOfVested and modified vesting time calculation. - Added function setVestingDuration(uint32 duration) external onlyOwner . |
contracts/core/merge/GenericMerge.sol | - Updated constructor to accept uint32 _vestingDuration . - Removed function mergeAll() . - Updated function merge(uint256 amount) to include whenSolvent(amount) . - Modified claim function to decrement sumOfVested . |
contracts/core/merge/MergeWithMarket.sol | - Updated constructor to accept uint32 _vestingDuration . - Updated function mergeAndSell(uint256 amount, IAMM amm, bytes calldata extraData) to include whenNotPaused and whenSolvent(amount) . - Disabled mergeAll and merge functions with a revert message. |
contracts/interfaces/IMergeV2.sol | - Removed function mergeAll() . |
test/GenericMerge.test.ts | - Updated deployFixture to include otherAccount2 . - Added tests for merging conditions and vesting amount claims. |
BroMerge
contract inherits from the Eater
contract, which is directly related to the changes made in the main PR regarding the Eater
contract's functionality and state variables.Eater
contract regarding the whenNotPaused
modifier and the addition of new functions are relevant to the updates made in the BroMerge
contract, which also implements similar functionalities.BBroMerge
contract, like BroMerge
, inherits from Eater
, and the changes made to Eater
are relevant to the functionality of BBroMerge
.vestingDuration
variable in the Eater
contract is directly related to the changes made in the main PR, which also modifies the vestingDuration
variable.MergeWithMarket
contract, which inherits from GenericMerge
, are relevant as they involve changes to the constructor and functionality that align with the updates in the main PR.GenericMerge
contract, particularly the changes to the _rate
variable, are relevant as they relate to the overall functionality of the merging process in the context of the main PR.enhancement
, SC
π° In the meadow where tokens play,
A newminAmount
leads the way.
WithwhenSolvent
guarding the gate,
Merging now won't tempt fate.
So hop along, letβs celebrate,
For balance keeps our dreams up-to-date! πΌ
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?
minAmount
to Eater contractsetMinAmount
function in Eater contractwhenSolvent
modifier to Eater contractmergeAll
andmerge
functions in GenericMerge contract to includewhenSolvent
modifierwhenSolvent
modifier tomergeAndSell
function in MergeWithMarket contractSummary by CodeRabbit
New Features
minAmount
.setMinAmount
.whenSolvent
to enforce balance checks before executing certain functions.sumOfVested
variable.setVestingDuration
for the contract owner to adjust the vesting period.vestingDuration
.Bug Fixes
mergeAll
function to streamline available operations.merge
andmergeAndSell
to include thewhenSolvent
modifier, ensuring proper execution conditions.