ETH Price: $3,274.59 (-1.70%)

Contract

0x51ba447DaD1de30b91286471BcB570F69ECE968D
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Bind Asset Hash179749442023-08-23 4:12:35488 days ago1692763955IN
0x51ba447D...69ECE968D
0 ETH0.0010784317.02744873
Bind Proxy Hash179749302023-08-23 4:09:47488 days ago1692763787IN
0x51ba447D...69ECE968D
0 ETH0.0008463817.17610073
Set Manager Prox...179746732023-08-23 3:17:59488 days ago1692760679IN
0x51ba447D...69ECE968D
0 ETH0.0008407317.83361639
Transfer Ownersh...179744782023-08-23 2:38:47488 days ago1692758327IN
0x51ba447D...69ECE968D
0 ETH0.0004595415.99476482

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LockProxy

Compiler Version
v0.5.17+commit.d19bba13

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2023-08-21
*/

pragma solidity ^0.5.0;

/**
 * @dev Interface of the EthCrossChainManagerProxy for business contract like LockProxy to obtain the reliable EthCrossChainManager contract hash.
 */
interface IEthCrossChainManagerProxy {
    function getEthCrossChainManager() external view returns (address);
}

pragma solidity ^0.5.0;

/**
 * @dev Interface of the EthCrossChainManager contract for business contract like LockProxy to request cross chain transaction
 */
interface IEthCrossChainManager {
    function crossChain(uint64 _toChainId, bytes calldata _toContract, bytes calldata _method, bytes calldata _txData) external returns (bool);
}

pragma solidity ^0.5.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     *
     * _Available since v2.4.0._
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b != 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

pragma solidity ^0.5.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP. Does not include
 * the optional functions; to access them see {ERC20Detailed}.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @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);
}

pragma solidity ^0.5.0;


library Utils {

    /* @notice      Convert the bytes array to bytes32 type, the bytes array length must be 32
    *  @param _bs   Source bytes array
    *  @return      bytes32
    */
    function bytesToBytes32(bytes memory _bs) internal pure returns (bytes32 value) {
        require(_bs.length == 32, "bytes length is not 32.");
        assembly {
            // load 32 bytes from memory starting from position _bs + 0x20 since the first 0x20 bytes stores _bs length
            value := mload(add(_bs, 0x20))
        }
    }

    /* @notice      Convert bytes to uint256
    *  @param _b    Source bytes should have length of 32
    *  @return      uint256
    */
    function bytesToUint256(bytes memory _bs) internal pure returns (uint256 value) {
        require(_bs.length == 32, "bytes length is not 32.");
        assembly {
            // load 32 bytes from memory starting from position _bs + 32
            value := mload(add(_bs, 0x20))
        }
        require(value <= 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, "Value exceeds the range");
    }

    /* @notice      Convert uint256 to bytes
    *  @param _b    uint256 that needs to be converted
    *  @return      bytes
    */
    function uint256ToBytes(uint256 _value) internal pure returns (bytes memory bs) {
        require(_value <= 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, "Value exceeds the range");
        assembly {
            // Get a location of some free memory and store it in result as
            // Solidity does for memory variables.
            bs := mload(0x40)
            // Put 0x20 at the first word, the length of bytes for uint256 value
            mstore(bs, 0x20)
            //In the next word, put value in bytes format to the next 32 bytes
            mstore(add(bs, 0x20), _value)
            // Update the free-memory pointer by padding our last write location to 32 bytes
            mstore(0x40, add(bs, 0x40))
        }
    }

    /* @notice      Convert bytes to address
    *  @param _bs   Source bytes: bytes length must be 20
    *  @return      Converted address from source bytes
    */
    function bytesToAddress(bytes memory _bs) internal pure returns (address addr)
    {
        require(_bs.length == 20, "bytes length does not match address");
        assembly {
            // for _bs, first word store _bs.length, second word store _bs.value
            // load 32 bytes from mem[_bs+20], convert it into Uint160, meaning we take last 20 bytes as addr (address).
            addr := mload(add(_bs, 0x14))
        }

    }
    
    /* @notice      Convert address to bytes
    *  @param _addr Address need to be converted
    *  @return      Converted bytes from address
    */
    function addressToBytes(address _addr) internal pure returns (bytes memory bs){
        assembly {
            // Get a location of some free memory and store it in result as
            // Solidity does for memory variables.
            bs := mload(0x40)
            // Put 20 (address byte length) at the first word, the length of bytes for uint256 value
            mstore(bs, 0x14)
            // logical shift left _a by 12 bytes, change _a from right-aligned to left-aligned
            mstore(add(bs, 0x20), shl(96, _addr))
            // Update the free-memory pointer by padding our last write location to 32 bytes
            mstore(0x40, add(bs, 0x40))
       }
    }

    /* @notice          Do hash leaf as the multi-chain does
    *  @param _data     Data in bytes format
    *  @return          Hashed value in bytes32 format
    */
    function hashLeaf(bytes memory _data) internal pure returns (bytes32 result)  {
        result = sha256(abi.encodePacked(byte(0x0), _data));
    }

    /* @notice          Do hash children as the multi-chain does
    *  @param _l        Left node
    *  @param _r        Right node
    *  @return          Hashed value in bytes32 format
    */
    function hashChildren(bytes32 _l, bytes32  _r) internal pure returns (bytes32 result)  {
        result = sha256(abi.encodePacked(bytes1(0x01), _l, _r));
    }

    /* @notice              Compare if two bytes are equal, which are in storage and memory, seperately
                            Refer from https://github.com/summa-tx/bitcoin-spv/blob/master/solidity/contracts/BytesLib.sol#L368
    *  @param _preBytes     The bytes stored in storage
    *  @param _postBytes    The bytes stored in memory
    *  @return              Bool type indicating if they are equal
    */
    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)
            // 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)

            // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
                // fslot can contain both the length and contents of the array
                // if slength < 32 bytes so let's prepare for that
                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                // slength != 0
                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(uint(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;
    }

    /* @notice              Slice the _bytes from _start index till the result has length of _length
                            Refer from https://github.com/summa-tx/bitcoin-spv/blob/master/solidity/contracts/BytesLib.sol#L246
    *  @param _bytes        The original bytes needs to be sliced
    *  @param _start        The index of _bytes for the start of sliced bytes
    *  @param _length       The index of _bytes for the end of sliced bytes
    *  @return              The sliced bytes
    */
    function slice(
        bytes memory _bytes,
        uint _start,
        uint _length
    )
        internal
        pure
        returns (bytes memory)
    {
        require(_bytes.length >= (_start + _length));

        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.
                // lengthmod <= _length % 32
                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)

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

        return tempBytes;
    }
    /* @notice              Check if the elements number of _signers within _keepers array is no less than _m
    *  @param _keepers      The array consists of serveral address
    *  @param _signers      Some specific addresses to be looked into
    *  @param _m            The number requirement paramter
    *  @return              True means containment, false meansdo do not contain.
    */
    function containMAddresses(address[] memory _keepers, address[] memory _signers, uint _m) internal pure returns (bool){
        uint m = 0;
        for(uint i = 0; i < _signers.length; i++){
            for (uint j = 0; j < _keepers.length; j++) {
                if (_signers[i] == _keepers[j]) {
                    m++;
                    // delete _keepers[j];
                    _keepers[j] = 0x7777777777777777777777777777777777777777;
                }
            }
        }
        return m >= _m;
    }

    /* @notice              TODO
    *  @param key
    *  @return
    */
    function compressMCPubKey(bytes memory key) internal pure returns (bytes memory newkey) {
         require(key.length >= 67, "key lenggh is too short");
         newkey = slice(key, 0, 35);
         if (uint8(key[66]) % 2 == 0){
             newkey[2] = byte(0x02);
         } else {
             newkey[2] = byte(0x03);
         }
         return newkey;
    }
    
    /**
     * @dev Returns true if `account` is a contract.
     *      Refer from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol#L18
     *
     * This test is non-exhaustive, and there may be false-negatives: during the
     * execution of a contract's constructor, its address will be reported as
     * not containing a contract.
     *
     * IMPORTANT: It is unsafe to assume that an address for which this
     * function returns false is an externally-owned account (EOA) and not a
     * contract.
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != 0x0 && codehash != accountHash);
    }
}

pragma solidity ^0.5.0;




/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value);
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves.

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length
        require(Utils.isContract(address(token)), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeERC20: low-level call failed");

        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

pragma solidity ^0.5.0;

/**
 * @dev Wrappers over encoding and serialization operation into bytes from bassic types in Solidity for PolyNetwork cross chain utility.
 *
 * Encode basic types in Solidity into bytes easily. It's designed to be used 
 * for PolyNetwork cross chain application, and the encoding rules on Ethereum chain 
 * and the decoding rules on other chains should be consistent. Here we  
 * follow the underlying serialization rule with implementation found here: 
 * https://github.com/polynetwork/poly/blob/master/common/zero_copy_sink.go
 *
 * Using this library instead of the unchecked serialization method can help reduce
 * the risk of serious bugs and handfule, so it's recommended to use it.
 *
 * Please note that risk can be minimized, yet not eliminated.
 */
library ZeroCopySink {
    /* @notice          Convert boolean value into bytes
    *  @param b         The boolean value
    *  @return          Converted bytes array
    */
    function WriteBool(bool b) internal pure returns (bytes memory) {
        bytes memory buff;
        assembly{
            buff := mload(0x40)
            mstore(buff, 1)
            switch iszero(b)
            case 1 {
                mstore(add(buff, 0x20), shl(248, 0x00))
                // mstore8(add(buff, 0x20), 0x00)
            }
            default {
                mstore(add(buff, 0x20), shl(248, 0x01))
                // mstore8(add(buff, 0x20), 0x01)
            }
            mstore(0x40, add(buff, 0x21))
        }
        return buff;
    }

    /* @notice          Convert byte value into bytes
    *  @param b         The byte value
    *  @return          Converted bytes array
    */
    function WriteByte(byte b) internal pure returns (bytes memory) {
        return WriteUint8(uint8(b));
    }

    /* @notice          Convert uint8 value into bytes
    *  @param v         The uint8 value
    *  @return          Converted bytes array
    */
    function WriteUint8(uint8 v) internal pure returns (bytes memory) {
        bytes memory buff;
        assembly{
            buff := mload(0x40)
            mstore(buff, 1)
            mstore(add(buff, 0x20), shl(248, v))
            // mstore(add(buff, 0x20), byte(0x1f, v))
            mstore(0x40, add(buff, 0x21))
        }
        return buff;
    }

    /* @notice          Convert uint16 value into bytes
    *  @param v         The uint16 value
    *  @return          Converted bytes array
    */
    function WriteUint16(uint16 v) internal pure returns (bytes memory) {
        bytes memory buff;

        assembly{
            buff := mload(0x40)
            let byteLen := 0x02
            mstore(buff, byteLen)
            for {
                let mindex := 0x00
                let vindex := 0x1f
            } lt(mindex, byteLen) {
                mindex := add(mindex, 0x01)
                vindex := sub(vindex, 0x01)
            }{
                mstore8(add(add(buff, 0x20), mindex), byte(vindex, v))
            }
            mstore(0x40, add(buff, 0x22))
        }
        return buff;
    }
    
    /* @notice          Convert uint32 value into bytes
    *  @param v         The uint32 value
    *  @return          Converted bytes array
    */
    function WriteUint32(uint32 v) internal pure returns(bytes memory) {
        bytes memory buff;
        assembly{
            buff := mload(0x40)
            let byteLen := 0x04
            mstore(buff, byteLen)
            for {
                let mindex := 0x00
                let vindex := 0x1f
            } lt(mindex, byteLen) {
                mindex := add(mindex, 0x01)
                vindex := sub(vindex, 0x01)
            }{
                mstore8(add(add(buff, 0x20), mindex), byte(vindex, v))
            }
            mstore(0x40, add(buff, 0x24))
        }
        return buff;
    }

    /* @notice          Convert uint64 value into bytes
    *  @param v         The uint64 value
    *  @return          Converted bytes array
    */
    function WriteUint64(uint64 v) internal pure returns(bytes memory) {
        bytes memory buff;

        assembly{
            buff := mload(0x40)
            let byteLen := 0x08
            mstore(buff, byteLen)
            for {
                let mindex := 0x00
                let vindex := 0x1f
            } lt(mindex, byteLen) {
                mindex := add(mindex, 0x01)
                vindex := sub(vindex, 0x01)
            }{
                mstore8(add(add(buff, 0x20), mindex), byte(vindex, v))
            }
            mstore(0x40, add(buff, 0x28))
        }
        return buff;
    }

    /* @notice          Convert limited uint256 value into bytes
    *  @param v         The uint256 value
    *  @return          Converted bytes array
    */
    function WriteUint255(uint256 v) internal pure returns (bytes memory) {
        require(v <= 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, "Value exceeds uint255 range");
        bytes memory buff;

        assembly{
            buff := mload(0x40)
            let byteLen := 0x20
            mstore(buff, byteLen)
            for {
                let mindex := 0x00
                let vindex := 0x1f
            } lt(mindex, byteLen) {
                mindex := add(mindex, 0x01)
                vindex := sub(vindex, 0x01)
            }{
                mstore8(add(add(buff, 0x20), mindex), byte(vindex, v))
            }
            mstore(0x40, add(buff, 0x40))
        }
        return buff;
    }

    /* @notice          Encode bytes format data into bytes
    *  @param data      The bytes array data
    *  @return          Encoded bytes array
    */
    function WriteVarBytes(bytes memory data) internal pure returns (bytes memory) {
        uint64 l = uint64(data.length);
        return abi.encodePacked(WriteVarUint(l), data);
    }

    function WriteVarUint(uint64 v) internal pure returns (bytes memory) {
        if (v < 0xFD){
    		return WriteUint8(uint8(v));
    	} else if (v <= 0xFFFF) {
    		return abi.encodePacked(WriteByte(0xFD), WriteUint16(uint16(v)));
    	} else if (v <= 0xFFFFFFFF) {
            return abi.encodePacked(WriteByte(0xFE), WriteUint32(uint32(v)));
    	} else {
    		return abi.encodePacked(WriteByte(0xFF), WriteUint64(uint64(v)));
    	}
    }
}

pragma solidity ^0.5.0;

/**
 * @dev Wrappers over decoding and deserialization operation from bytes into bassic types in Solidity for PolyNetwork cross chain utility.
 *
 * Decode into basic types in Solidity from bytes easily. It's designed to be used 
 * for PolyNetwork cross chain application, and the decoding rules on Ethereum chain 
 * and the encoding rule on other chains should be consistent, and . Here we
 * follow the underlying deserialization rule with implementation found here: 
 * https://github.com/polynetwork/poly/blob/master/common/zero_copy_source.go
 *
 * Using this library instead of the unchecked serialization method can help reduce
 * the risk of serious bugs and handfule, so it's recommended to use it.
 *
 * Please note that risk can be minimized, yet not eliminated.
 */
library ZeroCopySource {
    /* @notice              Read next byte as boolean type starting at offset from buff
    *  @param buff          Source bytes array
    *  @param offset        The position from where we read the boolean value
    *  @return              The the read boolean value and new offset
    */
    function NextBool(bytes memory buff, uint256 offset) internal pure returns(bool, uint256) {
        require(offset + 1 <= buff.length && offset < offset + 1, "Offset exceeds limit");
        // byte === bytes1
        byte v;
        assembly{
            v := mload(add(add(buff, 0x20), offset))
        }
        bool value;
        if (v == 0x01) {
		    value = true;
    	} else if (v == 0x00) {
            value = false;
        } else {
            revert("NextBool value error");
        }
        return (value, offset + 1);
    }

    /* @notice              Read next byte starting at offset from buff
    *  @param buff          Source bytes array
    *  @param offset        The position from where we read the byte value
    *  @return              The read byte value and new offset
    */
    function NextByte(bytes memory buff, uint256 offset) internal pure returns (byte, uint256) {
        require(offset + 1 <= buff.length && offset < offset + 1, "NextByte, Offset exceeds maximum");
        byte v;
        assembly{
            v := mload(add(add(buff, 0x20), offset))
        }
        return (v, offset + 1);
    }

    /* @notice              Read next byte as uint8 starting at offset from buff
    *  @param buff          Source bytes array
    *  @param offset        The position from where we read the byte value
    *  @return              The read uint8 value and new offset
    */
    function NextUint8(bytes memory buff, uint256 offset) internal pure returns (uint8, uint256) {
        require(offset + 1 <= buff.length && offset < offset + 1, "NextUint8, Offset exceeds maximum");
        uint8 v;
        assembly{
            let tmpbytes := mload(0x40)
            let bvalue := mload(add(add(buff, 0x20), offset))
            mstore8(tmpbytes, byte(0, bvalue))
            mstore(0x40, add(tmpbytes, 0x01))
            v := mload(sub(tmpbytes, 0x1f))
        }
        return (v, offset + 1);
    }

    /* @notice              Read next two bytes as uint16 type starting from offset
    *  @param buff          Source bytes array
    *  @param offset        The position from where we read the uint16 value
    *  @return              The read uint16 value and updated offset
    */
    function NextUint16(bytes memory buff, uint256 offset) internal pure returns (uint16, uint256) {
        require(offset + 2 <= buff.length && offset < offset + 2, "NextUint16, offset exceeds maximum");
        
        uint16 v;
        assembly {
            let tmpbytes := mload(0x40)
            let bvalue := mload(add(add(buff, 0x20), offset))
            mstore8(tmpbytes, byte(0x01, bvalue))
            mstore8(add(tmpbytes, 0x01), byte(0, bvalue))
            mstore(0x40, add(tmpbytes, 0x02))
            v := mload(sub(tmpbytes, 0x1e))
        }
        return (v, offset + 2);
    }


    /* @notice              Read next four bytes as uint32 type starting from offset
    *  @param buff          Source bytes array
    *  @param offset        The position from where we read the uint32 value
    *  @return              The read uint32 value and updated offset
    */
    function NextUint32(bytes memory buff, uint256 offset) internal pure returns (uint32, uint256) {
        require(offset + 4 <= buff.length && offset < offset + 4, "NextUint32, offset exceeds maximum");
        uint32 v;
        assembly {
            let tmpbytes := mload(0x40)
            let byteLen := 0x04
            for {
                let tindex := 0x00
                let bindex := sub(byteLen, 0x01)
                let bvalue := mload(add(add(buff, 0x20), offset))
            } lt(tindex, byteLen) {
                tindex := add(tindex, 0x01)
                bindex := sub(bindex, 0x01)
            }{
                mstore8(add(tmpbytes, tindex), byte(bindex, bvalue))
            }
            mstore(0x40, add(tmpbytes, byteLen))
            v := mload(sub(tmpbytes, sub(0x20, byteLen)))
        }
        return (v, offset + 4);
    }

    /* @notice              Read next eight bytes as uint64 type starting from offset
    *  @param buff          Source bytes array
    *  @param offset        The position from where we read the uint64 value
    *  @return              The read uint64 value and updated offset
    */
    function NextUint64(bytes memory buff, uint256 offset) internal pure returns (uint64, uint256) {
        require(offset + 8 <= buff.length && offset < offset + 8, "NextUint64, offset exceeds maximum");
        uint64 v;
        assembly {
            let tmpbytes := mload(0x40)
            let byteLen := 0x08
            for {
                let tindex := 0x00
                let bindex := sub(byteLen, 0x01)
                let bvalue := mload(add(add(buff, 0x20), offset))
            } lt(tindex, byteLen) {
                tindex := add(tindex, 0x01)
                bindex := sub(bindex, 0x01)
            }{
                mstore8(add(tmpbytes, tindex), byte(bindex, bvalue))
            }
            mstore(0x40, add(tmpbytes, byteLen))
            v := mload(sub(tmpbytes, sub(0x20, byteLen)))
        }
        return (v, offset + 8);
    }

    /* @notice              Read next 32 bytes as uint256 type starting from offset,
                            there are limits considering the numerical limits in multi-chain
    *  @param buff          Source bytes array
    *  @param offset        The position from where we read the uint256 value
    *  @return              The read uint256 value and updated offset
    */
    function NextUint255(bytes memory buff, uint256 offset) internal pure returns (uint256, uint256) {
        require(offset + 32 <= buff.length && offset < offset + 32, "NextUint255, offset exceeds maximum");
        uint256 v;
        assembly {
            let tmpbytes := mload(0x40)
            let byteLen := 0x20
            for {
                let tindex := 0x00
                let bindex := sub(byteLen, 0x01)
                let bvalue := mload(add(add(buff, 0x20), offset))
            } lt(tindex, byteLen) {
                tindex := add(tindex, 0x01)
                bindex := sub(bindex, 0x01)
            }{
                mstore8(add(tmpbytes, tindex), byte(bindex, bvalue))
            }
            mstore(0x40, add(tmpbytes, byteLen))
            v := mload(tmpbytes)
        }
        require(v <= 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, "Value exceeds the range");
        return (v, offset + 32);
    }
    /* @notice              Read next variable bytes starting from offset,
                            the decoding rule coming from multi-chain
    *  @param buff          Source bytes array
    *  @param offset        The position from where we read the bytes value
    *  @return              The read variable bytes array value and updated offset
    */
    function NextVarBytes(bytes memory buff, uint256 offset) internal pure returns(bytes memory, uint256) {
        uint len;
        (len, offset) = NextVarUint(buff, offset);
        require(offset + len <= buff.length && offset < offset + len, "NextVarBytes, offset exceeds maximum");
        bytes memory tempBytes;
        assembly{
            switch iszero(len)
            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(len, 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, len)

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

                mstore(tempBytes, len)

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

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

        return (tempBytes, offset + len);
    }
    /* @notice              Read next 32 bytes starting from offset,
    *  @param buff          Source bytes array
    *  @param offset        The position from where we read the bytes value
    *  @return              The read bytes32 value and updated offset
    */
    function NextHash(bytes memory buff, uint256 offset) internal pure returns (bytes32 , uint256) {
        require(offset + 32 <= buff.length && offset < offset + 32, "NextHash, offset exceeds maximum");
        bytes32 v;
        assembly {
            v := mload(add(buff, add(offset, 0x20)))
        }
        return (v, offset + 32);
    }

    /* @notice              Read next 20 bytes starting from offset,
    *  @param buff          Source bytes array
    *  @param offset        The position from where we read the bytes value
    *  @return              The read bytes20 value and updated offset
    */
    function NextBytes20(bytes memory buff, uint256 offset) internal pure returns (bytes20 , uint256) {
        require(offset + 20 <= buff.length && offset < offset + 20, "NextBytes20, offset exceeds maximum");
        bytes20 v;
        assembly {
            v := mload(add(buff, add(offset, 0x20)))
        }
        return (v, offset + 20);
    }
    
    function NextVarUint(bytes memory buff, uint256 offset) internal pure returns(uint, uint256) {
        byte v;
        (v, offset) = NextByte(buff, offset);

        uint value;
        if (v == 0xFD) {
            // return NextUint16(buff, offset);
            (value, offset) = NextUint16(buff, offset);
            require(value >= 0xFD && value <= 0xFFFF, "NextUint16, value outside range");
            return (value, offset);
        } else if (v == 0xFE) {
            // return NextUint32(buff, offset);
            (value, offset) = NextUint32(buff, offset);
            require(value > 0xFFFF && value <= 0xFFFFFFFF, "NextVarUint, value outside range");
            return (value, offset);
        } else if (v == 0xFF) {
            // return NextUint64(buff, offset);
            (value, offset) = NextUint64(buff, offset);
            require(value > 0xFFFFFFFF, "NextVarUint, value outside range");
            return (value, offset);
        } else{
            // return (uint8(v), offset);
            value = uint8(v);
            require(value < 0xFD, "NextVarUint, value outside range");
            return (value, offset);
        }
    }
}

pragma solidity ^0.5.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 GSN 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.
 * Refer from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/GSN/Context.sol
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }
    // solhint-disable-previous-line no-empty-blocks

    function _msgSender() internal view returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}


pragma solidity ^0.5.0;

/**
 * @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.
 *
 * 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.
 */
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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return _msgSender() == _owner;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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  onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}


pragma solidity ^0.5.0;









contract LockProxy is Ownable {
    using SafeMath for uint;
    using SafeERC20 for IERC20;

    struct TxArgs {
        bytes toAssetHash;
        bytes toAddress;
        uint256 amount;
    }
    address public managerProxyContract;
    mapping(uint64 => bytes) public proxyHashMap;
    mapping(address => mapping(uint64 => bytes)) public assetHashMap;
    mapping(address => bool) safeTransfer;

    event SetManagerProxyEvent(address manager);
    event BindProxyEvent(uint64 toChainId, bytes targetProxyHash);
    event BindAssetEvent(address fromAssetHash, uint64 toChainId, bytes targetProxyHash, uint initialAmount);
    event UnlockEvent(address toAssetHash, address toAddress, uint256 amount);
    event LockEvent(address fromAssetHash, address fromAddress, uint64 toChainId, bytes toAssetHash, bytes toAddress, uint256 amount);
    
    modifier onlyManagerContract() {
        IEthCrossChainManagerProxy ieccmp = IEthCrossChainManagerProxy(managerProxyContract);
        require(_msgSender() == ieccmp.getEthCrossChainManager(), "msgSender is not EthCrossChainManagerContract");
        _;
    }
    
    function setManagerProxy(address ethCCMProxyAddr) onlyOwner public {
        managerProxyContract = ethCCMProxyAddr;
        emit SetManagerProxyEvent(managerProxyContract);
    }
    
    function bindProxyHash(uint64 toChainId, bytes memory targetProxyHash) onlyOwner public returns (bool) {
        proxyHashMap[toChainId] = targetProxyHash;
        emit BindProxyEvent(toChainId, targetProxyHash);
        return true;
    }
    
    function bindAssetHash(address fromAssetHash, uint64 toChainId, bytes memory toAssetHash) onlyOwner public returns (bool) {
        assetHashMap[fromAssetHash][toChainId] = toAssetHash;
        emit BindAssetEvent(fromAssetHash, toChainId, toAssetHash, getBalanceFor(fromAssetHash));
        return true;
    }
    
    /* @notice                  This function is meant to be invoked by the user,
    *                           a certin amount teokens will be locked in the proxy contract the invoker/msg.sender immediately.
    *                           Then the same amount of tokens will be unloked from target chain proxy contract at the target chain with chainId later.
    *  @param fromAssetHash     The asset address in current chain, uniformly named as `fromAssetHash`
    *  @param toChainId         The target chain id
    *                           
    *  @param toAddress         The address in bytes format to receive same amount of tokens in target chain 
    *  @param amount            The amount of tokens to be crossed from ethereum to the chain with chainId
    */
    function lock(address fromAssetHash, uint64 toChainId, bytes memory toAddress, uint256 amount) public payable returns (bool) {
        require(amount != 0, "amount cannot be zero!");
        
        
        require(_transferToContract(fromAssetHash, amount), "transfer asset from fromAddress to lock_proxy contract  failed!");
        
        bytes memory toAssetHash = assetHashMap[fromAssetHash][toChainId];
        require(toAssetHash.length != 0, "empty illegal toAssetHash");

        TxArgs memory txArgs = TxArgs({
            toAssetHash: toAssetHash,
            toAddress: toAddress,
            amount: amount
        });
        bytes memory txData = _serializeTxArgs(txArgs);
        
        IEthCrossChainManagerProxy eccmp = IEthCrossChainManagerProxy(managerProxyContract);
        address eccmAddr = eccmp.getEthCrossChainManager();
        IEthCrossChainManager eccm = IEthCrossChainManager(eccmAddr);
        
        bytes memory toProxyHash = proxyHashMap[toChainId];
        require(toProxyHash.length != 0, "empty illegal toProxyHash");
        require(eccm.crossChain(toChainId, toProxyHash, "unlock", txData), "EthCrossChainManager crossChain executed error!");

        emit LockEvent(fromAssetHash, _msgSender(), toChainId, toAssetHash, toAddress, amount);
        
        return true;

    }
    
    // /* @notice                  This function is meant to be invoked by the ETH crosschain management contract,
    // *                           then mint a certin amount of tokens to the designated address since a certain amount 
    // *                           was burnt from the source chain invoker.
    // *  @param argsBs            The argument bytes recevied by the ethereum lock proxy contract, need to be deserialized.
    // *                           based on the way of serialization in the source chain proxy contract.
    // *  @param fromContractAddr  The source chain contract address
    // *  @param fromChainId       The source chain id
    // */
    function unlock(bytes memory argsBs, bytes memory fromContractAddr, uint64 fromChainId) onlyManagerContract public returns (bool) {
        TxArgs memory args = _deserializeTxArgs(argsBs);

        require(fromContractAddr.length != 0, "from proxy contract address cannot be empty");
        require(Utils.equalStorage(proxyHashMap[fromChainId], fromContractAddr), "From Proxy contract address error!");
        
        require(args.toAssetHash.length != 0, "toAssetHash cannot be empty");
        address toAssetHash = Utils.bytesToAddress(args.toAssetHash);

        require(args.toAddress.length != 0, "toAddress cannot be empty");
        address toAddress = Utils.bytesToAddress(args.toAddress);
        
        
        require(_transferFromContract(toAssetHash, toAddress, args.amount), "transfer asset from lock_proxy contract to toAddress failed!");
        
        emit UnlockEvent(toAssetHash, toAddress, args.amount);
        return true;
    }
    
    function getBalanceFor(address fromAssetHash) public view returns (uint256) {
        if (fromAssetHash == address(0)) {
            // return address(this).balance; // this expression would result in error: Failed to decode output: Error: insufficient data for uint256 type
            address selfAddr = address(this);
            return selfAddr.balance;
        } else {
            IERC20 erc20Token = IERC20(fromAssetHash);
            return erc20Token.balanceOf(address(this));
        }
    }
    function _transferToContract(address fromAssetHash, uint256 amount) internal returns (bool) {
        if (fromAssetHash == address(0)) {
            // fromAssetHash === address(0) denotes user choose to lock ether
            // passively check if the received msg.value equals amount
            require(msg.value != 0, "transferred ether cannot be zero!");
            require(msg.value == amount, "transferred ether is not equal to amount!");
        } else {
            // make sure lockproxy contract will decline any received ether
            require(msg.value == 0, "there should be no ether transfer!");
            // actively transfer amount of asset from msg.sender to lock_proxy contract
            require(_transferERC20ToContract(fromAssetHash, _msgSender(), address(this), amount), "transfer erc20 asset to lock_proxy contract failed!");
        }
        return true;
    }
    function _transferFromContract(address toAssetHash, address toAddress, uint256 amount) internal returns (bool) {
        if (toAssetHash == address(0x0000000000000000000000000000000000000000)) {
            // toAssetHash === address(0) denotes contract needs to unlock ether to toAddress
            // convert toAddress from 'address' type to 'address payable' type, then actively transfer ether
            address(uint160(toAddress)).transfer(amount);
        } else {
            // actively transfer amount of asset from lock_proxy contract to toAddress
            require(_transferERC20FromContract(toAssetHash, toAddress, amount), "transfer erc20 asset from lock_proxy contract to toAddress failed!");
        }
        return true;
    }
    
    
    function _transferERC20ToContract(address fromAssetHash, address fromAddress, address toAddress, uint256 amount) internal returns (bool) {
         IERC20 erc20Token = IERC20(fromAssetHash);
        //  require(erc20Token.transferFrom(fromAddress, toAddress, amount), "trasnfer ERC20 Token failed!");
         erc20Token.safeTransferFrom(fromAddress, toAddress, amount);
         return true;
    }
    function _transferERC20FromContract(address toAssetHash, address toAddress, uint256 amount) internal returns (bool) {
         IERC20 erc20Token = IERC20(toAssetHash);
        //  require(erc20Token.transfer(toAddress, amount), "trasnfer ERC20 Token failed!");
         erc20Token.safeTransfer(toAddress, amount);
         return true;
    }
    
    function _serializeTxArgs(TxArgs memory args) internal pure returns (bytes memory) {
        bytes memory buff;
        buff = abi.encodePacked(
            ZeroCopySink.WriteVarBytes(args.toAssetHash),
            ZeroCopySink.WriteVarBytes(args.toAddress),
            ZeroCopySink.WriteUint255(args.amount)
            );
        return buff;
    }

    function _deserializeTxArgs(bytes memory valueBs) internal pure returns (TxArgs memory) {
        TxArgs memory args;
        uint256 off = 0;
        (args.toAssetHash, off) = ZeroCopySource.NextVarBytes(valueBs, off);
        (args.toAddress, off) = ZeroCopySource.NextVarBytes(valueBs, off);
        (args.amount, off) = ZeroCopySource.NextUint255(valueBs, off);
        return args;
    }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"fromAssetHash","type":"address"},{"indexed":false,"internalType":"uint64","name":"toChainId","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"targetProxyHash","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"initialAmount","type":"uint256"}],"name":"BindAssetEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"toChainId","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"targetProxyHash","type":"bytes"}],"name":"BindProxyEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"fromAssetHash","type":"address"},{"indexed":false,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":false,"internalType":"uint64","name":"toChainId","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"toAssetHash","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"toAddress","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LockEvent","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":false,"internalType":"address","name":"manager","type":"address"}],"name":"SetManagerProxyEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"toAssetHash","type":"address"},{"indexed":false,"internalType":"address","name":"toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UnlockEvent","type":"event"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"assetHashMap","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"fromAssetHash","type":"address"},{"internalType":"uint64","name":"toChainId","type":"uint64"},{"internalType":"bytes","name":"toAssetHash","type":"bytes"}],"name":"bindAssetHash","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint64","name":"toChainId","type":"uint64"},{"internalType":"bytes","name":"targetProxyHash","type":"bytes"}],"name":"bindProxyHash","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"fromAssetHash","type":"address"}],"name":"getBalanceFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"fromAssetHash","type":"address"},{"internalType":"uint64","name":"toChainId","type":"uint64"},{"internalType":"bytes","name":"toAddress","type":"bytes"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"managerProxyContract","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint64","name":"","type":"uint64"}],"name":"proxyHashMap","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"ethCCMProxyAddr","type":"address"}],"name":"setManagerProxy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes","name":"argsBs","type":"bytes"},{"internalType":"bytes","name":"fromContractAddr","type":"bytes"},{"internalType":"uint64","name":"fromChainId","type":"uint64"}],"name":"unlock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]

608060405260006100176001600160e01b0361006616565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006a565b3390565b612bcc806100796000396000f3fe6080604052600436106100c25760003560e01c806384a6d0551161007f5780639e5767aa116100595780639e5767aa146105c9578063af9980f0146105fc578063d798f8811461062f578063f2fde38b14610644576100c2565b806384a6d055146104bf5780638da5cb5b146105835780638f32d59b146105b4576100c2565b806306af4b9f146100c75780633348f63b1461021c578063379b98f6146102eb5780634f7d9808146103ac57806359c589a114610463578063715018a6146104a8575b600080fd5b3480156100d357600080fd5b50610208600480360360608110156100ea57600080fd5b810190602081018135600160201b81111561010457600080fd5b82018360208201111561011657600080fd5b803590602001918460018302840111600160201b8311171561013757600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561018957600080fd5b82018360208201111561019b57600080fd5b803590602001918460018302840111600160201b831117156101bc57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160401b031691506106779050565b604080519115158252519081900360200190f35b34801561022857600080fd5b506102086004803603606081101561023f57600080fd5b6001600160a01b03823516916001600160401b0360208201351691810190606081016040820135600160201b81111561027757600080fd5b82018360208201111561028957600080fd5b803590602001918460018302840111600160201b831117156102aa57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061096a945050505050565b3480156102f757600080fd5b506102086004803603604081101561030e57600080fd5b6001600160401b038235169190810190604081016020820135600160201b81111561033857600080fd5b82018360208201111561034a57600080fd5b803590602001918460018302840111600160201b8311171561036b57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610ad5945050505050565b3480156103b857600080fd5b506103ee600480360360408110156103cf57600080fd5b5080356001600160a01b031690602001356001600160401b0316610c04565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610428578181015183820152602001610410565b50505050905090810190601f1680156104555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561046f57600080fd5b506104966004803603602081101561048657600080fd5b50356001600160a01b0316610ca8565b60408051918252519081900360200190f35b3480156104b457600080fd5b506104bd610d43565b005b610208600480360360808110156104d557600080fd5b6001600160a01b03823516916001600160401b0360208201351691810190606081016040820135600160201b81111561050d57600080fd5b82018360208201111561051f57600080fd5b803590602001918460018302840111600160201b8311171561054057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610dd4915050565b34801561058f57600080fd5b5061059861144b565b604080516001600160a01b039092168252519081900360200190f35b3480156105c057600080fd5b5061020861145b565b3480156105d557600080fd5b506103ee600480360360208110156105ec57600080fd5b50356001600160401b031661147f565b34801561060857600080fd5b506104bd6004803603602081101561061f57600080fd5b50356001600160a01b03166114e5565b34801561063b57600080fd5b50610598611586565b34801561065057600080fd5b506104bd6004803603602081101561066757600080fd5b50356001600160a01b0316611595565b600154604080516387939a7f60e01b815290516000926001600160a01b03169182916387939a7f91600480820192602092909190829003018186803b1580156106bf57600080fd5b505afa1580156106d3573d6000803e3d6000fd5b505050506040513d60208110156106e957600080fd5b50516001600160a01b03166106fc6115e8565b6001600160a01b0316146107415760405162461bcd60e51b815260040180806020018281038252602d815260200180612970602d913960400191505060405180910390fd5b610749612799565b610752866115ec565b90508451600014156107955760405162461bcd60e51b815260040180806020018281038252602b81526020018061299d602b913960400191505060405180910390fd5b6001600160401b03841660009081526002602052604090206107b79086611638565b6107f25760405162461bcd60e51b8152600401808060200182810382526022815260200180612b556022913960400191505060405180910390fd5b805151610846576040805162461bcd60e51b815260206004820152601b60248201527f746f4173736574486173682063616e6e6f7420626520656d7074790000000000604482015290519081900360640190fd5b600061085582600001516116ec565b9050816020015151600014156108b2576040805162461bcd60e51b815260206004820152601960248201527f746f416464726573732063616e6e6f7420626520656d70747900000000000000604482015290519081900360640190fd5b60006108c183602001516116ec565b90506108d282828560400151611736565b61090d5760405162461bcd60e51b815260040180806020018281038252603c815260200180612934603c913960400191505060405180910390fd5b60408084015181516001600160a01b038086168252841660208201528083019190915290517fd90288730b87c2b8e0c45bd82260fd22478aba30ae1c4d578b8daba9261604df9181900360600190a1506001979650505050505050565b600061097461145b565b6109b3576040805162461bcd60e51b815260206004820181905260248201526000805160206129ea833981519152604482015290519081900360640190fd5b6001600160a01b03841660009081526003602090815260408083206001600160401b0387168452825290912083516109ed928501906127ba565b507f1628c8374c1bdfeb2275fd9f4c90562fd3fae974783dc522c8234e36abcfc58e848484610a1b88610ca8565b60405180856001600160a01b03166001600160a01b03168152602001846001600160401b03166001600160401b0316815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610a8e578181015183820152602001610a76565b50505050905090810190601f168015610abb5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a15060019392505050565b6000610adf61145b565b610b1e576040805162461bcd60e51b815260206004820181905260248201526000805160206129ea833981519152604482015290519081900360640190fd5b6001600160401b03831660009081526002602090815260409091208351610b47928501906127ba565b507fdacd7d303272a3b58aec6620d6d1fb588f4996a5b46858ed437f1c34348f2d0f838360405180836001600160401b03166001600160401b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bc0578181015183820152602001610ba8565b50505050905090810190601f168015610bed5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a150600192915050565b60036020908152600092835260408084208252918352918190208054825160026001831615610100026000190190921691909104601f810185900485028201850190935282815292909190830182828015610ca05780601f10610c7557610100808354040283529160200191610ca0565b820191906000526020600020905b815481529060010190602001808311610c8357829003601f168201915b505050505081565b60006001600160a01b038216610cc057503031610d3e565b604080516370a0823160e01b8152306004820152905183916001600160a01b038316916370a0823191602480820192602092909190829003018186803b158015610d0957600080fd5b505afa158015610d1d573d6000803e3d6000fd5b505050506040513d6020811015610d3357600080fd5b50519150610d3e9050565b919050565b610d4b61145b565b610d8a576040805162461bcd60e51b815260206004820181905260248201526000805160206129ea833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600081610e21576040805162461bcd60e51b8152602060048201526016602482015275616d6f756e742063616e6e6f74206265207a65726f2160501b604482015290519081900360640190fd5b610e2b85836117d2565b610e665760405162461bcd60e51b815260040180806020018281038252603f815260200180612a39603f913960400191505060405180910390fd5b6001600160a01b03851660009081526003602090815260408083206001600160401b038816845282529182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015610f165780601f10610eeb57610100808354040283529160200191610f16565b820191906000526020600020905b815481529060010190602001808311610ef957829003601f168201915b50505050509050805160001415610f74576040805162461bcd60e51b815260206004820152601960248201527f656d70747920696c6c6567616c20746f41737365744861736800000000000000604482015290519081900360640190fd5b610f7c612799565b60405180606001604052808381526020018681526020018581525090506060610fa4826118f5565b90506000600160009054906101000a90046001600160a01b031690506000816001600160a01b03166387939a7f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ffb57600080fd5b505afa15801561100f573d6000803e3d6000fd5b505050506040513d602081101561102557600080fd5b50516001600160401b038a16600090815260026020818152604092839020805484516001821615610100026000190190911693909304601f8101839004830284018301909452838352939450849360609390918301828280156110c95780601f1061109e576101008083540402835291602001916110c9565b820191906000526020600020905b8154815290600101906020018083116110ac57829003601f168201915b50505050509050805160001415611127576040805162461bcd60e51b815260206004820152601960248201527f656d70747920696c6c6567616c20746f50726f78794861736800000000000000604482015290519081900360640190fd5b816001600160a01b031663bd5cf6258c83886040518463ffffffff1660e01b815260040180846001600160401b03166001600160401b03168152602001806020018060200180602001848103845286818151815260200191508051906020019080838360005b838110156111a557818101518382015260200161118d565b50505050905090810190601f1680156111d25780820380516001836020036101000a031916815260200191505b508481038352600681526020018065756e6c6f636b60d01b815250602001848103825285818151815260200191508051906020019080838360005b8381101561122557818101518382015260200161120d565b50505050905090810190601f1680156112525780820380516001836020036101000a031916815260200191505b509650505050505050602060405180830381600087803b15801561127557600080fd5b505af1158015611289573d6000803e3d6000fd5b505050506040513d602081101561129f57600080fd5b50516112dc5760405162461bcd60e51b815260040180806020018281038252602f815260200180612a0a602f913960400191505060405180910390fd5b7f8636abd6d0e464fe725a13346c7ac779b73561c705506044a2e6b2cdb1295ea58c6113066115e8565b8d8a8e8e60405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001856001600160401b03166001600160401b031681526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611399578181015183820152602001611381565b50505050905090810190601f1680156113c65780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156113f95781810151838201526020016113e1565b50505050905090810190601f1680156114265780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390a15060019b9a5050505050505050505050565b6000546001600160a01b03165b90565b600080546001600160a01b03166114706115e8565b6001600160a01b031614905090565b600260208181526000928352604092839020805484516001821615610100026000190190911693909304601f8101839004830284018301909452838352919290830182828015610ca05780601f10610c7557610100808354040283529160200191610ca0565b6114ed61145b565b61152c576040805162461bcd60e51b815260206004820181905260248201526000805160206129ea833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b03838116919091179182905560408051929091168252517f43b1a8ec337adb61e8311ed025d99c80db65c02fe5c5027c1b6a93b40970cec4916020908290030190a150565b6001546001600160a01b031681565b61159d61145b565b6115dc576040805162461bcd60e51b815260206004820181905260248201526000805160206129ea833981519152604482015290519081900360640190fd5b6115e581611a22565b50565b3390565b6115f4612799565b6115fc612799565b60006116088482611ac2565b90835290506116178482611ac2565b6020840191909152905061162b8482611b9a565b5060408301525092915050565b6000806001905083546002600180831615610100020382160484518082146001811461166757600094506116e0565b82156116e05760208310600181146116c557600189600052602060002060208a018581015b6002848284100114156116bc5781518354146116ab5760009950600093505b60018301925060208201915061168c565b505050506116de565b610100808604029450602088015185146116de57600095505b505b50929695505050505050565b6000815160141461172e5760405162461bcd60e51b81526004018080602001828103825260238152602001806128b86023913960400191505060405180910390fd5b506014015190565b60006001600160a01b038416611782576040516001600160a01b0384169083156108fc029084906000818181858888f1935050505015801561177c573d6000803e3d6000fd5b506117c8565b61178d848484611c97565b6117c85760405162461bcd60e51b81526004018080602001828103825260428152602001806128766042913960600191505060405180910390fd5b5060019392505050565b60006001600160a01b038316611861573461181e5760405162461bcd60e51b8152600401808060200182810382526021815260200180612b776021913960400191505060405180910390fd5b81341461185c5760405162461bcd60e51b8152600401808060200182810382526029815260200180612a786029913960400191505060405180910390fd5b6118ec565b341561189e5760405162461bcd60e51b81526004018080602001828103825260228152602001806129c86022913960400191505060405180910390fd5b6118b1836118aa6115e8565b3085611cbf565b6118ec5760405162461bcd60e51b81526004018080602001828103825260338152602001806128db6033913960400191505060405180910390fd5b50600192915050565b6060806119058360000151611ce9565b6119128460200151611ce9565b61191f8560400151611daf565b6040516020018084805190602001908083835b602083106119515780518252601f199092019160209182019101611932565b51815160209384036101000a600019018019909216911617905286519190930192860191508083835b602083106119995780518252601f19909201916020918201910161197a565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106119e15780518252601f1990920191602091820191016119c2565b6001836020036101000a0380198251168184511680821785525050505050509050019350505050604051602081830303815290604052905080915050919050565b6001600160a01b038116611a675760405162461bcd60e51b815260040180806020018281038252602681526020018061290e6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080611ad18585611e4c565b865190955090915081850111801590611aeb575080840184105b611b265760405162461bcd60e51b8152600401808060200182810382526024815260200180612b316024913960400191505060405180910390fd5b606081158015611b4157604051915060208201604052611b8b565b6040519150601f8316801560200281840101848101888315602002848c0101015b81831015611b7a578051835260209283019201611b62565b5050848452601f01601f1916604052505b509250830190505b9250929050565b60008083518360200111158015611bb357508260200183105b611bee5760405162461bcd60e51b81526004018080602001828103825260238152602001806128536023913960400191505060405180910390fd5b600060405160206000600182038760208a0101515b83831015611c235780821a83860153600183019250600182039150611c03565b50505081016040525190506001600160ff1b03811115611c8a576040805162461bcd60e51b815260206004820152601760248201527f56616c75652065786365656473207468652072616e6765000000000000000000604482015290519081900360640190fd5b9460209390930193505050565b600083611cb46001600160a01b038216858563ffffffff61206516565b506001949350505050565b600084611cdd6001600160a01b03821686868663ffffffff6120bc16565b50600195945050505050565b8051606090611cf78161211c565b836040516020018083805190602001908083835b60208310611d2a5780518252601f199092019160209182019101611d0b565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b60208310611d725780518252601f199092019160209182019101611d53565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052915050919050565b60606001600160ff1b03821115611e0d576040805162461bcd60e51b815260206004820152601b60248201527f56616c756520657863656564732075696e743235352072616e67650000000000604482015290519081900360640190fd5b60405160208082526000601f5b82821015611e3c5785811a826020860101536001919091019060001901611e1a565b5050506040818101905292915050565b6000806000611e5b8585612262565b94509050600060fd60f81b6001600160f81b031983161415611ef957611e8186866122e0565b955061ffff16905060fd8110801590611e9c575061ffff8111155b611eed576040805162461bcd60e51b815260206004820152601f60248201527f4e65787455696e7431362c2076616c7565206f7574736964652072616e676500604482015290519081900360640190fd5b9250839150611b939050565b607f60f91b6001600160f81b031983161415611f8957611f198686612369565b955063ffffffff16905061ffff81118015611f38575063ffffffff8111155b611eed576040805162461bcd60e51b815260206004820181905260248201527f4e65787456617255696e742c2076616c7565206f7574736964652072616e6765604482015290519081900360640190fd5b6001600160f81b0319808316141561200a57611fa5868661240f565b95506001600160401b0316905063ffffffff8111611eed576040805162461bcd60e51b815260206004820181905260248201527f4e65787456617255696e742c2076616c7565206f7574736964652072616e6765604482015290519081900360640190fd5b5060f881901c60fd8110611eed576040805162461bcd60e51b815260206004820181905260248201527f4e65787456617255696e742c2076616c7565206f7574736964652072616e6765604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526120b79084906124b5565b505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526121169085906124b5565b50505050565b606060fd826001600160401b031610156121405761213982612664565b9050610d3e565b61ffff826001600160401b03161161221e5761215f60fd60f81b612680565b61216883612694565b6040516020018083805190602001908083835b6020831061219a5780518252601f19909201916020918201910161217b565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106121e25780518252601f1990920191602091820191016121c3565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529050610d3e565b63ffffffff826001600160401b0316116122485761223f607f60f91b612680565b612168836126d7565b6122596001600160f81b0319612680565b6121688361271a565b6000808351836001011115801561227b57508260010183105b6122cc576040805162461bcd60e51b815260206004820181905260248201527f4e657874427974652c204f66667365742065786365656473206d6178696d756d604482015290519081900360640190fd5b505081810160200151600182019250929050565b600080835183600201111580156122f957508260020183105b6123345760405162461bcd60e51b8152600401808060200182810382526022815260200180612aa16022913960400191505060405180910390fd5b6000604051846020870101518060011a82538060001a6001830153506002818101604052601d19909101519694019450505050565b6000808351836004011115801561238257508260040183105b6123bd5760405162461bcd60e51b8152600401808060200182810382526022815260200180612b0f6022913960400191505060405180910390fd5b600060405160046000600182038760208a0101515b838310156123f25780821a838601536001830192506001820391506123d2565b505050808201604052602003900351956004949094019450505050565b6000808351836008011115801561242857508260080183105b6124635760405162461bcd60e51b8152600401808060200182810382526022815260200180612aed6022913960400191505060405180910390fd5b600060405160086000600182038760208a0101515b838310156124985780821a83860153600183019250600182039150612478565b505050808201604052602003900351956008949094019450505050565b6124be8261275d565b61250f576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061254d5780518252601f19909201916020918201910161252e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146125af576040519150601f19603f3d011682016040523d82523d6000602084013e6125b4565b606091505b50915091508161260b576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156121165780806020019051602081101561262757600080fd5b50516121165760405162461bcd60e51b815260040180806020018281038252602a815260200180612ac3602a913960400191505060405180910390fd5b604080516001815260f89290921b602083015260218201905290565b606061268e8260f81c612664565b92915050565b6040516002808252606091906000601f5b828210156126c75785811a8260208601015360019190910190600019016126a5565b5050506022810160405292915050565b6040516004808252606091906000601f5b8282101561270a5785811a8260208601015360019190910190600019016126e8565b5050506024810160405292915050565b6040516008808252606091906000601f5b8282101561274d5785811a82602086010153600191909101906000190161272b565b5050506028810160405292915050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906127915750808214155b949350505050565b60405180606001604052806060815260200160608152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106127fb57805160ff1916838001178555612828565b82800160010185558215612828579182015b8281111561282857825182559160200191906001019061280d565b50612834929150612838565b5090565b61145891905b80821115612834576000815560010161283e56fe4e65787455696e743235352c206f66667365742065786365656473206d6178696d756d7472616e736665722065726332302061737365742066726f6d206c6f636b5f70726f787920636f6e747261637420746f20746f41646472657373206661696c6564216279746573206c656e67746820646f6573206e6f74206d6174636820616464726573737472616e7366657220657263323020617373657420746f206c6f636b5f70726f787920636f6e7472616374206661696c6564214f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573737472616e736665722061737365742066726f6d206c6f636b5f70726f787920636f6e747261637420746f20746f41646472657373206661696c6564216d736753656e646572206973206e6f742045746843726f7373436861696e4d616e61676572436f6e747261637466726f6d2070726f787920636f6e747261637420616464726573732063616e6e6f7420626520656d70747974686572652073686f756c64206265206e6f206574686572207472616e73666572214f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245746843726f7373436861696e4d616e616765722063726f7373436861696e206578656375746564206572726f72217472616e736665722061737365742066726f6d2066726f6d4164647265737320746f206c6f636b5f70726f787920636f6e747261637420206661696c6564217472616e73666572726564206574686572206973206e6f7420657175616c20746f20616d6f756e74214e65787455696e7431362c206f66667365742065786365656473206d6178696d756d5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644e65787455696e7436342c206f66667365742065786365656473206d6178696d756d4e65787455696e7433322c206f66667365742065786365656473206d6178696d756d4e65787456617242797465732c206f66667365742065786365656473206d6178696d756d46726f6d2050726f787920636f6e74726163742061646472657373206572726f72217472616e736665727265642065746865722063616e6e6f74206265207a65726f21a265627a7a72315820c7a3f08b11aaa0a2a9ce6d908d14549c5939b182a8c6b475e84db0bfb55ad57d64736f6c63430005110032

Deployed Bytecode

0x6080604052600436106100c25760003560e01c806384a6d0551161007f5780639e5767aa116100595780639e5767aa146105c9578063af9980f0146105fc578063d798f8811461062f578063f2fde38b14610644576100c2565b806384a6d055146104bf5780638da5cb5b146105835780638f32d59b146105b4576100c2565b806306af4b9f146100c75780633348f63b1461021c578063379b98f6146102eb5780634f7d9808146103ac57806359c589a114610463578063715018a6146104a8575b600080fd5b3480156100d357600080fd5b50610208600480360360608110156100ea57600080fd5b810190602081018135600160201b81111561010457600080fd5b82018360208201111561011657600080fd5b803590602001918460018302840111600160201b8311171561013757600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561018957600080fd5b82018360208201111561019b57600080fd5b803590602001918460018302840111600160201b831117156101bc57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160401b031691506106779050565b604080519115158252519081900360200190f35b34801561022857600080fd5b506102086004803603606081101561023f57600080fd5b6001600160a01b03823516916001600160401b0360208201351691810190606081016040820135600160201b81111561027757600080fd5b82018360208201111561028957600080fd5b803590602001918460018302840111600160201b831117156102aa57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061096a945050505050565b3480156102f757600080fd5b506102086004803603604081101561030e57600080fd5b6001600160401b038235169190810190604081016020820135600160201b81111561033857600080fd5b82018360208201111561034a57600080fd5b803590602001918460018302840111600160201b8311171561036b57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610ad5945050505050565b3480156103b857600080fd5b506103ee600480360360408110156103cf57600080fd5b5080356001600160a01b031690602001356001600160401b0316610c04565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610428578181015183820152602001610410565b50505050905090810190601f1680156104555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561046f57600080fd5b506104966004803603602081101561048657600080fd5b50356001600160a01b0316610ca8565b60408051918252519081900360200190f35b3480156104b457600080fd5b506104bd610d43565b005b610208600480360360808110156104d557600080fd5b6001600160a01b03823516916001600160401b0360208201351691810190606081016040820135600160201b81111561050d57600080fd5b82018360208201111561051f57600080fd5b803590602001918460018302840111600160201b8311171561054057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610dd4915050565b34801561058f57600080fd5b5061059861144b565b604080516001600160a01b039092168252519081900360200190f35b3480156105c057600080fd5b5061020861145b565b3480156105d557600080fd5b506103ee600480360360208110156105ec57600080fd5b50356001600160401b031661147f565b34801561060857600080fd5b506104bd6004803603602081101561061f57600080fd5b50356001600160a01b03166114e5565b34801561063b57600080fd5b50610598611586565b34801561065057600080fd5b506104bd6004803603602081101561066757600080fd5b50356001600160a01b0316611595565b600154604080516387939a7f60e01b815290516000926001600160a01b03169182916387939a7f91600480820192602092909190829003018186803b1580156106bf57600080fd5b505afa1580156106d3573d6000803e3d6000fd5b505050506040513d60208110156106e957600080fd5b50516001600160a01b03166106fc6115e8565b6001600160a01b0316146107415760405162461bcd60e51b815260040180806020018281038252602d815260200180612970602d913960400191505060405180910390fd5b610749612799565b610752866115ec565b90508451600014156107955760405162461bcd60e51b815260040180806020018281038252602b81526020018061299d602b913960400191505060405180910390fd5b6001600160401b03841660009081526002602052604090206107b79086611638565b6107f25760405162461bcd60e51b8152600401808060200182810382526022815260200180612b556022913960400191505060405180910390fd5b805151610846576040805162461bcd60e51b815260206004820152601b60248201527f746f4173736574486173682063616e6e6f7420626520656d7074790000000000604482015290519081900360640190fd5b600061085582600001516116ec565b9050816020015151600014156108b2576040805162461bcd60e51b815260206004820152601960248201527f746f416464726573732063616e6e6f7420626520656d70747900000000000000604482015290519081900360640190fd5b60006108c183602001516116ec565b90506108d282828560400151611736565b61090d5760405162461bcd60e51b815260040180806020018281038252603c815260200180612934603c913960400191505060405180910390fd5b60408084015181516001600160a01b038086168252841660208201528083019190915290517fd90288730b87c2b8e0c45bd82260fd22478aba30ae1c4d578b8daba9261604df9181900360600190a1506001979650505050505050565b600061097461145b565b6109b3576040805162461bcd60e51b815260206004820181905260248201526000805160206129ea833981519152604482015290519081900360640190fd5b6001600160a01b03841660009081526003602090815260408083206001600160401b0387168452825290912083516109ed928501906127ba565b507f1628c8374c1bdfeb2275fd9f4c90562fd3fae974783dc522c8234e36abcfc58e848484610a1b88610ca8565b60405180856001600160a01b03166001600160a01b03168152602001846001600160401b03166001600160401b0316815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610a8e578181015183820152602001610a76565b50505050905090810190601f168015610abb5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a15060019392505050565b6000610adf61145b565b610b1e576040805162461bcd60e51b815260206004820181905260248201526000805160206129ea833981519152604482015290519081900360640190fd5b6001600160401b03831660009081526002602090815260409091208351610b47928501906127ba565b507fdacd7d303272a3b58aec6620d6d1fb588f4996a5b46858ed437f1c34348f2d0f838360405180836001600160401b03166001600160401b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bc0578181015183820152602001610ba8565b50505050905090810190601f168015610bed5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a150600192915050565b60036020908152600092835260408084208252918352918190208054825160026001831615610100026000190190921691909104601f810185900485028201850190935282815292909190830182828015610ca05780601f10610c7557610100808354040283529160200191610ca0565b820191906000526020600020905b815481529060010190602001808311610c8357829003601f168201915b505050505081565b60006001600160a01b038216610cc057503031610d3e565b604080516370a0823160e01b8152306004820152905183916001600160a01b038316916370a0823191602480820192602092909190829003018186803b158015610d0957600080fd5b505afa158015610d1d573d6000803e3d6000fd5b505050506040513d6020811015610d3357600080fd5b50519150610d3e9050565b919050565b610d4b61145b565b610d8a576040805162461bcd60e51b815260206004820181905260248201526000805160206129ea833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600081610e21576040805162461bcd60e51b8152602060048201526016602482015275616d6f756e742063616e6e6f74206265207a65726f2160501b604482015290519081900360640190fd5b610e2b85836117d2565b610e665760405162461bcd60e51b815260040180806020018281038252603f815260200180612a39603f913960400191505060405180910390fd5b6001600160a01b03851660009081526003602090815260408083206001600160401b038816845282529182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015610f165780601f10610eeb57610100808354040283529160200191610f16565b820191906000526020600020905b815481529060010190602001808311610ef957829003601f168201915b50505050509050805160001415610f74576040805162461bcd60e51b815260206004820152601960248201527f656d70747920696c6c6567616c20746f41737365744861736800000000000000604482015290519081900360640190fd5b610f7c612799565b60405180606001604052808381526020018681526020018581525090506060610fa4826118f5565b90506000600160009054906101000a90046001600160a01b031690506000816001600160a01b03166387939a7f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ffb57600080fd5b505afa15801561100f573d6000803e3d6000fd5b505050506040513d602081101561102557600080fd5b50516001600160401b038a16600090815260026020818152604092839020805484516001821615610100026000190190911693909304601f8101839004830284018301909452838352939450849360609390918301828280156110c95780601f1061109e576101008083540402835291602001916110c9565b820191906000526020600020905b8154815290600101906020018083116110ac57829003601f168201915b50505050509050805160001415611127576040805162461bcd60e51b815260206004820152601960248201527f656d70747920696c6c6567616c20746f50726f78794861736800000000000000604482015290519081900360640190fd5b816001600160a01b031663bd5cf6258c83886040518463ffffffff1660e01b815260040180846001600160401b03166001600160401b03168152602001806020018060200180602001848103845286818151815260200191508051906020019080838360005b838110156111a557818101518382015260200161118d565b50505050905090810190601f1680156111d25780820380516001836020036101000a031916815260200191505b508481038352600681526020018065756e6c6f636b60d01b815250602001848103825285818151815260200191508051906020019080838360005b8381101561122557818101518382015260200161120d565b50505050905090810190601f1680156112525780820380516001836020036101000a031916815260200191505b509650505050505050602060405180830381600087803b15801561127557600080fd5b505af1158015611289573d6000803e3d6000fd5b505050506040513d602081101561129f57600080fd5b50516112dc5760405162461bcd60e51b815260040180806020018281038252602f815260200180612a0a602f913960400191505060405180910390fd5b7f8636abd6d0e464fe725a13346c7ac779b73561c705506044a2e6b2cdb1295ea58c6113066115e8565b8d8a8e8e60405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001856001600160401b03166001600160401b031681526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611399578181015183820152602001611381565b50505050905090810190601f1680156113c65780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156113f95781810151838201526020016113e1565b50505050905090810190601f1680156114265780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390a15060019b9a5050505050505050505050565b6000546001600160a01b03165b90565b600080546001600160a01b03166114706115e8565b6001600160a01b031614905090565b600260208181526000928352604092839020805484516001821615610100026000190190911693909304601f8101839004830284018301909452838352919290830182828015610ca05780601f10610c7557610100808354040283529160200191610ca0565b6114ed61145b565b61152c576040805162461bcd60e51b815260206004820181905260248201526000805160206129ea833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b03838116919091179182905560408051929091168252517f43b1a8ec337adb61e8311ed025d99c80db65c02fe5c5027c1b6a93b40970cec4916020908290030190a150565b6001546001600160a01b031681565b61159d61145b565b6115dc576040805162461bcd60e51b815260206004820181905260248201526000805160206129ea833981519152604482015290519081900360640190fd5b6115e581611a22565b50565b3390565b6115f4612799565b6115fc612799565b60006116088482611ac2565b90835290506116178482611ac2565b6020840191909152905061162b8482611b9a565b5060408301525092915050565b6000806001905083546002600180831615610100020382160484518082146001811461166757600094506116e0565b82156116e05760208310600181146116c557600189600052602060002060208a018581015b6002848284100114156116bc5781518354146116ab5760009950600093505b60018301925060208201915061168c565b505050506116de565b610100808604029450602088015185146116de57600095505b505b50929695505050505050565b6000815160141461172e5760405162461bcd60e51b81526004018080602001828103825260238152602001806128b86023913960400191505060405180910390fd5b506014015190565b60006001600160a01b038416611782576040516001600160a01b0384169083156108fc029084906000818181858888f1935050505015801561177c573d6000803e3d6000fd5b506117c8565b61178d848484611c97565b6117c85760405162461bcd60e51b81526004018080602001828103825260428152602001806128766042913960600191505060405180910390fd5b5060019392505050565b60006001600160a01b038316611861573461181e5760405162461bcd60e51b8152600401808060200182810382526021815260200180612b776021913960400191505060405180910390fd5b81341461185c5760405162461bcd60e51b8152600401808060200182810382526029815260200180612a786029913960400191505060405180910390fd5b6118ec565b341561189e5760405162461bcd60e51b81526004018080602001828103825260228152602001806129c86022913960400191505060405180910390fd5b6118b1836118aa6115e8565b3085611cbf565b6118ec5760405162461bcd60e51b81526004018080602001828103825260338152602001806128db6033913960400191505060405180910390fd5b50600192915050565b6060806119058360000151611ce9565b6119128460200151611ce9565b61191f8560400151611daf565b6040516020018084805190602001908083835b602083106119515780518252601f199092019160209182019101611932565b51815160209384036101000a600019018019909216911617905286519190930192860191508083835b602083106119995780518252601f19909201916020918201910161197a565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106119e15780518252601f1990920191602091820191016119c2565b6001836020036101000a0380198251168184511680821785525050505050509050019350505050604051602081830303815290604052905080915050919050565b6001600160a01b038116611a675760405162461bcd60e51b815260040180806020018281038252602681526020018061290e6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080611ad18585611e4c565b865190955090915081850111801590611aeb575080840184105b611b265760405162461bcd60e51b8152600401808060200182810382526024815260200180612b316024913960400191505060405180910390fd5b606081158015611b4157604051915060208201604052611b8b565b6040519150601f8316801560200281840101848101888315602002848c0101015b81831015611b7a578051835260209283019201611b62565b5050848452601f01601f1916604052505b509250830190505b9250929050565b60008083518360200111158015611bb357508260200183105b611bee5760405162461bcd60e51b81526004018080602001828103825260238152602001806128536023913960400191505060405180910390fd5b600060405160206000600182038760208a0101515b83831015611c235780821a83860153600183019250600182039150611c03565b50505081016040525190506001600160ff1b03811115611c8a576040805162461bcd60e51b815260206004820152601760248201527f56616c75652065786365656473207468652072616e6765000000000000000000604482015290519081900360640190fd5b9460209390930193505050565b600083611cb46001600160a01b038216858563ffffffff61206516565b506001949350505050565b600084611cdd6001600160a01b03821686868663ffffffff6120bc16565b50600195945050505050565b8051606090611cf78161211c565b836040516020018083805190602001908083835b60208310611d2a5780518252601f199092019160209182019101611d0b565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b60208310611d725780518252601f199092019160209182019101611d53565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052915050919050565b60606001600160ff1b03821115611e0d576040805162461bcd60e51b815260206004820152601b60248201527f56616c756520657863656564732075696e743235352072616e67650000000000604482015290519081900360640190fd5b60405160208082526000601f5b82821015611e3c5785811a826020860101536001919091019060001901611e1a565b5050506040818101905292915050565b6000806000611e5b8585612262565b94509050600060fd60f81b6001600160f81b031983161415611ef957611e8186866122e0565b955061ffff16905060fd8110801590611e9c575061ffff8111155b611eed576040805162461bcd60e51b815260206004820152601f60248201527f4e65787455696e7431362c2076616c7565206f7574736964652072616e676500604482015290519081900360640190fd5b9250839150611b939050565b607f60f91b6001600160f81b031983161415611f8957611f198686612369565b955063ffffffff16905061ffff81118015611f38575063ffffffff8111155b611eed576040805162461bcd60e51b815260206004820181905260248201527f4e65787456617255696e742c2076616c7565206f7574736964652072616e6765604482015290519081900360640190fd5b6001600160f81b0319808316141561200a57611fa5868661240f565b95506001600160401b0316905063ffffffff8111611eed576040805162461bcd60e51b815260206004820181905260248201527f4e65787456617255696e742c2076616c7565206f7574736964652072616e6765604482015290519081900360640190fd5b5060f881901c60fd8110611eed576040805162461bcd60e51b815260206004820181905260248201527f4e65787456617255696e742c2076616c7565206f7574736964652072616e6765604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526120b79084906124b5565b505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526121169085906124b5565b50505050565b606060fd826001600160401b031610156121405761213982612664565b9050610d3e565b61ffff826001600160401b03161161221e5761215f60fd60f81b612680565b61216883612694565b6040516020018083805190602001908083835b6020831061219a5780518252601f19909201916020918201910161217b565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106121e25780518252601f1990920191602091820191016121c3565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529050610d3e565b63ffffffff826001600160401b0316116122485761223f607f60f91b612680565b612168836126d7565b6122596001600160f81b0319612680565b6121688361271a565b6000808351836001011115801561227b57508260010183105b6122cc576040805162461bcd60e51b815260206004820181905260248201527f4e657874427974652c204f66667365742065786365656473206d6178696d756d604482015290519081900360640190fd5b505081810160200151600182019250929050565b600080835183600201111580156122f957508260020183105b6123345760405162461bcd60e51b8152600401808060200182810382526022815260200180612aa16022913960400191505060405180910390fd5b6000604051846020870101518060011a82538060001a6001830153506002818101604052601d19909101519694019450505050565b6000808351836004011115801561238257508260040183105b6123bd5760405162461bcd60e51b8152600401808060200182810382526022815260200180612b0f6022913960400191505060405180910390fd5b600060405160046000600182038760208a0101515b838310156123f25780821a838601536001830192506001820391506123d2565b505050808201604052602003900351956004949094019450505050565b6000808351836008011115801561242857508260080183105b6124635760405162461bcd60e51b8152600401808060200182810382526022815260200180612aed6022913960400191505060405180910390fd5b600060405160086000600182038760208a0101515b838310156124985780821a83860153600183019250600182039150612478565b505050808201604052602003900351956008949094019450505050565b6124be8261275d565b61250f576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061254d5780518252601f19909201916020918201910161252e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146125af576040519150601f19603f3d011682016040523d82523d6000602084013e6125b4565b606091505b50915091508161260b576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156121165780806020019051602081101561262757600080fd5b50516121165760405162461bcd60e51b815260040180806020018281038252602a815260200180612ac3602a913960400191505060405180910390fd5b604080516001815260f89290921b602083015260218201905290565b606061268e8260f81c612664565b92915050565b6040516002808252606091906000601f5b828210156126c75785811a8260208601015360019190910190600019016126a5565b5050506022810160405292915050565b6040516004808252606091906000601f5b8282101561270a5785811a8260208601015360019190910190600019016126e8565b5050506024810160405292915050565b6040516008808252606091906000601f5b8282101561274d5785811a82602086010153600191909101906000190161272b565b5050506028810160405292915050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906127915750808214155b949350505050565b60405180606001604052806060815260200160608152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106127fb57805160ff1916838001178555612828565b82800160010185558215612828579182015b8281111561282857825182559160200191906001019061280d565b50612834929150612838565b5090565b61145891905b80821115612834576000815560010161283e56fe4e65787455696e743235352c206f66667365742065786365656473206d6178696d756d7472616e736665722065726332302061737365742066726f6d206c6f636b5f70726f787920636f6e747261637420746f20746f41646472657373206661696c6564216279746573206c656e67746820646f6573206e6f74206d6174636820616464726573737472616e7366657220657263323020617373657420746f206c6f636b5f70726f787920636f6e7472616374206661696c6564214f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573737472616e736665722061737365742066726f6d206c6f636b5f70726f787920636f6e747261637420746f20746f41646472657373206661696c6564216d736753656e646572206973206e6f742045746843726f7373436861696e4d616e61676572436f6e747261637466726f6d2070726f787920636f6e747261637420616464726573732063616e6e6f7420626520656d70747974686572652073686f756c64206265206e6f206574686572207472616e73666572214f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245746843726f7373436861696e4d616e616765722063726f7373436861696e206578656375746564206572726f72217472616e736665722061737365742066726f6d2066726f6d4164647265737320746f206c6f636b5f70726f787920636f6e747261637420206661696c6564217472616e73666572726564206574686572206973206e6f7420657175616c20746f20616d6f756e74214e65787455696e7431362c206f66667365742065786365656473206d6178696d756d5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644e65787455696e7436342c206f66667365742065786365656473206d6178696d756d4e65787455696e7433322c206f66667365742065786365656473206d6178696d756d4e65787456617242797465732c206f66667365742065786365656473206d6178696d756d46726f6d2050726f787920636f6e74726163742061646472657373206572726f72217472616e736665727265642065746865722063616e6e6f74206265207a65726f21a265627a7a72315820c7a3f08b11aaa0a2a9ce6d908d14549c5939b182a8c6b475e84db0bfb55ad57d64736f6c63430005110032

Deployed Bytecode Sourcemap

49860:9479:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;54612:976;;8:9:-1;5:2;;;30:1;27;20:12;5:2;54612:976:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;54612:976:0;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;54612:976:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;54612:976:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;54612:976:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;54612:976:0;;;;;;;;-1:-1:-1;54612:976:0;;-1:-1:-1;;;;;5:28;;2:2;;;46:1;43;36:12;2:2;54612:976:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;54612:976:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;54612:976:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;54612:976:0;;-1:-1:-1;;;54612:976:0;;-1:-1:-1;;;;;54612:976:0;;-1:-1:-1;54612:976:0;;-1:-1:-1;54612:976:0:i;:::-;;;;;;;;;;;;;;;;;;51454:314;;8:9:-1;5:2;;;30:1;27;20:12;5:2;51454:314:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;51454:314:0;;;;-1:-1:-1;;;;;51454:314:0;;;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;51454:314:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;51454:314:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;51454:314:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;51454:314:0;;-1:-1:-1;51454:314:0;;-1:-1:-1;;;;;51454:314:0:i;51199:243::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;51199:243:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;51199:243:0;;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;51199:243:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;51199:243:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;51199:243:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;51199:243:0;;-1:-1:-1;51199:243:0;;-1:-1:-1;;;;;51199:243:0:i;50162:64::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;50162:64:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;50162:64:0;;-1:-1:-1;;;;;50162:64:0;;;;;-1:-1:-1;;;;;50162:64:0;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;50162:64:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;55600:510;;8:9:-1;5:2;;;30:1;27;20:12;5:2;55600:510:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;55600:510:0;-1:-1:-1;;;;;55600:510:0;;:::i;:::-;;;;;;;;;;;;;;;;49068:140;;8:9:-1;5:2;;;30:1;27;20:12;5:2;49068:140:0;;;:::i;:::-;;52564:1352;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;52564:1352:0;;;;-1:-1:-1;;;;;52564:1352:0;;;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;52564:1352:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;52564:1352:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;52564:1352:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;52564:1352:0;;-1:-1:-1;;52564:1352:0;;;-1:-1:-1;52564:1352:0;;-1:-1:-1;;52564:1352:0:i;48257:79::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;48257:79:0;;;:::i;:::-;;;;-1:-1:-1;;;;;48257:79:0;;;;;;;;;;;;;;48623:94;;8:9:-1;5:2;;;30:1;27;20:12;5:2;48623:94:0;;;:::i;50111:44::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;50111:44:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;50111:44:0;-1:-1:-1;;;;;50111:44:0;;:::i;51005:182::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;51005:182:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;51005:182:0;-1:-1:-1;;;;;51005:182:0;;:::i;50069:35::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;50069:35:0;;;:::i;49363:110::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;49363:110:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;49363:110:0;-1:-1:-1;;;;;49363:110:0;;:::i;54612:976::-;50835:20;;50891:32;;;-1:-1:-1;;;50891:32:0;;;;54736:4;;-1:-1:-1;;;;;50835:20:0;;;;50891:30;;:32;;;;;;;;;;;;;;;50835:20;50891:32;;;5:2:-1;;;;30:1;27;20:12;5:2;50891:32:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;50891:32:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;50891:32:0;-1:-1:-1;;;;;50875:48:0;:12;:10;:12::i;:::-;-1:-1:-1;;;;;50875:48:0;;50867:106;;;;-1:-1:-1;;;50867:106:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;54753:18;;:::i;:::-;54774:26;54793:6;54774:18;:26::i;:::-;54753:47;;54821:16;:23;54848:1;54821:28;;54813:84;;;;-1:-1:-1;;;54813:84:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;54935:25:0;;;;;;:12;:25;;;;;54916:63;;54962:16;54916:18;:63::i;:::-;54908:110;;;;-1:-1:-1;;;54908:110:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;55047:16;;:23;55039:68;;;;;-1:-1:-1;;;55039:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;55118:19;55140:38;55161:4;:16;;;55140:20;:38::i;:::-;55118:60;;55199:4;:14;;;:21;55224:1;55199:26;;55191:64;;;;;-1:-1:-1;;;55191:64:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;55266:17;55286:36;55307:4;:14;;;55286:20;:36::i;:::-;55266:56;;55361:58;55383:11;55396:9;55407:4;:11;;;55361:21;:58::i;:::-;55353:131;;;;-1:-1:-1;;;55353:131:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;55546:11;;;;;55510:48;;-1:-1:-1;;;;;55510:48:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;55576:4:0;;54612:976;-1:-1:-1;;;;;;;54612:976:0:o;51454:314::-;51570:4;48469:9;:7;:9::i;:::-;48461:54;;;;;-1:-1:-1;;;48461:54:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48461:54:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;51587:27:0;;;;;;:12;:27;;;;;;;;-1:-1:-1;;;;;51587:38:0;;;;;;;;;:52;;;;;;;;:::i;:::-;;51655:83;51670:13;51685:9;51696:11;51709:28;51723:13;51709;:28::i;:::-;51655:83;;;;-1:-1:-1;;;;;51655:83:0;-1:-1:-1;;;;;51655:83:0;;;;;;-1:-1:-1;;;;;51655:83:0;-1:-1:-1;;;;;51655:83:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;51655:83:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;51756:4:0;51454:314;;;;;:::o;51199:243::-;51296:4;48469:9;:7;:9::i;:::-;48461:54;;;;;-1:-1:-1;;;48461:54:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48461:54:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;51313:23:0;;;;;;:12;:23;;;;;;;;:41;;;;;;;;:::i;:::-;;51370:42;51385:9;51396:15;51370:42;;;;-1:-1:-1;;;;;51370:42:0;-1:-1:-1;;;;;51370:42:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;51370:42:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;51430:4:0;51199:243;;;;:::o;50162:64::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;50162:64:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;55600:510::-;55667:7;-1:-1:-1;;;;;55691:27:0;;55687:416;;-1:-1:-1;55917:4:0;55944:16;55937:23;;55687:416;56056:35;;;-1:-1:-1;;;56056:35:0;;56085:4;56056:35;;;;;;56020:13;;-1:-1:-1;;;;;56056:20:0;;;;;:35;;;;;;;;;;;;;;;:20;:35;;;5:2:-1;;;;30:1;27;20:12;5:2;56056:35:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;56056:35:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;56056:35:0;;-1:-1:-1;56049:42:0;;-1:-1:-1;56049:42:0;55687:416;55600:510;;;:::o;49068:140::-;48469:9;:7;:9::i;:::-;48461:54;;;;;-1:-1:-1;;;48461:54:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48461:54:0;;;;;;;;;;;;;;;49167:1;49151:6;;49130:40;;-1:-1:-1;;;;;49151:6:0;;;;49130:40;;49167:1;;49130:40;49198:1;49181:19;;-1:-1:-1;;;;;;49181:19:0;;;49068:140::o;52564:1352::-;52683:4;52708:11;52700:46;;;;;-1:-1:-1;;;52700:46:0;;;;;;;;;;;;-1:-1:-1;;;52700:46:0;;;;;;;;;;;;;;;52785:42;52805:13;52820:6;52785:19;:42::i;:::-;52777:118;;;;-1:-1:-1;;;52777:118:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;52943:27:0;;;;;;:12;:27;;;;;;;;-1:-1:-1;;;;;52943:38:0;;;;;;;;;;52916:65;;;;;;-1:-1:-1;;52916:65:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:24;;:65;;;52943:38;52916:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53000:11;:18;53022:1;53000:23;;52992:61;;;;;-1:-1:-1;;;52992:61:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;53066:20;;:::i;:::-;53089:122;;;;;;;;53124:11;53089:122;;;;53161:9;53089:122;;;;53193:6;53089:122;;;53066:145;;53222:19;53244:24;53261:6;53244:16;:24::i;:::-;53222:46;;53289:32;53351:20;;;;;;;;;-1:-1:-1;;;;;53351:20:0;53289:83;;53383:16;53402:5;-1:-1:-1;;;;;53402:29:0;;:31;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;53402:31:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;53402:31:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;53402:31:0;-1:-1:-1;;;;;53552:23:0;;53444:26;53552:23;;;:12;53402:31;53552:23;;;;;;;;53525:50;;;;;;;;;;-1:-1:-1;;53525:50:0;;;;;;;;;;;;;;;;;;;;;;;;;;53402:31;;-1:-1:-1;53402:31:0;;53525:24;;53552:23;;53525:50;;53552:23;53525:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53594:11;:18;53616:1;53594:23;;53586:61;;;;;-1:-1:-1;;;53586:61:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;53666:4;-1:-1:-1;;;;;53666:15:0;;53682:9;53693:11;53716:6;53666:57;;;;;;;;;;;;;-1:-1:-1;;;;;53666:57:0;-1:-1:-1;;;;;53666:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;53666:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;53666:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;53666:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;53666:57:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;53666:57:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;53666:57:0;53658:117;;;;-1:-1:-1;;;53658:117:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53793:81;53803:13;53818:12;:10;:12::i;:::-;53832:9;53843:11;53856:9;53867:6;53793:81;;;;-1:-1:-1;;;;;53793:81:0;-1:-1:-1;;;;;53793:81:0;;;;;;-1:-1:-1;;;;;53793:81:0;-1:-1:-1;;;;;53793:81:0;;;;;;-1:-1:-1;;;;;53793:81:0;-1:-1:-1;;;;;53793:81:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;53793:81:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;53793:81:0;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;53793:81:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;53902:4:0;;52564:1352;-1:-1:-1;;;;;;;;;;;52564:1352:0:o;48257:79::-;48295:7;48322:6;-1:-1:-1;;;;;48322:6:0;48257:79;;:::o;48623:94::-;48663:4;48703:6;;-1:-1:-1;;;;;48703:6:0;48687:12;:10;:12::i;:::-;-1:-1:-1;;;;;48687:22:0;;48680:29;;48623:94;:::o;50111:44::-;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;50111:44:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;51005:182;48469:9;:7;:9::i;:::-;48461:54;;;;;-1:-1:-1;;;48461:54:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48461:54:0;;;;;;;;;;;;;;;51083:20;:38;;-1:-1:-1;;;;;;51083:38:0;-1:-1:-1;;;;;51083:38:0;;;;;;;;;;;51137:42;;;51158:20;;;;51137:42;;;;;;;;;;;;;51005:182;:::o;50069:35::-;;;-1:-1:-1;;;;;50069:35:0;;:::o;49363:110::-;48469:9;:7;:9::i;:::-;48461:54;;;;;-1:-1:-1;;;48461:54:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48461:54:0;;;;;;;;;;;;;;;49437:28;49456:8;49437:18;:28::i;:::-;49363:110;:::o;47019:98::-;47099:10;47019:98;:::o;58937:399::-;59010:13;;:::i;:::-;59036:18;;:::i;:::-;59065:11;59117:41;59145:7;59065:11;59117:27;:41::i;:::-;59091:67;;;;-1:-1:-1;59193:41:0;59221:7;59091:67;59193:27;:41::i;:::-;59170:14;;;59169:65;;;;;-1:-1:-1;59266:40:0;59293:7;59169:65;59266:26;:40::i;:::-;-1:-1:-1;59246:11:0;;;59245:61;-1:-1:-1;59246:11:0;58937:399;-1:-1:-1;;58937:399:0:o;13602:3160::-;13697:4;13714:12;13729:4;13714:19;;13835:14;13829:21;14425:1;14420;14414;14407:5;14403:13;14396:21;14389:5;14385:33;14381:41;14374:5;14370:53;14366:61;14462:10;14456:17;14572:7;14563;14560:20;14599:1;14594:2024;;;;16701:1;16690:12;;14553:2164;;14594:2024;14938:7;14931:15;14921:2;;14990;14981:7;14978:15;15020:1;15015:355;;;;15684:1;15806:14;15801:3;15794:27;15872:4;15867:3;15857:20;15931:4;15919:10;15915:21;15981:7;15977:2;15973:16;16142:419;16174:1;16169:2;16163:3;16159:2;16156:11;16152:20;16149:27;16142:419;;;16362:2;16356:9;16351:2;16345:9;16342:24;16332:2;;16461:1;16450:12;;16502:1;16496:7;;16332:2;16222:1;16218:2;16214:10;16208:16;;16268:4;16264:2;16260:13;16254:19;;16142:419;;;15400:1184;;;;14971:1613;;15015:355;15149:5;15141;15134;15130:17;15126:29;15117:38;;15225:4;15213:10;15209:21;15203:28;15196:5;15193:39;15183:2;;15319:1;15308:12;;15183:2;14971:1613;14921:2;-1:-1:-1;16747:7:0;;13602:3160;-1:-1:-1;;;;;;13602:3160:0:o;11170:447::-;11235:12;11273:3;:10;11287:2;11273:16;11265:64;;;;-1:-1:-1;;;11265:64:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;11591:4:0;11582:14;11576:21;;11349:259::o;57028:757::-;57133:4;-1:-1:-1;;;;;57154:66:0;;57150:606;;57442:44;;-1:-1:-1;;;;;57442:36:0;;;:44;;;;;57479:6;;57442:44;;;;57479:6;57442:36;:44;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;57442:44:0;57150:606;;;57615:58;57642:11;57655:9;57666:6;57615:26;:58::i;:::-;57607:137;;;;-1:-1:-1;;;57607:137:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;57773:4:0;57028:757;;;;;:::o;56116:906::-;56202:4;-1:-1:-1;;;;;56223:27:0;;56219:774;;56426:9;56418:60;;;;-1:-1:-1;;;56418:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;56514:6;56501:9;:19;56493:73;;;;-1:-1:-1;;;56493:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;56219:774;;;56684:9;:14;56676:61;;;;-1:-1:-1;;;56676:61:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;56849:76;56874:13;56889:12;:10;:12::i;:::-;56911:4;56918:6;56849:24;:76::i;:::-;56841:140;;;;-1:-1:-1;;;56841:140:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;57010:4:0;56116:906;;;;:::o;58570:359::-;58639:12;58664:17;58730:44;58757:4;:16;;;58730:26;:44::i;:::-;58789:42;58816:4;:14;;;58789:26;:42::i;:::-;58846:38;58872:4;:11;;;58846:25;:38::i;:::-;58699:200;;;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;58699:200:0;;;;;;;;;;-1:-1:-1;58699:200:0;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;58699:200:0;;;;;;;;;;-1:-1:-1;58699:200:0;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;58699:200:0;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;58699:200:0;;;58692:207;;58917:4;58910:11;;;58570:359;;;:::o;49579:229::-;-1:-1:-1;;;;;49653:22:0;;49645:73;;;;-1:-1:-1;;;49645:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49755:6;;;49734:38;;-1:-1:-1;;;;;49734:38:0;;;;49755:6;;;49734:38;;;49783:6;:17;;-1:-1:-1;;;;;;49783:17:0;-1:-1:-1;;;;;49783:17:0;;;;;;;;;;49579:229::o;40980:2656::-;41059:12;41073:7;41093:8;41128:25;41140:4;41146:6;41128:11;:25::i;:::-;41188:11;;41112:41;;-1:-1:-1;41112:41:0;;-1:-1:-1;41172:12:0;;;:27;;;;:52;;;41221:3;41212:6;:12;41203:6;:21;41172:52;41164:101;;;;-1:-1:-1;;;41164:101:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;41276:22;41339:11;;41364:1991;;;;43499:4;43493:11;43480:24;;43552:4;43541:9;43537:20;43531:4;43524:34;41332:2241;;41364:1991;41549:4;41543:11;41530:24;;42214:2;42209:3;42205:12;42602:9;42595:17;42589:4;42585:28;42573:9;42562;42558:25;42554:60;42651:3;42647:2;42643:12;42902:6;42888:9;42881:17;42875:4;42871:28;42859:9;42853:4;42849:20;42845:55;42841:68;42675:432;42936:3;42932:2;42929:11;42675:432;;;43078:9;;43067:21;;42978:4;42970:13;;;;43011;42675:432;;;-1:-1:-1;;43127:22:0;;;43335:2;43318:11;-1:-1:-1;;43314:25:0;43308:4;43301:39;-1:-1:-1;41332:2241:0;-1:-1:-1;43604:9:0;-1:-1:-1;43615:12:0;;;-1:-1:-1;40980:2656:0;;;;;;:::o;39635:975::-;39714:7;39723;39766:4;:11;39751:6;39760:2;39751:11;:26;;:50;;;;;39790:6;39799:2;39790:11;39781:6;:20;39751:50;39743:98;;;;-1:-1:-1;;;39743:98:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;39852:9;39918:4;39912:11;39952:4;40007;40056;40047:7;40043:18;40120:6;40113:4;40107;40103:15;40099:28;40093:35;39970:386;40155:7;40147:6;40144:19;39970:386;;;40333:6;40325;40320:20;40311:6;40301:8;40297:21;40289:52;40205:4;40197:6;40193:17;40183:27;;40250:4;40242:6;40238:17;40228:27;;39970:386;;;-1:-1:-1;;;40383:22:0;;40377:4;40370:36;40425:15;;-1:-1:-1;;;;;;40469:71:0;;;40461:107;;;;;-1:-1:-1;;;40461:107:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;40587:1;40599:2;40590:11;;;;;-1:-1:-1;;;39635:975:0:o;58212:346::-;58322:4;58367:11;58485:42;-1:-1:-1;;;;;58485:23:0;;58509:9;58520:6;58485:42;:23;:42;:::i;:::-;-1:-1:-1;58546:4:0;;58212:346;-1:-1:-1;;;;58212:346:0:o;57803:403::-;57934:4;57979:13;58116:59;-1:-1:-1;;;;;58116:27:0;;58144:11;58157:9;58168:6;58116:59;:27;:59;:::i;:::-;-1:-1:-1;58194:4:0;;57803:403;-1:-1:-1;;;;;57803:403:0:o;32200:185::-;32308:11;;32265:12;;32355:15;32308:11;32355:12;:15::i;:::-;32372:4;32338:39;;;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;32338:39:0;;;;;;;;;;-1:-1:-1;32338:39:0;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;32338:39:0;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;32338:39:0;;;32331:46;;;32200:185;;;:::o;31285:747::-;31341:12;-1:-1:-1;;;;;31374:1:0;:71;;31366:111;;;;;-1:-1:-1;;;31366:111:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;31555:4;31549:11;31589:4;31607:21;;;31679:4;31715;31642:307;31746:7;31738:6;31735:19;31642:307;;;31931:1;31923:6;31918:15;31909:6;31902:4;31896;31892:15;31888:28;31880:54;31796:4;31784:17;;;;;-1:-1:-1;;31829:17:0;31642:307;;;-1:-1:-1;;;31986:4:0;31976:15;;;31963:29;;31976:15;31285:747;-1:-1:-1;;31285:747:0:o;44912:1186::-;44990:4;44996:7;45016:6;45047:22;45056:4;45062:6;45047:8;:22::i;:::-;45033:36;-1:-1:-1;45033:36:0;-1:-1:-1;45082:10:0;-1:-1:-1;;;;;;;;;45107:9:0;;;45103:988;;;45200:24;45211:4;45217:6;45200:10;:24::i;:::-;45182:42;-1:-1:-1;45182:42:0;;;-1:-1:-1;45256:4:0;45247:13;;;;;:32;;;45273:6;45264:5;:15;;45247:32;45239:76;;;;;-1:-1:-1;;;45239:76:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;45338:5;-1:-1:-1;45345:6:0;;-1:-1:-1;45330:22:0;;-1:-1:-1;45330:22:0;45103:988;-1:-1:-1;;;;;;;;;45374:9:0;;;45370:721;;;45467:24;45478:4;45484:6;45467:10;:24::i;:::-;45449:42;-1:-1:-1;45449:42:0;;;-1:-1:-1;45522:6:0;45514:14;;:37;;;;;45541:10;45532:5;:19;;45514:37;45506:82;;;;;-1:-1:-1;;;45506:82:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;45370:721;-1:-1:-1;;;;;;45647:9:0;;;;45643:448;;;45740:24;45751:4;45757:6;45740:10;:24::i;:::-;45722:42;-1:-1:-1;;;;;;45722:42:0;;-1:-1:-1;45795:10:0;45787:18;;45779:63;;;;;-1:-1:-1;;;45779:63:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;45643:448;-1:-1:-1;45962:8:0;;;;46001:4;45993:12;;45985:57;;;;;-1:-1:-1;;;45985:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;23277:176;23386:58;;;-1:-1:-1;;;;;23386:58:0;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;23386:58:0;;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;23360:85:0;;23379:5;;23360:18;:85::i;:::-;23277:176;;;:::o;23461:204::-;23588:68;;;-1:-1:-1;;;;;23588:68:0;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;23588:68:0;;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;23562:95:0;;23581:5;;23562:18;:95::i;:::-;23461:204;;;;:::o;32393:453::-;32448:12;32481:4;32477:1;-1:-1:-1;;;;;32477:8:0;;32473:366;;;32502:20;32519:1;32502:10;:20::i;:::-;32495:27;;;;32473:366;32546:6;32541:1;-1:-1:-1;;;;;32541:11:0;;32537:302;;32587:15;-1:-1:-1;;;32587:9:0;:15::i;:::-;32604:22;32623:1;32604:11;:22::i;:::-;32570:57;;;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;32570:57:0;;;;;;;;;;-1:-1:-1;32570:57:0;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;32570:57:0;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;32570:57:0;;;32563:64;;;;32537:302;32651:10;32646:1;-1:-1:-1;;;;;32646:15:0;;32642:197;;32702:15;-1:-1:-1;;;32702:9:0;:15::i;:::-;32719:22;32738:1;32719:11;:22::i;32642:197::-;32790:15;-1:-1:-1;;;;;;32790:9:0;:15::i;:::-;32807:22;32826:1;32807:11;:22::i;34832:337::-;34908:4;34914:7;34956:4;:11;34942:6;34951:1;34942:10;:25;;:48;;;;;34980:6;34989:1;34980:10;34971:6;:19;34942:48;34934:93;;;;;-1:-1:-1;;;34934:93:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;35089:28:0;;;35103:4;35089:28;35083:35;35159:1;35150:10;;34832:337;;;;;:::o;36284:608::-;36362:6;36370:7;36412:4;:11;36398:6;36407:1;36398:10;:25;;:48;;;;;36436:6;36445:1;36436:10;36427:6;:19;36398:48;36390:95;;;;-1:-1:-1;;;36390:95:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;36506:8;36571:4;36565:11;36631:6;36624:4;36618;36614:15;36610:28;36604:35;36682:6;36676:4;36671:18;36661:8;36653:37;36741:6;36738:1;36733:15;36726:4;36716:8;36712:19;36704:45;-1:-1:-1;36790:4:0;36776:19;;;36770:4;36763:33;-1:-1:-1;;36821:19:0;;;36815:26;;36873:10;;;-1:-1:-1;;;;36284:608:0:o;37192:875::-;37270:6;37278:7;37320:4;:11;37306:6;37315:1;37306:10;:25;;:48;;;;;37344:6;37353:1;37344:10;37335:6;:19;37306:48;37298:95;;;;-1:-1:-1;;;37298:95:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;37404:8;37469:4;37463:11;37503:4;37558;37607;37598:7;37594:18;37671:6;37664:4;37658;37654:15;37650:28;37644:35;37521:386;37706:7;37698:6;37695:19;37521:386;;;37884:6;37876;37871:20;37862:6;37852:8;37848:21;37840:52;37756:4;37748:6;37744:17;37734:27;;37801:4;37793:6;37789:17;37779:27;;37521:386;;;-1:-1:-1;;;37934:22:0;;;37928:4;37921:36;38000:4;37996:18;37982:33;;37976:40;;38057:1;38048:10;;;;;-1:-1:-1;;;;37192:875:0:o;38366:::-;38444:6;38452:7;38494:4;:11;38480:6;38489:1;38480:10;:25;;:48;;;;;38518:6;38527:1;38518:10;38509:6;:19;38480:48;38472:95;;;;-1:-1:-1;;;38472:95:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;38578:8;38643:4;38637:11;38677:4;38732;38781;38772:7;38768:18;38845:6;38838:4;38832;38828:15;38824:28;38818:35;38695:386;38880:7;38872:6;38869:19;38695:386;;;39058:6;39050;39045:20;39036:6;39026:8;39022:21;39014:52;38930:4;38922:6;38918:17;38908:27;;38975:4;38967:6;38963:17;38953:27;;38695:386;;;-1:-1:-1;;;39108:22:0;;;39102:4;39095:36;39174:4;39170:18;39156:33;;39150:40;;39231:1;39222:10;;;;;-1:-1:-1;;;;38366:875:0:o;25271:1119::-;25875:32;25900:5;25875:16;:32::i;:::-;25867:76;;;;;-1:-1:-1;;;25867:76:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;26017:12;26031:23;26066:5;-1:-1:-1;;;;;26058:19:0;26078:4;26058:25;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;26058:25:0;;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;;26016:67:0;;;;26102:7;26094:52;;;;;-1:-1:-1;;;26094:52:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26163:17;;:21;26159:224;;26305:10;26294:30;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;26294:30:0;26286:85;;;;-1:-1:-1;;;26286:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;28394:364;28536:4;28530:11;;28568:1;28555:15;;28612:3;28608:11;;;;28601:4;28591:15;;28584:36;28712:4;28702:15;;28689:29;;28530:11;28394:364::o;28124:110::-;28174:12;28206:20;28223:1;28217:8;;28206:10;:20::i;:::-;28199:27;28124:110;-1:-1:-1;;28124:110:0:o;28920:623::-;29066:4;29060:11;29100:4;29118:21;;;28974:12;;29060:11;29190:4;29226;29153:307;29257:7;29249:6;29246:19;29153:307;;;29442:1;29434:6;29429:15;29420:6;29413:4;29407;29403:15;29399:28;29391:54;29307:4;29295:17;;;;;-1:-1:-1;;29340:17:0;29153:307;;;-1:-1:-1;;;29497:4:0;29487:15;;29481:4;29474:29;29487:15;28920:623;-1:-1:-1;;28920:623:0:o;29709:620::-;29852:4;29846:11;29886:4;29904:21;;;29762:12;;29846:11;29976:4;30012;29939:307;30043:7;30035:6;30032:19;29939:307;;;30228:1;30220:6;30215:15;30206:6;30199:4;30193;30189:15;30185:28;30177:54;30093:4;30081:17;;;;;-1:-1:-1;;30126:17:0;29939:307;;;-1:-1:-1;;;30283:4:0;30273:15;;30267:4;30260:29;30273:15;29709:620;-1:-1:-1;;29709:620:0:o;30491:622::-;30636:4;30630:11;30670:4;30688:21;;;30544:12;;30630:11;30760:4;30796;30723:307;30827:7;30819:6;30816:19;30723:307;;;31012:1;31004:6;30999:15;30990:6;30983:4;30977;30973:15;30969:28;30961:54;30877:4;30865:17;;;;;-1:-1:-1;;30910:17:0;30723:307;;;-1:-1:-1;;;31067:4:0;31057:15;;31051:4;31044:29;31057:15;30491:622;-1:-1:-1;;30491:622:0:o;21901:810::-;21961:4;22620:20;;22463:66;22660:15;;;;;:42;;;22691:11;22679:8;:23;;22660:42;22652:51;21901:810;-1:-1:-1;;;;21901:810:0:o;49860:9479::-;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;49860:9479:0;;;-1:-1:-1;49860:9479:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;

Swarm Source

bzzr://c7a3f08b11aaa0a2a9ce6d908d14549c5939b182a8c6b475e84db0bfb55ad57d

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  ]

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.