-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updatable burn redeem contract #103
Conversation
LCOV of commit
|
LCOV of commit
|
error InvalidRedeemAmount(); | ||
error InvalidPaymentAmount(); | ||
|
||
error Inactive(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New error that emit if initializeBurnRedeem
is called when active
is set to `false
* @param burnFee the burn fee | ||
* @param multiBurnFee the multi burn fee | ||
*/ | ||
function setBurnFees(uint256 burnFee, uint256 multiBurnFee) external; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New setBurnFees
and setActive
methods
/** | ||
* See {IBurnRedeemCoreV2-setBurnFees}. | ||
*/ | ||
function setBurnFees(uint256 burnFee, uint256 multiBurnFee) external override adminRequired { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New method to set burn fees
/** | ||
* See {IBurnRedeemCoreV2-setActive}. | ||
*/ | ||
function setActive(bool _active) external override adminRequired { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new method to set active status
uint256 instanceId, | ||
BurnRedeemParameters calldata burnRedeemParameters | ||
) internal { | ||
if (!active) revert Inactive(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only allow new burns if active is true
vm.stopPrank(); | ||
} | ||
|
||
function testSetBurnFees() public { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New tests for setting burn fees
vm.stopPrank(); | ||
} | ||
|
||
function testSetActive() public { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New tests for setting active
vm.stopPrank(); | ||
} | ||
|
||
function testSetActive() public { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New tests for setting active
} | ||
|
||
|
||
function testSetBurnFees() public { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New tests for setting bunFees
burnRedeem.updateBurnRedeem(address(creator), 1, params); | ||
|
||
// Only admin can set membership address and update fees | ||
vm.startPrank(owner); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New access tests for setBurnFees
and setActive
burnRedeem.updateBurnRedeem(address(creator), 1, params, true); | ||
|
||
// Only admin can set membership address and update fees | ||
vm.startPrank(owner); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New access tests for setBurnFees
and setActive
will get eyes on this in the morning |
This PR
Add new ERC721BurnRedeemV2 and ERC1155BurnRedeemV2
Has exact same functionality as ERC721BurnRedeem and ERC1155BurnRedeem except the ability to update mintFees and prevent new burns if neccessary
New methods:
setBurnFees
: set burn fees, takes inburnFee
andmultiBurnFee
. Only admin of the extension can triggersetActive
: whether to allow new burns or not. Only admin of the extension can triggerNew tests for
setBurnFees
andsetActive
Screenshots (if applicable)
Ticket
https://linear.app/manifoldxyz/issue/UPDATE-THIS-PART
Self-Review
CR Notes
QA Steps