Skip to content
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

Merged

Conversation

marcomariscal
Copy link

No description provided.


// Child should be able to mint from parent
vm.prank(address(childMinter));
parentMinter.mint(_receiver, _amount);
Copy link
Collaborator

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.

Copy link
Collaborator

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

@marcomariscal marcomariscal changed the base branch from feat/capped-minter-v2-time-controls to feat/capped-minter-v2 December 17, 2024 20:22
@marcomariscal marcomariscal linked an issue Dec 17, 2024 that may be closed by this pull request
6 tasks
_createCappedMinter(address(parentMinter), _childAdmin, _childCap, _startTime, _expirationTime);

_grantMinterRoleToCappedMinter(address(parentMinter));
_grantMinterRoleToCappedMinter(address(childMinter));
Copy link
Collaborator

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

Copy link
Author

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(
Copy link
Collaborator

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexkeating alexkeating merged commit 0b086d1 into feat/capped-minter-v2 Dec 17, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested Capped Minters
2 participants