Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
21001719 | 1 hr ago | 0.00034882 ETH | ||||
21001719 | 1 hr ago | 0.00034882 ETH | ||||
21000352 | 5 hrs ago | 0.00035632 ETH | ||||
21000352 | 5 hrs ago | 0.00035632 ETH | ||||
20999073 | 10 hrs ago | 0.00036745 ETH | ||||
20999073 | 10 hrs ago | 0.00036745 ETH | ||||
20997401 | 15 hrs ago | 0.00034932 ETH | ||||
20997401 | 15 hrs ago | 0.00034932 ETH | ||||
20995639 | 21 hrs ago | 0.00034934 ETH | ||||
20995639 | 21 hrs ago | 0.00034934 ETH | ||||
20994265 | 26 hrs ago | 0.00035096 ETH | ||||
20994265 | 26 hrs ago | 0.00035096 ETH | ||||
20993187 | 29 hrs ago | 0.00035537 ETH | ||||
20993187 | 29 hrs ago | 0.00035537 ETH | ||||
20991817 | 34 hrs ago | 0.00035319 ETH | ||||
20991817 | 34 hrs ago | 0.00035319 ETH | ||||
20990333 | 39 hrs ago | 0.00035033 ETH | ||||
20990333 | 39 hrs ago | 0.00035033 ETH | ||||
20988831 | 44 hrs ago | 0.00035037 ETH | ||||
20988831 | 44 hrs ago | 0.00035037 ETH | ||||
20987494 | 2 days ago | 0.00035187 ETH | ||||
20987494 | 2 days ago | 0.00035187 ETH | ||||
20986370 | 2 days ago | 0.00035322 ETH | ||||
20986370 | 2 days ago | 0.00035322 ETH | ||||
20985506 | 2 days ago | 0.00035559 ETH |
Loading...
Loading
Contract Name:
LayerZeroBridge
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "./ILayerZeroReceiver.sol"; import "./ILayerZeroEndpoint.sol"; import "./ILayerZeroUserApplicationConfig.sol"; import "./LayerZeroStorage.sol"; import "../zksync/ReentrancyGuard.sol"; import "../interfaces/ISyncService.sol"; /// @title LayerZero bridge implementation of non-blocking model /// @dev if message is blocking we should call `retryPayload` of endpoint to retry /// the reasons for message blocking may be: /// * `_dstAddress` is not deployed to dst chain, and we can deploy LayerZeroBridge to dst chain to fix it. /// * lzReceive cost more gas than `_gasLimit` that endpoint send, and user should call `retryMessage` to fix it. /// * lzReceive reverted unexpected, and we can fix bug and deploy a new contract to fix it. /// @author zk.link contract LayerZeroBridge is ReentrancyGuard, LayerZeroStorage, ISyncService, ILayerZeroReceiver, ILayerZeroUserApplicationConfig { modifier onlyEndpoint { require(msg.sender == address(endpoint), "Require endpoint"); _; } modifier onlyGovernor { require(msg.sender == zklink.networkGovernor(), "Caller is not governor"); _; } modifier onlyZkLink { require(msg.sender == address(zklink), "Caller is not zkLink"); _; } /// @param _zklink The zklink contract address /// @param _endpoint The LayerZero endpoint constructor(IZkLink _zklink, ILayerZeroEndpoint _endpoint) { initializeReentrancyGuard(); zklink = _zklink; endpoint = _endpoint; } //---------------------------UserApplication config---------------------------------------- function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external override onlyGovernor { endpoint.setConfig(_version, _chainId, _configType, _config); } function setSendVersion(uint16 _version) external override onlyGovernor { endpoint.setSendVersion(_version); } function setReceiveVersion(uint16 _version) external override onlyGovernor { endpoint.setReceiveVersion(_version); } function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyGovernor { endpoint.forceResumeReceive(_srcChainId, _srcAddress); } /// @notice Set bridge destination /// @param zkLinkChainId zkLink chain id /// @param lzChainId LayerZero chain id /// @param contractAddr LayerZeroBridge contract address on other chains function setDestination(uint8 zkLinkChainId, uint16 lzChainId, bytes calldata contractAddr) external onlyGovernor { zkLinkChainIdToLZChainId[zkLinkChainId] = lzChainId; lzChainIdToZKLinkChainId[lzChainId] = zkLinkChainId; destinations[lzChainId] = contractAddr; emit UpdateDestination(zkLinkChainId, lzChainId, contractAddr); } function estimateSendSyncHashFee(bytes32 syncHash) external view returns (uint nativeFee) { uint16 dstChainId = zkLinkChainIdToLZChainId[MASTER_CHAIN_ID]; checkDstChainId(dstChainId); bytes memory payload = buildSyncHashPayload(syncHash); (nativeFee, ) = endpoint.estimateFees(dstChainId, address(this), payload, false, new bytes(0)); } function sendSyncHash(bytes32 syncHash) external override onlyZkLink payable { // ===Checks=== // send msg to master chain uint16 dstChainId = zkLinkChainIdToLZChainId[MASTER_CHAIN_ID]; bytes memory trustedRemote = checkDstChainId(dstChainId); // ===Interactions=== // send LayerZero message bytes memory path = abi.encodePacked(trustedRemote, address(this)); bytes memory payload = buildSyncHashPayload(syncHash); // solhint-disable-next-line check-send-result endpoint.send{value:msg.value}(dstChainId, path, payload, payable(tx.origin), address(0), new bytes(0)); } function buildSyncHashPayload(bytes32 syncHash) internal pure returns (bytes memory payload) { payload = abi.encode(syncHash); } function estimateConfirmBlockFee(uint8 destZkLinkChainId, uint32 blockNumber) external view returns (uint nativeFee) { uint16 dstChainId = zkLinkChainIdToLZChainId[destZkLinkChainId]; checkDstChainId(dstChainId); bytes memory payload = buildConfirmPayload(blockNumber); (nativeFee, ) = endpoint.estimateFees(dstChainId, address(this), payload, false, new bytes(0)); } function confirmBlock(uint8 destZkLinkChainId, uint32 blockNumber) external override onlyZkLink payable { // ===Checks=== uint16 dstChainId = zkLinkChainIdToLZChainId[destZkLinkChainId]; bytes memory trustedRemote = checkDstChainId(dstChainId); // ===Interactions=== // send LayerZero message bytes memory path = abi.encodePacked(trustedRemote, address(this)); bytes memory payload = buildConfirmPayload(blockNumber); // solhint-disable-next-line check-send-result endpoint.send{value:msg.value}(dstChainId, path, payload, payable(tx.origin), address(0), new bytes(0)); } function buildConfirmPayload(uint32 blockNumber) internal pure returns (bytes memory payload) { payload = abi.encode(blockNumber); } function _nonblockingLzReceive(uint16 srcChainId, bytes calldata /**srcAddress**/, uint64 /**nonce**/, bytes calldata payload) internal { // unpack payload uint8 zkLinkChainId = lzChainIdToZKLinkChainId[srcChainId]; require(zkLinkChainId > 0, "zkLink chain id not config"); if (CHAIN_ID == MASTER_CHAIN_ID) { bytes32 syncHash = abi.decode(payload, (bytes32)); zklink.receiveSyncHash(zkLinkChainId, syncHash); } else { uint32 blockNumber = abi.decode(payload, (uint32)); zklink.receiveBlockConfirmation(blockNumber); } } /// @notice Receive the bytes payload from the source chain via LayerZero /// @dev lzReceive can only be called by endpoint /// @dev srcPath(in UltraLightNodeV2) = abi.encodePacked(srcAddress, dstAddress); function lzReceive(uint16 srcChainId, bytes calldata srcPath, uint64 nonce, bytes calldata payload) external override onlyEndpoint nonReentrant { // reject invalid src contract address bytes memory srcAddress = destinations[srcChainId]; bytes memory path = abi.encodePacked(srcAddress, address(this)); require(keccak256(path) == keccak256(srcPath), "Invalid src"); // try-catch all errors/exceptions // solhint-disable-next-line no-empty-blocks try this.nonblockingLzReceive(srcChainId, srcAddress, nonce, payload) { // do nothing } catch { // error / exception failedMessages[srcChainId][srcAddress][nonce] = keccak256(payload); emit MessageFailed(srcChainId, srcAddress, nonce, payload); } } function nonblockingLzReceive(uint16 srcChainId, bytes calldata srcAddress, uint64 nonce, bytes calldata payload) public { // only internal transaction require(msg.sender == address(this), "Caller must be this bridge"); _nonblockingLzReceive(srcChainId, srcAddress, nonce, payload); } /// @notice Retry the failed message, payload hash must be exist function retryMessage(uint16 srcChainId, bytes calldata srcAddress, uint64 nonce, bytes calldata payload) external payable virtual nonReentrant { // assert there is message to retry bytes32 payloadHash = failedMessages[srcChainId][srcAddress][nonce]; require(payloadHash != bytes32(0), "No stored message"); require(keccak256(payload) == payloadHash, "Invalid payload"); // clear the stored message failedMessages[srcChainId][srcAddress][nonce] = bytes32(0); // execute the message. revert if it fails again _nonblockingLzReceive(srcChainId, srcAddress, nonce, payload); } function checkDstChainId(uint16 dstChainId) internal view returns (bytes memory trustedRemote) { trustedRemote = destinations[dstChainId]; require(trustedRemote.length > 0, "Trust remote not exist"); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "./ILayerZeroUserApplicationConfig.sol"; interface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig { // @notice send a LayerZero message to the specified address at a LayerZero endpoint. // @param _dstChainId - the destination chain identifier // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains // @param _payload - a custom bytes payload to send to the destination contract // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination function send(uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable; // @notice used by the messaging library to publish verified payload // @param _srcChainId - the source chain identifier // @param _srcAddress - the source contract (as bytes) at the source chain // @param _dstAddress - the address on destination chain // @param _nonce - the unbound message ordering nonce // @param _gasLimit - the gas limit for external contract execution // @param _payload - verified payload to send to the destination contract function receivePayload(uint16 _srcChainId, bytes calldata _srcAddress, address _dstAddress, uint64 _nonce, uint _gasLimit, bytes calldata _payload) external; // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64); // @notice get the outboundNonce from this source chain which, consequently, is always an EVM // @param _srcAddress - the source chain contract address function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64); // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery // @param _dstChainId - the destination chain identifier // @param _userApplication - the user app address on this EVM chain // @param _payload - the custom message to send over LayerZero // @param _payInZRO - if false, user app pays the protocol fee in native token // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain function estimateFees(uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam) external view returns (uint nativeFee, uint zroFee); // @notice get this Endpoint's immutable source identifier function getChainId() external view returns (uint16); // @notice the interface to retry failed message on this Endpoint destination // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address // @param _payload - the payload to be retried function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external; // @notice query if any STORED payload (message blocking) at the endpoint. // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool); // @notice query if the _libraryAddress is valid for sending msgs. // @param _userApplication - the user app address on this EVM chain function getSendLibraryAddress(address _userApplication) external view returns (address); // @notice query if the _libraryAddress is valid for receiving msgs. // @param _userApplication - the user app address on this EVM chain function getReceiveLibraryAddress(address _userApplication) external view returns (address); // @notice query if the non-reentrancy guard for send() is on // @return true if the guard is on. false otherwise function isSendingPayload() external view returns (bool); // @notice query if the non-reentrancy guard for receive() is on // @return true if the guard is on. false otherwise function isReceivingPayload() external view returns (bool); // @notice get the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version // @param _chainId - the chainId for the pending config change // @param _userApplication - the contract address of the user application // @param _configType - type of configuration. every messaging library has its own convention. function getConfig(uint16 _version, uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory); // @notice get the send() LayerZero messaging library version // @param _userApplication - the contract address of the user application function getSendVersion(address _userApplication) external view returns (uint16); // @notice get the lzReceive() LayerZero messaging library version // @param _userApplication - the contract address of the user application function getReceiveVersion(address _userApplication) external view returns (uint16); }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT interface ILayerZeroReceiver { // @notice LayerZero endpoint will invoke this function to deliver the message on the destination // @param _srcChainId - the source endpoint identifier // @param _srcAddress - the source sending contract address from the source chain // @param _nonce - the ordered message nonce // @param _payload - the signed payload is the UA bytes has encoded to be sent function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external; }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT interface ILayerZeroUserApplicationConfig { // @notice set the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version // @param _chainId - the chainId for the pending config change // @param _configType - type of configuration. every messaging library has its own convention. // @param _config - configuration in the bytes. can encode arbitrary content. function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external; // @notice set the send() LayerZero messaging library version to _version // @param _version - new messaging library version function setSendVersion(uint16 _version) external; // @notice set the lzReceive() LayerZero messaging library version to _version // @param _version - new messaging library version function setReceiveVersion(uint16 _version) external; // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload // @param _srcChainId - the chainId of the source chain // @param _srcAddress - the contract address of the source contract at the source chain function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external; }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "./ILayerZeroEndpoint.sol"; import "../interfaces/IZkLink.sol"; import {Config} from "../zksync/Config.sol"; /// @title LayerZero bridge storage /// @author zk.link /// @dev Do not initialize any variables of this contract /// Do not break the alignment of contract storage contract LayerZeroStorage is Config { /// @notice zklink contract address IZkLink public zklink; /// @notice LayerZero endpoint that used to send and receive message ILayerZeroEndpoint public endpoint; /// @notice zkLink chainId => lz chainId mapping(uint8 => uint16) public zkLinkChainIdToLZChainId; /// @notice lz chainId => zkLink chainId mapping(uint16 => uint8) public lzChainIdToZKLinkChainId; /// @notice bridge contract address on other chains mapping(uint16 => bytes) public destinations; /// @notice failed message of lz non-blocking model /// @dev the struct of failedMessages is (srcChainId => srcAddress => nonce => payloadHash) /// srcChainId is the id of message source chain /// srcAddress is the trust remote address on the source chain who send message /// nonce is inbound message nonce /// payLoadHash is the keccak256 of message payload mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages; event UpdateDestination(uint8 zkLinkChainId, uint16 lzChainId, bytes destination); event MessageFailed(uint16 srcChainId, bytes srcAddress, uint64 nonce, bytes payload); }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT OR Apache-2.0 /// @title Sync service for sending cross chain message /// @author zk.link interface ISyncService { /// @notice Return the fee of sending sync hash to master chain /// @param syncHash the sync hash function estimateSendSyncHashFee(bytes32 syncHash) external view returns (uint nativeFee); /// @notice Send sync hash message to master chain /// @param syncHash the sync hash function sendSyncHash(bytes32 syncHash) external payable; /// @notice Estimate the fee of sending confirm block message to slaver chain /// @param destZkLinkChainId the destination chain id defined by zkLink /// @param blockNumber the height of stored block function estimateConfirmBlockFee(uint8 destZkLinkChainId, uint32 blockNumber) external view returns (uint nativeFee); /// @notice Send block confirmation message to slaver chains /// @param destZkLinkChainId the destination chain id defined by zkLink /// @param blockNumber the block height function confirmBlock(uint8 destZkLinkChainId, uint32 blockNumber) external payable; }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT OR Apache-2.0 import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /// @title ZkLink interface contract /// @author zk.link interface IZkLink { /// @notice Return the network governor function networkGovernor() external view returns (address); /// @notice Deposit ETH to Layer 2 - transfer ether from user into contract, validate it, register deposit function depositETH(bytes32 _zkLinkAddress, uint8 _subAccountId) external payable; /// @notice Deposit ERC20 token to Layer 2 - transfer ERC20 tokens from user into contract, validate it, register deposit function depositERC20(IERC20 _token, uint104 _amount, bytes32 _zkLinkAddress, uint8 _subAccountId, bool _mapping) external; /// @notice Receive block sync hash from slaver chain function receiveSyncHash(uint8 chainId, bytes32 syncHash) external; /// @notice Receive block confirmation from master chain function receiveBlockConfirmation(uint32 blockNumber) external; /// @notice Withdraw token to L1 for user by gateway /// @param owner User receive token on L1 /// @param token Token address /// @param amount The amount(recovered decimals) of withdraw operation /// @param fastWithdrawFeeRate Fast withdraw fee rate taken by acceptor /// @param accountIdOfNonce Account that supply nonce, may be different from accountId /// @param subAccountIdOfNonce SubAccount that supply nonce /// @param nonce SubAccount nonce, used to produce unique accept info function withdrawToL1(address owner, address token, uint128 amount, uint16 fastWithdrawFeeRate, uint32 accountIdOfNonce, uint8 subAccountIdOfNonce, uint32 nonce) external payable; /// @notice Withdraws tokens from zkLink contract to the owner /// @param _owner Address of the tokens owner /// @param _tokenId Token id /// @param _amount Amount to withdraw to request. /// @dev NOTE: We will call ERC20.transfer(.., _amount), but if according to internal logic of ERC20 token zkLink contract /// balance will be decreased by value more then _amount we will try to subtract this value from user pending balance function withdrawPendingBalance(address payable _owner, uint16 _tokenId, uint128 _amount) external; }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT OR Apache-2.0 /// @title zkSync configuration constants /// @author Matter Labs contract Config { /// @dev Default fee address in state address public constant DEFAULT_FEE_ADDRESS = 0x374632e7D48B7872d904524FdC5Dd4516F42cDFF; bytes32 internal constant EMPTY_STRING_KECCAK = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; /// @dev Bytes in one chunk uint8 internal constant CHUNK_BYTES = 23; /// @dev Bytes of L2 PubKey hash uint8 internal constant PUBKEY_HASH_BYTES = 20; /// @dev Max amount of tokens registered in the network uint16 internal constant MAX_AMOUNT_OF_REGISTERED_TOKENS = 65535; /// @dev Max account id that could be registered in the network uint32 internal constant MAX_ACCOUNT_ID = 16777215; /// @dev Max sub account id that could be bound to account id uint8 internal constant MAX_SUB_ACCOUNT_ID = 31; /// @dev Expected average period of block creation uint256 internal constant BLOCK_PERIOD = 12 seconds; /// @dev Operation chunks uint256 internal constant DEPOSIT_BYTES = 3 * CHUNK_BYTES; uint256 internal constant FULL_EXIT_BYTES = 3 * CHUNK_BYTES; uint256 internal constant WITHDRAW_BYTES = 5 * CHUNK_BYTES; uint256 internal constant FORCED_EXIT_BYTES = 3 * CHUNK_BYTES; uint256 internal constant CHANGE_PUBKEY_BYTES = 3 * CHUNK_BYTES; /// @dev Expiration delta for priority request to be satisfied (in seconds) /// @dev NOTE: Priority expiration should be > (EXPECT_VERIFICATION_IN * BLOCK_PERIOD) /// @dev otherwise incorrect block with priority op could not be reverted. uint256 internal constant PRIORITY_EXPIRATION_PERIOD = 14 days; /// @dev Expiration delta for priority request to be satisfied (in ETH blocks) uint256 internal constant PRIORITY_EXPIRATION = 2592000; /// @dev Reserved time for users to send full exit priority operation in case of an upgrade (in seconds) uint256 internal constant MASS_FULL_EXIT_PERIOD = 5 days; /// @dev Reserved time for users to withdraw funds from full exit priority operation in case of an upgrade (in seconds) uint256 internal constant TIME_TO_WITHDRAW_FUNDS_FROM_FULL_EXIT = 2 days; /// @dev Notice period before activation preparation status of upgrade mode (in seconds) /// @dev NOTE: we must reserve for users enough time to send full exit operation, wait maximum time for processing this operation and withdraw funds from it. uint256 internal constant UPGRADE_NOTICE_PERIOD = 0; /// @dev Max commitment produced in zk proof where highest 3 bits is 0 uint256 internal constant MAX_PROOF_COMMITMENT = 0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; /// @dev Bit mask to apply for verifier public input before verifying. uint256 internal constant INPUT_MASK = 14474011154664524427946373126085988481658748083205070504932198000989141204991; /// @dev Auth fact reset timelock uint256 internal constant AUTH_FACT_RESET_TIMELOCK = 1 days; /// @dev Max deposit of ERC20 token that is possible to deposit uint128 internal constant MAX_DEPOSIT_AMOUNT = 20282409603651670423947251286015; /// @dev Chain id defined by ZkLink uint8 public constant CHAIN_ID = 4; /// @dev Min chain id defined by ZkLink uint8 public constant MIN_CHAIN_ID = 1; /// @dev Max chain id defined by ZkLink uint8 public constant MAX_CHAIN_ID = 9; /// @dev All chain index, for example [1, 2, 3, 4] => 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 = 15 uint256 public constant ALL_CHAINS = 268; /// @dev Master chain id defined by ZkLink uint8 public constant MASTER_CHAIN_ID = 9; /// @dev NONE, ORIGIN, NEXUS uint8 internal constant SYNC_TYPE = 1; uint8 internal constant SYNC_NONE = 0; uint8 internal constant SYNC_ORIGIN = 1; uint8 internal constant SYNC_NEXUS = 2; /// @dev Token decimals is a fixed value at layer two in ZkLink uint8 internal constant TOKEN_DECIMALS_OF_LAYER2 = 18; /// @dev The default fee account id uint32 internal constant DEFAULT_FEE_ACCOUNT_ID = 0; /// @dev Global asset account in the network /// @dev Can not deposit to or full exit this account uint32 internal constant GLOBAL_ASSET_ACCOUNT_ID = 1; bytes32 internal constant GLOBAL_ASSET_ACCOUNT_ADDRESS = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; /// @dev USD and USD stable tokens defined by zkLink /// @dev User can deposit USD stable token(eg. USDC, BUSD) to get USD in layer two /// @dev And user also can full exit USD in layer two and get back USD stable tokens uint16 internal constant USD_TOKEN_ID = 1; uint16 internal constant MIN_USD_STABLE_TOKEN_ID = 17; uint16 internal constant MAX_USD_STABLE_TOKEN_ID = 31; }
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT OR Apache-2.0 /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. * * _Since v2.5.0:_ this module is now much more gas efficient, given net gas * metering changes introduced in the Istanbul hardfork. */ contract ReentrancyGuard { /// @dev Address of lock flag variable. /// @dev Flag is placed at random memory location to not interfere with Storage contract. uint256 private constant LOCK_FLAG_ADDRESS = 0x8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf4; // keccak256("ReentrancyGuard") - 1; // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/566a774222707e424896c0c390a84dc3c13bdcb2/contracts/security/ReentrancyGuard.sol // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; function initializeReentrancyGuard() internal { uint256 lockSlotOldValue; // Storing an initial non-zero value makes deployment a bit more // expensive, but in exchange every call to nonReentrant // will be cheaper. assembly { lockSlotOldValue := sload(LOCK_FLAG_ADDRESS) sstore(LOCK_FLAG_ADDRESS, _NOT_ENTERED) } // Check that storage slot for reentrancy guard is empty to rule out possibility of double initialization require(lockSlotOldValue == 0, "1B"); } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { uint256 _status; assembly { _status := sload(LOCK_FLAG_ADDRESS) } // On the first call to nonReentrant, _notEntered will be true require(_status == _NOT_ENTERED); // Any calls to nonReentrant after this point will fail assembly { sstore(LOCK_FLAG_ADDRESS, _ENTERED) } _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) assembly { sstore(LOCK_FLAG_ADDRESS, _NOT_ENTERED) } } }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IZkLink","name":"_zklink","type":"address"},{"internalType":"contract ILayerZeroEndpoint","name":"_endpoint","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"payload","type":"bytes"}],"name":"MessageFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"zkLinkChainId","type":"uint8"},{"indexed":false,"internalType":"uint16","name":"lzChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"destination","type":"bytes"}],"name":"UpdateDestination","type":"event"},{"inputs":[],"name":"ALL_CHAINS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CHAIN_ID","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_FEE_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MASTER_CHAIN_ID","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_CHAIN_ID","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_CHAIN_ID","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"destZkLinkChainId","type":"uint8"},{"internalType":"uint32","name":"blockNumber","type":"uint32"}],"name":"confirmBlock","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"destinations","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"destZkLinkChainId","type":"uint8"},{"internalType":"uint32","name":"blockNumber","type":"uint32"}],"name":"estimateConfirmBlockFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"syncHash","type":"bytes32"}],"name":"estimateSendSyncHashFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"failedMessages","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"forceResumeReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"lzChainIdToZKLinkChainId","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"srcChainId","type":"uint16"},{"internalType":"bytes","name":"srcPath","type":"bytes"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"srcChainId","type":"uint16"},{"internalType":"bytes","name":"srcAddress","type":"bytes"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"nonblockingLzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"srcChainId","type":"uint16"},{"internalType":"bytes","name":"srcAddress","type":"bytes"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"retryMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"syncHash","type":"bytes32"}],"name":"sendSyncHash","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_configType","type":"uint256"},{"internalType":"bytes","name":"_config","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"zkLinkChainId","type":"uint8"},{"internalType":"uint16","name":"lzChainId","type":"uint16"},{"internalType":"bytes","name":"contractAddr","type":"bytes"}],"name":"setDestination","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setReceiveVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setSendVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"zkLinkChainIdToLZChainId","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"zklink","outputs":[{"internalType":"contract IZkLink","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6080346100df57601f6117ab38819003918201601f19168301916001600160401b038311848410176100e45780849260409485528339810103126100df5780516001600160a01b0391828216918290036100df57602001519182168092036100df577f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf46001815491556100b55760018060a01b03199081600054161760005560015416176001556040516116b090816100fb8239f35b60405162461bcd60e51b815260206004820152600260248201526118a160f11b6044820152606490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe608060408181526004908136101561001657600080fd5b600092833560e01c9081621d356714610f13575083816307e0db1714610e7b575080630df8f62214610e5f57806310a7132414610e425783816310ddb13714610d825750806338e7f17614610d4d578381633ea5c2d814610cbf57816342d65a8d14610bd7575080635169051714610b8d578063528aaea414610b655780635b8c41e614610ac55780635bc105c01461082d5780635e280f1114610a9c57806363fbcb371461083257806364494fdf1461082d57806366ad5c8a146107115783816370bef682146106435750806385e1f4d01461062857838163cbed8b9c146104e757508063d1deba1f146102d7578063dfd7aecb146102a2578063e10136ff1461026f578063e1ba1b22146102115763f95eba5f1461013557600080fd5b3461020d578060031936011261020d578061014e6113dc565b9260ff6101596113ec565b94168552600260205261017d61ffff83872054169461017786611619565b506115be565b9060018060a01b03600154169083519561019687611250565b8787526101b885519788958694859463040a7bb160e41b8652309186016114ab565b03915afa91821561020357602093926101d3575b5051908152f35b816101f49293503d84116101fc575b6101ec818361126b565b810190611495565b5090386101cc565b503d6101e2565b81513d85823e3d90fd5b8280fd5b503461020d57602036600319011261020d576009835260026020528061ffff81852054169261023f84611619565b50815190803560208301526020825261025782611235565b60018060a01b03600154169083519561019687611250565b83823461029e578160031936011261029e576020905173374632e7d48b7872d904524fdc5dd4516f42cdff8152f35b5080fd5b83823461029e57602036600319011261029e5761ffff8160209360ff6102c66113dc565b168152600285522054169051908152f35b50906102e23661116b565b917f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf4979597949391949760018954036104e35761ffff9060028a551691828a52602094600586526001600160401b03888c20878a5180928686833786820190815203019020931692836000528652876000205480156104ac5761036636878a61137a565b87815191012003610477578590848c5260058252888c20838a51948593843782019081520301902090600052835287856000205587526003825260ff848820541615610434579082809288969594010312610430576103c4906113ff565b83546001600160a01b031690813b1561042c57602463ffffffff9186809486519788958694636472a68560e11b865216908401525af1908115610423575061040f575b506001825580f35b6104189061120c565b61029e578138610407565b513d84823e3d90fd5b8480fd5b8380fd5b835162461bcd60e51b8152808601839052601a60248201527f7a6b4c696e6b20636861696e206964206e6f7420636f6e6669670000000000006044820152606490fd5b875162461bcd60e51b8152808a01879052600f60248201526e125b9d985b1a59081c185e5b1bd859608a1b6044820152606490fd5b885162461bcd60e51b8152808b0188905260116024820152704e6f2073746f726564206d65737361676560781b6044820152606490fd5b8980fd5b808484346106245760803660031901126106245761050361111c565b9161050c61112d565b926064356001600160401b0381116106205761052b903690840161113e565b8654855163f39349ef60e01b81529196916001600160a01b039160209082908890829086165afa9081156106165761056f9183918b916105e8575b5016331461142f565b6001541691823b156105e45787946105be86928851998a97889687956332fb62e760e21b875261ffff809316908701521660248501526044356044850152608060648501526084840191611474565b03925af190811561042357506105d15750f35b6105da9061120c565b6105e15780f35b80fd5b8780fd5b610609915060203d811161060f575b610601818361126b565b810190611410565b8c610566565b503d6105f7565b87513d8b823e3d90fd5b8580fd5b5050fd5b503461020d578260031936011261020d576020925051908152f35b80848480600319360112610624576106596113dc565b6106616113ec565b9060ff60018060a01b039161067a8388541633146114f1565b16855260026020526106ad6106c061ffff8588205416936106bb61069d86611619565b8751948591309060208401611534565b03601f19810185528461126b565b6115be565b9160015416908451936106d285611250565b878552823b156105e4576106fc889587519889968795869562c5803160e81b875232938701611565565b039134905af190811561042357506105d15750f35b5091903461029e576107223661116b565b979492509250503033036107ea5761ffff168452600360205260ff8285205416156107a7576020818596810103126107a25761075d906113ff565b83546001600160a01b031690813b1561042c57602463ffffffff9186809486519788958694636472a68560e11b865216908401525af190811561042357506105d15750f35b505050fd5b815162461bcd60e51b8152602081850152601a60248201527f7a6b4c696e6b20636861696e206964206e6f7420636f6e6669670000000000006044820152606490fd5b825162461bcd60e51b8152602081860152601a60248201527f43616c6c6572206d7573742062652074686973206272696467650000000000006044820152606490fd5b6113c0565b5091903461029e57606036600319011261029e5761084e6113dc565b9061085761112d565b6001600160401b039460443586811161062057610877903690850161113e565b8654835163f39349ef60e01b81526020979395929493916001600160a01b039190899082908a90829086165afa908115610a9257916108c39160ff94938c91610a75575016331461142f565b16948588526002875261ffff8389209216918261ffff19825416179055818852600387528288208660ff19825416179055808752828820988411610a62575061090c88546111d2565b601f8111610a1f575b508697601f84116001146109945791606091849361098396958a9b7fe43f60864da5cecd3b1432049c014ef44d27489bf79c662beb5564bfca9518949b91610989575b508560011b906000198760031b1c19161790555b815197889788528701528501526060840191611474565b0390a180f35b905086013538610958565b808852868820601f198516895b818110610a08575091606093917fe43f60864da5cecd3b1432049c014ef44d27489bf79c662beb5564bfca9518949a9b8761098399989795106109ee575b5050600185811b01905561096c565b870135600019600388901b60f8161c1916905538806109df565b878c013583559a89019a60019092019189016109a1565b888852868820601f850160051c810191888610610a58575b601f0160051c01905b818110610a4d5750610915565b888155600101610a40565b9091508190610a37565b634e487b7160e01b885260419052602487fd5b610a8c91508b3d8d1161060f57610601818361126b565b38610566565b85513d8c823e3d90fd5b83823461029e578160031936011261029e5760015490516001600160a01b039091168152602090f35b50903461020d57606036600319011261020d57610ae061111c565b6024356001600160401b0392838211610620573660238301121561062057816024610b109336930135910161137a565b93604435928316809303610b605760209484869261ffff610b4595168152600584522082865194838680955193849201611332565b82019081520301902090600052825280600020549051908152f35b600080fd5b83823461029e578160031936011261029e57905490516001600160a01b039091168152602090f35b50903461020d57602036600319011261020d5781610bd393610bc09261ffff610bb461111c565b1682526020522061128c565b9051918291602083526020830190611355565b0390f35b80848434610624578060031936011261062457610bf261111c565b6024356001600160401b03811161042c57610c10903690850161113e565b8554845163f39349ef60e01b815291959293916001600160a01b039160209082908690829086165afa908115610cb557610c559183918a91610c97575016331461142f565b6001541690813b15610c93578661ffff916105be82968851998a97889687956342d65a8d60e01b875216908501528960248501526044840191611474565b8680fd5b610caf915060203d811161060f57610601818361126b565b8b610566565b86513d8a823e3d90fd5b80848460203660031901126106245782546001600160a01b0390610ce690821633146114f1565b60098452600260205261ffff828520541690610d17610d25610d0784611619565b8551928391309060208401611534565b03601f19810183528261126b565b8351918535602084015260208352610d3c83611235565b60015416908451936106d285611250565b83823461029e57602036600319011261029e5760ff8160209361ffff610d7161111c565b168152600385522054169051908152f35b8084843461062457602036600319011261062457610d9e61111c565b8354825163f39349ef60e01b81526001600160a01b039160209082908790829086165afa908115610e3857610dde9183918891610e1a575016331461142f565b6001541690813b1561042c57602461ffff91868094865197889586946310ddb13760e01b865216908401525af190811561042357506105d15750f35b610e32915060203d811161060f57610601818361126b565b89610566565b84513d88823e3d90fd5b83823461029e578160031936011261029e576020905161010c8152f35b83823461029e578160031936011261029e576020905160018152f35b8084843461062457602036600319011261062457610e9761111c565b8354825163f39349ef60e01b81526001600160a01b039160209082908790829086165afa908115610e3857610ed79183918891610e1a575016331461142f565b6001541690813b1561042c57602461ffff91868094865197889586946307e0db1760e01b865216908401525af190811561042357506105d15750f35b849291503461020d57610f253661116b565b600154939694959490939192916001600160a01b031633036110e857507f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf49660018854036110e4576002885561ffff8516998a8a52602097818952610fb1610f8e848d2061128c565b8451909990808c0190610fa681610d17308f86611534565b51902092369161137a565b898151910120036110b557303b156104e35789868892610fe588888888519788968796633356ae4560e11b885287016115da565b038183305af19081611097575b5090899a60019a959493921560001461108a578861105c7fe6f254030bcb01ffd20558175c13fcaed6d1520be7becee4c961b65f79243b0d9a8a856110839a61103c368c8c61137a565b848151910120968152600584522082875194838680955193849201611332565b820190815203019020906001600160401b03851660005252816000205551958695866115da565b0390a15580f35b5050505050505050505580f35b996110a960019b96959493929661120c565b99949091929394610ff2565b87606492519162461bcd60e51b8352820152600b60248201526a496e76616c69642073726360a81b6044820152fd5b8880fd5b62461bcd60e51b815260208a820152601060248201526f14995c5d5a5c9948195b991c1bda5b9d60821b6044820152606490fd5b6004359061ffff82168203610b6057565b6024359061ffff82168203610b6057565b9181601f84011215610b60578235916001600160401b038311610b605760208381860195010111610b6057565b906080600319830112610b605760043561ffff81168103610b6057916001600160401b0390602435828111610b6057816111a79160040161113e565b939093926044358181168103610b605792606435918211610b60576111ce9160040161113e565b9091565b90600182811c92168015611202575b60208310146111ec57565b634e487b7160e01b600052602260045260246000fd5b91607f16916111e1565b6001600160401b03811161121f57604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b0382111761121f57604052565b602081019081106001600160401b0382111761121f57604052565b90601f801991011681019081106001600160401b0382111761121f57604052565b90604051918260008254926112a0846111d2565b90818452600194858116908160001461130f57506001146112cc575b50506112ca9250038361126b565b565b9093915060005260209081600020936000915b8183106112f75750506112ca935082010138806112bc565b855488840185015294850194879450918301916112df565b9150506112ca94506020925060ff191682840152151560051b82010138806112bc565b60005b8381106113455750506000910152565b8181015183820152602001611335565b9060209161136e81518092818552858086019101611332565b601f01601f1916010190565b9291926001600160401b03821161121f57604051916113a3601f8201601f19166020018461126b565b829481845281830111610b60578281602093846000960137010152565b34610b60576000366003190112610b6057602060405160098152f35b6004359060ff82168203610b6057565b6024359063ffffffff82168203610b6057565b359063ffffffff82168203610b6057565b90816020910312610b6057516001600160a01b0381168103610b605790565b1561143657565b60405162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba1033b7bb32b93737b960511b6044820152606490fd5b908060209392818452848401376000828201840152601f01601f1916010190565b9190826040910312610b60576020825192015190565b926114ee949261ffff6114d99316855260018060a01b0316602085015260a0604085015260a0840190611355565b91600060608201526080818403910152611355565b90565b156114f857565b60405162461bcd60e51b815260206004820152601460248201527343616c6c6572206973206e6f74207a6b4c696e6b60601b6044820152606490fd5b60209061154a6014949382815194859201611332565b01906bffffffffffffffffffffffff199060601b1681520190565b919261158a6114ee969461ffff6115989416855260c0602086015260c0850190611355565b908382036040850152611355565b6001600160a01b0390931660608201526000608082015280830360a09190910152611355565b63ffffffff60405191166020820152602081526114ee81611235565b906116056114ee9694959361ffff6001600160401b0393168452608060208501526080840190611355565b941660408201526060818503910152611474565b61ffff166000526004602052611632604060002061128c565b9081511561163c57565b60405162461bcd60e51b8152602060048201526016602482015275151c9d5cdd081c995b5bdd19481b9bdd08195e1a5cdd60521b6044820152606490fdfea264697066735822122093416ba1356c92894fa1e04f01d9ee6c60b9788256aedf96b094daa94b95063464736f6c6343000812003300000000000000000000000035d173cdfe4d484bc5985fda55fabad5892c7b8200000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675
Deployed Bytecode
0x608060408181526004908136101561001657600080fd5b600092833560e01c9081621d356714610f13575083816307e0db1714610e7b575080630df8f62214610e5f57806310a7132414610e425783816310ddb13714610d825750806338e7f17614610d4d578381633ea5c2d814610cbf57816342d65a8d14610bd7575080635169051714610b8d578063528aaea414610b655780635b8c41e614610ac55780635bc105c01461082d5780635e280f1114610a9c57806363fbcb371461083257806364494fdf1461082d57806366ad5c8a146107115783816370bef682146106435750806385e1f4d01461062857838163cbed8b9c146104e757508063d1deba1f146102d7578063dfd7aecb146102a2578063e10136ff1461026f578063e1ba1b22146102115763f95eba5f1461013557600080fd5b3461020d578060031936011261020d578061014e6113dc565b9260ff6101596113ec565b94168552600260205261017d61ffff83872054169461017786611619565b506115be565b9060018060a01b03600154169083519561019687611250565b8787526101b885519788958694859463040a7bb160e41b8652309186016114ab565b03915afa91821561020357602093926101d3575b5051908152f35b816101f49293503d84116101fc575b6101ec818361126b565b810190611495565b5090386101cc565b503d6101e2565b81513d85823e3d90fd5b8280fd5b503461020d57602036600319011261020d576009835260026020528061ffff81852054169261023f84611619565b50815190803560208301526020825261025782611235565b60018060a01b03600154169083519561019687611250565b83823461029e578160031936011261029e576020905173374632e7d48b7872d904524fdc5dd4516f42cdff8152f35b5080fd5b83823461029e57602036600319011261029e5761ffff8160209360ff6102c66113dc565b168152600285522054169051908152f35b50906102e23661116b565b917f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf4979597949391949760018954036104e35761ffff9060028a551691828a52602094600586526001600160401b03888c20878a5180928686833786820190815203019020931692836000528652876000205480156104ac5761036636878a61137a565b87815191012003610477578590848c5260058252888c20838a51948593843782019081520301902090600052835287856000205587526003825260ff848820541615610434579082809288969594010312610430576103c4906113ff565b83546001600160a01b031690813b1561042c57602463ffffffff9186809486519788958694636472a68560e11b865216908401525af1908115610423575061040f575b506001825580f35b6104189061120c565b61029e578138610407565b513d84823e3d90fd5b8480fd5b8380fd5b835162461bcd60e51b8152808601839052601a60248201527f7a6b4c696e6b20636861696e206964206e6f7420636f6e6669670000000000006044820152606490fd5b875162461bcd60e51b8152808a01879052600f60248201526e125b9d985b1a59081c185e5b1bd859608a1b6044820152606490fd5b885162461bcd60e51b8152808b0188905260116024820152704e6f2073746f726564206d65737361676560781b6044820152606490fd5b8980fd5b808484346106245760803660031901126106245761050361111c565b9161050c61112d565b926064356001600160401b0381116106205761052b903690840161113e565b8654855163f39349ef60e01b81529196916001600160a01b039160209082908890829086165afa9081156106165761056f9183918b916105e8575b5016331461142f565b6001541691823b156105e45787946105be86928851998a97889687956332fb62e760e21b875261ffff809316908701521660248501526044356044850152608060648501526084840191611474565b03925af190811561042357506105d15750f35b6105da9061120c565b6105e15780f35b80fd5b8780fd5b610609915060203d811161060f575b610601818361126b565b810190611410565b8c610566565b503d6105f7565b87513d8b823e3d90fd5b8580fd5b5050fd5b503461020d578260031936011261020d576020925051908152f35b80848480600319360112610624576106596113dc565b6106616113ec565b9060ff60018060a01b039161067a8388541633146114f1565b16855260026020526106ad6106c061ffff8588205416936106bb61069d86611619565b8751948591309060208401611534565b03601f19810185528461126b565b6115be565b9160015416908451936106d285611250565b878552823b156105e4576106fc889587519889968795869562c5803160e81b875232938701611565565b039134905af190811561042357506105d15750f35b5091903461029e576107223661116b565b979492509250503033036107ea5761ffff168452600360205260ff8285205416156107a7576020818596810103126107a25761075d906113ff565b83546001600160a01b031690813b1561042c57602463ffffffff9186809486519788958694636472a68560e11b865216908401525af190811561042357506105d15750f35b505050fd5b815162461bcd60e51b8152602081850152601a60248201527f7a6b4c696e6b20636861696e206964206e6f7420636f6e6669670000000000006044820152606490fd5b825162461bcd60e51b8152602081860152601a60248201527f43616c6c6572206d7573742062652074686973206272696467650000000000006044820152606490fd5b6113c0565b5091903461029e57606036600319011261029e5761084e6113dc565b9061085761112d565b6001600160401b039460443586811161062057610877903690850161113e565b8654835163f39349ef60e01b81526020979395929493916001600160a01b039190899082908a90829086165afa908115610a9257916108c39160ff94938c91610a75575016331461142f565b16948588526002875261ffff8389209216918261ffff19825416179055818852600387528288208660ff19825416179055808752828820988411610a62575061090c88546111d2565b601f8111610a1f575b508697601f84116001146109945791606091849361098396958a9b7fe43f60864da5cecd3b1432049c014ef44d27489bf79c662beb5564bfca9518949b91610989575b508560011b906000198760031b1c19161790555b815197889788528701528501526060840191611474565b0390a180f35b905086013538610958565b808852868820601f198516895b818110610a08575091606093917fe43f60864da5cecd3b1432049c014ef44d27489bf79c662beb5564bfca9518949a9b8761098399989795106109ee575b5050600185811b01905561096c565b870135600019600388901b60f8161c1916905538806109df565b878c013583559a89019a60019092019189016109a1565b888852868820601f850160051c810191888610610a58575b601f0160051c01905b818110610a4d5750610915565b888155600101610a40565b9091508190610a37565b634e487b7160e01b885260419052602487fd5b610a8c91508b3d8d1161060f57610601818361126b565b38610566565b85513d8c823e3d90fd5b83823461029e578160031936011261029e5760015490516001600160a01b039091168152602090f35b50903461020d57606036600319011261020d57610ae061111c565b6024356001600160401b0392838211610620573660238301121561062057816024610b109336930135910161137a565b93604435928316809303610b605760209484869261ffff610b4595168152600584522082865194838680955193849201611332565b82019081520301902090600052825280600020549051908152f35b600080fd5b83823461029e578160031936011261029e57905490516001600160a01b039091168152602090f35b50903461020d57602036600319011261020d5781610bd393610bc09261ffff610bb461111c565b1682526020522061128c565b9051918291602083526020830190611355565b0390f35b80848434610624578060031936011261062457610bf261111c565b6024356001600160401b03811161042c57610c10903690850161113e565b8554845163f39349ef60e01b815291959293916001600160a01b039160209082908690829086165afa908115610cb557610c559183918a91610c97575016331461142f565b6001541690813b15610c93578661ffff916105be82968851998a97889687956342d65a8d60e01b875216908501528960248501526044840191611474565b8680fd5b610caf915060203d811161060f57610601818361126b565b8b610566565b86513d8a823e3d90fd5b80848460203660031901126106245782546001600160a01b0390610ce690821633146114f1565b60098452600260205261ffff828520541690610d17610d25610d0784611619565b8551928391309060208401611534565b03601f19810183528261126b565b8351918535602084015260208352610d3c83611235565b60015416908451936106d285611250565b83823461029e57602036600319011261029e5760ff8160209361ffff610d7161111c565b168152600385522054169051908152f35b8084843461062457602036600319011261062457610d9e61111c565b8354825163f39349ef60e01b81526001600160a01b039160209082908790829086165afa908115610e3857610dde9183918891610e1a575016331461142f565b6001541690813b1561042c57602461ffff91868094865197889586946310ddb13760e01b865216908401525af190811561042357506105d15750f35b610e32915060203d811161060f57610601818361126b565b89610566565b84513d88823e3d90fd5b83823461029e578160031936011261029e576020905161010c8152f35b83823461029e578160031936011261029e576020905160018152f35b8084843461062457602036600319011261062457610e9761111c565b8354825163f39349ef60e01b81526001600160a01b039160209082908790829086165afa908115610e3857610ed79183918891610e1a575016331461142f565b6001541690813b1561042c57602461ffff91868094865197889586946307e0db1760e01b865216908401525af190811561042357506105d15750f35b849291503461020d57610f253661116b565b600154939694959490939192916001600160a01b031633036110e857507f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf49660018854036110e4576002885561ffff8516998a8a52602097818952610fb1610f8e848d2061128c565b8451909990808c0190610fa681610d17308f86611534565b51902092369161137a565b898151910120036110b557303b156104e35789868892610fe588888888519788968796633356ae4560e11b885287016115da565b038183305af19081611097575b5090899a60019a959493921560001461108a578861105c7fe6f254030bcb01ffd20558175c13fcaed6d1520be7becee4c961b65f79243b0d9a8a856110839a61103c368c8c61137a565b848151910120968152600584522082875194838680955193849201611332565b820190815203019020906001600160401b03851660005252816000205551958695866115da565b0390a15580f35b5050505050505050505580f35b996110a960019b96959493929661120c565b99949091929394610ff2565b87606492519162461bcd60e51b8352820152600b60248201526a496e76616c69642073726360a81b6044820152fd5b8880fd5b62461bcd60e51b815260208a820152601060248201526f14995c5d5a5c9948195b991c1bda5b9d60821b6044820152606490fd5b6004359061ffff82168203610b6057565b6024359061ffff82168203610b6057565b9181601f84011215610b60578235916001600160401b038311610b605760208381860195010111610b6057565b906080600319830112610b605760043561ffff81168103610b6057916001600160401b0390602435828111610b6057816111a79160040161113e565b939093926044358181168103610b605792606435918211610b60576111ce9160040161113e565b9091565b90600182811c92168015611202575b60208310146111ec57565b634e487b7160e01b600052602260045260246000fd5b91607f16916111e1565b6001600160401b03811161121f57604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b0382111761121f57604052565b602081019081106001600160401b0382111761121f57604052565b90601f801991011681019081106001600160401b0382111761121f57604052565b90604051918260008254926112a0846111d2565b90818452600194858116908160001461130f57506001146112cc575b50506112ca9250038361126b565b565b9093915060005260209081600020936000915b8183106112f75750506112ca935082010138806112bc565b855488840185015294850194879450918301916112df565b9150506112ca94506020925060ff191682840152151560051b82010138806112bc565b60005b8381106113455750506000910152565b8181015183820152602001611335565b9060209161136e81518092818552858086019101611332565b601f01601f1916010190565b9291926001600160401b03821161121f57604051916113a3601f8201601f19166020018461126b565b829481845281830111610b60578281602093846000960137010152565b34610b60576000366003190112610b6057602060405160098152f35b6004359060ff82168203610b6057565b6024359063ffffffff82168203610b6057565b359063ffffffff82168203610b6057565b90816020910312610b6057516001600160a01b0381168103610b605790565b1561143657565b60405162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba1033b7bb32b93737b960511b6044820152606490fd5b908060209392818452848401376000828201840152601f01601f1916010190565b9190826040910312610b60576020825192015190565b926114ee949261ffff6114d99316855260018060a01b0316602085015260a0604085015260a0840190611355565b91600060608201526080818403910152611355565b90565b156114f857565b60405162461bcd60e51b815260206004820152601460248201527343616c6c6572206973206e6f74207a6b4c696e6b60601b6044820152606490fd5b60209061154a6014949382815194859201611332565b01906bffffffffffffffffffffffff199060601b1681520190565b919261158a6114ee969461ffff6115989416855260c0602086015260c0850190611355565b908382036040850152611355565b6001600160a01b0390931660608201526000608082015280830360a09190910152611355565b63ffffffff60405191166020820152602081526114ee81611235565b906116056114ee9694959361ffff6001600160401b0393168452608060208501526080840190611355565b941660408201526060818503910152611474565b61ffff166000526004602052611632604060002061128c565b9081511561163c57565b60405162461bcd60e51b8152602060048201526016602482015275151c9d5cdd081c995b5bdd19481b9bdd08195e1a5cdd60521b6044820152606490fdfea264697066735822122093416ba1356c92894fa1e04f01d9ee6c60b9788256aedf96b094daa94b95063464736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000035d173cdfe4d484bc5985fda55fabad5892c7b8200000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675
-----Decoded View---------------
Arg [0] : _zklink (address): 0x35D173cdfE4d484BC5985fDa55FABad5892c7B82
Arg [1] : _endpoint (address): 0x66A71Dcef29A0fFBDBE3c6a460a3B5BC225Cd675
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000035d173cdfe4d484bc5985fda55fabad5892c7b82
Arg [1] : 00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 29 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ 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.