ETH Price: $2,413.42 (-0.32%)

Contract

0x057C6c17C1ea13fD4372D1e2592Db7Cb92C3F4A4
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Bridge ETH174145422023-06-05 13:13:47467 days ago1685970827IN
0x057C6c17...b92C3F4A4
0.01549412 ETH0.0124499251.45
Transfer Ownersh...174065312023-06-04 10:03:23468 days ago1685873003IN
0x057C6c17...b92C3F4A4
0 ETH0.0005937720.71135606
Bridge ETH173942862023-06-02 16:38:59470 days ago1685723939IN
0x057C6c17...b92C3F4A4
0.000594 ETH0.0086859535.89695678
Bridge ETH173942222023-06-02 16:25:59470 days ago1685723159IN
0x057C6c17...b92C3F4A4
0.000594 ETH0.0135481349.05741479
Bridge ETH173802162023-05-31 17:04:23472 days ago1685552663IN
0x057C6c17...b92C3F4A4
0.00059264 ETH0.0211147168.03099612
Set Trusted Remo...173801432023-05-31 16:49:47472 days ago1685551787IN
0x057C6c17...b92C3F4A4
0 ETH0.0061723865.79526605
Register Token173801432023-05-31 16:49:47472 days ago1685551787IN
0x057C6c17...b92C3F4A4
0 ETH0.0050049865.79526605
Register Token173801422023-05-31 16:49:35472 days ago1685551775IN
0x057C6c17...b92C3F4A4
0 ETH0.0050497966.41933214
0x60c06040173801412023-05-31 16:49:23472 days ago1685551763IN
 Create: OriginalBridge
0 ETH0.2139860462.82651455

Latest 10 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
174269232023-06-07 7:09:11466 days ago1686121751
0x057C6c17...b92C3F4A4
0.000194 ETH
174269232023-06-07 7:09:11466 days ago1686121751
0x057C6c17...b92C3F4A4
0.000194 ETH
174145422023-06-05 13:13:47467 days ago1685970827
0x057C6c17...b92C3F4A4
0.00049412 ETH
174145422023-06-05 13:13:47467 days ago1685970827
0x057C6c17...b92C3F4A4
0.015 ETH
173942862023-06-02 16:38:59470 days ago1685723939
0x057C6c17...b92C3F4A4
0.000494 ETH
173942862023-06-02 16:38:59470 days ago1685723939
0x057C6c17...b92C3F4A4
0.0001 ETH
173942222023-06-02 16:25:59470 days ago1685723159
0x057C6c17...b92C3F4A4
0.000494 ETH
173942222023-06-02 16:25:59470 days ago1685723159
0x057C6c17...b92C3F4A4
0.0001 ETH
173802162023-05-31 17:04:23472 days ago1685552663
0x057C6c17...b92C3F4A4
0.00049264 ETH
173802162023-05-31 17:04:23472 days ago1685552663
0x057C6c17...b92C3F4A4
0.0001 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OriginalBridge

Compiler Version
v0.8.8+commit.dddeac2f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : OriginalBridge.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import {BridgeBase} from "./BridgeBase.sol";
import {LzLib} from "@layerzerolabs/solidity-examples/contracts/libraries/LzLib.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {TransferHelper} from "./library/TransferHelper.sol";
import {IWETH} from "./interface/IWETH.sol";

contract OriginalBridge is BridgeBase{

    mapping (address => bool) public supportedTokens;
    
    mapping (address => uint) public totalValueLocked;

    mapping (address => uint) public conversionRate;

    uint16 public remoteChainId;

    address public immutable WETH;

    event Send(address indexed  token,address from,address to,uint amount);
    event Receive(address indexed token,address to,uint amount);
    event RegisterToken(address token);
    event SetRemoteChainId(uint16 chainId);
    event WithdrawFee(address token,address to,uint amount);

    receive() external payable {}

    constructor(address _endpoint,uint16 _remoteChainId,address _weth)BridgeBase(_endpoint){
        require(_weth != address(0),"OriginalBridge:Invalid weth address");
        WETH = _weth;
        remoteChainId = _remoteChainId;
    }
    
    function registerToken(address token,uint8 sharedDecimals) external onlyOwner{

        require(!supportedTokens[token] && token != address(0),"OriginalBridge:Invalid address");
        uint8 localDecimals = _getDecimals(token);
        require(localDecimals >= sharedDecimals,"OriginalBridge:Shared decimals must be less than or equal to local decimals");
        supportedTokens[token] = true;
        //usdt 8 set 6 
        //ConversionRate[token] = 10**2 = 100
        conversionRate[token] = 10**(localDecimals-sharedDecimals);
        emit RegisterToken(token);
    }
    
    function estimateGasFee(
        bool _useZero,
        bytes calldata _adapterParam
        ) public view returns (uint nativeFee, uint zroFee)
    {
        bytes memory _payload = abi.encode(PT_MINT,address(this),address(this),0);
        return lzEndpoint.estimateFees(remoteChainId, address(this), _payload, _useZero, _adapterParam);
    }
    
    function setRemoteChainId(uint16 chainId) external  onlyOwner{
        remoteChainId = chainId;
        emit SetRemoteChainId(chainId);
    }
    //cross token
    function bridge(
        address token,
        address to,
        uint amountInto,
        LzLib.CallParams calldata callParams,
        bytes memory adapterParams
        ) external payable  nonReentrant
        {
        require(supportedTokens[token] && to != address(0),"OriginalBridge:Invalid address");
        
        uint balanceBefore = IERC20(token).balanceOf(address(this));
        TransferHelper.safeTransferFrom(token, msg.sender, address(this), amountInto);
        uint balanceAfter = IERC20(token).balanceOf(address(this));

        (uint retained,uint dust) = _removeDust(token, balanceAfter - balanceBefore);
        if (dust>0){
            TransferHelper.safeTransfer(token, msg.sender , dust);
        }
    
        _bridge(token, to, retained, msg.value, callParams, adapterParams);
        
    }

    function bridgeETH(
        address to,
        uint amountInto,
        LzLib.CallParams calldata callParams,
        bytes memory adapterParams
        ) external payable  nonReentrant
        {
        require(supportedTokens[WETH] && to != address(0),"OriginalBridge:Invalid address");
        require(msg.value > amountInto,"OriginalBridge:Not enough value");
        (uint retained, ) = _removeDust(WETH, amountInto);
        IWETH(WETH).deposit{value: retained}();
        _bridge(WETH, to, retained, msg.value - retained, callParams, adapterParams);
    }

    function _bridge(
        address token,
        address to,
        uint retained,
        uint nativeFee,
        LzLib.CallParams calldata callParams,
        bytes memory adapterParams
        ) private{
        _checkAdapterParams(remoteChainId, PT_MINT, adapterParams);
        uint mintAmount = _amountLDToSD(token, retained);
        require(mintAmount > 0,"OriginalBridge:Invalid amount");
        
        totalValueLocked[token] += mintAmount;
        
        bytes memory payload = abi.encode(PT_MINT,token,to,mintAmount);
        
        _lzSend(
            remoteChainId, 
            payload, 
            callParams.refundAddress, 
            callParams.zroPaymentAddress, 
            adapterParams, nativeFee);
        emit Send(token, msg.sender, to, retained);
    }

    function _nonblockingLzReceive(
        uint16 srcChainId, 
        bytes memory, 
        uint64, 
        bytes memory payload
    ) internal virtual override 
    {
        
        require(srcChainId == remoteChainId,"OriginalBridge:ChainId mismatch");
        (uint8 pkType,address token,address to,uint withdrawAmount,uint totalAmount,bool unwrap) =
        abi.decode(payload,(uint8,address,address,uint,uint,bool));
        require(pkType == PT_UNLOCK, "OriginalBridge:Pk type mis mismatch");
        require(supportedTokens[token], "OriginalBridge:Not supported");
        totalValueLocked[token] -= totalAmount;
        uint withdrawAmountLD = _amountSDToLD(token,withdrawAmount);
        if (token == WETH && unwrap){
            IWETH(WETH).withdraw(withdrawAmountLD);
            TransferHelper.safeTransferETH(to,withdrawAmountLD);
            emit Receive(address(0), to, withdrawAmountLD);
        }else{
            TransferHelper.safeTransfer(token,to,withdrawAmountLD);
            emit Receive(token, to, withdrawAmountLD);
        }
    }

    function getBridgeTruthFee(address token) public view returns(uint){
        (bool success,bytes memory data) = token.staticcall(abi.encodeWithSignature("balanceOf(address)", address(this)));
        require(success,"Original:Static call failed");
        uint256 currentAmount = abi.decode(data,(uint256));
        return currentAmount - _amountSDToLD(token, totalValueLocked[token]);
    }

    function withdrawFee(address token,address to,uint amount) external onlyOwner{
        
        uint fee = getBridgeTruthFee(token);
        require(amount <= fee,"OriginalBridge:Invalid withdraw amount");
        TransferHelper.safeTransfer(token,to,amount);
        emit WithdrawFee( token, to, amount);
    }

    function _getDecimals(address token) internal view returns (uint8){
        (bool success,bytes memory data) = token.staticcall(abi.encodeWithSignature("decimals()"));
        require(success,"OriginalBridge:Static call failed");
        return abi.decode(data,(uint8));
    }

    function _removeDust(address token,uint amountInto) internal view returns(uint retained,uint dust){
        dust = amountInto % conversionRate[token];
        retained = amountInto - dust;
    }

    function _amountLDToSD(address token,uint amount) internal view returns (uint){
        return amount / conversionRate[token];
        //10**18 - 10**12
    }

    function _amountSDToLD(address token,uint amount) internal view returns (uint){
        return amount * conversionRate[token];
    }


}

File 2 of 16 : ILayerZeroEndpoint.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.0;

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);
}

File 3 of 16 : ILayerZeroReceiver.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.0;

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;
}

File 4 of 16 : ILayerZeroUserApplicationConfig.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.0;

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;
}

File 5 of 16 : LzLib.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;

library LzLib {
    // LayerZero communication
    struct CallParams {
        address payable refundAddress;
        address zroPaymentAddress;
    }

    //---------------------------------------------------------------------------
    // Address type handling

    struct AirdropParams {
        uint airdropAmount;
        bytes32 airdropAddress;
    }

    function buildAdapterParams(LzLib.AirdropParams memory _airdropParams, uint _uaGasLimit) internal pure returns (bytes memory adapterParams) {
        if (_airdropParams.airdropAmount == 0 && _airdropParams.airdropAddress == bytes32(0x0)) {
            adapterParams = buildDefaultAdapterParams(_uaGasLimit);
        } else {
            adapterParams = buildAirdropAdapterParams(_uaGasLimit, _airdropParams);
        }
    }

    // Build Adapter Params
    function buildDefaultAdapterParams(uint _uaGas) internal pure returns (bytes memory) {
        // txType 1
        // bytes  [2       32      ]
        // fields [txType  extraGas]
        return abi.encodePacked(uint16(1), _uaGas);
    }

    function buildAirdropAdapterParams(uint _uaGas, AirdropParams memory _params) internal pure returns (bytes memory) {
        require(_params.airdropAmount > 0, "Airdrop amount must be greater than 0");
        require(_params.airdropAddress != bytes32(0x0), "Airdrop address must be set");

        // txType 2
        // bytes  [2       32        32            bytes[]         ]
        // fields [txType  extraGas  dstNativeAmt  dstNativeAddress]
        return abi.encodePacked(uint16(2), _uaGas, _params.airdropAmount, _params.airdropAddress);
    }

    function getGasLimit(bytes memory _adapterParams) internal pure returns (uint gasLimit) {
        require(_adapterParams.length == 34 || _adapterParams.length > 66, "Invalid adapterParams");
        assembly {
            gasLimit := mload(add(_adapterParams, 34))
        }
    }

    // Decode Adapter Params
    function decodeAdapterParams(bytes memory _adapterParams) internal pure returns (uint16 txType, uint uaGas, uint airdropAmount, address payable airdropAddress) {
        require(_adapterParams.length == 34 || _adapterParams.length > 66, "Invalid adapterParams");
        assembly {
            txType := mload(add(_adapterParams, 2))
            uaGas := mload(add(_adapterParams, 34))
        }
        require(txType == 1 || txType == 2, "Unsupported txType");
        require(uaGas > 0, "Gas too low");

        if (txType == 2) {
            assembly {
                airdropAmount := mload(add(_adapterParams, 66))
                airdropAddress := mload(add(_adapterParams, 86))
            }
        }
    }

    //---------------------------------------------------------------------------
    // Address type handling
    function bytes32ToAddress(bytes32 _bytes32Address) internal pure returns (address _address) {
        return address(uint160(uint(_bytes32Address)));
    }

    function addressToBytes32(address _address) internal pure returns (bytes32 _bytes32Address) {
        return bytes32(uint(uint160(_address)));
    }
}

File 6 of 16 : LzApp.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "../interfaces/ILayerZeroReceiver.sol";
import "../interfaces/ILayerZeroUserApplicationConfig.sol";
import "../interfaces/ILayerZeroEndpoint.sol";
import "../util/BytesLib.sol";

/*
 * a generic LzReceiver implementation
 */
abstract contract LzApp is Ownable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig {
    using BytesLib for bytes;

    // ua can not send payload larger than this by default, but it can be changed by the ua owner
    uint constant public DEFAULT_PAYLOAD_SIZE_LIMIT = 10000;

    ILayerZeroEndpoint public immutable lzEndpoint;
    mapping(uint16 => bytes) public trustedRemoteLookup;
    mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup;
    mapping(uint16 => uint) public payloadSizeLimitLookup;
    address public precrime;

    event SetPrecrime(address precrime);
    event SetTrustedRemote(uint16 _remoteChainId, bytes _path);
    event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);
    event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas);

    constructor(address _endpoint) {
        lzEndpoint = ILayerZeroEndpoint(_endpoint);
    }

    function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual override {
        // lzReceive must be called by the endpoint for security
        require(_msgSender() == address(lzEndpoint), "LzApp: invalid endpoint caller");

        bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];
        // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote.
        require(_srcAddress.length == trustedRemote.length && trustedRemote.length > 0 && keccak256(_srcAddress) == keccak256(trustedRemote), "LzApp: invalid source sending contract");

        _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
    }

    // abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging
    function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual;

    function _lzSend(uint16 _dstChainId, bytes memory _payload, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams, uint _nativeFee) internal virtual {
        bytes memory trustedRemote = trustedRemoteLookup[_dstChainId];
        require(trustedRemote.length != 0, "LzApp: destination chain is not a trusted source");
        _checkPayloadSize(_dstChainId, _payload.length);
        lzEndpoint.send{value: _nativeFee}(_dstChainId, trustedRemote, _payload, _refundAddress, _zroPaymentAddress, _adapterParams);
    }

    function _checkGasLimit(uint16 _dstChainId, uint16 _type, bytes memory _adapterParams, uint _extraGas) internal view virtual {
        uint providedGasLimit = _getGasLimit(_adapterParams);
        uint minGasLimit = minDstGasLookup[_dstChainId][_type] + _extraGas;
        require(minGasLimit > 0, "LzApp: minGasLimit not set");
        require(providedGasLimit >= minGasLimit, "LzApp: gas limit is too low");
    }

    function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint gasLimit) {
        require(_adapterParams.length >= 34, "LzApp: invalid adapterParams");
        assembly {
            gasLimit := mload(add(_adapterParams, 34))
        }
    }

    function _checkPayloadSize(uint16 _dstChainId, uint _payloadSize) internal view virtual {
        uint payloadSizeLimit = payloadSizeLimitLookup[_dstChainId];
        if (payloadSizeLimit == 0) { // use default if not set
            payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT;
        }
        require(_payloadSize <= payloadSizeLimit, "LzApp: payload size is too large");
    }

    //---------------------------UserApplication config----------------------------------------
    function getConfig(uint16 _version, uint16 _chainId, address, uint _configType) external view returns (bytes memory) {
        return lzEndpoint.getConfig(_version, _chainId, address(this), _configType);
    }

    // generic config for LayerZero user Application
    function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external override onlyOwner {
        lzEndpoint.setConfig(_version, _chainId, _configType, _config);
    }

    function setSendVersion(uint16 _version) external override onlyOwner {
        lzEndpoint.setSendVersion(_version);
    }

    function setReceiveVersion(uint16 _version) external override onlyOwner {
        lzEndpoint.setReceiveVersion(_version);
    }

    function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner {
        lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress);
    }

    // _path = abi.encodePacked(remoteAddress, localAddress)
    // this function set the trusted path for the cross-chain communication
    function setTrustedRemote(uint16 _srcChainId, bytes calldata _path) external onlyOwner {
        trustedRemoteLookup[_srcChainId] = _path;
        emit SetTrustedRemote(_srcChainId, _path);
    }

    function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner {
        trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this));
        emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress);
    }

    function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory) {
        bytes memory path = trustedRemoteLookup[_remoteChainId];
        require(path.length != 0, "LzApp: no trusted path record");
        return path.slice(0, path.length - 20); // the last 20 bytes should be address(this)
    }

    function setPrecrime(address _precrime) external onlyOwner {
        precrime = _precrime;
        emit SetPrecrime(_precrime);
    }

    function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint _minGas) external onlyOwner {
        require(_minGas > 0, "LzApp: invalid minGas");
        minDstGasLookup[_dstChainId][_packetType] = _minGas;
        emit SetMinDstGas(_dstChainId, _packetType, _minGas);
    }

    // if the size is 0, it means default size limit
    function setPayloadSizeLimit(uint16 _dstChainId, uint _size) external onlyOwner {
        payloadSizeLimitLookup[_dstChainId] = _size;
    }

    //--------------------------- VIEW FUNCTION ----------------------------------------
    function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) {
        bytes memory trustedSource = trustedRemoteLookup[_srcChainId];
        return keccak256(trustedSource) == keccak256(_srcAddress);
    }
}

File 7 of 16 : NonblockingLzApp.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./LzApp.sol";
import "../util/ExcessivelySafeCall.sol";

/*
 * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel
 * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking
 * NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress)
 */
abstract contract NonblockingLzApp is LzApp {
    using ExcessivelySafeCall for address;

    constructor(address _endpoint) LzApp(_endpoint) {}

    mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages;

    event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason);
    event RetryMessageSuccess(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash);

    // overriding the virtual function in LzReceiver
    function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual override {
        (bool success, bytes memory reason) = address(this).excessivelySafeCall(gasleft(), 150, abi.encodeWithSelector(this.nonblockingLzReceive.selector, _srcChainId, _srcAddress, _nonce, _payload));
        // try-catch all errors/exceptions
        if (!success) {
            _storeFailedMessage(_srcChainId, _srcAddress, _nonce, _payload, reason);
        }
    }

    function _storeFailedMessage(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload, bytes memory _reason) internal virtual {
        failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload);
        emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload, _reason);
    }

    function nonblockingLzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual {
        // only internal transaction
        require(_msgSender() == address(this), "NonblockingLzApp: caller must be LzApp");
        _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
    }

    //@notice override this function
    function _nonblockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual;

    function retryMessage(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public payable virtual {
        // assert there is message to retry
        bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce];
        require(payloadHash != bytes32(0), "NonblockingLzApp: no stored message");
        require(keccak256(_payload) == payloadHash, "NonblockingLzApp: 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);
        emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash);
    }
}

File 8 of 16 : BytesLib.sol
// SPDX-License-Identifier: Unlicense
/*
 * @title Solidity Bytes Arrays Utils
 * @author Gonçalo Sá <[email protected]>
 *
 * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.
 *      The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.
 */
pragma solidity >=0.8.0 <0.9.0;


library BytesLib {
    function concat(
        bytes memory _preBytes,
        bytes memory _postBytes
    )
    internal
    pure
    returns (bytes memory)
    {
        bytes memory tempBytes;

        assembly {
        // Get a location of some free memory and store it in tempBytes as
        // Solidity does for memory variables.
            tempBytes := mload(0x40)

        // Store the length of the first bytes array at the beginning of
        // the memory for tempBytes.
            let length := mload(_preBytes)
            mstore(tempBytes, length)

        // Maintain a memory counter for the current write location in the
        // temp bytes array by adding the 32 bytes for the array length to
        // the starting location.
            let mc := add(tempBytes, 0x20)
        // Stop copying when the memory counter reaches the length of the
        // first bytes array.
            let end := add(mc, length)

            for {
            // Initialize a copy counter to the start of the _preBytes data,
            // 32 bytes into its memory.
                let cc := add(_preBytes, 0x20)
            } lt(mc, end) {
            // Increase both counters by 32 bytes each iteration.
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
            // Write the _preBytes data into the tempBytes memory 32 bytes
            // at a time.
                mstore(mc, mload(cc))
            }

        // Add the length of _postBytes to the current length of tempBytes
        // and store it as the new length in the first 32 bytes of the
        // tempBytes memory.
            length := mload(_postBytes)
            mstore(tempBytes, add(length, mload(tempBytes)))

        // Move the memory counter back from a multiple of 0x20 to the
        // actual end of the _preBytes data.
            mc := end
        // Stop copying when the memory counter reaches the new combined
        // length of the arrays.
            end := add(mc, length)

            for {
                let cc := add(_postBytes, 0x20)
            } lt(mc, end) {
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                mstore(mc, mload(cc))
            }

        // Update the free-memory pointer by padding our last write location
        // to 32 bytes: add 31 bytes to the end of tempBytes to move to the
        // next 32 byte block, then round down to the nearest multiple of
        // 32. If the sum of the length of the two arrays is zero then add
        // one before rounding down to leave a blank 32 bytes (the length block with 0).
            mstore(0x40, and(
            add(add(end, iszero(add(length, mload(_preBytes)))), 31),
            not(31) // Round down to the nearest 32 bytes.
            ))
        }

        return tempBytes;
    }

    function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {
        assembly {
        // Read the first 32 bytes of _preBytes storage, which is the length
        // of the array. (We don't need to use the offset into the slot
        // because arrays use the entire slot.)
            let fslot := sload(_preBytes.slot)
        // Arrays of 31 bytes or less have an even value in their slot,
        // while longer arrays have an odd value. The actual length is
        // the slot divided by two for odd values, and the lowest order
        // byte divided by two for even values.
        // If the slot is even, bitwise and the slot with 255 and divide by
        // two to get the length. If the slot is odd, bitwise and the slot
        // with -1 and divide by two.
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)
            let newlength := add(slength, mlength)
        // slength can contain both the length and contents of the array
        // if length < 32 bytes so let's prepare for that
        // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
            switch add(lt(slength, 32), lt(newlength, 32))
            case 2 {
            // Since the new array still fits in the slot, we just need to
            // update the contents of the slot.
            // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
                sstore(
                _preBytes.slot,
                // all the modifications to the slot are inside this
                // next block
                add(
                // we can just add to the slot contents because the
                // bytes we want to change are the LSBs
                fslot,
                add(
                mul(
                div(
                // load the bytes from memory
                mload(add(_postBytes, 0x20)),
                // zero all bytes to the right
                exp(0x100, sub(32, mlength))
                ),
                // and now shift left the number of bytes to
                // leave space for the length in the slot
                exp(0x100, sub(32, newlength))
                ),
                // increase length by the double of the memory
                // bytes length
                mul(mlength, 2)
                )
                )
                )
            }
            case 1 {
            // The stored value fits in the slot, but the combined value
            // will exceed it.
            // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

            // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

            // The contents of the _postBytes array start 32 bytes into
            // the structure. Our first read should obtain the `submod`
            // bytes that can fit into the unused space in the last word
            // of the stored array. To get this, we read 32 bytes starting
            // from `submod`, so the data we read overlaps with the array
            // contents by `submod` bytes. Masking the lowest-order
            // `submod` bytes allows us to add that value directly to the
            // stored value.

                let submod := sub(32, slength)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(
                sc,
                add(
                and(
                fslot,
                0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00
                ),
                and(mload(mc), mask)
                )
                )

                for {
                    mc := add(mc, 0x20)
                    sc := add(sc, 1)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
            default {
            // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
            // Start copying to the last used word of the stored array.
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

            // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

            // Copy over the first `submod` bytes of the new data as in
            // case 1 above.
                let slengthmod := mod(slength, 32)
                let mlengthmod := mod(mlength, 32)
                let submod := sub(32, slengthmod)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(sc, add(sload(sc), and(mload(mc), mask)))

                for {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
        }
    }

    function slice(
        bytes memory _bytes,
        uint256 _start,
        uint256 _length
    )
    internal
    pure
    returns (bytes memory)
    {
        require(_length + 31 >= _length, "slice_overflow");
        require(_bytes.length >= _start + _length, "slice_outOfBounds");

        bytes memory tempBytes;

        assembly {
            switch iszero(_length)
            case 0 {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
                tempBytes := mload(0x40)

            // The first word of the slice result is potentially a partial
            // word read from the original array. To read it, we calculate
            // the length of that partial word and start copying that many
            // bytes into the array. The first word we copy will start with
            // data we don't care about, but the last `lengthmod` bytes will
            // land at the beginning of the contents of the new array. When
            // we're done copying, we overwrite the full first word with
            // the actual length of the slice.
                let lengthmod := and(_length, 31)

            // The multiplication in the next line is necessary
            // because when slicing multiples of 32 bytes (lengthmod == 0)
            // the following copy loop was copying the origin's length
            // and then ending prematurely not copying everything it should.
                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
                let end := add(mc, _length)

                for {
                // The multiplication in the next line has the same exact purpose
                // as the one above.
                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
                } lt(mc, end) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    mstore(mc, mload(cc))
                }

                mstore(tempBytes, _length)

            //update free-memory pointer
            //allocating the array padded to 32 bytes like the compiler does now
                mstore(0x40, and(add(mc, 31), not(31)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default {
                tempBytes := mload(0x40)
            //zero out the 32 bytes slice we are about to return
            //we need to do it because Solidity does not garbage collect
                mstore(tempBytes, 0)

                mstore(0x40, add(tempBytes, 0x20))
            }
        }

        return tempBytes;
    }

    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
        require(_bytes.length >= _start + 20, "toAddress_outOfBounds");
        address tempAddress;

        assembly {
            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
        }

        return tempAddress;
    }

    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
        require(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
        uint8 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x1), _start))
        }

        return tempUint;
    }

    function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {
        require(_bytes.length >= _start + 2, "toUint16_outOfBounds");
        uint16 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x2), _start))
        }

        return tempUint;
    }

    function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {
        require(_bytes.length >= _start + 4, "toUint32_outOfBounds");
        uint32 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x4), _start))
        }

        return tempUint;
    }

    function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {
        require(_bytes.length >= _start + 8, "toUint64_outOfBounds");
        uint64 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x8), _start))
        }

        return tempUint;
    }

    function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {
        require(_bytes.length >= _start + 12, "toUint96_outOfBounds");
        uint96 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0xc), _start))
        }

        return tempUint;
    }

    function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {
        require(_bytes.length >= _start + 16, "toUint128_outOfBounds");
        uint128 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x10), _start))
        }

        return tempUint;
    }

    function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {
        require(_bytes.length >= _start + 32, "toUint256_outOfBounds");
        uint256 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x20), _start))
        }

        return tempUint;
    }

    function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {
        require(_bytes.length >= _start + 32, "toBytes32_outOfBounds");
        bytes32 tempBytes32;

        assembly {
            tempBytes32 := mload(add(add(_bytes, 0x20), _start))
        }

        return tempBytes32;
    }

    function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
        bool success = true;

        assembly {
            let length := mload(_preBytes)

        // if lengths don't match the arrays are not equal
            switch eq(length, mload(_postBytes))
            case 1 {
            // cb is a circuit breaker in the for loop since there's
            //  no said feature for inline assembly loops
            // cb = 1 - don't breaker
            // cb = 0 - break
                let cb := 1

                let mc := add(_preBytes, 0x20)
                let end := add(mc, length)

                for {
                    let cc := add(_postBytes, 0x20)
                // the next line is the loop condition:
                // while(uint256(mc < end) + cb == 2)
                } eq(add(lt(mc, end), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                    // unsuccess:
                        success := 0
                        cb := 0
                    }
                }
            }
            default {
            // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function equalStorage(
        bytes storage _preBytes,
        bytes memory _postBytes
    )
    internal
    view
    returns (bool)
    {
        bool success = true;

        assembly {
        // we know _preBytes_offset is 0
            let fslot := sload(_preBytes.slot)
        // Decode the length of the stored array like in concatStorage().
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)

        // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
            // slength can contain both the length and contents of the array
            // if length < 32 bytes so let's prepare for that
            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                if iszero(iszero(slength)) {
                    switch lt(slength, 32)
                    case 1 {
                    // blank the last byte which is the length
                        fslot := mul(div(fslot, 0x100), 0x100)

                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
                        // unsuccess:
                            success := 0
                        }
                    }
                    default {
                    // cb is a circuit breaker in the for loop since there's
                    //  no said feature for inline assembly loops
                    // cb = 1 - don't breaker
                    // cb = 0 - break
                        let cb := 1

                    // get the keccak hash to get the contents of the array
                        mstore(0x0, _preBytes.slot)
                        let sc := keccak256(0x0, 0x20)

                        let mc := add(_postBytes, 0x20)
                        let end := add(mc, mlength)

                    // the next line is the loop condition:
                    // while(uint256(mc < end) + cb == 2)
                        for {} eq(add(lt(mc, end), cb), 2) {
                            sc := add(sc, 1)
                            mc := add(mc, 0x20)
                        } {
                            if iszero(eq(sload(sc), mload(mc))) {
                            // unsuccess:
                                success := 0
                                cb := 0
                            }
                        }
                    }
                }
            }
            default {
            // unsuccess:
                success := 0
            }
        }

        return success;
    }
}

File 9 of 16 : ExcessivelySafeCall.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.7.6;

library ExcessivelySafeCall {
    uint256 constant LOW_28_MASK =
    0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

    /// @notice Use when you _really_ really _really_ don't trust the called
    /// contract. This prevents the called contract from causing reversion of
    /// the caller in as many ways as we can.
    /// @dev The main difference between this and a solidity low-level call is
    /// that we limit the number of bytes that the callee can cause to be
    /// copied to caller memory. This prevents stupid things like malicious
    /// contracts returning 10,000,000 bytes causing a local OOG when copying
    /// to memory.
    /// @param _target The address to call
    /// @param _gas The amount of gas to forward to the remote contract
    /// @param _maxCopy The maximum number of bytes of returndata to copy
    /// to memory.
    /// @param _calldata The data to send to the remote contract
    /// @return success and returndata, as `.call()`. Returndata is capped to
    /// `_maxCopy` bytes.
    function excessivelySafeCall(
        address _target,
        uint256 _gas,
        uint16 _maxCopy,
        bytes memory _calldata
    ) internal returns (bool, bytes memory) {
        // set up for assembly call
        uint256 _toCopy;
        bool _success;
        bytes memory _returnData = new bytes(_maxCopy);
        // dispatch message to recipient
        // by assembly calling "handle" function
        // we call via assembly to avoid memcopying a very large returndata
        // returned by a malicious contract
        assembly {
            _success := call(
            _gas, // gas
            _target, // recipient
            0, // ether value
            add(_calldata, 0x20), // inloc
            mload(_calldata), // inlen
            0, // outloc
            0 // outlen
            )
        // limit our copy to 256 bytes
            _toCopy := returndatasize()
            if gt(_toCopy, _maxCopy) {
                _toCopy := _maxCopy
            }
        // Store the length of the copied bytes
            mstore(_returnData, _toCopy)
        // copy the bytes from returndata[0:_toCopy]
            returndatacopy(add(_returnData, 0x20), 0, _toCopy)
        }
        return (_success, _returnData);
    }

    /// @notice Use when you _really_ really _really_ don't trust the called
    /// contract. This prevents the called contract from causing reversion of
    /// the caller in as many ways as we can.
    /// @dev The main difference between this and a solidity low-level call is
    /// that we limit the number of bytes that the callee can cause to be
    /// copied to caller memory. This prevents stupid things like malicious
    /// contracts returning 10,000,000 bytes causing a local OOG when copying
    /// to memory.
    /// @param _target The address to call
    /// @param _gas The amount of gas to forward to the remote contract
    /// @param _maxCopy The maximum number of bytes of returndata to copy
    /// to memory.
    /// @param _calldata The data to send to the remote contract
    /// @return success and returndata, as `.call()`. Returndata is capped to
    /// `_maxCopy` bytes.
    function excessivelySafeStaticCall(
        address _target,
        uint256 _gas,
        uint16 _maxCopy,
        bytes memory _calldata
    ) internal view returns (bool, bytes memory) {
        // set up for assembly call
        uint256 _toCopy;
        bool _success;
        bytes memory _returnData = new bytes(_maxCopy);
        // dispatch message to recipient
        // by assembly calling "handle" function
        // we call via assembly to avoid memcopying a very large returndata
        // returned by a malicious contract
        assembly {
            _success := staticcall(
            _gas, // gas
            _target, // recipient
            add(_calldata, 0x20), // inloc
            mload(_calldata), // inlen
            0, // outloc
            0 // outlen
            )
        // limit our copy to 256 bytes
            _toCopy := returndatasize()
            if gt(_toCopy, _maxCopy) {
                _toCopy := _maxCopy
            }
        // Store the length of the copied bytes
            mstore(_returnData, _toCopy)
        // copy the bytes from returndata[0:_toCopy]
            returndatacopy(add(_returnData, 0x20), 0, _toCopy)
        }
        return (_success, _returnData);
    }

    /**
     * @notice Swaps function selectors in encoded contract calls
     * @dev Allows reuse of encoded calldata for functions with identical
     * argument types but different names. It simply swaps out the first 4 bytes
     * for the new selector. This function modifies memory in place, and should
     * only be used with caution.
     * @param _newSelector The new 4-byte selector
     * @param _buf The encoded contract args
     */
    function swapSelector(bytes4 _newSelector, bytes memory _buf)
    internal
    pure
    {
        require(_buf.length >= 4);
        uint256 _mask = LOW_28_MASK;
        assembly {
        // load the first word of
            let _word := mload(add(_buf, 0x20))
        // mask out the top 4 bytes
        // /x
            _word := and(_word, _mask)
            _word := or(_newSelector, _word)
            mstore(add(_buf, 0x20), _word)
        }
    }
}

File 10 of 16 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 11 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.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].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // 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;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @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 making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 12 of 16 : IERC20.sol
// 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);
}

File 13 of 16 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 14 of 16 : BridgeBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {NonblockingLzApp} from "@layerzerolabs/solidity-examples/contracts/lzApp/NonblockingLzApp.sol";

abstract contract BridgeBase is NonblockingLzApp,ReentrancyGuard{
    
    uint8 public constant PT_MINT = 0; 
    uint8 public constant PT_UNLOCK = 1;
    bool  public useCustomAdapterParams;

    event SetUseCustomAdapterParams(bool useCustomAdapterParams);
    
    constructor(address _endpoint)NonblockingLzApp(_endpoint){}
    
    function setUseCustomAdapterParams(bool _useCustomAdapterParams) external onlyOwner{
        useCustomAdapterParams = _useCustomAdapterParams;
        emit SetUseCustomAdapterParams(_useCustomAdapterParams);
    }
    
    function _checkAdapterParams(uint16 remoteId,uint8 pkType,bytes memory adapterParams)internal virtual {
        if (useCustomAdapterParams){
            _checkGasLimit(remoteId, pkType, adapterParams, 0);
        }else {
            require(adapterParams.length == 0,"BridgeBase:adapterParams must be empty");
        }
    }

    function renounceOwnership() public override onlyOwner {}
}

File 15 of 16 : IWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

interface IWETH {
    /// @notice Deposit ether to get wrapped ether
    function deposit() external payable;

    /// @notice Withdraw wrapped ether to get ether
    function withdraw(uint) external;
}

File 16 of 16 : TransferHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

library TransferHelper {
    function safeApprove(address token, address to, uint value) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
    }

    function safeTransfer(address token, address to, uint value) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
    }

    function safeTransferFrom(address token, address from, address to, uint value) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
    }

    function safeTransferETH(address to, uint value) internal {
        (bool success,) = to.call{value:value}(new bytes(0));
        require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_endpoint","type":"address"},{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"address","name":"_weth","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"},{"indexed":false,"internalType":"bytes","name":"_reason","type":"bytes"}],"name":"MessageFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Receive","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"RegisterToken","type":"event"},{"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":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"RetryMessageSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Send","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"_type","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"_minDstGas","type":"uint256"}],"name":"SetMinDstGas","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"precrime","type":"address"}],"name":"SetPrecrime","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"chainId","type":"uint16"}],"name":"SetRemoteChainId","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_path","type":"bytes"}],"name":"SetTrustedRemote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"SetTrustedRemoteAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"useCustomAdapterParams","type":"bool"}],"name":"SetUseCustomAdapterParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawFee","type":"event"},{"inputs":[],"name":"DEFAULT_PAYLOAD_SIZE_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PT_MINT","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PT_UNLOCK","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amountInto","type":"uint256"},{"components":[{"internalType":"address payable","name":"refundAddress","type":"address"},{"internalType":"address","name":"zroPaymentAddress","type":"address"}],"internalType":"struct LzLib.CallParams","name":"callParams","type":"tuple"},{"internalType":"bytes","name":"adapterParams","type":"bytes"}],"name":"bridge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amountInto","type":"uint256"},{"components":[{"internalType":"address payable","name":"refundAddress","type":"address"},{"internalType":"address","name":"zroPaymentAddress","type":"address"}],"internalType":"struct LzLib.CallParams","name":"callParams","type":"tuple"},{"internalType":"bytes","name":"adapterParams","type":"bytes"}],"name":"bridgeETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"conversionRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_useZero","type":"bool"},{"internalType":"bytes","name":"_adapterParam","type":"bytes"}],"name":"estimateGasFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","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":"address","name":"token","type":"address"}],"name":"getBridgeTruthFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"}],"name":"getTrustedRemoteAddress","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"isTrustedRemote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lzEndpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","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":"lzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"minDstGasLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"payloadSizeLimitLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"precrime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint8","name":"sharedDecimals","type":"uint8"}],"name":"registerToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"remoteChainId","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"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":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint16","name":"_packetType","type":"uint16"},{"internalType":"uint256","name":"_minGas","type":"uint256"}],"name":"setMinDstGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_size","type":"uint256"}],"name":"setPayloadSizeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_precrime","type":"address"}],"name":"setPrecrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setReceiveVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"chainId","type":"uint16"}],"name":"setRemoteChainId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setSendVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_path","type":"bytes"}],"name":"setTrustedRemote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"setTrustedRemoteAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_useCustomAdapterParams","type":"bool"}],"name":"setUseCustomAdapterParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"supportedTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalValueLocked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"trustedRemoteLookup","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"useCustomAdapterParams","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c06040523480156200001157600080fd5b5060405162003d9038038062003d9083398101604081905262000034916200015a565b8280806200004233620000ed565b60601b6001600160601b031916608052505060016006556001600160a01b038116620000c05760405162461bcd60e51b815260206004820152602360248201527f4f726967696e616c4272696467653a496e76616c69642077657468206164647260448201526265737360e81b606482015260840160405180910390fd5b60601b6001600160601b03191660a052600b805461ffff191661ffff9290921691909117905550620001ac565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200015557600080fd5b919050565b6000806000606084860312156200017057600080fd5b6200017b846200013d565b9250602084015161ffff811681146200019357600080fd5b9150620001a3604085016200013d565b90509250925092565b60805160601c60a05160601c613b566200023a6000396000818161064d01528181611bdb01528181611c9301528181611cbd01528181611d3401528181612213015261226a0152600081816106b60152818161083f01528181610a8e01528181610c0601528181610eb00152818161159c015281816116b801528181611b430152612bbf0152613b566000f3fe6080604052600436106102495760003560e01c80638cfd8f5c11610139578063c4461834116100b6578063eab45d9c1161007a578063eab45d9c1461078f578063eb8d72b7146107af578063ed629c5c146107cf578063f2fde38b146107e9578063f5ecbdbc14610809578063fada9ccc1461082957600080fd5b8063c4461834146106f8578063cbed8b9c1461070e578063d1deba1f1461072e578063df2a5b3b14610741578063e95181961461076157600080fd5b8063a6c3d165116100fd578063a6c3d1651461061b578063ad5c46481461063b578063adb616641461066f578063b353aaa7146106a4578063baf3292d146106d857600080fd5b80638cfd8f5c1461055e5780638da5cb5b14610596578063950c8a74146105c85780639f38369a146105e8578063a29f61b41461060857600080fd5b806346f6f9b5116101c757806368c4ac261161018b57806368c4ac26146104aa57806368ea28b0146104da578063715018a6146104ef5780637533d7881461050457806389d7506b1461053157600080fd5b806346f6f9b5146103c75780634aff33c8146103ee5780635a4967e51461041b5780635b8c41e61461043b57806366ad5c8a1461048a57600080fd5b806338db1ebc1161020e57806338db1ebc146102f7578063396decb6146103175780633d8b38f61461034a5780633f1f4fa41461037a57806342d65a8d146103a757600080fd5b80621d35671461025557806307e0db17146102775780630df37483146102975780631095b6d7146102b757806310ddb137146102d757600080fd5b3661025057005b600080fd5b34801561026157600080fd5b50610275610270366004612f67565b61083c565b005b34801561028357600080fd5b50610275610292366004612ffa565b610a6d565b3480156102a357600080fd5b506102756102b2366004613015565b610af6565b3480156102c357600080fd5b506102756102d2366004613054565b610b15565b3480156102e357600080fd5b506102756102f2366004612ffa565b610be5565b34801561030357600080fd5b50610275610312366004612ffa565b610c3d565b34801561032357600080fd5b50610337610332366004613095565b610c90565b6040519081526020015b60405180910390f35b34801561035657600080fd5b5061036a6103653660046130b2565b610dc5565b6040519015158152602001610341565b34801561038657600080fd5b50610337610395366004612ffa565b60036020526000908152604090205481565b3480156103b357600080fd5b506102756103c23660046130b2565b610e91565b3480156103d357600080fd5b506103dc600081565b60405160ff9091168152602001610341565b3480156103fa57600080fd5b50610337610409366004613095565b60096020526000908152604090205481565b34801561042757600080fd5b50610275610436366004613113565b610f17565b34801561044757600080fd5b5061033761045636600461320f565b6005602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561049657600080fd5b506102756104a5366004612f67565b611096565b3480156104b657600080fd5b5061036a6104c5366004613095565b60086020526000908152604090205460ff1681565b3480156104e657600080fd5b506103dc600181565b3480156104fb57600080fd5b50610275611172565b34801561051057600080fd5b5061052461051f366004612ffa565b61117c565b60405161034191906132c4565b34801561053d57600080fd5b5061033761054c366004613095565b600a6020526000908152604090205481565b34801561056a57600080fd5b506103376105793660046132d7565b600260209081526000928352604080842090915290825290205481565b3480156105a257600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610341565b3480156105d457600080fd5b506004546105b0906001600160a01b031681565b3480156105f457600080fd5b50610524610603366004612ffa565b611216565b610275610616366004613322565b61132d565b34801561062757600080fd5b506102756106363660046130b2565b6114cd565b34801561064757600080fd5b506105b07f000000000000000000000000000000000000000000000000000000000000000081565b34801561067b57600080fd5b5061068f61068a3660046133ad565b611553565b60408051928352602083019190915201610341565b3480156106b057600080fd5b506105b07f000000000000000000000000000000000000000000000000000000000000000081565b3480156106e457600080fd5b506102756106f3366004613095565b611643565b34801561070457600080fd5b5061033761271081565b34801561071a57600080fd5b506102756107293660046133cd565b611699565b61027561073c366004612f67565b61172e565b34801561074d57600080fd5b5061027561075c36600461343b565b611944565b34801561076d57600080fd5b50600b5461077c9061ffff1681565b60405161ffff9091168152602001610341565b34801561079b57600080fd5b506102756107aa366004613477565b6119f6565b3480156107bb57600080fd5b506102756107ca3660046130b2565b611a3f565b3480156107db57600080fd5b5060075461036a9060ff1681565b3480156107f557600080fd5b50610275610804366004613095565b611a99565b34801561081557600080fd5b50610524610824366004613494565b611b12565b6102756108373660046134e1565b611bc9565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146108b95760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff8616600090815260016020526040812080546108d79061354b565b80601f01602080910402602001604051908101604052809291908181526020018280546109039061354b565b80156109505780601f1061092557610100808354040283529160200191610950565b820191906000526020600020905b81548152906001019060200180831161093357829003601f168201915b5050505050905080518686905014801561096b575060008151115b80156109935750805160208201206040516109899088908890613580565b6040518091039020145b6109ee5760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b60648201526084016108b0565b610a648787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a935091508890889081908401838280828437600092019190915250611d7992505050565b50505050505050565b610a75611df2565b6040516307e0db1760e01b815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906307e0db17906024015b600060405180830381600087803b158015610adb57600080fd5b505af1158015610aef573d6000803e3d6000fd5b5050505050565b610afe611df2565b61ffff909116600090815260036020526040902055565b610b1d611df2565b6000610b2884610c90565b905080821115610b895760405162461bcd60e51b815260206004820152602660248201527f4f726967696e616c4272696467653a496e76616c696420776974686472617720604482015265185b5bdd5b9d60d21b60648201526084016108b0565b610b94848484611e4c565b604080516001600160a01b038087168252851660208201529081018390527ff15a0a3784dea9b4fe33bc98e2450745e262d310237b2868ea8ef56967ff3ecb9060600160405180910390a150505050565b610bed611df2565b6040516310ddb13760e01b815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906310ddb13790602401610ac1565b610c45611df2565b600b805461ffff191661ffff83169081179091556040519081527fe8df78a276e2b718a366328e9120b436ea83832fbeede026392fed933e3ffa5b906020015b60405180910390a150565b604051306024820152600090819081906001600160a01b0385169060440160408051601f198184030181529181526020820180516001600160e01b03166370a0823160e01b17905251610ce39190613590565b600060405180830381855afa9150503d8060008114610d1e576040519150601f19603f3d011682016040523d82523d6000602084013e610d23565b606091505b509150915081610d755760405162461bcd60e51b815260206004820152601b60248201527f4f726967696e616c3a5374617469632063616c6c206661696c6564000000000060448201526064016108b0565b600081806020019051810190610d8b91906135ac565b6001600160a01b038616600090815260096020526040902054909150610db2908690611f60565b610dbc90826135db565b95945050505050565b61ffff831660009081526001602052604081208054829190610de69061354b565b80601f0160208091040260200160405190810160405280929190818152602001828054610e129061354b565b8015610e5f5780601f10610e3457610100808354040283529160200191610e5f565b820191906000526020600020905b815481529060010190602001808311610e4257829003601f168201915b505050505090508383604051610e76929190613580565b60405180910390208180519060200120149150509392505050565b610e99611df2565b6040516342d65a8d60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906342d65a8d90610ee99086908690869060040161361b565b600060405180830381600087803b158015610f0357600080fd5b505af1158015610a64573d6000803e3d6000fd5b610f1f611df2565b6001600160a01b03821660009081526008602052604090205460ff16158015610f5057506001600160a01b03821615155b610f6c5760405162461bcd60e51b81526004016108b090613639565b6000610f7783611f8c565b90508160ff168160ff1610156110095760405162461bcd60e51b815260206004820152604b60248201527f4f726967696e616c4272696467653a53686172656420646563696d616c73206d60448201527f757374206265206c657373207468616e206f7220657175616c20746f206c6f6360648201526a616c20646563696d616c7360a81b608482015260a4016108b0565b6001600160a01b0383166000908152600860205260409020805460ff191660011790556110368282613670565b61104190600a613777565b6001600160a01b0384166000818152600a602090815260409182902093909355519081527ff7fe8023cb2e36bde1d59a88ac5763a8c11be6d25e6819f71bb7e23e5bf0dc1691015b60405180910390a1505050565b3330146110f45760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b60648201526084016108b0565b61116a8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f89018190048102820181019092528781528993509150879087908190840183828082843760009201919091525061208a92505050565b505050505050565b61117a611df2565b565b600160205260009081526040902080546111959061354b565b80601f01602080910402602001604051908101604052809291908181526020018280546111c19061354b565b801561120e5780601f106111e35761010080835404028352916020019161120e565b820191906000526020600020905b8154815290600101906020018083116111f157829003601f168201915b505050505081565b61ffff81166000908152600160205260408120805460609291906112399061354b565b80601f01602080910402602001604051908101604052809291908181526020018280546112659061354b565b80156112b25780601f10611287576101008083540402835291602001916112b2565b820191906000526020600020905b81548152906001019060200180831161129557829003601f168201915b5050505050905080516000141561130b5760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f726400000060448201526064016108b0565b61132660006014835161131e91906135db565b839190612381565b9392505050565b61133561248e565b6001600160a01b03851660009081526008602052604090205460ff16801561136557506001600160a01b03841615155b6113815760405162461bcd60e51b81526004016108b090613639565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a082319060240160206040518083038186803b1580156113c357600080fd5b505afa1580156113d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fb91906135ac565b9050611409863330876124e8565b6040516370a0823160e01b81523060048201526000906001600160a01b038816906370a082319060240160206040518083038186803b15801561144b57600080fd5b505afa15801561145f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148391906135ac565b905060008061149b8961149686866135db565b612610565b909250905080156114b1576114b1893383611e4c565b6114bf898984348a8a61264a565b50505050610aef6001600655565b6114d5611df2565b8181306040516020016114ea93929190613786565b60408051601f1981840301815291815261ffff8516600090815260016020908152919020825161151f93919290910190612de4565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce8383836040516110899392919061361b565b60408051600060208201819052308284018190526060830181905260808084018390528451808503909101815260a0840194859052600b5463040a7bb160e41b909552919384937f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316926340a7bb10926115e79261ffff909116919086908c908c908c9060a4016137ac565b604080518083038186803b1580156115fe57600080fd5b505afa158015611612573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116369190613802565b9250925050935093915050565b61164b611df2565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b90602001610c85565b6116a1611df2565b6040516332fb62e760e21b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063cbed8b9c906116f59088908890889088908890600401613826565b600060405180830381600087803b15801561170f57600080fd5b505af1158015611723573d6000803e3d6000fd5b505050505050505050565b61ffff861660009081526005602052604080822090516117519088908890613580565b90815260408051602092819003830190206001600160401b038716600090815292529020549050806117d15760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b60648201526084016108b0565b8083836040516117e2929190613580565b6040518091039020146118415760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b60648201526084016108b0565b61ffff871660009081526005602052604080822090516118649089908990613580565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f880182900482028301820190528682526118fc918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061208a92505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e5878787878560405161193395949392919061385f565b60405180910390a150505050505050565b61194c611df2565b600081116119945760405162461bcd60e51b81526020600482015260156024820152744c7a4170703a20696e76616c6964206d696e47617360581b60448201526064016108b0565b61ffff83811660008181526002602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac090606001611089565b6119fe611df2565b6007805460ff19168215159081179091556040519081527f1584ad594a70cbe1e6515592e1272a987d922b097ead875069cebe8b40c004a490602001610c85565b611a47611df2565b61ffff83166000908152600160205260409020611a65908383612e68565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab8383836040516110899392919061361b565b611aa1611df2565b6001600160a01b038116611b065760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108b0565b611b0f816127b4565b50565b604051633d7b2f6f60e21b815261ffff808616600483015284166024820152306044820152606481018290526060907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f5ecbdbc9060840160006040518083038186803b158015611b8d57600080fd5b505afa158015611ba1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dbc919081019061389a565b611bd161248e565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660009081526008602052604090205460ff168015611c2157506001600160a01b03841615155b611c3d5760405162461bcd60e51b81526004016108b090613639565b823411611c8c5760405162461bcd60e51b815260206004820152601f60248201527f4f726967696e616c4272696467653a4e6f7420656e6f7567682076616c75650060448201526064016108b0565b6000611cb87f000000000000000000000000000000000000000000000000000000000000000085612610565b5090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015611d1657600080fd5b505af1158015611d2a573d6000803e3d6000fd5b5050505050611d687f000000000000000000000000000000000000000000000000000000000000000086838434611d6191906135db565b878761264a565b50611d736001600655565b50505050565b600080611ddc5a60966366ad5c8a60e01b89898989604051602401611da19493929190613907565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915230929190612804565b915091508161116a5761116a868686868561288e565b6000546001600160a01b0316331461117a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108b0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611ea89190613590565b6000604051808303816000865af19150503d8060008114611ee5576040519150601f19603f3d011682016040523d82523d6000602084013e611eea565b606091505b5091509150818015611f14575080511580611f14575080806020019051810190611f149190613945565b610aef5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c45440060448201526064016108b0565b6001600160a01b0382166000908152600a6020526040812054611f839083613962565b90505b92915050565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b03861691611fd29190613590565b600060405180830381855afa9150503d806000811461200d576040519150601f19603f3d011682016040523d82523d6000602084013e612012565b606091505b50915091508161206e5760405162461bcd60e51b815260206004820152602160248201527f4f726967696e616c4272696467653a5374617469632063616c6c206661696c656044820152601960fa1b60648201526084016108b0565b808060200190518101906120829190613981565b949350505050565b600b5461ffff8581169116146120e25760405162461bcd60e51b815260206004820152601f60248201527f4f726967696e616c4272696467653a436861696e4964206d69736d617463680060448201526064016108b0565b600080600080600080868060200190518101906120ff919061399e565b955095509550955095509550600160ff168660ff161461216d5760405162461bcd60e51b815260206004820152602360248201527f4f726967696e616c4272696467653a506b2074797065206d6973206d69736d616044820152620e8c6d60eb1b60648201526084016108b0565b6001600160a01b03851660009081526008602052604090205460ff166121d55760405162461bcd60e51b815260206004820152601c60248201527f4f726967696e616c4272696467653a4e6f7420737570706f727465640000000060448201526064016108b0565b6001600160a01b038516600090815260096020526040812080548492906121fd9084906135db565b909155506000905061220f8685611f60565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614801561224f5750815b1561232257604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156122b657600080fd5b505af11580156122ca573d6000803e3d6000fd5b505050506122d8858261292b565b604080516001600160a01b0387168152602081018390526000917ffd19781f43410d9594fd4c02dd1d98dbe99099cbd222d5851a6e183c468d33ca910160405180910390a2612374565b61232d868683611e4c565b604080516001600160a01b038781168252602082018490528816917ffd19781f43410d9594fd4c02dd1d98dbe99099cbd222d5851a6e183c468d33ca910160405180910390a25b5050505050505050505050565b60608161238f81601f613a12565b10156123ce5760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016108b0565b6123d88284613a12565b8451101561241c5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016108b0565b60608215801561243b5760405191506000825260208201604052612485565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561247457805183526020928301920161245c565b5050858452601f01601f1916604052505b50949350505050565b600260065414156124e15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108b0565b6002600655565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b179052915160009283929088169161254c9190613590565b6000604051808303816000865af19150503d8060008114612589576040519150601f19603f3d011682016040523d82523d6000602084013e61258e565b606091505b50915091508180156125b85750805115806125b85750808060200190518101906125b89190613945565b61116a5760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b60648201526084016108b0565b6001600160a01b0382166000908152600a602052604081205481906126359084613a40565b905061264181846135db565b91509250929050565b600b5461265d9061ffff166000836129f9565b60006126698786612a72565b9050600081116126bb5760405162461bcd60e51b815260206004820152601d60248201527f4f726967696e616c4272696467653a496e76616c696420616d6f756e7400000060448201526064016108b0565b6001600160a01b038716600090815260096020526040812080548392906126e3908490613a12565b9091555050604080516000602082018190526001600160a01b03808b169383019390935291881660608201526080810183905260a00160408051601f19818403018152919052600b5490915061275c9061ffff16826127456020880188613095565b6127556040890160208a01613095565b878a612a95565b604080513381526001600160a01b038981166020830152918101889052908916907f358304737e16805ddc68ab8f04e14751a94bb8fd0a3fecc784b61d0c0789f4609060600160405180910390a25050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000606060008060008661ffff166001600160401b038111156128295761282961314c565b6040519080825280601f01601f191660200182016040528015612853576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115612875578692505b828152826000602083013e909890975095505050505050565b8180519060200120600560008761ffff1661ffff168152602001908152602001600020856040516128bf9190613590565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c9061291c9087908790879087908790613a54565b60405180910390a15050505050565b604080516000808252602082019092526001600160a01b0384169083906040516129559190613590565b60006040518083038185875af1925050503d8060008114612992576040519150601f19603f3d011682016040523d82523d6000602084013e612997565b606091505b50509050806129f45760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960448201526213115160ea1b60648201526084016108b0565b505050565b60075460ff1615612a14576129f4838360ff16836000612c3b565b8051156129f45760405162461bcd60e51b815260206004820152602660248201527f427269646765426173653a61646170746572506172616d73206d75737420626560448201526520656d70747960d01b60648201526084016108b0565b6001600160a01b0382166000908152600a6020526040812054611f839083613ab2565b61ffff861660009081526001602052604081208054612ab39061354b565b80601f0160208091040260200160405190810160405280929190818152602001828054612adf9061354b565b8015612b2c5780601f10612b0157610100808354040283529160200191612b2c565b820191906000526020600020905b815481529060010190602001808311612b0f57829003601f168201915b50505050509050805160001415612b9e5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b60648201526084016108b0565b612ba9878751612d1a565b60405162c5803160e81b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c5803100908490612c00908b9086908c908c908c908c90600401613ac6565b6000604051808303818588803b158015612c1957600080fd5b505af1158015612c2d573d6000803e3d6000fd5b505050505050505050505050565b6000612c4683612d88565b61ffff808716600090815260026020908152604080832093891683529290529081205491925090612c78908490613a12565b905060008111612cca5760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f742073657400000000000060448201526064016108b0565b8082101561116a5760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f77000000000060448201526064016108b0565b61ffff821660009081526003602052604090205480612d3857506127105b808211156129f45760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c6172676560448201526064016108b0565b6000602282511015612ddc5760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d730000000060448201526064016108b0565b506022015190565b828054612df09061354b565b90600052602060002090601f016020900481019282612e125760008555612e58565b82601f10612e2b57805160ff1916838001178555612e58565b82800160010185558215612e58579182015b82811115612e58578251825591602001919060010190612e3d565b50612e64929150612edc565b5090565b828054612e749061354b565b90600052602060002090601f016020900481019282612e965760008555612e58565b82601f10612eaf5782800160ff19823516178555612e58565b82800160010185558215612e58579182015b82811115612e58578235825591602001919060010190612ec1565b5b80821115612e645760008155600101612edd565b803561ffff81168114612f0357600080fd5b919050565b60008083601f840112612f1a57600080fd5b5081356001600160401b03811115612f3157600080fd5b602083019150836020828501011115612f4957600080fd5b9250929050565b80356001600160401b0381168114612f0357600080fd5b60008060008060008060808789031215612f8057600080fd5b612f8987612ef1565b955060208701356001600160401b0380821115612fa557600080fd5b612fb18a838b01612f08565b9097509550859150612fc560408a01612f50565b94506060890135915080821115612fdb57600080fd5b50612fe889828a01612f08565b979a9699509497509295939492505050565b60006020828403121561300c57600080fd5b611f8382612ef1565b6000806040838503121561302857600080fd5b61303183612ef1565b946020939093013593505050565b6001600160a01b0381168114611b0f57600080fd5b60008060006060848603121561306957600080fd5b83356130748161303f565b925060208401356130848161303f565b929592945050506040919091013590565b6000602082840312156130a757600080fd5b81356113268161303f565b6000806000604084860312156130c757600080fd5b6130d084612ef1565b925060208401356001600160401b038111156130eb57600080fd5b6130f786828701612f08565b9497909650939450505050565b60ff81168114611b0f57600080fd5b6000806040838503121561312657600080fd5b82356131318161303f565b9150602083013561314181613104565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561318a5761318a61314c565b604052919050565b60006001600160401b038211156131ab576131ab61314c565b50601f01601f191660200190565b600082601f8301126131ca57600080fd5b81356131dd6131d882613192565b613162565b8181528460208386010111156131f257600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121561322457600080fd5b61322d84612ef1565b925060208401356001600160401b0381111561324857600080fd5b613254868287016131b9565b92505061326360408501612f50565b90509250925092565b60005b8381101561328757818101518382015260200161326f565b83811115611d735750506000910152565b600081518084526132b081602086016020860161326c565b601f01601f19169290920160200192915050565b602081526000611f836020830184613298565b600080604083850312156132ea57600080fd5b6132f383612ef1565b915061330160208401612ef1565b90509250929050565b60006040828403121561331c57600080fd5b50919050565b600080600080600060c0868803121561333a57600080fd5b85356133458161303f565b945060208601356133558161303f565b93506040860135925061336b876060880161330a565b915060a08601356001600160401b0381111561338657600080fd5b613392888289016131b9565b9150509295509295909350565b8015158114611b0f57600080fd5b6000806000604084860312156133c257600080fd5b83356130d08161339f565b6000806000806000608086880312156133e557600080fd5b6133ee86612ef1565b94506133fc60208701612ef1565b93506040860135925060608601356001600160401b0381111561341e57600080fd5b61342a88828901612f08565b969995985093965092949392505050565b60008060006060848603121561345057600080fd5b61345984612ef1565b925061346760208501612ef1565b9150604084013590509250925092565b60006020828403121561348957600080fd5b81356113268161339f565b600080600080608085870312156134aa57600080fd5b6134b385612ef1565b93506134c160208601612ef1565b925060408501356134d18161303f565b9396929550929360600135925050565b60008060008060a085870312156134f757600080fd5b84356135028161303f565b935060208501359250613518866040870161330a565b915060808501356001600160401b0381111561353357600080fd5b61353f878288016131b9565b91505092959194509250565b600181811c9082168061355f57607f821691505b6020821081141561331c57634e487b7160e01b600052602260045260246000fd5b8183823760009101908152919050565b600082516135a281846020870161326c565b9190910192915050565b6000602082840312156135be57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156135ed576135ed6135c5565b500390565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff84168152604060208201526000610dbc6040830184866135f2565b6020808252601e908201527f4f726967696e616c4272696467653a496e76616c696420616464726573730000604082015260600190565b600060ff821660ff84168082101561368a5761368a6135c5565b90039392505050565b600181815b808511156136ce5781600019048211156136b4576136b46135c5565b808516156136c157918102915b93841c9390800290613698565b509250929050565b6000826136e557506001611f86565b816136f257506000611f86565b816001811461370857600281146137125761372e565b6001915050611f86565b60ff841115613723576137236135c5565b50506001821b611f86565b5060208310610133831016604e8410600b8410161715613751575081810a611f86565b61375b8383613693565b806000190482111561376f5761376f6135c5565b029392505050565b6000611f8360ff8416836136d6565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b61ffff871681526001600160a01b038616602082015260a0604082018190526000906137da90830187613298565b851515606084015282810360808401526137f58185876135f2565b9998505050505050505050565b6000806040838503121561381557600080fd5b505080516020909101519092909150565b600061ffff8088168352808716602084015250846040830152608060608301526138546080830184866135f2565b979650505050505050565b61ffff8616815260806020820152600061387d6080830186886135f2565b6001600160401b0394909416604083015250606001529392505050565b6000602082840312156138ac57600080fd5b81516001600160401b038111156138c257600080fd5b8201601f810184136138d357600080fd5b80516138e16131d882613192565b8181528560208385010111156138f657600080fd5b610dbc82602083016020860161326c565b61ffff851681526080602082015260006139246080830186613298565b6001600160401b038516604084015282810360608401526138548185613298565b60006020828403121561395757600080fd5b81516113268161339f565b600081600019048311821515161561397c5761397c6135c5565b500290565b60006020828403121561399357600080fd5b815161132681613104565b60008060008060008060c087890312156139b757600080fd5b86516139c281613104565b60208801519096506139d38161303f565b60408801519095506139e48161303f565b80945050606087015192506080870151915060a0870151613a048161339f565b809150509295509295509295565b60008219821115613a2557613a256135c5565b500190565b634e487b7160e01b600052601260045260246000fd5b600082613a4f57613a4f613a2a565b500690565b61ffff8616815260a060208201526000613a7160a0830187613298565b6001600160401b03861660408401528281036060840152613a928186613298565b90508281036080840152613aa68185613298565b98975050505050505050565b600082613ac157613ac1613a2a565b500490565b61ffff8716815260c060208201526000613ae360c0830188613298565b8281036040840152613af58188613298565b6001600160a01b0387811660608601528616608085015283810360a085015290506137f5818561329856fea2646970667358221220f27c36add217ff60d043cb9317db21574568e3972e938bc26091b7e41ec2fb5764736f6c6343000808003300000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6750000000000000000000000000000000000000000000000000000000000000099000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

Deployed Bytecode

0x6080604052600436106102495760003560e01c80638cfd8f5c11610139578063c4461834116100b6578063eab45d9c1161007a578063eab45d9c1461078f578063eb8d72b7146107af578063ed629c5c146107cf578063f2fde38b146107e9578063f5ecbdbc14610809578063fada9ccc1461082957600080fd5b8063c4461834146106f8578063cbed8b9c1461070e578063d1deba1f1461072e578063df2a5b3b14610741578063e95181961461076157600080fd5b8063a6c3d165116100fd578063a6c3d1651461061b578063ad5c46481461063b578063adb616641461066f578063b353aaa7146106a4578063baf3292d146106d857600080fd5b80638cfd8f5c1461055e5780638da5cb5b14610596578063950c8a74146105c85780639f38369a146105e8578063a29f61b41461060857600080fd5b806346f6f9b5116101c757806368c4ac261161018b57806368c4ac26146104aa57806368ea28b0146104da578063715018a6146104ef5780637533d7881461050457806389d7506b1461053157600080fd5b806346f6f9b5146103c75780634aff33c8146103ee5780635a4967e51461041b5780635b8c41e61461043b57806366ad5c8a1461048a57600080fd5b806338db1ebc1161020e57806338db1ebc146102f7578063396decb6146103175780633d8b38f61461034a5780633f1f4fa41461037a57806342d65a8d146103a757600080fd5b80621d35671461025557806307e0db17146102775780630df37483146102975780631095b6d7146102b757806310ddb137146102d757600080fd5b3661025057005b600080fd5b34801561026157600080fd5b50610275610270366004612f67565b61083c565b005b34801561028357600080fd5b50610275610292366004612ffa565b610a6d565b3480156102a357600080fd5b506102756102b2366004613015565b610af6565b3480156102c357600080fd5b506102756102d2366004613054565b610b15565b3480156102e357600080fd5b506102756102f2366004612ffa565b610be5565b34801561030357600080fd5b50610275610312366004612ffa565b610c3d565b34801561032357600080fd5b50610337610332366004613095565b610c90565b6040519081526020015b60405180910390f35b34801561035657600080fd5b5061036a6103653660046130b2565b610dc5565b6040519015158152602001610341565b34801561038657600080fd5b50610337610395366004612ffa565b60036020526000908152604090205481565b3480156103b357600080fd5b506102756103c23660046130b2565b610e91565b3480156103d357600080fd5b506103dc600081565b60405160ff9091168152602001610341565b3480156103fa57600080fd5b50610337610409366004613095565b60096020526000908152604090205481565b34801561042757600080fd5b50610275610436366004613113565b610f17565b34801561044757600080fd5b5061033761045636600461320f565b6005602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561049657600080fd5b506102756104a5366004612f67565b611096565b3480156104b657600080fd5b5061036a6104c5366004613095565b60086020526000908152604090205460ff1681565b3480156104e657600080fd5b506103dc600181565b3480156104fb57600080fd5b50610275611172565b34801561051057600080fd5b5061052461051f366004612ffa565b61117c565b60405161034191906132c4565b34801561053d57600080fd5b5061033761054c366004613095565b600a6020526000908152604090205481565b34801561056a57600080fd5b506103376105793660046132d7565b600260209081526000928352604080842090915290825290205481565b3480156105a257600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610341565b3480156105d457600080fd5b506004546105b0906001600160a01b031681565b3480156105f457600080fd5b50610524610603366004612ffa565b611216565b610275610616366004613322565b61132d565b34801561062757600080fd5b506102756106363660046130b2565b6114cd565b34801561064757600080fd5b506105b07f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b34801561067b57600080fd5b5061068f61068a3660046133ad565b611553565b60408051928352602083019190915201610341565b3480156106b057600080fd5b506105b07f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67581565b3480156106e457600080fd5b506102756106f3366004613095565b611643565b34801561070457600080fd5b5061033761271081565b34801561071a57600080fd5b506102756107293660046133cd565b611699565b61027561073c366004612f67565b61172e565b34801561074d57600080fd5b5061027561075c36600461343b565b611944565b34801561076d57600080fd5b50600b5461077c9061ffff1681565b60405161ffff9091168152602001610341565b34801561079b57600080fd5b506102756107aa366004613477565b6119f6565b3480156107bb57600080fd5b506102756107ca3660046130b2565b611a3f565b3480156107db57600080fd5b5060075461036a9060ff1681565b3480156107f557600080fd5b50610275610804366004613095565b611a99565b34801561081557600080fd5b50610524610824366004613494565b611b12565b6102756108373660046134e1565b611bc9565b337f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b0316146108b95760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff8616600090815260016020526040812080546108d79061354b565b80601f01602080910402602001604051908101604052809291908181526020018280546109039061354b565b80156109505780601f1061092557610100808354040283529160200191610950565b820191906000526020600020905b81548152906001019060200180831161093357829003601f168201915b5050505050905080518686905014801561096b575060008151115b80156109935750805160208201206040516109899088908890613580565b6040518091039020145b6109ee5760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b60648201526084016108b0565b610a648787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a935091508890889081908401838280828437600092019190915250611d7992505050565b50505050505050565b610a75611df2565b6040516307e0db1760e01b815261ffff821660048201527f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b0316906307e0db17906024015b600060405180830381600087803b158015610adb57600080fd5b505af1158015610aef573d6000803e3d6000fd5b5050505050565b610afe611df2565b61ffff909116600090815260036020526040902055565b610b1d611df2565b6000610b2884610c90565b905080821115610b895760405162461bcd60e51b815260206004820152602660248201527f4f726967696e616c4272696467653a496e76616c696420776974686472617720604482015265185b5bdd5b9d60d21b60648201526084016108b0565b610b94848484611e4c565b604080516001600160a01b038087168252851660208201529081018390527ff15a0a3784dea9b4fe33bc98e2450745e262d310237b2868ea8ef56967ff3ecb9060600160405180910390a150505050565b610bed611df2565b6040516310ddb13760e01b815261ffff821660048201527f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b0316906310ddb13790602401610ac1565b610c45611df2565b600b805461ffff191661ffff83169081179091556040519081527fe8df78a276e2b718a366328e9120b436ea83832fbeede026392fed933e3ffa5b906020015b60405180910390a150565b604051306024820152600090819081906001600160a01b0385169060440160408051601f198184030181529181526020820180516001600160e01b03166370a0823160e01b17905251610ce39190613590565b600060405180830381855afa9150503d8060008114610d1e576040519150601f19603f3d011682016040523d82523d6000602084013e610d23565b606091505b509150915081610d755760405162461bcd60e51b815260206004820152601b60248201527f4f726967696e616c3a5374617469632063616c6c206661696c6564000000000060448201526064016108b0565b600081806020019051810190610d8b91906135ac565b6001600160a01b038616600090815260096020526040902054909150610db2908690611f60565b610dbc90826135db565b95945050505050565b61ffff831660009081526001602052604081208054829190610de69061354b565b80601f0160208091040260200160405190810160405280929190818152602001828054610e129061354b565b8015610e5f5780601f10610e3457610100808354040283529160200191610e5f565b820191906000526020600020905b815481529060010190602001808311610e4257829003601f168201915b505050505090508383604051610e76929190613580565b60405180910390208180519060200120149150509392505050565b610e99611df2565b6040516342d65a8d60e01b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67516906342d65a8d90610ee99086908690869060040161361b565b600060405180830381600087803b158015610f0357600080fd5b505af1158015610a64573d6000803e3d6000fd5b610f1f611df2565b6001600160a01b03821660009081526008602052604090205460ff16158015610f5057506001600160a01b03821615155b610f6c5760405162461bcd60e51b81526004016108b090613639565b6000610f7783611f8c565b90508160ff168160ff1610156110095760405162461bcd60e51b815260206004820152604b60248201527f4f726967696e616c4272696467653a53686172656420646563696d616c73206d60448201527f757374206265206c657373207468616e206f7220657175616c20746f206c6f6360648201526a616c20646563696d616c7360a81b608482015260a4016108b0565b6001600160a01b0383166000908152600860205260409020805460ff191660011790556110368282613670565b61104190600a613777565b6001600160a01b0384166000818152600a602090815260409182902093909355519081527ff7fe8023cb2e36bde1d59a88ac5763a8c11be6d25e6819f71bb7e23e5bf0dc1691015b60405180910390a1505050565b3330146110f45760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b60648201526084016108b0565b61116a8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f89018190048102820181019092528781528993509150879087908190840183828082843760009201919091525061208a92505050565b505050505050565b61117a611df2565b565b600160205260009081526040902080546111959061354b565b80601f01602080910402602001604051908101604052809291908181526020018280546111c19061354b565b801561120e5780601f106111e35761010080835404028352916020019161120e565b820191906000526020600020905b8154815290600101906020018083116111f157829003601f168201915b505050505081565b61ffff81166000908152600160205260408120805460609291906112399061354b565b80601f01602080910402602001604051908101604052809291908181526020018280546112659061354b565b80156112b25780601f10611287576101008083540402835291602001916112b2565b820191906000526020600020905b81548152906001019060200180831161129557829003601f168201915b5050505050905080516000141561130b5760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f726400000060448201526064016108b0565b61132660006014835161131e91906135db565b839190612381565b9392505050565b61133561248e565b6001600160a01b03851660009081526008602052604090205460ff16801561136557506001600160a01b03841615155b6113815760405162461bcd60e51b81526004016108b090613639565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a082319060240160206040518083038186803b1580156113c357600080fd5b505afa1580156113d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fb91906135ac565b9050611409863330876124e8565b6040516370a0823160e01b81523060048201526000906001600160a01b038816906370a082319060240160206040518083038186803b15801561144b57600080fd5b505afa15801561145f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148391906135ac565b905060008061149b8961149686866135db565b612610565b909250905080156114b1576114b1893383611e4c565b6114bf898984348a8a61264a565b50505050610aef6001600655565b6114d5611df2565b8181306040516020016114ea93929190613786565b60408051601f1981840301815291815261ffff8516600090815260016020908152919020825161151f93919290910190612de4565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce8383836040516110899392919061361b565b60408051600060208201819052308284018190526060830181905260808084018390528451808503909101815260a0840194859052600b5463040a7bb160e41b909552919384937f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b0316926340a7bb10926115e79261ffff909116919086908c908c908c9060a4016137ac565b604080518083038186803b1580156115fe57600080fd5b505afa158015611612573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116369190613802565b9250925050935093915050565b61164b611df2565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b90602001610c85565b6116a1611df2565b6040516332fb62e760e21b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675169063cbed8b9c906116f59088908890889088908890600401613826565b600060405180830381600087803b15801561170f57600080fd5b505af1158015611723573d6000803e3d6000fd5b505050505050505050565b61ffff861660009081526005602052604080822090516117519088908890613580565b90815260408051602092819003830190206001600160401b038716600090815292529020549050806117d15760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b60648201526084016108b0565b8083836040516117e2929190613580565b6040518091039020146118415760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b60648201526084016108b0565b61ffff871660009081526005602052604080822090516118649089908990613580565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f880182900482028301820190528682526118fc918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061208a92505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e5878787878560405161193395949392919061385f565b60405180910390a150505050505050565b61194c611df2565b600081116119945760405162461bcd60e51b81526020600482015260156024820152744c7a4170703a20696e76616c6964206d696e47617360581b60448201526064016108b0565b61ffff83811660008181526002602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac090606001611089565b6119fe611df2565b6007805460ff19168215159081179091556040519081527f1584ad594a70cbe1e6515592e1272a987d922b097ead875069cebe8b40c004a490602001610c85565b611a47611df2565b61ffff83166000908152600160205260409020611a65908383612e68565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab8383836040516110899392919061361b565b611aa1611df2565b6001600160a01b038116611b065760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108b0565b611b0f816127b4565b50565b604051633d7b2f6f60e21b815261ffff808616600483015284166024820152306044820152606481018290526060907f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b03169063f5ecbdbc9060840160006040518083038186803b158015611b8d57600080fd5b505afa158015611ba1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dbc919081019061389a565b611bd161248e565b6001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21660009081526008602052604090205460ff168015611c2157506001600160a01b03841615155b611c3d5760405162461bcd60e51b81526004016108b090613639565b823411611c8c5760405162461bcd60e51b815260206004820152601f60248201527f4f726967696e616c4272696467653a4e6f7420656e6f7567682076616c75650060448201526064016108b0565b6000611cb87f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc285612610565b5090507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015611d1657600080fd5b505af1158015611d2a573d6000803e3d6000fd5b5050505050611d687f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc286838434611d6191906135db565b878761264a565b50611d736001600655565b50505050565b600080611ddc5a60966366ad5c8a60e01b89898989604051602401611da19493929190613907565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915230929190612804565b915091508161116a5761116a868686868561288e565b6000546001600160a01b0316331461117a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108b0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611ea89190613590565b6000604051808303816000865af19150503d8060008114611ee5576040519150601f19603f3d011682016040523d82523d6000602084013e611eea565b606091505b5091509150818015611f14575080511580611f14575080806020019051810190611f149190613945565b610aef5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c45440060448201526064016108b0565b6001600160a01b0382166000908152600a6020526040812054611f839083613962565b90505b92915050565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b03861691611fd29190613590565b600060405180830381855afa9150503d806000811461200d576040519150601f19603f3d011682016040523d82523d6000602084013e612012565b606091505b50915091508161206e5760405162461bcd60e51b815260206004820152602160248201527f4f726967696e616c4272696467653a5374617469632063616c6c206661696c656044820152601960fa1b60648201526084016108b0565b808060200190518101906120829190613981565b949350505050565b600b5461ffff8581169116146120e25760405162461bcd60e51b815260206004820152601f60248201527f4f726967696e616c4272696467653a436861696e4964206d69736d617463680060448201526064016108b0565b600080600080600080868060200190518101906120ff919061399e565b955095509550955095509550600160ff168660ff161461216d5760405162461bcd60e51b815260206004820152602360248201527f4f726967696e616c4272696467653a506b2074797065206d6973206d69736d616044820152620e8c6d60eb1b60648201526084016108b0565b6001600160a01b03851660009081526008602052604090205460ff166121d55760405162461bcd60e51b815260206004820152601c60248201527f4f726967696e616c4272696467653a4e6f7420737570706f727465640000000060448201526064016108b0565b6001600160a01b038516600090815260096020526040812080548492906121fd9084906135db565b909155506000905061220f8685611f60565b90507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316866001600160a01b031614801561224f5750815b1561232257604051632e1a7d4d60e01b8152600481018290527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156122b657600080fd5b505af11580156122ca573d6000803e3d6000fd5b505050506122d8858261292b565b604080516001600160a01b0387168152602081018390526000917ffd19781f43410d9594fd4c02dd1d98dbe99099cbd222d5851a6e183c468d33ca910160405180910390a2612374565b61232d868683611e4c565b604080516001600160a01b038781168252602082018490528816917ffd19781f43410d9594fd4c02dd1d98dbe99099cbd222d5851a6e183c468d33ca910160405180910390a25b5050505050505050505050565b60608161238f81601f613a12565b10156123ce5760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016108b0565b6123d88284613a12565b8451101561241c5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016108b0565b60608215801561243b5760405191506000825260208201604052612485565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561247457805183526020928301920161245c565b5050858452601f01601f1916604052505b50949350505050565b600260065414156124e15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108b0565b6002600655565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b179052915160009283929088169161254c9190613590565b6000604051808303816000865af19150503d8060008114612589576040519150601f19603f3d011682016040523d82523d6000602084013e61258e565b606091505b50915091508180156125b85750805115806125b85750808060200190518101906125b89190613945565b61116a5760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b60648201526084016108b0565b6001600160a01b0382166000908152600a602052604081205481906126359084613a40565b905061264181846135db565b91509250929050565b600b5461265d9061ffff166000836129f9565b60006126698786612a72565b9050600081116126bb5760405162461bcd60e51b815260206004820152601d60248201527f4f726967696e616c4272696467653a496e76616c696420616d6f756e7400000060448201526064016108b0565b6001600160a01b038716600090815260096020526040812080548392906126e3908490613a12565b9091555050604080516000602082018190526001600160a01b03808b169383019390935291881660608201526080810183905260a00160408051601f19818403018152919052600b5490915061275c9061ffff16826127456020880188613095565b6127556040890160208a01613095565b878a612a95565b604080513381526001600160a01b038981166020830152918101889052908916907f358304737e16805ddc68ab8f04e14751a94bb8fd0a3fecc784b61d0c0789f4609060600160405180910390a25050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000606060008060008661ffff166001600160401b038111156128295761282961314c565b6040519080825280601f01601f191660200182016040528015612853576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115612875578692505b828152826000602083013e909890975095505050505050565b8180519060200120600560008761ffff1661ffff168152602001908152602001600020856040516128bf9190613590565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c9061291c9087908790879087908790613a54565b60405180910390a15050505050565b604080516000808252602082019092526001600160a01b0384169083906040516129559190613590565b60006040518083038185875af1925050503d8060008114612992576040519150601f19603f3d011682016040523d82523d6000602084013e612997565b606091505b50509050806129f45760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960448201526213115160ea1b60648201526084016108b0565b505050565b60075460ff1615612a14576129f4838360ff16836000612c3b565b8051156129f45760405162461bcd60e51b815260206004820152602660248201527f427269646765426173653a61646170746572506172616d73206d75737420626560448201526520656d70747960d01b60648201526084016108b0565b6001600160a01b0382166000908152600a6020526040812054611f839083613ab2565b61ffff861660009081526001602052604081208054612ab39061354b565b80601f0160208091040260200160405190810160405280929190818152602001828054612adf9061354b565b8015612b2c5780601f10612b0157610100808354040283529160200191612b2c565b820191906000526020600020905b815481529060010190602001808311612b0f57829003601f168201915b50505050509050805160001415612b9e5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b60648201526084016108b0565b612ba9878751612d1a565b60405162c5803160e81b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675169063c5803100908490612c00908b9086908c908c908c908c90600401613ac6565b6000604051808303818588803b158015612c1957600080fd5b505af1158015612c2d573d6000803e3d6000fd5b505050505050505050505050565b6000612c4683612d88565b61ffff808716600090815260026020908152604080832093891683529290529081205491925090612c78908490613a12565b905060008111612cca5760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f742073657400000000000060448201526064016108b0565b8082101561116a5760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f77000000000060448201526064016108b0565b61ffff821660009081526003602052604090205480612d3857506127105b808211156129f45760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c6172676560448201526064016108b0565b6000602282511015612ddc5760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d730000000060448201526064016108b0565b506022015190565b828054612df09061354b565b90600052602060002090601f016020900481019282612e125760008555612e58565b82601f10612e2b57805160ff1916838001178555612e58565b82800160010185558215612e58579182015b82811115612e58578251825591602001919060010190612e3d565b50612e64929150612edc565b5090565b828054612e749061354b565b90600052602060002090601f016020900481019282612e965760008555612e58565b82601f10612eaf5782800160ff19823516178555612e58565b82800160010185558215612e58579182015b82811115612e58578235825591602001919060010190612ec1565b5b80821115612e645760008155600101612edd565b803561ffff81168114612f0357600080fd5b919050565b60008083601f840112612f1a57600080fd5b5081356001600160401b03811115612f3157600080fd5b602083019150836020828501011115612f4957600080fd5b9250929050565b80356001600160401b0381168114612f0357600080fd5b60008060008060008060808789031215612f8057600080fd5b612f8987612ef1565b955060208701356001600160401b0380821115612fa557600080fd5b612fb18a838b01612f08565b9097509550859150612fc560408a01612f50565b94506060890135915080821115612fdb57600080fd5b50612fe889828a01612f08565b979a9699509497509295939492505050565b60006020828403121561300c57600080fd5b611f8382612ef1565b6000806040838503121561302857600080fd5b61303183612ef1565b946020939093013593505050565b6001600160a01b0381168114611b0f57600080fd5b60008060006060848603121561306957600080fd5b83356130748161303f565b925060208401356130848161303f565b929592945050506040919091013590565b6000602082840312156130a757600080fd5b81356113268161303f565b6000806000604084860312156130c757600080fd5b6130d084612ef1565b925060208401356001600160401b038111156130eb57600080fd5b6130f786828701612f08565b9497909650939450505050565b60ff81168114611b0f57600080fd5b6000806040838503121561312657600080fd5b82356131318161303f565b9150602083013561314181613104565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561318a5761318a61314c565b604052919050565b60006001600160401b038211156131ab576131ab61314c565b50601f01601f191660200190565b600082601f8301126131ca57600080fd5b81356131dd6131d882613192565b613162565b8181528460208386010111156131f257600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121561322457600080fd5b61322d84612ef1565b925060208401356001600160401b0381111561324857600080fd5b613254868287016131b9565b92505061326360408501612f50565b90509250925092565b60005b8381101561328757818101518382015260200161326f565b83811115611d735750506000910152565b600081518084526132b081602086016020860161326c565b601f01601f19169290920160200192915050565b602081526000611f836020830184613298565b600080604083850312156132ea57600080fd5b6132f383612ef1565b915061330160208401612ef1565b90509250929050565b60006040828403121561331c57600080fd5b50919050565b600080600080600060c0868803121561333a57600080fd5b85356133458161303f565b945060208601356133558161303f565b93506040860135925061336b876060880161330a565b915060a08601356001600160401b0381111561338657600080fd5b613392888289016131b9565b9150509295509295909350565b8015158114611b0f57600080fd5b6000806000604084860312156133c257600080fd5b83356130d08161339f565b6000806000806000608086880312156133e557600080fd5b6133ee86612ef1565b94506133fc60208701612ef1565b93506040860135925060608601356001600160401b0381111561341e57600080fd5b61342a88828901612f08565b969995985093965092949392505050565b60008060006060848603121561345057600080fd5b61345984612ef1565b925061346760208501612ef1565b9150604084013590509250925092565b60006020828403121561348957600080fd5b81356113268161339f565b600080600080608085870312156134aa57600080fd5b6134b385612ef1565b93506134c160208601612ef1565b925060408501356134d18161303f565b9396929550929360600135925050565b60008060008060a085870312156134f757600080fd5b84356135028161303f565b935060208501359250613518866040870161330a565b915060808501356001600160401b0381111561353357600080fd5b61353f878288016131b9565b91505092959194509250565b600181811c9082168061355f57607f821691505b6020821081141561331c57634e487b7160e01b600052602260045260246000fd5b8183823760009101908152919050565b600082516135a281846020870161326c565b9190910192915050565b6000602082840312156135be57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156135ed576135ed6135c5565b500390565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff84168152604060208201526000610dbc6040830184866135f2565b6020808252601e908201527f4f726967696e616c4272696467653a496e76616c696420616464726573730000604082015260600190565b600060ff821660ff84168082101561368a5761368a6135c5565b90039392505050565b600181815b808511156136ce5781600019048211156136b4576136b46135c5565b808516156136c157918102915b93841c9390800290613698565b509250929050565b6000826136e557506001611f86565b816136f257506000611f86565b816001811461370857600281146137125761372e565b6001915050611f86565b60ff841115613723576137236135c5565b50506001821b611f86565b5060208310610133831016604e8410600b8410161715613751575081810a611f86565b61375b8383613693565b806000190482111561376f5761376f6135c5565b029392505050565b6000611f8360ff8416836136d6565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b61ffff871681526001600160a01b038616602082015260a0604082018190526000906137da90830187613298565b851515606084015282810360808401526137f58185876135f2565b9998505050505050505050565b6000806040838503121561381557600080fd5b505080516020909101519092909150565b600061ffff8088168352808716602084015250846040830152608060608301526138546080830184866135f2565b979650505050505050565b61ffff8616815260806020820152600061387d6080830186886135f2565b6001600160401b0394909416604083015250606001529392505050565b6000602082840312156138ac57600080fd5b81516001600160401b038111156138c257600080fd5b8201601f810184136138d357600080fd5b80516138e16131d882613192565b8181528560208385010111156138f657600080fd5b610dbc82602083016020860161326c565b61ffff851681526080602082015260006139246080830186613298565b6001600160401b038516604084015282810360608401526138548185613298565b60006020828403121561395757600080fd5b81516113268161339f565b600081600019048311821515161561397c5761397c6135c5565b500290565b60006020828403121561399357600080fd5b815161132681613104565b60008060008060008060c087890312156139b757600080fd5b86516139c281613104565b60208801519096506139d38161303f565b60408801519095506139e48161303f565b80945050606087015192506080870151915060a0870151613a048161339f565b809150509295509295509295565b60008219821115613a2557613a256135c5565b500190565b634e487b7160e01b600052601260045260246000fd5b600082613a4f57613a4f613a2a565b500690565b61ffff8616815260a060208201526000613a7160a0830187613298565b6001600160401b03861660408401528281036060840152613a928186613298565b90508281036080840152613aa68185613298565b98975050505050505050565b600082613ac157613ac1613a2a565b500490565b61ffff8716815260c060208201526000613ae360c0830188613298565b8281036040840152613af58188613298565b6001600160a01b0387811660608601528616608085015283810360a085015290506137f5818561329856fea2646970667358221220f27c36add217ff60d043cb9317db21574568e3972e938bc26091b7e41ec2fb5764736f6c63430008080033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6750000000000000000000000000000000000000000000000000000000000000099000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-----Decoded View---------------
Arg [0] : _endpoint (address): 0x66A71Dcef29A0fFBDBE3c6a460a3B5BC225Cd675
Arg [1] : _remoteChainId (uint16): 153
Arg [2] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000099
Arg [2] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2


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
[ 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.