Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
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 | Block | From | To | ||||
---|---|---|---|---|---|---|---|
19218589 | 301 days ago | 0 ETH | |||||
19218553 | 301 days ago | 0 ETH | |||||
19218532 | 301 days ago | 0 ETH | |||||
19218496 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH | |||||
19218461 | 301 days ago | 0 ETH |
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
Contract Source Code (Solidity Standard Json-Input format)
// 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 ); } }
// 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); }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.17; import "./IBasePolygonZkEVMGlobalExitRoot.sol"; interface IPolygonZkEVMGlobalExitRoot is IBasePolygonZkEVMGlobalExitRoot { function getLastGlobalExitRoot() external view returns (bytes32); }
// 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)); } }
{ "optimizer": { "enabled": true, "runs": 999999 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.