Module zenith_types::Zenith

source ·
Expand description

Generated by the following Solidity interface…

interface Zenith {
    struct BlockHeader {
        uint256 rollupChainId;
        uint256 hostBlockNumber;
        uint256 gasLimit;
        address rewardAddress;
        bytes32 blockDataHash;
    }

    error BadSignature(address derivedSequencer);
    error IncorrectHostBlock();
    error OneRollupBlockPerHostBlock();
    error OnlySequencerAdmin();

    event BlockSubmitted(address indexed sequencer, uint256 indexed rollupChainId, uint256 gasLimit, address rewardAddress, bytes32 blockDataHash);
    event SequencerSet(address indexed sequencer, bool indexed permissioned);

    constructor(address _sequencerAdmin);

    function addSequencer(address sequencer) external;
    function blockCommitment(BlockHeader memory header) external view returns (bytes32 commit);
    function deployBlockNumber() external view returns (uint256);
    function isSequencer(address) external view returns (bool);
    function lastSubmittedAtBlock(uint256) external view returns (uint256);
    function removeSequencer(address sequencer) external;
    function sequencerAdmin() external view returns (address);
    function submitBlock(BlockHeader memory header, uint8 v, bytes32 r, bytes32 s, bytes memory) external;
}

…which was generated by the following JSON ABI:

[
  {
    "type": "constructor",
    "inputs": [
      {
        "name": "_sequencerAdmin",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "addSequencer",
    "inputs": [
      {
        "name": "sequencer",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "blockCommitment",
    "inputs": [
      {
        "name": "header",
        "type": "tuple",
        "internalType": "struct Zenith.BlockHeader",
        "components": [
          {
            "name": "rollupChainId",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "hostBlockNumber",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "gasLimit",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "rewardAddress",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "blockDataHash",
            "type": "bytes32",
            "internalType": "bytes32"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "commit",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "deployBlockNumber",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "isSequencer",
    "inputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "lastSubmittedAtBlock",
    "inputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "removeSequencer",
    "inputs": [
      {
        "name": "sequencer",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "sequencerAdmin",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "submitBlock",
    "inputs": [
      {
        "name": "header",
        "type": "tuple",
        "internalType": "struct Zenith.BlockHeader",
        "components": [
          {
            "name": "rollupChainId",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "hostBlockNumber",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "gasLimit",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "rewardAddress",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "blockDataHash",
            "type": "bytes32",
            "internalType": "bytes32"
          }
        ]
      },
      {
        "name": "v",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "r",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "s",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "",
        "type": "bytes",
        "internalType": "bytes"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "event",
    "name": "BlockSubmitted",
    "inputs": [
      {
        "name": "sequencer",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "rollupChainId",
        "type": "uint256",
        "indexed": true,
        "internalType": "uint256"
      },
      {
        "name": "gasLimit",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "rewardAddress",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "blockDataHash",
        "type": "bytes32",
        "indexed": false,
        "internalType": "bytes32"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "SequencerSet",
    "inputs": [
      {
        "name": "sequencer",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "permissioned",
        "type": "bool",
        "indexed": true,
        "internalType": "bool"
      }
    ],
    "anonymous": false
  },
  {
    "type": "error",
    "name": "BadSignature",
    "inputs": [
      {
        "name": "derivedSequencer",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "IncorrectHostBlock",
    "inputs": []
  },
  {
    "type": "error",
    "name": "OneRollupBlockPerHostBlock",
    "inputs": []
  },
  {
    "type": "error",
    "name": "OnlySequencerAdmin",
    "inputs": []
  }
]

Structs§

Enums§

Functions§

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