diff --git a/test/unit/README.md b/test/unit/README.md index 5df91e1a..5a454f2e 100644 --- a/test/unit/README.md +++ b/test/unit/README.md @@ -6,87 +6,88 @@ This document outlines the tests associated with this project. It is currently n **Test Contracts**: [RootERC20Bridge.t.sol](./root/RootERC20Bridge.t.sol), [RootERC20BridgeWithdraw.t.sol](./root/withdrawals/RootERC20BridgeWithdraw.t.sol) ### Initialization -| Test | Description | Happy Path | -|---------------------------------------------------------|---------------------------------------------------------------------------------|------------| -| `test_InitializeBridge` | Test initialization of the bridge | Yes | -| `test_RevertIf_InitializeTwice` | Reverts if initialized twice | No | -| `test_RevertIf_InitializeWithAZeroAddressAll` | Reverts if initialized with a zero address for all arguments | No | -| `test_RevertIf_InitializeWithAZeroAddressChildBridge` | Reverts if initialized with a zero address for the child bridge argument | No | -| `test_RevertIf_InitializeWithAZeroAddressIMXToken` | Reverts if initialized with a zero address for the IMX token argument | No | -| `test_RevertIf_InitializeWithAZeroAddressRootAdapter` | Reverts if initialized with a zero address for the root bridge adapter argument | No | -| `test_RevertIf_InitializeWithAZeroAddressTokenTemplate` | Reverts if initialized with a zero address for the token template argument | No | -| `test_RevertIf_InitializeWithAZeroAddressWETHToken` | Reverts if initialized with a zero address for the WETH token argument | No | -| `test_RevertIf_InitializeWithEmptyChildAdapter` | Reverts if initialized with an empty child adapter argument | No | +| Test | Description | Happy Path | +|---------------------------------------------------------|----------------------------------------------------------------------------------------|------------| +| `test_InitializeBridge` | Test initialization of the bridge | Yes | +| `test_RevertIf_InitializeTwice` | Ensures revert if initialized twice | No | +| `test_RevertIf_InitializeWithAZeroAddressAll` | Ensures revert if initialized with a zero address for all arguments | No | +| `test_RevertIf_InitializeWithAZeroAddressChildBridge` | Ensures revert if initialized with a zero address for the child bridge argument | No | +| `test_RevertIf_InitializeWithAZeroAddressIMXToken` | Ensures revert if initialized with a zero address for the IMX token argument | No | +| `test_RevertIf_InitializeWithAZeroAddressRootAdapter` | Ensures revert if initialized with a zero address for the root bridge adapter argument | No | +| `test_RevertIf_InitializeWithAZeroAddressTokenTemplate` | Ensures revert if initialized with a zero address for the token template argument | No | +| `test_RevertIf_InitializeWithAZeroAddressWETHToken` | Ensures revert if initialized with a zero address for the WETH token argument | No | +| `test_RevertIf_InitializeWithEmptyChildAdapter` | Ensures revert if initialized with an empty child adapter argument | No | -### Privileged Operations +### Control Operations -| Test | Description | Happy Path | -|--------------------------------------------------------------|-------------------------------------------------------------------|------------| -| `test_updateRootBridgeAdaptor_UpdatesRootBridgeAdapto` | Updates the bridge adaptor address | Yes | -| `test_updateRootBridgeAdaptor_EmitsNewRootBridgeAdaptorEven` | Updating adapter address should emit `NewRootBridgeAdaptor` event | Yes | -| `test_RevertIf_updateRootBridgeAdaptorCalledByNonOwner` | Reverts if the function is called by a non-owner | No | -| `test_RevertIf_updateRootBridgeAdaptorCalledWithZeroAddress` | Reverts if the function is called with a zero adaptor address | No | +| Test | Description | Happy Path | +|--------------------------------------------------------------|----------------------------------------------------------------------|------------| +| `test_updateRootBridgeAdaptor_UpdatesRootBridgeAdapto` | Updates the bridge adaptor address | Yes | +| `test_updateRootBridgeAdaptor_EmitsNewRootBridgeAdaptorEven` | Updating adapter address should emit `NewRootBridgeAdaptor` event | Yes | +| `test_RevertIf_updateRootBridgeAdaptorCalledByNonOwner` | Ensures revert if the function is called by a non-owner | No | +| `test_RevertIf_updateRootBridgeAdaptorCalledWithZeroAddress` | Ensures revert if the function is called with a zero adaptor address | No | ### Map Token -| Test | Description | Happy Path | -|-----------------------------------------------|-----------------------------------------------------------------------|------------| -| `test_mapToken_SetsTokenMapping` | Verifies that the mapToken function sets the token mapping. | Yes | -| `test_mapToken_CallsAdaptor` | Verifies that the mapToken function calls the bridge adapter | Yes | -| `test_mapToken_EmitsTokenMappedEvent` | Verifies that the mapToken function emits a `TokenMappedEvent` event. | Yes | -| `test_RevertIf_mapTokenCalledTwice` | Reverts if the mapToken function is called twice for the same token | No | -| `test_RevertIf_mapTokenCalledWithETHAddress` | Reverts if the mapToken function is called for native ETH | No | -| `test_RevertIf_mapTokenCalledWithIMXAddress` | Reverts if the mapToken function is called for IMX | No | -| `test_RevertIf_mapTokenCalledWithZeroAddress` | Reverts if the mapToken function is called with a zero address | No | +| Test | Description | Happy Path | +|-----------------------------------------------|----------------------------------------------------------------------------|------------| +| `test_mapToken_SetsTokenMapping` | Verifies that the mapToken function sets the token mapping. | Yes | +| `test_mapToken_CallsAdaptor` | Verifies that the mapToken function calls the bridge adapter | Yes | +| `test_mapToken_EmitsTokenMappedEvent` | Verifies that the mapToken function emits a `TokenMappedEvent` event. | Yes | +| `test_RevertIf_mapTokenCalledTwice` | Ensures revert if the mapToken function is called twice for the same token | No | +| `test_RevertIf_mapTokenCalledWithETHAddress` | Ensures revert if the mapToken function is called for native ETH | No | +| `test_RevertIf_mapTokenCalledWithIMXAddress` | Ensures revert if the mapToken function is called for IMX | No | +| `test_RevertIf_mapTokenCalledWithZeroAddress` | Ensures revert if the mapToken function is called with a zero address | No | ### Deposits -#### ERC20 Token +#### Standard ERC20 Tokens -| Test | Description | Happy Path | -|-------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|------------| -| `test_depositCallsSendMessage` | Calls the send message function when depositing | Yes | -| `test_depositEmitsChildChainERC20DepositEvent` | Emits the child chain ERC20 deposit event when depositing an ERC20 token | Yes | -| `test_depositTransfersToken` | Verifies that the deposit function transfers the specified token to the specified child chain. | Yes | -| `test_depositToCallsSendMessage` | Calls the send message function when depositing to a child chain account | Yes | -| `test_depositToEmitsChildChainERC20DepositEven` | Verifies that the depositToETH function emits a ChildChainERC20DepositEven event. | Yes | -| `test_depositToTransfersToken` | Verifies that the depositToETH function transfers the specified token to the child chain. | Yes | -| `test_RevertIf_depositAmountIsZero` | Reverts if the deposit amount is zero | No | -| `test_RevertIf_depositCalledWhenTokenApprovalNotProvided` | Reverts if the deposit function is called when token approval is not provided | No | -| `test_RevertIf_depositCalledWithUnmappedToken` | Reverts if the deposit function is called with an unmapped token | No | -| `test_RevertIf_depositCalledWithZeroAddress` | Reverts if the deposit function is called with a zero address | No | -| `test_RevertIf_depositToAmountIsZero` | Reverts if the depositTo amount is zero | No | -| `test_RevertIf_depositToCalledWhenTokenApprovalNotProvided` | Reverts if the depositTo function is called when token approval is not provided | No | -| `test_RevertIf_depositToCalledWithUnmappedToken` | Reverts if the depositTo function is called with an unmapped token | No | -| `test_RevertIf_depositToCalledWithZeroAddress` | Reverts if the depositTo function is called with a zero address | No | +| Test | Description | Happy Path | +|-------------------------------------------------------------|------------------------------------------------------------------------------------------------|------------| +| `test_depositCallsSendMessage` | Calls the send message function when depositing | Yes | +| `test_depositEmitsChildChainERC20DepositEvent` | Emits the child chain ERC20 deposit event when depositing an ERC20 token | Yes | +| `test_depositTransfersToken` | Verifies that the deposit function transfers the specified token to the specified child chain. | Yes | +| `test_depositToCallsSendMessage` | Calls the send message function when depositing to a child chain account | Yes | +| `test_depositToEmitsChildChainERC20DepositEven` | Verifies that the depositToETH function emits a ChildChainERC20DepositEven event. | Yes | +| `test_depositToTransfersToken` | Verifies that the depositToETH function transfers the specified token to the child chain. | Yes | +| `test_RevertIf_depositAmountIsZero` | Ensures revert if the deposit amount is zero | No | +| `test_RevertIf_depositCalledWhenTokenApprovalNotProvided` | Ensures revert if the deposit function is called when token approval is not provided | No | +| `test_RevertIf_depositCalledWithUnmappedToken` | Ensures revert if the deposit function is called with an unmapped token | No | +| `test_RevertIf_depositCalledWithZeroAddress` | Ensures revert if the deposit function is called with a zero address | No | +| `test_RevertIf_depositToAmountIsZero` | Ensures revert if the depositTo amount is zero | No | +| `test_RevertIf_depositToCalledWhenTokenApprovalNotProvided` | Ensures revert if the depositTo function is called when token approval is not provided | No | +| `test_RevertIf_depositToCalledWithUnmappedToken` | Ensures revert if the depositTo function is called with an unmapped token | No | +| `test_RevertIf_depositToCalledWithZeroAddress` | Ensures revert if the depositTo function is called with a zero address | No | -#### Deposit ETH (Native and Wrapped) +#### IMX Token -| Test | Description | Happy Path | -|-----------------------------------------------|--------------------------------------------------------------------------------------------------------|------------| -| `test_depositETHCallsSendMessage` | Calls the send message function when depositing ETH | Yes | -| `test_depositETHEmitsNativeEthDepositEvent` | Emits the native ETH deposit event when depositing ETH | Yes | -| `test_depositTransfersNativeAsse` | Verifies that the deposit function transfers the native asset to the specified child chain. | Yes | -| `test_depositToETHCallsSendMessage` | Verifies that the depositToETH function calls the sendMessage function. | Yes | -| `test_depositToETHEmitsNativeEthDepositEven` | Verifies that the depositToETH function emits a NativeEthDepositEven event. | Yes | -| `test_depositToTransfersNativeAsse` | Verifies that the depositToETH function transfers the native asset to the child chain. | Yes | -| `test_RevertIf_depositETHAmountIsZero` | Reverts if the depositETH amount is zero | No | -| `test_RevertIf_depositETHInsufficientValue` | Reverts if the depositETH function is called with insufficient value | No | -| `test_RevertIf_depositToETHAmountIsZero` | Reverts if the depositToETH amount is zero | No | -| `test_RevertIf_depositToETHInsufficientValue` | Reverts if the depositToETH function is called with insufficient value | No | -| `test_depositWETHCallsSendMessag` | Verifies that the depositWETH function calls the sendMessage function. | Yes | -| `test_depositWETHEmitsNativeDepositEvent` | Verifies that the depositWETH function emits a NativeDepositEven event. | Yes | -| `test_depositWETHTransfersToken` | Verifies that the depositWETH function transfers WETH to the child chain. | Yes | +| Test | Description | Happy Path | +|------------------------------------------------------|--------------------------------------------------------------------------------------------------------|------------| +| `test_depositIMXEmitsIMXDepositEvent` | Emits the IMX deposit event when depositing IMX | Yes | +| `test_deposit_whenSettingImxDepositLimitToUnlimited` | Verifies that the deposit function can still be called when the IMX deposit limit is set to unlimited. | Yes | +| `test_depositToIMXEmitsIMXDepositEven` | Verifies that the depositToETH function emits a IMXDepositEven event. | Yes | +| `test_depositToWETHEmitsWETHDepositEven` | Verifies that the depositToETH function emits a WETHDepositEven event when depositing WETH. | Yes | +| `test_depositToWETHTransfersToken` | Verifies that the depositToETH function transfers WETH to the child chain. | Yes | +| `test_RevertsIf_IMXDepositLimitExceeded` | Ensures revert if the IMX deposit limit is exceeded | No | +| `test_RevertsIf_IMXDepositLimitTooLow` | Ensures revert if the IMX deposit limit is too low | No | -#### IMX Token +#### ETH (Native and Wrapped) + +| Test | Description | Happy Path | +|-----------------------------------------------|---------------------------------------------------------------------------------------------|------------| +| `test_depositETHCallsSendMessage` | Calls the send message function when depositing ETH | Yes | +| `test_depositETHEmitsNativeEthDepositEvent` | Emits the native ETH deposit event when depositing ETH | Yes | +| `test_depositTransfersNativeAsse` | Verifies that the deposit function transfers the native asset to the specified child chain. | Yes | +| `test_depositToETHCallsSendMessage` | Verifies that the depositToETH function calls the sendMessage function. | Yes | +| `test_depositToETHEmitsNativeEthDepositEven` | Verifies that the depositToETH function emits a NativeEthDepositEven event. | Yes | +| `test_depositToTransfersNativeAsse` | Verifies that the depositToETH function transfers the native asset to the child chain. | Yes | +| `test_RevertIf_depositETHAmountIsZero` | Ensures revert if the depositETH amount is zero | No | +| `test_RevertIf_depositETHInsufficientValue` | Ensures revert if the depositETH function is called with insufficient value | No | +| `test_RevertIf_depositToETHAmountIsZero` | Ensures revert if the depositToETH amount is zero | No | +| `test_RevertIf_depositToETHInsufficientValue` | Ensures revert if the depositToETH function is called with insufficient value | No | +| `test_depositWETHCallsSendMessag` | Verifies that the depositWETH function calls the sendMessage function. | Yes | +| `test_depositWETHEmitsNativeDepositEvent` | Verifies that the depositWETH function emits a NativeDepositEven event. | Yes | +| `test_depositWETHTransfersToken` | Verifies that the depositWETH function transfers WETH to the child chain. | Yes | -| Test | Description | Happy Path | -|-------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|------------| -| `test_depositIMXEmitsIMXDepositEvent` | Emits the IMX deposit event when depositing IMX | Yes | -| `test_deposit_whenSettingImxDepositLimitToUnlimited` | Verifies that the deposit function can still be called when the IMX deposit limit is set to unlimited. | Yes | -| `test_depositToIMXEmitsIMXDepositEven` | Verifies that the depositToETH function emits a IMXDepositEven event. | Yes | -| `test_depositToWETHEmitsWETHDepositEven` | Verifies that the depositToETH function emits a WETHDepositEven event when depositing WETH. | Yes | -| `test_depositToWETHTransfersToken` | Verifies that the depositToETH function transfers WETH to the child chain. | Yes | -| `test_RevertsIf_IMXDepositLimitExceeded` | Reverts if the IMX deposit limit is exceeded | No | -| `test_RevertsIf_IMXDepositLimitTooLow` | Reverts if the IMX deposit limit is too low | No | ### Withdrawal diff --git a/test/unit/test.json b/test/unit/test.json new file mode 100644 index 00000000..a5549661 --- /dev/null +++ b/test/unit/test.json @@ -0,0 +1,1700 @@ +[ + { + "inputs": [], + "name": "AlreadyMapped", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedBalance", + "type": "uint256" + } + ], + "name": "BalanceInvariantCheckFailed", + "type": "error" + }, + { + "inputs": [], + "name": "CantMapETH", + "type": "error" + }, + { + "inputs": [], + "name": "CantMapIMX", + "type": "error" + }, + { + "inputs": [], + "name": "CantMapWETH", + "type": "error" + }, + { + "inputs": [], + "name": "ImxDepositLimitExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "ImxDepositLimitTooLow", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientValue", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidChildChain", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidChildERC20BridgeAdaptor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidData", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSourceAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSourceChain", + "type": "error" + }, + { + "inputs": [], + "name": "NotBridgeAdaptor", + "type": "error" + }, + { + "inputs": [], + "name": "NotMapped", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAmount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rootToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "childToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ChildChainERC20Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "IMXDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rootToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "childToken", + "type": "address" + } + ], + "name": "L1TokenMapped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rootToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "childToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "NativeEthDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldImxDepositLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newImxDepositLimit", + "type": "uint256" + } + ], + "name": "NewImxDepositLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldRootBridgeAdaptor", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newRootBridgeAdaptor", + "type": "address" + } + ], + "name": "NewRootBridgeAdaptor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rootToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "childToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "withdrawer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RootChainERC20Withdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rootToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "childToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WETHDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "log", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "log_address", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256[]", + "name": "val", + "type": "uint256[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "int256[]", + "name": "val", + "type": "int256[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "val", + "type": "address[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "log_bytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "log_bytes32", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "name": "log_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "address", + "name": "val", + "type": "address" + } + ], + "name": "log_named_address", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "val", + "type": "uint256[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256[]", + "name": "val", + "type": "int256[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "val", + "type": "address[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "val", + "type": "bytes" + } + ], + "name": "log_named_bytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "val", + "type": "bytes32" + } + ], + "name": "log_named_bytes32", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256", + "name": "val", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "name": "log_named_decimal_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "val", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "name": "log_named_decimal_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256", + "name": "val", + "type": "int256" + } + ], + "name": "log_named_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "val", + "type": "string" + } + ], + "name": "log_named_string", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "val", + "type": "uint256" + } + ], + "name": "log_named_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "log_string", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "log_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "logs", + "type": "event" + }, + { + "inputs": [], + "name": "IS_TEST", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAP_TOKEN_SIG", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WITHDRAW_SIG", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "contract RootERC20Bridge", + "name": "rootBridge", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mapTokenFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bool", + "name": "saveTokenMapping", + "type": "bool" + } + ], + "name": "_setupDeposit", + "outputs": [ + { + "internalType": "address", + "name": "childToken", + "type": "address" + }, + { + "internalType": "bytes", + "name": "predictedPayload", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "axelarGasService", + "outputs": [ + { + "internalType": "contract MockAxelarGasService", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "childIntegrationSetup", + "outputs": [ + { + "internalType": "contract ChildERC20Bridge", + "name": "childBridge", + "type": "address" + }, + { + "internalType": "contract ChildAxelarBridgeAdaptor", + "name": "childBridgeAdaptor", + "type": "address" + }, + { + "internalType": "address", + "name": "rootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "rootIMX", + "type": "address" + }, + { + "internalType": "contract ChildERC20", + "name": "childTokenTemplate", + "type": "address" + }, + { + "internalType": "contract MockAxelarGasService", + "name": "axelarGasService", + "type": "address" + }, + { + "internalType": "contract MockAxelarGateway", + "name": "mockAxelarGateway", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "excludeArtifacts", + "outputs": [ + { + "internalType": "string[]", + "name": "excludedArtifacts_", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "excludeContracts", + "outputs": [ + { + "internalType": "address[]", + "name": "excludedContracts_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "excludeSenders", + "outputs": [ + { + "internalType": "address[]", + "name": "excludedSenders_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "failed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "key", + "type": "address" + }, + { + "internalType": "uint256", + "name": "position", + "type": "uint256" + } + ], + "name": "getMappingStorageSlotFor", + "outputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "mockAxelarAdaptor", + "outputs": [ + { + "internalType": "contract MockAdaptor", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mockAxelarGateway", + "outputs": [ + { + "internalType": "contract MockAxelarGateway", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rootBridge", + "outputs": [ + { + "internalType": "contract RootERC20Bridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "childBridge", + "type": "address" + }, + { + "internalType": "address", + "name": "childBridgeAdaptor", + "type": "address" + }, + { + "internalType": "string", + "name": "childBridgeName", + "type": "string" + }, + { + "internalType": "address", + "name": "imxTokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "wethTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "imxCumulativeDepositLimit", + "type": "uint256" + } + ], + "name": "rootIntegrationSetup", + "outputs": [ + { + "internalType": "contract ERC20PresetMinterPauser", + "name": "imxToken", + "type": "address" + }, + { + "internalType": "contract ERC20PresetMinterPauser", + "name": "token", + "type": "address" + }, + { + "internalType": "contract RootERC20Bridge", + "name": "rootBridge", + "type": "address" + }, + { + "internalType": "contract RootAxelarBridgeAdaptor", + "name": "axelarAdaptor", + "type": "address" + }, + { + "internalType": "contract MockAxelarGateway", + "name": "mockAxelarGateway", + "type": "address" + }, + { + "internalType": "contract MockAxelarGasService", + "name": "axelarGasService", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ChildERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "contract ChildERC20Bridge", + "name": "childBridge", + "type": "address" + }, + { + "internalType": "string", + "name": "sourceChain", + "type": "string" + }, + { + "internalType": "string", + "name": "sourceAddress", + "type": "string" + } + ], + "name": "setupChildDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "contract RootERC20Bridge", + "name": "rootBridge", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mapTokenFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "saveTokenMapping", + "type": "bool" + } + ], + "name": "setupDeposit", + "outputs": [ + { + "internalType": "address", + "name": "childToken", + "type": "address" + }, + { + "internalType": "bytes", + "name": "predictedPayload", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "contract RootERC20Bridge", + "name": "rootBridge", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mapTokenFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bool", + "name": "saveTokenMapping", + "type": "bool" + } + ], + "name": "setupDepositTo", + "outputs": [ + { + "internalType": "address", + "name": "childToken", + "type": "address" + }, + { + "internalType": "bytes", + "name": "predictedPayload", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "targetArtifactSelectors", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct StdInvariant.FuzzSelector[]", + "name": "targetedArtifactSelectors_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetArtifacts", + "outputs": [ + { + "internalType": "string[]", + "name": "targetedArtifacts_", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetContracts", + "outputs": [ + { + "internalType": "address[]", + "name": "targetedContracts_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetInterfaces", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "string[]", + "name": "artifacts", + "type": "string[]" + } + ], + "internalType": "struct StdInvariant.FuzzInterface[]", + "name": "targetedInterfaces_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetSelectors", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct StdInvariant.FuzzSelector[]", + "name": "targetedSelectors_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetSenders", + "outputs": [ + { + "internalType": "address[]", + "name": "targetedSenders_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_mapTokenFee", + "type": "uint256" + } + ], + "name": "testFuzz_mapToken_UpdatesEthBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_InitializeBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIfInitializeTwice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_InitializeWithAZeroAddressAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_InitializeWithAZeroAddressChildBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_InitializeWithAZeroAddressIMXToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_InitializeWithAZeroAddressRootAdapter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_InitializeWithAZeroAddressTokenTemplate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_InitializeWithAZeroAddressWETHToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_InitializeWithEmptyChildAdapter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_InitializeWithEmptyChildName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositAmountIsZero", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositCalledWhenTokenApprovalNotProvided", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositCalledWithUnmappedToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositCalledWithZeroAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositETHAmountIsZero", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositETHInsufficientValue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositToAmountIsZero", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositToCalledWhenTokenApprovalNotProvided", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositToCalledWithUnmappedToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositToCalledWithZeroAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositToETHAmountIsZero", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_depositToETHInsufficientValue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_mapTokenCalledTwice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_mapTokenCalledWithETHAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_mapTokenCalledWithIMXAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_mapTokenCalledWithZeroAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_updateRootBridgeAdaptorCalledByNonOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertIf_updateRootBridgeAdaptorCalledWithZeroAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertsIf_IMXDepositLimitExceeded", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_RevertsIf_IMXDepositLimitTooLow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositCallsSendMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositETHCallsSendMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositETHEmitsNativeEthDepositEvent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositEmitsChildChainERC20DepositEvent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositIMXEmitsIMXDepositEvent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositToCallsSendMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositToETHCallsSendMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositToETHEmitsNativeEthDepositEvent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositToEmitsChildChainERC20DepositEvent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositToIMXEmitsIMXDepositEvent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositToTransfersNativeAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositToTransfersTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositToWETHEmitsWETHDepositEvent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositToWETHTransfersTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositTransfersNativeAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositTransfersTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositWETHCallsSendMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositWETHEmitsNativeDepositEvent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_depositWETHTransfersTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_deposit_whenSettingImxDepositLimitToUnlimited", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_mapToken_CallsAdaptor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_mapToken_EmitsTokenMappedEvent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_mapToken_SetsTokenMapping", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_updateRootBridgeAdaptor_EmitsNewRootBridgeAdaptorEvent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "test_updateRootBridgeAdaptor_UpdatesRootBridgeAdaptor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract ERC20PresetMinterPauser", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +]