Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers. Name tag integration is not available in advanced view.
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Method | Block |
From
|
To
|
||||
---|---|---|---|---|---|---|---|---|
Transfer* | 7879292 | 10 days ago | 0 ETH | |||||
Transfer* | 7879292 | 10 days ago | 0 ETH | |||||
Transfer* | 7878976 | 10 days ago | 0 ETH | |||||
Transfer* | 7878976 | 10 days ago | 0 ETH | |||||
Transfer* | 7878967 | 10 days ago | 0 ETH | |||||
Transfer* | 7878967 | 10 days ago | 0 ETH | |||||
Transfer* | 7878966 | 10 days ago | 0 ETH | |||||
Transfer* | 7878966 | 10 days ago | 0 ETH | |||||
Transfer* | 7878945 | 10 days ago | 0 ETH | |||||
Transfer* | 7878945 | 10 days ago | 0 ETH | |||||
Transfer* | 7878944 | 10 days ago | 0 ETH | |||||
Transfer* | 7878944 | 10 days ago | 0 ETH | |||||
Transfer* | 7878943 | 10 days ago | 0 ETH | |||||
Transfer* | 7878943 | 10 days ago | 0 ETH | |||||
Transfer* | 7878331 | 10 days ago | 0 ETH | |||||
Transfer* | 7878331 | 10 days ago | 0 ETH | |||||
Transfer* | 7878330 | 10 days ago | 0 ETH | |||||
Transfer* | 7878330 | 10 days ago | 0 ETH | |||||
Transfer* | 7878329 | 10 days ago | 0 ETH | |||||
Transfer* | 7878329 | 10 days ago | 0 ETH | |||||
Transfer* | 7878328 | 10 days ago | 0 ETH | |||||
Transfer* | 7878328 | 10 days ago | 0 ETH | |||||
Transfer* | 7877601 | 10 days ago | 0 ETH | |||||
Transfer* | 7877601 | 10 days ago | 0 ETH | |||||
Transfer* | 7877332 | 10 days ago | 0 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xde600B01...56AE75d58 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
ZkEvmVerifierV2
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 ZkEvmVerifierV2 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 verifierDigest; /*************** * Constructor * ***************/ constructor(address _verifier, bytes32 _verifierDigest) { plonkVerifier = _verifier; verifierDigest = _verifierDigest; } /************************* * Public View Functions * *************************/ /// @inheritdoc IZkEvmVerifierV2 /// /// @dev Encoding for `publicInput` /// ```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 _verifierDigest = verifierDigest; bool success; // 1. the first 12 * 32 (0x180) bytes of `bundleProof` is `accumulator` // 2. the rest bytes of `bundleProof` is the actual `bundle_recursion_proof` // 3. Inserted between `accumulator` and `bundle_recursion_proof` are // 32 * 13 (0x1a0) bytes, such that: // | start | end | field | // |---------------|---------------|-------------------------| // | 0x00 | 0x180 | bundleProof[0x00:0x180] | // | 0x180 | 0x180 + 0x20 | verifierDigest | // | 0x180 + 0x20 | 0x180 + 0x40 | prevStateRoot_hi | // | 0x180 + 0x40 | 0x180 + 0x60 | prevStateRoot_lo | // | 0x180 + 0x60 | 0x180 + 0x80 | prevBatchHash_hi | // | 0x180 + 0x80 | 0x180 + 0xa0 | prevBatchHash_lo | // | 0x180 + 0xa0 | 0x180 + 0xc0 | postStateRoot_hi | // | 0x180 + 0xc0 | 0x180 + 0xe0 | postStateRoot_lo | // | 0x180 + 0xe0 | 0x180 + 0x100 | batchHash_hi | // | 0x180 + 0x100 | 0x180 + 0x120 | batchHash_lo | // | 0x180 + 0x120 | 0x180 + 0x140 | layer2ChainId | // | 0x180 + 0x140 | 0x180 + 0x160 | withdrawRoot_hi | // | 0x180 + 0x160 | 0x180 + 0x180 | withdrawRoot_lo | // | 0x180 + 0x180 | 0x180 + 0x1a0 | numRound | // | 0x180 + 0x1a0 | 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 0x1a0 bytes mstore(add(p, 0x180), _verifierDigest) // verifierDigest let value := calldataload(add(publicInput.offset, 0xc)) mstore(add(p, 0x1a0), shr(128, value)) // prevStateRoot_hi mstore(add(p, 0x1c0), and(value, 0xffffffffffffffffffffffffffffffff)) // prevStateRoot_lo value := calldataload(add(publicInput.offset, 0x2c)) mstore(add(p, 0x1e0), shr(128, value)) // prevBatchHash_hi mstore(add(p, 0x200), and(value, 0xffffffffffffffffffffffffffffffff)) // prevBatchHash_lo value := calldataload(add(publicInput.offset, 0x4c)) mstore(add(p, 0x220), shr(128, value)) // postStateRoot_hi mstore(add(p, 0x240), and(value, 0xffffffffffffffffffffffffffffffff)) // postStateRoot_lo value := calldataload(add(publicInput.offset, 0x6c)) mstore(add(p, 0x260), shr(128, value)) // batchHash_hi mstore(add(p, 0x280), and(value, 0xffffffffffffffffffffffffffffffff)) // batchHash_lo value := shr(192, calldataload(publicInput.offset)) mstore(add(p, 0x2a0), value) // layer2ChainId value := calldataload(add(publicInput.offset, 0x8c)) mstore(add(p, 0x2c0), shr(128, value)) // withdrawRoot_hi mstore(add(p, 0x2e0), and(value, 0xffffffffffffffffffffffffffffffff)) // withdrawRoot_lo value := shr(224, calldataload(add(publicInput.offset, 0x08))) mstore(add(p, 0x300), sub(value, 1)) // numRound, which is numBatches - 1 // 3. copy all remaining bytes from bundleProof calldatacopy(add(p, 0x320), add(bundleProof.offset, 0x180), sub(bundleProof.length, 0x180)) // 4. call plonk verifier success := staticcall(gas(), _verifier, p, add(bundleProof.length, 0x1a0), 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; }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "cancun", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_verifier","type":"address"},{"internalType":"bytes32","name":"_verifierDigest","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":"verifierDigest","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"}]
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061003f575f3560e01c80637959e13014610043578063e4886e501461007d578063f7e83aee146100bc575b5f80fd5b61006a7f0a1904dbfff4614fb090b4b3864af4874f12680c32f07889e9ede8665097e5ec81565b6040519081526020015b60405180910390f35b6100a47f00000000000000000000000009e2f90f1610ac31bbd8a024fb1acb50111358ca81565b6040516001600160a01b039091168152602001610074565b6100cf6100ca366004610250565b6100d1565b005b6040517f00000000000000000000000009e2f90f1610ac31bbd8a024fb1acb50111358ca907f0a1904dbfff4614fb090b4b3864af4874f12680c32f07889e9ede8665097e5ec905f90610180888237610180818101849052600c870135608081811c6101a08501526fffffffffffffffffffffffffffffffff9182166101c0850152602c89013580821c6101e08601528216610200850152604c89013580821c6102208601528216610240850152606c89013580821c6102608601528216610280850152883560c01c6102a0850152608c8901359081901c6102c0850152166102e08301525f19600888013560e01c0161030083015261017f1988019089016103208301375f806101a0890183875afa915050806102025760405163439cc0cd60e01b815260040160405180910390fd5b50505050505050565b5f8083601f84011261021b575f80fd5b50813567ffffffffffffffff811115610232575f80fd5b602083019150836020828501011115610249575f80fd5b9250929050565b5f805f8060408587031215610263575f80fd5b843567ffffffffffffffff8082111561027a575f80fd5b6102868883890161020b565b9096509450602087013591508082111561029e575f80fd5b506102ab8782880161020b565b9598949750955050505056fea264697066735822122066ca6fd7cfdf99356734b3b58efd317c5638df8cad2a271844b21c859e65692164736f6c63430008180033
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.