-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: capped minter v2 nested testing #23
feat: capped minter v2 nested testing #23
Conversation
|
||
// Child should be able to mint from parent | ||
vm.prank(address(childMinter)); | ||
parentMinter.mint(_receiver, _amount); |
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.
What we really want to test is that a minter on the child can mint from the child and that this minting consumes contributes towards the limit of the parent minter.
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.
Also, I would change some naming in the main contract to reference _mintable
or something similar instead of token
_createCappedMinter(address(parentMinter), _childAdmin, _childCap, _startTime, _expirationTime); | ||
|
||
_grantMinterRoleToCappedMinter(address(parentMinter)); | ||
_grantMinterRoleToCappedMinter(address(childMinter)); |
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.
The child shouldn't need the minter role on the token
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.
@@ -167,6 +173,71 @@ contract Mint is ZkCappedMinterV2Test { | |||
cappedMinter.mint(_receiver, _amount); | |||
} | |||
|
|||
function testFuzz_NestedMintingContributesToParentCap( |
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.
Maybe also add a test verifying the parent mint does not count against the child mint
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.
No description provided.