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

Merged
merged 53 commits into from
Dec 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9f8ea6e
feat: inherit from AccessControl and update accordingly
marcomariscal Dec 4, 2024
2aecdce
feat: update tests to handle new auth functionality
marcomariscal Dec 4, 2024
e293e2d
feat: add minter role
marcomariscal Dec 4, 2024
b7f4222
feat: test admin can't mint by default
marcomariscal Dec 4, 2024
726d0bf
fix: name
marcomariscal Dec 4, 2024
31d626f
fix: structure
marcomariscal Dec 4, 2024
fb88648
feat: basic pause functionality
marcomariscal Dec 3, 2024
946dc79
feat: pause/unpause tests
marcomariscal Dec 3, 2024
d9b3dba
fix: assume cap is not zero
marcomariscal Dec 3, 2024
1cfbef7
fix: check for pauser role
marcomariscal Dec 3, 2024
3379852
fix: separate role errors
marcomariscal Dec 4, 2024
004c789
feat: _revertIfNotPauser
marcomariscal Dec 4, 2024
4f29f5c
feat: close with tests
marcomariscal Dec 4, 2024
edf05f6
fix: use _revertIfNotPauser
marcomariscal Dec 4, 2024
bceb0f7
chore: better comment for `close`
marcomariscal Dec 4, 2024
e680c31
chore: comment
marcomariscal Dec 10, 2024
6ee3fb1
feat: _grantMinterRole helper
marcomariscal Dec 10, 2024
72ef93c
fix: use _checkRole and remove unused unauth error
marcomariscal Dec 10, 2024
dd15cac
fix: assume cap
marcomariscal Dec 10, 2024
61e7247
fix: toml
marcomariscal Dec 10, 2024
1295f88
chore: format
marcomariscal Dec 10, 2024
54315f5
fix: import
marcomariscal Dec 10, 2024
2558249
fix: compile
marcomariscal Dec 10, 2024
857ebc6
chore: name
marcomariscal Dec 10, 2024
479ef77
fix: import
marcomariscal Dec 10, 2024
007784b
fix: remove unnecessary
marcomariscal Dec 10, 2024
bfbac0e
feat: _revertIfClosed
marcomariscal Dec 10, 2024
8a5f057
Merge branch 'feat/capped-minter-v2-minter-role' into feat/capped-min…
marcomariscal Dec 10, 2024
493c1a6
feat: _formatAccessControlError
marcomariscal Dec 10, 2024
7d84ebe
Merge branch 'feat/capped-minter-v2-pause' into feat/capped-minter-v2…
marcomariscal Dec 10, 2024
6bb7d1a
fix: formatted error
marcomariscal Dec 10, 2024
fca3ffb
fix: remove assume cap greater than 0 in favor of bound
marcomariscal Dec 11, 2024
93e4af3
fix: remove unnecessary assumptions
marcomariscal Dec 11, 2024
225ba92
fix: use grant minter role
marcomariscal Dec 11, 2024
1942a64
fix: remove redundant balance check
marcomariscal Dec 11, 2024
77acf62
feat: refactor to set up capped minter in setup func
marcomariscal Dec 11, 2024
ecb275d
feat: testFuzz_CorrectlyPausesMintsWhenTogglingPause
marcomariscal Dec 11, 2024
43fa666
fix: move func
marcomariscal Dec 11, 2024
7da3772
Merge branch 'feat/capped-minter-v2-pause' into feat/capped-minter-v2…
marcomariscal Dec 12, 2024
57e1f4f
fix: only admin can close, fix mint to zero addr receiver, and format…
marcomariscal Dec 12, 2024
ef8ca96
fix: remove unnecessary revert if closed when unpausing
marcomariscal Dec 12, 2024
3fc7d3a
Update l2-contracts/src/ZkCappedMinterV2.sol
marcomariscal Dec 12, 2024
bb6854b
fix: test
marcomariscal Dec 12, 2024
0b17e88
fix: remove unnecessary pause from close
marcomariscal Dec 12, 2024
7631a29
fix: use global minter
marcomariscal Dec 12, 2024
246efdc
feat: test_CorrectlyChangesClosedVarWhenCalledByAdmin
marcomariscal Dec 16, 2024
91c0ca8
fix: foundry toml revert
marcomariscal Dec 16, 2024
aa47d27
Merge branch 'feat/capped-minter-v2' into feat/capped-minter-v2-close
marcomariscal Dec 16, 2024
48c9ca6
fix: handle check balances before and after
marcomariscal Dec 16, 2024
fe1cac7
fix: assume not capped minter admin
marcomariscal Dec 16, 2024
c7bef58
fix: handle balance check before in test
marcomariscal Dec 17, 2024
010e4c5
fix: rename
marcomariscal Dec 17, 2024
960a751
chore: remove unused
marcomariscal Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: test
marcomariscal committed Dec 12, 2024
commit bb6854b4de08f1726c78381c3c8d87c2fb7c14fb
8 changes: 6 additions & 2 deletions l2-contracts/test/ZkCappedMinterV2.t.sol
Original file line number Diff line number Diff line change
@@ -232,10 +232,14 @@ contract Close is ZkCappedMinterV2Test {
vm.prank(_minter);
cappedMinter.mint(_receiver, _amount);

// Try to unpause (should fail)
vm.expectRevert(ZkCappedMinterV2.ZkCappedMinterV2__ContractClosed.selector);
// Try to unpause (should succeed but minting still blocked)
vm.prank(_cappedMinterAdmin);
cappedMinter.unpause();

// Verify minting is still blocked even after unpausing
vm.expectRevert(ZkCappedMinterV2.ZkCappedMinterV2__ContractClosed.selector);
vm.prank(_minter);
cappedMinter.mint(_receiver, _amount);
}

function testFuzz_RevertIf_NotAdminCloses(address _cappedMinterAdmin, address _nonAdmin, uint256 _cap) public {