ETH Price: $3,503.68 (+2.17%)
Gas: 2 Gwei

Contract

0xA2Ab526e5C5491F10FC05A55F064BF9F7CEf32a0
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...183329112023-10-12 7:41:59281 days ago1697096519IN
Scroll: L1 Multiple Version Rollup
0 ETH0.000282349.84635552
Initialize183069612023-10-08 16:30:47285 days ago1696782647IN
Scroll: L1 Multiple Version Rollup
0 ETH0.000589212.73986761
0x60806040183069332023-10-08 16:25:11285 days ago1696782311IN
 Contract Creation
0 ETH0.0082170913.35029041

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
197566692024-04-28 22:03:1182 days ago1714341791
0xA2Ab526e...F7CEf32a0
0 ETH
197566692024-04-28 22:03:1182 days ago1714341791
0xA2Ab526e...F7CEf32a0
0 ETH
197566682024-04-28 22:02:5982 days ago1714341779
0xA2Ab526e...F7CEf32a0
0 ETH
197566682024-04-28 22:02:5982 days ago1714341779
0xA2Ab526e...F7CEf32a0
0 ETH
197566652024-04-28 22:02:2382 days ago1714341743
0xA2Ab526e...F7CEf32a0
0 ETH
197566652024-04-28 22:02:2382 days ago1714341743
0xA2Ab526e...F7CEf32a0
0 ETH
197566642024-04-28 22:02:1182 days ago1714341731
0xA2Ab526e...F7CEf32a0
0 ETH
197566642024-04-28 22:02:1182 days ago1714341731
0xA2Ab526e...F7CEf32a0
0 ETH
197566622024-04-28 22:01:4782 days ago1714341707
0xA2Ab526e...F7CEf32a0
0 ETH
197566622024-04-28 22:01:4782 days ago1714341707
0xA2Ab526e...F7CEf32a0
0 ETH
197566432024-04-28 21:57:5982 days ago1714341479
0xA2Ab526e...F7CEf32a0
0 ETH
197566432024-04-28 21:57:5982 days ago1714341479
0xA2Ab526e...F7CEf32a0
0 ETH
197566302024-04-28 21:55:2382 days ago1714341323
0xA2Ab526e...F7CEf32a0
0 ETH
197566302024-04-28 21:55:2382 days ago1714341323
0xA2Ab526e...F7CEf32a0
0 ETH
197566292024-04-28 21:55:1182 days ago1714341311
0xA2Ab526e...F7CEf32a0
0 ETH
197566292024-04-28 21:55:1182 days ago1714341311
0xA2Ab526e...F7CEf32a0
0 ETH
197566282024-04-28 21:54:5982 days ago1714341299
0xA2Ab526e...F7CEf32a0
0 ETH
197566282024-04-28 21:54:5982 days ago1714341299
0xA2Ab526e...F7CEf32a0
0 ETH
197566262024-04-28 21:54:3582 days ago1714341275
0xA2Ab526e...F7CEf32a0
0 ETH
197566262024-04-28 21:54:3582 days ago1714341275
0xA2Ab526e...F7CEf32a0
0 ETH
197566252024-04-28 21:54:2382 days ago1714341263
0xA2Ab526e...F7CEf32a0
0 ETH
197566252024-04-28 21:54:2382 days ago1714341263
0xA2Ab526e...F7CEf32a0
0 ETH
197566242024-04-28 21:54:1182 days ago1714341251
0xA2Ab526e...F7CEf32a0
0 ETH
197566242024-04-28 21:54:1182 days ago1714341251
0xA2Ab526e...F7CEf32a0
0 ETH
197566222024-04-28 21:53:4782 days ago1714341227
0xA2Ab526e...F7CEf32a0
0 ETH
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x39e231dC...6D03d8282
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
MultipleVersionRollupVerifier

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 6 : MultipleVersionRollupVerifier.sol
// SPDX-License-Identifier: MIT

pragma solidity =0.8.16;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

import {IScrollChain} from "./IScrollChain.sol";
import {IRollupVerifier} from "../../libraries/verifier/IRollupVerifier.sol";
import {IZkEvmVerifier} from "../../libraries/verifier/IZkEvmVerifier.sol";

contract MultipleVersionRollupVerifier is IRollupVerifier, Ownable {
    /**********
     * Events *
     **********/

    /// @notice Emitted when the address of verifier is updated.
    /// @param startBatchIndex The start batch index when the verifier will be used.
    /// @param verifier The address of new verifier.
    event UpdateVerifier(uint256 startBatchIndex, address verifier);

    /***********
     * Structs *
     ***********/

    struct Verifier {
        // The start batch index for the verifier.
        uint64 startBatchIndex;
        // The address of zkevm verifier.
        address verifier;
    }

    /*************
     * Variables *
     *************/

    /// @notice The list of legacy zkevm verifier, sorted by batchIndex in increasing order.
    Verifier[] public legacyVerifiers;

    /// @notice The lastest used zkevm verifier.
    Verifier public latestVerifier;

    /// @notice The address of ScrollChain contract.
    address public scrollChain;

    /***************
     * Constructor *
     ***************/

    constructor(address _verifier) {
        require(_verifier != address(0), "zero verifier address");

        latestVerifier.verifier = _verifier;
    }

    function initialize(address _scrollChain) external onlyOwner {
        require(scrollChain == address(0), "initialized");

        scrollChain = _scrollChain;
    }

    /*************************
     * Public View Functions *
     *************************/

    /// @notice Return the number of legacy verifiers.
    function legacyVerifiersLength() external view returns (uint256) {
        return legacyVerifiers.length;
    }

    /// @notice Compute the verifier should be used for specific batch.
    /// @param _batchIndex The batch index to query.
    function getVerifier(uint256 _batchIndex) public view returns (address) {
        // Normally, we will use the latest verifier.
        Verifier memory _verifier = latestVerifier;

        if (_verifier.startBatchIndex > _batchIndex) {
            uint256 _length = legacyVerifiers.length;
            // In most case, only last few verifier will be used by `ScrollChain`.
            // So, we use linear search instead of binary search.
            unchecked {
                for (uint256 i = _length; i > 0; --i) {
                    _verifier = legacyVerifiers[i - 1];
                    if (_verifier.startBatchIndex <= _batchIndex) break;
                }
            }
        }

        return _verifier.verifier;
    }

    /*****************************
     * Public Mutating Functions *
     *****************************/

    /// @inheritdoc IRollupVerifier
    function verifyAggregateProof(
        uint256 _batchIndex,
        bytes calldata _aggrProof,
        bytes32 _publicInputHash
    ) external view override {
        address _verifier = getVerifier(_batchIndex);

        IZkEvmVerifier(_verifier).verify(_aggrProof, _publicInputHash);
    }

    /************************
     * Restricted Functions *
     ************************/

    /// @notice Update the address of zkevm verifier.
    /// @param _startBatchIndex The start batch index when the verifier will be used.
    /// @param _verifier The address of new verifier.
    function updateVerifier(uint64 _startBatchIndex, address _verifier) external onlyOwner {
        require(_startBatchIndex > IScrollChain(scrollChain).lastFinalizedBatchIndex(), "start batch index finalized");

        Verifier memory _latestVerifier = latestVerifier;
        require(_startBatchIndex >= _latestVerifier.startBatchIndex, "start batch index too small");
        require(_verifier != address(0), "zero verifier address");

        if (_latestVerifier.startBatchIndex < _startBatchIndex) {
            legacyVerifiers.push(_latestVerifier);
            _latestVerifier.startBatchIndex = _startBatchIndex;
        }
        _latestVerifier.verifier = _verifier;

        latestVerifier = _latestVerifier;

        emit UpdateVerifier(_startBatchIndex, _verifier);
    }
}

File 2 of 6 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 6 : IScrollChain.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.16;

interface IScrollChain {
    /**********
     * Events *
     **********/

    /// @notice Emitted when a new batch is committed.
    /// @param batchIndex The index of the batch.
    /// @param batchHash The hash of the batch.
    event CommitBatch(uint256 indexed batchIndex, bytes32 indexed batchHash);

    /// @notice revert a pending batch.
    /// @param batchIndex The index of the batch.
    /// @param batchHash The hash of the batch
    event RevertBatch(uint256 indexed batchIndex, bytes32 indexed batchHash);

    /// @notice Emitted when a batch is finalized.
    /// @param batchIndex The index of the batch.
    /// @param batchHash The hash of the batch
    /// @param stateRoot The state root on layer 2 after this batch.
    /// @param withdrawRoot The merkle root on layer2 after this batch.
    event FinalizeBatch(uint256 indexed batchIndex, bytes32 indexed batchHash, bytes32 stateRoot, bytes32 withdrawRoot);

    /*************************
     * Public View Functions *
     *************************/

    /// @notice The latest finalized batch index.
    function lastFinalizedBatchIndex() external view returns (uint256);

    /// @notice Return the batch hash of a committed batch.
    /// @param batchIndex The index of the batch.
    function committedBatches(uint256 batchIndex) external view returns (bytes32);

    /// @notice Return the state root of a committed batch.
    /// @param batchIndex The index of the batch.
    function finalizedStateRoots(uint256 batchIndex) external view returns (bytes32);

    /// @notice Return the message root of a committed batch.
    /// @param batchIndex The index of the batch.
    function withdrawRoots(uint256 batchIndex) external view returns (bytes32);

    /// @notice Return whether the batch is finalized by batch index.
    /// @param batchIndex The index of the batch.
    function isBatchFinalized(uint256 batchIndex) external view returns (bool);

    /*****************************
     * Public Mutating Functions *
     *****************************/

    /// @notice Commit a batch of transactions on layer 1.
    ///
    /// @param version The version of current batch.
    /// @param parentBatchHeader The header of parent batch, see the comments of `BatchHeaderV0Codec`.
    /// @param chunks The list of encoded chunks, see the comments of `ChunkCodec`.
    /// @param skippedL1MessageBitmap The bitmap indicates whether each L1 message is skipped or not.
    function commitBatch(
        uint8 version,
        bytes calldata parentBatchHeader,
        bytes[] memory chunks,
        bytes calldata skippedL1MessageBitmap
    ) external;

    /// @notice Revert a pending batch.
    /// @dev one can only revert unfinalized batches.
    /// @param batchHeader The header of current batch, see the encoding in comments of `commitBatch`.
    /// @param count The number of subsequent batches to revert, including current batch.
    function revertBatch(bytes calldata batchHeader, uint256 count) external;

    /// @notice Finalize a committed batch on layer 1.
    /// @param batchHeader The header of current batch, see the encoding in comments of `commitBatch.
    /// @param prevStateRoot The state root of parent batch.
    /// @param postStateRoot The state root of current batch.
    /// @param withdrawRoot The withdraw trie root of current batch.
    /// @param aggrProof The aggregation proof for current batch.
    function finalizeBatchWithProof(
        bytes calldata batchHeader,
        bytes32 prevStateRoot,
        bytes32 postStateRoot,
        bytes32 withdrawRoot,
        bytes calldata aggrProof
    ) external;
}

File 4 of 6 : IRollupVerifier.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.16;

interface IRollupVerifier {
    /// @notice Verify aggregate zk proof.
    /// @param batchIndex The batch index to verify.
    /// @param aggrProof The aggregated proof.
    /// @param publicInputHash The public input hash.
    function verifyAggregateProof(
        uint256 batchIndex,
        bytes calldata aggrProof,
        bytes32 publicInputHash
    ) external view;
}

File 5 of 6 : IZkEvmVerifier.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.16;

interface IZkEvmVerifier {
    /// @notice Verify aggregate zk proof.
    /// @param aggrProof The aggregated proof.
    /// @param publicInputHash The public input hash.
    function verify(bytes calldata aggrProof, bytes32 publicInputHash) external view;
}

File 6 of 6 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_verifier","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startBatchIndex","type":"uint256"},{"indexed":false,"internalType":"address","name":"verifier","type":"address"}],"name":"UpdateVerifier","type":"event"},{"inputs":[{"internalType":"uint256","name":"_batchIndex","type":"uint256"}],"name":"getVerifier","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_scrollChain","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"latestVerifier","outputs":[{"internalType":"uint64","name":"startBatchIndex","type":"uint64"},{"internalType":"address","name":"verifier","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"legacyVerifiers","outputs":[{"internalType":"uint64","name":"startBatchIndex","type":"uint64"},{"internalType":"address","name":"verifier","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"legacyVerifiersLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scrollChain","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_startBatchIndex","type":"uint64"},{"internalType":"address","name":"_verifier","type":"address"}],"name":"updateVerifier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_batchIndex","type":"uint256"},{"internalType":"bytes","name":"_aggrProof","type":"bytes"},{"internalType":"bytes32","name":"_publicInputHash","type":"bytes32"}],"name":"verifyAggregateProof","outputs":[],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80638da5cb5b116100715780638da5cb5b1461015c578063b57919e81461016d578063c4d66de81461017e578063cc780aa114610191578063ef4b5227146101a4578063f2fde38b146101b757600080fd5b80631a2c3cde146100ae5780633561bc27146100ee5780634cf536b314610119578063715018a61461013f578063897630dd14610149575b600080fd5b6100c16100bc366004610785565b6101ca565b6040805167ffffffffffffffff90931683526001600160a01b039091166020830152015b60405180910390f35b6101016100fc366004610785565b610206565b6040516001600160a01b0390911681526020016100e5565b6002546100c19067ffffffffffffffff811690600160401b90046001600160a01b031682565b6101476102bf565b005b600354610101906001600160a01b031681565b6000546001600160a01b0316610101565b6001546040519081526020016100e5565b61014761018c3660046107ba565b6102d3565b61014761019f3660046107dc565b610349565b6101476101b236600461085e565b6103be565b6101476101c53660046107ba565b610662565b600181815481106101da57600080fd5b60009182526020909120015467ffffffffffffffff81169150600160401b90046001600160a01b031682565b6040805180820190915260025467ffffffffffffffff8116808352600160401b9091046001600160a01b03166020830152600091908310156102b557600154805b80156102b257600180820381548110610262576102626108a0565b60009182526020918290206040805180820190915291015467ffffffffffffffff8116808352600160401b9091046001600160a01b03169282019290925293508510156102b25760001901610247565b50505b6020015192915050565b6102c76106db565b6102d16000610735565b565b6102db6106db565b6003546001600160a01b0316156103275760405162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b60448201526064015b60405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600061035485610206565b604051636b40634160e01b81529091506001600160a01b03821690636b40634190610387908790879087906004016108b6565b60006040518083038186803b15801561039f57600080fd5b505afa1580156103b3573d6000803e3d6000fd5b505050505050505050565b6103c66106db565b600360009054906101000a90046001600160a01b03166001600160a01b031663059def616040518163ffffffff1660e01b8152600401602060405180830381865afa158015610419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043d91906108ef565b8267ffffffffffffffff16116104955760405162461bcd60e51b815260206004820152601b60248201527f737461727420626174636820696e6465782066696e616c697a65640000000000604482015260640161031e565b6040805180820190915260025467ffffffffffffffff808216808452600160401b9092046001600160a01b03166020840152841610156105175760405162461bcd60e51b815260206004820152601b60248201527f737461727420626174636820696e64657820746f6f20736d616c6c0000000000604482015260640161031e565b6001600160a01b0382166105655760405162461bcd60e51b81526020600482015260156024820152747a65726f207665726966696572206164647265737360581b604482015260640161031e565b805167ffffffffffffffff808516911610156105e75760018054808201825560009190915281517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6909101805460208401516001600160a01b0316600160401b026001600160e01b031990911667ffffffffffffffff93841617179055831681525b6001600160a01b038216602082810182905282516002805467ffffffffffffffff9283166001600160e01b031990911617600160401b8502179055604080519187168252918101929092527f1363b06925d4266686ad6ab546259321a7ed3cc0bcc55ada2c6431a754b3b4e2910160405180910390a1505050565b61066a6106db565b6001600160a01b0381166106cf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161031e565b6106d881610735565b50565b6000546001600160a01b031633146102d15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161031e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561079757600080fd5b5035919050565b80356001600160a01b03811681146107b557600080fd5b919050565b6000602082840312156107cc57600080fd5b6107d58261079e565b9392505050565b600080600080606085870312156107f257600080fd5b84359350602085013567ffffffffffffffff8082111561081157600080fd5b818701915087601f83011261082557600080fd5b81358181111561083457600080fd5b88602082850101111561084657600080fd5b95986020929092019750949560400135945092505050565b6000806040838503121561087157600080fd5b823567ffffffffffffffff8116811461088957600080fd5b91506108976020840161079e565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b604081528260408201528284606083013760006060848301015260006060601f19601f8601168301019050826020830152949350505050565b60006020828403121561090157600080fd5b505191905056fea26469706673582212201297d7338daa171602fc61261a1f2f8e42e924ff0b44c952fc5b44e4537c39d164736f6c63430008100033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.