Module EthBridgeConfig

Source
Expand description

Generated by the following Solidity interface…

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

interface EthBridgeConfig {
    error AddressEmptyCode(address target);
    error ERC1967InvalidImplementation(address implementation);
    error ERC1967NonPayable();
    error FailedInnerCall();
    error InvalidInitialization();
    error NotInitializing();
    error ReentrancyGuardReentrantCall();
    error UUPSUnauthorizedCallContext();
    error UUPSUnsupportedProxiableUUID(bytes32 slot);

    event ContractUpgraded(uint256 nonce, address proxy, address implementation);
    event Initialized(uint64 version);
    event TokenAdded(uint8 tokenID, address tokenAddress, uint8 suiDecimal, uint64 tokenPrice);
    event TokenPriceUpdated(uint8 tokenID, uint64 tokenPrice);
    event TokenPriceUpdatedV2(uint64 nonce, uint8 tokenID, uint64 tokenPrice);
    event TokensAddedV2(uint64 nonce, uint8[] tokenIDs, address[] tokenAddresses, uint8[] suiDecimals, uint64[] tokenPrices);
    event Upgraded(address indexed implementation);

    function UPGRADE_INTERFACE_VERSION() external view returns (string memory);
    function addTokensWithSignatures(bytes[] memory signatures, BridgeUtils.Message memory message) external;
    function chainID() external view returns (uint8);
    function committee() external view returns (address);
    function initialize(address _committee, uint8 _chainID, address[] memory _supportedTokens, uint64[] memory _tokenPrices, uint8[] memory _supportedChains) external;
    function isChainSupported(uint8 chainId) external view returns (bool);
    function isTokenSupported(uint8 tokenID) external view returns (bool);
    function nonces(uint8 messageType) external view returns (uint64 nonce);
    function proxiableUUID() external view returns (bytes32);
    function supportedChains(uint8 chainId) external view returns (bool isSupported);
    function supportedTokens(uint8 tokenID) external view returns (address tokenAddress, uint8 suiDecimal, bool native);
    function tokenAddressOf(uint8 tokenID) external view returns (address);
    function tokenPriceOf(uint8 tokenID) external view returns (uint64);
    function tokenPrices(uint8 tokenID) external view returns (uint64 tokenPrice);
    function tokenSuiDecimalOf(uint8 tokenID) external view returns (uint8);
    function updateTokenPriceWithSignatures(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;
}

…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": "addTokensWithSignatures",
    "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": "chainID",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "committee",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IBridgeCommittee"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "initialize",
    "inputs": [
      {
        "name": "_committee",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_chainID",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "_supportedTokens",
        "type": "address[]",
        "internalType": "address[]"
      },
      {
        "name": "_tokenPrices",
        "type": "uint64[]",
        "internalType": "uint64[]"
      },
      {
        "name": "_supportedChains",
        "type": "uint8[]",
        "internalType": "uint8[]"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "isChainSupported",
    "inputs": [
      {
        "name": "chainId",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "isTokenSupported",
    "inputs": [
      {
        "name": "tokenID",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "nonces",
    "inputs": [
      {
        "name": "messageType",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "nonce",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "proxiableUUID",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "supportedChains",
    "inputs": [
      {
        "name": "chainId",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "isSupported",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "supportedTokens",
    "inputs": [
      {
        "name": "tokenID",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "tokenAddress",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "suiDecimal",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "native",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "tokenAddressOf",
    "inputs": [
      {
        "name": "tokenID",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "tokenPriceOf",
    "inputs": [
      {
        "name": "tokenID",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "tokenPrices",
    "inputs": [
      {
        "name": "tokenID",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "tokenPrice",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "tokenSuiDecimalOf",
    "inputs": [
      {
        "name": "tokenID",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "updateTokenPriceWithSignatures",
    "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": "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": "Initialized",
    "inputs": [
      {
        "name": "version",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "TokenAdded",
    "inputs": [
      {
        "name": "tokenID",
        "type": "uint8",
        "indexed": false,
        "internalType": "uint8"
      },
      {
        "name": "tokenAddress",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "suiDecimal",
        "type": "uint8",
        "indexed": false,
        "internalType": "uint8"
      },
      {
        "name": "tokenPrice",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "TokenPriceUpdated",
    "inputs": [
      {
        "name": "tokenID",
        "type": "uint8",
        "indexed": false,
        "internalType": "uint8"
      },
      {
        "name": "tokenPrice",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "TokenPriceUpdatedV2",
    "inputs": [
      {
        "name": "nonce",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      },
      {
        "name": "tokenID",
        "type": "uint8",
        "indexed": false,
        "internalType": "uint8"
      },
      {
        "name": "tokenPrice",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "TokensAddedV2",
    "inputs": [
      {
        "name": "nonce",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      },
      {
        "name": "tokenIDs",
        "type": "uint8[]",
        "indexed": false,
        "internalType": "uint8[]"
      },
      {
        "name": "tokenAddresses",
        "type": "address[]",
        "indexed": false,
        "internalType": "address[]"
      },
      {
        "name": "suiDecimals",
        "type": "uint8[]",
        "indexed": false,
        "internalType": "uint8[]"
      },
      {
        "name": "tokenPrices",
        "type": "uint64[]",
        "indexed": false,
        "internalType": "uint64[]"
      }
    ],
    "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": "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.
EthBridgeConfigInstance
A EthBridgeConfig instance.
FailedInnerCall
Custom error with signature FailedInnerCall() and selector 0x1425ea42.
Initialized
Event with signature Initialized(uint64) and selector 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2.
InvalidInitialization
Custom error with signature InvalidInitialization() and selector 0xf92ee8a9.
NotInitializing
Custom error with signature NotInitializing() and selector 0xd7e6bcf8.
ReentrancyGuardReentrantCall
Custom error with signature ReentrancyGuardReentrantCall() and selector 0x3ee5aeb5.
TokenAdded
Event with signature TokenAdded(uint8,address,uint8,uint64) and selector 0xa7e991a720243e0c1b8072c6972f6102e2609ab05652b7f7201eda2fe2319a5c.
TokenPriceUpdated
Event with signature TokenPriceUpdated(uint8,uint64) and selector 0x63c7b0537430440067accde2f4ff8d60cfb1ff84ad16fd272394102f9cd052d0.
TokenPriceUpdatedV2
Event with signature TokenPriceUpdatedV2(uint64,uint8,uint64) and selector 0xe89f01f7a3c23e3a6667361b69793ec8e62800df987fae26a83313f61730ad87.
TokensAddedV2
Event with signature TokensAddedV2(uint64,uint8[],address[],uint8[],uint64[]) and selector 0xa8c9f6401ba814ab2ccd92aaaf0ee583418ce404d9b20a70188e76fd74e59c70.
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.
addTokensWithSignaturesCall
Function with signature addTokensWithSignatures(bytes[],(uint8,uint8,uint64,uint8,bytes)) and selector 0x43025664.
addTokensWithSignaturesReturn
Container type for the return parameters of the addTokensWithSignatures(bytes[],(uint8,uint8,uint64,uint8,bytes)) function.
chainIDCall
Function with signature chainID() and selector 0xadc879e9.
chainIDReturn
Container type for the return parameters of the chainID() function.
committeeCall
Function with signature committee() and selector 0xd864e740.
committeeReturn
Container type for the return parameters of the committee() function.
initializeCall
Function with signature initialize(address,uint8,address[],uint64[],uint8[]) and selector 0xdcb09117.
initializeReturn
Container type for the return parameters of the initialize(address,uint8,address[],uint64[],uint8[]) function.
isChainSupportedCall
Function with signature isChainSupported(uint8) and selector 0x73209533.
isChainSupportedReturn
Container type for the return parameters of the isChainSupported(uint8) function.
isTokenSupportedCall
Function with signature isTokenSupported(uint8) and selector 0x438cb46a.
isTokenSupportedReturn
Container type for the return parameters of the isTokenSupported(uint8) function.
noncesCall
Function with signature nonces(uint8) and selector 0x5035bda2.
noncesReturn
Container type for the return parameters of the nonces(uint8) function.
proxiableUUIDCall
Function with signature proxiableUUID() and selector 0x52d1902d.
proxiableUUIDReturn
Container type for the return parameters of the proxiableUUID() function.
supportedChainsCall
Function with signature supportedChains(uint8) and selector 0x7b099ce5.
supportedChainsReturn
Container type for the return parameters of the supportedChains(uint8) function.
supportedTokensCall
Function with signature supportedTokens(uint8) and selector 0x3f572d36.
supportedTokensReturn
Container type for the return parameters of the supportedTokens(uint8) function.
tokenAddressOfCall
Function with signature tokenAddressOf(uint8) and selector 0xe5324889.
tokenAddressOfReturn
Container type for the return parameters of the tokenAddressOf(uint8) function.
tokenPriceOfCall
Function with signature tokenPriceOf(uint8) and selector 0xdfc3db3d.
tokenPriceOfReturn
Container type for the return parameters of the tokenPriceOf(uint8) function.
tokenPricesCall
Function with signature tokenPrices(uint8) and selector 0xdeceafa7.
tokenPricesReturn
Container type for the return parameters of the tokenPrices(uint8) function.
tokenSuiDecimalOfCall
Function with signature tokenSuiDecimalOf(uint8) and selector 0x71ceee4f.
tokenSuiDecimalOfReturn
Container type for the return parameters of the tokenSuiDecimalOf(uint8) function.
updateTokenPriceWithSignaturesCall
Function with signature updateTokenPriceWithSignatures(bytes[],(uint8,uint8,uint64,uint8,bytes)) and selector 0xbfb5d846.
updateTokenPriceWithSignaturesReturn
Container type for the return parameters of the updateTokenPriceWithSignatures(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.

Enums§

EthBridgeConfigCalls
Container for all the EthBridgeConfig function calls.
EthBridgeConfigErrors
Container for all the EthBridgeConfig custom errors.
EthBridgeConfigEvents
Container for all the EthBridgeConfig events.

Functions§

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