gmp

Module Gateway

Source
Expand description

Generated by the following Solidity interface…

interface Gateway {
    type Command is uint8;
    type GmpStatus is uint8;
    struct Batch {
        uint8 version;
        uint64 batchId;
        GatewayOp[] ops;
    }
    struct GasPrice {
        uint64 mantissa;
        int16 exponent;
    }
    struct GatewayOp {
        Command command;
        bytes params;
    }
    struct GmpMessage {
        bytes32 source;
        uint16 srcNetwork;
        address dest;
        uint16 destNetwork;
        uint64 gasLimit;
        uint64 nonce;
        bytes data;
    }
    struct Route {
        uint16 networkId;
        bytes32 gateway;
        uint64 maxGasLimit;
        uint64 msgGas;
        uint64 msgByteGas;
        uint64 gasPriceMantissa;
        int16 gasPriceExponent;
        uint64 msgFee;
    }
    struct Signature {
        uint256 xCoord;
        uint256 e;
        uint256 s;
    }
    struct TssKey {
        uint256 xCoord;
        uint8 yParity;
        uint16 numSessions;
    }

    error AddressEmptyCode(address target);
    error ERC1967InvalidImplementation(address implementation);
    error ERC1967NonPayable();
    error FailedCall();
    error InvalidInitialization();
    error NotInitializing();
    error OwnableInvalidOwner(address owner);
    error OwnableUnauthorizedAccount(address account);
    error UUPSUnauthorizedCallContext();
    error UUPSUnsupportedProxiableUUID(bytes32 slot);

    event BatchExecuted(uint64 batch);
    event GmpCreated(bytes32 indexed id, bytes32 indexed source, address indexed destinationAddress, uint16 destinationNetwork, uint64 gasLimit, uint64 nonce, bytes data);
    event GmpExecuted(bytes32 indexed id, bytes32 indexed source, address indexed dest, GmpStatus status, bytes32 result);
    event Initialized(uint64 version);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event RouteUpdated(uint16 indexed networkId, bytes32 gateway, uint64 maxGasLimit, uint64 msgGas, uint64 msgByteGas, uint64 gasPriceMantissa, int16 gasPriceExponent, uint64 msgFee);
    event ShardRegistered(TssKey key);
    event ShardRevoked(TssKey key);
    event Upgraded(address indexed implementation);

    constructor();

    receive() external payable;

    function UPGRADE_INTERFACE_VERSION() external view returns (string memory);
    function _include_gmp_message(GmpMessage memory) external;
    function admin() external view returns (address);
    function estimateMessageCost(uint16 network, uint256 messageSize, uint64 gasLimit) external view returns (uint256);
    function execute(Signature memory signature, Batch memory batch) external;
    function initialize(uint16 _networkId) external;
    function messages(bytes32) external view returns (GmpStatus);
    function networkId() external view returns (uint16);
    function nonces(address) external view returns (uint64);
    function owner() external view returns (address);
    function proxiableUUID() external view returns (bytes32);
    function renounceOwnership() external;
    function routes() external view returns (Route[] memory);
    function setAdmin(address newAdmin) external payable;
    function setPrices(GasPrice[] memory prices) external;
    function setRoute(Route memory info) external;
    function setShards(TssKey[] memory register, TssKey[] memory revoke) external;
    function shards() external view returns (TssKey[] memory);
    function submitMessage(address destinationAddress, uint16 network, uint64 gasLimit, bytes memory data) external payable returns (bytes32);
    function transferOwnership(address newOwner) external;
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable;
    function withdraw(uint256 amount, address recipient, bytes memory data) external returns (bytes memory output);
}

…which was generated by the following JSON ABI:

[
  {
    "type": "constructor",
    "inputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "receive",
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "UPGRADE_INTERFACE_VERSION",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "string",
        "internalType": "string"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_include_gmp_message",
    "inputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct GmpMessage",
        "components": [
          {
            "name": "source",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "srcNetwork",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "dest",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "destNetwork",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "gasLimit",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "nonce",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "data",
            "type": "bytes",
            "internalType": "bytes"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "admin",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "estimateMessageCost",
    "inputs": [
      {
        "name": "network",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "messageSize",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "gasLimit",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "execute",
    "inputs": [
      {
        "name": "signature",
        "type": "tuple",
        "internalType": "struct Signature",
        "components": [
          {
            "name": "xCoord",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "e",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "s",
            "type": "uint256",
            "internalType": "uint256"
          }
        ]
      },
      {
        "name": "batch",
        "type": "tuple",
        "internalType": "struct Batch",
        "components": [
          {
            "name": "version",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "batchId",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "ops",
            "type": "tuple[]",
            "internalType": "struct GatewayOp[]",
            "components": [
              {
                "name": "command",
                "type": "uint8",
                "internalType": "enum Command"
              },
              {
                "name": "params",
                "type": "bytes",
                "internalType": "bytes"
              }
            ]
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "initialize",
    "inputs": [
      {
        "name": "_networkId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "messages",
    "inputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint8",
        "internalType": "enum GmpStatus"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "networkId",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint16",
        "internalType": "uint16"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "nonces",
    "inputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "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": "renounceOwnership",
    "inputs": [],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "routes",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "tuple[]",
        "internalType": "struct Route[]",
        "components": [
          {
            "name": "networkId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "gateway",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "maxGasLimit",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "msgGas",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "msgByteGas",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "gasPriceMantissa",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "gasPriceExponent",
            "type": "int16",
            "internalType": "int16"
          },
          {
            "name": "msgFee",
            "type": "uint64",
            "internalType": "uint64"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "setAdmin",
    "inputs": [
      {
        "name": "newAdmin",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "setPrices",
    "inputs": [
      {
        "name": "prices",
        "type": "tuple[]",
        "internalType": "struct GasPrice[]",
        "components": [
          {
            "name": "mantissa",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "exponent",
            "type": "int16",
            "internalType": "int16"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setRoute",
    "inputs": [
      {
        "name": "info",
        "type": "tuple",
        "internalType": "struct Route",
        "components": [
          {
            "name": "networkId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "gateway",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "maxGasLimit",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "msgGas",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "msgByteGas",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "gasPriceMantissa",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "gasPriceExponent",
            "type": "int16",
            "internalType": "int16"
          },
          {
            "name": "msgFee",
            "type": "uint64",
            "internalType": "uint64"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setShards",
    "inputs": [
      {
        "name": "register",
        "type": "tuple[]",
        "internalType": "struct TssKey[]",
        "components": [
          {
            "name": "xCoord",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "yParity",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "numSessions",
            "type": "uint16",
            "internalType": "uint16"
          }
        ]
      },
      {
        "name": "revoke",
        "type": "tuple[]",
        "internalType": "struct TssKey[]",
        "components": [
          {
            "name": "xCoord",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "yParity",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "numSessions",
            "type": "uint16",
            "internalType": "uint16"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "shards",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "tuple[]",
        "internalType": "struct TssKey[]",
        "components": [
          {
            "name": "xCoord",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "yParity",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "numSessions",
            "type": "uint16",
            "internalType": "uint16"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "submitMessage",
    "inputs": [
      {
        "name": "destinationAddress",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "network",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "gasLimit",
        "type": "uint64",
        "internalType": "uint64"
      },
      {
        "name": "data",
        "type": "bytes",
        "internalType": "bytes"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "transferOwnership",
    "inputs": [
      {
        "name": "newOwner",
        "type": "address",
        "internalType": "address"
      }
    ],
    "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": "withdraw",
    "inputs": [
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "recipient",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "data",
        "type": "bytes",
        "internalType": "bytes"
      }
    ],
    "outputs": [
      {
        "name": "output",
        "type": "bytes",
        "internalType": "bytes"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "event",
    "name": "BatchExecuted",
    "inputs": [
      {
        "name": "batch",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "GmpCreated",
    "inputs": [
      {
        "name": "id",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "source",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "destinationAddress",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "destinationNetwork",
        "type": "uint16",
        "indexed": false,
        "internalType": "uint16"
      },
      {
        "name": "gasLimit",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      },
      {
        "name": "nonce",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      },
      {
        "name": "data",
        "type": "bytes",
        "indexed": false,
        "internalType": "bytes"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "GmpExecuted",
    "inputs": [
      {
        "name": "id",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "source",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "dest",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "status",
        "type": "uint8",
        "indexed": false,
        "internalType": "enum GmpStatus"
      },
      {
        "name": "result",
        "type": "bytes32",
        "indexed": false,
        "internalType": "bytes32"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Initialized",
    "inputs": [
      {
        "name": "version",
        "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": "RouteUpdated",
    "inputs": [
      {
        "name": "networkId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "gateway",
        "type": "bytes32",
        "indexed": false,
        "internalType": "bytes32"
      },
      {
        "name": "maxGasLimit",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      },
      {
        "name": "msgGas",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      },
      {
        "name": "msgByteGas",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      },
      {
        "name": "gasPriceMantissa",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      },
      {
        "name": "gasPriceExponent",
        "type": "int16",
        "indexed": false,
        "internalType": "int16"
      },
      {
        "name": "msgFee",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "ShardRegistered",
    "inputs": [
      {
        "name": "key",
        "type": "tuple",
        "indexed": false,
        "internalType": "struct TssKey",
        "components": [
          {
            "name": "xCoord",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "yParity",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "numSessions",
            "type": "uint16",
            "internalType": "uint16"
          }
        ]
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "ShardRevoked",
    "inputs": [
      {
        "name": "key",
        "type": "tuple",
        "indexed": false,
        "internalType": "struct TssKey",
        "components": [
          {
            "name": "xCoord",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "yParity",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "numSessions",
            "type": "uint16",
            "internalType": "uint16"
          }
        ]
      }
    ],
    "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": "FailedCall",
    "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": "UUPSUnauthorizedCallContext",
    "inputs": []
  },
  {
    "type": "error",
    "name": "UUPSUnsupportedProxiableUUID",
    "inputs": [
      {
        "name": "slot",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  }
]

Structs§

Enums§

Statics§

  • The creation / init bytecode of the contract.
  • The runtime bytecode of the contract, as deployed on the network.