-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2dc1035
commit 0650261
Showing
5 changed files
with
94 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Test Plan for Common Token contracts | ||
|
||
## HubOwner.sol | ||
This section defines tests for contracts/token/common/HubOwner.sol. | ||
All of these tests are in test/token/common/HubOwner.t.sol. | ||
|
||
| Test name |Description | Happy Case | Implemented | | ||
|---------------------------------| --------------------------------------------------|------------|-------------| | ||
| testInit | Check that deployment work. | Yes | Yes | | ||
| testRenounceAdmin | Check that default admins can call renounce. | Yes | Yes | | ||
| testRenounceLastAdminBlocked | Check that the last admin can not call renounce. | No | Yes | | ||
| testRenounceHubOwner | Check that hub owners can call renounce. | Yes | Yes | | ||
| testRenounceLastHubOwnerBlocked | Check that the last hub owner can not call renounce. | No | Yes | | ||
| testOwnerWhenNoHubOwner | Check operation when there are no hub owners. | No | Yes | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,73 @@ | ||
# Test Plan for Immutable ERC20 Preset contracts | ||
|
||
## ImmutableERC20FixedSupplyNoBurn.sol | ||
This section defines tests for contracts/erc20/preset/ImmutableERC20FixedSupplyNoBurn.sol. Note | ||
that this contract extends Open Zeppelin's ERC 20 contract which is extensively tested here: | ||
The ERC 20 contracts test the additional features supplied over and above the Open Zeppelin contracts. | ||
These base contracts are extensively tested here: | ||
https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v4.9/test/token/ERC20 . | ||
|
||
|
||
## Common Tests | ||
ERC20TestCommon.t.sol provides a test that is common to all ERC20 contracts: checking initialisation. | ||
|
||
ERC20MinternBurnerPermitCommon.t.sol provides tests used by both ImmutableERC20MinterBurnerPermit.t.sol | ||
and ImmutableERC20MinterBurnerPermitV2.t.sol. The ERC20MinternBurnerPermitCommon.t.sol tests are shown below: | ||
|
||
| Test name |Description | Happy Case | Implemented | | ||
|---------------------------------| --------------------------------------------------|------------|-------------| | ||
| testInitExtended | Check initialisation. | Yes | Yes | | ||
| testMint | Ensure successful minting by minter | Yes | Yes | | ||
| testOnlyMinterCanMint | Ensure Only minter role can mint reverts. | No | Yes | | ||
| testCanOnlyMintUpToMaxSupply | Ensure can only mint up to max supply | No | Yes | | ||
| testBurn | Ensure allowance is required to burn | Yes | Yes | | ||
| testBurnFrom | Ensure allowance is required to burnFrom | Yes | Yes | | ||
| testPermit | Ensure Permit works | Yes | Yes | | ||
|
||
|
||
## ImmutableERC20FixedSupplyNoBurn.sol | ||
This section defines tests for contracts/erc20/preset/ImmutableERC20FixedSupplyNoBurn.sol. | ||
All of the tests defined in the table below are in test/erc20/preset/ImmutableERC20FixedSupplyNoBurn.t.sol. | ||
|
||
| Test name |Description | Happy Case | Implemented | | ||
|---------------------------------| --------------------------------------------------|------------|-------------| | ||
| testInit | Check constructor. | Yes | Yes | | ||
| testInitExtended | Check constructor. | Yes | Yes | | ||
| testChangeOwner | Check change ownership. | Yes | Yes | | ||
| testRenounceOwnershipBlocked | Ensure renounceOwnership reverts. | No | Yes | | ||
|
||
## ImmutableERC20FixedSupplyNoBurnV2.sol | ||
This section defines tests for contracts/erc20/preset/ImmutableERC20FixedSupplyNoBurnV2.sol. | ||
All of the tests defined in the table below are in test/erc20/preset/ImmutableERC20FixedSupplyNoBurnV2.t.sol. | ||
Note that ImmutableERC20FixedSupplyNoBurnV2 extends HubOwner.sol. The ownership features reside in | ||
HubOwner.sol, and hence are tested in HubOwner.t.sol. | ||
|
||
## ImmutableERC20MinterBurnerPermit.sol | ||
This section defines tests for contracts/erc20/preset/ImmutableERC20MinterBurnerPermit.sol. Note | ||
that this contract extends Open Zeppelin's ERC 20 contract which is extensively tested here: | ||
https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v4.9/test/token/ERC20 . | ||
| Test name |Description | Happy Case | Implemented | | ||
|---------------------------------| --------------------------------------------------|------------|-------------| | ||
| testInitExtended | Check constructor. | Yes | Yes | | ||
|
||
|
||
## ImmutableERC20MinterBurnerPermit.sol | ||
This section defines tests for contracts/erc20/preset/ImmutableERC20MinterBurnerPermit.sol. | ||
All of the tests defined in the table below are in test/erc20/preset/ImmutableERC20MinterBurnerPermit.t.sol. | ||
Minter, Burner and Permit features are tested in ERC20MinternBurnerPermitCommon.t.sol, described above. | ||
|
||
| Test name |Description | Happy Case | Implemented | | ||
|---------------------------------| --------------------------------------------------|------------|-------------| | ||
| testInit | Check constructor. | Yes | Yes | | ||
| testChangeOwner | Check change ownership. | Yes | Yes | | ||
| testRenounceOwnershipBlocked | Ensure renounceOwnership reverts. | No | Yes | | ||
| testOnlyMinterCanMunt | Ensure Only minter role can mint reverts. | No | Yes | | ||
| testMint | Ensure successful minting by minter | No | Yes | | ||
| testCanOnlyMintUpToMaxSupply | Ensure can only mint up to max supply | No | Yes | | ||
| testRenounceLastHubOwnerBlocked | Ensure the last hub owner cannot be renounced | No | Yes | | ||
| testRenounceLastAdminBlocked | Ensure the last default admin cannot be renounced | No | Yes | | ||
| testRenounceAdmin | Ensure admin role can be renounced | No | Yes | | ||
| testRenounceHubOwner | Ensure hub owner role can be renounced | No | Yes | | ||
| testBurnFrom | Ensure allowance is required to burnFrom | Yes | Yes | | ||
| testPermit | Ensure Permit works | Yes | Yes | | ||
| testInitExtended | Check constructor. | Yes | Yes | | ||
| testRenounceAdmin | Check that default admins can call renounce. | Yes | Yes | | ||
| testRenounceLastAdminBlocked | Check that the last admin can not call renounce. | No | Yes | | ||
| testRenounceHubOwner | Check that hub owners can call renounce. | Yes | Yes | | ||
| testRenounceLastHubOwnerBlocked | Check that the last hub owner can not call renounce. | No | Yes | | ||
|
||
## ImmutableERC20MinterBurnerPermitV2.sol | ||
This section defines tests for contracts/erc20/preset/ImmutableERC20MinterBurnerPermitV2.sol. | ||
All of the tests defined in the table below are in test/erc20/preset/ImmutableERC20MinterBurnerPermitV2.t.sol. | ||
Note that ImmutableERC20MinterBurnerPermitV2 extends HubOwner.sol. The ownership features reside in | ||
HubOwner.sol, and hence are tested in HubOwner.t.sol. Minter, Burner and Permit features are | ||
tested in ERC20MinternBurnerPermitCommon.t.sol, described above. | ||
|
||
|
||
| Test name |Description | Happy Case | Implemented | | ||
|---------------------------------| --------------------------------------------------|------------|-------------| | ||
| testInitExtended | Check constructor. | Yes | Yes | | ||
| testRenounceAdmin | Check that default admins can call renounce. | Yes | Yes | | ||
| testRenounceLastAdminBlocked | Check that the last admin can not call renounce. | No | Yes | | ||
| testRenounceHubOwner | Check that hub owners can call renounce. | Yes | Yes | | ||
| testRenounceLastHubOwnerBlocked | Check that the last hub owner can not call renounce. | No | Yes | |