ETH Price: $3,713.55 (-5.56%)

Contract

0xbc1ea504fC54D078514eFCCA1F6860B5219B6BC3
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
192185892024-02-13 10:47:11301 days ago1707821231
0xbc1ea504...5219B6BC3
0 ETH
192185532024-02-13 10:39:59301 days ago1707820799
0xbc1ea504...5219B6BC3
0 ETH
192185322024-02-13 10:35:47301 days ago1707820547
0xbc1ea504...5219B6BC3
0 ETH
192184962024-02-13 10:28:23301 days ago1707820103
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
192184612024-02-13 10:21:23301 days ago1707819683
0xbc1ea504...5219B6BC3
0 ETH
View All Internal Transactions
Loading...
Loading

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

Contract Name:
PolygonZkEVMGlobalExitRoot

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion
File 1 of 4 : PolygonZkEVMGlobalExitRoot.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.17;

import "./interfaces/IPolygonZkEVMGlobalExitRoot.sol";
import "./lib/GlobalExitRootLib.sol";

/**
 * Contract responsible for managing the exit roots across multiple networks
 */
contract PolygonZkEVMGlobalExitRoot is IPolygonZkEVMGlobalExitRoot {
    // PolygonZkEVMBridge address
    address public immutable bridgeAddress;

    // Rollup contract address
    address public immutable rollupAddress;

    // Rollup exit root, this will be updated every time a batch is verified
    bytes32 public lastRollupExitRoot;

    // Mainnet exit root, this will be updated every time a deposit is made in mainnet
    bytes32 public lastMainnetExitRoot;

    // Store every global exit root: Root --> timestamp
    mapping(bytes32 => uint256) public globalExitRootMap;

    /**
     * @dev Emitted when the global exit root is updated
     */
    event UpdateGlobalExitRoot(
        bytes32 indexed mainnetExitRoot,
        bytes32 indexed rollupExitRoot
    );

    /**
     * @param _rollupAddress Rollup contract address
     * @param _bridgeAddress PolygonZkEVMBridge contract address
     */
    constructor(address _rollupAddress, address _bridgeAddress) {
        rollupAddress = _rollupAddress;
        bridgeAddress = _bridgeAddress;
    }

    /**
     * @notice Update the exit root of one of the networks and the global exit root
     * @param newRoot new exit tree root
     */
    function updateExitRoot(bytes32 newRoot) external {
        // Store storage variables into temporal variables since will be used multiple times
        bytes32 cacheLastRollupExitRoot = lastRollupExitRoot;
        bytes32 cacheLastMainnetExitRoot = lastMainnetExitRoot;

        if (msg.sender == bridgeAddress) {
            lastMainnetExitRoot = newRoot;
            cacheLastMainnetExitRoot = newRoot;
        } else if (msg.sender == rollupAddress) {
            lastRollupExitRoot = newRoot;
            cacheLastRollupExitRoot = newRoot;
        } else {
            revert OnlyAllowedContracts();
        }

        bytes32 newGlobalExitRoot = GlobalExitRootLib.calculateGlobalExitRoot(
            cacheLastMainnetExitRoot,
            cacheLastRollupExitRoot
        );

        // If it already exists, do not modify the timestamp
        if (globalExitRootMap[newGlobalExitRoot] == 0) {
            globalExitRootMap[newGlobalExitRoot] = block.timestamp;
            emit UpdateGlobalExitRoot(
                cacheLastMainnetExitRoot,
                cacheLastRollupExitRoot
            );
        }
    }

    /**
     * @notice Return last global exit root
     */
    function getLastGlobalExitRoot() public view returns (bytes32) {
        return
            GlobalExitRootLib.calculateGlobalExitRoot(
                lastMainnetExitRoot,
                lastRollupExitRoot
            );
    }
}

File 2 of 4 : IBasePolygonZkEVMGlobalExitRoot.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.17;

interface IBasePolygonZkEVMGlobalExitRoot {
    /**
     * @dev Thrown when the caller is not the allowed contracts
     */
    error OnlyAllowedContracts();

    function updateExitRoot(bytes32 newRollupExitRoot) external;

    function globalExitRootMap(
        bytes32 globalExitRootNum
    ) external returns (uint256);
}

File 3 of 4 : IPolygonZkEVMGlobalExitRoot.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.17;
import "./IBasePolygonZkEVMGlobalExitRoot.sol";

interface IPolygonZkEVMGlobalExitRoot is IBasePolygonZkEVMGlobalExitRoot {
    function getLastGlobalExitRoot() external view returns (bytes32);
}

File 4 of 4 : GlobalExitRootLib.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.17;

/**
 * @dev A library that provides the necessary calculations to calculate the global exit root
 */
library GlobalExitRootLib {
    function calculateGlobalExitRoot(
        bytes32 mainnetExitRoot,
        bytes32 rollupExitRoot
    ) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(mainnetExitRoot, rollupExitRoot));
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_rollupAddress","type":"address"},{"internalType":"address","name":"_bridgeAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"OnlyAllowedContracts","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"mainnetExitRoot","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"rollupExitRoot","type":"bytes32"}],"name":"UpdateGlobalExitRoot","type":"event"},{"inputs":[],"name":"bridgeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastGlobalExitRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"globalExitRootMap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastMainnetExitRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRollupExitRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rollupAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newRoot","type":"bytes32"}],"name":"updateExitRoot","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806333d6247d1161005b57806333d6247d146100c75780633ed691ef146100dc5780635ec6a8df146100e4578063a3c573eb1461013057600080fd5b806301fd904414610082578063257b36321461009e578063319cf735146100be575b600080fd5b61008b60005481565b6040519081526020015b60405180910390f35b61008b6100ac3660046102e2565b60026020526000908152604090205481565b61008b60015481565b6100da6100d53660046102e2565b610157565b005b61008b6102a6565b61010b7f0000000000000000000000005132a183e9f3cb7c848b0aac5ae0c4f0491b7ab281565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610095565b61010b7f0000000000000000000000002a3dd3eb832af982ec71669e178424b10dca2ede81565b60005460015473ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000002a3dd3eb832af982ec71669e178424b10dca2ede1633036101a65750600182905581610222565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005132a183e9f3cb7c848b0aac5ae0c4f0491b7ab21633036101f0576000839055829150610222565b6040517fb49365dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051602080820184905281830185905282518083038401815260609092019092528051910120600090600081815260026020526040812054919250036102a05760008181526002602052604080822042905551849184917f61014378f82a0d809aefaf87a8ac9505b89c321808287a6e7810f29304c1fce39190a35b50505050565b60006102dd600154600054604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b905090565b6000602082840312156102f457600080fd5b503591905056fea2646970667358221220bc23c6d5d3992802bdfd06ef45362230dcda7d33db81b1dc3ef40d86219e81c864736f6c63430008110033

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

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.