Skip to content

Commit

Permalink
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions l2-contracts/src/ZkCappedMinterV2.sol
Original file line number Diff line number Diff line change
@@ -45,17 +45,13 @@ contract ZkCappedMinterV2 is AccessControl, Pausable {

/// @notice Pauses token minting
function pause() external {
if (!hasRole(PAUSER_ROLE, msg.sender)) {
revert ZkCappedMinterV2__NotPauser(msg.sender);
}
_revertIfNotPauser(msg.sender);
_pause();
}

/// @notice Unpauses token minting
function unpause() external {
if (!hasRole(PAUSER_ROLE, msg.sender)) {
revert ZkCappedMinterV2__NotPauser(msg.sender);
}
_revertIfNotPauser(msg.sender);
_unpause();
}

@@ -77,6 +73,13 @@ contract ZkCappedMinterV2 is AccessControl, Pausable {
}
}

/// @notice Reverts if the account does not have pauser role.
function _revertIfNotPauser(address account) internal view {
if (!hasRole(PAUSER_ROLE, account)) {
revert ZkCappedMinterV2__NotPauser(account);
}
}

/// @notice Reverts if the amount of new tokens will increase the minted tokens beyond the mint cap.
/// @param _amount The quantity of tokens, in raw decimals, that will checked against the cap.
function _revertIfCapExceeded(uint256 _amount) internal view {

0 comments on commit b3e1cb4

Please sign in to comment.