Module EthBridgeLimiter

Source
Expand description

Generated by the following Solidity interface…

library BridgeUtils {
    struct Message {
        uint8 messageType;
        uint8 version;
        uint64 nonce;
        uint8 chainID;
        bytes payload;
    }
}

interface EthBridgeLimiter {
    error AddressEmptyCode(address target);
    error ERC1967InvalidImplementation(address implementation);
    error ERC1967NonPayable();
    error FailedInnerCall();
    error InvalidInitialization();
    error NotInitializing();
    error OwnableInvalidOwner(address owner);
    error OwnableUnauthorizedAccount(address account);
    error ReentrancyGuardReentrantCall();
    error UUPSUnauthorizedCallContext();
    error UUPSUnsupportedProxiableUUID(bytes32 slot);

    event ContractUpgraded(uint256 nonce, address proxy, address implementation);
    event HourlyTransferAmountUpdated(uint32 hourUpdated, uint256 amount);
    event Initialized(uint64 version);
    event LimitUpdated(uint8 sourceChainID, uint64 newLimit);
    event LimitUpdatedV2(uint64 nonce, uint8 sourceChainID, uint64 newLimit);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event Upgraded(address indexed implementation);

    function UPGRADE_INTERFACE_VERSION() external view returns (string memory);
    function calculateAmountInUSD(uint8 tokenID, uint256 amount) external view returns (uint256);
    function calculateWindowAmount(uint8 chainID) external view returns (uint256 total);
    function chainHourlyTransferAmount(uint256 chainHourTimestamp) external view returns (uint256 totalAmountBridged);
    function chainLimits(uint8 chainID) external view returns (uint64 totalLimit);
    function committee() external view returns (address);
    function currentHour() external view returns (uint32);
    function getChainHourTimestampKey(uint8 chainID, uint32 hourTimestamp) external pure returns (uint256);
    function initialize(address _committee, uint8[] memory chainIDs, uint64[] memory _totalLimits) external;
    function nonces(uint8 messageType) external view returns (uint64 nonce);
    function oldestChainTimestamp(uint8 chainID) external view returns (uint32 oldestHourTimestamp);
    function owner() external view returns (address);
    function proxiableUUID() external view returns (bytes32);
    function recordBridgeTransfers(uint8 chainID, uint8 tokenID, uint256 amount) external;
    function renounceOwnership() external;
    function transferOwnership(address newOwner) external;
    function updateLimitWithSignatures(bytes[] memory signatures, BridgeUtils.Message memory message) external;
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable;
    function upgradeWithSignatures(bytes[] memory signatures, BridgeUtils.Message memory message) external;
    function willAmountExceedLimit(uint8 chainID, uint8 tokenID, uint256 amount) external view returns (bool);
    function willUSDAmountExceedLimit(uint8 chainID, uint256 amount) external view returns (bool);
}

…which was generated by the following JSON ABI:

[
  {
    "type": "function",
    "name": "UPGRADE_INTERFACE_VERSION",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "string",
        "internalType": "string"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "calculateAmountInUSD",
    "inputs": [
      {
        "name": "tokenID",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "calculateWindowAmount",
    "inputs": [
      {
        "name": "chainID",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "total",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "chainHourlyTransferAmount",
    "inputs": [
      {
        "name": "chainHourTimestamp",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "totalAmountBridged",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "chainLimits",
    "inputs": [
      {
        "name": "chainID",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "totalLimit",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "committee",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IBridgeCommittee"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "currentHour",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint32",
        "internalType": "uint32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getChainHourTimestampKey",
    "inputs": [
      {
        "name": "chainID",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "hourTimestamp",
        "type": "uint32",
        "internalType": "uint32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "pure"
  },
  {
    "type": "function",
    "name": "initialize",
    "inputs": [
      {
        "name": "_committee",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "chainIDs",
        "type": "uint8[]",
        "internalType": "uint8[]"
      },
      {
        "name": "_totalLimits",
        "type": "uint64[]",
        "internalType": "uint64[]"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "nonces",
    "inputs": [
      {
        "name": "messageType",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "nonce",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "oldestChainTimestamp",
    "inputs": [
      {
        "name": "chainID",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "oldestHourTimestamp",
        "type": "uint32",
        "internalType": "uint32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "owner",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "proxiableUUID",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "recordBridgeTransfers",
    "inputs": [
      {
        "name": "chainID",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "tokenID",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "renounceOwnership",
    "inputs": [],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "transferOwnership",
    "inputs": [
      {
        "name": "newOwner",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "updateLimitWithSignatures",
    "inputs": [
      {
        "name": "signatures",
        "type": "bytes[]",
        "internalType": "bytes[]"
      },
      {
        "name": "message",
        "type": "tuple",
        "internalType": "struct BridgeUtils.Message",
        "components": [
          {
            "name": "messageType",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "version",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "nonce",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "chainID",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "payload",
            "type": "bytes",
            "internalType": "bytes"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "upgradeToAndCall",
    "inputs": [
      {
        "name": "newImplementation",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "data",
        "type": "bytes",
        "internalType": "bytes"
      }
    ],
    "outputs": [],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "upgradeWithSignatures",
    "inputs": [
      {
        "name": "signatures",
        "type": "bytes[]",
        "internalType": "bytes[]"
      },
      {
        "name": "message",
        "type": "tuple",
        "internalType": "struct BridgeUtils.Message",
        "components": [
          {
            "name": "messageType",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "version",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "nonce",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "chainID",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "payload",
            "type": "bytes",
            "internalType": "bytes"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "willAmountExceedLimit",
    "inputs": [
      {
        "name": "chainID",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "tokenID",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "willUSDAmountExceedLimit",
    "inputs": [
      {
        "name": "chainID",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "event",
    "name": "ContractUpgraded",
    "inputs": [
      {
        "name": "nonce",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "proxy",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "implementation",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "HourlyTransferAmountUpdated",
    "inputs": [
      {
        "name": "hourUpdated",
        "type": "uint32",
        "indexed": false,
        "internalType": "uint32"
      },
      {
        "name": "amount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Initialized",
    "inputs": [
      {
        "name": "version",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "LimitUpdated",
    "inputs": [
      {
        "name": "sourceChainID",
        "type": "uint8",
        "indexed": false,
        "internalType": "uint8"
      },
      {
        "name": "newLimit",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "LimitUpdatedV2",
    "inputs": [
      {
        "name": "nonce",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      },
      {
        "name": "sourceChainID",
        "type": "uint8",
        "indexed": false,
        "internalType": "uint8"
      },
      {
        "name": "newLimit",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "OwnershipTransferred",
    "inputs": [
      {
        "name": "previousOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "newOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Upgraded",
    "inputs": [
      {
        "name": "implementation",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "error",
    "name": "AddressEmptyCode",
    "inputs": [
      {
        "name": "target",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "ERC1967InvalidImplementation",
    "inputs": [
      {
        "name": "implementation",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "ERC1967NonPayable",
    "inputs": []
  },
  {
    "type": "error",
    "name": "FailedInnerCall",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InvalidInitialization",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NotInitializing",
    "inputs": []
  },
  {
    "type": "error",
    "name": "OwnableInvalidOwner",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "OwnableUnauthorizedAccount",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "ReentrancyGuardReentrantCall",
    "inputs": []
  },
  {
    "type": "error",
    "name": "UUPSUnauthorizedCallContext",
    "inputs": []
  },
  {
    "type": "error",
    "name": "UUPSUnsupportedProxiableUUID",
    "inputs": [
      {
        "name": "slot",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  }
]

Structs§

AddressEmptyCode
Custom error with signature AddressEmptyCode(address) and selector 0x9996b315.
ContractUpgraded
Event with signature ContractUpgraded(uint256,address,address) and selector 0xdc69b57038334451ee12fd1742228917cea7f40dbd33cda5162e7e5754acee1c.
ERC1967InvalidImplementation
Custom error with signature ERC1967InvalidImplementation(address) and selector 0x4c9c8ce3.
ERC1967NonPayable
Custom error with signature ERC1967NonPayable() and selector 0xb398979f.
EthBridgeLimiterInstance
A EthBridgeLimiter instance.
FailedInnerCall
Custom error with signature FailedInnerCall() and selector 0x1425ea42.
HourlyTransferAmountUpdated
Event with signature HourlyTransferAmountUpdated(uint32,uint256) and selector 0x1c67469b467f869771dcc2fb28419e0225fff93861a184775e7af2fd916eef55.
Initialized
Event with signature Initialized(uint64) and selector 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2.
InvalidInitialization
Custom error with signature InvalidInitialization() and selector 0xf92ee8a9.
LimitUpdated
Event with signature LimitUpdated(uint8,uint64) and selector 0x2266d5ea4551f9e8a7c1ffe1c87131985d16d31b1ca809656328b4e19ec2b0f8.
LimitUpdatedV2
Event with signature LimitUpdatedV2(uint64,uint8,uint64) and selector 0x253425292723148e4239ef77c5a481d0351c3440eaee94112b541e71a3754599.
NotInitializing
Custom error with signature NotInitializing() and selector 0xd7e6bcf8.
OwnableInvalidOwner
Custom error with signature OwnableInvalidOwner(address) and selector 0x1e4fbdf7.
OwnableUnauthorizedAccount
Custom error with signature OwnableUnauthorizedAccount(address) and selector 0x118cdaa7.
OwnershipTransferred
Event with signature OwnershipTransferred(address,address) and selector 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
ReentrancyGuardReentrantCall
Custom error with signature ReentrancyGuardReentrantCall() and selector 0x3ee5aeb5.
UPGRADE_INTERFACE_VERSIONCall
Function with signature UPGRADE_INTERFACE_VERSION() and selector 0xad3cb1cc.
UPGRADE_INTERFACE_VERSIONReturn
Container type for the return parameters of the UPGRADE_INTERFACE_VERSION() function.
UUPSUnauthorizedCallContext
Custom error with signature UUPSUnauthorizedCallContext() and selector 0xe07c8dba.
UUPSUnsupportedProxiableUUID
Custom error with signature UUPSUnsupportedProxiableUUID(bytes32) and selector 0xaa1d49a4.
Upgraded
Event with signature Upgraded(address) and selector 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b.
calculateAmountInUSDCall
Function with signature calculateAmountInUSD(uint8,uint256) and selector 0xe6b04b9f.
calculateAmountInUSDReturn
Container type for the return parameters of the calculateAmountInUSD(uint8,uint256) function.
calculateWindowAmountCall
Function with signature calculateWindowAmount(uint8) and selector 0xc6b478dd.
calculateWindowAmountReturn
Container type for the return parameters of the calculateWindowAmount(uint8) function.
chainHourlyTransferAmountCall
Function with signature chainHourlyTransferAmount(uint256) and selector 0x9056e153.
chainHourlyTransferAmountReturn
Container type for the return parameters of the chainHourlyTransferAmount(uint256) function.
chainLimitsCall
Function with signature chainLimits(uint8) and selector 0x2c4535af.
chainLimitsReturn
Container type for the return parameters of the chainLimits(uint8) function.
committeeCall
Function with signature committee() and selector 0xd864e740.
committeeReturn
Container type for the return parameters of the committee() function.
currentHourCall
Function with signature currentHour() and selector 0x020e185d.
currentHourReturn
Container type for the return parameters of the currentHour() function.
getChainHourTimestampKeyCall
Function with signature getChainHourTimestampKey(uint8,uint32) and selector 0x085714c5.
getChainHourTimestampKeyReturn
Container type for the return parameters of the getChainHourTimestampKey(uint8,uint32) function.
initializeCall
Function with signature initialize(address,uint8[],uint64[]) and selector 0x43a5f2bc.
initializeReturn
Container type for the return parameters of the initialize(address,uint8[],uint64[]) function.
noncesCall
Function with signature nonces(uint8) and selector 0x5035bda2.
noncesReturn
Container type for the return parameters of the nonces(uint8) function.
oldestChainTimestampCall
Function with signature oldestChainTimestamp(uint8) and selector 0x795334ad.
oldestChainTimestampReturn
Container type for the return parameters of the oldestChainTimestamp(uint8) function.
ownerCall
Function with signature owner() and selector 0x8da5cb5b.
ownerReturn
Container type for the return parameters of the owner() function.
proxiableUUIDCall
Function with signature proxiableUUID() and selector 0x52d1902d.
proxiableUUIDReturn
Container type for the return parameters of the proxiableUUID() function.
recordBridgeTransfersCall
Function with signature recordBridgeTransfers(uint8,uint8,uint256) and selector 0x9373d391.
recordBridgeTransfersReturn
Container type for the return parameters of the recordBridgeTransfers(uint8,uint8,uint256) function.
renounceOwnershipCall
Function with signature renounceOwnership() and selector 0x715018a6.
renounceOwnershipReturn
Container type for the return parameters of the renounceOwnership() function.
transferOwnershipCall
Function with signature transferOwnership(address) and selector 0xf2fde38b.
transferOwnershipReturn
Container type for the return parameters of the transferOwnership(address) function.
updateLimitWithSignaturesCall
Function with signature updateLimitWithSignatures(bytes[],(uint8,uint8,uint64,uint8,bytes)) and selector 0x97c39b13.
updateLimitWithSignaturesReturn
Container type for the return parameters of the updateLimitWithSignatures(bytes[],(uint8,uint8,uint64,uint8,bytes)) function.
upgradeToAndCallCall
Function with signature upgradeToAndCall(address,bytes) and selector 0x4f1ef286.
upgradeToAndCallReturn
Container type for the return parameters of the upgradeToAndCall(address,bytes) function.
upgradeWithSignaturesCall
Function with signature upgradeWithSignatures(bytes[],(uint8,uint8,uint64,uint8,bytes)) and selector 0xfa72a6d0.
upgradeWithSignaturesReturn
Container type for the return parameters of the upgradeWithSignatures(bytes[],(uint8,uint8,uint64,uint8,bytes)) function.
willAmountExceedLimitCall
Function with signature willAmountExceedLimit(uint8,uint8,uint256) and selector 0xf7857a19.
willAmountExceedLimitReturn
Container type for the return parameters of the willAmountExceedLimit(uint8,uint8,uint256) function.
willUSDAmountExceedLimitCall
Function with signature willUSDAmountExceedLimit(uint8,uint256) and selector 0x4f46cba7.
willUSDAmountExceedLimitReturn
Container type for the return parameters of the willUSDAmountExceedLimit(uint8,uint256) function.

Enums§

EthBridgeLimiterCalls
Container for all the EthBridgeLimiter function calls.
EthBridgeLimiterErrors
Container for all the EthBridgeLimiter custom errors.
EthBridgeLimiterEvents
Container for all the EthBridgeLimiter events.

Functions§

new
Creates a new wrapper around an on-chain EthBridgeLimiter contract instance.