-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from CMTA/custom-error-hardhat
Custom error with hardhat support
- Loading branch information
Showing
90 changed files
with
6,522 additions
and
10,715 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ artifacts | |
cache | ||
#manticore | ||
mcore_* | ||
#secrets | ||
.env |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
//SPDX-License-Identifier: MPL-2.0 | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
library Errors { | ||
// CMTAT | ||
error CMTAT_InvalidTransfer(address from, address to, uint256 amount); | ||
|
||
// SnapshotModule | ||
error CMTAT_SnapshotModule_SnapshotScheduledInThePast( | ||
uint256 time, | ||
uint256 timestamp | ||
); | ||
error CMTAT_SnapshotModule_SnapshotTimestampBeforeLastSnapshot( | ||
uint256 time, | ||
uint256 lastSnapshotTimestamp | ||
); | ||
error CMTAT_SnapshotModule_SnapshotTimestampAfterNextSnapshot( | ||
uint256 time, | ||
uint256 nextSnapshotTimestamp | ||
); | ||
error CMTAT_SnapshotModule_SnapshotTimestampBeforePreviousSnapshot( | ||
uint256 time, | ||
uint256 previousSnapshotTimestamp | ||
); | ||
error CMTAT_SnapshotModule_SnapshotAlreadyExists(); | ||
error CMTAT_SnapshotModule_SnapshotAlreadyDone(); | ||
error CMTAT_SnapshotModule_NoSnapshotScheduled(); | ||
error CMTAT_SnapshotModule_SnapshotNotFound(); | ||
|
||
// OnlyDelegateCallModule | ||
error CMTAT_OnlyDelegateCallModule_DirectCallToImplementation(); | ||
|
||
// ERC20BaseModule | ||
error CMTAT_ERC20BaseModule_WrongAllowance( | ||
address spender, | ||
uint256 currentAllowance, | ||
uint256 allowanceProvided | ||
); | ||
|
||
// BurnModule | ||
error CMTAT_BurnModule_EmptyAccounts(); | ||
error CMTAT_BurnModule_AccountsValueslengthMismatch(); | ||
|
||
// MintModule | ||
error CMTAT_MintModule_EmptyAccounts(); | ||
error CMTAT_MintModule_AccountsValueslengthMismatch(); | ||
|
||
// ERC20BaseModule | ||
error CMTAT_ERC20BaseModule_EmptyTos(); | ||
error CMTAT_ERC20BaseModule_TosValueslengthMismatch(); | ||
|
||
// DebtModule | ||
error CMTAT_DebtModule_SameValue(); | ||
|
||
// BaseModule | ||
error CMTAT_BaseModule_SameValue(); | ||
|
||
// ValidationModule | ||
error CMTAT_ValidationModule_SameValue(); | ||
|
||
// AuthorizationModule | ||
error CMTAT_AuthorizationModule_AddressZeroNotAllowed(); | ||
} |
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,11 +1,12 @@ | ||
//SPDX-License-Identifier: MPL-2.0 | ||
|
||
pragma solidity ^0.8.17; | ||
pragma solidity ^0.8.20; | ||
|
||
import "../../openzeppelin-contracts-upgradeable/contracts/metatx/MinimalForwarderUpgradeable.sol"; | ||
import "../../openzeppelin-contracts-upgradeable/contracts/metatx/ERC2771ForwarderUpgradeable.sol"; | ||
|
||
contract MinimalForwarderMock is MinimalForwarderUpgradeable { | ||
function initialize() public initializer { | ||
__MinimalForwarder_init(); | ||
contract MinimalForwarderMock is ERC2771ForwarderUpgradeable { | ||
function initialize(string memory name) public initializer { | ||
__EIP712_init_unchained(name, "1"); | ||
__ERC2771Forwarder_init_unchained(""); | ||
} | ||
} |
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
Oops, something went wrong.