ETH Price: $2,042.83 (+0.78%)

Contract

0xBB08c87a2E871FcF3d86C4F7ED03dEc8B66297Ba
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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

Contract Name:
ZkEvmVerifierPostEuclid

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT

pragma solidity =0.8.24;

import {IZkEvmVerifierV2} from "./IZkEvmVerifier.sol";

// solhint-disable no-inline-assembly

contract ZkEvmVerifierPostEuclid is IZkEvmVerifierV2 {
    /**********
     * Errors *
     **********/

    /// @dev Thrown when bundle recursion zk proof verification is failed.
    error VerificationFailed();

    /*************
     * Constants *
     *************/

    /// @notice The address of highly optimized plonk verifier contract.
    address public immutable plonkVerifier;

    /// @notice A predetermined digest for the `plonkVerifier`.
    bytes32 public immutable verifierDigest1;

    /// @notice A predetermined digest for the `plonkVerifier`.
    bytes32 public immutable verifierDigest2;

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

    constructor(
        address _verifier,
        bytes32 _verifierDigest1,
        bytes32 _verifierDigest2
    ) {
        plonkVerifier = _verifier;
        verifierDigest1 = _verifierDigest1;
        verifierDigest2 = _verifierDigest2;
    }

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

    /// @inheritdoc IZkEvmVerifierV2
    ///
    /// @dev Encoding for `publicInput`. And this is exactly the same as `ZkEvmVerifierV2`.
    /// ```text
    /// | layer2ChainId | numBatches | prevStateRoot | prevBatchHash | postStateRoot | batchHash | withdrawRoot |
    /// |    8 bytes    |  4  bytes  |   32  bytes   |   32  bytes   |   32  bytes   | 32  bytes |   32 bytes   |
    /// ```
    function verify(bytes calldata bundleProof, bytes calldata publicInput) external view override {
        address _verifier = plonkVerifier;
        bytes32 _verifierDigest1 = verifierDigest1;
        bytes32 _verifierDigest2 = verifierDigest2;
        bytes32 publicInputHash = keccak256(publicInput);
        bool success;

        // 1. the first 12 * 32 (0x180) bytes of `bundleProof` is `accumulator`
        // 2. the rest bytes of `bundleProof` is the actual `bundle_proof`
        // 3. Inserted between `accumulator` and `bundle_proof` are
        //    32 * 34 (0x440) bytes, such that:
        //    | start         | end           | field                   |
        //    |---------------|---------------|-------------------------|
        //    | 0x00          | 0x180         | bundleProof[0x00:0x180] |
        //    | 0x180         | 0x180 + 0x20  | verifierDigest1         |
        //    | 0x180 + 0x20  | 0x180 + 0x40  | verifierDigest2         |
        //    | 0x180 + 0x40  | 0x180 + 0x60  | publicInputHash[0]      |
        //    | 0x180 + 0x60  | 0x180 + 0x80  | publicInputHash[1]      |
        //    ...
        //    | 0x180 + 0x420 | 0x180 + 0x440 | publicInputHash[31]     |
        //    | 0x180 + 0x440 | dynamic       | bundleProof[0x180:]     |
        assembly {
            let p := mload(0x40)
            // 1. copy the accumulator's 0x180 bytes
            calldatacopy(p, bundleProof.offset, 0x180)
            // 2. insert the public input's 0x440 bytes
            mstore(add(p, 0x180), _verifierDigest1) // verifierDigest1
            mstore(add(p, 0x1a0), _verifierDigest2) // verifierDigest2
            for {
                let i := 0
            } lt(i, 0x400) {
                i := add(i, 0x20)
            } {
                mstore(add(p, sub(0x5a0, i)), and(publicInputHash, 0xff))
                publicInputHash := shr(8, publicInputHash)
            }
            // 3. copy all remaining bytes from bundleProof
            calldatacopy(add(p, 0x5c0), add(bundleProof.offset, 0x180), sub(bundleProof.length, 0x180))
            // 4. call plonk verifier
            success := staticcall(gas(), _verifier, p, add(bundleProof.length, 0x440), 0x00, 0x00)
        }
        if (!success) {
            revert VerificationFailed();
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.24;

interface IZkEvmVerifierV1 {
    /// @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;
}

interface IZkEvmVerifierV2 {
    /// @notice Verify bundle zk proof.
    /// @param bundleProof The bundle recursion proof.
    /// @param publicInput The public input.
    function verify(bytes calldata bundleProof, bytes calldata publicInput) external view;
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_verifier","type":"address"},{"internalType":"bytes32","name":"_verifierDigest1","type":"bytes32"},{"internalType":"bytes32","name":"_verifierDigest2","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"VerificationFailed","type":"error"},{"inputs":[],"name":"plonkVerifier","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"verifierDigest1","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"verifierDigest2","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"bundleProof","type":"bytes"},{"internalType":"bytes","name":"publicInput","type":"bytes"}],"name":"verify","outputs":[],"stateMutability":"view","type":"function"}]

0x60e060405234801561000f575f80fd5b506040516103c03803806103c083398101604081905261002e91610047565b6001600160a01b0390921660805260a05260c052610086565b5f805f60608486031215610059575f80fd5b83516001600160a01b038116811461006f575f80fd5b602085015160409095015190969495509392505050565b60805160a05160c0516102fe6100c25f395f8181608d015261014c01525f81816053015261012a01525f818160b4015261010801526102fe5ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c8063336a075e1461004e57806397dd698514610088578063e4886e50146100af578063f7e83aee146100ee575b5f80fd5b6100757f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100757f000000000000000000000000000000000000000000000000000000000000000081565b6100d67f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161007f565b6101016100fc366004610252565b610103565b005b6040517f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000905f9061017b90879087906102b9565b604051809103902090505f6040516101808a823784610180820152836101a08201525f5b6104008110156101c55760ff84166105a082900383015260089390931c9260200161019f565b5061018089036101808b016105c08301375f806104408b0183895afa915050806102025760405163439cc0cd60e01b815260040160405180910390fd5b505050505050505050565b5f8083601f84011261021d575f80fd5b50813567ffffffffffffffff811115610234575f80fd5b60208301915083602082850101111561024b575f80fd5b9250929050565b5f805f8060408587031215610265575f80fd5b843567ffffffffffffffff8082111561027c575f80fd5b6102888883890161020d565b909650945060208701359150808211156102a0575f80fd5b506102ad8782880161020d565b95989497509550505050565b818382375f910190815291905056fea26469706673582212206e40dec04f88d732d64390d2feca991ab267946bb2a18c211ed3ed104099378864736f6c634300081800330000000000000000000000007f1a3e1299f44baefe20cb2bcd62a75ca00c20d60076388fb7de9cb4e4f0a73cf1dbf24a02a789d1cb83d7b23a7591e144d2f6d3009305f0762291e3cdd805ff6d6e81f1d135dbfdeb3ecf30ad82c3855dde7909

Deployed Bytecode

0x608060405234801561000f575f80fd5b506004361061004a575f3560e01c8063336a075e1461004e57806397dd698514610088578063e4886e50146100af578063f7e83aee146100ee575b5f80fd5b6100757f0076388fb7de9cb4e4f0a73cf1dbf24a02a789d1cb83d7b23a7591e144d2f6d381565b6040519081526020015b60405180910390f35b6100757f009305f0762291e3cdd805ff6d6e81f1d135dbfdeb3ecf30ad82c3855dde790981565b6100d67f0000000000000000000000007f1a3e1299f44baefe20cb2bcd62a75ca00c20d681565b6040516001600160a01b03909116815260200161007f565b6101016100fc366004610252565b610103565b005b6040517f0000000000000000000000007f1a3e1299f44baefe20cb2bcd62a75ca00c20d6907f0076388fb7de9cb4e4f0a73cf1dbf24a02a789d1cb83d7b23a7591e144d2f6d3907f009305f0762291e3cdd805ff6d6e81f1d135dbfdeb3ecf30ad82c3855dde7909905f9061017b90879087906102b9565b604051809103902090505f6040516101808a823784610180820152836101a08201525f5b6104008110156101c55760ff84166105a082900383015260089390931c9260200161019f565b5061018089036101808b016105c08301375f806104408b0183895afa915050806102025760405163439cc0cd60e01b815260040160405180910390fd5b505050505050505050565b5f8083601f84011261021d575f80fd5b50813567ffffffffffffffff811115610234575f80fd5b60208301915083602082850101111561024b575f80fd5b9250929050565b5f805f8060408587031215610265575f80fd5b843567ffffffffffffffff8082111561027c575f80fd5b6102888883890161020d565b909650945060208701359150808211156102a0575f80fd5b506102ad8782880161020d565b95989497509550505050565b818382375f910190815291905056fea26469706673582212206e40dec04f88d732d64390d2feca991ab267946bb2a18c211ed3ed104099378864736f6c63430008180033

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

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.