Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 27,588 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Submit Block | 3139582 | 12 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139582 | 12 hrs ago | IN | 0 ETH | 0.00000002 | ||||
Submit Block | 3139582 | 12 hrs ago | IN | 0 ETH | 0.00000002 | ||||
Submit Block | 3139575 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139575 | 13 hrs ago | IN | 0 ETH | 0.00000002 | ||||
Submit Block | 3139568 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139563 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139557 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139557 | 13 hrs ago | IN | 0 ETH | 0.00000002 | ||||
Submit Block | 3139557 | 13 hrs ago | IN | 0 ETH | 0.00000002 | ||||
Submit Block | 3139557 | 13 hrs ago | IN | 0 ETH | 0.00000002 | ||||
Submit Block | 3139548 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139542 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139537 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139531 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139526 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139526 | 13 hrs ago | IN | 0 ETH | 0.00000002 | ||||
Submit Block | 3139519 | 13 hrs ago | IN | 0 ETH | 0.00000004 | ||||
Submit Block | 3139519 | 13 hrs ago | IN | 0 ETH | 0.00000002 | ||||
Submit Block | 3139513 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139507 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139500 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139494 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139489 | 13 hrs ago | IN | 0 ETH | 0.00000003 | ||||
Submit Block | 3139482 | 13 hrs ago | IN | 0 ETH | 0.00000003 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Zenith
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity 0.8.26; contract Zenith { /// @notice The address that is allowed to set/remove sequencers. address public immutable sequencerAdmin; /// @notice The block number at which the Zenith contract was deployed. uint256 public deployBlockNumber; /// @notice Block header information for the rollup block, signed by the sequencer. /// @param rollupChainId - the chainId of the rollup chain. Any chainId is accepted by the contract. /// @param hostBlockNumber - the host block number in which the rollup block must be submitted. Enforced by the contract. /// @param gasLimit - the gas limit for the rollup block. Ignored by the contract; enforced by the Node. /// @param rewardAddress - the address to receive the rollup block reward. Ignored by the contract; enforced by the Node. /// @param blockDataHash - keccak256(rlp-encoded transactions). the Node will discard the block if the hash doens't match. /// this allows the sequencer to sign over finalized set of transactions, /// without the Zenith contract needing to interact with raw transaction data (which may be provided via blobs or calldata). struct BlockHeader { uint256 rollupChainId; uint256 hostBlockNumber; uint256 gasLimit; address rewardAddress; bytes32 blockDataHash; } /// @notice The host block number that a block was last submitted at for a given rollup chainId. /// rollupChainId => host blockNumber that block was last submitted at mapping(uint256 => uint256) public lastSubmittedAtBlock; /// @notice Registry of permissioned sequencers. /// address => TRUE if it's a permissioned sequencer mapping(address => bool) public isSequencer; /// @notice Thrown when a block submission is attempted in the incorrect host block. error IncorrectHostBlock(); /// @notice Thrown when a block submission is attempted with a signature by a non-permissioned sequencer, /// OR when signature is produced over different block header than is provided. /// @param derivedSequencer - the derived signer of the block header that is not a permissioned sequencer. error BadSignature(address derivedSequencer); /// @notice Thrown when attempting to submit more than one rollup block per host block error OneRollupBlockPerHostBlock(); /// @notice Thrown when attempting to modify sequencer roles if not sequencerAdmin. error OnlySequencerAdmin(); /// @notice Emitted when a new rollup block is successfully submitted. /// @param sequencer - the address of the sequencer that signed the block. /// @param rollupChainId - the chainId of the rollup chain. /// @param gasLimit - the gas limit for the rollup block. /// @param rewardAddress - the address to receive the rollup block reward. /// @param blockDataHash - keccak256(rlp-encoded transactions). the Node will discard the block if the hash doens't match transactions provided. /// @dev including blockDataHash allows the sequencer to sign over finalized block data, without needing to calldatacopy the `blockData` param. event BlockSubmitted( address indexed sequencer, uint256 indexed rollupChainId, uint256 gasLimit, address rewardAddress, bytes32 blockDataHash ); /// @notice Emitted when a sequencer is added or removed. event SequencerSet(address indexed sequencer, bool indexed permissioned); constructor(address _sequencerAdmin) { sequencerAdmin = _sequencerAdmin; deployBlockNumber = block.number; } /// @notice Add a sequencer to the permissioned sequencer list. /// @param sequencer - the address of the sequencer to add. /// @custom:emits SequencerSet if the sequencer is added. /// @custom:reverts OnlySequencerAdmin if the caller is not the sequencerAdmin. function addSequencer(address sequencer) external { if (msg.sender != sequencerAdmin) revert OnlySequencerAdmin(); if (isSequencer[sequencer]) return; isSequencer[sequencer] = true; emit SequencerSet(sequencer, true); } /// @notice Remove a sequencer from the permissioned sequencer list. /// @param sequencer - the address of the sequencer to remove. /// @custom:emits SequencerSet if the sequencer is removed. /// @custom:reverts OnlySequencerAdmin if the caller is not the sequencerAdmin. function removeSequencer(address sequencer) external { if (msg.sender != sequencerAdmin) revert OnlySequencerAdmin(); if (!isSequencer[sequencer]) return; delete isSequencer[sequencer]; emit SequencerSet(sequencer, false); } /// @notice Submit a rollup block. /// @dev Blocks are submitted by Builders, with an attestation to the block signed by a Sequencer. /// @param header - the header information for the rollup block. /// @param v - the v component of the Sequencer's ECSDA signature over the block header. /// @param r - the r component of the Sequencer's ECSDA signature over the block header. /// @param s - the s component of the Sequencer's ECSDA signature over the block header. /// @custom:reverts IncorrectHostBlock if the hostBlockNumber does not match the current block. /// @custom:reverts BadSignature if the signer is not a permissioned sequencer, /// OR if the signature provided commits to a different header. /// @custom:reverts OneRollupBlockPerHostBlock if attempting to submit a second rollup block within one host block. /// @custom:emits BlockSubmitted if the block is successfully submitted. function submitBlock(BlockHeader memory header, uint8 v, bytes32 r, bytes32 s, bytes calldata) external { // assert that the host block number matches the current block if (block.number != header.hostBlockNumber) revert IncorrectHostBlock(); // derive sequencer from signature over block header bytes32 blockCommit = blockCommitment(header); address sequencer = ecrecover(blockCommit, v, r, s); // assert that signature is valid && sequencer is permissioned if (sequencer == address(0) || !isSequencer[sequencer]) revert BadSignature(sequencer); // assert this is the first rollup block submitted for this host block if (lastSubmittedAtBlock[header.rollupChainId] == block.number) revert OneRollupBlockPerHostBlock(); lastSubmittedAtBlock[header.rollupChainId] = block.number; // emit event emit BlockSubmitted( sequencer, header.rollupChainId, header.gasLimit, header.rewardAddress, header.blockDataHash ); } /// @notice Construct hash of block details that the sequencer signs. /// @param header - the header information for the rollup block. /// @return commit - the hash of the encoded block details. function blockCommitment(BlockHeader memory header) public view returns (bytes32 commit) { bytes memory encoded = abi.encodePacked( "init4.sequencer.v0", block.chainid, header.rollupChainId, header.hostBlockNumber, header.gasLimit, header.rewardAddress, header.blockDataHash ); commit = keccak256(encoded); } }
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-gas-snapshot/=lib/permit2/lib/forge-gas-snapshot/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "permit2/=lib/permit2/", "solmate/=lib/permit2/lib/solmate/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "cancun", "viaIR": false, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_sequencerAdmin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"derivedSequencer","type":"address"}],"name":"BadSignature","type":"error"},{"inputs":[],"name":"IncorrectHostBlock","type":"error"},{"inputs":[],"name":"OneRollupBlockPerHostBlock","type":"error"},{"inputs":[],"name":"OnlySequencerAdmin","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sequencer","type":"address"},{"indexed":true,"internalType":"uint256","name":"rollupChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"gasLimit","type":"uint256"},{"indexed":false,"internalType":"address","name":"rewardAddress","type":"address"},{"indexed":false,"internalType":"bytes32","name":"blockDataHash","type":"bytes32"}],"name":"BlockSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sequencer","type":"address"},{"indexed":true,"internalType":"bool","name":"permissioned","type":"bool"}],"name":"SequencerSet","type":"event"},{"inputs":[{"internalType":"address","name":"sequencer","type":"address"}],"name":"addSequencer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"rollupChainId","type":"uint256"},{"internalType":"uint256","name":"hostBlockNumber","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"address","name":"rewardAddress","type":"address"},{"internalType":"bytes32","name":"blockDataHash","type":"bytes32"}],"internalType":"struct Zenith.BlockHeader","name":"header","type":"tuple"}],"name":"blockCommitment","outputs":[{"internalType":"bytes32","name":"commit","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deployBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isSequencer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lastSubmittedAtBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sequencer","type":"address"}],"name":"removeSequencer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sequencerAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"rollupChainId","type":"uint256"},{"internalType":"uint256","name":"hostBlockNumber","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"address","name":"rewardAddress","type":"address"},{"internalType":"bytes32","name":"blockDataHash","type":"bytes32"}],"internalType":"struct Zenith.BlockHeader","name":"header","type":"tuple"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"submitBlock","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a0604052348015600e575f80fd5b5060405161079b38038061079b833981016040819052602b91603e565b6001600160a01b0316608052435f556069565b5f60208284031215604d575f80fd5b81516001600160a01b03811681146062575f80fd5b9392505050565b60805161070c61008f5f395f81816101480152818161018d015261048e015261070c5ff3fe608060405234801561000f575f80fd5b5060043610610085575f3560e01c80638635c102116100585780638635c1021461010a57806388b673d31461011d5780638a33623114610130578063f9060fee14610143575f80fd5b8063206288d3146100895780636989ca7c146100a45780636d46e987146100b95780637e82bb01146100eb575b5f80fd5b6100915f5481565b6040519081526020015b60405180910390f35b6100b76100b236600461055b565b610182565b005b6100db6100c736600461055b565b60026020525f908152604090205460ff1681565b604051901515815260200161009b565b6100916100f936600461057b565b60016020525f908152604090205481565b610091610118366004610611565b610239565b6100b761012b36600461062b565b6102da565b6100b761013e36600461055b565b610483565b61016a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009b565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101cb5760405163049a95bf60e41b815260040160405180910390fd5b6001600160a01b0381165f9081526002602052604090205460ff166101ed5750565b6001600160a01b0381165f81815260026020526040808220805460ff19169055519091907feb12a9a53eec138c91b27b4f912a257bd690c18fc8bde744be92a0365eb9b87e908390a350565b5f8046835f015184602001518560400151866060015187608001516040516020016102bb96959493929190710696e6974342e73657175656e6365722e76360741b8152601281019690965260328601949094526052850192909252607284015260601b6bffffffffffffffffffffffff1916609283015260a682015260c60190565b60408051601f1981840301815291905280516020909101209392505050565b856020015143146102fe5760405163b2d975db60e01b815260040160405180910390fd5b5f61030887610239565b604080515f8082526020820180845284905260ff8a169282019290925260608101889052608081018790529192509060019060a0016020604051602081039080840390855afa15801561035d573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b038116158061039857506001600160a01b0381165f9081526002602052604090205460ff16155b156103c557604051639a7d38d960e01b81526001600160a01b038216600482015260240160405180910390fd5b87515f908152600160205260409020544390036103f557604051632ce0494b60e01b815260040160405180910390fd5b87515f90815260016020526040908190204390558851818a015160608b015160808c0151935192936001600160a01b038616937ffe642e465ceaeb1c7f4cedaee76e84b12970fe1546683f8758525b3a0e2b44429361047193909290919283526001600160a01b03919091166020830152604082015260600190565b60405180910390a35050505050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104cc5760405163049a95bf60e41b815260040160405180910390fd5b6001600160a01b0381165f9081526002602052604090205460ff16156104ef5750565b6001600160a01b0381165f81815260026020526040808220805460ff1916600190811790915590519092917feb12a9a53eec138c91b27b4f912a257bd690c18fc8bde744be92a0365eb9b87e91a350565b80356001600160a01b0381168114610556575f80fd5b919050565b5f6020828403121561056b575f80fd5b61057482610540565b9392505050565b5f6020828403121561058b575f80fd5b5035919050565b5f60a082840312156105a2575f80fd5b60405160a0810181811067ffffffffffffffff821117156105d157634e487b7160e01b5f52604160045260245ffd5b6040908152833582526020808501359083015283810135908201529050806105fb60608401610540565b6060820152608092830135920191909152919050565b5f60a08284031215610621575f80fd5b6105748383610592565b5f805f805f806101208789031215610641575f80fd5b61064b8888610592565b955060a087013560ff81168114610660575f80fd5b945060c0870135935060e0870135925061010087013567ffffffffffffffff81111561068a575f80fd5b8701601f8101891361069a575f80fd5b803567ffffffffffffffff8111156106b0575f80fd5b8960208284010111156106c1575f80fd5b6020820193508092505050929550929550929556fea26469706673582212200db69a7f97b54a960c543d94babf928a411f14d6fb0eff942d083e8f270a065164736f6c634300081a003300000000000000000000000029403f107781ea45bf93710abf8df13f67f2008f
Deployed Bytecode
0x608060405234801561000f575f80fd5b5060043610610085575f3560e01c80638635c102116100585780638635c1021461010a57806388b673d31461011d5780638a33623114610130578063f9060fee14610143575f80fd5b8063206288d3146100895780636989ca7c146100a45780636d46e987146100b95780637e82bb01146100eb575b5f80fd5b6100915f5481565b6040519081526020015b60405180910390f35b6100b76100b236600461055b565b610182565b005b6100db6100c736600461055b565b60026020525f908152604090205460ff1681565b604051901515815260200161009b565b6100916100f936600461057b565b60016020525f908152604090205481565b610091610118366004610611565b610239565b6100b761012b36600461062b565b6102da565b6100b761013e36600461055b565b610483565b61016a7f00000000000000000000000029403f107781ea45bf93710abf8df13f67f2008f81565b6040516001600160a01b03909116815260200161009b565b336001600160a01b037f00000000000000000000000029403f107781ea45bf93710abf8df13f67f2008f16146101cb5760405163049a95bf60e41b815260040160405180910390fd5b6001600160a01b0381165f9081526002602052604090205460ff166101ed5750565b6001600160a01b0381165f81815260026020526040808220805460ff19169055519091907feb12a9a53eec138c91b27b4f912a257bd690c18fc8bde744be92a0365eb9b87e908390a350565b5f8046835f015184602001518560400151866060015187608001516040516020016102bb96959493929190710696e6974342e73657175656e6365722e76360741b8152601281019690965260328601949094526052850192909252607284015260601b6bffffffffffffffffffffffff1916609283015260a682015260c60190565b60408051601f1981840301815291905280516020909101209392505050565b856020015143146102fe5760405163b2d975db60e01b815260040160405180910390fd5b5f61030887610239565b604080515f8082526020820180845284905260ff8a169282019290925260608101889052608081018790529192509060019060a0016020604051602081039080840390855afa15801561035d573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b038116158061039857506001600160a01b0381165f9081526002602052604090205460ff16155b156103c557604051639a7d38d960e01b81526001600160a01b038216600482015260240160405180910390fd5b87515f908152600160205260409020544390036103f557604051632ce0494b60e01b815260040160405180910390fd5b87515f90815260016020526040908190204390558851818a015160608b015160808c0151935192936001600160a01b038616937ffe642e465ceaeb1c7f4cedaee76e84b12970fe1546683f8758525b3a0e2b44429361047193909290919283526001600160a01b03919091166020830152604082015260600190565b60405180910390a35050505050505050565b336001600160a01b037f00000000000000000000000029403f107781ea45bf93710abf8df13f67f2008f16146104cc5760405163049a95bf60e41b815260040160405180910390fd5b6001600160a01b0381165f9081526002602052604090205460ff16156104ef5750565b6001600160a01b0381165f81815260026020526040808220805460ff1916600190811790915590519092917feb12a9a53eec138c91b27b4f912a257bd690c18fc8bde744be92a0365eb9b87e91a350565b80356001600160a01b0381168114610556575f80fd5b919050565b5f6020828403121561056b575f80fd5b61057482610540565b9392505050565b5f6020828403121561058b575f80fd5b5035919050565b5f60a082840312156105a2575f80fd5b60405160a0810181811067ffffffffffffffff821117156105d157634e487b7160e01b5f52604160045260245ffd5b6040908152833582526020808501359083015283810135908201529050806105fb60608401610540565b6060820152608092830135920191909152919050565b5f60a08284031215610621575f80fd5b6105748383610592565b5f805f805f806101208789031215610641575f80fd5b61064b8888610592565b955060a087013560ff81168114610660575f80fd5b945060c0870135935060e0870135925061010087013567ffffffffffffffff81111561068a575f80fd5b8701601f8101891361069a575f80fd5b803567ffffffffffffffff8111156106b0575f80fd5b8960208284010111156106c1575f80fd5b6020820193508092505050929550929550929556fea26469706673582212200db69a7f97b54a960c543d94babf928a411f14d6fb0eff942d083e8f270a065164736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000029403f107781ea45bf93710abf8df13f67f2008f
-----Decoded View---------------
Arg [0] : _sequencerAdmin (address): 0x29403F107781ea45Bf93710abf8df13F67f2008f
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000029403f107781ea45bf93710abf8df13f67f2008f
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.