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 close #12

Open
wants to merge 13 commits into
base: feat/capped-minter-v2-pause
Choose a base branch
from

Conversation

marcomariscal
Copy link

No description provided.

@marcomariscal marcomariscal linked an issue Dec 4, 2024 that may be closed by this pull request
4 tasks
@marcomariscal marcomariscal force-pushed the feat/capped-minter-v2-pause branch 2 times, most recently from ca259f4 to 004c789 Compare December 4, 2024 23:17
@marcomariscal marcomariscal force-pushed the feat/capped-minter-v2-close branch from 3fcf95b to bceb0f7 Compare December 4, 2024 23:21
/// @dev Once closed, the contract cannot be reopened and all minting operations will be permanently blocked.
/// @dev Only callable by accounts with the PAUSER_ROLE.
function close() external {
_checkRole(PAUSER_ROLE, msg.sender);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we only want the admin to be able to close

Copy link
Author

Choose a reason for hiding this comment

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

@@ -45,6 +51,7 @@ contract ZkCappedMinterV2 is AccessControl, Pausable {

/// @notice Unpauses token minting
function unpause() external {
_revertIfClosed();
Copy link
Collaborator

Choose a reason for hiding this comment

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

It don't think we need to revert here, since unpausing will have no effect right?

Copy link
Author

Choose a reason for hiding this comment

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

yee you're right:

ef8ca96

l2-contracts/src/ZkCappedMinterV2.sol Outdated Show resolved Hide resolved
function close() external {
_checkRole(PAUSER_ROLE, msg.sender);
closed = true;
_pause();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why pause here as well?

Copy link
Author

Choose a reason for hiding this comment

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

ah yep unnecessary:

0b17e88

uint256 _amount
) public {
_cap = bound(_cap, 0, MAX_MINT_SUPPLY);
vm.assume(_cap > 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as last pr take a look at some of these assumes

Copy link
Author

Choose a reason for hiding this comment

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

cleaned up in feat/capped-minter-v2-pause and some here as well.

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.

Close Functionality
2 participants