-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement setMinimumFeeToZero function
- Loading branch information
1 parent
d275dd0
commit 93e0a30
Showing
18 changed files
with
141 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
tests/integration/concrete/campaign/shared/set-minimum-fee-to-zero/setMinimumFeeToZero.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >=0.8.22 <0.9.0; | ||
|
||
import { ISablierMerkleBase } from "src/interfaces/ISablierMerkleBase.sol"; | ||
import { Errors } from "src/libraries/Errors.sol"; | ||
|
||
import { Integration_Test } from "../../../../Integration.t.sol"; | ||
|
||
abstract contract SetMinimumFeeToZero_Integration_Test is Integration_Test { | ||
function test_RevertWhen_CallerNotFactoryAdmin() external { | ||
resetPrank({ msgSender: users.eve }); | ||
vm.expectRevert( | ||
abi.encodeWithSelector(Errors.SablierMerkleBase_CallerNotFactoryAdmin.selector, users.admin, users.eve) | ||
); | ||
merkleBase.setMinimumFeeToZero(); | ||
} | ||
|
||
modifier whenCallerFactoryAdmin() { | ||
_; | ||
} | ||
|
||
function test_GivenMinimumFeeAlreadyZero() external whenCallerFactoryAdmin { | ||
resetPrank(users.admin); | ||
merkleBase.setMinimumFeeToZero(); | ||
assertEq(merkleBase.minimumFee(), 0); | ||
merkleBase.setMinimumFeeToZero(); | ||
assertEq(merkleBase.minimumFee(), 0); | ||
} | ||
|
||
function test_GivenMinimumFeeNotZero() external whenCallerFactoryAdmin { | ||
resetPrank(users.admin); | ||
vm.expectEmit({ emitter: address(merkleBase) }); | ||
emit ISablierMerkleBase.MinimumFeeSetToZero(users.admin, MINIMUM_FEE); | ||
merkleBase.setMinimumFeeToZero(); | ||
assertEq(merkleBase.minimumFee(), 0); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/integration/concrete/campaign/shared/set-minimum-fee-to-zero/setMinimumFeeToZero.tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
SetMinimumFeeToZero_Integration_Test | ||
├── when caller not factory admin | ||
│ └── it should revert | ||
└── when caller factory admin | ||
├── given minimum fee already zero | ||
│ └── it should do nothing | ||
└── given minimum fee not zero | ||
├── it should set minimum fee to zero | ||
└── it should emit event MinimumFeeSetToZero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters