ETH Price: $3,244.60 (+1.14%)
Gas: 12 Gwei

Token

 

Overview

Max Total Supply

0

Holders

0

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
DefaultDepositContract

Compiler Version
v0.7.0+commit.9e61f92b

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion, Apache-2.0 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-10-29
*/

// SPDX-License-Identifier: Apache-2.0
// Copyright 2017 Loopring Technology Limited.
pragma solidity ^0.7.0;


/// @title Ownable
/// @author Brecht Devos - <[email protected]>
/// @dev The Ownable contract has an owner address, and provides basic
///      authorization control functions, this simplifies the implementation of
///      "user permissions".
contract Ownable
{
    address public owner;

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

    /// @dev The Ownable constructor sets the original `owner` of the contract
    ///      to the sender.
    constructor()
    {
        owner = msg.sender;
    }

    /// @dev Throws if called by any account other than the owner.
    modifier onlyOwner()
    {
        require(msg.sender == owner, "UNAUTHORIZED");
        _;
    }

    /// @dev Allows the current owner to transfer control of the contract to a
    ///      new owner.
    /// @param newOwner The address to transfer ownership to.
    function transferOwnership(
        address newOwner
        )
        public
        virtual
        onlyOwner
    {
        require(newOwner != address(0), "ZERO_ADDRESS");
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }

    function renounceOwnership()
        public
        onlyOwner
    {
        emit OwnershipTransferred(owner, address(0));
        owner = address(0);
    }
}

// Copyright 2017 Loopring Technology Limited.



/// @title Utility Functions for uint
/// @author Daniel Wang - <[email protected]>
library MathUint
{
    using MathUint for uint;

    function mul(
        uint a,
        uint b
        )
        internal
        pure
        returns (uint c)
    {
        c = a * b;
        require(a == 0 || c / a == b, "MUL_OVERFLOW");
    }

    function sub(
        uint a,
        uint b
        )
        internal
        pure
        returns (uint)
    {
        require(b <= a, "SUB_UNDERFLOW");
        return a - b;
    }

    function add(
        uint a,
        uint b
        )
        internal
        pure
        returns (uint c)
    {
        c = a + b;
        require(c >= a, "ADD_OVERFLOW");
    }

    function add64(
        uint64 a,
        uint64 b
        )
        internal
        pure
        returns (uint64 c)
    {
        c = a + b;
        require(c >= a, "ADD_OVERFLOW");
    }
}

// Copyright 2017 Loopring Technology Limited.



/// @title ERC20 Token Interface
/// @dev see https://github.com/ethereum/EIPs/issues/20
/// @author Daniel Wang - <[email protected]>
abstract contract ERC20
{
    function totalSupply()
        public
        virtual
        view
        returns (uint);

    function balanceOf(
        address who
        )
        public
        virtual
        view
        returns (uint);

    function allowance(
        address owner,
        address spender
        )
        public
        virtual
        view
        returns (uint);

    function transfer(
        address to,
        uint value
        )
        public
        virtual
        returns (bool);

    function transferFrom(
        address from,
        address to,
        uint    value
        )
        public
        virtual
        returns (bool);

    function approve(
        address spender,
        uint    value
        )
        public
        virtual
        returns (bool);
}

// Copyright 2017 Loopring Technology Limited.



// Copyright 2017 Loopring Technology Limited.



/// @title Utility Functions for addresses
/// @author Daniel Wang - <[email protected]>
/// @author Brecht Devos - <[email protected]>
library AddressUtil
{
    using AddressUtil for *;

    function isContract(
        address addr
        )
        internal
        view
        returns (bool)
    {
        // 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;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(addr) }
        return (codehash != 0x0 &&
                codehash != 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470);
    }

    function toPayable(
        address addr
        )
        internal
        pure
        returns (address payable)
    {
        return payable(addr);
    }

    // Works like address.send but with a customizable gas limit
    // Make sure your code is safe for reentrancy when using this function!
    function sendETH(
        address to,
        uint    amount,
        uint    gasLimit
        )
        internal
        returns (bool success)
    {
        if (amount == 0) {
            return true;
        }
        address payable recipient = to.toPayable();
        /* solium-disable-next-line */
        (success, ) = recipient.call{value: amount, gas: gasLimit}("");
    }

    // Works like address.transfer but with a customizable gas limit
    // Make sure your code is safe for reentrancy when using this function!
    function sendETHAndVerify(
        address to,
        uint    amount,
        uint    gasLimit
        )
        internal
        returns (bool success)
    {
        success = to.sendETH(amount, gasLimit);
        require(success, "TRANSFER_FAILURE");
    }

    // Works like call but is slightly more efficient when data
    // needs to be copied from memory to do the call.
    function fastCall(
        address to,
        uint    gasLimit,
        uint    value,
        bytes   memory data
        )
        internal
        returns (bool success, bytes memory returnData)
    {
        if (to != address(0)) {
            assembly {
                // Do the call
                success := call(gasLimit, to, value, add(data, 32), mload(data), 0, 0)
                // Copy the return data
                let size := returndatasize()
                returnData := mload(0x40)
                mstore(returnData, size)
                returndatacopy(add(returnData, 32), 0, size)
                // Update free memory pointer
                mstore(0x40, add(returnData, add(32, size)))
            }
        }
    }

    // Like fastCall, but throws when the call is unsuccessful.
    function fastCallAndVerify(
        address to,
        uint    gasLimit,
        uint    value,
        bytes   memory data
        )
        internal
        returns (bytes memory returnData)
    {
        bool success;
        (success, returnData) = fastCall(to, gasLimit, value, data);
        if (!success) {
            assembly {
                revert(add(returnData, 32), mload(returnData))
            }
        }
    }
}


// Copyright 2017 Loopring Technology Limited.





/// @title Claimable
/// @author Brecht Devos - <[email protected]>
/// @dev Extension for the Ownable contract, where the ownership needs
///      to be claimed. This allows the new owner to accept the transfer.
contract Claimable is Ownable
{
    address public pendingOwner;

    /// @dev Modifier throws if called by any account other than the pendingOwner.
    modifier onlyPendingOwner() {
        require(msg.sender == pendingOwner, "UNAUTHORIZED");
        _;
    }

    /// @dev Allows the current owner to set the pendingOwner address.
    /// @param newOwner The address to transfer ownership to.
    function transferOwnership(
        address newOwner
        )
        public
        override
        onlyOwner
    {
        require(newOwner != address(0) && newOwner != owner, "INVALID_ADDRESS");
        pendingOwner = newOwner;
    }

    /// @dev Allows the pendingOwner address to finalize the transfer.
    function claimOwnership()
        public
        onlyPendingOwner
    {
        emit OwnershipTransferred(owner, pendingOwner);
        owner = pendingOwner;
        pendingOwner = address(0);
    }
}



// Copyright 2017 Loopring Technology Limited.



/// @title ERC20 safe transfer
/// @dev see https://github.com/sec-bit/badERC20Fix
/// @author Brecht Devos - <[email protected]>
library ERC20SafeTransfer
{
    function safeTransferAndVerify(
        address token,
        address to,
        uint    value
        )
        internal
    {
        safeTransferWithGasLimitAndVerify(
            token,
            to,
            value,
            gasleft()
        );
    }

    function safeTransfer(
        address token,
        address to,
        uint    value
        )
        internal
        returns (bool)
    {
        return safeTransferWithGasLimit(
            token,
            to,
            value,
            gasleft()
        );
    }

    function safeTransferWithGasLimitAndVerify(
        address token,
        address to,
        uint    value,
        uint    gasLimit
        )
        internal
    {
        require(
            safeTransferWithGasLimit(token, to, value, gasLimit),
            "TRANSFER_FAILURE"
        );
    }

    function safeTransferWithGasLimit(
        address token,
        address to,
        uint    value,
        uint    gasLimit
        )
        internal
        returns (bool)
    {
        // A transfer is successful when 'call' is successful and depending on the token:
        // - No value is returned: we assume a revert when the transfer failed (i.e. 'call' returns false)
        // - A single boolean is returned: this boolean needs to be true (non-zero)

        // bytes4(keccak256("transfer(address,uint256)")) = 0xa9059cbb
        bytes memory callData = abi.encodeWithSelector(
            bytes4(0xa9059cbb),
            to,
            value
        );
        (bool success, ) = token.call{gas: gasLimit}(callData);
        return checkReturnValue(success);
    }

    function safeTransferFromAndVerify(
        address token,
        address from,
        address to,
        uint    value
        )
        internal
    {
        safeTransferFromWithGasLimitAndVerify(
            token,
            from,
            to,
            value,
            gasleft()
        );
    }

    function safeTransferFrom(
        address token,
        address from,
        address to,
        uint    value
        )
        internal
        returns (bool)
    {
        return safeTransferFromWithGasLimit(
            token,
            from,
            to,
            value,
            gasleft()
        );
    }

    function safeTransferFromWithGasLimitAndVerify(
        address token,
        address from,
        address to,
        uint    value,
        uint    gasLimit
        )
        internal
    {
        bool result = safeTransferFromWithGasLimit(
            token,
            from,
            to,
            value,
            gasLimit
        );
        require(result, "TRANSFER_FAILURE");
    }

    function safeTransferFromWithGasLimit(
        address token,
        address from,
        address to,
        uint    value,
        uint    gasLimit
        )
        internal
        returns (bool)
    {
        // A transferFrom is successful when 'call' is successful and depending on the token:
        // - No value is returned: we assume a revert when the transfer failed (i.e. 'call' returns false)
        // - A single boolean is returned: this boolean needs to be true (non-zero)

        // bytes4(keccak256("transferFrom(address,address,uint256)")) = 0x23b872dd
        bytes memory callData = abi.encodeWithSelector(
            bytes4(0x23b872dd),
            from,
            to,
            value
        );
        (bool success, ) = token.call{gas: gasLimit}(callData);
        return checkReturnValue(success);
    }

    function checkReturnValue(
        bool success
        )
        internal
        pure
        returns (bool)
    {
        // A transfer/transferFrom is successful when 'call' is successful and depending on the token:
        // - No value is returned: we assume a revert when the transfer failed (i.e. 'call' returns false)
        // - A single boolean is returned: this boolean needs to be true (non-zero)
        if (success) {
            assembly {
                switch returndatasize()
                // Non-standard ERC20: nothing is returned so if 'call' was successful we assume the transfer succeeded
                case 0 {
                    success := 1
                }
                // Standard ERC20: a single boolean value is returned which needs to be true
                case 32 {
                    returndatacopy(0, 0, 32)
                    success := mload(0)
                }
                // None of the above: not successful
                default {
                    success := 0
                }
            }
        }
        return success;
    }
}


// Taken from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/SafeCast.sol




/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such 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.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        require(value < 2**96, "SafeCast: value doesn\'t fit in 96 bits");
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        require(value < 2**40, "SafeCast: value doesn\'t fit in 40 bits");
        return uint40(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        require(value < 2**255, "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

// Copyright 2017 Loopring Technology Limited.



/// @title IDepositContract.
/// @dev   Contract storing and transferring funds for an exchange.
///
///        ERC1155 tokens can be supported by registering pseudo token addresses calculated
///        as `address(keccak256(real_token_address, token_params))`. Then the custom
///        deposit contract can look up the real token address and paramsters with the
///        pseudo token address before doing the transfers.
/// @author Brecht Devos - <[email protected]>
interface IDepositContract
{
    /// @dev Returns if a token is suppoprted by this contract.
    function isTokenSupported(address token)
        external
        view
        returns (bool);

    /// @dev Transfers tokens from a user to the exchange. This function will
    ///      be called when a user deposits funds to the exchange.
    ///      In a simple implementation the funds are simply stored inside the
    ///      deposit contract directly. More advanced implementations may store the funds
    ///      in some DeFi application to earn interest, so this function could directly
    ///      call the necessary functions to store the funds there.
    ///
    ///      This function needs to throw when an error occurred!
    ///
    ///      This function can only be called by the exchange.
    ///
    /// @param from The address of the account that sends the tokens.
    /// @param token The address of the token to transfer (`0x0` for ETH).
    /// @param amount The amount of tokens to transfer.
    /// @param extraData Opaque data that can be used by the contract to handle the deposit
    /// @return amountReceived The amount to deposit to the user's account in the Merkle tree
    function deposit(
        address from,
        address token,
        uint96  amount,
        bytes   calldata extraData
        )
        external
        payable
        returns (uint96 amountReceived);

    /// @dev Transfers tokens from the exchange to a user. This function will
    ///      be called when a withdrawal is done for a user on the exchange.
    ///      In the simplest implementation the funds are simply stored inside the
    ///      deposit contract directly so this simply transfers the requested tokens back
    ///      to the user. More advanced implementations may store the funds
    ///      in some DeFi application to earn interest so the function would
    ///      need to get those tokens back from the DeFi application first before they
    ///      can be transferred to the user.
    ///
    ///      This function needs to throw when an error occurred!
    ///
    ///      This function can only be called by the exchange.
    ///
    /// @param from The address from which 'amount' tokens are transferred.
    /// @param to The address to which 'amount' tokens are transferred.
    /// @param token The address of the token to transfer (`0x0` for ETH).
    /// @param amount The amount of tokens transferred.
    /// @param extraData Opaque data that can be used by the contract to handle the withdrawal
    function withdraw(
        address from,
        address to,
        address token,
        uint    amount,
        bytes   calldata extraData
        )
        external
        payable;

    /// @dev Transfers tokens (ETH not supported) for a user using the allowance set
    ///      for the exchange. This way the approval can be used for all functionality (and
    ///      extended functionality) of the exchange.
    ///      Should NOT be used to deposit/withdraw user funds, `deposit`/`withdraw`
    ///      should be used for that as they will contain specialised logic for those operations.
    ///      This function can be called by the exchange to transfer onchain funds of users
    ///      necessary for Agent functionality.
    ///
    ///      This function needs to throw when an error occurred!
    ///
    ///      This function can only be called by the exchange.
    ///
    /// @param from The address of the account that sends the tokens.
    /// @param to The address to which 'amount' tokens are transferred.
    /// @param token The address of the token to transfer (ETH is and cannot be suppported).
    /// @param amount The amount of tokens transferred.
    function transfer(
        address from,
        address to,
        address token,
        uint    amount
        )
        external
        payable;

    /// @dev Checks if the given address is used for depositing ETH or not.
    ///      Is used while depositing to send the correct ETH amount to the deposit contract.
    ///
    ///      Note that 0x0 is always registered for deposting ETH when the exchange is created!
    ///      This function allows additional addresses to be used for depositing ETH, the deposit
    ///      contract can implement different behaviour based on the address value.
    ///
    /// @param addr The address to check
    /// @return True if the address is used for depositing ETH, else false.
    function isETH(address addr)
        external
        view
        returns (bool);
}


/// @title DefaultDepositContract
/// @dev   Default implementation of IDepositContract that just stores
///        all funds without doing anything with them.
///
///        Should be able to work with proxy contracts so the contract
///        can be updated easily (but with great caution and transparency!)
///        when necessary.
///
/// @author Brecht Devos - <[email protected]>
contract DefaultDepositContract is IDepositContract, Claimable
{
    using AddressUtil       for address;
    using ERC20SafeTransfer for address;
    using MathUint          for uint;
    using SafeCast          for uint;

    address public exchange;

    mapping (address => bool) needCheckBalance;

    modifier onlyExchange()
    {
        require(msg.sender == exchange, "UNAUTHORIZED");
        _;
    }

    modifier ifNotZero(uint amount)
    {
        if (amount == 0) return;
        else  _;
    }

    event CheckBalance(
        address indexed token,
        bool            checkBalance
    );

    function initialize(
        address _exchange
        )
        external
    {
        require(
            exchange == address(0) && _exchange != address(0),
            "INVALID_EXCHANGE"
        );
        owner = msg.sender;
        exchange = _exchange;
    }

    function setCheckBalance(
        address token,
        bool    checkBalance
        )
        external
        onlyOwner
    {
        require(needCheckBalance[token] != checkBalance, "INVALID_VALUE");

        needCheckBalance[token] = checkBalance;
        emit CheckBalance(token, checkBalance);
    }

    function isTokenSupported(address /*token*/)
        external
        override
        pure
        returns (bool)
    {
        return true;
    }

    function deposit(
        address from,
        address token,
        uint96  amount,
        bytes   calldata /*extraData*/
        )
        external
        override
        payable
        onlyExchange
        ifNotZero(amount)
        returns (uint96 amountReceived)
    {
        uint ethToReturn = 0;

        if (isETHInternal(token)) {
            require(msg.value >= amount, "INVALID_ETH_DEPOSIT");
            amountReceived = amount;
            ethToReturn = msg.value - amount;
        } else {
            bool checkBalance = needCheckBalance[token];
            uint balanceBefore = checkBalance ? ERC20(token).balanceOf(address(this)) : 0;

            token.safeTransferFromAndVerify(from, address(this), uint(amount));

            uint balanceAfter = checkBalance ? ERC20(token).balanceOf(address(this)) : amount;
            uint diff = balanceAfter.sub(balanceBefore);
            amountReceived = diff.toUint96();

            ethToReturn = msg.value;
        }

        if (ethToReturn > 0) {
            from.sendETHAndVerify(ethToReturn, gasleft());
        }
    }

    function withdraw(
        address /*from*/,
        address to,
        address token,
        uint    amount,
        bytes   calldata /*extraData*/
        )
        external
        override
        payable
        onlyExchange
        ifNotZero(amount)
    {
        if (isETHInternal(token)) {
            to.sendETHAndVerify(amount, gasleft());
        } else {
            if (!token.safeTransfer(to, amount)){
                uint amountPaid = ERC20(token).balanceOf(address(this));
                require(amountPaid < amount, "UNEXPECTED");
                token.safeTransferAndVerify(to, amountPaid);
            }
        }
    }

    function transfer(
        address from,
        address to,
        address token,
        uint    amount
        )
        external
        override
        payable
        onlyExchange
        ifNotZero(amount)
    {
        token.safeTransferFromAndVerify(from, to, amount);
    }

    function isETH(address addr)
        external
        override
        pure
        returns (bool)
    {
        return isETHInternal(addr);
    }

    // -- Internal --

    function isETHInternal(address addr)
        internal
        pure
        returns (bool)
    {
        return addr == address(0);
    }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bool","name":"checkBalance","type":"bool"}],"name":"CheckBalance","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"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint96","name":"amount","type":"uint96"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"deposit","outputs":[{"internalType":"uint96","name":"amountReceived","type":"uint96"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"exchange","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_exchange","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isETH","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isTokenSupported","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"checkBalance","type":"bool"}],"name":"setCheckBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"}]

608060405234801561001057600080fd5b50600080546001600160a01b03191633179055611801806100326000396000f3fe6080604052600436106100d25760003560e01c8063c4d66de81161007f578063f18d03cc11610059578063f18d03cc146102ec578063f2fde38b14610335578063f3d790b714610375578063f70a250814610441576100d2565b8063c4d66de814610282578063d2f7265a146102c2578063e30c3978146102d7576100d2565b8063715018a6116100b0578063715018a6146101db57806375151b63146101f05780638da5cb5b14610244576100d2565b80633823f247146100d75780634e71e0c81461017e578063634de7dd14610193575b600080fd5b61017c600480360360a08110156100ed57600080fd5b73ffffffffffffffffffffffffffffffffffffffff823581169260208101358216926040820135909216916060820135919081019060a08101608082013564010000000081111561013d57600080fd5b82018360208201111561014f57600080fd5b8035906020019184600183028401116401000000008311171561017157600080fd5b509092509050610481565b005b34801561018a57600080fd5b5061017c61069f565b34801561019f57600080fd5b5061017c600480360360408110156101b657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013515156107bb565b3480156101e757600080fd5b5061017c610967565b3480156101fc57600080fd5b506102306004803603602081101561021357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610a5c565b604080519115158252519081900360200190f35b34801561025057600080fd5b50610259610a62565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561028e57600080fd5b5061017c600480360360208110156102a557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610a7e565b3480156102ce57600080fd5b50610259610b79565b3480156102e357600080fd5b50610259610b95565b61017c6004803603608081101561030257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101358216916040820135169060600135610bb1565b34801561034157600080fd5b5061017c6004803603602081101561035857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c6b565b6104206004803603608081101561038b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff82358116926020810135909116916bffffffffffffffffffffffff60408301351691908101906080810160608201356401000000008111156103e157600080fd5b8201836020820111156103f357600080fd5b8035906020019184600183028401116401000000008311171561041557600080fd5b509092509050610de3565b604080516bffffffffffffffffffffffff9092168252519081900360200190f35b34801561044d57600080fd5b506102306004803603602081101561046457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661113b565b60025473ffffffffffffffffffffffffffffffffffffffff16331461050757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b828061051257610696565b61051b8561114c565b1561054957610543845a73ffffffffffffffffffffffffffffffffffffffff89169190611166565b50610696565b61056a73ffffffffffffffffffffffffffffffffffffffff861687866111fe565b6106965760008573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156105d757600080fd5b505afa1580156105eb573d6000803e3d6000fd5b505050506040513d602081101561060157600080fd5b5051905084811061067357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f554e455850454354454400000000000000000000000000000000000000000000604482015290519081900360640190fd5b61069473ffffffffffffffffffffffffffffffffffffffff87168883611214565b505b50505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461072557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6001546000805460405173ffffffffffffffffffffffffffffffffffffffff93841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461084157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526003602052604090205460ff16151581151514156108dc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f494e56414c49445f56414c554500000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660008181526003602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016851515908117909155825190815291517f5ca546e2df4ecf26ee1e85b99c7fc08237e0fc2bc8df80f9f3e0fa5a7116ed819281900390910190a25050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109ed57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b50600190565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff16158015610ab9575073ffffffffffffffffffffffffffffffffffffffff811615155b610b2457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f494e56414c49445f45584348414e474500000000000000000000000000000000604482015290519081900360640190fd5b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556002805490911673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff163314610c3757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b8080610c4257610c64565b610c6473ffffffffffffffffffffffffffffffffffffffff8416868685611225565b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610cf157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615801590610d31575060005473ffffffffffffffffffffffffffffffffffffffff828116911614155b610d9c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f494e56414c49445f414444524553530000000000000000000000000000000000604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60025460009073ffffffffffffffffffffffffffffffffffffffff163314610e6c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6bffffffffffffffffffffffff841680610e8557611131565b6000610e908761114c565b15610f2c57856bffffffffffffffffffffffff16341015610f1257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e56414c49445f4554485f4445504f53495400000000000000000000000000604482015290519081900360640190fd5b508491506bffffffffffffffffffffffff82163403611104565b73ffffffffffffffffffffffffffffffffffffffff871660009081526003602052604081205460ff169081610f62576000610ffb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8b16916370a08231916024808301926020929190829003018186803b158015610fce57600080fd5b505afa158015610fe2573d6000803e3d6000fd5b505050506040513d6020811015610ff857600080fd5b50515b905061102d73ffffffffffffffffffffffffffffffffffffffff8a168b306bffffffffffffffffffffffff8c16611225565b60008261104857886bffffffffffffffffffffffff166110e1565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8c16916370a08231916024808301926020929190829003018186803b1580156110b457600080fd5b505afa1580156110c8573d6000803e3d6000fd5b505050506040513d60208110156110de57600080fd5b50515b905060006110ef8284611238565b90506110fa816112af565b9650349450505050505b801561112f5761112d815a73ffffffffffffffffffffffffffffffffffffffff8b169190611166565b505b505b5095945050505050565b60006111468261114c565b92915050565b73ffffffffffffffffffffffffffffffffffffffff161590565b600061118973ffffffffffffffffffffffffffffffffffffffff8516848461131a565b9050806111f757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5452414e534645525f4641494c55524500000000000000000000000000000000604482015290519081900360640190fd5b9392505050565b600061120c8484845a6113b7565b949350505050565b6112208383835a61150c565b505050565b611232848484845a611583565b50505050565b6000828211156112a957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f5355425f554e444552464c4f5700000000000000000000000000000000000000604482015290519081900360640190fd5b50900390565b60006c010000000000000000000000008210611316576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117a66026913960400191505060405180910390fd5b5090565b600082611329575060016111f7565b600061134a8573ffffffffffffffffffffffffffffffffffffffff16611608565b60405190915073ffffffffffffffffffffffffffffffffffffffff821690849086906000818181858888f193505050503d80600081146113a6576040519150601f19603f3d011682016040523d82523d6000602084013e6113ab565b606091505b50909695505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8086166024830152604480830186905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251825160009485938a16928792869282918083835b6020831061148c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161144f565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038160008787f1925050503d80600081146114ef576040519150601f19603f3d011682016040523d82523d6000602084013e6114f4565b606091505b505090506115018161160b565b979650505050505050565b611518848484846113b7565b61123257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5452414e534645525f4641494c55524500000000000000000000000000000000604482015290519081900360640190fd5b60006115928686868686611647565b90508061160057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5452414e534645525f4641494c55524500000000000000000000000000000000604482015290519081900360640190fd5b505050505050565b90565b60008115611316573d801561162b57602081146116345760009250611640565b60019250611640565b60206000803e60005192505b5090919050565b6040805173ffffffffffffffffffffffffffffffffffffffff80871660248301528086166044830152606480830186905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001781529251825160009485938b16928792869282918083835b6020831061172457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016116e7565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038160008787f1925050503d8060008114611787576040519150601f19603f3d011682016040523d82523d6000602084013e61178c565b606091505b505090506117998161160b565b9897505050505050505056fe53616665436173743a2076616c756520646f65736e27742066697420696e2039362062697473a2646970667358221220979e966d3e3b93489b96051bd9dd18007a01182463cd93ae5ca1c1783041e36e64736f6c63430007000033

Deployed Bytecode

0x6080604052600436106100d25760003560e01c8063c4d66de81161007f578063f18d03cc11610059578063f18d03cc146102ec578063f2fde38b14610335578063f3d790b714610375578063f70a250814610441576100d2565b8063c4d66de814610282578063d2f7265a146102c2578063e30c3978146102d7576100d2565b8063715018a6116100b0578063715018a6146101db57806375151b63146101f05780638da5cb5b14610244576100d2565b80633823f247146100d75780634e71e0c81461017e578063634de7dd14610193575b600080fd5b61017c600480360360a08110156100ed57600080fd5b73ffffffffffffffffffffffffffffffffffffffff823581169260208101358216926040820135909216916060820135919081019060a08101608082013564010000000081111561013d57600080fd5b82018360208201111561014f57600080fd5b8035906020019184600183028401116401000000008311171561017157600080fd5b509092509050610481565b005b34801561018a57600080fd5b5061017c61069f565b34801561019f57600080fd5b5061017c600480360360408110156101b657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013515156107bb565b3480156101e757600080fd5b5061017c610967565b3480156101fc57600080fd5b506102306004803603602081101561021357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610a5c565b604080519115158252519081900360200190f35b34801561025057600080fd5b50610259610a62565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561028e57600080fd5b5061017c600480360360208110156102a557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610a7e565b3480156102ce57600080fd5b50610259610b79565b3480156102e357600080fd5b50610259610b95565b61017c6004803603608081101561030257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101358216916040820135169060600135610bb1565b34801561034157600080fd5b5061017c6004803603602081101561035857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c6b565b6104206004803603608081101561038b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff82358116926020810135909116916bffffffffffffffffffffffff60408301351691908101906080810160608201356401000000008111156103e157600080fd5b8201836020820111156103f357600080fd5b8035906020019184600183028401116401000000008311171561041557600080fd5b509092509050610de3565b604080516bffffffffffffffffffffffff9092168252519081900360200190f35b34801561044d57600080fd5b506102306004803603602081101561046457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661113b565b60025473ffffffffffffffffffffffffffffffffffffffff16331461050757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b828061051257610696565b61051b8561114c565b1561054957610543845a73ffffffffffffffffffffffffffffffffffffffff89169190611166565b50610696565b61056a73ffffffffffffffffffffffffffffffffffffffff861687866111fe565b6106965760008573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156105d757600080fd5b505afa1580156105eb573d6000803e3d6000fd5b505050506040513d602081101561060157600080fd5b5051905084811061067357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f554e455850454354454400000000000000000000000000000000000000000000604482015290519081900360640190fd5b61069473ffffffffffffffffffffffffffffffffffffffff87168883611214565b505b50505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461072557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6001546000805460405173ffffffffffffffffffffffffffffffffffffffff93841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461084157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526003602052604090205460ff16151581151514156108dc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f494e56414c49445f56414c554500000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660008181526003602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016851515908117909155825190815291517f5ca546e2df4ecf26ee1e85b99c7fc08237e0fc2bc8df80f9f3e0fa5a7116ed819281900390910190a25050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109ed57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b50600190565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff16158015610ab9575073ffffffffffffffffffffffffffffffffffffffff811615155b610b2457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f494e56414c49445f45584348414e474500000000000000000000000000000000604482015290519081900360640190fd5b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556002805490911673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff163314610c3757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b8080610c4257610c64565b610c6473ffffffffffffffffffffffffffffffffffffffff8416868685611225565b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610cf157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615801590610d31575060005473ffffffffffffffffffffffffffffffffffffffff828116911614155b610d9c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f494e56414c49445f414444524553530000000000000000000000000000000000604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60025460009073ffffffffffffffffffffffffffffffffffffffff163314610e6c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6bffffffffffffffffffffffff841680610e8557611131565b6000610e908761114c565b15610f2c57856bffffffffffffffffffffffff16341015610f1257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e56414c49445f4554485f4445504f53495400000000000000000000000000604482015290519081900360640190fd5b508491506bffffffffffffffffffffffff82163403611104565b73ffffffffffffffffffffffffffffffffffffffff871660009081526003602052604081205460ff169081610f62576000610ffb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8b16916370a08231916024808301926020929190829003018186803b158015610fce57600080fd5b505afa158015610fe2573d6000803e3d6000fd5b505050506040513d6020811015610ff857600080fd5b50515b905061102d73ffffffffffffffffffffffffffffffffffffffff8a168b306bffffffffffffffffffffffff8c16611225565b60008261104857886bffffffffffffffffffffffff166110e1565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8c16916370a08231916024808301926020929190829003018186803b1580156110b457600080fd5b505afa1580156110c8573d6000803e3d6000fd5b505050506040513d60208110156110de57600080fd5b50515b905060006110ef8284611238565b90506110fa816112af565b9650349450505050505b801561112f5761112d815a73ffffffffffffffffffffffffffffffffffffffff8b169190611166565b505b505b5095945050505050565b60006111468261114c565b92915050565b73ffffffffffffffffffffffffffffffffffffffff161590565b600061118973ffffffffffffffffffffffffffffffffffffffff8516848461131a565b9050806111f757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5452414e534645525f4641494c55524500000000000000000000000000000000604482015290519081900360640190fd5b9392505050565b600061120c8484845a6113b7565b949350505050565b6112208383835a61150c565b505050565b611232848484845a611583565b50505050565b6000828211156112a957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f5355425f554e444552464c4f5700000000000000000000000000000000000000604482015290519081900360640190fd5b50900390565b60006c010000000000000000000000008210611316576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117a66026913960400191505060405180910390fd5b5090565b600082611329575060016111f7565b600061134a8573ffffffffffffffffffffffffffffffffffffffff16611608565b60405190915073ffffffffffffffffffffffffffffffffffffffff821690849086906000818181858888f193505050503d80600081146113a6576040519150601f19603f3d011682016040523d82523d6000602084013e6113ab565b606091505b50909695505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8086166024830152604480830186905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251825160009485938a16928792869282918083835b6020831061148c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161144f565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038160008787f1925050503d80600081146114ef576040519150601f19603f3d011682016040523d82523d6000602084013e6114f4565b606091505b505090506115018161160b565b979650505050505050565b611518848484846113b7565b61123257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5452414e534645525f4641494c55524500000000000000000000000000000000604482015290519081900360640190fd5b60006115928686868686611647565b90508061160057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5452414e534645525f4641494c55524500000000000000000000000000000000604482015290519081900360640190fd5b505050505050565b90565b60008115611316573d801561162b57602081146116345760009250611640565b60019250611640565b60206000803e60005192505b5090919050565b6040805173ffffffffffffffffffffffffffffffffffffffff80871660248301528086166044830152606480830186905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001781529251825160009485938b16928792869282918083835b6020831061172457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016116e7565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038160008787f1925050503d8060008114611787576040519150601f19603f3d011682016040523d82523d6000602084013e61178c565b606091505b505090506117998161160b565b9897505050505050505056fe53616665436173743a2076616c756520646f65736e27742066697420696e2039362062697473a2646970667358221220979e966d3e3b93489b96051bd9dd18007a01182463cd93ae5ca1c1783041e36e64736f6c63430007000033

Deployed Bytecode Sourcemap

26747:3858:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;29297:664;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;29297:664:0;;-1:-1:-1;29297:664:0;-1:-1:-1;29297:664:0;:::i;:::-;;8110:205;;;;;;;;;;;;;:::i;27674:317::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;27674:317:0;;;;;;;;;;;:::i;1335:161::-;;;;;;;;;;;;;:::i;27999:154::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;27999:154:0;;;;:::i;:::-;;;;;;;;;;;;;;;;;;395:20;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;27390:276;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;27390:276:0;;;;:::i;26982:23::-;;;;;;;;;;;;;:::i;7410:27::-;;;;;;;;;;;;;:::i;29969:297::-;;;;;;;;;;;;;;;;-1:-1:-1;29969:297:0;;;;;;;;;;;;;;;;;;;;;;;:::i;7783:247::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;7783:247:0;;;;:::i;28161:1128::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;28161:1128:0;;-1:-1:-1;28161:1128:0;-1:-1:-1;28161:1128:0;:::i;:::-;;;;;;;;;;;;;;;;;;;30274:153;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;30274:153:0;;;;:::i;29297:664::-;27127:8;;;;27113:10;:22;27105:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;29558:6;27232:11;27228:41:::1;;27245:7;;27228:41;29586:20:::2;29600:5;29586:13;:20::i;:::-;29582:372;;;29623:38;29643:6;29651:9;29623:19;::::0;::::2;::::0;:38;:19:::2;:38::i;:::-;;29582:372;;;29699:30;:18;::::0;::::2;29718:2:::0;29722:6;29699:18:::2;:30::i;:::-;29694:249;;29749:15;29773:5;29767:22;;;29798:4;29767:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;29767:37:0;;-1:-1:-1;29831:19:0;;::::2;29823:42;;;::::0;;::::2;::::0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;::::2;::::0;;;;;;;;;;;;;::::2;;29884:43;:27;::::0;::::2;29912:2:::0;29916:10;29884:27:::2;:43::i;:::-;29694:249;;27163:1:::1;29297:664:::0;;;;;;:::o;8110:205::-;7591:12;;;;7577:10;:26;7569:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8227:12:::1;::::0;::::1;8220:5:::0;;8199:41:::1;::::0;8227:12:::1;::::0;;::::1;::::0;8220:5;;::::1;::::0;8199:41:::1;::::0;::::1;8259:12;::::0;;::::1;8251:20:::0;;;;;::::1;8259:12;::::0;::::1;8251:20;::::0;;;8282:25:::1;::::0;;8110:205::o;27674:317::-;841:5;;;;827:10;:19;819:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27826:23:::1;::::0;::::1;;::::0;;;:16:::1;:23;::::0;;;;;::::1;;:39;;::::0;::::1;;;;27818:65;;;::::0;;::::1;::::0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;27896:23;::::0;::::1;;::::0;;;:16:::1;:23;::::0;;;;;;;;:38;;;::::1;::::0;::::1;;::::0;;::::1;::::0;;;27950:33;;;;;;;::::1;::::0;;;;;;;;::::1;27674:317:::0;;:::o;1335:161::-;841:5;;;;827:10;:19;819:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1456:1:::1;1441:5:::0;;1420:39:::1;::::0;::::1;1441:5:::0;;::::1;::::0;1420:39:::1;::::0;1456:1;;1420:39:::1;1486:1;1470:18:::0;;;::::1;::::0;;1335:161::o;27999:154::-;-1:-1:-1;28141:4:0;;27999:154::o;395:20::-;;;;;;:::o;27390:276::-;27505:8;;:22;:8;:22;:49;;;;-1:-1:-1;27531:23:0;;;;;27505:49;27483:115;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27609:5;:18;;27617:10;27609:18;;;;;;;;27638:8;:20;;;;;27609:18;27638:20;;;;;;;;;;27390:276::o;26982:23::-;;;;;;:::o;7410:27::-;;;;;;:::o;29969:297::-;27127:8;;;;27113:10;:22;27105:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30185:6;27232:11;27228:41:::1;;27245:7;;27228:41;30209:49:::2;:31;::::0;::::2;30241:4:::0;30247:2;30251:6;30209:31:::2;:49::i;:::-;27163:1:::1;29969:297:::0;;;;:::o;7783:247::-;841:5;;;;827:10;:19;819:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7925:22:::1;::::0;::::1;::::0;;::::1;::::0;:43:::1;;-1:-1:-1::0;7963:5:0::1;::::0;::::1;7951:17:::0;;::::1;7963:5:::0;::::1;7951:17;;7925:43;7917:71;;;::::0;;::::1;::::0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;7999:12;:23:::0;;;::::1;;::::0;;;::::1;::::0;;;::::1;::::0;;7783:247::o;28161:1128::-;27127:8;;28422:21;;27127:8;;27113:10;:22;27105:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27180:97:::1;::::0;::::1;27232:11:::0;27228:41:::1;;27245:7;;27228:41;28461:16:::2;28498:20;28512:5;28498:13;:20::i;:::-;28494:683;;;28556:6;28543:19;;:9;:19;;28535:51;;;::::0;;::::2;::::0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;::::2;::::0;;;;;;;;;;;;;::::2;;-1:-1:-1::0;28618:6:0;;-1:-1:-1;28653:18:0::2;::::0;::::2;:9;:18;28494:683;;;28724:23;::::0;::::2;28704:17;28724:23:::0;;;:16:::2;:23;::::0;;;;;::::2;;::::0;;28783:56:::2;;28838:1;28783:56;;;28798:37;::::0;;;;;28829:4:::2;28798:37;::::0;::::2;::::0;;;:22:::2;::::0;::::2;::::0;::::2;::::0;:37;;;;;::::2;::::0;;;;;;;;:22;:37;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;28798:37:0;28783:56:::2;28762:77:::0;-1:-1:-1;28856:66:0::2;:31;::::0;::::2;28888:4:::0;28902::::2;28909:12;::::0;::::2;28856:31;:66::i;:::-;28939:17;28959:12;:61;;29014:6;28959:61;;;;;28974:37;::::0;;;;;29005:4:::2;28974:37;::::0;::::2;::::0;;;:22:::2;::::0;::::2;::::0;::::2;::::0;:37;;;;;::::2;::::0;;;;;;;;:22;:37;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;28974:37:0;28959:61:::2;28939:81:::0;-1:-1:-1;29035:9:0::2;29047:31;28939:81:::0;29064:13;29047:16:::2;:31::i;:::-;29035:43;;29110:15;:4;:13;:15::i;:::-;29093:32;;29156:9;29142:23;;28494:683;;;;;29193:15:::0;;29189:93:::2;;29225:45;29247:11;29260:9;29225:21;::::0;::::2;::::0;:45;:21:::2;:45::i;:::-;;29189:93;27268:1;27228:41:::1;27163:1;28161:1128:::0;;;;;;;:::o;30274:153::-;30371:4;30400:19;30414:4;30400:13;:19::i;:::-;30393:26;30274:153;-1:-1:-1;;30274:153:0:o;30460:142::-;30576:18;;;;30460:142::o;5405:269::-;5551:12;5591:28;:10;;;5602:6;5610:8;5591:10;:28::i;:::-;5581:38;;5638:7;5630:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5405:269;;;;;:::o;8835:291::-;8973:4;9002:116;9041:5;9061:2;9078:5;9098:9;9002:24;:116::i;:::-;8995:123;8835:291;-1:-1:-1;;;;8835:291:0:o;8549:278::-;8694:125;8742:5;8762:2;8779:5;8799:9;8694:33;:125::i;:::-;8549:278;;;:::o;10260:328::-;10432:148;10484:5;10504:4;10523:2;10540:5;10560:9;10432:37;:148::i;:::-;10260:328;;;;:::o;1915:193::-;2023:4;2058:1;2053;:6;;2045:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2095:5:0;;;1915:193::o;15024:179::-;15080:6;15115:5;15107;:13;15099:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;15189:5:0;15024:179::o;4855:395::-;4992:12;5026:11;5022:55;;-1:-1:-1;5061:4:0;5054:11;;5022:55;5087:25;5115:14;:2;:12;;;:14::i;:::-;5194:48;;5087:42;;-1:-1:-1;5194:14:0;;;;5229:8;;5216:6;;5194:48;;;;5216:6;5194:14;5229:8;5194:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5180:62:0;;4855:395;-1:-1:-1;;;;;;4855:395:0:o;9452:800::-;10033:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10070:18;10033:103;;;10166:35;;;;9629:4;;;;10166:10;;;10182:8;;10033:103;;10166:35;;;;10033:103;10166:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10147:54;;;10219:25;10236:7;10219:16;:25::i;:::-;10212:32;9452:800;-1:-1:-1;;;;;;;9452:800:0:o;9134:310::-;9340:52;9365:5;9372:2;9376:5;9383:8;9340:24;:52::i;:::-;9318:118;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10945:417;11156:11;11170:138;11213:5;11233:4;11252:2;11269:5;11289:8;11170:28;:138::i;:::-;11156:152;;11327:6;11319:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10945:417;;;;;;:::o;4540:164::-;4691:4;4540:164::o;12240:1127::-;12350:4;12673:7;12669:666;;;12732:16;12887:61;;;;13065:2;13060:115;;;;13289:1;13278:12;;12725:584;;12887:61;12928:1;12917:12;;12887:61;;13060:115;13112:2;13109:1;13106;13091:24;13154:1;13148:8;13137:19;;12725:584;-1:-1:-1;13352:7:0;;12240:1127;-1:-1:-1;12240:1127:0:o;11370:862::-;11994:122;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12031:18;11994:122;;;12146:35;;;;11574:4;;;;12146:10;;;12162:8;;11994:122;;12146:35;;;;11994:122;12146:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12127:54;;;12199:25;12216:7;12199:16;:25::i;:::-;12192:32;11370:862;-1:-1:-1;;;;;;;;11370:862:0:o

Swarm Source

ipfs://979e966d3e3b93489b96051bd9dd18007a01182463cd93ae5ca1c1783041e36e
Loading...
Loading
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.