ETH Price: $2,605.02 (-1.94%)

Token

dloop Art Registry (DART)
 

Overview

Max Total Supply

402 DART

Holders

188

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
3 DART
0x824CF10dD61Fc1E74f588BF9b64eDAECb3098DB7
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

The elementum digital art market is the main brand and key solution provided by dloop ltd. The 'dloop Art Registry' represents the main platform smart contract that was initially used to mint historically significant NFTs by renowned visionaries in modern and contemporary art.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
DloopToken

Compiler Version
v0.5.17+commit.d19bba13

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Audited

Contract Source Code (Solidity)Audit Report

/**
 *Submitted for verification at Etherscan.io on 2020-08-22
*/

/**
Author: dloop ltd
Website: https://www.dloop.ch
Source Code & Licensing Agreement: https://github.com/dloop-ltd/art-registry
*/

pragma solidity 0.5.17;


/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }
    // solhint-disable-previous-line no-empty-blocks

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

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

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
contract IERC721 is IERC165 {
    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);

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

    /**
     * @dev Returns the owner of the NFT specified by `tokenId`.
     */
    function ownerOf(uint256 tokenId) public view returns (address owner);

    /**
     * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
     * another (`to`).
     *
     *
     *
     * Requirements:
     * - `from`, `to` cannot be zero.
     * - `tokenId` must be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this
     * NFT by either {approve} or {setApprovalForAll}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public;
    /**
     * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
     * another (`to`).
     *
     * Requirements:
     * - If the caller is not `from`, it must be approved to move this NFT by
     * either {approve} or {setApprovalForAll}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public;
    function approve(address to, uint256 tokenId) public;
    function getApproved(uint256 tokenId) public view returns (address operator);

    function setApprovalForAll(address operator, bool _approved) public;
    function isApprovedForAll(address owner, address operator) public view returns (bool);


    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
}

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
contract IERC721Enumerable is IERC721 {
    function totalSupply() public view returns (uint256);
    function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256 tokenId);

    function tokenByIndex(uint256 index) public view returns (uint256);
}

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
contract IERC721Receiver {
    /**
     * @notice Handle the receipt of an NFT
     * @dev The ERC721 smart contract calls this function on the recipient
     * after a {IERC721-safeTransferFrom}. This function MUST return the function selector,
     * otherwise the caller will revert the transaction. The selector to be
     * returned can be obtained as `this.onERC721Received.selector`. This
     * function MAY throw to revert and reject the transfer.
     * Note: the ERC721 contract address is always the message sender.
     * @param operator The address which called `safeTransferFrom` function
     * @param from The address which previously owned the token
     * @param tokenId The NFT identifier which is being transferred
     * @param data Additional data with no specified format
     * @return bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
    public returns (bytes4);
}

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * This test is non-exhaustive, and there may be false-negatives: during the
     * execution of a contract's constructor, its address will be reported as
     * not containing a contract.
     *
     * IMPORTANT: It is unsafe to assume that an address for which this
     * function returns false is an externally-owned account (EOA) and not a
     * contract.
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

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

    /**
     * @dev Converts an `address` into `address payable`. Note that this is
     * simply a type cast: the actual underlying value is not changed.
     *
     * _Available since v2.4.0._
     */
    function toPayable(address account) internal pure returns (address payable) {
        return address(uint160(account));
    }

    /**
     * @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].
     *
     * _Available since v2.4.0._
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}
 * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never
 * directly accessed.
 */
library Counters {
    using SafeMath for uint256;

    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        counter._value += 1;
    }

    function decrement(Counter storage counter) internal {
        counter._value = counter._value.sub(1);
    }
}

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
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) external view 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 {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721 is Context, ERC165, IERC721 {
    using SafeMath for uint256;
    using Address for address;
    using Counters for Counters.Counter;

    // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
    // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
    bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;

    // Mapping from token ID to owner
    mapping (uint256 => address) private _tokenOwner;

    // Mapping from token ID to approved address
    mapping (uint256 => address) private _tokenApprovals;

    // Mapping from owner to number of owned token
    mapping (address => Counters.Counter) private _ownedTokensCount;

    // Mapping from owner to operator approvals
    mapping (address => mapping (address => bool)) private _operatorApprovals;

    /*
     *     bytes4(keccak256('balanceOf(address)')) == 0x70a08231
     *     bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
     *     bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
     *     bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
     *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
     *     bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
     *
     *     => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
     *        0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
     */
    bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;

    constructor () public {
        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721);
    }

    /**
     * @dev Gets the balance of the specified address.
     * @param owner address to query the balance of
     * @return uint256 representing the amount owned by the passed address
     */
    function balanceOf(address owner) public view returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");

        return _ownedTokensCount[owner].current();
    }

    /**
     * @dev Gets the owner of the specified token ID.
     * @param tokenId uint256 ID of the token to query the owner of
     * @return address currently marked as the owner of the given token ID
     */
    function ownerOf(uint256 tokenId) public view returns (address) {
        address owner = _tokenOwner[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");

        return owner;
    }

    /**
     * @dev Approves another address to transfer the given token ID
     * The zero address indicates there is no approved address.
     * There can only be one approved address per token at a given time.
     * Can only be called by the token owner or an approved operator.
     * @param to address to be approved for the given token ID
     * @param tokenId uint256 ID of the token to be approved
     */
    function approve(address to, uint256 tokenId) public {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Gets the approved address for a token ID, or zero if no address set
     * Reverts if the token ID does not exist.
     * @param tokenId uint256 ID of the token to query the approval of
     * @return address currently approved for the given token ID
     */
    function getApproved(uint256 tokenId) public view returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev Sets or unsets the approval of a given operator
     * An operator is allowed to transfer all tokens of the sender on their behalf.
     * @param to operator address to set the approval
     * @param approved representing the status of the approval to be set
     */
    function setApprovalForAll(address to, bool approved) public {
        require(to != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][to] = approved;
        emit ApprovalForAll(_msgSender(), to, approved);
    }

    /**
     * @dev Tells whether an operator is approved by a given owner.
     * @param owner owner address which you want to query the approval of
     * @param operator operator address which you want to query the approval of
     * @return bool whether the given operator is approved by the given owner
     */
    function isApprovedForAll(address owner, address operator) public view returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev Transfers the ownership of a given token ID to another address.
     * Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     * Requires the msg.sender to be the owner, approved, or operator.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function transferFrom(address from, address to, uint256 tokenId) public {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transferFrom(from, to, tokenId);
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * Requires the msg.sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * Requires the _msgSender() to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes data to send along with a safe transfer check
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransferFrom(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * Requires the msg.sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes data to send along with a safe transfer check
     */
    function _safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) internal {
        _transferFrom(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether the specified token exists.
     * @param tokenId uint256 ID of the token to query the existence of
     * @return bool whether the token exists
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        address owner = _tokenOwner[tokenId];
        return owner != address(0);
    }

    /**
     * @dev Returns whether the given spender can transfer a given token ID.
     * @param spender address of the spender to query
     * @param tokenId uint256 ID of the token to be transferred
     * @return bool whether the msg.sender is approved for the given token ID,
     * is an operator of the owner, or is the owner of the token
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Internal function to safely mint a new token.
     * Reverts if the given token ID already exists.
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _safeMint(address to, uint256 tokenId) internal {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Internal function to safely mint a new token.
     * Reverts if the given token ID already exists.
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     * @param _data bytes data to send along with a safe transfer check
     */
    function _safeMint(address to, uint256 tokenId, bytes memory _data) internal {
        _mint(to, tokenId);
        require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Internal function to mint a new token.
     * Reverts if the given token ID already exists.
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _mint(address to, uint256 tokenId) internal {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _tokenOwner[tokenId] = to;
        _ownedTokensCount[to].increment();

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Internal function to burn a specific token.
     * Reverts if the token does not exist.
     * Deprecated, use {_burn} instead.
     * @param owner owner of the token to burn
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(address owner, uint256 tokenId) internal {
        require(ownerOf(tokenId) == owner, "ERC721: burn of token that is not own");

        _clearApproval(tokenId);

        _ownedTokensCount[owner].decrement();
        _tokenOwner[tokenId] = address(0);

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Internal function to burn a specific token.
     * Reverts if the token does not exist.
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(uint256 tokenId) internal {
        _burn(ownerOf(tokenId), tokenId);
    }

    /**
     * @dev Internal function to transfer ownership of a given token ID to another address.
     * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function _transferFrom(address from, address to, uint256 tokenId) internal {
        require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _clearApproval(tokenId);

        _ownedTokensCount[from].decrement();
        _ownedTokensCount[to].increment();

        _tokenOwner[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * This function is deprecated.
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
        internal returns (bool)
    {
        if (!to.isContract()) {
            return true;
        }

        bytes4 retval = IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data);
        return (retval == _ERC721_RECEIVED);
    }

    /**
     * @dev Private function to clear current approval of a given token ID.
     * @param tokenId uint256 ID of the token to be transferred
     */
    function _clearApproval(uint256 tokenId) private {
        if (_tokenApprovals[tokenId] != address(0)) {
            _tokenApprovals[tokenId] = address(0);
        }
    }
}

/**
 * @title ERC-721 Non-Fungible Token with optional enumeration extension logic
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721Enumerable is Context, ERC165, ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => uint256[]) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    /*
     *     bytes4(keccak256('totalSupply()')) == 0x18160ddd
     *     bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
     *     bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
     *
     *     => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
     */
    bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;

    /**
     * @dev Constructor function.
     */
    constructor () public {
        // register the supported interface to conform to ERC721Enumerable via ERC165
        _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
    }

    /**
     * @dev Gets the token ID at a given index of the tokens list of the requested owner.
     * @param owner address owning the tokens list to be accessed
     * @param index uint256 representing the index to be accessed of the requested tokens list
     * @return uint256 token ID at the given index of the tokens list owned by the requested address
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
        require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev Gets the total amount of tokens stored by the contract.
     * @return uint256 representing the total amount of tokens
     */
    function totalSupply() public view returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev Gets the token ID at a given index of all the tokens in this contract
     * Reverts if the index is greater or equal to the total number of tokens.
     * @param index uint256 representing the index to be accessed of the tokens list
     * @return uint256 token ID at the given index of the tokens list
     */
    function tokenByIndex(uint256 index) public view returns (uint256) {
        require(index < totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev Internal function to transfer ownership of a given token ID to another address.
     * As opposed to transferFrom, this imposes no restrictions on msg.sender.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function _transferFrom(address from, address to, uint256 tokenId) internal {
        super._transferFrom(from, to, tokenId);

        _removeTokenFromOwnerEnumeration(from, tokenId);

        _addTokenToOwnerEnumeration(to, tokenId);
    }

    /**
     * @dev Internal function to mint a new token.
     * Reverts if the given token ID already exists.
     * @param to address the beneficiary that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _mint(address to, uint256 tokenId) internal {
        super._mint(to, tokenId);

        _addTokenToOwnerEnumeration(to, tokenId);

        _addTokenToAllTokensEnumeration(tokenId);
    }

    /**
     * @dev Internal function to burn a specific token.
     * Reverts if the token does not exist.
     * Deprecated, use {ERC721-_burn} instead.
     * @param owner owner of the token to burn
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(address owner, uint256 tokenId) internal {
        super._burn(owner, tokenId);

        _removeTokenFromOwnerEnumeration(owner, tokenId);
        // Since tokenId will be deleted, we can clear its slot in _ownedTokensIndex to trigger a gas refund
        _ownedTokensIndex[tokenId] = 0;

        _removeTokenFromAllTokensEnumeration(tokenId);
    }

    /**
     * @dev Gets the list of token IDs of the requested owner.
     * @param owner address owning the tokens
     * @return uint256[] List of token IDs owned by the requested address
     */
    function _tokensOfOwner(address owner) internal view returns (uint256[] storage) {
        return _ownedTokens[owner];
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        _ownedTokensIndex[tokenId] = _ownedTokens[to].length;
        _ownedTokens[to].push(tokenId);
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _ownedTokens[from].length.sub(1);
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        _ownedTokens[from].length--;

        // Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occupied by
        // lastTokenId, or just over the end of the array if the token was the last one).
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length.sub(1);
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        _allTokens.length--;
        _allTokensIndex[tokenId] = 0;
    }
}

contract DloopAdmin {
    mapping(address => bool) private _adminMap;
    uint256 private _adminCount = 0;

    event AdminAdded(address indexed account);
    event AdminRenounced(address indexed account);

    constructor() public {
        _adminMap[msg.sender] = true;
        _adminCount = 1;
    }

    modifier onlyAdmin() {
        require(_adminMap[msg.sender], "caller does not have the admin role");
        _;
    }

    function numberOfAdmins() public view returns (uint256) {
        return _adminCount;
    }

    function isAdmin(address account) public view returns (bool) {
        return _adminMap[account];
    }

    function addAdmin(address account) public onlyAdmin {
        require(!_adminMap[account], "account already has admin role");
        require(account != address(0x0), "account must not be 0x0");
        _adminMap[account] = true;
        _adminCount = SafeMath.add(_adminCount, 1);
        emit AdminAdded(account);
    }

    function renounceAdmin() public onlyAdmin {
        _adminMap[msg.sender] = false;
        _adminCount = SafeMath.sub(_adminCount, 1);
        require(_adminCount > 0, "minimum one admin required");
        emit AdminRenounced(msg.sender);
    }
}

contract DloopGovernance is DloopAdmin {
    bool private _minterRoleEnabled = true;
    mapping(address => bool) private _minterMap;
    uint256 private _minterCount = 0;

    event AllMintersDisabled(address indexed sender);
    event AllMintersEnabled(address indexed sender);
    event MinterAdded(address indexed account);
    event MinterRemoved(address indexed account);

    constructor() public {
        addMinter(msg.sender);
    }

    modifier onlyMinter() {
        require(_minterRoleEnabled, "all minters are disabled");
        require(isMinter(msg.sender), "caller does not have the minter role");
        _;
    }

    function disableAllMinters() public onlyMinter {
        _minterRoleEnabled = false;
        emit AllMintersDisabled(msg.sender);
    }

    function enableAllMinters() public onlyAdmin {
        require(!_minterRoleEnabled, "minters already enabled");
        _minterRoleEnabled = true;
        emit AllMintersEnabled(msg.sender);
    }

    function isMinter(address account) public view returns (bool) {
        require(_minterRoleEnabled, "all minters are disabled");
        return _minterMap[account];
    }

    function isMinterRoleActive() public view returns (bool) {
        return _minterRoleEnabled;
    }

    function addMinter(address account) public onlyAdmin {
        require(!_minterMap[account], "account already has minter role");
        _minterMap[account] = true;
        _minterCount = SafeMath.add(_minterCount, 1);
        emit MinterAdded(account);
    }

    function removeMinter(address account) public onlyAdmin {
        require(_minterMap[account], "account does not have minter role");
        _minterMap[account] = false;
        _minterCount = SafeMath.sub(_minterCount, 1);
        emit MinterRemoved(account);
    }

    function numberOfMinters() public view returns (uint256) {
        return _minterCount;
    }
}

contract DloopManagedToken is ERC721, DloopGovernance {
    mapping(uint256 => bool) private _managedMap;

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public {
        require(!isManaged(tokenId), "token is managed");
        super.safeTransferFrom(from, to, tokenId, _data);
    }

    function transferFrom(address from, address to, uint256 tokenId) public {
        require(!isManaged(tokenId), "token is managed");
        super.transferFrom(from, to, tokenId);
    }

    function isManaged(uint256 tokenId) public view returns (bool) {
        require(super._exists(tokenId), "tokenId does not exist");
        return _managedMap[tokenId];
    }

    function _setManaged(uint256 tokenId, bool managed) internal {
        require(super._exists(tokenId), "tokenId does not exist");
        _managedMap[tokenId] = managed;
    }
}

contract DloopWithdraw is DloopManagedToken {
    uint256 private _lastWithdrawal = block.timestamp;
    uint256 private _withdrawalWaitTime = 300;

    event TokenWithdrawn(
        address indexed from,
        address indexed to,
        uint256 indexed tokenId
    );

    event WithdrawalWaitTimeSet(uint256 withdrawalWaitTime);
    event ManagedTransfer(
        address by,
        address indexed from,
        address indexed to,
        uint256 indexed tokenId
    );

    function managedTransfer(address to, uint256 tokenId)
        public
        onlyMinter
        returns (bool)
    {
        require(
            isManaged(tokenId),
            "specified tokenId does not reference a managed token"
        );

        address from = ownerOf(tokenId);
        super._safeTransferFrom(from, to, tokenId, "");
        emit ManagedTransfer(msg.sender, from, to, tokenId);
        return true;
    }

    function withdraw(address to, uint256 tokenId)
        public
        onlyMinter
        returns (bool)
    {
        require(
            isManaged(tokenId),
            "specified tokenId does not reference a managed token"
        );
        require(canWithdrawNow(), "withdrawal is currently locked");

        _lastWithdrawal = block.timestamp;
        super._setManaged(tokenId, false);

        address from = ownerOf(tokenId);
        super._safeTransferFrom(from, to, tokenId, "");

        emit TokenWithdrawn(from, to, tokenId);
        return true;
    }

    function setWithdrawalWaitTime(uint256 withdrawalWaitTime)
        public
        onlyAdmin
        returns (uint256)
    {
        _withdrawalWaitTime = withdrawalWaitTime;
        emit WithdrawalWaitTimeSet(withdrawalWaitTime);
    }

    function getWithdrawalWaitTime() public view returns (uint256) {
        return _withdrawalWaitTime;
    }

    function canWithdrawNow() public view returns (bool) {
        if (_withdrawalWaitTime == 0) {
            return true;
        } else {
            uint256 nextWithdraw = SafeMath.add(
                _lastWithdrawal,
                _withdrawalWaitTime
            );
            return nextWithdraw <= block.timestamp;
        }
    }

    function getLastWithdrawal() public view returns (uint256) {
        return _lastWithdrawal;
    }

}

contract DloopUtil {
    uint256 internal constant MAX_DATA_LENGTH = 4096;
    uint256 internal constant MIN_DATA_LENGTH = 1;

    struct Data {
        bytes32 dataType;
        bytes data;
    }

    function createTokenId(
        uint64 artworkId,
        uint16 editionNumber,
        uint8 artistProofNumber
    ) public pure returns (uint256) {
        require(artworkId > 0, "artworkId must be positive");
        require(
            editionNumber > 0 || artistProofNumber > 0,
            "one of editionNumber or artistProofNumber must be positive"
        );
        require(
            !(editionNumber != 0 && artistProofNumber != 0),
            "one of editionNumber or artistProofNumber must be zero"
        );

        uint256 tokenId = artworkId;
        tokenId = tokenId << 16;
        tokenId = SafeMath.add(tokenId, editionNumber);
        tokenId = tokenId << 8;
        tokenId = SafeMath.add(tokenId, artistProofNumber);

        return tokenId;
    }

    function splitTokenId(uint256 tokenId)
        public
        pure
        returns (
            uint64 artworkId,
            uint16 editionNumber,
            uint8 artistProofNumber
        )
    {
        artworkId = uint64(tokenId >> 24);
        editionNumber = uint16(tokenId >> 8);
        artistProofNumber = uint8(tokenId);

        require(artworkId > 0, "artworkId must be positive");
        require(
            editionNumber > 0 || artistProofNumber > 0,
            "one of editionNumber or artistProofNumber must be positive"
        );
        require(
            !(editionNumber != 0 && artistProofNumber != 0),
            "one of editionNumber or artistProofNumber must be zero"
        );
    }
}

contract DloopArtwork is DloopGovernance, DloopUtil {
    uint16 private constant MAX_EDITION_SIZE = 10000;
    uint16 private constant MIN_EDITION_SIZE = 1;

    uint8 private constant MAX_ARTIST_PROOF_SIZE = 10;
    uint8 private constant MIN_ARTIST_PROOF_SIZE = 1;

    struct Artwork {
        uint16 editionSize;
        uint16 editionCounter;
        uint8 artistProofSize;
        uint8 artistProofCounter;
        bool hasEntry;
        Data[] dataArray;
    }

    mapping(uint64 => Artwork) private _artworkMap; //uint64 represents the artworkId

    event ArtworkCreated(uint64 indexed artworkId);
    event ArtworkDataAdded(uint64 indexed artworkId, bytes32 indexed dataType);

    function createArtwork(
        uint64 artworkId,
        uint16 editionSize,
        uint8 artistProofSize,
        bytes32 dataType,
        bytes memory data
    ) public onlyMinter returns (bool) {
        require(!_artworkMap[artworkId].hasEntry, "artworkId already exists");
        require(editionSize <= MAX_EDITION_SIZE, "editionSize exceeded");
        require(
            editionSize >= MIN_EDITION_SIZE,
            "editionSize must be positive"
        );
        require(
            artistProofSize <= MAX_ARTIST_PROOF_SIZE,
            "artistProofSize exceeded"
        );
        require(
            artistProofSize >= MIN_ARTIST_PROOF_SIZE,
            "artistProofSize must be positive"
        );

        _artworkMap[artworkId].hasEntry = true;
        _artworkMap[artworkId].editionSize = editionSize;
        _artworkMap[artworkId].artistProofSize = artistProofSize;

        emit ArtworkCreated(artworkId);
        addArtworkData(artworkId, dataType, data);

        return true;
    }

    function _updateArtwork(
        uint64 artworkId,
        uint16 editionNumber,
        uint8 artistProofNumber
    ) internal {
        Artwork storage aw = _artworkMap[artworkId];

        require(aw.hasEntry, "artworkId does not exist");

        if (editionNumber > 0) {
            require(
                editionNumber <= aw.editionSize,
                "editionNumber must not exceed editionSize"
            );
            aw.editionCounter = aw.editionCounter + 1;
        }

        if (artistProofNumber > 0) {
            require(
                artistProofNumber <= aw.artistProofSize,
                "artistProofNumber must not exceed artistProofSize"
            );
            aw.artistProofCounter = aw.artistProofCounter + 1;
        }
    }

    function addArtworkData(
        uint64 artworkId,
        bytes32 dataType,
        bytes memory data
    ) public onlyMinter returns (bool) {
        require(_artworkMap[artworkId].hasEntry, "artworkId does not exist");
        require(artworkId > 0, "artworkId must be greater than 0");
        require(dataType != 0x0, "dataType must not be 0x0");
        require(data.length >= MIN_DATA_LENGTH, "data required");
        require(data.length <= MAX_DATA_LENGTH, "data exceeds maximum length");

        _artworkMap[artworkId].dataArray.push(Data(dataType, data));

        emit ArtworkDataAdded(artworkId, dataType);
        return true;
    }

    function getArtworkDataLength(uint64 artworkId)
        public
        view
        returns (uint256)
    {
        require(_artworkMap[artworkId].hasEntry, "artworkId does not exist");
        return _artworkMap[artworkId].dataArray.length;
    }

    function getArtworkData(uint64 artworkId, uint256 index)
        public
        view
        returns (bytes32 dataType, bytes memory data)
    {
        Artwork memory aw = _artworkMap[artworkId];

        require(aw.hasEntry, "artworkId does not exist");
        require(
            index < aw.dataArray.length,
            "artwork data index is out of bounds"
        );

        dataType = aw.dataArray[index].dataType;
        data = aw.dataArray[index].data;
    }

    function getArtworkInfo(uint64 artworkId)
        public
        view
        returns (
            uint16 editionSize,
            uint16 editionCounter,
            uint8 artistProofSize,
            uint8 artistProofCounter
        )
    {
        Artwork memory aw = _artworkMap[artworkId];
        require(aw.hasEntry, "artworkId does not exist");

        editionSize = aw.editionSize;
        editionCounter = aw.editionCounter;
        artistProofSize = aw.artistProofSize;
        artistProofCounter = aw.artistProofCounter;
    }
}

contract DloopMintable is DloopWithdraw, DloopArtwork {
    mapping(uint256 => Data[]) private _dataMap; //uint256 represents the tokenId

    event EditionMinted(
        uint256 indexed tokenId,
        uint64 indexed artworkId,
        uint16 editionNumber,
        uint8 artistProofNumber
    );
    event EditionDataAdded(uint256 indexed tokenId, bytes32 indexed dataType);

    function mintEdition(
        address to,
        uint64 artworkId,
        uint16 editionNumber,
        uint8 artistProofNumber,
        bytes32 dataType,
        bytes memory data
    ) public onlyMinter returns (bool) {
        uint256 tokenId = super.createTokenId(
            artworkId,
            editionNumber,
            artistProofNumber
        );

        super._safeMint(to, tokenId);
        super._setManaged(tokenId, true);

        super._updateArtwork(artworkId, editionNumber, artistProofNumber);

        emit EditionMinted(
            tokenId,
            artworkId,
            editionNumber,
            artistProofNumber
        );

        // Special case. If dataType is set, add the data
        if (dataType != 0x0) {
            addEditionData(tokenId, dataType, data);
        }

        return true;
    }

    function addEditionData(
        uint256 tokenId,
        bytes32 dataType,
        bytes memory data
    ) public onlyMinter returns (bool) {
        require(super._exists(tokenId), "tokenId does not exist");
        require(dataType != 0x0, "dataType must not be 0x0");
        require(data.length >= MIN_DATA_LENGTH, "data required");
        require(data.length <= MAX_DATA_LENGTH, "data exceeds maximum length");

        _dataMap[tokenId].push(Data(dataType, data));

        emit EditionDataAdded(tokenId, dataType);
        return true;
    }

    function getEditionDataLength(uint256 tokenId)
        public
        view
        returns (uint256)
    {
        require(_exists(tokenId), "tokenId does not exist");
        return _dataMap[tokenId].length;
    }

    function getEditionData(uint256 tokenId, uint256 index)
        public
        view
        returns (bytes32 dataType, bytes memory data)
    {
        require(_exists(tokenId), "tokenId does not exist");
        require(
            index < _dataMap[tokenId].length,
            "edition data index is out of bounds"
        );

        dataType = _dataMap[tokenId][index].dataType;
        data = _dataMap[tokenId][index].data;
    }
}

// @dev Removed the IERC721Metadata interface. solidity-coverage had issues.
contract CustomERC721Metadata is ERC165, ERC721 {
    string private _name;
    string private _symbol;
    string private _baseURI;

    /*
    * bytes4(keccak256('name()')) == 0x06fdde03
    * bytes4(keccak256('symbol()')) == 0x95d89b41
    * bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
    *
    * => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
    */
    bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;

    event BaseURISet(string baseURI);

    /**
    * @dev Constructor function
    */
    constructor(string memory name, string memory symbol, string memory baseURI)
        public
    {
        _name = name;
        _symbol = symbol;
        _baseURI = baseURI;

        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721_METADATA);
    }

    function _setBaseURI(string memory baseURI) internal {
        _baseURI = baseURI;
        emit BaseURISet(baseURI);
    }

    /**
    * @dev Gets the token name.
    * @return string representing the token name
    */
    function name() external view returns (string memory) {
        return _name;
    }

    /**
    * @dev Gets the token symbol.
    * @return string representing the token symbol
    */
    function symbol() external view returns (string memory) {
        return _symbol;
    }

    function getBaseURI() external view returns (string memory) {
        return _baseURI;
    }

    function tokenURI(uint256 tokenId) external view returns (string memory) {
        require(_exists(tokenId), "tokenId does not exist");
        return string(abi.encodePacked(_baseURI, uint2str(tokenId)));
    }

    // Helper function from Oraclize
    // https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.5.sol
    function uint2str(uint256 inp) internal pure returns (string memory) {
        if (inp == 0) return "0";
        uint256 i = inp;
        uint256 j = i;
        uint256 length;
        while (j != 0) {
            length++;
            j /= 10;
        }
        bytes memory bstr = new bytes(length);
        uint256 k = length - 1;
        while (i != 0) {
            bstr[k--] = bytes1(uint8(48 + (i % 10)));
            i /= 10;
        }
        return string(bstr);
    }
}

contract DloopToken is CustomERC721Metadata, ERC721Enumerable, DloopMintable {
    constructor(string memory baseURI)
        public
        CustomERC721Metadata("dloop Art Registry", "DART", baseURI)
    {
        // solhint-disable-previous-line no-empty-blocks
    }

    function setBaseURI(string memory baseURI)
        public
        onlyMinter
        returns (bool)
    {
        super._setBaseURI(baseURI);
        return true;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"AdminAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"AdminRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AllMintersDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AllMintersEnabled","type":"event"},{"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":true,"internalType":"uint64","name":"artworkId","type":"uint64"}],"name":"ArtworkCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"artworkId","type":"uint64"},{"indexed":true,"internalType":"bytes32","name":"dataType","type":"bytes32"}],"name":"ArtworkDataAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"baseURI","type":"string"}],"name":"BaseURISet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"dataType","type":"bytes32"}],"name":"EditionDataAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint64","name":"artworkId","type":"uint64"},{"indexed":false,"internalType":"uint16","name":"editionNumber","type":"uint16"},{"indexed":false,"internalType":"uint8","name":"artistProofNumber","type":"uint8"}],"name":"EditionMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"by","type":"address"},{"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":"ManagedTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"MinterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"MinterRemoved","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":"TokenWithdrawn","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"withdrawalWaitTime","type":"uint256"}],"name":"WithdrawalWaitTimeSet","type":"event"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint64","name":"artworkId","type":"uint64"},{"internalType":"bytes32","name":"dataType","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"addArtworkData","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes32","name":"dataType","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"addEditionData","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addMinter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"canWithdrawNow","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint64","name":"artworkId","type":"uint64"},{"internalType":"uint16","name":"editionSize","type":"uint16"},{"internalType":"uint8","name":"artistProofSize","type":"uint8"},{"internalType":"bytes32","name":"dataType","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"createArtwork","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint64","name":"artworkId","type":"uint64"},{"internalType":"uint16","name":"editionNumber","type":"uint16"},{"internalType":"uint8","name":"artistProofNumber","type":"uint8"}],"name":"createTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[],"name":"disableAllMinters","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"enableAllMinters","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint64","name":"artworkId","type":"uint64"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getArtworkData","outputs":[{"internalType":"bytes32","name":"dataType","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint64","name":"artworkId","type":"uint64"}],"name":"getArtworkDataLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint64","name":"artworkId","type":"uint64"}],"name":"getArtworkInfo","outputs":[{"internalType":"uint16","name":"editionSize","type":"uint16"},{"internalType":"uint16","name":"editionCounter","type":"uint16"},{"internalType":"uint8","name":"artistProofSize","type":"uint8"},{"internalType":"uint8","name":"artistProofCounter","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBaseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getEditionData","outputs":[{"internalType":"bytes32","name":"dataType","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getEditionDataLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getLastWithdrawal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getWithdrawalWaitTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isManaged","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isMinterRoleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"managedTransfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint64","name":"artworkId","type":"uint64"},{"internalType":"uint16","name":"editionNumber","type":"uint16"},{"internalType":"uint8","name":"artistProofNumber","type":"uint8"},{"internalType":"bytes32","name":"dataType","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintEdition","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"numberOfAdmins","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"numberOfMinters","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeMinter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"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":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"withdrawalWaitTime","type":"uint256"}],"name":"setWithdrawalWaitTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"splitTokenId","outputs":[{"internalType":"uint64","name":"artworkId","type":"uint64"},{"internalType":"uint16","name":"editionNumber","type":"uint16"},{"internalType":"uint8","name":"artistProofNumber","type":"uint8"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040526000600d819055600e805460ff191660011790556010554260125561012c6013553480156200003257600080fd5b5060405162004a3538038062004a35833981810160405260208110156200005857600080fd5b81019080805160405193929190846401000000008211156200007957600080fd5b9083019060208201858111156200008f57600080fd5b8251640100000000811182820188101715620000aa57600080fd5b82525081516020918201929091019080838360005b83811015620000d9578181015183820152602001620000bf565b50505050905090810190601f168015620001075780820380516001836020036101000a031916815260200191505b50604081810181526012825271646c6f6f702041727420526567697374727960701b602080840191909152815180830190925260048252631110549560e21b9082015290935091508390506200016d6301ffc9a760e01b6001600160e01b036200024016565b620001886380ac58cd60e01b6001600160e01b036200024016565b82516200019d90600590602086019062000463565b508151620001b390600690602085019062000463565b508051620001c990600790602084019062000463565b50620001e5635b5e139f60e01b6001600160e01b036200024016565b5062000205915063780e9d6360e01b90506001600160e01b036200024016565b336000818152600c60205260409020805460ff19166001908117909155600d5562000239906001600160e01b03620002c516565b5062000508565b6001600160e01b03198082161415620002a0576040805162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015290519081900360640190fd5b6001600160e01b0319166000908152602081905260409020805460ff19166001179055565b336000908152600c602052604090205460ff16620003155760405162461bcd60e51b815260040180806020018281038252602381526020018062004a126023913960400191505060405180910390fd5b6001600160a01b0381166000908152600f602052604090205460ff161562000384576040805162461bcd60e51b815260206004820152601f60248201527f6163636f756e7420616c726561647920686173206d696e74657220726f6c6500604482015290519081900360640190fd5b6001600160a01b0381166000908152600f60209081526040909120805460ff19166001908117909155601054620003c7929091906200332462000401821b17901c565b6010556040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b6000828201838110156200045c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620004a657805160ff1916838001178555620004d6565b82800160010185558215620004d6579182015b82811115620004d6578251825591602001919060010190620004b9565b50620004e4929150620004e8565b5090565b6200050591905b80821115620004e45760008155600101620004ef565b90565b6144fa80620005186000396000f3fe608060405234801561001057600080fd5b50600436106102955760003560e01c80637048027511610167578063983b2d56116100ce578063c87b56dd11610087578063c87b56dd14610b37578063d13bf44d14610b54578063e985e9c514610c20578063e9e7a42514610c4e578063f3fef3a314610c6b578063fa23529614610c9757610295565b8063983b2d561461099b5780639de13aec146109c1578063a22cb465146109c9578063aa271e1a146109f7578063b88d4fde14610a1d578063c7a67c0e14610ae157610295565b80638253e852116101205780638253e8521461088a57806388cde55f146108b05780638bad0c0a146109605780638c37e6cd146109685780638fa82d6b1461097057806395d89b411461099357610295565b8063704802751461074a57806370a0823114610770578063714c53981461079657806371f750771461079e57806374cd211f146107a6578063813958661461088257610295565b806323b872dd1161020b5780634031bc4e116101c45780634031bc4e1461061157806342842e0e146106195780634f6ccce71461064f57806355b6cce11461066c57806355f804b3146106895780636352211e1461072d57610295565b806323b872dd1461051a57806324d7806c146105505780632f745c59146105765780633092afd5146105a257806332ee940f146105c8578063391d2abc146105e557610295565b80630c0662a81161025d5780630c0662a8146103c157806310b6876b146103db578063163660f61461042657806318160ddd146104d157806318a22473146104d95780631c09a845146104e157610295565b806301ffc9a71461029a57806303e1c644146102d557806306fdde03146102dd578063081812fc1461035a578063095ea7b314610393575b600080fd5b6102c1600480360360208110156102b057600080fd5b50356001600160e01b031916610d50565b604080519115158252519081900360200190f35b6102c1610d73565b6102e5610d7d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561031f578181015183820152602001610307565b50505050905090810190601f16801561034c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103776004803603602081101561037057600080fd5b5035610e13565b604080516001600160a01b039092168252519081900360200190f35b6103bf600480360360408110156103a957600080fd5b506001600160a01b038135169060200135610e75565b005b6103c9610f9d565b60408051918252519081900360200190f35b6103f8600480360360208110156103f157600080fd5b5035610fa3565b604080516001600160401b03909416845261ffff909216602084015260ff1682820152519081900360600190f35b6104526004803603604081101561043c57600080fd5b506001600160401b0381351690602001356110b2565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561049557818101518382015260200161047d565b50505050905090810190601f1680156104c25780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b6103c96112fe565b6103c9611304565b6103c9600480360360608110156104f757600080fd5b5080356001600160401b031690602081013561ffff16906040013560ff1661130a565b6103bf6004803603606081101561053057600080fd5b506001600160a01b03813581169160208101359091169060400135611445565b6102c16004803603602081101561056657600080fd5b50356001600160a01b03166114a3565b6103c96004803603604081101561058c57600080fd5b506001600160a01b0381351690602001356114c1565b6103bf600480360360208110156105b857600080fd5b50356001600160a01b0316611540565b6103c9600480360360208110156105de57600080fd5b503561164d565b6102c1600480360360408110156105fb57600080fd5b506001600160a01b0381351690602001356116aa565b6103bf6117f2565b6103bf6004803603606081101561062f57600080fd5b506001600160a01b038135811691602081013590911690604001356118d2565b6103c96004803603602081101561066557600080fd5b50356118ed565b6102c16004803603602081101561068257600080fd5b5035611953565b6102c16004803603602081101561069f57600080fd5b810190602081018135600160201b8111156106b957600080fd5b8201836020820111156106cb57600080fd5b803590602001918460018302840111600160201b831117156106ec57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506119b3945050505050565b6103776004803603602081101561074357600080fd5b5035611a50565b6103bf6004803603602081101561076057600080fd5b50356001600160a01b0316611aaa565b6103c96004803603602081101561078657600080fd5b50356001600160a01b0316611c2d565b6102e5611c95565b6103c9611cf6565b6102c1600480360360c08110156107bc57600080fd5b6001600160a01b03823516916001600160401b036020820135169161ffff6040830135169160ff606082013516916080820135919081019060c0810160a0820135600160201b81111561080e57600080fd5b82018360208201111561082057600080fd5b803590602001918460018302840111600160201b8311171561084157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611cfc945050505050565b6103c9611e26565b6103c9600480360360208110156108a057600080fd5b50356001600160401b0316611e2c565b6102c1600480360360608110156108c657600080fd5b813591602081013591810190606081016040820135600160201b8111156108ec57600080fd5b8201836020820111156108fe57600080fd5b803590602001918460018302840111600160201b8311171561091f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611ead945050505050565b6103bf612102565b6103bf6121f8565b6104526004803603604081101561098657600080fd5b50803590602001356122b8565b6102e561244f565b6103bf600480360360208110156109b157600080fd5b50356001600160a01b03166124b0565b6102c16125d8565b6103bf600480360360408110156109df57600080fd5b506001600160a01b0381351690602001351515612609565b6102c160048036036020811015610a0d57600080fd5b50356001600160a01b031661270e565b6103bf60048036036080811015610a3357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b811115610a6d57600080fd5b820183602082011115610a7f57600080fd5b803590602001918460018302840111600160201b83111715610aa057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612775945050505050565b610b0760048036036020811015610af757600080fd5b50356001600160401b03166127d5565b6040805161ffff958616815293909416602084015260ff9182168385015216606082015290519081900360800190f35b6102e560048036036020811015610b4d57600080fd5b50356129bd565b6102c1600480360360a0811015610b6a57600080fd5b6001600160401b038235169161ffff6020820135169160ff6040830135169160608101359181019060a081016080820135600160201b811115610bac57600080fd5b820183602082011115610bbe57600080fd5b803590602001918460018302840111600160201b83111715610bdf57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612ad8945050505050565b6102c160048036036040811015610c3657600080fd5b506001600160a01b0381358116916020013516612dc1565b6103c960048036036020811015610c6457600080fd5b5035612def565b6102c160048036036040811015610c8157600080fd5b506001600160a01b038135169060200135612e7a565b6102c160048036036060811015610cad57600080fd5b6001600160401b0382351691602081013591810190606081016040820135600160201b811115610cdc57600080fd5b820183602082011115610cee57600080fd5b803590602001918460018302840111600160201b83111715610d0f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550613025945050505050565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b600e5460ff165b90565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e095780601f10610dde57610100808354040283529160200191610e09565b820191906000526020600020905b815481529060010190602001808311610dec57829003601f168201915b5050505050905090565b6000610e1e82613303565b610e595760405162461bcd60e51b815260040180806020018281038252602c8152602001806143b2602c913960400191505060405180910390fd5b506000908152600260205260409020546001600160a01b031690565b6000610e8082611a50565b9050806001600160a01b0316836001600160a01b03161415610ed35760405162461bcd60e51b81526004018080602001828103825260218152602001806144076021913960400191505060405180910390fd5b806001600160a01b0316610ee5613320565b6001600160a01b03161480610f065750610f0681610f01613320565b612dc1565b610f415760405162461bcd60e51b81526004018080602001828103825260388152602001806142976038913960400191505060405180910390fd5b60008281526002602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60125490565b601881901c600882901c826001600160401b038316611009576040805162461bcd60e51b815260206004820152601a60248201527f617274776f726b4964206d75737420626520706f736974697665000000000000604482015290519081900360640190fd5b60008261ffff16118061101f575060008160ff16115b61105a5760405162461bcd60e51b815260040180806020018281038252603a815260200180614378603a913960400191505060405180910390fd5b61ffff82161580159061106f575060ff811615155b156110ab5760405162461bcd60e51b81526004018080602001828103825260368152602001806143426036913960400191505060405180910390fd5b9193909250565b600060606110be613fbf565b6001600160401b0385166000908152601460209081526040808320815160c081018352815461ffff8082168352620100008204168286015260ff600160201b820481168386015265010000000000820481166060840152600160301b90910416151560808201526001820180548451818702810187019095528085529195929460a0870194939192919084015b82821015611229578382906000526020600020906002020160405180604001604052908160008201548152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112115780601f106111e657610100808354040283529160200191611211565b820191906000526020600020905b8154815290600101906020018083116111f457829003601f168201915b5050505050815250508152602001906001019061114b565b505050508152505090508060800151611277576040805162461bcd60e51b815260206004820152601860248201526000805160206144a6833981519152604482015290519081900360640190fd5b8060a001515184106112ba5760405162461bcd60e51b81526004018080602001828103825260238152602001806141ad6023913960400191505060405180910390fd5b8060a0015184815181106112ca57fe5b60200260200101516000015192508060a0015184815181106112e857fe5b6020026020010151602001519150509250929050565b600a5490565b60105490565b600080846001600160401b031611611369576040805162461bcd60e51b815260206004820152601a60248201527f617274776f726b4964206d75737420626520706f736974697665000000000000604482015290519081900360640190fd5b60008361ffff16118061137f575060008260ff16115b6113ba5760405162461bcd60e51b815260040180806020018281038252603a815260200180614378603a913960400191505060405180910390fd5b61ffff8316158015906113cf575060ff821615155b1561140b5760405162461bcd60e51b81526004018080602001828103825260368152602001806143426036913960400191505060405180910390fd5b69ffffffffffffffff0000601085901b1661142a8161ffff8616613324565b60081b905061143c8160ff8516613324565b95945050505050565b61144e81611953565b15611493576040805162461bcd60e51b815260206004820152601060248201526f1d1bdad95b881a5cc81b585b9859d95960821b604482015290519081900360640190fd5b61149e838383613385565b505050565b6001600160a01b03166000908152600c602052604090205460ff1690565b60006114cc83611c2d565b82106115095760405162461bcd60e51b815260040180806020018281038252602b815260200180614103602b913960400191505060405180910390fd5b6001600160a01b038316600090815260086020526040902080548390811061152d57fe5b9060005260206000200154905092915050565b336000908152600c602052604090205460ff1661158e5760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b6001600160a01b0381166000908152600f602052604090205460ff166115e55760405162461bcd60e51b81526004018080602001828103825260218152602001806144856021913960400191505060405180910390fd5b6001600160a01b0381166000908152600f60205260409020805460ff191690556010546116139060016133dc565b6010556040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b600061165882613303565b611697576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b5060009081526015602052604090205490565b600e5460009060ff166116f2576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b6116fb3361270e565b6117365760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b61173f82611953565b61177a5760405162461bcd60e51b81526004018080602001828103825260348152602001806140cf6034913960400191505060405180910390fd5b600061178583611a50565b90506117a28185856040518060200160405280600081525061341e565b60408051338152905184916001600160a01b0380881692908516917f739a5d4bb38ef40fc3ace6387d0fa3e32f565ab1f889487d0d998865a089260d919081900360200190a45060019392505050565b336000908152600c602052604090205460ff166118405760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b600e5460ff1615611898576040805162461bcd60e51b815260206004820152601760248201527f6d696e7465727320616c726561647920656e61626c6564000000000000000000604482015290519081900360640190fd5b600e805460ff1916600117905560405133907f845e6c16f22f9a7e47220d46683edcc9ea7999f35765a22791308ef169cd87c790600090a2565b61149e83838360405180602001604052806000815250612775565b60006118f76112fe565b82106119345760405162461bcd60e51b815260040180806020018281038252602c815260200180614459602c913960400191505060405180910390fd5b600a828154811061194157fe5b90600052602060002001549050919050565b600061195e82613303565b61199d576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b5060009081526011602052604090205460ff1690565b600e5460009060ff166119fb576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b611a043361270e565b611a3f5760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b611a4882613470565b506001919050565b6000818152600160205260408120546001600160a01b031680611aa45760405162461bcd60e51b81526004018080602001828103825260298152602001806143196029913960400191505060405180910390fd5b92915050565b336000908152600c602052604090205460ff16611af85760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b6001600160a01b0381166000908152600c602052604090205460ff1615611b66576040805162461bcd60e51b815260206004820152601e60248201527f6163636f756e7420616c7265616479206861732061646d696e20726f6c650000604482015290519081900360640190fd5b6001600160a01b038116611bc1576040805162461bcd60e51b815260206004820152601760248201527f6163636f756e74206d757374206e6f7420626520307830000000000000000000604482015290519081900360640190fd5b6001600160a01b0381166000908152600c60205260409020805460ff19166001908117909155600d54611bf391613324565b600d556040516001600160a01b038216907f44d6d25963f097ad14f29f06854a01f575648a1ef82f30e562ccd3889717e33990600090a250565b60006001600160a01b038216611c745760405162461bcd60e51b815260040180806020018281038252602a8152602001806142ef602a913960400191505060405180910390fd5b6001600160a01b0382166000908152600360205260409020611aa490613520565b60078054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e095780601f10610dde57610100808354040283529160200191610e09565b60135490565b600e5460009060ff16611d44576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b611d4d3361270e565b611d885760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b6000611d9587878761130a565b9050611da18882613524565b611dac816001613542565b611db78787876135aa565b6040805161ffff8816815260ff8716602082015281516001600160401b038a169284927fc429c56a120a6569f9e93a9be0819b013eb908bbd6ca52b232723b5f5b08d217929081900390910190a38315611e1857611e16818585611ead565b505b506001979650505050505050565b600d5490565b6001600160401b038116600090815260146020526040812054600160301b900460ff16611e8e576040805162461bcd60e51b815260206004820152601860248201526000805160206144a6833981519152604482015290519081900360640190fd5b506001600160401b031660009081526014602052604090206001015490565b600e5460009060ff16611ef5576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b611efe3361270e565b611f395760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b611f4284613303565b611f81576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b82611fce576040805162461bcd60e51b815260206004820152601860248201527706461746154797065206d757374206e6f74206265203078360441b604482015290519081900360640190fd5b600182511015612015576040805162461bcd60e51b815260206004820152600d60248201526c19185d18481c995c5d5a5c9959609a1b604482015290519081900360640190fd5b6110008251111561206d576040805162461bcd60e51b815260206004820152601b60248201527f646174612065786365656473206d6178696d756d206c656e6774680000000000604482015290519081900360640190fd5b6000848152601560209081526040808320815180830190925286825281830186815281546001818101808555938752958590208451600290920201908155905180519295939491936120c793908501929190910190613ff6565b50506040518592508691507fb8fc7aebee6966d3b631b719ef33efd95b2e2a4ec772cbec5c80da8b0b2b657a90600090a35060019392505050565b336000908152600c602052604090205460ff166121505760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b336000908152600c60205260409020805460ff19169055600d546121759060016133dc565b600d8190556121cb576040805162461bcd60e51b815260206004820152601a60248201527f6d696e696d756d206f6e652061646d696e207265717569726564000000000000604482015290519081900360640190fd5b60405133907f3aeb34a9cebce3c91879dc662fedfe0060c966cfcefb6985a595d1c0c56b8fca90600090a2565b600e5460ff1661223d576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b6122463361270e565b6122815760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b600e805460ff1916905560405133907f0e56269497a7b24eda36ba108138ddfad9444c8e97aea7bb743d33e8ce5ce24f90600090a2565b600060606122c584613303565b612304576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b60008481526015602052604090205483106123505760405162461bcd60e51b81526004018080602001828103825260238152602001806141d06023913960400191505060405180910390fd5b600084815260156020526040902080548490811061236a57fe5b906000526020600020906002020160000154915060156000858152602001908152602001600020838154811061239c57fe5b90600052602060002090600202016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124415780601f1061241657610100808354040283529160200191612441565b820191906000526020600020905b81548152906001019060200180831161242457829003601f168201915b505050505090509250929050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e095780601f10610dde57610100808354040283529160200191610e09565b336000908152600c602052604090205460ff166124fe5760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b6001600160a01b0381166000908152600f602052604090205460ff161561256c576040805162461bcd60e51b815260206004820152601f60248201527f6163636f756e7420616c726561647920686173206d696e74657220726f6c6500604482015290519081900360640190fd5b6001600160a01b0381166000908152600f60205260409020805460ff1916600190811790915560105461259e91613324565b6010556040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b6000601354600014156125ed57506001610d7a565b60006125fd601254601354613324565b4210159150610d7a9050565b612611613320565b6001600160a01b0316826001600160a01b03161415612677576040805162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015290519081900360640190fd5b8060046000612684613320565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556126c8613320565b60408051841515815290516001600160a01b0392909216917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319181900360200190a35050565b600e5460009060ff16612756576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152600f602052604090205460ff1690565b61277e82611953565b156127c3576040805162461bcd60e51b815260206004820152601060248201526f1d1bdad95b881a5cc81b585b9859d95960821b604482015290519081900360640190fd5b6127cf84848484613704565b50505050565b6000806000806127e3613fbf565b6001600160401b0386166000908152601460209081526040808320815160c081018352815461ffff8082168352620100008204168286015260ff600160201b820481168386015265010000000000820481166060840152600160301b90910416151560808201526001820180548451818702810187019095528085529195929460a0870194939192919084015b8282101561294e578382906000526020600020906002020160405180604001604052908160008201548152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129365780601f1061290b57610100808354040283529160200191612936565b820191906000526020600020905b81548152906001019060200180831161291957829003601f168201915b50505050508152505081526020019060010190612870565b50505050815250509050806080015161299c576040805162461bcd60e51b815260206004820152601860248201526000805160206144a6833981519152604482015290519081900360640190fd5b80516020820151604083015160609093015191989097509195509350915050565b60606129c882613303565b612a07576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b6007612a128361375c565b6040516020018083805460018160011615610100020316600290048015612a705780601f10612a4e576101008083540402835291820191612a70565b820191906000526020600020905b815481529060010190602001808311612a5c575b5050825160208401908083835b60208310612a9c5780518252601f199092019160209182019101612a7d565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529050919050565b600e5460009060ff16612b20576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b612b293361270e565b612b645760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b6001600160401b038616600090815260146020526040902054600160301b900460ff1615612bd9576040805162461bcd60e51b815260206004820152601860248201527f617274776f726b496420616c7265616479206578697374730000000000000000604482015290519081900360640190fd5b61271061ffff86161115612c2b576040805162461bcd60e51b815260206004820152601460248201527319591a5d1a5bdb94da5e9948195e18d95959195960621b604482015290519081900360640190fd5b600161ffff86161015612c85576040805162461bcd60e51b815260206004820152601c60248201527f65646974696f6e53697a65206d75737420626520706f73697469766500000000604482015290519081900360640190fd5b600a60ff85161115612cde576040805162461bcd60e51b815260206004820152601860248201527f61727469737450726f6f6653697a652065786365656465640000000000000000604482015290519081900360640190fd5b600160ff85161015612d37576040805162461bcd60e51b815260206004820181905260248201527f61727469737450726f6f6653697a65206d75737420626520706f736974697665604482015290519081900360640190fd5b6001600160401b0386166000818152601460205260408082208054600160301b66ff000000000000199091161761ffff191661ffff8a161764ff000000001916600160201b60ff8a1602179055517fdff0c7dd43c72f174e18fdfea4d32508dc22258563908c1e643ba078d6ae2c139190a2612db4868484613025565b5060019695505050505050565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b336000908152600c602052604081205460ff16612e3d5760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b60138290556040805183815290517fac4eba83ff12d56e0adf95fb1eb4391e754b31655687e29cc0bd6767f8a9991e9181900360200190a1919050565b600e5460009060ff16612ec2576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b612ecb3361270e565b612f065760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b612f0f82611953565b612f4a5760405162461bcd60e51b81526004018080602001828103825260348152602001806140cf6034913960400191505060405180910390fd5b612f526125d8565b612fa3576040805162461bcd60e51b815260206004820152601e60248201527f7769746864726177616c2069732063757272656e746c79206c6f636b65640000604482015290519081900360640190fd5b42601255612fb2826000613542565b6000612fbd83611a50565b9050612fda8185856040518060200160405280600081525061341e565b82846001600160a01b0316826001600160a01b03167f8210728e7c071f615b840ee026032693858fbcd5e5359e67e438c890f59e562060405160405180910390a45060019392505050565b600e5460009060ff1661306d576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b6130763361270e565b6130b15760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b6001600160401b038416600090815260146020526040902054600160301b900460ff16613113576040805162461bcd60e51b815260206004820152601860248201526000805160206144a6833981519152604482015290519081900360640190fd5b6000846001600160401b031611613171576040805162461bcd60e51b815260206004820181905260248201527f617274776f726b4964206d7573742062652067726561746572207468616e2030604482015290519081900360640190fd5b826131be576040805162461bcd60e51b815260206004820152601860248201527706461746154797065206d757374206e6f74206265203078360441b604482015290519081900360640190fd5b600182511015613205576040805162461bcd60e51b815260206004820152600d60248201526c19185d18481c995c5d5a5c9959609a1b604482015290519081900360640190fd5b6110008251111561325d576040805162461bcd60e51b815260206004820152601b60248201527f646174612065786365656473206d6178696d756d206c656e6774680000000000604482015290519081900360640190fd5b6001600160401b038416600090815260146020908152604080832081518083019092528682528183018681526001918201805480840180835591875295859020845160029097020195865590518051919593946132bf93850192910190613ff6565b50506040518592506001600160401b03871691507fe7488016caaec4a8374fc75067de6b42748031a6a3e646589b3a0f83a5272cd690600090a35060019392505050565b6000908152600160205260409020546001600160a01b0316151590565b3390565b60008282018381101561337e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b613396613390613320565b8261381f565b6133d15760405162461bcd60e51b81526004018080602001828103825260318152602001806144286031913960400191505060405180910390fd5b61149e8383836138c3565b600061337e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506138e2565b6134298484846138c3565b61343584848484613979565b6127cf5760405162461bcd60e51b815260040180806020018281038252603281526020018061412e6032913960400191505060405180910390fd5b8051613483906007906020840190613ff6565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f6816040518080602001828103825283818151815260200191508051906020019080838360005b838110156134e35781810151838201526020016134cb565b50505050905090810190601f1680156135105780820380516001836020036101000a031916815260200191505b509250505060405180910390a150565b5490565b61353e828260405180602001604052806000815250613ad0565b5050565b61354b82613303565b61358a576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b600091825260116020526040909120805460ff1916911515919091179055565b6001600160401b03831660009081526014602052604090208054600160301b900460ff1661360d576040805162461bcd60e51b815260206004820152601860248201526000805160206144a6833981519152604482015290519081900360640190fd5b61ffff83161561368257805461ffff908116908416111561365f5760405162461bcd60e51b81526004018080602001828103825260298152602001806141606029913960400191505060405180910390fd5b8054600161ffff62010000808404821692909201160263ffff0000199091161781555b60ff8216156127cf57805460ff600160201b909104811690831611156136d95760405162461bcd60e51b81526004018080602001828103825260318152602001806142176031913960400191505060405180910390fd5b805465ff0000000000198116650100000000009182900460ff90811660010116909102179055505050565b61371561370f613320565b8361381f565b6137505760405162461bcd60e51b81526004018080602001828103825260318152602001806144286031913960400191505060405180910390fd5b6127cf8484848461341e565b60608161378157506040805180820190915260018152600360fc1b6020820152610d6e565b818060005b811561379a57600101600a82049150613786565b6060816040519080825280601f01601f1916602001820160405280156137c7576020820181803883390190505b50905060001982015b841561381557600a850660300160f81b828280600190039350815181106137f357fe5b60200101906001600160f81b031916908160001a905350600a850494506137d0565b5095945050505050565b600061382a82613303565b6138655760405162461bcd60e51b815260040180806020018281038252602c81526020018061426b602c913960400191505060405180910390fd5b600061387083611a50565b9050806001600160a01b0316846001600160a01b031614806138ab5750836001600160a01b03166138a084610e13565b6001600160a01b0316145b806138bb57506138bb8185612dc1565b949350505050565b6138ce838383613b22565b6138d88382613c66565b61149e8282613d5b565b600081848411156139715760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561393657818101518382015260200161391e565b50505050905090810190601f1680156139635780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600061398d846001600160a01b0316613d99565b613999575060016138bb565b6000846001600160a01b031663150b7a026139b2613320565b8887876040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015613a37578181015183820152602001613a1f565b50505050905090810190601f168015613a645780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b158015613a8657600080fd5b505af1158015613a9a573d6000803e3d6000fd5b505050506040513d6020811015613ab057600080fd5b50516001600160e01b031916630a85bd0160e11b14915050949350505050565b613ada8383613dd0565b613ae76000848484613979565b61149e5760405162461bcd60e51b815260040180806020018281038252603281526020018061412e6032913960400191505060405180910390fd5b826001600160a01b0316613b3582611a50565b6001600160a01b031614613b7a5760405162461bcd60e51b81526004018080602001828103825260298152602001806143de6029913960400191505060405180910390fd5b6001600160a01b038216613bbf5760405162461bcd60e51b81526004018080602001828103825260248152602001806141f36024913960400191505060405180910390fd5b613bc881613ded565b6001600160a01b0383166000908152600360205260409020613be990613e2a565b6001600160a01b0382166000908152600360205260409020613c0a90613e41565b60008181526001602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216600090815260086020526040812054613c9090600163ffffffff6133dc16565b600083815260096020526040902054909150808214613d2b576001600160a01b0384166000908152600860205260408120805484908110613ccd57fe5b906000526020600020015490508060086000876001600160a01b03166001600160a01b031681526020019081526020016000208381548110613d0b57fe5b600091825260208083209091019290925591825260099052604090208190555b6001600160a01b0384166000908152600860205260409020805490613d54906000198301614074565b5050505050565b6001600160a01b0390911660009081526008602081815260408084208054868652600984529185208290559282526001810183559183529091200155565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906138bb5750141592915050565b613dda8282613e4a565b613de48282613d5b565b61353e81613f7b565b6000818152600260205260409020546001600160a01b031615613e2757600081815260026020526040902080546001600160a01b03191690555b50565b8054613e3d90600163ffffffff6133dc16565b9055565b80546001019055565b6001600160a01b038216613ea5576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b613eae81613303565b15613f00576040805162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015290519081900360640190fd5b600081815260016020908152604080832080546001600160a01b0319166001600160a01b038716908117909155835260039091529020613f3f90613e41565b60405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b6040805160c0810182526000808252602082018190529181018290526060808201839052608082019290925260a081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061403757805160ff1916838001178555614064565b82800160010185558215614064579182015b82811115614064578251825591602001919060010190614049565b50614070929150614094565b5090565b81548183558181111561149e5760008381526020902061149e9181019083015b610d7a91905b80821115614070576000815560010161409a56fe746f6b656e496420646f6573206e6f742065786973740000000000000000000073706563696669656420746f6b656e496420646f6573206e6f74207265666572656e63652061206d616e6167656420746f6b656e455243373231456e756d657261626c653a206f776e657220696e646578206f7574206f6620626f756e64734552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e74657265646974696f6e4e756d626572206d757374206e6f74206578636565642065646974696f6e53697a6563616c6c657220646f6573206e6f74206861766520746865206d696e74657220726f6c65617274776f726b206461746120696e646578206973206f7574206f6620626f756e647365646974696f6e206461746120696e646578206973206f7574206f6620626f756e64734552433732313a207472616e7366657220746f20746865207a65726f206164647265737361727469737450726f6f664e756d626572206d757374206e6f74206578636565642061727469737450726f6f6653697a6563616c6c657220646f6573206e6f742068617665207468652061646d696e20726f6c654552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c616c6c206d696e74657273206172652064697361626c656400000000000000004552433732313a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656e6f6e65206f662065646974696f6e4e756d626572206f722061727469737450726f6f664e756d626572206d757374206265207a65726f6f6e65206f662065646974696f6e4e756d626572206f722061727469737450726f6f664e756d626572206d75737420626520706f7369746976654552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564455243373231456e756d657261626c653a20676c6f62616c20696e646578206f7574206f6620626f756e64736163636f756e7420646f6573206e6f742068617665206d696e74657220726f6c65617274776f726b496420646f6573206e6f742065786973740000000000000000a265627a7a72315820c445f5268415269ef11225b6e8f49f122cc63c773d928069d1171aeb9b50b1a264736f6c6343000511003263616c6c657220646f6573206e6f742068617665207468652061646d696e20726f6c650000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002668747470733a2f2f732d63646e2e646c6f6f702e63682f746f6b656e2d6d657461646174612f0000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102955760003560e01c80637048027511610167578063983b2d56116100ce578063c87b56dd11610087578063c87b56dd14610b37578063d13bf44d14610b54578063e985e9c514610c20578063e9e7a42514610c4e578063f3fef3a314610c6b578063fa23529614610c9757610295565b8063983b2d561461099b5780639de13aec146109c1578063a22cb465146109c9578063aa271e1a146109f7578063b88d4fde14610a1d578063c7a67c0e14610ae157610295565b80638253e852116101205780638253e8521461088a57806388cde55f146108b05780638bad0c0a146109605780638c37e6cd146109685780638fa82d6b1461097057806395d89b411461099357610295565b8063704802751461074a57806370a0823114610770578063714c53981461079657806371f750771461079e57806374cd211f146107a6578063813958661461088257610295565b806323b872dd1161020b5780634031bc4e116101c45780634031bc4e1461061157806342842e0e146106195780634f6ccce71461064f57806355b6cce11461066c57806355f804b3146106895780636352211e1461072d57610295565b806323b872dd1461051a57806324d7806c146105505780632f745c59146105765780633092afd5146105a257806332ee940f146105c8578063391d2abc146105e557610295565b80630c0662a81161025d5780630c0662a8146103c157806310b6876b146103db578063163660f61461042657806318160ddd146104d157806318a22473146104d95780631c09a845146104e157610295565b806301ffc9a71461029a57806303e1c644146102d557806306fdde03146102dd578063081812fc1461035a578063095ea7b314610393575b600080fd5b6102c1600480360360208110156102b057600080fd5b50356001600160e01b031916610d50565b604080519115158252519081900360200190f35b6102c1610d73565b6102e5610d7d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561031f578181015183820152602001610307565b50505050905090810190601f16801561034c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103776004803603602081101561037057600080fd5b5035610e13565b604080516001600160a01b039092168252519081900360200190f35b6103bf600480360360408110156103a957600080fd5b506001600160a01b038135169060200135610e75565b005b6103c9610f9d565b60408051918252519081900360200190f35b6103f8600480360360208110156103f157600080fd5b5035610fa3565b604080516001600160401b03909416845261ffff909216602084015260ff1682820152519081900360600190f35b6104526004803603604081101561043c57600080fd5b506001600160401b0381351690602001356110b2565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561049557818101518382015260200161047d565b50505050905090810190601f1680156104c25780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b6103c96112fe565b6103c9611304565b6103c9600480360360608110156104f757600080fd5b5080356001600160401b031690602081013561ffff16906040013560ff1661130a565b6103bf6004803603606081101561053057600080fd5b506001600160a01b03813581169160208101359091169060400135611445565b6102c16004803603602081101561056657600080fd5b50356001600160a01b03166114a3565b6103c96004803603604081101561058c57600080fd5b506001600160a01b0381351690602001356114c1565b6103bf600480360360208110156105b857600080fd5b50356001600160a01b0316611540565b6103c9600480360360208110156105de57600080fd5b503561164d565b6102c1600480360360408110156105fb57600080fd5b506001600160a01b0381351690602001356116aa565b6103bf6117f2565b6103bf6004803603606081101561062f57600080fd5b506001600160a01b038135811691602081013590911690604001356118d2565b6103c96004803603602081101561066557600080fd5b50356118ed565b6102c16004803603602081101561068257600080fd5b5035611953565b6102c16004803603602081101561069f57600080fd5b810190602081018135600160201b8111156106b957600080fd5b8201836020820111156106cb57600080fd5b803590602001918460018302840111600160201b831117156106ec57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506119b3945050505050565b6103776004803603602081101561074357600080fd5b5035611a50565b6103bf6004803603602081101561076057600080fd5b50356001600160a01b0316611aaa565b6103c96004803603602081101561078657600080fd5b50356001600160a01b0316611c2d565b6102e5611c95565b6103c9611cf6565b6102c1600480360360c08110156107bc57600080fd5b6001600160a01b03823516916001600160401b036020820135169161ffff6040830135169160ff606082013516916080820135919081019060c0810160a0820135600160201b81111561080e57600080fd5b82018360208201111561082057600080fd5b803590602001918460018302840111600160201b8311171561084157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611cfc945050505050565b6103c9611e26565b6103c9600480360360208110156108a057600080fd5b50356001600160401b0316611e2c565b6102c1600480360360608110156108c657600080fd5b813591602081013591810190606081016040820135600160201b8111156108ec57600080fd5b8201836020820111156108fe57600080fd5b803590602001918460018302840111600160201b8311171561091f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611ead945050505050565b6103bf612102565b6103bf6121f8565b6104526004803603604081101561098657600080fd5b50803590602001356122b8565b6102e561244f565b6103bf600480360360208110156109b157600080fd5b50356001600160a01b03166124b0565b6102c16125d8565b6103bf600480360360408110156109df57600080fd5b506001600160a01b0381351690602001351515612609565b6102c160048036036020811015610a0d57600080fd5b50356001600160a01b031661270e565b6103bf60048036036080811015610a3357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b811115610a6d57600080fd5b820183602082011115610a7f57600080fd5b803590602001918460018302840111600160201b83111715610aa057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612775945050505050565b610b0760048036036020811015610af757600080fd5b50356001600160401b03166127d5565b6040805161ffff958616815293909416602084015260ff9182168385015216606082015290519081900360800190f35b6102e560048036036020811015610b4d57600080fd5b50356129bd565b6102c1600480360360a0811015610b6a57600080fd5b6001600160401b038235169161ffff6020820135169160ff6040830135169160608101359181019060a081016080820135600160201b811115610bac57600080fd5b820183602082011115610bbe57600080fd5b803590602001918460018302840111600160201b83111715610bdf57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612ad8945050505050565b6102c160048036036040811015610c3657600080fd5b506001600160a01b0381358116916020013516612dc1565b6103c960048036036020811015610c6457600080fd5b5035612def565b6102c160048036036040811015610c8157600080fd5b506001600160a01b038135169060200135612e7a565b6102c160048036036060811015610cad57600080fd5b6001600160401b0382351691602081013591810190606081016040820135600160201b811115610cdc57600080fd5b820183602082011115610cee57600080fd5b803590602001918460018302840111600160201b83111715610d0f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550613025945050505050565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b600e5460ff165b90565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e095780601f10610dde57610100808354040283529160200191610e09565b820191906000526020600020905b815481529060010190602001808311610dec57829003601f168201915b5050505050905090565b6000610e1e82613303565b610e595760405162461bcd60e51b815260040180806020018281038252602c8152602001806143b2602c913960400191505060405180910390fd5b506000908152600260205260409020546001600160a01b031690565b6000610e8082611a50565b9050806001600160a01b0316836001600160a01b03161415610ed35760405162461bcd60e51b81526004018080602001828103825260218152602001806144076021913960400191505060405180910390fd5b806001600160a01b0316610ee5613320565b6001600160a01b03161480610f065750610f0681610f01613320565b612dc1565b610f415760405162461bcd60e51b81526004018080602001828103825260388152602001806142976038913960400191505060405180910390fd5b60008281526002602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60125490565b601881901c600882901c826001600160401b038316611009576040805162461bcd60e51b815260206004820152601a60248201527f617274776f726b4964206d75737420626520706f736974697665000000000000604482015290519081900360640190fd5b60008261ffff16118061101f575060008160ff16115b61105a5760405162461bcd60e51b815260040180806020018281038252603a815260200180614378603a913960400191505060405180910390fd5b61ffff82161580159061106f575060ff811615155b156110ab5760405162461bcd60e51b81526004018080602001828103825260368152602001806143426036913960400191505060405180910390fd5b9193909250565b600060606110be613fbf565b6001600160401b0385166000908152601460209081526040808320815160c081018352815461ffff8082168352620100008204168286015260ff600160201b820481168386015265010000000000820481166060840152600160301b90910416151560808201526001820180548451818702810187019095528085529195929460a0870194939192919084015b82821015611229578382906000526020600020906002020160405180604001604052908160008201548152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112115780601f106111e657610100808354040283529160200191611211565b820191906000526020600020905b8154815290600101906020018083116111f457829003601f168201915b5050505050815250508152602001906001019061114b565b505050508152505090508060800151611277576040805162461bcd60e51b815260206004820152601860248201526000805160206144a6833981519152604482015290519081900360640190fd5b8060a001515184106112ba5760405162461bcd60e51b81526004018080602001828103825260238152602001806141ad6023913960400191505060405180910390fd5b8060a0015184815181106112ca57fe5b60200260200101516000015192508060a0015184815181106112e857fe5b6020026020010151602001519150509250929050565b600a5490565b60105490565b600080846001600160401b031611611369576040805162461bcd60e51b815260206004820152601a60248201527f617274776f726b4964206d75737420626520706f736974697665000000000000604482015290519081900360640190fd5b60008361ffff16118061137f575060008260ff16115b6113ba5760405162461bcd60e51b815260040180806020018281038252603a815260200180614378603a913960400191505060405180910390fd5b61ffff8316158015906113cf575060ff821615155b1561140b5760405162461bcd60e51b81526004018080602001828103825260368152602001806143426036913960400191505060405180910390fd5b69ffffffffffffffff0000601085901b1661142a8161ffff8616613324565b60081b905061143c8160ff8516613324565b95945050505050565b61144e81611953565b15611493576040805162461bcd60e51b815260206004820152601060248201526f1d1bdad95b881a5cc81b585b9859d95960821b604482015290519081900360640190fd5b61149e838383613385565b505050565b6001600160a01b03166000908152600c602052604090205460ff1690565b60006114cc83611c2d565b82106115095760405162461bcd60e51b815260040180806020018281038252602b815260200180614103602b913960400191505060405180910390fd5b6001600160a01b038316600090815260086020526040902080548390811061152d57fe5b9060005260206000200154905092915050565b336000908152600c602052604090205460ff1661158e5760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b6001600160a01b0381166000908152600f602052604090205460ff166115e55760405162461bcd60e51b81526004018080602001828103825260218152602001806144856021913960400191505060405180910390fd5b6001600160a01b0381166000908152600f60205260409020805460ff191690556010546116139060016133dc565b6010556040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b600061165882613303565b611697576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b5060009081526015602052604090205490565b600e5460009060ff166116f2576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b6116fb3361270e565b6117365760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b61173f82611953565b61177a5760405162461bcd60e51b81526004018080602001828103825260348152602001806140cf6034913960400191505060405180910390fd5b600061178583611a50565b90506117a28185856040518060200160405280600081525061341e565b60408051338152905184916001600160a01b0380881692908516917f739a5d4bb38ef40fc3ace6387d0fa3e32f565ab1f889487d0d998865a089260d919081900360200190a45060019392505050565b336000908152600c602052604090205460ff166118405760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b600e5460ff1615611898576040805162461bcd60e51b815260206004820152601760248201527f6d696e7465727320616c726561647920656e61626c6564000000000000000000604482015290519081900360640190fd5b600e805460ff1916600117905560405133907f845e6c16f22f9a7e47220d46683edcc9ea7999f35765a22791308ef169cd87c790600090a2565b61149e83838360405180602001604052806000815250612775565b60006118f76112fe565b82106119345760405162461bcd60e51b815260040180806020018281038252602c815260200180614459602c913960400191505060405180910390fd5b600a828154811061194157fe5b90600052602060002001549050919050565b600061195e82613303565b61199d576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b5060009081526011602052604090205460ff1690565b600e5460009060ff166119fb576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b611a043361270e565b611a3f5760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b611a4882613470565b506001919050565b6000818152600160205260408120546001600160a01b031680611aa45760405162461bcd60e51b81526004018080602001828103825260298152602001806143196029913960400191505060405180910390fd5b92915050565b336000908152600c602052604090205460ff16611af85760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b6001600160a01b0381166000908152600c602052604090205460ff1615611b66576040805162461bcd60e51b815260206004820152601e60248201527f6163636f756e7420616c7265616479206861732061646d696e20726f6c650000604482015290519081900360640190fd5b6001600160a01b038116611bc1576040805162461bcd60e51b815260206004820152601760248201527f6163636f756e74206d757374206e6f7420626520307830000000000000000000604482015290519081900360640190fd5b6001600160a01b0381166000908152600c60205260409020805460ff19166001908117909155600d54611bf391613324565b600d556040516001600160a01b038216907f44d6d25963f097ad14f29f06854a01f575648a1ef82f30e562ccd3889717e33990600090a250565b60006001600160a01b038216611c745760405162461bcd60e51b815260040180806020018281038252602a8152602001806142ef602a913960400191505060405180910390fd5b6001600160a01b0382166000908152600360205260409020611aa490613520565b60078054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e095780601f10610dde57610100808354040283529160200191610e09565b60135490565b600e5460009060ff16611d44576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b611d4d3361270e565b611d885760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b6000611d9587878761130a565b9050611da18882613524565b611dac816001613542565b611db78787876135aa565b6040805161ffff8816815260ff8716602082015281516001600160401b038a169284927fc429c56a120a6569f9e93a9be0819b013eb908bbd6ca52b232723b5f5b08d217929081900390910190a38315611e1857611e16818585611ead565b505b506001979650505050505050565b600d5490565b6001600160401b038116600090815260146020526040812054600160301b900460ff16611e8e576040805162461bcd60e51b815260206004820152601860248201526000805160206144a6833981519152604482015290519081900360640190fd5b506001600160401b031660009081526014602052604090206001015490565b600e5460009060ff16611ef5576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b611efe3361270e565b611f395760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b611f4284613303565b611f81576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b82611fce576040805162461bcd60e51b815260206004820152601860248201527706461746154797065206d757374206e6f74206265203078360441b604482015290519081900360640190fd5b600182511015612015576040805162461bcd60e51b815260206004820152600d60248201526c19185d18481c995c5d5a5c9959609a1b604482015290519081900360640190fd5b6110008251111561206d576040805162461bcd60e51b815260206004820152601b60248201527f646174612065786365656473206d6178696d756d206c656e6774680000000000604482015290519081900360640190fd5b6000848152601560209081526040808320815180830190925286825281830186815281546001818101808555938752958590208451600290920201908155905180519295939491936120c793908501929190910190613ff6565b50506040518592508691507fb8fc7aebee6966d3b631b719ef33efd95b2e2a4ec772cbec5c80da8b0b2b657a90600090a35060019392505050565b336000908152600c602052604090205460ff166121505760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b336000908152600c60205260409020805460ff19169055600d546121759060016133dc565b600d8190556121cb576040805162461bcd60e51b815260206004820152601a60248201527f6d696e696d756d206f6e652061646d696e207265717569726564000000000000604482015290519081900360640190fd5b60405133907f3aeb34a9cebce3c91879dc662fedfe0060c966cfcefb6985a595d1c0c56b8fca90600090a2565b600e5460ff1661223d576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b6122463361270e565b6122815760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b600e805460ff1916905560405133907f0e56269497a7b24eda36ba108138ddfad9444c8e97aea7bb743d33e8ce5ce24f90600090a2565b600060606122c584613303565b612304576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b60008481526015602052604090205483106123505760405162461bcd60e51b81526004018080602001828103825260238152602001806141d06023913960400191505060405180910390fd5b600084815260156020526040902080548490811061236a57fe5b906000526020600020906002020160000154915060156000858152602001908152602001600020838154811061239c57fe5b90600052602060002090600202016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124415780601f1061241657610100808354040283529160200191612441565b820191906000526020600020905b81548152906001019060200180831161242457829003601f168201915b505050505090509250929050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e095780601f10610dde57610100808354040283529160200191610e09565b336000908152600c602052604090205460ff166124fe5760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b6001600160a01b0381166000908152600f602052604090205460ff161561256c576040805162461bcd60e51b815260206004820152601f60248201527f6163636f756e7420616c726561647920686173206d696e74657220726f6c6500604482015290519081900360640190fd5b6001600160a01b0381166000908152600f60205260409020805460ff1916600190811790915560105461259e91613324565b6010556040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b6000601354600014156125ed57506001610d7a565b60006125fd601254601354613324565b4210159150610d7a9050565b612611613320565b6001600160a01b0316826001600160a01b03161415612677576040805162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015290519081900360640190fd5b8060046000612684613320565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556126c8613320565b60408051841515815290516001600160a01b0392909216917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319181900360200190a35050565b600e5460009060ff16612756576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152600f602052604090205460ff1690565b61277e82611953565b156127c3576040805162461bcd60e51b815260206004820152601060248201526f1d1bdad95b881a5cc81b585b9859d95960821b604482015290519081900360640190fd5b6127cf84848484613704565b50505050565b6000806000806127e3613fbf565b6001600160401b0386166000908152601460209081526040808320815160c081018352815461ffff8082168352620100008204168286015260ff600160201b820481168386015265010000000000820481166060840152600160301b90910416151560808201526001820180548451818702810187019095528085529195929460a0870194939192919084015b8282101561294e578382906000526020600020906002020160405180604001604052908160008201548152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129365780601f1061290b57610100808354040283529160200191612936565b820191906000526020600020905b81548152906001019060200180831161291957829003601f168201915b50505050508152505081526020019060010190612870565b50505050815250509050806080015161299c576040805162461bcd60e51b815260206004820152601860248201526000805160206144a6833981519152604482015290519081900360640190fd5b80516020820151604083015160609093015191989097509195509350915050565b60606129c882613303565b612a07576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b6007612a128361375c565b6040516020018083805460018160011615610100020316600290048015612a705780601f10612a4e576101008083540402835291820191612a70565b820191906000526020600020905b815481529060010190602001808311612a5c575b5050825160208401908083835b60208310612a9c5780518252601f199092019160209182019101612a7d565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529050919050565b600e5460009060ff16612b20576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b612b293361270e565b612b645760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b6001600160401b038616600090815260146020526040902054600160301b900460ff1615612bd9576040805162461bcd60e51b815260206004820152601860248201527f617274776f726b496420616c7265616479206578697374730000000000000000604482015290519081900360640190fd5b61271061ffff86161115612c2b576040805162461bcd60e51b815260206004820152601460248201527319591a5d1a5bdb94da5e9948195e18d95959195960621b604482015290519081900360640190fd5b600161ffff86161015612c85576040805162461bcd60e51b815260206004820152601c60248201527f65646974696f6e53697a65206d75737420626520706f73697469766500000000604482015290519081900360640190fd5b600a60ff85161115612cde576040805162461bcd60e51b815260206004820152601860248201527f61727469737450726f6f6653697a652065786365656465640000000000000000604482015290519081900360640190fd5b600160ff85161015612d37576040805162461bcd60e51b815260206004820181905260248201527f61727469737450726f6f6653697a65206d75737420626520706f736974697665604482015290519081900360640190fd5b6001600160401b0386166000818152601460205260408082208054600160301b66ff000000000000199091161761ffff191661ffff8a161764ff000000001916600160201b60ff8a1602179055517fdff0c7dd43c72f174e18fdfea4d32508dc22258563908c1e643ba078d6ae2c139190a2612db4868484613025565b5060019695505050505050565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b336000908152600c602052604081205460ff16612e3d5760405162461bcd60e51b81526004018080602001828103825260238152602001806142486023913960400191505060405180910390fd5b60138290556040805183815290517fac4eba83ff12d56e0adf95fb1eb4391e754b31655687e29cc0bd6767f8a9991e9181900360200190a1919050565b600e5460009060ff16612ec2576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b612ecb3361270e565b612f065760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b612f0f82611953565b612f4a5760405162461bcd60e51b81526004018080602001828103825260348152602001806140cf6034913960400191505060405180910390fd5b612f526125d8565b612fa3576040805162461bcd60e51b815260206004820152601e60248201527f7769746864726177616c2069732063757272656e746c79206c6f636b65640000604482015290519081900360640190fd5b42601255612fb2826000613542565b6000612fbd83611a50565b9050612fda8185856040518060200160405280600081525061341e565b82846001600160a01b0316826001600160a01b03167f8210728e7c071f615b840ee026032693858fbcd5e5359e67e438c890f59e562060405160405180910390a45060019392505050565b600e5460009060ff1661306d576040805162461bcd60e51b815260206004820152601860248201526000805160206142cf833981519152604482015290519081900360640190fd5b6130763361270e565b6130b15760405162461bcd60e51b81526004018080602001828103825260248152602001806141896024913960400191505060405180910390fd5b6001600160401b038416600090815260146020526040902054600160301b900460ff16613113576040805162461bcd60e51b815260206004820152601860248201526000805160206144a6833981519152604482015290519081900360640190fd5b6000846001600160401b031611613171576040805162461bcd60e51b815260206004820181905260248201527f617274776f726b4964206d7573742062652067726561746572207468616e2030604482015290519081900360640190fd5b826131be576040805162461bcd60e51b815260206004820152601860248201527706461746154797065206d757374206e6f74206265203078360441b604482015290519081900360640190fd5b600182511015613205576040805162461bcd60e51b815260206004820152600d60248201526c19185d18481c995c5d5a5c9959609a1b604482015290519081900360640190fd5b6110008251111561325d576040805162461bcd60e51b815260206004820152601b60248201527f646174612065786365656473206d6178696d756d206c656e6774680000000000604482015290519081900360640190fd5b6001600160401b038416600090815260146020908152604080832081518083019092528682528183018681526001918201805480840180835591875295859020845160029097020195865590518051919593946132bf93850192910190613ff6565b50506040518592506001600160401b03871691507fe7488016caaec4a8374fc75067de6b42748031a6a3e646589b3a0f83a5272cd690600090a35060019392505050565b6000908152600160205260409020546001600160a01b0316151590565b3390565b60008282018381101561337e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b613396613390613320565b8261381f565b6133d15760405162461bcd60e51b81526004018080602001828103825260318152602001806144286031913960400191505060405180910390fd5b61149e8383836138c3565b600061337e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506138e2565b6134298484846138c3565b61343584848484613979565b6127cf5760405162461bcd60e51b815260040180806020018281038252603281526020018061412e6032913960400191505060405180910390fd5b8051613483906007906020840190613ff6565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f6816040518080602001828103825283818151815260200191508051906020019080838360005b838110156134e35781810151838201526020016134cb565b50505050905090810190601f1680156135105780820380516001836020036101000a031916815260200191505b509250505060405180910390a150565b5490565b61353e828260405180602001604052806000815250613ad0565b5050565b61354b82613303565b61358a576040805162461bcd60e51b815260206004820152601660248201526000805160206140af833981519152604482015290519081900360640190fd5b600091825260116020526040909120805460ff1916911515919091179055565b6001600160401b03831660009081526014602052604090208054600160301b900460ff1661360d576040805162461bcd60e51b815260206004820152601860248201526000805160206144a6833981519152604482015290519081900360640190fd5b61ffff83161561368257805461ffff908116908416111561365f5760405162461bcd60e51b81526004018080602001828103825260298152602001806141606029913960400191505060405180910390fd5b8054600161ffff62010000808404821692909201160263ffff0000199091161781555b60ff8216156127cf57805460ff600160201b909104811690831611156136d95760405162461bcd60e51b81526004018080602001828103825260318152602001806142176031913960400191505060405180910390fd5b805465ff0000000000198116650100000000009182900460ff90811660010116909102179055505050565b61371561370f613320565b8361381f565b6137505760405162461bcd60e51b81526004018080602001828103825260318152602001806144286031913960400191505060405180910390fd5b6127cf8484848461341e565b60608161378157506040805180820190915260018152600360fc1b6020820152610d6e565b818060005b811561379a57600101600a82049150613786565b6060816040519080825280601f01601f1916602001820160405280156137c7576020820181803883390190505b50905060001982015b841561381557600a850660300160f81b828280600190039350815181106137f357fe5b60200101906001600160f81b031916908160001a905350600a850494506137d0565b5095945050505050565b600061382a82613303565b6138655760405162461bcd60e51b815260040180806020018281038252602c81526020018061426b602c913960400191505060405180910390fd5b600061387083611a50565b9050806001600160a01b0316846001600160a01b031614806138ab5750836001600160a01b03166138a084610e13565b6001600160a01b0316145b806138bb57506138bb8185612dc1565b949350505050565b6138ce838383613b22565b6138d88382613c66565b61149e8282613d5b565b600081848411156139715760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561393657818101518382015260200161391e565b50505050905090810190601f1680156139635780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600061398d846001600160a01b0316613d99565b613999575060016138bb565b6000846001600160a01b031663150b7a026139b2613320565b8887876040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015613a37578181015183820152602001613a1f565b50505050905090810190601f168015613a645780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b158015613a8657600080fd5b505af1158015613a9a573d6000803e3d6000fd5b505050506040513d6020811015613ab057600080fd5b50516001600160e01b031916630a85bd0160e11b14915050949350505050565b613ada8383613dd0565b613ae76000848484613979565b61149e5760405162461bcd60e51b815260040180806020018281038252603281526020018061412e6032913960400191505060405180910390fd5b826001600160a01b0316613b3582611a50565b6001600160a01b031614613b7a5760405162461bcd60e51b81526004018080602001828103825260298152602001806143de6029913960400191505060405180910390fd5b6001600160a01b038216613bbf5760405162461bcd60e51b81526004018080602001828103825260248152602001806141f36024913960400191505060405180910390fd5b613bc881613ded565b6001600160a01b0383166000908152600360205260409020613be990613e2a565b6001600160a01b0382166000908152600360205260409020613c0a90613e41565b60008181526001602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216600090815260086020526040812054613c9090600163ffffffff6133dc16565b600083815260096020526040902054909150808214613d2b576001600160a01b0384166000908152600860205260408120805484908110613ccd57fe5b906000526020600020015490508060086000876001600160a01b03166001600160a01b031681526020019081526020016000208381548110613d0b57fe5b600091825260208083209091019290925591825260099052604090208190555b6001600160a01b0384166000908152600860205260409020805490613d54906000198301614074565b5050505050565b6001600160a01b0390911660009081526008602081815260408084208054868652600984529185208290559282526001810183559183529091200155565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906138bb5750141592915050565b613dda8282613e4a565b613de48282613d5b565b61353e81613f7b565b6000818152600260205260409020546001600160a01b031615613e2757600081815260026020526040902080546001600160a01b03191690555b50565b8054613e3d90600163ffffffff6133dc16565b9055565b80546001019055565b6001600160a01b038216613ea5576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b613eae81613303565b15613f00576040805162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015290519081900360640190fd5b600081815260016020908152604080832080546001600160a01b0319166001600160a01b038716908117909155835260039091529020613f3f90613e41565b60405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b6040805160c0810182526000808252602082018190529181018290526060808201839052608082019290925260a081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061403757805160ff1916838001178555614064565b82800160010185558215614064579182015b82811115614064578251825591602001919060010190614049565b50614070929150614094565b5090565b81548183558181111561149e5760008381526020902061149e9181019083015b610d7a91905b80821115614070576000815560010161409a56fe746f6b656e496420646f6573206e6f742065786973740000000000000000000073706563696669656420746f6b656e496420646f6573206e6f74207265666572656e63652061206d616e6167656420746f6b656e455243373231456e756d657261626c653a206f776e657220696e646578206f7574206f6620626f756e64734552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e74657265646974696f6e4e756d626572206d757374206e6f74206578636565642065646974696f6e53697a6563616c6c657220646f6573206e6f74206861766520746865206d696e74657220726f6c65617274776f726b206461746120696e646578206973206f7574206f6620626f756e647365646974696f6e206461746120696e646578206973206f7574206f6620626f756e64734552433732313a207472616e7366657220746f20746865207a65726f206164647265737361727469737450726f6f664e756d626572206d757374206e6f74206578636565642061727469737450726f6f6653697a6563616c6c657220646f6573206e6f742068617665207468652061646d696e20726f6c654552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c616c6c206d696e74657273206172652064697361626c656400000000000000004552433732313a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656e6f6e65206f662065646974696f6e4e756d626572206f722061727469737450726f6f664e756d626572206d757374206265207a65726f6f6e65206f662065646974696f6e4e756d626572206f722061727469737450726f6f664e756d626572206d75737420626520706f7369746976654552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564455243373231456e756d657261626c653a20676c6f62616c20696e646578206f7574206f6620626f756e64736163636f756e7420646f6573206e6f742068617665206d696e74657220726f6c65617274776f726b496420646f6573206e6f742065786973740000000000000000a265627a7a72315820c445f5268415269ef11225b6e8f49f122cc63c773d928069d1171aeb9b50b1a264736f6c63430005110032

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

0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002668747470733a2f2f732d63646e2e646c6f6f702e63682f746f6b656e2d6d657461646174612f0000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : baseURI (string): https://s-cdn.dloop.ch/token-metadata/

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000026
Arg [2] : 68747470733a2f2f732d63646e2e646c6f6f702e63682f746f6b656e2d6d6574
Arg [3] : 61646174612f0000000000000000000000000000000000000000000000000000


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