MATIC Price: $0.360786 (-20.25%)
 

Overview

Max Total Supply

234,711 EMONA

Holders

53,673

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Filtered by Token Holder
Polygonscan: Donate
Balance
4 EMONA
0x71c7656ec7ab88b098defb751b7401b5f6d8976f
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
EtheremonMonsterToken

Compiler Version
v0.6.6+commit.6c089d02

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at polygonscan.com on 2021-06-30
*/

// File: openzeppelin-solidity/contracts/introspection/IERC165.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// File: openzeppelin-solidity/contracts/introspection/ERC165.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;


/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
abstract contract ERC165 is IERC165 {
    /*
     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
     */
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    constructor () internal {
        // Derived contracts need only register support for their own interfaces,
        // we register support for ERC165 itself here
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

// File: openzeppelin-solidity/contracts/utils/Address.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is 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.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File: openzeppelin-solidity/contracts/token/ERC721/IERC721.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;


/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
      * @dev Safely transfers `tokenId` token from `from` to `to`.
      *
      * Requirements:
      *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
      * - `tokenId` token must exist and be owned by `from`.
      * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
      * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
      *
      * Emits a {Transfer} event.
      */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}

// File: openzeppelin-solidity/contracts/token/ERC721/IERC721Receiver.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}

// File: openzeppelin-solidity/contracts/token/ERC721/IERC721Metadata.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;


/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {

    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

// File: openzeppelin-solidity/contracts/token/ERC721/IERC721Enumerable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;


/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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);
}

// File: openzeppelin-solidity/contracts/math/SafeMath.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.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.
     */
    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.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        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.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

// File: openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.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 IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

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

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    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, "SafeERC20: decreased allowance below zero");
        _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. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "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");
        }
    }
}

// File: contracts/EIP712Base.sol

pragma solidity 0.6.6;


contract EIP712Base {
    struct EIP712Domain {
        string name;
        string version;
        address verifyingContract;
        bytes32 salt;
    }

    string constant public ERC712_VERSION = "1";

    bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256(
        bytes(
            "EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)"
        )
    );
    bytes32 internal domainSeperator;

    constructor(string memory name) public {
        _setDomainSeperator(name);
    }
    
    function _setDomainSeperator(string memory name) internal {
        domainSeperator = keccak256(
            abi.encode(
                EIP712_DOMAIN_TYPEHASH,
                keccak256(bytes(name)),
                keccak256(bytes(ERC712_VERSION)),
                address(this),
                bytes32(getChainId())
            )
        );
    }

    function getDomainSeperator() public view returns (bytes32) {
        return domainSeperator;
    }

    function getChainId() public pure returns (uint256) {
        uint256 id;
        assembly {
            id := chainid()
        }
        return id;
    }

    /**
     * Accept message hash and returns hash message in EIP712 compatible form
     * So that it can be used to recover signer from signature signed using EIP712 formatted data
     * https://eips.ethereum.org/EIPS/eip-712
     * "\\x19" makes the encoding deterministic
     * "\\x01" is the version byte to make it compatible to EIP-191
     */
    function toTypedMessageHash(bytes32 messageHash)
        internal
        view
        returns (bytes32)
    {
        return
            keccak256(
                abi.encodePacked("\x19\x01", getDomainSeperator(), messageHash)
            );
    }
}

// File: contracts/NativeMetaTransaction.sol

pragma solidity 0.6.6;



contract NativeMetaTransaction is EIP712Base {
    using SafeMath for uint256;
    bytes32 private constant META_TRANSACTION_TYPEHASH = keccak256(
        bytes(
            "MetaTransaction(uint256 nonce,address from,bytes functionSignature)"
        )
    );
    event MetaTransactionExecuted(
        address userAddress,
        address payable relayerAddress,
        bytes functionSignature
    );
    mapping(address => uint256) nonces;

    /*
     * Meta transaction structure.
     * No point of including value field here as if user is doing value transfer then he has the funds to pay for gas
     * He should call the desired function directly in that case.
     */
    struct MetaTransaction {
        uint256 nonce;
        address from;
        bytes functionSignature;
    }

    constructor(string memory name) public EIP712Base(name){
    }

    function executeMetaTransaction(
        address userAddress,
        bytes memory functionSignature,
        bytes32 sigR,
        bytes32 sigS,
        uint8 sigV
    ) public payable returns (bytes memory) {
        MetaTransaction memory metaTx = MetaTransaction({
            nonce: nonces[userAddress],
            from: userAddress,
            functionSignature: functionSignature
        });

        require(
            verify(userAddress, metaTx, sigR, sigS, sigV),
            "Signer and signature do not match"
        );

        // increase nonce for user (to avoid re-use)
        nonces[userAddress] = nonces[userAddress].add(1);

        emit MetaTransactionExecuted(
            userAddress,
            msg.sender,
            functionSignature
        );

        // Append userAddress and relayer address at the end to extract it from calling context
        (bool success, bytes memory returnData) = address(this).call(
            abi.encodePacked(functionSignature, userAddress)
        );
        require(success, "Function call not successful");

        return returnData;
    }

    function hashMetaTransaction(MetaTransaction memory metaTx)
        internal
        pure
        returns (bytes32)
    {
        return
            keccak256(
                abi.encode(
                    META_TRANSACTION_TYPEHASH,
                    metaTx.nonce,
                    metaTx.from,
                    keccak256(metaTx.functionSignature)
                )
            );
    }

    function getNonce(address user) public view returns (uint256 nonce) {
        nonce = nonces[user];
    }

    function verify(
        address signer,
        MetaTransaction memory metaTx,
        bytes32 sigR,
        bytes32 sigS,
        uint8 sigV
    ) internal view returns (bool) {
        require(signer != address(0), "NativeMetaTransaction: INVALID_SIGNER");
        return
            signer ==
            ecrecover(
                toTypedMessageHash(hashMetaTransaction(metaTx)),
                sigV,
                sigR,
                sigS
            );
    }
}

// File: contracts/Context.sol

pragma solidity 0.6.6;


contract Context {
    function msgSender()
        internal
        view
        returns (address payable sender)
    {
        if (msg.sender == address(this)) {
            bytes memory array = msg.data;
            uint256 index = msg.data.length;
            assembly {
                // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those.
                sender := and(
                    mload(add(array, index)),
                    0xffffffffffffffffffffffffffffffffffffffff
                )
            }
        } else {
            sender = msg.sender;
        }
        return sender;
    }
}

// File: contracts/EthermonEnum.sol

pragma solidity 0.6.6;


contract EthermonEnum {

    enum ResultCode {
        SUCCESS,
        ERROR_CLASS_NOT_FOUND,
        ERROR_LOW_BALANCE,
        ERROR_SEND_FAIL,
        ERROR_NOT_TRAINER,
        ERROR_NOT_ENOUGH_MONEY,
        ERROR_INVALID_AMOUNT
    }
    
    enum ArrayType {
        CLASS_TYPE,
        STAT_STEP,
        STAT_START,
        STAT_BASE,
        OBJ_SKILL
    }

    enum PropertyType {
        ANCESTOR,
        XFACTOR
    }
}

// File: contracts/EthermonDataBase.sol

pragma solidity 0.6.6;

interface EtheremonDataBase {

    // write
    function withdrawEther(address _sendTo, uint _amount) external returns(EthermonEnum.ResultCode);
    function addElementToArrayType(EthermonEnum.ArrayType _type, uint64 _id, uint8 _value) external returns(uint);
    function updateIndexOfArrayType(EthermonEnum.ArrayType _type, uint64 _id, uint _index, uint8 _value) external returns(uint);
    function setMonsterClass(uint32 _classId, uint256 _price, uint256 _returnPrice, bool _catchable) external returns(uint32);
    function addMonsterObj(uint32 _classId, address _trainer, string calldata _name) external returns(uint64);
    function setMonsterObj(uint64 _objId, string calldata _name, uint32 _exp, uint32 _createIndex, uint32 _lastClaimIndex) external;
    function increaseMonsterExp(uint64 _objId, uint32 amount) external;
    function decreaseMonsterExp(uint64 _objId, uint32 amount) external;
    function removeMonsterIdMapping(address _trainer, uint64 _monsterId) external;
    function addMonsterIdMapping(address _trainer, uint64 _monsterId) external;
    function clearMonsterReturnBalance(uint64 _monsterId) external returns(uint256 amount);
    function collectAllReturnBalance(address _trainer) external returns(uint256 amount);
    function transferMonster(address _from, address _to, uint64 _monsterId) external returns(EthermonEnum.ResultCode);
    function addExtraBalance(address _trainer, uint256 _amount) external returns(uint256);
    function deductExtraBalance(address _trainer, uint256 _amount) external returns(uint256);
    function setExtraBalance(address _trainer, uint256 _amount) external;
    
    // read
    function totalMonster() external view returns(uint256);
    function totalClass() external view returns(uint32);
    function getSizeArrayType(EthermonEnum.ArrayType _type, uint64 _id) external view returns(uint);
    function getElementInArrayType(EthermonEnum.ArrayType _type, uint64 _id, uint _index) external view returns(uint8);
    function getMonsterClass(uint32 _classId) external view returns(uint32 classId, uint256 price, uint256 returnPrice, uint32 total, bool catchable);
    function getMonsterObj(uint64 _objId) external view returns(uint64 objId, uint32 classId, address trainer, uint32 exp, uint32 createIndex, uint32 lastClaimIndex, uint createTime);
    function getMonsterName(uint64 _objId) external view returns(string memory name);
    function getExtraBalance(address _trainer) external view returns(uint256);
    function getMonsterDexSize(address _trainer) external view returns(uint);
    function getMonsterObjId(address _trainer, uint index) external view returns(uint64);
    function getExpectedBalance(address _trainer) external view returns(uint256);
    function getMonsterReturn(uint64 _objId) external view returns(uint256 current, uint256 total);
}

// File: contracts/BasicAccessControl.sol

pragma solidity 0.6.6;


contract BasicAccessControl is Context {
    address payable public owner;
    // address[] public moderators;
    uint16 public totalModerators = 0;
    mapping (address => bool) public moderators;
    bool public isMaintaining = false;

    constructor() public {
        owner = msgSender();
    }

    modifier onlyOwner {
        require(msgSender() == owner);
        _;
    }

    modifier onlyModerators() {
        require(msgSender() == owner || moderators[msgSender()] == true);
        _;
    }

    modifier isActive {
        require(!isMaintaining);
        _;
    }

    function ChangeOwner(address payable _newOwner) public onlyOwner {
        if (_newOwner != address(0)) {
            owner = _newOwner;
        }
    }


    function AddModerator(address _newModerator) public onlyOwner {
        if (moderators[_newModerator] == false) {
            moderators[_newModerator] = true;
            totalModerators += 1;
        }
    }

    function Kill() public onlyOwner {
        selfdestruct(owner);
    }
}

// File: contracts/EtheremonMonsterToken.sol

pragma solidity 0.6.6;

// copyright [email protected]// copyright [email protected]















interface ERC721 {
       
    function transfer(address _to, uint256 _tokenId) external;
  
}



interface EtheremonBattle {
    function isOnBattle(uint64 _objId) external view returns(bool);
}

interface EtheremonTradeInterface {
    function isOnTrading(uint64 _objId) external view returns(bool);
}


contract EtheremonMonsterTokenBasic is IERC721, ERC721, ERC165, BasicAccessControl {

    using SafeMath for uint256;
    using Address for address;
    
    struct MonsterClassAcc {
        uint32 classId;
        uint256 price;
        uint256 returnPrice;
        uint32 total;
        bool catchable;
    }

    struct MonsterObjAcc {
        uint64 monsterId;
        uint32 classId;
        address trainer;
        string name;
        uint32 exp;
        uint32 createIndex;
        uint32 lastClaimIndex;
        uint createTime;
    }

    // data contract
    address public dataContract;
    address public battleContract;
    address public tradeContract;
    
    // Mapping from NFT ID to approved address.
    mapping (uint256 => address) internal idToApprovals;
    
    // Mapping from owner address to mapping of operator addresses.
    mapping (address => mapping (address => bool)) internal ownerToOperators;
    
    /**
    * @dev Magic value of a smart contract that can recieve NFT.
    * Equal to: bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")).
    */
    bytes4 constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;

    event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
    event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);
    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    
    
    // internal function
    function _canOperate(address _tokenOwner) internal view {
        require(_tokenOwner == msgSender() || ownerToOperators[_tokenOwner][msgSender()]);
    }
    
    function _canTransfer(uint256 _tokenId, address _tokenOwner) internal view {
        EtheremonBattle battle = EtheremonBattle(battleContract);
        EtheremonTradeInterface trade = EtheremonTradeInterface(tradeContract);
        require(!battle.isOnBattle(uint64(_tokenId)) && !trade.isOnTrading(uint64(_tokenId)));
        require(_tokenOwner != address(0));
        require(_tokenOwner == msgSender() || idToApprovals[_tokenId] == msgSender() || ownerToOperators[_tokenOwner][msgSender()]);
    }
    
    function setOperationContracts(address _dataContract, address _battleContract, address _tradeContract) external onlyModerators {
        dataContract = _dataContract;
        battleContract = _battleContract;
        tradeContract = _tradeContract;
    }
    
    // public function

    function isApprovable(address _owner, uint256 _tokenId) public view returns(bool) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_tokenId));
        if (obj.monsterId != uint64(_tokenId))
            return false;
        if (obj.trainer != _owner)
            return false;
        // check battle & trade contract 
        EtheremonBattle battle = EtheremonBattle(battleContract);
        EtheremonTradeInterface trade = EtheremonTradeInterface(tradeContract);
        return (!battle.isOnBattle(obj.monsterId) && !trade.isOnTrading(obj.monsterId));
    }

    function balanceOf(address _owner) external view override returns (uint256) {
        require(_owner != address(0));
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        return data.getMonsterDexSize(_owner);
    }

    function ownerOf(uint256 _tokenId) external view override returns (address _owner) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, _owner, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_tokenId));
        require(_owner != address(0));
    }


    function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata _data) external override {
        _safeTransferFrom(_from, _to, _tokenId, _data);
    }

    function safeTransferFrom(address _from, address _to, uint256 _tokenId) external override {
        _safeTransferFrom(_from, _to, _tokenId, "");
    }

    function transferFrom(address _from, address _to, uint256 _tokenId) external override {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_tokenId));
        require(obj.trainer != address(0));
        _canTransfer(_tokenId, obj.trainer);
        
        require(obj.trainer == _from);
        require(_to != address(0));
        _transfer(obj.trainer, _to, _tokenId);
    }

    function transfer(address _to, uint256 _tokenId) external override {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_tokenId));
        require(obj.trainer != address(0));
        _canTransfer(_tokenId, obj.trainer);
        
        require(obj.trainer == msgSender());
        require(_to != address(0));
        _transfer(obj.trainer, _to, _tokenId);
    }

    function approve(address _approved, uint256 _tokenId) external override {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_tokenId));
        require(obj.trainer != address(0));
        _canOperate(obj.trainer);
        EtheremonBattle battle = EtheremonBattle(battleContract);
        EtheremonTradeInterface trade = EtheremonTradeInterface(tradeContract);
        if(battle.isOnBattle(obj.monsterId) || trade.isOnTrading(obj.monsterId))
            revert();
        
        require(_approved != obj.trainer);

        idToApprovals[_tokenId] = _approved;
        emit Approval(obj.trainer, _approved, _tokenId);
    }

    function setApprovalForAll(address _operator, bool _approved) external override {
        require(_operator != address(0));
        ownerToOperators[msgSender()][_operator] = _approved;
        emit ApprovalForAll(msgSender(), _operator, _approved);
    }

    function getApproved(uint256 _tokenId) external view override returns (address) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_tokenId));
        require(obj.trainer != address(0));
        return idToApprovals[_tokenId];
    }

    function isApprovedForAll(address _owner, address _operator) external view override returns (bool) {
        require(_owner != address(0));
        require(_operator != address(0));
        return ownerToOperators[_owner][_operator];
    }

    function _safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) internal {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_tokenId));
        require(obj.trainer != address(0));
        _canTransfer(_tokenId, obj.trainer);
        
        require(obj.trainer == _from);
        require(_to != address(0));

        _transfer(obj.trainer, _to, _tokenId);

        if (_to.isContract()) {
            bytes4 retval = IERC721Receiver(_to).onERC721Received(msgSender(), _from, _tokenId, _data);
            require(retval == MAGIC_ON_ERC721_RECEIVED);
        }
    }

    function _transfer(address _from, address _to, uint256 _tokenId) private {
        _clearApproval(_tokenId);
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        data.removeMonsterIdMapping(_from, uint64(_tokenId));
        data.addMonsterIdMapping(_to, uint64(_tokenId));
        emit Transfer(_from, _to, _tokenId);
    }


    function _burn(uint256 _tokenId) internal virtual { 
        _clearApproval(_tokenId);
        
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_tokenId));
        require(obj.trainer != address(0));
        
        EtheremonBattle battle = EtheremonBattle(battleContract);
        EtheremonTradeInterface trade = EtheremonTradeInterface(tradeContract);
        if(battle.isOnBattle(obj.monsterId) || trade.isOnTrading(obj.monsterId))
            revert();
        
        data.removeMonsterIdMapping(obj.trainer, uint64(_tokenId));
        
        emit Transfer(obj.trainer, address(0), _tokenId);
    }

    function _clearApproval(uint256 _tokenId) internal {
        if(idToApprovals[_tokenId] != address(0)) {
            delete idToApprovals[_tokenId];
        }
    }

}

abstract contract EtheremonMonsterEnumerable is EtheremonMonsterTokenBasic, IERC721Enumerable {

    constructor() public {
        _registerInterface(0x780e9d63); // ERC721Enumerable
    }

    function totalSupply() external view override returns (uint256) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        return data.totalMonster();
    }

    function tokenByIndex(uint256 _index) external view override returns (uint256) {
        return _index;
    }

    function tokenOfOwnerByIndex(address _owner, uint256 _index) external view override returns (uint256) {
        require(_owner != address(0));
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        return data.getMonsterObjId(_owner, _index);
    }

}


abstract contract EtheremonMonsterStandard is EtheremonMonsterEnumerable, IERC721Metadata {
    string internal nftName;
    string internal nftSymbol;
    
    mapping (uint256 => string) internal idToUri;
    
    constructor(string memory _name, string memory _symbol) public {
        nftName = _name;
        nftSymbol = _symbol;
        _registerInterface(0x5b5e139f); // ERC721Metadata
    }
    
    function _burn(uint256 _tokenId) internal override {
        super._burn(_tokenId);
        if (bytes(idToUri[_tokenId]).length != 0) {
            delete idToUri[_tokenId];
        }
    }
    
    function _setTokenUri(uint256 _tokenId, string memory _uri) internal {
        idToUri[_tokenId] = _uri;
    }
    
    function name() external view override returns (string memory _name) {
        _name = nftName;
    }
    
    function symbol() external view override returns (string memory _symbol) {
        _symbol = nftSymbol;
    }
    
    function tokenURI(uint256 _tokenId) external view override returns (string memory) {
        return idToUri[_tokenId];
    }
}

contract EtheremonMonsterToken is EtheremonMonsterStandard("EtheremonMonster", "EMONA"), NativeMetaTransaction {
    using SafeERC20 for IERC20;

    uint8 constant public STAT_COUNT = 6;
    uint8 constant public STAT_MAX = 32;

    uint seed = 0;

    mapping(uint8 => uint32) public levelExps;
    mapping(uint32 => bool) classWhitelist;
    mapping(address => bool) addressWhitelist;

    uint public gapFactor = 0.001 ether;
    uint16 public priceIncreasingRatio = 1000;
//wrapped ether on matic
    IERC20 public weth;

    constructor(
        string memory name,
        address _weth
    )
        public
        NativeMetaTransaction(name)
    {
        weth = IERC20(_weth);
        _registerInterface(0x80ac58cd); // ERC721
    }
    
    function setPriceIncreasingRatio(uint16 _ratio) external onlyModerators {
        priceIncreasingRatio = _ratio;
    }

    function setFactor(uint _gapFactor) public onlyModerators {
        gapFactor = _gapFactor;
    }
    
    function genLevelExp() external onlyModerators {
        uint8 level = 1;
        uint32 requirement = 100;
        uint32 sum = requirement;
        while(level <= 100) {
            levelExps[level] = sum;
            level += 1;
            requirement = (requirement * 11) / 10 + 5;
            sum += requirement;
        }
    }

    function setClassWhitelist(uint32 _classId, bool _status) external onlyModerators {
        classWhitelist[_classId] = _status;
    }

    function setAddressWhitelist(address _smartcontract, bool _status) external onlyModerators {
        addressWhitelist[_smartcontract] = _status;
    }

    function setTokenURI(uint256 _tokenId, string calldata _uri) external onlyModerators {
        _setTokenUri(_tokenId, _uri);
    }

    // write access
    function withdrawEther(
        address _sendTo,
        uint _amount
    )
        public
        onlyOwner
    {   
        uint256 balance = weth.balanceOf(address(this));

        require(_amount <= balance);
        
        weth.safeTransfer(_sendTo, _amount);
    }

    function mintMonster(uint32 _classId, address _trainer, string calldata _name) external onlyModerators returns(uint){
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        // add monster
        uint64 objId = data.addMonsterObj(_classId, _trainer, _name);
        uint8 value;
        seed = getRandom(_trainer, block.number-1, seed, objId);
        // generate base stat for the previous one
        for (uint i=0; i < STAT_COUNT; i+= 1) {
            value = uint8(seed % STAT_MAX) + data.getElementInArrayType(EthermonEnum.ArrayType.STAT_START, uint64(_classId), i);
            data.addElementToArrayType(EthermonEnum.ArrayType.STAT_BASE, objId, value);
        }
        emit Transfer(address(0), _trainer, objId);
        return objId;
    }

    function burnMonster(uint64 _tokenId) external onlyModerators {
        _burn(_tokenId);
    }

    function clearApproval(uint _tokenId) external onlyModerators {
        _clearApproval(_tokenId);
    }

    function triggerTransferEvent(address _from, address _to, uint _tokenId) external onlyModerators {
        _clearApproval(_tokenId);
        emit Transfer(_from, _to, _tokenId);
    }

    // public api
    function getRandom(address _player, uint _block, uint _seed, uint _count) view public returns(uint) {
        return uint(keccak256(abi.encodePacked(blockhash(_block), _player, _seed, _count)));
    }

    function getLevel(uint32 exp) view public returns (uint8) {
        uint8 minIndex = 1;
        uint8 maxIndex = 100;
        uint8 currentIndex;

        while (minIndex < maxIndex) {
            currentIndex = (minIndex + maxIndex) / 2;
            if (exp < levelExps[currentIndex])
                maxIndex = currentIndex;
            else
                minIndex = currentIndex + 1;
        }

        return minIndex;
    }

    function getMonsterBaseStats(uint64 _monsterId) external view returns(uint hp, uint pa, uint pd, uint sa, uint sd, uint speed) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        uint[6] memory stats;
        for(uint i=0; i < STAT_COUNT; i+=1) {
            stats[i] = data.getElementInArrayType(EthermonEnum.ArrayType.STAT_BASE, _monsterId, i);
        }
        return (stats[0], stats[1], stats[2], stats[3], stats[4], stats[5]);
    }
    
    function getMonsterCurrentStats(uint64 _monsterId) external view returns(uint exp, uint level, uint hp, uint pa, uint pd, uint sa, uint sd, uint speed) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(_monsterId);
        
        uint[6] memory stats;
        uint i = 0;
        level = getLevel(obj.exp);
        for(i=0; i < STAT_COUNT; i+=1) {
            stats[i] = data.getElementInArrayType(EthermonEnum.ArrayType.STAT_BASE, _monsterId, i);
        }
        for(i=0; i < STAT_COUNT; i++) {
            stats[i] += uint(data.getElementInArrayType(EthermonEnum.ArrayType.STAT_STEP, obj.classId, i)) * level * 3;
        }
        
        return (obj.exp, level, stats[0], stats[1], stats[2], stats[3], stats[4], stats[5]);
    }
    
    function getMonsterCP(uint64 _monsterId) external view returns(uint cp) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(_monsterId);
        
        uint[6] memory stats;
        uint i = 0;
        cp = getLevel(obj.exp);
        for(i=0; i < STAT_COUNT; i+=1) {
            stats[i] = data.getElementInArrayType(EthermonEnum.ArrayType.STAT_BASE, _monsterId, i);
        }
        for(i=0; i < STAT_COUNT; i++) {
            stats[i] += uint(data.getElementInArrayType(EthermonEnum.ArrayType.STAT_STEP, obj.classId, i)) * cp * 3;
        }
        
        cp = (stats[0] + stats[1] + stats[2] + stats[3] + stats[4] + stats[5]) / 6;
    }
    
    function getPrice(uint32 _classId) external view returns(bool catchable, uint price) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterClassAcc memory class;
        (class.classId, class.price, class.returnPrice, class.total, class.catchable) = data.getMonsterClass(_classId);
        
        price = class.price;
        if (class.total > 0)
            price += class.price*(class.total-1)/priceIncreasingRatio;
        
        if (class.catchable == false) {
            if (addressWhitelist[msgSender()] == true && classWhitelist[_classId] == true) {
                return (true, price);
            }
        }
        
        return (class.catchable, price);
    }
    
    function getMonsterClassBasic(uint32 _classId) external view returns(uint256, uint256, uint256, bool) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterClassAcc memory class;
        (class.classId, class.price, class.returnPrice, class.total, class.catchable) = data.getMonsterClass(_classId);
        return (class.price, class.returnPrice, class.total, class.catchable);
    }
    
    function renameMonster(uint64 _objId, string calldata name) external isActive {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(_objId);
        if (obj.monsterId != _objId || obj.trainer != msgSender()) {
            revert();
        }
        data.setMonsterObj(_objId, name, obj.exp, obj.createIndex, obj.lastClaimIndex);
    }
    
    //MATIC: CHANGES FOR ETHER
    function catchMonster(
        address _player,
        uint32 _classId,
        string calldata _name,
        uint256 amount
    )
        external
        isActive
        returns(uint tokenId)
    {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterClassAcc memory class;
        (class.classId, class.price, class.returnPrice, class.total, class.catchable) = data.getMonsterClass(_classId);
        if (class.classId == 0) {
            revert();
        }
        
        if (class.catchable == false) {
            if (addressWhitelist[msgSender()] == false || classWhitelist[_classId] == false) {
                revert();
            }
        }
        
        uint price = class.price;
        if (class.total > 0)
            price += class.price*(class.total-1)/priceIncreasingRatio;
        weth.safeTransferFrom(msgSender(), address(this), amount);
        if (amount + gapFactor < price) {
            revert();
        }
        
        // add new monster 
        uint64 objId = data.addMonsterObj(_classId, _player, _name);
        uint8 value;
        seed = getRandom(_player, block.number-1, seed, objId);
        // generate base stat for the previous one
        for (uint i=0; i < STAT_COUNT; i+= 1) {
            value = uint8(seed % STAT_MAX) + data.getElementInArrayType(EthermonEnum.ArrayType.STAT_START, uint64(_classId), i);
            data.addElementToArrayType(EthermonEnum.ArrayType.STAT_BASE, objId, value);
        }
        
        emit Transfer(address(0), _player, objId);

        return objId; 
    }
    
    
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"address payable","name":"relayerAddress","type":"address"},{"indexed":false,"internalType":"bytes","name":"functionSignature","type":"bytes"}],"name":"MetaTransactionExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"_newModerator","type":"address"}],"name":"AddModerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_newOwner","type":"address"}],"name":"ChangeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ERC712_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"Kill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"STAT_COUNT","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAT_MAX","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_approved","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"battleContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_tokenId","type":"uint64"}],"name":"burnMonster","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_player","type":"address"},{"internalType":"uint32","name":"_classId","type":"uint32"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"catchMonster","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"clearApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dataContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"bytes","name":"functionSignature","type":"bytes"},{"internalType":"bytes32","name":"sigR","type":"bytes32"},{"internalType":"bytes32","name":"sigS","type":"bytes32"},{"internalType":"uint8","name":"sigV","type":"uint8"}],"name":"executeMetaTransaction","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"gapFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"genLevelExp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getDomainSeperator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"exp","type":"uint32"}],"name":"getLevel","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_monsterId","type":"uint64"}],"name":"getMonsterBaseStats","outputs":[{"internalType":"uint256","name":"hp","type":"uint256"},{"internalType":"uint256","name":"pa","type":"uint256"},{"internalType":"uint256","name":"pd","type":"uint256"},{"internalType":"uint256","name":"sa","type":"uint256"},{"internalType":"uint256","name":"sd","type":"uint256"},{"internalType":"uint256","name":"speed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_monsterId","type":"uint64"}],"name":"getMonsterCP","outputs":[{"internalType":"uint256","name":"cp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_classId","type":"uint32"}],"name":"getMonsterClassBasic","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_monsterId","type":"uint64"}],"name":"getMonsterCurrentStats","outputs":[{"internalType":"uint256","name":"exp","type":"uint256"},{"internalType":"uint256","name":"level","type":"uint256"},{"internalType":"uint256","name":"hp","type":"uint256"},{"internalType":"uint256","name":"pa","type":"uint256"},{"internalType":"uint256","name":"pd","type":"uint256"},{"internalType":"uint256","name":"sa","type":"uint256"},{"internalType":"uint256","name":"sd","type":"uint256"},{"internalType":"uint256","name":"speed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_classId","type":"uint32"}],"name":"getPrice","outputs":[{"internalType":"bool","name":"catchable","type":"bool"},{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_player","type":"address"},{"internalType":"uint256","name":"_block","type":"uint256"},{"internalType":"uint256","name":"_seed","type":"uint256"},{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"getRandom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"isApprovable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMaintaining","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"levelExps","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_classId","type":"uint32"},{"internalType":"address","name":"_trainer","type":"address"},{"internalType":"string","name":"_name","type":"string"}],"name":"mintMonster","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"moderators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"_name","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceIncreasingRatio","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_objId","type":"uint64"},{"internalType":"string","name":"name","type":"string"}],"name":"renameMonster","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_smartcontract","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setAddressWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_classId","type":"uint32"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setClassWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gapFactor","type":"uint256"}],"name":"setFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_dataContract","type":"address"},{"internalType":"address","name":"_battleContract","type":"address"},{"internalType":"address","name":"_tradeContract","type":"address"}],"name":"setOperationContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_ratio","type":"uint16"}],"name":"setPriceIncreasingRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"_symbol","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalModerators","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradeContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"triggerTransferEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sendTo","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawEther","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526001805461ffff60a01b191690556003805460ff191690556000600d5566038d7ea4c680006011556012805461ffff19166103e81790553480156200004857600080fd5b506040516200562538038062005625833981810160405260408110156200006e57600080fd5b81019080805160405193929190846401000000008211156200008f57600080fd5b908301906020820185811115620000a557600080fd5b8251640100000000811182820188101715620000c057600080fd5b82525081516020918201929091019080838360005b83811015620000ef578181015183820152602001620000d5565b50505050905090810190601f1680156200011d5780820380516001836020036101000a031916815260200191505b5060408181526020928301518282018252601083526f22ba3432b932b6b7b726b7b739ba32b960811b8484015281518083019092526005825264454d4f4e4160d81b938201939093529193508492508291620001896301ffc9a760e01b6001600160e01b036200026a16565b6200019c6001600160e01b03620002ef16565b600180546001600160a01b0319166001600160a01b0392909216919091179055620001ce63780e9d6360e01b6200026a565b8151620001e39060089060208501906200041b565b508051620001f99060099060208401906200041b565b5062000215635b5e139f60e01b6001600160e01b036200026a16565b506200022c9050816001600160e01b036200034f16565b50506012805462010000600160b01b031916620100006001600160a01b03841602179055620002626380ac58cd60e01b6200026a565b5050620004bd565b6001600160e01b03198082161415620002ca576040805162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015290519081900360640190fd5b6001600160e01b0319166000908152602081905260409020805460ff19166001179055565b600033301415620003495760606000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506200034c9050565b50335b90565b6040518060800160405280604f8152602001620055d6604f913980516020918201208251838301206040805180820190915260018152603160f81b930192909252907fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc630620003c66001600160e01b036200041716565b604080516020808201979097528082019590955260608501939093526001600160a01b03909116608084015260a0808401919091528151808403909101815260c090920190528051910120600b5550565b4690565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200045e57805160ff19168380011785556200048e565b828001600101855582156200048e579182015b828111156200048e57825182559160200191906001019062000471565b506200049c929150620004a0565b5090565b6200034c91905b808211156200049c5760008155600101620004a7565b61510980620004cd6000396000f3fe6080604052600436106103965760003560e01c806357918052116101dc578063af4c14ee11610102578063d29cbd60116100a0578063e985e9c51161006f578063e985e9c51461111d578063ee4e441614611158578063f28532921461116d578063ffa640d8146111a057610396565b8063d29cbd6014611042578063d98e14bd146110a8578063da26663a146110bd578063e19bb9641461110857610396565b8063be26733c116100dc578063be26733c14610fab578063c10be52114610fc0578063c463b00814610fd5578063c87b56dd1461101857610396565b8063af4c14ee14610ea5578063b2cad9b714610ee0578063b88d4fde14610f1057610396565b806381b230421161017a57806394f6ba1c1161014957806394f6ba1c14610dc457806395d89b4114610e1c578063a22cb46514610e31578063a9059cbb14610e6c57610396565b806381b2304214610cb85780638a0520fb14610ceb5780638d1d22d814610d245780638da5cb5b14610daf57610396565b806370a08231116101b657806370a0823114610beb57806378b475a814610c1e5780637fdd540314610c64578063817e9d3114610c8e57610396565b80635791805214610b605780636352211e14610b8e5780636c81fd6d14610bb857610396565b806320379ee5116102c15780633fc8cef31161025f5780634e3dc2f11161022e5780634e3dc2f114610aa65780634efb023e14610ad15780634f6ccce714610afd578063522f681514610b2757610396565b80633fc8cef314610a01578063423b1ca314610a1657806342842e0e14610a2b5780634661bb9814610a6e57610396565b80632f745c591161029b5780632f745c591461092a57806333ced321146109635780633408e470146109785780633c6e59271461098d57610396565b806320379ee51461089f57806323b872dd146108b45780632d0335ab146108f757610396565b80630a92b264116103395780630f7e5970116103085780630f7e5970146107c057806314d0f1ba146107d5578063162094c41461080857806318160ddd1461088a57610396565b80630a92b2641461065f5780630afd548d146106a45780630c53c51c146106e95780630d668818146107ab57610396565b806306fdde031161037557806306fdde03146104be578063081812fc14610548578063095ea7b31461058e5780630963d4b7146105c957610396565b806225cdc81461039b57806301ffc9a7146104435780630672859b1461048b575b600080fd5b3480156103a757600080fd5b50610431600480360360808110156103be57600080fd5b6001600160a01b038235169163ffffffff60208201351691810190606081016040820135600160201b8111156103f357600080fd5b82018360208201111561040557600080fd5b803590602001918460018302840111600160201b8311171561042657600080fd5b9193509150356111b5565b60408051918252519081900360200190f35b34801561044f57600080fd5b506104776004803603602081101561046657600080fd5b50356001600160e01b0319166115e9565b604080519115158252519081900360200190f35b34801561049757600080fd5b50610431600480360360208110156104ae57600080fd5b50356001600160401b0316611608565b3480156104ca57600080fd5b506104d36118c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561050d5781810151838201526020016104f5565b50505050905090810190601f16801561053a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561055457600080fd5b506105726004803603602081101561056b57600080fd5b5035611958565b604080516001600160a01b039092168252519081900360200190f35b34801561059a57600080fd5b506105c7600480360360408110156105b157600080fd5b506001600160a01b038135169060200135611a7b565b005b3480156105d557600080fd5b50610431600480360360608110156105ec57600080fd5b63ffffffff823516916001600160a01b0360208201351691810190606081016040820135600160201b81111561062157600080fd5b82018360208201111561063357600080fd5b803590602001918460018302840111600160201b8311171561065457600080fd5b509092509050611d30565b34801561066b57600080fd5b506104316004803603608081101561068257600080fd5b506001600160a01b03813516906020810135906040810135906060013561200d565b3480156106b057600080fd5b506105c7600480360360608110156106c757600080fd5b506001600160a01b03813581169160208101358216916040909101351661205f565b6104d3600480360360a08110156106ff57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561072957600080fd5b82018360208201111561073b57600080fd5b803590602001918460018302840111600160201b8311171561075c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550508235935050506020810135906040013560ff16612103565b3480156107b757600080fd5b50610572612406565b3480156107cc57600080fd5b506104d361241a565b3480156107e157600080fd5b50610477600480360360208110156107f857600080fd5b50356001600160a01b0316612437565b34801561081457600080fd5b506105c76004803603604081101561082b57600080fd5b81359190810190604081016020820135600160201b81111561084c57600080fd5b82018360208201111561085e57600080fd5b803590602001918460018302840111600160201b8311171561087f57600080fd5b50909250905061244c565b34801561089657600080fd5b506104316124ed565b3480156108ab57600080fd5b50610431612574565b3480156108c057600080fd5b506105c7600480360360608110156108d757600080fd5b506001600160a01b0381358116916020810135909116906040013561257a565b34801561090357600080fd5b506104316004803603602081101561091a57600080fd5b50356001600160a01b03166126d5565b34801561093657600080fd5b506104316004803603604081101561094d57600080fd5b506001600160a01b0381351690602001356126f0565b34801561096f57600080fd5b506105c761279f565b34801561098457600080fd5b50610431612854565b34801561099957600080fd5b506109c0600480360360208110156109b057600080fd5b50356001600160401b0316612858565b604080519889526020890197909752878701959095526060870193909352608086019190915260a085015260c084015260e083015251908190036101000190f35b348015610a0d57600080fd5b50610572612b6d565b348015610a2257600080fd5b50610572612b82565b348015610a3757600080fd5b506105c760048036036060811015610a4e57600080fd5b506001600160a01b03813581169160208101359091169060400135612b91565b348015610a7a57600080fd5b506105c760048036036040811015610a9157600080fd5b5063ffffffff81351690602001351515612bac565b348015610ab257600080fd5b50610abb612c30565b6040805160ff9092168252519081900360200190f35b348015610add57600080fd5b50610ae6612c35565b6040805161ffff9092168252519081900360200190f35b348015610b0957600080fd5b5061043160048036036020811015610b2057600080fd5b5035612571565b348015610b3357600080fd5b506105c760048036036040811015610b4a57600080fd5b506001600160a01b038135169060200135612c46565b348015610b6c57600080fd5b506105c760048036036020811015610b8357600080fd5b503561ffff16612d16565b348015610b9a57600080fd5b5061057260048036036020811015610bb157600080fd5b5035612d8a565b348015610bc457600080fd5b506105c760048036036020811015610bdb57600080fd5b50356001600160a01b0316612e92565b348015610bf757600080fd5b5061043160048036036020811015610c0e57600080fd5b50356001600160a01b0316612f25565b348015610c2a57600080fd5b50610c4b60048036036020811015610c4157600080fd5b503560ff16612fc1565b6040805163ffffffff9092168252519081900360200190f35b348015610c7057600080fd5b506105c760048036036020811015610c8757600080fd5b5035612fd9565b348015610c9a57600080fd5b506105c760048036036020811015610cb157600080fd5b503561303e565b348015610cc457600080fd5b506105c760048036036020811015610cdb57600080fd5b50356001600160401b031661309f565b348015610cf757600080fd5b5061047760048036036040811015610d0e57600080fd5b506001600160a01b03813516906020013561310d565b348015610d3057600080fd5b506105c760048036036040811015610d4757600080fd5b6001600160401b038235169190810190604081016020820135600160201b811115610d7157600080fd5b820183602082011115610d8357600080fd5b803590602001918460018302840111600160201b83111715610da457600080fd5b50909250905061336b565b348015610dbb57600080fd5b50610572613589565b348015610dd057600080fd5b50610df460048036036020811015610de757600080fd5b503563ffffffff16613598565b6040805194855260208501939093528383019190915215156060830152519081900360800190f35b348015610e2857600080fd5b506104d3613682565b348015610e3d57600080fd5b506105c760048036036040811015610e5457600080fd5b506001600160a01b03813516906020013515156136e3565b348015610e7857600080fd5b506105c760048036036040811015610e8f57600080fd5b506001600160a01b03813516906020013561378d565b348015610eb157600080fd5b506105c760048036036040811015610ec857600080fd5b506001600160a01b03813516906020013515156138ee565b348015610eec57600080fd5b50610abb60048036036020811015610f0357600080fd5b503563ffffffff16613975565b348015610f1c57600080fd5b506105c760048036036080811015610f3357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b811115610f6d57600080fd5b820183602082011115610f7f57600080fd5b803590602001918460018302840111600160201b83111715610fa057600080fd5b5090925090506139d8565b348015610fb757600080fd5b506105c7613a1a565b348015610fcc57600080fd5b50610431613a4f565b348015610fe157600080fd5b506105c760048036036060811015610ff857600080fd5b506001600160a01b03813581169160208101359091169060400135613a55565b34801561102457600080fd5b506104d36004803603602081101561103b57600080fd5b5035613aee565b34801561104e57600080fd5b506110756004803603602081101561106557600080fd5b50356001600160401b0316613b8f565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b3480156110b457600080fd5b50610abb613c9d565b3480156110c957600080fd5b506110ed600480360360208110156110e057600080fd5b503563ffffffff16613ca2565b60408051921515835260208301919091528051918290030190f35b34801561111457600080fd5b50610ae6613e29565b34801561112957600080fd5b506104776004803603604081101561114057600080fd5b506001600160a01b0381358116916020013516613e33565b34801561116457600080fd5b50610477613e8a565b34801561117957600080fd5b506105c76004803603602081101561119057600080fd5b50356001600160a01b0316613e93565b3480156111ac57600080fd5b50610572613ee9565b60035460009060ff16156111c857600080fd5b60035461010090046001600160a01b03166111e1614e49565b6040805163274a72b160e21b815263ffffffff8916600482015290516001600160a01b03841691639d29cac49160248083019260a0929190829003018186803b15801561122d57600080fd5b505afa158015611241573d6000803e3d6000fd5b505050506040513d60a081101561125757600080fd5b50805160208083015160408085015160608087015160809788015115159789019790975263ffffffff9687169088015290860152908401521680825261129c57600080fd5b60808101516112fa57601060006112b1613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615806112f0575063ffffffff87166000908152600f602052604090205460ff16155b156112fa57600080fd5b6020810151606082015163ffffffff161561133a576012546060830151602084015161ffff9092169160001990910163ffffffff16028161133757fe5b04015b61135f611345613ef8565b6012546201000090046001600160a01b0316903088613f55565b806011548601101561137057600080fd5b60405163fc4d20f560e01b815263ffffffff8916600482019081526001600160a01b038b81166024840152606060448401908152606484018a90526000939187169263fc4d20f5928d928f928e928e9290608401848480828437600081840152601f19601f82011690508083019250505095505050505050602060405180830381600087803b15801561140257600080fd5b505af1158015611416573d6000803e3d6000fd5b505050506040513d602081101561142c57600080fd5b5051600d54909150600090611452908c906000194301906001600160401b03861661200d565b600d5560005b60068110156115a257604080516362b21ad760e01b81526002600482015263ffffffff8d1660248201526044810183905290516001600160a01b038816916362b21ad7916064808301926020929190829003018186803b1580156114bb57600080fd5b505afa1580156114cf573d6000803e3d6000fd5b505050506040513d60208110156114e557600080fd5b5051600d5460209006019150856001600160a01b03166326bda739600385856040518463ffffffff1660e01b81526004018084600481111561152357fe5b60ff168152602001836001600160401b03166001600160401b031681526020018260ff1660ff1681526020019350505050602060405180830381600087803b15801561156e57600080fd5b505af1158015611582573d6000803e3d6000fd5b505050506040513d602081101561159857600080fd5b5050600101611458565b506040516001600160401b038316906001600160a01b038d169060009060008051602061508a833981519152908290a4506001600160401b03169998505050505050505050565b6001600160e01b03191660009081526020819052604090205460ff1690565b60035460009061010090046001600160a01b0316611624614e77565b604080516239012360e51b81526001600160401b038616600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b15801561167257600080fd5b505afa158015611686573d6000803e3d6000fd5b505050506040513d60e081101561169c57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086015292909216918301919091526001600160401b0316815261170f614eba565b608082015160009061172090613975565b60ff169450600090505b60068110156117d857604080516362b21ad760e01b8152600360048201526001600160401b03881660248201526044810183905290516001600160a01b038616916362b21ad7916064808301926020929190829003018186803b15801561179057600080fd5b505afa1580156117a4573d6000803e3d6000fd5b505050506040513d60208110156117ba57600080fd5b505160ff168282600681106117cb57fe5b602002015260010161172a565b5060005b600681101561189557602083810151604080516362b21ad760e01b81526001600482015263ffffffff9092166024830152604482018490525187926001600160a01b038816926362b21ad79260648083019392829003018186803b15801561184357600080fd5b505afa158015611857573d6000803e3d6000fd5b505050506040513d602081101561186d57600080fd5b505160ff160260030282826006811061188257fe5b60200201805190910190526001016117dc565b5060a081015160808201516060830151604084015160208501519451600695010101010104949350505050565b60088054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561194e5780601f106119235761010080835404028352916020019161194e565b820191906000526020600020905b81548152906001019060200180831161193157829003601f168201915b5050505050905090565b60035460009061010090046001600160a01b0316611974614e77565b604080516239012360e51b81526001600160401b038616600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156119c257600080fd5b505afa1580156119d6573d6000803e3d6000fd5b505050506040513d60e08110156119ec57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b03168252611a5d57600080fd5b5050506000908152600660205260409020546001600160a01b031690565b60035461010090046001600160a01b0316611a94614e77565b604080516239012360e51b81526001600160401b038516600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b158015611ae257600080fd5b505afa158015611af6573d6000803e3d6000fd5b505050506040513d60e0811015611b0c57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b03168252611b7d57600080fd5b611b8a8160400151613faf565b600480546005548351604080516335f097f360e01b81526001600160401b039092169482019490945292516001600160a01b0392831693919092169183916335f097f3916024808301926020929190829003018186803b158015611bed57600080fd5b505afa158015611c01573d6000803e3d6000fd5b505050506040513d6020811015611c1757600080fd5b505180611c9d5750825160408051632a11e9c760e21b81526001600160401b039092166004830152516001600160a01b0383169163a847a71c916024808301926020929190829003018186803b158015611c7057600080fd5b505afa158015611c84573d6000803e3d6000fd5b505050506040513d6020811015611c9a57600080fd5b50515b15611ca757600080fd5b82604001516001600160a01b0316866001600160a01b03161415611cca57600080fd5b60008581526006602052604080822080546001600160a01b0319166001600160a01b038a811691821790925586830151925189949193909216917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050505050565b6001546000906001600160a01b0316611d47613ef8565b6001600160a01b03161480611d86575060026000611d63613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b611d8f57600080fd5b60035460405163fc4d20f560e01b815263ffffffff8716600482019081526001600160a01b038781166024840152606060448401908152606484018790526101009094041692600092849263fc4d20f5928b928b928b928b92608401848480828437600081840152601f19601f82011690508083019250505095505050505050602060405180830381600087803b158015611e2957600080fd5b505af1158015611e3d573d6000803e3d6000fd5b505050506040513d6020811015611e5357600080fd5b5051600d54909150600090611e799088906000194301906001600160401b03861661200d565b600d5560005b6006811015611fc957604080516362b21ad760e01b81526002600482015263ffffffff8b1660248201526044810183905290516001600160a01b038616916362b21ad7916064808301926020929190829003018186803b158015611ee257600080fd5b505afa158015611ef6573d6000803e3d6000fd5b505050506040513d6020811015611f0c57600080fd5b5051600d5460209006019150836001600160a01b03166326bda739600385856040518463ffffffff1660e01b815260040180846004811115611f4a57fe5b60ff168152602001836001600160401b03166001600160401b031681526020018260ff1660ff1681526020019350505050602060405180830381600087803b158015611f9557600080fd5b505af1158015611fa9573d6000803e3d6000fd5b505050506040513d6020811015611fbf57600080fd5b5050600101611e7f565b506040516001600160401b038316906001600160a01b0389169060009060008051602061508a833981519152908290a4506001600160401b03169695505050505050565b60408051934060208086019190915260609590951b6bffffffffffffffffffffffff19168482015260548401929092526074808401919091528151808403909101815260949092019052805191012090565b6001546001600160a01b0316612073613ef8565b6001600160a01b031614806120b257506002600061208f613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b6120bb57600080fd5b600380546001600160a01b0394851661010002610100600160a81b0319909116179055600480549284166001600160a01b031993841617905560058054919093169116179055565b606061210d614ed8565b50604080516060810182526001600160a01b0388166000818152600c60209081529084902054835282015290810186905261214b8782878787614019565b6121865760405162461bcd60e51b81526004018080602001828103825260218152602001806150696021913960400191505060405180910390fd5b6001600160a01b0387166000908152600c60205260409020546121b090600163ffffffff6140f616565b6001600160a01b0388166000818152600c602090815260408083209490945583519283523383820181905260609484018581528b51958501959095528a517f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b958d9592948d94919260808501928601918190849084905b8381101561223f578181015183820152602001612227565b50505050905090810190601f16801561226c5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a160006060306001600160a01b0316888a6040516020018083805190602001908083835b602083106122bd5780518252601f19909201916020918201910161229e565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b03166001600160a01b031660601b8152601401925050506040516020818303038152906040526040518082805190602001908083835b6020831061233c5780518252601f19909201916020918201910161231d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461239e576040519150601f19603f3d011682016040523d82523d6000602084013e6123a3565b606091505b5091509150816123fa576040805162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c00000000604482015290519081900360640190fd5b98975050505050505050565b60035461010090046001600160a01b031681565b604051806040016040528060018152602001603160f81b81525081565b60026020526000908152604090205460ff1681565b6001546001600160a01b0316612460613ef8565b6001600160a01b0316148061249f57506002600061247c613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b6124a857600080fd5b6124e88383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061415792505050565b505050565b600080600360019054906101000a90046001600160a01b03169050806001600160a01b0316637a09defe6040518163ffffffff1660e01b815260040160206040518083038186803b15801561254157600080fd5b505afa158015612555573d6000803e3d6000fd5b505050506040513d602081101561256b57600080fd5b50519150505b90565b600b5490565b60035461010090046001600160a01b0316612593614e77565b604080516239012360e51b81526001600160401b038516600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156125e157600080fd5b505afa1580156125f5573d6000803e3d6000fd5b505050506040513d60e081101561260b57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b0316825261267c57600080fd5b61268a838260400151614176565b846001600160a01b031681604001516001600160a01b0316146126ac57600080fd5b6001600160a01b0384166126bf57600080fd5b6126ce81604001518585614338565b5050505050565b6001600160a01b03166000908152600c602052604090205490565b60006001600160a01b03831661270557600080fd5b600354604080516375fe2e3360e01b81526001600160a01b0386811660048301526024820186905291516101009093049091169182916375fe2e33916044808301926020929190829003018186803b15801561276057600080fd5b505afa158015612774573d6000803e3d6000fd5b505050506040513d602081101561278a57600080fd5b50516001600160401b03169150505b92915050565b6001546001600160a01b03166127b3613ef8565b6001600160a01b031614806127f25750600260006127cf613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b6127fb57600080fd5b60016064805b60648360ff16116124e85760ff83166000908152600e60205260409020805463ffffffff191663ffffffff83811691909117909155600190930192600a90600b8402160460050191508181019050612801565b4690565b6000806000806000806000806000600360019054906101000a90046001600160a01b03169050612886614e77565b604080516239012360e51b81526001600160401b038d16600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156128d457600080fd5b505afa1580156128e8573d6000803e3d6000fd5b505050506040513d60e08110156128fe57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086015292909216918301919091526001600160401b03168152612971614eba565b608082015160009061298290613975565b60ff169a50600090505b6006811015612a5257836001600160a01b03166362b21ad760038f846040518463ffffffff1660e01b8152600401808460048111156129c757fe5b60ff168152602001836001600160401b03166001600160401b03168152602001828152602001935050505060206040518083038186803b158015612a0a57600080fd5b505afa158015612a1e573d6000803e3d6000fd5b505050506040513d6020811015612a3457600080fd5b505160ff16828260068110612a4557fe5b602002015260010161298c565b5060005b6006811015612b0f57602083810151604080516362b21ad760e01b81526001600482015263ffffffff909216602483015260448201849052518d926001600160a01b038816926362b21ad79260648083019392829003018186803b158015612abd57600080fd5b505afa158015612ad1573d6000803e3d6000fd5b505050506040513d6020811015612ae757600080fd5b505160ff1602600302828260068110612afc57fe5b6020020180519091019052600101612a56565b60808301518b8360006020020151846001602002015185600260200201518660036020020151876004602002015188600560200201518763ffffffff1697509b509b509b509b509b509b509b509b5050505050919395975091939597565b6012546201000090046001600160a01b031681565b6004546001600160a01b031681565b6124e883838360405180602001604052806000815250614464565b6001546001600160a01b0316612bc0613ef8565b6001600160a01b03161480612bff575060026000612bdc613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b612c0857600080fd5b63ffffffff919091166000908152600f60205260409020805460ff1916911515919091179055565b602081565b600154600160a01b900461ffff1681565b6001546001600160a01b0316612c5a613ef8565b6001600160a01b031614612c6d57600080fd5b601254604080516370a0823160e01b815230600482015290516000926201000090046001600160a01b0316916370a08231916024808301926020929190829003018186803b158015612cbe57600080fd5b505afa158015612cd2573d6000803e3d6000fd5b505050506040513d6020811015612ce857600080fd5b5051905080821115612cf957600080fd5b6012546124e8906201000090046001600160a01b03168484614711565b6001546001600160a01b0316612d2a613ef8565b6001600160a01b03161480612d69575060026000612d46613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b612d7257600080fd5b6012805461ffff191661ffff92909216919091179055565b60035460009061010090046001600160a01b0316612da6614e77565b604080516239012360e51b81526001600160401b038616600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b158015612df457600080fd5b505afa158015612e08573d6000803e3d6000fd5b505050506040513d60e0811015612e1e57600080fd5b5080516020808301516040840151606085015160808087015160a08089015160c0998a015160e08c015263ffffffff908116998b019990995290881690890152908616908701529316908401526001600160401b0316825292506001600160a01b038316612e8b57600080fd5b5050919050565b6001546001600160a01b0316612ea6613ef8565b6001600160a01b031614612eb957600080fd5b6001600160a01b03811660009081526002602052604090205460ff16612f22576001600160a01b0381166000908152600260205260409020805460ff19166001908117909155805461ffff600160a01b808304821684019091160261ffff60a01b199091161790555b50565b60006001600160a01b038216612f3a57600080fd5b600354604080516311f05eeb60e21b81526001600160a01b03858116600483015291516101009093049091169182916347c17bac916024808301926020929190829003018186803b158015612f8e57600080fd5b505afa158015612fa2573d6000803e3d6000fd5b505050506040513d6020811015612fb857600080fd5b50519392505050565b600e6020526000908152604090205463ffffffff1681565b6001546001600160a01b0316612fed613ef8565b6001600160a01b0316148061302c575060026000613009613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b61303557600080fd5b612f2281614763565b6001546001600160a01b0316613052613ef8565b6001600160a01b0316148061309157506002600061306e613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b61309a57600080fd5b601155565b6001546001600160a01b03166130b3613ef8565b6001600160a01b031614806130f25750600260006130cf613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b6130fb57600080fd5b612f22816001600160401b031661479e565b60035460009061010090046001600160a01b0316613129614e77565b604080516239012360e51b81526001600160401b038616600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b15801561317757600080fd5b505afa15801561318b573d6000803e3d6000fd5b505050506040513d60e08110156131a157600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086015292909216918301919091526001600160401b039081168083529085161461322257600092505050612799565b846001600160a01b031681604001516001600160a01b03161461324a57600092505050612799565b600480546005548351604080516335f097f360e01b81526001600160401b039092169482019490945292516001600160a01b0392831693919092169183916335f097f3916024808301926020929190829003018186803b1580156132ad57600080fd5b505afa1580156132c1573d6000803e3d6000fd5b505050506040513d60208110156132d757600080fd5b50511580156133605750825160408051632a11e9c760e21b81526001600160401b039092166004830152516001600160a01b0383169163a847a71c916024808301926020929190829003018186803b15801561333257600080fd5b505afa158015613346573d6000803e3d6000fd5b505050506040513d602081101561335c57600080fd5b5051155b979650505050505050565b60035460ff161561337b57600080fd5b60035461010090046001600160a01b0316613394614e77565b604080516239012360e51b81526001600160401b038716600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156133e257600080fd5b505afa1580156133f6573d6000803e3d6000fd5b505050506040513d60e081101561340c57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086015292909216918301919091526001600160401b039081168083529086161415806134a7575061348d613ef8565b6001600160a01b031681604001516001600160a01b031614155b156134b157600080fd5b608081015160a08083015160c08401516040516332666a3160e01b81526001600160401b038a166004820190815263ffffffff80871660448401528085166064840152831660848301526024820194855260a482018990526001600160a01b038816956332666a31958c958c958c959394919390929060c401878780828437600081840152601f19601f820116905080830192505050975050505050505050600060405180830381600087803b15801561356a57600080fd5b505af115801561357e573d6000803e3d6000fd5b505050505050505050565b6001546001600160a01b031681565b60035460009081908190819061010090046001600160a01b03166135ba614e49565b6040805163274a72b160e21b815263ffffffff8916600482015290516001600160a01b03841691639d29cac49160248083019260a0929190829003018186803b15801561360657600080fd5b505afa15801561361a573d6000803e3d6000fd5b505050506040513d60a081101561363057600080fd5b508051602080830151604080850151606080870151608097880151151597890188905263ffffffff90811691890182905292880182905293870183905293169094529299909850919650945092505050565b60098054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561194e5780601f106119235761010080835404028352916020019161194e565b6001600160a01b0382166136f657600080fd5b8060076000613703613ef8565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155613747613ef8565b60408051841515815290516001600160a01b0392909216917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319181900360200190a35050565b60035461010090046001600160a01b03166137a6614e77565b604080516239012360e51b81526001600160401b038516600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156137f457600080fd5b505afa158015613808573d6000803e3d6000fd5b505050506040513d60e081101561381e57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b0316825261388f57600080fd5b61389d838260400151614176565b6138a5613ef8565b6001600160a01b031681604001516001600160a01b0316146138c657600080fd5b6001600160a01b0384166138d957600080fd5b6138e881604001518585614338565b50505050565b6001546001600160a01b0316613902613ef8565b6001600160a01b0316148061394157506002600061391e613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b61394a57600080fd5b6001600160a01b03919091166000908152601060205260409020805460ff1916911515919091179055565b600060016064825b8160ff168360ff1610156139cf57600260ff848401160460ff81166000908152600e602052604090205490915063ffffffff90811690861610156139c3578091506139ca565b8060010192505b61397d565b50909392505050565b6126ce85858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061446492505050565b6001546001600160a01b0316613a2e613ef8565b6001600160a01b031614613a4157600080fd5b6001546001600160a01b0316ff5b60115481565b6001546001600160a01b0316613a69613ef8565b6001600160a01b03161480613aa8575060026000613a85613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b613ab157600080fd5b613aba81614763565b80826001600160a01b0316846001600160a01b031660008051602061508a83398151915260405160405180910390a4505050565b6000818152600a602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015613b835780601f10613b5857610100808354040283529160200191613b83565b820191906000526020600020905b815481529060010190602001808311613b6657829003601f168201915b50505050509050919050565b6000806000806000806000600360019054906101000a90046001600160a01b03169050613bba614eba565b60005b6006811015613c6b57604080516362b21ad760e01b8152600360048201526001600160401b038c1660248201526044810183905290516001600160a01b038516916362b21ad7916064808301926020929190829003018186803b158015613c2357600080fd5b505afa158015613c37573d6000803e3d6000fd5b505050506040513d6020811015613c4d57600080fd5b505160ff16828260068110613c5e57fe5b6020020152600101613bbd565b508051602082015160408301516060840151608085015160a090950151939d929c50909a509850919650945092505050565b600681565b600354600090819061010090046001600160a01b0316613cc0614e49565b6040805163274a72b160e21b815263ffffffff8716600482015290516001600160a01b03841691639d29cac49160248083019260a0929190829003018186803b158015613d0c57600080fd5b505afa158015613d20573d6000803e3d6000fd5b505050506040513d60a0811015613d3657600080fd5b50805160208083015160408085015160608087015160809788015115159789019790975263ffffffff9687169088018190529187015291850181905292909116835290935015613dae576012546060820151602083015161ffff9092169160001990910163ffffffff160281613da857fe5b04830192505b6080810151613e1c5760106000613dc3613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001148015613e0b575063ffffffff85166000908152600f602052604090205460ff1615156001145b15613e1c575060019250613e249050565b608001519250505b915091565b60125461ffff1681565b60006001600160a01b038316613e4857600080fd5b6001600160a01b038216613e5b57600080fd5b506001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b60035460ff1681565b6001546001600160a01b0316613ea7613ef8565b6001600160a01b031614613eba57600080fd5b6001600160a01b03811615612f2257600180546001600160a01b0383166001600160a01b031990911617905550565b6005546001600160a01b031681565b600033301415613f505760606000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506125719050565b503390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526138e89085906147e5565b613fb7613ef8565b6001600160a01b0316816001600160a01b0316148061401057506001600160a01b038116600090815260076020526040812090613ff2613ef8565b6001600160a01b0316815260208101919091526040016000205460ff165b612f2257600080fd5b60006001600160a01b0386166140605760405162461bcd60e51b81526004018080602001828103825260258152602001806150446025913960400191505060405180910390fd5b600161407361406e87614896565b614922565b83868660405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156140cd573d6000803e3d6000fd5b505050602060405103516001600160a01b0316866001600160a01b031614905095945050505050565b600082820183811015614150576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000828152600a6020908152604090912082516124e892840190614f02565b60048054600554604080516335f097f360e01b81526001600160401b03871694810194909452516001600160a01b0392831693919092169183916335f097f3916024808301926020929190829003018186803b1580156141d557600080fd5b505afa1580156141e9573d6000803e3d6000fd5b505050506040513d60208110156141ff57600080fd5b5051158015614286575060408051632a11e9c760e21b81526001600160401b038616600482015290516001600160a01b0383169163a847a71c916024808301926020929190829003018186803b15801561425857600080fd5b505afa15801561426c573d6000803e3d6000fd5b505050506040513d602081101561428257600080fd5b5051155b61428f57600080fd5b6001600160a01b0383166142a257600080fd5b6142aa613ef8565b6001600160a01b0316836001600160a01b031614806142ea57506142cc613ef8565b6000858152600660205260409020546001600160a01b039081169116145b8061432f57506001600160a01b038316600090815260076020526040812090614311613ef8565b6001600160a01b0316815260208101919091526040016000205460ff165b6138e857600080fd5b61434181614763565b60035460408051633063665960e11b81526001600160a01b0386811660048301526001600160401b038516602483015291516101009093049091169182916360c6ccb291604480830192600092919082900301818387803b1580156143a557600080fd5b505af11580156143b9573d6000803e3d6000fd5b50506040805163492400cf60e11b81526001600160a01b0387811660048301526001600160401b038716602483015291519185169350639248019e925060448082019260009290919082900301818387803b15801561441757600080fd5b505af115801561442b573d6000803e3d6000fd5b5050505081836001600160a01b0316856001600160a01b031660008051602061508a83398151915260405160405180910390a450505050565b60035461010090046001600160a01b031661447d614e77565b604080516239012360e51b81526001600160401b038616600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156144cb57600080fd5b505afa1580156144df573d6000803e3d6000fd5b505050506040513d60e08110156144f557600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b0316825261456657600080fd5b614574848260400151614176565b856001600160a01b031681604001516001600160a01b03161461459657600080fd5b6001600160a01b0385166145a957600080fd5b6145b881604001518686614338565b6145ca856001600160a01b031661496e565b15614709576000856001600160a01b031663150b7a026145e8613ef8565b8988886040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561466d578181015183820152602001614655565b50505050905090810190601f16801561469a5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b1580156146bc57600080fd5b505af11580156146d0573d6000803e3d6000fd5b505050506040513d60208110156146e657600080fd5b505190506001600160e01b03198116630a85bd0160e11b1461470757600080fd5b505b505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526124e89084906147e5565b6000818152600660205260409020546001600160a01b031615612f2257600090815260066020526040902080546001600160a01b0319169055565b6147a781614974565b6000818152600a60205260409020546002600019610100600184161502019091160415612f22576000818152600a60205260408120612f2291614f80565b606061483a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c429092919063ffffffff16565b8051909150156124e85780806020019051602081101561485957600080fd5b50516124e85760405162461bcd60e51b815260040180806020018281038252602a8152602001806150aa602a913960400191505060405180910390fd5b6000604051806080016040528060438152602001614fdb60439139805190602001208260000151836020015184604001518051906020012060405160200180858152602001848152602001836001600160a01b03166001600160a01b03168152602001828152602001945050505050604051602081830303815290604052805190602001209050919050565b600061492c612574565b82604051602001808061190160f01b81525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b3b151590565b61497d81614763565b60035461010090046001600160a01b0316614996614e77565b604080516239012360e51b81526001600160401b038516600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156149e457600080fd5b505afa1580156149f8573d6000803e3d6000fd5b505050506040513d60e0811015614a0e57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b03168252614a7f57600080fd5b600480546005548351604080516335f097f360e01b81526001600160401b039092169482019490945292516001600160a01b0392831693919092169183916335f097f3916024808301926020929190829003018186803b158015614ae257600080fd5b505afa158015614af6573d6000803e3d6000fd5b505050506040513d6020811015614b0c57600080fd5b505180614b925750825160408051632a11e9c760e21b81526001600160401b039092166004830152516001600160a01b0383169163a847a71c916024808301926020929190829003018186803b158015614b6557600080fd5b505afa158015614b79573d6000803e3d6000fd5b505050506040513d6020811015614b8f57600080fd5b50515b15614b9c57600080fd5b6040808401518151633063665960e11b81526001600160a01b0391821660048201526001600160401b03881660248201529151908616916360c6ccb291604480830192600092919082900301818387803b158015614bf957600080fd5b505af1158015614c0d573d6000803e3d6000fd5b50505060408085015190518792506000916001600160a01b03169060008051602061508a833981519152908390a45050505050565b6060614c518484600085614c59565b949350505050565b606082471015614c9a5760405162461bcd60e51b815260040180806020018281038252602681526020018061501e6026913960400191505060405180910390fd5b614ca38561496e565b614cf4576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310614d335780518252601f199092019160209182019101614d14565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114614d95576040519150601f19603f3d011682016040523d82523d6000602084013e614d9a565b606091505b509150915061336082828660608315614db4575081614150565b825115614dc45782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614e0e578181015183820152602001614df6565b50505050905090810190601f168015614e3b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b60408051610100810182526000808252602082018190529181018290526060808201526080810182905260a0810182905260c0810182905260e081019190915290565b6040518060c001604052806006906020820280368337509192915050565b60405180606001604052806000815260200160006001600160a01b03168152602001606081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10614f4357805160ff1916838001178555614f70565b82800160010185558215614f70579182015b82811115614f70578251825591602001919060010190614f55565b50614f7c929150614fc0565b5090565b50805460018160011615610100020316600290046000825580601f10614fa65750612f22565b601f016020900490600052602060002090810190612f2291905b61257191905b80821115614f7c5760008155600101614fc656fe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c4e61746976654d6574615472616e73616374696f6e3a20494e56414c49445f5349474e45525369676e657220616e64207369676e617475726520646f206e6f74206d61746368ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212200f599e4a1d424613a23418db35e22d691338b6c0f8115fc2bf8502ceae35454564736f6c63430006060033454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c6164647265737320766572696679696e67436f6e74726163742c627974657333322073616c742900000000000000000000000000000000000000000000000000000000000000400000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f619000000000000000000000000000000000000000000000000000000000000000845544845524d4f4e000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106103965760003560e01c806357918052116101dc578063af4c14ee11610102578063d29cbd60116100a0578063e985e9c51161006f578063e985e9c51461111d578063ee4e441614611158578063f28532921461116d578063ffa640d8146111a057610396565b8063d29cbd6014611042578063d98e14bd146110a8578063da26663a146110bd578063e19bb9641461110857610396565b8063be26733c116100dc578063be26733c14610fab578063c10be52114610fc0578063c463b00814610fd5578063c87b56dd1461101857610396565b8063af4c14ee14610ea5578063b2cad9b714610ee0578063b88d4fde14610f1057610396565b806381b230421161017a57806394f6ba1c1161014957806394f6ba1c14610dc457806395d89b4114610e1c578063a22cb46514610e31578063a9059cbb14610e6c57610396565b806381b2304214610cb85780638a0520fb14610ceb5780638d1d22d814610d245780638da5cb5b14610daf57610396565b806370a08231116101b657806370a0823114610beb57806378b475a814610c1e5780637fdd540314610c64578063817e9d3114610c8e57610396565b80635791805214610b605780636352211e14610b8e5780636c81fd6d14610bb857610396565b806320379ee5116102c15780633fc8cef31161025f5780634e3dc2f11161022e5780634e3dc2f114610aa65780634efb023e14610ad15780634f6ccce714610afd578063522f681514610b2757610396565b80633fc8cef314610a01578063423b1ca314610a1657806342842e0e14610a2b5780634661bb9814610a6e57610396565b80632f745c591161029b5780632f745c591461092a57806333ced321146109635780633408e470146109785780633c6e59271461098d57610396565b806320379ee51461089f57806323b872dd146108b45780632d0335ab146108f757610396565b80630a92b264116103395780630f7e5970116103085780630f7e5970146107c057806314d0f1ba146107d5578063162094c41461080857806318160ddd1461088a57610396565b80630a92b2641461065f5780630afd548d146106a45780630c53c51c146106e95780630d668818146107ab57610396565b806306fdde031161037557806306fdde03146104be578063081812fc14610548578063095ea7b31461058e5780630963d4b7146105c957610396565b806225cdc81461039b57806301ffc9a7146104435780630672859b1461048b575b600080fd5b3480156103a757600080fd5b50610431600480360360808110156103be57600080fd5b6001600160a01b038235169163ffffffff60208201351691810190606081016040820135600160201b8111156103f357600080fd5b82018360208201111561040557600080fd5b803590602001918460018302840111600160201b8311171561042657600080fd5b9193509150356111b5565b60408051918252519081900360200190f35b34801561044f57600080fd5b506104776004803603602081101561046657600080fd5b50356001600160e01b0319166115e9565b604080519115158252519081900360200190f35b34801561049757600080fd5b50610431600480360360208110156104ae57600080fd5b50356001600160401b0316611608565b3480156104ca57600080fd5b506104d36118c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561050d5781810151838201526020016104f5565b50505050905090810190601f16801561053a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561055457600080fd5b506105726004803603602081101561056b57600080fd5b5035611958565b604080516001600160a01b039092168252519081900360200190f35b34801561059a57600080fd5b506105c7600480360360408110156105b157600080fd5b506001600160a01b038135169060200135611a7b565b005b3480156105d557600080fd5b50610431600480360360608110156105ec57600080fd5b63ffffffff823516916001600160a01b0360208201351691810190606081016040820135600160201b81111561062157600080fd5b82018360208201111561063357600080fd5b803590602001918460018302840111600160201b8311171561065457600080fd5b509092509050611d30565b34801561066b57600080fd5b506104316004803603608081101561068257600080fd5b506001600160a01b03813516906020810135906040810135906060013561200d565b3480156106b057600080fd5b506105c7600480360360608110156106c757600080fd5b506001600160a01b03813581169160208101358216916040909101351661205f565b6104d3600480360360a08110156106ff57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561072957600080fd5b82018360208201111561073b57600080fd5b803590602001918460018302840111600160201b8311171561075c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550508235935050506020810135906040013560ff16612103565b3480156107b757600080fd5b50610572612406565b3480156107cc57600080fd5b506104d361241a565b3480156107e157600080fd5b50610477600480360360208110156107f857600080fd5b50356001600160a01b0316612437565b34801561081457600080fd5b506105c76004803603604081101561082b57600080fd5b81359190810190604081016020820135600160201b81111561084c57600080fd5b82018360208201111561085e57600080fd5b803590602001918460018302840111600160201b8311171561087f57600080fd5b50909250905061244c565b34801561089657600080fd5b506104316124ed565b3480156108ab57600080fd5b50610431612574565b3480156108c057600080fd5b506105c7600480360360608110156108d757600080fd5b506001600160a01b0381358116916020810135909116906040013561257a565b34801561090357600080fd5b506104316004803603602081101561091a57600080fd5b50356001600160a01b03166126d5565b34801561093657600080fd5b506104316004803603604081101561094d57600080fd5b506001600160a01b0381351690602001356126f0565b34801561096f57600080fd5b506105c761279f565b34801561098457600080fd5b50610431612854565b34801561099957600080fd5b506109c0600480360360208110156109b057600080fd5b50356001600160401b0316612858565b604080519889526020890197909752878701959095526060870193909352608086019190915260a085015260c084015260e083015251908190036101000190f35b348015610a0d57600080fd5b50610572612b6d565b348015610a2257600080fd5b50610572612b82565b348015610a3757600080fd5b506105c760048036036060811015610a4e57600080fd5b506001600160a01b03813581169160208101359091169060400135612b91565b348015610a7a57600080fd5b506105c760048036036040811015610a9157600080fd5b5063ffffffff81351690602001351515612bac565b348015610ab257600080fd5b50610abb612c30565b6040805160ff9092168252519081900360200190f35b348015610add57600080fd5b50610ae6612c35565b6040805161ffff9092168252519081900360200190f35b348015610b0957600080fd5b5061043160048036036020811015610b2057600080fd5b5035612571565b348015610b3357600080fd5b506105c760048036036040811015610b4a57600080fd5b506001600160a01b038135169060200135612c46565b348015610b6c57600080fd5b506105c760048036036020811015610b8357600080fd5b503561ffff16612d16565b348015610b9a57600080fd5b5061057260048036036020811015610bb157600080fd5b5035612d8a565b348015610bc457600080fd5b506105c760048036036020811015610bdb57600080fd5b50356001600160a01b0316612e92565b348015610bf757600080fd5b5061043160048036036020811015610c0e57600080fd5b50356001600160a01b0316612f25565b348015610c2a57600080fd5b50610c4b60048036036020811015610c4157600080fd5b503560ff16612fc1565b6040805163ffffffff9092168252519081900360200190f35b348015610c7057600080fd5b506105c760048036036020811015610c8757600080fd5b5035612fd9565b348015610c9a57600080fd5b506105c760048036036020811015610cb157600080fd5b503561303e565b348015610cc457600080fd5b506105c760048036036020811015610cdb57600080fd5b50356001600160401b031661309f565b348015610cf757600080fd5b5061047760048036036040811015610d0e57600080fd5b506001600160a01b03813516906020013561310d565b348015610d3057600080fd5b506105c760048036036040811015610d4757600080fd5b6001600160401b038235169190810190604081016020820135600160201b811115610d7157600080fd5b820183602082011115610d8357600080fd5b803590602001918460018302840111600160201b83111715610da457600080fd5b50909250905061336b565b348015610dbb57600080fd5b50610572613589565b348015610dd057600080fd5b50610df460048036036020811015610de757600080fd5b503563ffffffff16613598565b6040805194855260208501939093528383019190915215156060830152519081900360800190f35b348015610e2857600080fd5b506104d3613682565b348015610e3d57600080fd5b506105c760048036036040811015610e5457600080fd5b506001600160a01b03813516906020013515156136e3565b348015610e7857600080fd5b506105c760048036036040811015610e8f57600080fd5b506001600160a01b03813516906020013561378d565b348015610eb157600080fd5b506105c760048036036040811015610ec857600080fd5b506001600160a01b03813516906020013515156138ee565b348015610eec57600080fd5b50610abb60048036036020811015610f0357600080fd5b503563ffffffff16613975565b348015610f1c57600080fd5b506105c760048036036080811015610f3357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b811115610f6d57600080fd5b820183602082011115610f7f57600080fd5b803590602001918460018302840111600160201b83111715610fa057600080fd5b5090925090506139d8565b348015610fb757600080fd5b506105c7613a1a565b348015610fcc57600080fd5b50610431613a4f565b348015610fe157600080fd5b506105c760048036036060811015610ff857600080fd5b506001600160a01b03813581169160208101359091169060400135613a55565b34801561102457600080fd5b506104d36004803603602081101561103b57600080fd5b5035613aee565b34801561104e57600080fd5b506110756004803603602081101561106557600080fd5b50356001600160401b0316613b8f565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b3480156110b457600080fd5b50610abb613c9d565b3480156110c957600080fd5b506110ed600480360360208110156110e057600080fd5b503563ffffffff16613ca2565b60408051921515835260208301919091528051918290030190f35b34801561111457600080fd5b50610ae6613e29565b34801561112957600080fd5b506104776004803603604081101561114057600080fd5b506001600160a01b0381358116916020013516613e33565b34801561116457600080fd5b50610477613e8a565b34801561117957600080fd5b506105c76004803603602081101561119057600080fd5b50356001600160a01b0316613e93565b3480156111ac57600080fd5b50610572613ee9565b60035460009060ff16156111c857600080fd5b60035461010090046001600160a01b03166111e1614e49565b6040805163274a72b160e21b815263ffffffff8916600482015290516001600160a01b03841691639d29cac49160248083019260a0929190829003018186803b15801561122d57600080fd5b505afa158015611241573d6000803e3d6000fd5b505050506040513d60a081101561125757600080fd5b50805160208083015160408085015160608087015160809788015115159789019790975263ffffffff9687169088015290860152908401521680825261129c57600080fd5b60808101516112fa57601060006112b1613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615806112f0575063ffffffff87166000908152600f602052604090205460ff16155b156112fa57600080fd5b6020810151606082015163ffffffff161561133a576012546060830151602084015161ffff9092169160001990910163ffffffff16028161133757fe5b04015b61135f611345613ef8565b6012546201000090046001600160a01b0316903088613f55565b806011548601101561137057600080fd5b60405163fc4d20f560e01b815263ffffffff8916600482019081526001600160a01b038b81166024840152606060448401908152606484018a90526000939187169263fc4d20f5928d928f928e928e9290608401848480828437600081840152601f19601f82011690508083019250505095505050505050602060405180830381600087803b15801561140257600080fd5b505af1158015611416573d6000803e3d6000fd5b505050506040513d602081101561142c57600080fd5b5051600d54909150600090611452908c906000194301906001600160401b03861661200d565b600d5560005b60068110156115a257604080516362b21ad760e01b81526002600482015263ffffffff8d1660248201526044810183905290516001600160a01b038816916362b21ad7916064808301926020929190829003018186803b1580156114bb57600080fd5b505afa1580156114cf573d6000803e3d6000fd5b505050506040513d60208110156114e557600080fd5b5051600d5460209006019150856001600160a01b03166326bda739600385856040518463ffffffff1660e01b81526004018084600481111561152357fe5b60ff168152602001836001600160401b03166001600160401b031681526020018260ff1660ff1681526020019350505050602060405180830381600087803b15801561156e57600080fd5b505af1158015611582573d6000803e3d6000fd5b505050506040513d602081101561159857600080fd5b5050600101611458565b506040516001600160401b038316906001600160a01b038d169060009060008051602061508a833981519152908290a4506001600160401b03169998505050505050505050565b6001600160e01b03191660009081526020819052604090205460ff1690565b60035460009061010090046001600160a01b0316611624614e77565b604080516239012360e51b81526001600160401b038616600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b15801561167257600080fd5b505afa158015611686573d6000803e3d6000fd5b505050506040513d60e081101561169c57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086015292909216918301919091526001600160401b0316815261170f614eba565b608082015160009061172090613975565b60ff169450600090505b60068110156117d857604080516362b21ad760e01b8152600360048201526001600160401b03881660248201526044810183905290516001600160a01b038616916362b21ad7916064808301926020929190829003018186803b15801561179057600080fd5b505afa1580156117a4573d6000803e3d6000fd5b505050506040513d60208110156117ba57600080fd5b505160ff168282600681106117cb57fe5b602002015260010161172a565b5060005b600681101561189557602083810151604080516362b21ad760e01b81526001600482015263ffffffff9092166024830152604482018490525187926001600160a01b038816926362b21ad79260648083019392829003018186803b15801561184357600080fd5b505afa158015611857573d6000803e3d6000fd5b505050506040513d602081101561186d57600080fd5b505160ff160260030282826006811061188257fe5b60200201805190910190526001016117dc565b5060a081015160808201516060830151604084015160208501519451600695010101010104949350505050565b60088054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561194e5780601f106119235761010080835404028352916020019161194e565b820191906000526020600020905b81548152906001019060200180831161193157829003601f168201915b5050505050905090565b60035460009061010090046001600160a01b0316611974614e77565b604080516239012360e51b81526001600160401b038616600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156119c257600080fd5b505afa1580156119d6573d6000803e3d6000fd5b505050506040513d60e08110156119ec57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b03168252611a5d57600080fd5b5050506000908152600660205260409020546001600160a01b031690565b60035461010090046001600160a01b0316611a94614e77565b604080516239012360e51b81526001600160401b038516600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b158015611ae257600080fd5b505afa158015611af6573d6000803e3d6000fd5b505050506040513d60e0811015611b0c57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b03168252611b7d57600080fd5b611b8a8160400151613faf565b600480546005548351604080516335f097f360e01b81526001600160401b039092169482019490945292516001600160a01b0392831693919092169183916335f097f3916024808301926020929190829003018186803b158015611bed57600080fd5b505afa158015611c01573d6000803e3d6000fd5b505050506040513d6020811015611c1757600080fd5b505180611c9d5750825160408051632a11e9c760e21b81526001600160401b039092166004830152516001600160a01b0383169163a847a71c916024808301926020929190829003018186803b158015611c7057600080fd5b505afa158015611c84573d6000803e3d6000fd5b505050506040513d6020811015611c9a57600080fd5b50515b15611ca757600080fd5b82604001516001600160a01b0316866001600160a01b03161415611cca57600080fd5b60008581526006602052604080822080546001600160a01b0319166001600160a01b038a811691821790925586830151925189949193909216917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050505050565b6001546000906001600160a01b0316611d47613ef8565b6001600160a01b03161480611d86575060026000611d63613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b611d8f57600080fd5b60035460405163fc4d20f560e01b815263ffffffff8716600482019081526001600160a01b038781166024840152606060448401908152606484018790526101009094041692600092849263fc4d20f5928b928b928b928b92608401848480828437600081840152601f19601f82011690508083019250505095505050505050602060405180830381600087803b158015611e2957600080fd5b505af1158015611e3d573d6000803e3d6000fd5b505050506040513d6020811015611e5357600080fd5b5051600d54909150600090611e799088906000194301906001600160401b03861661200d565b600d5560005b6006811015611fc957604080516362b21ad760e01b81526002600482015263ffffffff8b1660248201526044810183905290516001600160a01b038616916362b21ad7916064808301926020929190829003018186803b158015611ee257600080fd5b505afa158015611ef6573d6000803e3d6000fd5b505050506040513d6020811015611f0c57600080fd5b5051600d5460209006019150836001600160a01b03166326bda739600385856040518463ffffffff1660e01b815260040180846004811115611f4a57fe5b60ff168152602001836001600160401b03166001600160401b031681526020018260ff1660ff1681526020019350505050602060405180830381600087803b158015611f9557600080fd5b505af1158015611fa9573d6000803e3d6000fd5b505050506040513d6020811015611fbf57600080fd5b5050600101611e7f565b506040516001600160401b038316906001600160a01b0389169060009060008051602061508a833981519152908290a4506001600160401b03169695505050505050565b60408051934060208086019190915260609590951b6bffffffffffffffffffffffff19168482015260548401929092526074808401919091528151808403909101815260949092019052805191012090565b6001546001600160a01b0316612073613ef8565b6001600160a01b031614806120b257506002600061208f613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b6120bb57600080fd5b600380546001600160a01b0394851661010002610100600160a81b0319909116179055600480549284166001600160a01b031993841617905560058054919093169116179055565b606061210d614ed8565b50604080516060810182526001600160a01b0388166000818152600c60209081529084902054835282015290810186905261214b8782878787614019565b6121865760405162461bcd60e51b81526004018080602001828103825260218152602001806150696021913960400191505060405180910390fd5b6001600160a01b0387166000908152600c60205260409020546121b090600163ffffffff6140f616565b6001600160a01b0388166000818152600c602090815260408083209490945583519283523383820181905260609484018581528b51958501959095528a517f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b958d9592948d94919260808501928601918190849084905b8381101561223f578181015183820152602001612227565b50505050905090810190601f16801561226c5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a160006060306001600160a01b0316888a6040516020018083805190602001908083835b602083106122bd5780518252601f19909201916020918201910161229e565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b03166001600160a01b031660601b8152601401925050506040516020818303038152906040526040518082805190602001908083835b6020831061233c5780518252601f19909201916020918201910161231d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461239e576040519150601f19603f3d011682016040523d82523d6000602084013e6123a3565b606091505b5091509150816123fa576040805162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c00000000604482015290519081900360640190fd5b98975050505050505050565b60035461010090046001600160a01b031681565b604051806040016040528060018152602001603160f81b81525081565b60026020526000908152604090205460ff1681565b6001546001600160a01b0316612460613ef8565b6001600160a01b0316148061249f57506002600061247c613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b6124a857600080fd5b6124e88383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061415792505050565b505050565b600080600360019054906101000a90046001600160a01b03169050806001600160a01b0316637a09defe6040518163ffffffff1660e01b815260040160206040518083038186803b15801561254157600080fd5b505afa158015612555573d6000803e3d6000fd5b505050506040513d602081101561256b57600080fd5b50519150505b90565b600b5490565b60035461010090046001600160a01b0316612593614e77565b604080516239012360e51b81526001600160401b038516600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156125e157600080fd5b505afa1580156125f5573d6000803e3d6000fd5b505050506040513d60e081101561260b57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b0316825261267c57600080fd5b61268a838260400151614176565b846001600160a01b031681604001516001600160a01b0316146126ac57600080fd5b6001600160a01b0384166126bf57600080fd5b6126ce81604001518585614338565b5050505050565b6001600160a01b03166000908152600c602052604090205490565b60006001600160a01b03831661270557600080fd5b600354604080516375fe2e3360e01b81526001600160a01b0386811660048301526024820186905291516101009093049091169182916375fe2e33916044808301926020929190829003018186803b15801561276057600080fd5b505afa158015612774573d6000803e3d6000fd5b505050506040513d602081101561278a57600080fd5b50516001600160401b03169150505b92915050565b6001546001600160a01b03166127b3613ef8565b6001600160a01b031614806127f25750600260006127cf613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b6127fb57600080fd5b60016064805b60648360ff16116124e85760ff83166000908152600e60205260409020805463ffffffff191663ffffffff83811691909117909155600190930192600a90600b8402160460050191508181019050612801565b4690565b6000806000806000806000806000600360019054906101000a90046001600160a01b03169050612886614e77565b604080516239012360e51b81526001600160401b038d16600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156128d457600080fd5b505afa1580156128e8573d6000803e3d6000fd5b505050506040513d60e08110156128fe57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086015292909216918301919091526001600160401b03168152612971614eba565b608082015160009061298290613975565b60ff169a50600090505b6006811015612a5257836001600160a01b03166362b21ad760038f846040518463ffffffff1660e01b8152600401808460048111156129c757fe5b60ff168152602001836001600160401b03166001600160401b03168152602001828152602001935050505060206040518083038186803b158015612a0a57600080fd5b505afa158015612a1e573d6000803e3d6000fd5b505050506040513d6020811015612a3457600080fd5b505160ff16828260068110612a4557fe5b602002015260010161298c565b5060005b6006811015612b0f57602083810151604080516362b21ad760e01b81526001600482015263ffffffff909216602483015260448201849052518d926001600160a01b038816926362b21ad79260648083019392829003018186803b158015612abd57600080fd5b505afa158015612ad1573d6000803e3d6000fd5b505050506040513d6020811015612ae757600080fd5b505160ff1602600302828260068110612afc57fe5b6020020180519091019052600101612a56565b60808301518b8360006020020151846001602002015185600260200201518660036020020151876004602002015188600560200201518763ffffffff1697509b509b509b509b509b509b509b509b5050505050919395975091939597565b6012546201000090046001600160a01b031681565b6004546001600160a01b031681565b6124e883838360405180602001604052806000815250614464565b6001546001600160a01b0316612bc0613ef8565b6001600160a01b03161480612bff575060026000612bdc613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b612c0857600080fd5b63ffffffff919091166000908152600f60205260409020805460ff1916911515919091179055565b602081565b600154600160a01b900461ffff1681565b6001546001600160a01b0316612c5a613ef8565b6001600160a01b031614612c6d57600080fd5b601254604080516370a0823160e01b815230600482015290516000926201000090046001600160a01b0316916370a08231916024808301926020929190829003018186803b158015612cbe57600080fd5b505afa158015612cd2573d6000803e3d6000fd5b505050506040513d6020811015612ce857600080fd5b5051905080821115612cf957600080fd5b6012546124e8906201000090046001600160a01b03168484614711565b6001546001600160a01b0316612d2a613ef8565b6001600160a01b03161480612d69575060026000612d46613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b612d7257600080fd5b6012805461ffff191661ffff92909216919091179055565b60035460009061010090046001600160a01b0316612da6614e77565b604080516239012360e51b81526001600160401b038616600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b158015612df457600080fd5b505afa158015612e08573d6000803e3d6000fd5b505050506040513d60e0811015612e1e57600080fd5b5080516020808301516040840151606085015160808087015160a08089015160c0998a015160e08c015263ffffffff908116998b019990995290881690890152908616908701529316908401526001600160401b0316825292506001600160a01b038316612e8b57600080fd5b5050919050565b6001546001600160a01b0316612ea6613ef8565b6001600160a01b031614612eb957600080fd5b6001600160a01b03811660009081526002602052604090205460ff16612f22576001600160a01b0381166000908152600260205260409020805460ff19166001908117909155805461ffff600160a01b808304821684019091160261ffff60a01b199091161790555b50565b60006001600160a01b038216612f3a57600080fd5b600354604080516311f05eeb60e21b81526001600160a01b03858116600483015291516101009093049091169182916347c17bac916024808301926020929190829003018186803b158015612f8e57600080fd5b505afa158015612fa2573d6000803e3d6000fd5b505050506040513d6020811015612fb857600080fd5b50519392505050565b600e6020526000908152604090205463ffffffff1681565b6001546001600160a01b0316612fed613ef8565b6001600160a01b0316148061302c575060026000613009613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b61303557600080fd5b612f2281614763565b6001546001600160a01b0316613052613ef8565b6001600160a01b0316148061309157506002600061306e613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b61309a57600080fd5b601155565b6001546001600160a01b03166130b3613ef8565b6001600160a01b031614806130f25750600260006130cf613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b6130fb57600080fd5b612f22816001600160401b031661479e565b60035460009061010090046001600160a01b0316613129614e77565b604080516239012360e51b81526001600160401b038616600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b15801561317757600080fd5b505afa15801561318b573d6000803e3d6000fd5b505050506040513d60e08110156131a157600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086015292909216918301919091526001600160401b039081168083529085161461322257600092505050612799565b846001600160a01b031681604001516001600160a01b03161461324a57600092505050612799565b600480546005548351604080516335f097f360e01b81526001600160401b039092169482019490945292516001600160a01b0392831693919092169183916335f097f3916024808301926020929190829003018186803b1580156132ad57600080fd5b505afa1580156132c1573d6000803e3d6000fd5b505050506040513d60208110156132d757600080fd5b50511580156133605750825160408051632a11e9c760e21b81526001600160401b039092166004830152516001600160a01b0383169163a847a71c916024808301926020929190829003018186803b15801561333257600080fd5b505afa158015613346573d6000803e3d6000fd5b505050506040513d602081101561335c57600080fd5b5051155b979650505050505050565b60035460ff161561337b57600080fd5b60035461010090046001600160a01b0316613394614e77565b604080516239012360e51b81526001600160401b038716600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156133e257600080fd5b505afa1580156133f6573d6000803e3d6000fd5b505050506040513d60e081101561340c57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086015292909216918301919091526001600160401b039081168083529086161415806134a7575061348d613ef8565b6001600160a01b031681604001516001600160a01b031614155b156134b157600080fd5b608081015160a08083015160c08401516040516332666a3160e01b81526001600160401b038a166004820190815263ffffffff80871660448401528085166064840152831660848301526024820194855260a482018990526001600160a01b038816956332666a31958c958c958c959394919390929060c401878780828437600081840152601f19601f820116905080830192505050975050505050505050600060405180830381600087803b15801561356a57600080fd5b505af115801561357e573d6000803e3d6000fd5b505050505050505050565b6001546001600160a01b031681565b60035460009081908190819061010090046001600160a01b03166135ba614e49565b6040805163274a72b160e21b815263ffffffff8916600482015290516001600160a01b03841691639d29cac49160248083019260a0929190829003018186803b15801561360657600080fd5b505afa15801561361a573d6000803e3d6000fd5b505050506040513d60a081101561363057600080fd5b508051602080830151604080850151606080870151608097880151151597890188905263ffffffff90811691890182905292880182905293870183905293169094529299909850919650945092505050565b60098054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561194e5780601f106119235761010080835404028352916020019161194e565b6001600160a01b0382166136f657600080fd5b8060076000613703613ef8565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155613747613ef8565b60408051841515815290516001600160a01b0392909216917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319181900360200190a35050565b60035461010090046001600160a01b03166137a6614e77565b604080516239012360e51b81526001600160401b038516600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156137f457600080fd5b505afa158015613808573d6000803e3d6000fd5b505050506040513d60e081101561381e57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b0316825261388f57600080fd5b61389d838260400151614176565b6138a5613ef8565b6001600160a01b031681604001516001600160a01b0316146138c657600080fd5b6001600160a01b0384166138d957600080fd5b6138e881604001518585614338565b50505050565b6001546001600160a01b0316613902613ef8565b6001600160a01b0316148061394157506002600061391e613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b61394a57600080fd5b6001600160a01b03919091166000908152601060205260409020805460ff1916911515919091179055565b600060016064825b8160ff168360ff1610156139cf57600260ff848401160460ff81166000908152600e602052604090205490915063ffffffff90811690861610156139c3578091506139ca565b8060010192505b61397d565b50909392505050565b6126ce85858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061446492505050565b6001546001600160a01b0316613a2e613ef8565b6001600160a01b031614613a4157600080fd5b6001546001600160a01b0316ff5b60115481565b6001546001600160a01b0316613a69613ef8565b6001600160a01b03161480613aa8575060026000613a85613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001145b613ab157600080fd5b613aba81614763565b80826001600160a01b0316846001600160a01b031660008051602061508a83398151915260405160405180910390a4505050565b6000818152600a602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015613b835780601f10613b5857610100808354040283529160200191613b83565b820191906000526020600020905b815481529060010190602001808311613b6657829003601f168201915b50505050509050919050565b6000806000806000806000600360019054906101000a90046001600160a01b03169050613bba614eba565b60005b6006811015613c6b57604080516362b21ad760e01b8152600360048201526001600160401b038c1660248201526044810183905290516001600160a01b038516916362b21ad7916064808301926020929190829003018186803b158015613c2357600080fd5b505afa158015613c37573d6000803e3d6000fd5b505050506040513d6020811015613c4d57600080fd5b505160ff16828260068110613c5e57fe5b6020020152600101613bbd565b508051602082015160408301516060840151608085015160a090950151939d929c50909a509850919650945092505050565b600681565b600354600090819061010090046001600160a01b0316613cc0614e49565b6040805163274a72b160e21b815263ffffffff8716600482015290516001600160a01b03841691639d29cac49160248083019260a0929190829003018186803b158015613d0c57600080fd5b505afa158015613d20573d6000803e3d6000fd5b505050506040513d60a0811015613d3657600080fd5b50805160208083015160408085015160608087015160809788015115159789019790975263ffffffff9687169088018190529187015291850181905292909116835290935015613dae576012546060820151602083015161ffff9092169160001990910163ffffffff160281613da857fe5b04830192505b6080810151613e1c5760106000613dc3613ef8565b6001600160a01b0316815260208101919091526040016000205460ff1615156001148015613e0b575063ffffffff85166000908152600f602052604090205460ff1615156001145b15613e1c575060019250613e249050565b608001519250505b915091565b60125461ffff1681565b60006001600160a01b038316613e4857600080fd5b6001600160a01b038216613e5b57600080fd5b506001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b60035460ff1681565b6001546001600160a01b0316613ea7613ef8565b6001600160a01b031614613eba57600080fd5b6001600160a01b03811615612f2257600180546001600160a01b0383166001600160a01b031990911617905550565b6005546001600160a01b031681565b600033301415613f505760606000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506125719050565b503390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526138e89085906147e5565b613fb7613ef8565b6001600160a01b0316816001600160a01b0316148061401057506001600160a01b038116600090815260076020526040812090613ff2613ef8565b6001600160a01b0316815260208101919091526040016000205460ff165b612f2257600080fd5b60006001600160a01b0386166140605760405162461bcd60e51b81526004018080602001828103825260258152602001806150446025913960400191505060405180910390fd5b600161407361406e87614896565b614922565b83868660405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156140cd573d6000803e3d6000fd5b505050602060405103516001600160a01b0316866001600160a01b031614905095945050505050565b600082820183811015614150576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000828152600a6020908152604090912082516124e892840190614f02565b60048054600554604080516335f097f360e01b81526001600160401b03871694810194909452516001600160a01b0392831693919092169183916335f097f3916024808301926020929190829003018186803b1580156141d557600080fd5b505afa1580156141e9573d6000803e3d6000fd5b505050506040513d60208110156141ff57600080fd5b5051158015614286575060408051632a11e9c760e21b81526001600160401b038616600482015290516001600160a01b0383169163a847a71c916024808301926020929190829003018186803b15801561425857600080fd5b505afa15801561426c573d6000803e3d6000fd5b505050506040513d602081101561428257600080fd5b5051155b61428f57600080fd5b6001600160a01b0383166142a257600080fd5b6142aa613ef8565b6001600160a01b0316836001600160a01b031614806142ea57506142cc613ef8565b6000858152600660205260409020546001600160a01b039081169116145b8061432f57506001600160a01b038316600090815260076020526040812090614311613ef8565b6001600160a01b0316815260208101919091526040016000205460ff165b6138e857600080fd5b61434181614763565b60035460408051633063665960e11b81526001600160a01b0386811660048301526001600160401b038516602483015291516101009093049091169182916360c6ccb291604480830192600092919082900301818387803b1580156143a557600080fd5b505af11580156143b9573d6000803e3d6000fd5b50506040805163492400cf60e11b81526001600160a01b0387811660048301526001600160401b038716602483015291519185169350639248019e925060448082019260009290919082900301818387803b15801561441757600080fd5b505af115801561442b573d6000803e3d6000fd5b5050505081836001600160a01b0316856001600160a01b031660008051602061508a83398151915260405160405180910390a450505050565b60035461010090046001600160a01b031661447d614e77565b604080516239012360e51b81526001600160401b038616600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156144cb57600080fd5b505afa1580156144df573d6000803e3d6000fd5b505050506040513d60e08110156144f557600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b0316825261456657600080fd5b614574848260400151614176565b856001600160a01b031681604001516001600160a01b03161461459657600080fd5b6001600160a01b0385166145a957600080fd5b6145b881604001518686614338565b6145ca856001600160a01b031661496e565b15614709576000856001600160a01b031663150b7a026145e8613ef8565b8988886040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561466d578181015183820152602001614655565b50505050905090810190601f16801561469a5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b1580156146bc57600080fd5b505af11580156146d0573d6000803e3d6000fd5b505050506040513d60208110156146e657600080fd5b505190506001600160e01b03198116630a85bd0160e11b1461470757600080fd5b505b505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526124e89084906147e5565b6000818152600660205260409020546001600160a01b031615612f2257600090815260066020526040902080546001600160a01b0319169055565b6147a781614974565b6000818152600a60205260409020546002600019610100600184161502019091160415612f22576000818152600a60205260408120612f2291614f80565b606061483a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c429092919063ffffffff16565b8051909150156124e85780806020019051602081101561485957600080fd5b50516124e85760405162461bcd60e51b815260040180806020018281038252602a8152602001806150aa602a913960400191505060405180910390fd5b6000604051806080016040528060438152602001614fdb60439139805190602001208260000151836020015184604001518051906020012060405160200180858152602001848152602001836001600160a01b03166001600160a01b03168152602001828152602001945050505050604051602081830303815290604052805190602001209050919050565b600061492c612574565b82604051602001808061190160f01b81525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b3b151590565b61497d81614763565b60035461010090046001600160a01b0316614996614e77565b604080516239012360e51b81526001600160401b038516600482015290516001600160a01b0384169163072024609160248083019260e0929190829003018186803b1580156149e457600080fd5b505afa1580156149f8573d6000803e3d6000fd5b505050506040513d60e0811015614a0e57600080fd5b508051602080830151604080850151606086015160808088015160a0808a015160c09a8b015160e08d015263ffffffff9081169a8c019a909a52908916908a0152908716908801526001600160a01b03169086018190529316908401526001600160401b03168252614a7f57600080fd5b600480546005548351604080516335f097f360e01b81526001600160401b039092169482019490945292516001600160a01b0392831693919092169183916335f097f3916024808301926020929190829003018186803b158015614ae257600080fd5b505afa158015614af6573d6000803e3d6000fd5b505050506040513d6020811015614b0c57600080fd5b505180614b925750825160408051632a11e9c760e21b81526001600160401b039092166004830152516001600160a01b0383169163a847a71c916024808301926020929190829003018186803b158015614b6557600080fd5b505afa158015614b79573d6000803e3d6000fd5b505050506040513d6020811015614b8f57600080fd5b50515b15614b9c57600080fd5b6040808401518151633063665960e11b81526001600160a01b0391821660048201526001600160401b03881660248201529151908616916360c6ccb291604480830192600092919082900301818387803b158015614bf957600080fd5b505af1158015614c0d573d6000803e3d6000fd5b50505060408085015190518792506000916001600160a01b03169060008051602061508a833981519152908390a45050505050565b6060614c518484600085614c59565b949350505050565b606082471015614c9a5760405162461bcd60e51b815260040180806020018281038252602681526020018061501e6026913960400191505060405180910390fd5b614ca38561496e565b614cf4576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310614d335780518252601f199092019160209182019101614d14565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114614d95576040519150601f19603f3d011682016040523d82523d6000602084013e614d9a565b606091505b509150915061336082828660608315614db4575081614150565b825115614dc45782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614e0e578181015183820152602001614df6565b50505050905090810190601f168015614e3b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b60408051610100810182526000808252602082018190529181018290526060808201526080810182905260a0810182905260c0810182905260e081019190915290565b6040518060c001604052806006906020820280368337509192915050565b60405180606001604052806000815260200160006001600160a01b03168152602001606081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10614f4357805160ff1916838001178555614f70565b82800160010185558215614f70579182015b82811115614f70578251825591602001919060010190614f55565b50614f7c929150614fc0565b5090565b50805460018160011615610100020316600290046000825580601f10614fa65750612f22565b601f016020900490600052602060002090810190612f2291905b61257191905b80821115614f7c5760008155600101614fc656fe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c4e61746976654d6574615472616e73616374696f6e3a20494e56414c49445f5349474e45525369676e657220616e64207369676e617475726520646f206e6f74206d61746368ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212200f599e4a1d424613a23418db35e22d691338b6c0f8115fc2bf8502ceae35454564736f6c63430006060033

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

00000000000000000000000000000000000000000000000000000000000000400000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f619000000000000000000000000000000000000000000000000000000000000000845544845524d4f4e000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name (string): ETHERMON
Arg [1] : _weth (address): 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f619
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [3] : 45544845524d4f4e000000000000000000000000000000000000000000000000


Loading...
Loading
[ Download: CSV Export  ]
[ 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.