Module ethereum_serai::router::abi

source ·
Expand description

Generated by the following Solidity interface…

interface Router {
    struct Call {
        address to;
        uint256 value;
        bytes data;
    }
    struct OutInstruction {
        address to;
        Call[] calls;
        uint256 value;
    }
    struct Signature {
        bytes32 c;
        bytes32 s;
    }

    error FailedTransfer();
    error InvalidAmount();
    error InvalidKey();
    error InvalidSOrA();
    error InvalidSignature();
    error MalformedSignature();
    error TooManyTransactions();

    event Executed(uint256 indexed nonce, bytes32 indexed batch, uint256 success, Signature signature);
    event InInstruction(address indexed from, address indexed coin, uint256 amount, bytes instruction);
    event SeraiKeyUpdated(uint256 indexed nonce, bytes32 indexed key, Signature signature);

    constructor(bytes32 _seraiKey);

    function execute(OutInstruction[] memory transactions, Signature memory sig) external;
    function inInstruction(address coin, uint256 amount, bytes memory instruction) external payable;
    function nonce() external view returns (uint256);
    function seraiKey() external view returns (bytes32);
    function updateSeraiKey(bytes32 _seraiKey, Signature memory sig) external;
}

…which was generated by the following JSON ABI:

[
  {
    "type": "constructor",
    "inputs": [
      {
        "name": "_seraiKey",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "execute",
    "inputs": [
      {
        "name": "transactions",
        "type": "tuple[]",
        "internalType": "struct Router.OutInstruction[]",
        "components": [
          {
            "name": "to",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "calls",
            "type": "tuple[]",
            "internalType": "struct Call[]",
            "components": [
              {
                "name": "to",
                "type": "address",
                "internalType": "address"
              },
              {
                "name": "value",
                "type": "uint256",
                "internalType": "uint256"
              },
              {
                "name": "data",
                "type": "bytes",
                "internalType": "bytes"
              }
            ]
          },
          {
            "name": "value",
            "type": "uint256",
            "internalType": "uint256"
          }
        ]
      },
      {
        "name": "sig",
        "type": "tuple",
        "internalType": "struct Router.Signature",
        "components": [
          {
            "name": "c",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "s",
            "type": "bytes32",
            "internalType": "bytes32"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "inInstruction",
    "inputs": [
      {
        "name": "coin",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "instruction",
        "type": "bytes",
        "internalType": "bytes"
      }
    ],
    "outputs": [],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "nonce",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "seraiKey",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "updateSeraiKey",
    "inputs": [
      {
        "name": "_seraiKey",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "sig",
        "type": "tuple",
        "internalType": "struct Router.Signature",
        "components": [
          {
            "name": "c",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "s",
            "type": "bytes32",
            "internalType": "bytes32"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "event",
    "name": "Executed",
    "inputs": [
      {
        "name": "nonce",
        "type": "uint256",
        "indexed": true,
        "internalType": "uint256"
      },
      {
        "name": "batch",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "success",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "signature",
        "type": "tuple",
        "indexed": false,
        "internalType": "struct Router.Signature",
        "components": [
          {
            "name": "c",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "s",
            "type": "bytes32",
            "internalType": "bytes32"
          }
        ]
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "InInstruction",
    "inputs": [
      {
        "name": "from",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "coin",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "instruction",
        "type": "bytes",
        "indexed": false,
        "internalType": "bytes"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "SeraiKeyUpdated",
    "inputs": [
      {
        "name": "nonce",
        "type": "uint256",
        "indexed": true,
        "internalType": "uint256"
      },
      {
        "name": "key",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "signature",
        "type": "tuple",
        "indexed": false,
        "internalType": "struct Router.Signature",
        "components": [
          {
            "name": "c",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "s",
            "type": "bytes32",
            "internalType": "bytes32"
          }
        ]
      }
    ],
    "anonymous": false
  },
  {
    "type": "error",
    "name": "FailedTransfer",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InvalidAmount",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InvalidKey",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InvalidSOrA",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InvalidSignature",
    "inputs": []
  },
  {
    "type": "error",
    "name": "MalformedSignature",
    "inputs": []
  },
  {
    "type": "error",
    "name": "TooManyTransactions",
    "inputs": []
  }
]

Structs§

Enums§