ETH Price: $3,410.39 (-1.00%)
Gas: 1 Gwei

Token

Async Art (ASYNC)
 

Overview

Max Total Supply

348 ASYNC

Holders

28

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Filtered by Token Holder
xcopy.eth
Balance
1 ASYNC
0x39cc9c86e67baf2129b80fe3414c397492ea8026
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

Create, collect, and trade programmable art: digital paintings split into "Layers" which you can use to affect the overall image.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
AsyncArtwork

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-02-26
*/

/**
Copyright (C) 2020 Asynchronous Art, Inc.
GNU General Public License v3.0
Full notice https://github.com/asyncart/async-contracts/blob/master/LICENSE
*/

pragma solidity ^0.5.12;


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

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

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

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

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

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

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

contract ERC721 is ERC165, IERC721 {
    using SafeMath for uint256;
    using Address for address;
    using Counters for Counters.Counter;

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

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

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

        require(msg.sender == owner || isApprovedForAll(owner, msg.sender));

        _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 != msg.sender);

        _operatorApprovals[msg.sender][to] = approved;
        emit ApprovalForAll(msg.sender, 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(msg.sender, tokenId));

        _transferFrom(from, to, tokenId);
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * 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
     * 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(msg.sender, tokenId));
        _transferFrom(from, to, tokenId);
    }

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

    /**
     * @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));
        require(!_exists(tokenId), "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);

        _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, "not owner");
        require(to != address(0));

        _clearApproval(tokenId);

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

        _tokenOwner[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

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

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

contract ERC721Enumerable is 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 IERC721Metadata is IERC721 {
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Optional mapping for token URIs
    mapping(uint256 => string) private _tokenURIs;

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

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

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

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

    /**
     * @dev Returns an URI for a given token ID.
     * Throws if the token ID does not exist. May return an empty string.
     * @param tokenId uint256 ID of the token to query
     */
    function tokenURI(uint256 tokenId) external view returns (string memory) {
        // require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
        return _tokenURIs[tokenId];
    }

    /**
     * @dev Internal function to set the token URI for a given token.
     * Reverts if the token ID does not exist.
     * @param tokenId uint256 ID of the token to set its URI
     * @param uri string URI to assign
     */
    function _setTokenURI(uint256 tokenId, string memory uri) internal {
        require(_exists(tokenId), "URI set of nonexistent token");
        _tokenURIs[tokenId] = uri;
    }

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

        // Clear metadata (if any)
        if (bytes(_tokenURIs[tokenId]).length != 0) {
            delete _tokenURIs[tokenId];
        }
    }
}

contract AsyncArtwork is ERC721, ERC721Enumerable, ERC721Metadata {
    // An event whenever the platform address is updated
    event PlatformAddressUpdated (
        address platformAddress
    );

    // An event whenever royalty amounts are updated
    event RoyaltyAmountUpdated (
        uint256 platformFirstPercentage,
        uint256 platformSecondPercentage,
        uint256 artistSecondPercentage
    );

	// An event whenever a bid is proposed
	event BidProposed (
		uint256 tokenId,
        uint256 bidAmount,
        address bidder
    );

	// An event whenever an bid is withdrawn
    event BidWithdrawn (
    	uint256 tokenId
    );

    // An event whenever a buy now price has been set
    event BuyPriceSet (
    	uint256 tokenId,
    	uint256 price
    );

    // An event when a token has been sold 
    event TokenSale (
        // the id of the token
        uint256 tokenId,
        // the price that the token was sold for
        uint256 salePrice,
    	// the address of the buyer
    	address buyer  	
    );

    // An event whenever a control token has been updated
    event ControlLeverUpdated (
    	// the id of the token
    	uint256 tokenId,
    	// an optional amount that the updater sent to boost priority of the rendering
    	uint256 priorityTip,
        // the ids of the levers that were updated
        uint256[] leverIds,
    	// the previous values that the levers had before this update (for clients who want to animate the change)
    	int256[] previousValues,
    	// the new updated value
    	int256[] updatedValues
	);

    // struct for a token that controls part of the artwork
    struct ControlToken {        
        // number that tracks how many levers there are
        uint256 numControlLevers;
        // false by default, true once instantiated
        bool exists;
        // false by default, true once setup by the artist
        bool isSetup;
        // the levers that this control token can use
        mapping (uint256 => ControlLever) levers;
    }

    // struct for a lever on a control token that can be changed
    struct ControlLever {
        // // The minimum value this token can have (inclusive)
        int256 minValue;
        // The maximum value this token can have (inclusive)
        int256 maxValue;
        // The current value for this token
        int256 currentValue;
        // false by default, true once instantiated
        bool exists;
    } 

	// struct for a pending bid 
	struct PendingBid {
		// the address of the bidder
		address payable bidder;
		// the amount that they bid
		uint256 amount;
		// false by default, true once instantiated
		bool exists;
	}

    // creators who are allowed to mint on this contract
	mapping (address => bool) public whitelistedCreators;
    // for each token, holds an array of the creator collaborators. For layer tokens it will likely just be [artist], for master tokens it may hold multiples
    mapping (uint256 => address payable[]) public uniqueTokenCreators;
    // map a control token id to a control token struct
    mapping (uint256 => ControlToken) controlTokenMapping;
    // map control token ID to its buy price
	mapping (uint256 => uint256) public buyPrices;	
    // map a control token ID to its highest bid
	mapping (uint256 => PendingBid) public pendingBids;
    // track whether this token was sold the first time or not (used for determining whether to use first or secondary sale percentage)
    mapping (uint256 => bool) public tokenDidHaveFirstSale;    
    // mapping of addresses that are allowed to control tokens on your behalf
    mapping (address => address) public permissionedControllers;
    // the percentage of sale that the platform gets on first sales
    uint256 public platformFirstSalePercentage;
    // the percentage of sale that the platform gets on secondary sales
    uint256 public platformSecondSalePercentage;
    // the percentage of sale that an artist gets on secondary sales
    uint256 public artistSecondSalePercentage;
    // gets incremented to placehold for tokens not minted yet
    uint256 public expectedTokenSupply;
    // the address of the platform (for receving commissions and royalties)
    address payable public platformAddress;

	constructor (string memory name, string memory symbol) public ERC721Metadata(name, symbol) {
		// starting royalty amounts
        platformFirstSalePercentage = 10;
        platformSecondSalePercentage = 1;
        artistSecondSalePercentage = 4;

        // by default, the platformAddress is the address that mints this contract
        platformAddress = msg.sender;

        // by default, platform is whitelisted
        updateWhitelist(platformAddress, true);
  	}

    // modifier for only allowing the platform to make a call
    modifier onlyPlatform() {
        require(msg.sender == platformAddress);
        _;    
    }

    modifier onlyWhitelistedCreator() { 
    	require(whitelistedCreators[msg.sender] == true);
    	_; 
    }
    
    function updateWhitelist(address creator, bool state) public onlyPlatform {
    	whitelistedCreators[creator] = state;
    }

    // Allows the current platform address to update to something different
    function updatePlatformAddress(address payable newPlatformAddress) public onlyPlatform {
        platformAddress = newPlatformAddress;

        emit PlatformAddressUpdated(newPlatformAddress);
    }

    // Update the royalty percentages that platform and artists receive on first or secondary sales
    function updateRoyaltyPercentages(uint256 _platformFirstSalePercentage, uint256 _platformSecondSalePercentage, 
        uint256 _artistSecondSalePercentage) public onlyPlatform {
    	// don't let the platform take all of a first sale
    	require (_platformFirstSalePercentage < 100);
    	// don't let secondary percentages take all of a sale either
    	require (_platformSecondSalePercentage.add(_artistSecondSalePercentage) < 100);
        // update the percentage that the platform gets on first sale
        platformFirstSalePercentage = _platformFirstSalePercentage;
        // update the percentage that the platform gets on secondary sales
        platformSecondSalePercentage = _platformSecondSalePercentage;
        // update the percentage that artists get on secondary sales
        artistSecondSalePercentage = _artistSecondSalePercentage;
        // emit an event that contains the new royalty percentage values
        emit RoyaltyAmountUpdated(platformFirstSalePercentage, platformSecondSalePercentage, artistSecondSalePercentage);
    }
    function setupControlToken(uint256 controlTokenId, string memory controlTokenURI,
            int256[] memory leverMinValues, 
            int256[] memory leverMaxValues,
            int256[] memory leverStartValues,
            address payable[] memory additionalCollaborators
        ) public {
        // check that a control token exists for this token id
        require (controlTokenMapping[controlTokenId].exists, "No control token found");
        // ensure that this token is not setup yet
        require (controlTokenMapping[controlTokenId].isSetup == false, "Already setup");        
        // ensure that only the control token artist is attempting this mint
        require(uniqueTokenCreators[controlTokenId][0] == msg.sender, "Must be control token artist");        
        // enforce that the length of all the array lengths are equal
        require((leverMinValues.length == leverMaxValues.length) && (leverMaxValues.length == leverStartValues.length), "Values array mismatch");
        // mint the control token here
        super._safeMint(msg.sender, controlTokenId);
        // set token URI
        super._setTokenURI(controlTokenId, controlTokenURI);        
        // create the control token
        controlTokenMapping[controlTokenId] = ControlToken(leverStartValues.length, true, true);
        // create the control token levers now
        for (uint256 k = 0; k < leverStartValues.length; k++) {
            // enforce that maxValue is greater than or equal to minValue
            require (leverMaxValues[k] >= leverMinValues[k], "Max val must >= min");
            // enforce that currentValue is valid
            require((leverStartValues[k] >= leverMinValues[k]) && (leverStartValues[k] <= leverMaxValues[k]), "Invalid start val");
            // add the lever to this token
            controlTokenMapping[controlTokenId].levers[k] = ControlLever(leverMinValues[k],
                leverMaxValues[k], leverStartValues[k], true);
        }
        // the control token artist can optionally specify additional collaborators on this layer
        for (uint256 i = 0; i < additionalCollaborators.length; i++) {
            // can't provide burn address as collaborator
            require(additionalCollaborators[i] != address(0));

            uniqueTokenCreators[controlTokenId].push(additionalCollaborators[i]);
        }
    }

    function mintArtwork(uint256 artworkTokenId, string memory artworkTokenURI, address payable[] memory controlTokenArtists
    ) public onlyWhitelistedCreator {
        require (artworkTokenId == expectedTokenSupply, "ExpectedTokenSupply different");
        // Mint the token that represents ownership of the entire artwork    
        super._safeMint(msg.sender, artworkTokenId);
        expectedTokenSupply++;

        super._setTokenURI(artworkTokenId, artworkTokenURI);        
        // track the msg.sender address as the artist address for future royalties
        uniqueTokenCreators[artworkTokenId].push(msg.sender);

        // iterate through all control token URIs (1 for each control token)
        for (uint256 i = 0; i < controlTokenArtists.length; i++) {
            // can't provide burn address as artist
            require(controlTokenArtists[i] != address(0));

            // use the curren token supply as the next token id
            uint256 controlTokenId = expectedTokenSupply;
            expectedTokenSupply++;

            uniqueTokenCreators[controlTokenId].push(controlTokenArtists[i]);
            // stub in an existing control token so exists is true
            controlTokenMapping[controlTokenId] = ControlToken(0, true, false);

            if (controlTokenArtists[i] != msg.sender) {
                bool containsControlTokenArtist = false;

                for (uint256 k = 0; k < uniqueTokenCreators[artworkTokenId].length; k++) {
                    if (uniqueTokenCreators[artworkTokenId][k] == controlTokenArtists[i]) {
                        containsControlTokenArtist = true;
                        break;
                    }
                }
                if (containsControlTokenArtist == false) {
                    uniqueTokenCreators[artworkTokenId].push(controlTokenArtists[i]);
                }
            }
        }
    }
    // Bidder functions
    function bid(uint256 tokenId) public payable {
    	// don't let owners/approved bid on their own tokens
        require(_isApprovedOrOwner(msg.sender, tokenId) == false);        
    	// check if there's a high bid
    	if (pendingBids[tokenId].exists) {
    		// enforce that this bid is higher
    		require(msg.value > pendingBids[tokenId].amount, "Bid must be > than current bid");
            // Return bid amount back to bidder
            pendingBids[tokenId].bidder.transfer(pendingBids[tokenId].amount);
    	}
    	// set the new highest bid
    	pendingBids[tokenId] = PendingBid(msg.sender, msg.value, true);
    	// Emit event for the bid proposal
    	emit BidProposed(tokenId, msg.value, msg.sender);
    }
    // allows an address with a pending bid to withdraw it
    function withdrawBid(uint256 tokenId) public {
        // check that there is a bid from the sender to withdraw
        require (pendingBids[tokenId].exists && (pendingBids[tokenId].bidder == msg.sender));
    	// Return bid amount back to bidder
        pendingBids[tokenId].bidder.transfer(pendingBids[tokenId].amount);
		// clear highest bid
		pendingBids[tokenId] = PendingBid(address(0), 0, false);
		// emit an event when the highest bid is withdrawn
		emit BidWithdrawn(tokenId);
    }
    // Buy the artwork for the currently set price
    function takeBuyPrice(uint256 tokenId) public payable {
        // don't let owners/approved buy their own tokens
        require(_isApprovedOrOwner(msg.sender, tokenId) == false);
        // get the sale amount
        uint256 saleAmount = buyPrices[tokenId];
        // check that there is a buy price
        require(saleAmount > 0);
        // check that the buyer sent enough to purchase
        require (msg.value >= saleAmount);
    	// Return all highest bidder's money
        if (pendingBids[tokenId].exists) {
            // Return bid amount back to bidder
            pendingBids[tokenId].bidder.transfer(pendingBids[tokenId].amount);
            // clear highest bid
            pendingBids[tokenId] = PendingBid(address(0), 0, false);
        }        
        onTokenSold(tokenId, saleAmount, msg.sender);
    }

    function distributeFundsToCreators(uint256 amount, address payable[] memory creators) private {
        uint256 creatorShare = amount.div(creators.length);

        for (uint256 i = 0; i < creators.length; i++) {
            creators[i].transfer(creatorShare);
        }
    }

    function onTokenSold(uint256 tokenId, uint256 saleAmount, address to) private {
        // if the first sale already happened, then give the artist + platform the secondary royalty percentage
        if (tokenDidHaveFirstSale[tokenId]) {
        	// give platform its secondary sale percentage
        	uint256 platformAmount = saleAmount.mul(platformSecondSalePercentage).div(100);
        	platformAddress.transfer(platformAmount);
        	// distribute the creator royalty amongst the creators (all artists involved for a base token, sole artist creator for layer )
        	uint256 creatorAmount = saleAmount.mul(artistSecondSalePercentage).div(100);
        	distributeFundsToCreators(creatorAmount, uniqueTokenCreators[tokenId]);            
            // cast the owner to a payable address
            address payable payableOwner = address(uint160(ownerOf(tokenId)));
            // transfer the remaining amount to the owner of the token
            payableOwner.transfer(saleAmount.sub(platformAmount).sub(creatorAmount));
        } else {
        	tokenDidHaveFirstSale[tokenId] = true;
        	// give platform its first sale percentage
        	uint256 platformAmount = saleAmount.mul(platformFirstSalePercentage).div(100);
        	platformAddress.transfer(platformAmount);
        	// this is a token first sale, so distribute the remaining funds to the unique token creators of this token
        	// (if it's a base token it will be all the unique creators, if it's a control token it will be that single artist)                      
            distributeFundsToCreators(saleAmount.sub(platformAmount), uniqueTokenCreators[tokenId]);
        }
        // clear highest bid
        pendingBids[tokenId] = PendingBid(address(0), 0, false);
        // Transfer token to msg.sender
        safeTransferFrom(ownerOf(tokenId), to, tokenId, "");        
        // Emit event
        emit TokenSale(tokenId, saleAmount, to);
    }

    // Owner functions
    // Allow owner to accept the highest bid for a token
    function acceptBid(uint256 tokenId) public {
    	// check if sender is owner/approved of token        
        require(_isApprovedOrOwner(msg.sender, tokenId));
    	// check if there's a bid to accept
    	require (pendingBids[tokenId].exists);
        // process the sale
        onTokenSold(tokenId, pendingBids[tokenId].amount, pendingBids[tokenId].bidder);
    }

    // Allows owner of a control token to set an immediate buy price. Set to 0 to reset.
    function makeBuyPrice(uint256 tokenId, uint256 amount) public {
    	// check if sender is owner/approved of token        
    	require(_isApprovedOrOwner(msg.sender, tokenId));        
    	// set the buy price
    	buyPrices[tokenId] = amount;
    	// emit event
    	emit BuyPriceSet(tokenId, amount);
    }

    // return the min, max, and current value of a control lever
    function getControlToken(uint256 controlTokenId) public view returns (int256[] memory) {
        require(controlTokenMapping[controlTokenId].exists);
        
        ControlToken storage controlToken = controlTokenMapping[controlTokenId];

        int256[] memory returnValues = new int256[](controlToken.numControlLevers.mul(3));
        uint256 returnValIndex = 0;

        // iterate through all the control levers for this control token
        for (uint256 i = 0; i < controlToken.numControlLevers; i++) {        
            returnValues[returnValIndex] = controlToken.levers[i].minValue;
            returnValIndex = returnValIndex.add(1);

            returnValues[returnValIndex] = controlToken.levers[i].maxValue;
            returnValIndex = returnValIndex.add(1);

            returnValues[returnValIndex] = controlToken.levers[i].currentValue; 
            returnValIndex = returnValIndex.add(1);
        }        

        return returnValues;
    }
    // anyone can grant permission to another address to control tokens on their behalf. Set to Address(0) to reset.
    function grantControlPermission(address permissioned) public {
        permissionedControllers[msg.sender] = permissioned;
    }

    // Allows owner (or permissioned user) of a control token to update its lever values
    // Optionally accept a payment to increase speed of rendering priority
    function useControlToken(uint256 controlTokenId, uint256[] memory leverIds, int256[] memory newValues) public payable {
    	// check if sender is owner/approved of token OR if they're a permissioned controller for the token owner      
        require(_isApprovedOrOwner(msg.sender, controlTokenId) || (permissionedControllers[ownerOf(controlTokenId)] == msg.sender),
            "Owner or permissioned only"); 
        // collect the previous lever values for the event emit below
        int256[] memory previousValues = new int256[](newValues.length);

        for (uint256 i = 0; i < leverIds.length; i++) {
            // get the control lever
            ControlLever storage lever = controlTokenMapping[controlTokenId].levers[leverIds[i]];

            // Enforce that the new value is valid        
            require((newValues[i] >= lever.minValue) && (newValues[i] <= lever.maxValue), "Invalid val");

            // Enforce that the new value is different
            require(newValues[i] != lever.currentValue, "Must provide different val");

            // grab previous value for the event emit
            int256 previousValue = lever.currentValue;
            
            // Update token current value
            lever.currentValue = newValues[i];

            // collect the previous lever values for the event emit below
            previousValues[i] = previousValue;
        }

        // if there's a payment then send it to the platform (for higher priority updates)
        if (msg.value > 0) {
        	platformAddress.transfer(msg.value);
        }
        
    	// emit event
    	emit ControlLeverUpdated(controlTokenId, msg.value, leverIds, previousValues, newValues);
    }

    // override the default transfer
    function _transferFrom(address from, address to, uint256 tokenId) internal {        
        super._transferFrom(from, to, tokenId);        
        // clear a buy now price after being transferred
        buyPrices[tokenId] = 0;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bidAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"bidder","type":"address"}],"name":"BidProposed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"BidWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"BuyPriceSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"priorityTip","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"leverIds","type":"uint256[]"},{"indexed":false,"internalType":"int256[]","name":"previousValues","type":"int256[]"},{"indexed":false,"internalType":"int256[]","name":"updatedValues","type":"int256[]"}],"name":"ControlLeverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"platformAddress","type":"address"}],"name":"PlatformAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"platformFirstPercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"platformSecondPercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"artistSecondPercentage","type":"uint256"}],"name":"RoyaltyAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"salePrice","type":"uint256"},{"indexed":false,"internalType":"address","name":"buyer","type":"address"}],"name":"TokenSale","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"},{"constant":false,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"acceptBid","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":[],"name":"artistSecondSalePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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":false,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"bid","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"buyPrices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"expectedTokenSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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":"uint256","name":"controlTokenId","type":"uint256"}],"name":"getControlToken","outputs":[{"internalType":"int256[]","name":"","type":"int256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"permissioned","type":"address"}],"name":"grantControlPermission","outputs":[],"payable":false,"stateMutability":"nonpayable","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":false,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"makeBuyPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"artworkTokenId","type":"uint256"},{"internalType":"string","name":"artworkTokenURI","type":"string"},{"internalType":"address payable[]","name":"controlTokenArtists","type":"address[]"}],"name":"mintArtwork","outputs":[],"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pendingBids","outputs":[{"internalType":"address payable","name":"bidder","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"permissionedControllers","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"platformAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"platformFirstSalePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"platformSecondSalePercentage","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":"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":"uint256","name":"controlTokenId","type":"uint256"},{"internalType":"string","name":"controlTokenURI","type":"string"},{"internalType":"int256[]","name":"leverMinValues","type":"int256[]"},{"internalType":"int256[]","name":"leverMaxValues","type":"int256[]"},{"internalType":"int256[]","name":"leverStartValues","type":"int256[]"},{"internalType":"address payable[]","name":"additionalCollaborators","type":"address[]"}],"name":"setupControlToken","outputs":[],"payable":false,"stateMutability":"nonpayable","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":false,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"takeBuyPrice","outputs":[],"payable":true,"stateMutability":"payable","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":"uint256","name":"","type":"uint256"}],"name":"tokenDidHaveFirstSale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"uniqueTokenCreators","outputs":[{"internalType":"address payable","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address payable","name":"newPlatformAddress","type":"address"}],"name":"updatePlatformAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_platformFirstSalePercentage","type":"uint256"},{"internalType":"uint256","name":"_platformSecondSalePercentage","type":"uint256"},{"internalType":"uint256","name":"_artistSecondSalePercentage","type":"uint256"}],"name":"updateRoyaltyPercentages","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"updateWhitelist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"controlTokenId","type":"uint256"},{"internalType":"uint256[]","name":"leverIds","type":"uint256[]"},{"internalType":"int256[]","name":"newValues","type":"int256[]"}],"name":"useControlToken","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedCreators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawBid","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620036c4380380620036c4833981810160405260408110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b9083019060208201858111156200006e57600080fd5b82516401000000008111828201881017156200008957600080fd5b82525081516020918201929091019080838360005b83811015620000b85781810151838201526020016200009e565b50505050905090810190601f168015620000e65780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200010a57600080fd5b9083019060208201858111156200012057600080fd5b82516401000000008111828201881017156200013b57600080fd5b82525081516020918201929091019080838360005b838110156200016a57818101518382015260200162000150565b50505050905090810190601f168015620001985780820380516001836020036101000a031916815260200191505b5060405250839150829050620001be6301ffc9a760e01b6001600160e01b036200028b16565b620001d96380ac58cd60e01b6001600160e01b036200028b16565b620001f463780e9d6360e01b6001600160e01b036200028b16565b81516200020990600990602085019062000353565b5080516200021f90600a90602084019062000353565b506200023b635b5e139f60e01b6001600160e01b036200028b16565b5050600a601355600160148190556004601555601780546001600160a01b03191633179081905562000283916001600160a01b0391909116906001600160e01b036200031016565b5050620003f8565b6001600160e01b03198082161415620002eb576040805162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015290519081900360640190fd5b6001600160e01b0319166000908152602081905260409020805460ff19166001179055565b6017546001600160a01b031633146200032857600080fd5b6001600160a01b03919091166000908152600c60205260409020805460ff1916911515919091179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200039657805160ff1916838001178555620003c6565b82800160010185558215620003c6579182015b82811115620003c6578251825591602001919060010190620003a9565b50620003d4929150620003d8565b5090565b620003f591905b80821115620003d45760008155600101620003df565b90565b6132bc80620004086000396000f3fe60806040526004361061023b5760003560e01c8063755db7b31161012e578063b88d4fde116100ab578063d66767ab1161006f578063d66767ab14610eae578063d91c070c14610ec3578063dbe55e5614610ef3578063e66c7f3514610f08578063e985e9c514610f255761023b565b8063b88d4fde14610d35578063b8c1801514610e06578063bab2d11114610e1b578063c87b56dd14610e30578063cf8589b914610e5a5761023b565b806398207051116100f25780639820705114610b3357806398c8103e14610b66578063a22cb46514610ca0578063a90d6de314610cdb578063a94141a114610d055761023b565b8063755db7b3146109115780638cb6ddcb14610a3b5780638f9f193f14610a7157806395d89b4114610aa457806396bc50b014610ab95761023b565b80632b1fd58a116101bc578063462399cd11610180578063462399cd1461084b5780634f6ccce714610875578063556d86281461089f5780636352211e146108b457806370a08231146108de5761023b565b80632b1fd58a146107555780632f745c591461077f57806341afca00146107b857806342842e0e146107eb578063454a2ab31461082e5761023b565b80630d392cd9116102035780630d392cd9146103c65780630eaaf4c81461040157806318160ddd1461042b5780631e9b0f521461045257806323b872dd146107125761023b565b806301ffc9a714610240578063041bb6ff1461028857806306fdde03146102bb578063081812fc14610345578063095ea7b31461038b575b600080fd5b34801561024c57600080fd5b506102746004803603602081101561026357600080fd5b50356001600160e01b031916610f60565b604080519115158252519081900360200190f35b34801561029457600080fd5b50610274600480360360208110156102ab57600080fd5b50356001600160a01b0316610f7f565b3480156102c757600080fd5b506102d0610f94565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561030a5781810151838201526020016102f2565b50505050905090810190601f1680156103375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035157600080fd5b5061036f6004803603602081101561036857600080fd5b503561102b565b604080516001600160a01b039092168252519081900360200190f35b34801561039757600080fd5b506103c4600480360360408110156103ae57600080fd5b506001600160a01b038135169060200135611046565b005b3480156103d257600080fd5b506103c4600480360360408110156103e957600080fd5b506001600160a01b03813516906020013515156110f3565b34801561040d57600080fd5b506103c46004803603602081101561042457600080fd5b5035611135565b34801561043757600080fd5b50610440611256565b60408051918252519081900360200190f35b34801561045e57600080fd5b506103c4600480360360c081101561047557600080fd5b81359190810190604081016020820135600160201b81111561049657600080fd5b8201836020820111156104a857600080fd5b803590602001918460018302840111600160201b831117156104c957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561051b57600080fd5b82018360208201111561052d57600080fd5b803590602001918460208302840111600160201b8311171561054e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561059d57600080fd5b8201836020820111156105af57600080fd5b803590602001918460208302840111600160201b831117156105d057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561061f57600080fd5b82018360208201111561063157600080fd5b803590602001918460208302840111600160201b8311171561065257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156106a157600080fd5b8201836020820111156106b357600080fd5b803590602001918460208302840111600160201b831117156106d457600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061125c945050505050565b34801561071e57600080fd5b506103c46004803603606081101561073557600080fd5b506001600160a01b038135811691602081013590911690604001356116d4565b34801561076157600080fd5b506103c46004803603602081101561077857600080fd5b50356116f7565b34801561078b57600080fd5b50610440600480360360408110156107a257600080fd5b506001600160a01b038135169060200135611754565b3480156107c457600080fd5b506103c4600480360360208110156107db57600080fd5b50356001600160a01b031661178c565b3480156107f757600080fd5b506103c46004803603606081101561080e57600080fd5b506001600160a01b038135811691602081013590911690604001356117bb565b6103c46004803603602081101561084457600080fd5b50356117d6565b34801561085757600080fd5b506102746004803603602081101561086e57600080fd5b5035611957565b34801561088157600080fd5b506104406004803603602081101561089857600080fd5b503561196c565b3480156108ab57600080fd5b5061044061198d565b3480156108c057600080fd5b5061036f600480360360208110156108d757600080fd5b5035611993565b3480156108ea57600080fd5b506104406004803603602081101561090157600080fd5b50356001600160a01b03166119b5565b6103c46004803603606081101561092757600080fd5b81359190810190604081016020820135600160201b81111561094857600080fd5b82018360208201111561095a57600080fd5b803590602001918460208302840111600160201b8311171561097b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156109ca57600080fd5b8201836020820111156109dc57600080fd5b803590602001918460208302840111600160201b831117156109fd57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506119eb945050505050565b348015610a4757600080fd5b506103c460048036036060811015610a5e57600080fd5b5080359060208101359060400135611d7a565b348015610a7d57600080fd5b506103c460048036036020811015610a9457600080fd5b50356001600160a01b0316611e0e565b348015610ab057600080fd5b506102d0611e79565b348015610ac557600080fd5b50610ae360048036036020811015610adc57600080fd5b5035611eda565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610b1f578181015183820152602001610b07565b505050509050019250505060405180910390f35b348015610b3f57600080fd5b5061036f60048036036020811015610b5657600080fd5b50356001600160a01b031661202d565b348015610b7257600080fd5b506103c460048036036060811015610b8957600080fd5b81359190810190604081016020820135600160201b811115610baa57600080fd5b820183602082011115610bbc57600080fd5b803590602001918460018302840111600160201b83111715610bdd57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b811115610c2f57600080fd5b820183602082011115610c4157600080fd5b803590602001918460208302840111600160201b83111715610c6257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550612048945050505050565b348015610cac57600080fd5b506103c460048036036040811015610cc357600080fd5b506001600160a01b0381351690602001351515612312565b348015610ce757600080fd5b5061044060048036036020811015610cfe57600080fd5b5035612396565b348015610d1157600080fd5b5061036f60048036036040811015610d2857600080fd5b50803590602001356123a8565b348015610d4157600080fd5b506103c460048036036080811015610d5857600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b811115610d9257600080fd5b820183602082011115610da457600080fd5b803590602001918460018302840111600160201b83111715610dc557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506123dd945050505050565b348015610e1257600080fd5b506104406123fb565b348015610e2757600080fd5b50610440612401565b348015610e3c57600080fd5b506102d060048036036020811015610e5357600080fd5b5035612407565b348015610e6657600080fd5b50610e8460048036036020811015610e7d57600080fd5b50356124a8565b604080516001600160a01b0390941684526020840192909252151582820152519081900360600190f35b348015610eba57600080fd5b506104406124d6565b348015610ecf57600080fd5b506103c460048036036040811015610ee657600080fd5b50803590602001356124dc565b348015610eff57600080fd5b5061036f612540565b6103c460048036036020811015610f1e57600080fd5b503561254f565b348015610f3157600080fd5b5061027460048036036040811015610f4857600080fd5b506001600160a01b0381358116916020013516612661565b6001600160e01b03191660009081526020819052604090205460ff1690565b600c6020526000908152604090205460ff1681565b60098054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156110205780601f10610ff557610100808354040283529160200191611020565b820191906000526020600020905b81548152906001019060200180831161100357829003601f168201915b505050505090505b90565b6000908152600260205260409020546001600160a01b031690565b600061105182611993565b9050806001600160a01b0316836001600160a01b0316141561107257600080fd5b336001600160a01b038216148061108e575061108e8133612661565b61109757600080fd5b60008281526002602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6017546001600160a01b0316331461110a57600080fd5b6001600160a01b03919091166000908152600c60205260409020805460ff1916911515919091179055565b60008181526010602052604090206002015460ff16801561116c57506000818152601060205260409020546001600160a01b031633145b61117557600080fd5b600081815260106020526040808220805460019091015491516001600160a01b039091169282156108fc02929190818181858888f193505050501580156111c0573d6000803e3d6000fd5b5060408051606081018252600080825260208083018281528385018381528684526010835292859020935184546001600160a01b0319166001600160a01b0390911617845551600184015590516002909201805460ff191692151592909217909155815183815291517f99319fa1a5fca42d549d4d49989116496775f906f62e0e2ff2ea3c3aacdefa279281900390910190a150565b60075490565b6000868152600e602052604090206001015460ff166112bb576040805162461bcd60e51b8152602060048201526016602482015275139bc818dbdb9d1c9bdb081d1bdad95b88199bdd5b9960521b604482015290519081900360640190fd5b6000868152600e6020526040902060010154610100900460ff1615611317576040805162461bcd60e51b815260206004820152600d60248201526c0416c726561647920736574757609c1b604482015290519081900360640190fd5b6000868152600d60205260408120805433929061133057fe5b6000918252602090912001546001600160a01b031614611397576040805162461bcd60e51b815260206004820152601c60248201527f4d75737420626520636f6e74726f6c20746f6b656e2061727469737400000000604482015290519081900360640190fd5b825184511480156113a9575081518351145b6113f2576040805162461bcd60e51b81526020600482015260156024820152740acc2d8eacae640c2e4e4c2f240dad2e6dac2e8c6d605b1b604482015290519081900360640190fd5b6113fc338761268f565b61140686866126a9565b60408051606081018252835181526001602080830182815283850183815260008c8152600e9093529482209351845551929091018054935115156101000261ff001993151560ff1990951694909417929092169290921790555b825181101561162a5784818151811061147557fe5b602002602001015184828151811061148957fe5b602002602001015112156114da576040805162461bcd60e51b815260206004820152601360248201527226b0bc103b30b61036bab9ba101f1e9036b4b760691b604482015290519081900360640190fd5b8481815181106114e657fe5b60200260200101518382815181106114fa57fe5b602002602001015112158015611536575083818151811061151757fe5b602002602001015183828151811061152b57fe5b602002602001015113155b61157b576040805162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081cdd185c9d081d985b607a1b604482015290519081900360640190fd5b604051806080016040528086838151811061159257fe5b602002602001015181526020018583815181106115ab57fe5b602002602001015181526020018483815181106115c457fe5b6020908102919091018101518252600191810182905260008a8152600e825260408082208683526002908101845291819020855181559285015183850155840151908201556060909201516003909201805460ff19169215159290921790915501611460565b5060005b81518110156116cb5760006001600160a01b031682828151811061164e57fe5b60200260200101516001600160a01b0316141561166a57600080fd5b6000878152600d60205260409020825183908390811061168657fe5b60209081029190910181015182546001808201855560009485529290932090920180546001600160a01b0319166001600160a01b03909316929092179091550161162e565b50505050505050565b6116de3382612722565b6116e757600080fd5b6116f2838383612781565b505050565b6117013382612722565b61170a57600080fd5b60008181526010602052604090206002015460ff1661172857600080fd5b6000818152601060205260409020600181015490546117519183916001600160a01b031661279f565b50565b6001600160a01b038216600090815260056020526040812080548390811061177857fe5b906000526020600020015490505b92915050565b33600090815260126020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6116f2838383604051806020016040528060008152506123dd565b6117e03382612722565b156117ea57600080fd5b60008181526010602052604090206002015460ff16156118b6576000818152601060205260409020600101543411611869576040805162461bcd60e51b815260206004820152601e60248201527f426964206d757374206265203e207468616e2063757272656e74206269640000604482015290519081900360640190fd5b600081815260106020526040808220805460019091015491516001600160a01b039091169282156108fc02929190818181858888f193505050501580156118b4573d6000803e3d6000fd5b505b604080516060808201835233808352346020808501828152600186880181815260008a815260108552899020975188546001600160a01b0319166001600160a01b03909116178855915190870155516002909501805460ff1916951515959095179094558451868152938401528284015291517fcbf61548a249040d379a7f7a4486a18d78824bce978077f4943fb55e111af1c1929181900390910190a150565b60116020526000908152604090205460ff1681565b60006007828154811061197b57fe5b90600052602060002001549050919050565b60165481565b6000818152600160205260408120546001600160a01b03168061178657600080fd5b60006001600160a01b0382166119ca57600080fd5b6001600160a01b038216600090815260036020526040902061178690612ace565b6119f53384612722565b80611a2857503360126000611a0986611993565b6001600160a01b03908116825260208201929092526040016000205416145b611a79576040805162461bcd60e51b815260206004820152601a60248201527f4f776e6572206f72207065726d697373696f6e6564206f6e6c79000000000000604482015290519081900360640190fd5b60608151604051908082528060200260200182016040528015611aa6578160200160208202803883390190505b50905060005b8351811015611c21576000600e60008781526020019081526020016000206002016000868481518110611adb57fe5b6020026020010151815260200190815260200160002090508060000154848381518110611b0457fe5b602002602001015112158015611b3157508060010154848381518110611b2657fe5b602002602001015113155b611b70576040805162461bcd60e51b815260206004820152600b60248201526a125b9d985b1a59081d985b60aa1b604482015290519081900360640190fd5b8060020154848381518110611b8157fe5b60200260200101511415611bdc576040805162461bcd60e51b815260206004820152601a60248201527f4d7573742070726f7669646520646966666572656e742076616c000000000000604482015290519081900360640190fd5b60028101548451859084908110611bef57fe5b6020026020010151826002018190555080848481518110611c0c57fe5b60209081029190910101525050600101611aac565b503415611c63576017546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015611c61573d6000803e3d6000fd5b505b7f1864c0e277c81ec1608d84e54d6f6c849f227acc0da19d9169fb0094d962f1c9843485848660405180868152602001858152602001806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b83811015611cdd578181015183820152602001611cc5565b50505050905001848103835286818151815260200191508051906020019060200280838360005b83811015611d1c578181015183820152602001611d04565b50505050905001848103825285818151815260200191508051906020019060200280838360005b83811015611d5b578181015183820152602001611d43565b505050509050019850505050505050505060405180910390a150505050565b6017546001600160a01b03163314611d9157600080fd5b60648310611d9e57600080fd5b6064611db0838363ffffffff612ad216565b10611dba57600080fd5b601383905560148290556015819055604080518481526020810184905280820183905290517fd946966340b57e0fdcf288c7bb51c470709dcfcd5d883779d28cf85679f758149181900360600190a1505050565b6017546001600160a01b03163314611e2557600080fd5b601780546001600160a01b0383166001600160a01b0319909116811790915560408051918252517fb29030287f33baad1941013143d2e1bd5e66c87318f0bd99bc0fae51fe4b191f9181900360200190a150565b600a8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156110205780601f10610ff557610100808354040283529160200191611020565b6000818152600e602052604090206001015460609060ff16611efb57600080fd5b6000828152600e602052604090208054606090611f1f90600363ffffffff612b3316565b604051908082528060200260200182016040528015611f48578160200160208202803883390190505b5090506000805b83548110156120235760008181526002850160205260409020548351849084908110611f7757fe5b6020908102919091010152611f9382600163ffffffff612ad216565b915083600201600082815260200190815260200160002060010154838381518110611fba57fe5b6020908102919091010152611fd682600163ffffffff612ad216565b915083600201600082815260200190815260200160002060020154838381518110611ffd57fe5b602090810291909101015261201982600163ffffffff612ad216565b9150600101611f4f565b5090949350505050565b6012602052600090815260409020546001600160a01b031681565b336000908152600c602052604090205460ff16151560011461206957600080fd5b60165483146120bf576040805162461bcd60e51b815260206004820152601d60248201527f4578706563746564546f6b656e537570706c7920646966666572656e74000000604482015290519081900360640190fd5b6120c9338461268f565b6016805460010190556120dc83836126a9565b6000838152600d60209081526040822080546001810182559083529082200180546001600160a01b031916331790555b815181101561230c5760006001600160a01b031682828151811061212c57fe5b60200260200101516001600160a01b0316141561214857600080fd5b60168054600181019091556000818152600d60205260409020835184908490811061216f57fe5b602090810291909101810151825460018082018555600094855283852090910180546001600160a01b0319166001600160a01b039093169290921790915560408051606081018252848152808401838152818301868152878752600e90955291909420935184555192018054915160ff199092169215159290921761ff001916610100911515919091021790558251339084908490811061220c57fe5b60200260200101516001600160a01b031614612303576000805b6000878152600d60205260409020548110156122a35784848151811061224857fe5b60200260200101516001600160a01b0316600d6000898152602001908152602001600020828154811061227757fe5b6000918252602090912001546001600160a01b0316141561229b57600191506122a3565b600101612226565b5080612301576000868152600d6020526040902084518590859081106122c557fe5b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b039092169190911790555b505b5060010161210c565b50505050565b6001600160a01b03821633141561232857600080fd5b3360008181526004602090815260408083206001600160a01b03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600f6020526000908152604090205481565b600d60205281600052604060002081815481106123c157fe5b6000918252602090912001546001600160a01b03169150829050565b6123e73383612722565b6123f057600080fd5b61230c848484612781565b60135481565b60155481565b6000818152600b602090815260409182902080548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084526060939283018282801561249c5780601f106124715761010080835404028352916020019161249c565b820191906000526020600020905b81548152906001019060200180831161247f57829003601f168201915b50505050509050919050565b6010602052600090815260409020805460018201546002909201546001600160a01b03909116919060ff1683565b60145481565b6124e63383612722565b6124ef57600080fd5b6000828152600f6020908152604091829020839055815184815290810183905281517fd765eb1cf8aab1a01381fef8dcc9f755ef2d2233849716da96a90e32da84821a929181900390910190a15050565b6017546001600160a01b031681565b6125593382612722565b1561256357600080fd5b6000818152600f60205260409020548061257c57600080fd5b8034101561258957600080fd5b60008281526010602052604090206002015460ff161561265257600082815260106020526040808220805460019091015491516001600160a01b039091169282156108fc02929190818181858888f193505050501580156125ee573d6000803e3d6000fd5b506040805160608101825260008082526020808301828152838501838152878452601090925293909120915182546001600160a01b0319166001600160a01b039091161782559151600182015590516002909101805460ff19169115159190911790555b61265d82823361279f565b5050565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b61265d828260405180602001604052806000815250612b8c565b6126b282612b96565b612703576040805162461bcd60e51b815260206004820152601c60248201527f55524920736574206f66206e6f6e6578697374656e7420746f6b656e00000000604482015290519081900360640190fd5b6000828152600b6020908152604090912082516116f2928401906131ae565b60008061272e83611993565b9050806001600160a01b0316846001600160a01b031614806127695750836001600160a01b031661275e8461102b565b6001600160a01b0316145b8061277957506127798185612661565b949350505050565b61278c838383612bb3565b6000908152600f60205260408120555050565b60008381526011602052604090205460ff16156129115760006127de60646127d260145486612b3390919063ffffffff16565b9063ffffffff612bd216565b6017546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015612819573d6000803e3d6000fd5b50600061283660646127d260155487612b3390919063ffffffff16565b6000868152600d602090815260409182902080548351818402810184019094528084529394506128a69385939283018282801561289c57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161287e575b5050505050612c14565b60006128b186611993565b90506001600160a01b0381166108fc6128e0846128d4898863ffffffff612c8d16565b9063ffffffff612c8d16565b6040518115909202916000818181858888f19350505050158015612908573d6000803e3d6000fd5b505050506129fc565b6000838152601160205260408120805460ff19166001179055601354612945906064906127d290869063ffffffff612b3316565b6017546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015612980573d6000803e3d6000fd5b506129fa612994848363ffffffff612c8d16565b6000868152600d60209081526040918290208054835181840281018401909452808452909183018282801561289c576020028201919060005260206000209081546001600160a01b0316815260019091019060200180831161287e575050505050612c14565b505b6040805160608101825260008082526020808301828152838501838152888452601090925293909120915182546001600160a01b0319166001600160a01b039091161782559151600182015590516002909101805460ff1916911515919091179055612a81612a6a84611993565b8285604051806020016040528060008152506123dd565b60408051848152602081018490526001600160a01b0383168183015290517fe8038e253f57f3f9c7277af1d801786319db71cc5491fe5db55a0e04f1b3466f9181900360600190a1505050565b5490565b600082820183811015612b2c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600082612b4257506000611786565b82820282848281612b4f57fe5b0414612b2c5760405162461bcd60e51b81526004018080602001828103825260218152602001806132676021913960400191505060405180910390fd5b6116f28383612ccf565b6000908152600160205260409020546001600160a01b0316151590565b612bbe838383612cec565b612bc88382612e00565b6116f28282612ef5565b6000612b2c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612f33565b6000612c2a825184612bd290919063ffffffff16565b905060005b825181101561230c57828181518110612c4457fe5b60200260200101516001600160a01b03166108fc839081150290604051600060405180830381858888f19350505050158015612c84573d6000803e3d6000fd5b50600101612c2f565b6000612b2c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612fd5565b612cd9828261302f565b612ce38282612ef5565b61265d8161310f565b826001600160a01b0316612cff82611993565b6001600160a01b031614612d46576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b038216612d5957600080fd5b612d6281613153565b6001600160a01b0383166000908152600360205260409020612d839061318e565b6001600160a01b0382166000908152600360205260409020612da4906131a5565b60008181526001602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216600090815260056020526040812054612e2a90600163ffffffff612c8d16565b600083815260066020526040902054909150808214612ec5576001600160a01b0384166000908152600560205260408120805484908110612e6757fe5b906000526020600020015490508060056000876001600160a01b03166001600160a01b031681526020019081526020016000208381548110612ea557fe5b600091825260208083209091019290925591825260069052604090208190555b6001600160a01b0384166000908152600560205260409020805490612eee90600019830161322c565b5050505050565b6001600160a01b0390911660009081526005602081815260408084208054868652600684529185208290559282526001810183559183529091200155565b60008183612fbf5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612f84578181015183820152602001612f6c565b50505050905090810190601f168015612fb15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612fcb57fe5b0495945050505050565b600081848411156130275760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612f84578181015183820152602001612f6c565b505050900390565b6001600160a01b03821661304257600080fd5b61304b81612b96565b15613094576040805162461bcd60e51b81526020600482015260146024820152731d1bdad95b88185b1c9958591e481b5a5b9d195960621b604482015290519081900360640190fd5b600081815260016020908152604080832080546001600160a01b0319166001600160a01b0387169081179091558352600390915290206130d3906131a5565b60405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600780546000838152600860205260408120829055600182018355919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880155565b6000818152600260205260409020546001600160a01b03161561175157600090815260026020526040902080546001600160a01b0319169055565b80546131a190600163ffffffff612c8d16565b9055565b80546001019055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106131ef57805160ff191683800117855561321c565b8280016001018555821561321c579182015b8281111561321c578251825591602001919060010190613201565b5061322892915061324c565b5090565b8154818355818111156116f2576000838152602090206116f29181019083015b61102891905b80821115613228576000815560010161325256fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158200936a4eac3bd0be25d4c56cc9bbe34abecbb5db23cd25afd9077a952b1e3ca0364736f6c634300051000320000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000094173796e6320417274000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000054153594e43000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x60806040526004361061023b5760003560e01c8063755db7b31161012e578063b88d4fde116100ab578063d66767ab1161006f578063d66767ab14610eae578063d91c070c14610ec3578063dbe55e5614610ef3578063e66c7f3514610f08578063e985e9c514610f255761023b565b8063b88d4fde14610d35578063b8c1801514610e06578063bab2d11114610e1b578063c87b56dd14610e30578063cf8589b914610e5a5761023b565b806398207051116100f25780639820705114610b3357806398c8103e14610b66578063a22cb46514610ca0578063a90d6de314610cdb578063a94141a114610d055761023b565b8063755db7b3146109115780638cb6ddcb14610a3b5780638f9f193f14610a7157806395d89b4114610aa457806396bc50b014610ab95761023b565b80632b1fd58a116101bc578063462399cd11610180578063462399cd1461084b5780634f6ccce714610875578063556d86281461089f5780636352211e146108b457806370a08231146108de5761023b565b80632b1fd58a146107555780632f745c591461077f57806341afca00146107b857806342842e0e146107eb578063454a2ab31461082e5761023b565b80630d392cd9116102035780630d392cd9146103c65780630eaaf4c81461040157806318160ddd1461042b5780631e9b0f521461045257806323b872dd146107125761023b565b806301ffc9a714610240578063041bb6ff1461028857806306fdde03146102bb578063081812fc14610345578063095ea7b31461038b575b600080fd5b34801561024c57600080fd5b506102746004803603602081101561026357600080fd5b50356001600160e01b031916610f60565b604080519115158252519081900360200190f35b34801561029457600080fd5b50610274600480360360208110156102ab57600080fd5b50356001600160a01b0316610f7f565b3480156102c757600080fd5b506102d0610f94565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561030a5781810151838201526020016102f2565b50505050905090810190601f1680156103375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035157600080fd5b5061036f6004803603602081101561036857600080fd5b503561102b565b604080516001600160a01b039092168252519081900360200190f35b34801561039757600080fd5b506103c4600480360360408110156103ae57600080fd5b506001600160a01b038135169060200135611046565b005b3480156103d257600080fd5b506103c4600480360360408110156103e957600080fd5b506001600160a01b03813516906020013515156110f3565b34801561040d57600080fd5b506103c46004803603602081101561042457600080fd5b5035611135565b34801561043757600080fd5b50610440611256565b60408051918252519081900360200190f35b34801561045e57600080fd5b506103c4600480360360c081101561047557600080fd5b81359190810190604081016020820135600160201b81111561049657600080fd5b8201836020820111156104a857600080fd5b803590602001918460018302840111600160201b831117156104c957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561051b57600080fd5b82018360208201111561052d57600080fd5b803590602001918460208302840111600160201b8311171561054e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561059d57600080fd5b8201836020820111156105af57600080fd5b803590602001918460208302840111600160201b831117156105d057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561061f57600080fd5b82018360208201111561063157600080fd5b803590602001918460208302840111600160201b8311171561065257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156106a157600080fd5b8201836020820111156106b357600080fd5b803590602001918460208302840111600160201b831117156106d457600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061125c945050505050565b34801561071e57600080fd5b506103c46004803603606081101561073557600080fd5b506001600160a01b038135811691602081013590911690604001356116d4565b34801561076157600080fd5b506103c46004803603602081101561077857600080fd5b50356116f7565b34801561078b57600080fd5b50610440600480360360408110156107a257600080fd5b506001600160a01b038135169060200135611754565b3480156107c457600080fd5b506103c4600480360360208110156107db57600080fd5b50356001600160a01b031661178c565b3480156107f757600080fd5b506103c46004803603606081101561080e57600080fd5b506001600160a01b038135811691602081013590911690604001356117bb565b6103c46004803603602081101561084457600080fd5b50356117d6565b34801561085757600080fd5b506102746004803603602081101561086e57600080fd5b5035611957565b34801561088157600080fd5b506104406004803603602081101561089857600080fd5b503561196c565b3480156108ab57600080fd5b5061044061198d565b3480156108c057600080fd5b5061036f600480360360208110156108d757600080fd5b5035611993565b3480156108ea57600080fd5b506104406004803603602081101561090157600080fd5b50356001600160a01b03166119b5565b6103c46004803603606081101561092757600080fd5b81359190810190604081016020820135600160201b81111561094857600080fd5b82018360208201111561095a57600080fd5b803590602001918460208302840111600160201b8311171561097b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156109ca57600080fd5b8201836020820111156109dc57600080fd5b803590602001918460208302840111600160201b831117156109fd57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506119eb945050505050565b348015610a4757600080fd5b506103c460048036036060811015610a5e57600080fd5b5080359060208101359060400135611d7a565b348015610a7d57600080fd5b506103c460048036036020811015610a9457600080fd5b50356001600160a01b0316611e0e565b348015610ab057600080fd5b506102d0611e79565b348015610ac557600080fd5b50610ae360048036036020811015610adc57600080fd5b5035611eda565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610b1f578181015183820152602001610b07565b505050509050019250505060405180910390f35b348015610b3f57600080fd5b5061036f60048036036020811015610b5657600080fd5b50356001600160a01b031661202d565b348015610b7257600080fd5b506103c460048036036060811015610b8957600080fd5b81359190810190604081016020820135600160201b811115610baa57600080fd5b820183602082011115610bbc57600080fd5b803590602001918460018302840111600160201b83111715610bdd57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b811115610c2f57600080fd5b820183602082011115610c4157600080fd5b803590602001918460208302840111600160201b83111715610c6257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550612048945050505050565b348015610cac57600080fd5b506103c460048036036040811015610cc357600080fd5b506001600160a01b0381351690602001351515612312565b348015610ce757600080fd5b5061044060048036036020811015610cfe57600080fd5b5035612396565b348015610d1157600080fd5b5061036f60048036036040811015610d2857600080fd5b50803590602001356123a8565b348015610d4157600080fd5b506103c460048036036080811015610d5857600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b811115610d9257600080fd5b820183602082011115610da457600080fd5b803590602001918460018302840111600160201b83111715610dc557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506123dd945050505050565b348015610e1257600080fd5b506104406123fb565b348015610e2757600080fd5b50610440612401565b348015610e3c57600080fd5b506102d060048036036020811015610e5357600080fd5b5035612407565b348015610e6657600080fd5b50610e8460048036036020811015610e7d57600080fd5b50356124a8565b604080516001600160a01b0390941684526020840192909252151582820152519081900360600190f35b348015610eba57600080fd5b506104406124d6565b348015610ecf57600080fd5b506103c460048036036040811015610ee657600080fd5b50803590602001356124dc565b348015610eff57600080fd5b5061036f612540565b6103c460048036036020811015610f1e57600080fd5b503561254f565b348015610f3157600080fd5b5061027460048036036040811015610f4857600080fd5b506001600160a01b0381358116916020013516612661565b6001600160e01b03191660009081526020819052604090205460ff1690565b600c6020526000908152604090205460ff1681565b60098054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156110205780601f10610ff557610100808354040283529160200191611020565b820191906000526020600020905b81548152906001019060200180831161100357829003601f168201915b505050505090505b90565b6000908152600260205260409020546001600160a01b031690565b600061105182611993565b9050806001600160a01b0316836001600160a01b0316141561107257600080fd5b336001600160a01b038216148061108e575061108e8133612661565b61109757600080fd5b60008281526002602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6017546001600160a01b0316331461110a57600080fd5b6001600160a01b03919091166000908152600c60205260409020805460ff1916911515919091179055565b60008181526010602052604090206002015460ff16801561116c57506000818152601060205260409020546001600160a01b031633145b61117557600080fd5b600081815260106020526040808220805460019091015491516001600160a01b039091169282156108fc02929190818181858888f193505050501580156111c0573d6000803e3d6000fd5b5060408051606081018252600080825260208083018281528385018381528684526010835292859020935184546001600160a01b0319166001600160a01b0390911617845551600184015590516002909201805460ff191692151592909217909155815183815291517f99319fa1a5fca42d549d4d49989116496775f906f62e0e2ff2ea3c3aacdefa279281900390910190a150565b60075490565b6000868152600e602052604090206001015460ff166112bb576040805162461bcd60e51b8152602060048201526016602482015275139bc818dbdb9d1c9bdb081d1bdad95b88199bdd5b9960521b604482015290519081900360640190fd5b6000868152600e6020526040902060010154610100900460ff1615611317576040805162461bcd60e51b815260206004820152600d60248201526c0416c726561647920736574757609c1b604482015290519081900360640190fd5b6000868152600d60205260408120805433929061133057fe5b6000918252602090912001546001600160a01b031614611397576040805162461bcd60e51b815260206004820152601c60248201527f4d75737420626520636f6e74726f6c20746f6b656e2061727469737400000000604482015290519081900360640190fd5b825184511480156113a9575081518351145b6113f2576040805162461bcd60e51b81526020600482015260156024820152740acc2d8eacae640c2e4e4c2f240dad2e6dac2e8c6d605b1b604482015290519081900360640190fd5b6113fc338761268f565b61140686866126a9565b60408051606081018252835181526001602080830182815283850183815260008c8152600e9093529482209351845551929091018054935115156101000261ff001993151560ff1990951694909417929092169290921790555b825181101561162a5784818151811061147557fe5b602002602001015184828151811061148957fe5b602002602001015112156114da576040805162461bcd60e51b815260206004820152601360248201527226b0bc103b30b61036bab9ba101f1e9036b4b760691b604482015290519081900360640190fd5b8481815181106114e657fe5b60200260200101518382815181106114fa57fe5b602002602001015112158015611536575083818151811061151757fe5b602002602001015183828151811061152b57fe5b602002602001015113155b61157b576040805162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081cdd185c9d081d985b607a1b604482015290519081900360640190fd5b604051806080016040528086838151811061159257fe5b602002602001015181526020018583815181106115ab57fe5b602002602001015181526020018483815181106115c457fe5b6020908102919091018101518252600191810182905260008a8152600e825260408082208683526002908101845291819020855181559285015183850155840151908201556060909201516003909201805460ff19169215159290921790915501611460565b5060005b81518110156116cb5760006001600160a01b031682828151811061164e57fe5b60200260200101516001600160a01b0316141561166a57600080fd5b6000878152600d60205260409020825183908390811061168657fe5b60209081029190910181015182546001808201855560009485529290932090920180546001600160a01b0319166001600160a01b03909316929092179091550161162e565b50505050505050565b6116de3382612722565b6116e757600080fd5b6116f2838383612781565b505050565b6117013382612722565b61170a57600080fd5b60008181526010602052604090206002015460ff1661172857600080fd5b6000818152601060205260409020600181015490546117519183916001600160a01b031661279f565b50565b6001600160a01b038216600090815260056020526040812080548390811061177857fe5b906000526020600020015490505b92915050565b33600090815260126020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6116f2838383604051806020016040528060008152506123dd565b6117e03382612722565b156117ea57600080fd5b60008181526010602052604090206002015460ff16156118b6576000818152601060205260409020600101543411611869576040805162461bcd60e51b815260206004820152601e60248201527f426964206d757374206265203e207468616e2063757272656e74206269640000604482015290519081900360640190fd5b600081815260106020526040808220805460019091015491516001600160a01b039091169282156108fc02929190818181858888f193505050501580156118b4573d6000803e3d6000fd5b505b604080516060808201835233808352346020808501828152600186880181815260008a815260108552899020975188546001600160a01b0319166001600160a01b03909116178855915190870155516002909501805460ff1916951515959095179094558451868152938401528284015291517fcbf61548a249040d379a7f7a4486a18d78824bce978077f4943fb55e111af1c1929181900390910190a150565b60116020526000908152604090205460ff1681565b60006007828154811061197b57fe5b90600052602060002001549050919050565b60165481565b6000818152600160205260408120546001600160a01b03168061178657600080fd5b60006001600160a01b0382166119ca57600080fd5b6001600160a01b038216600090815260036020526040902061178690612ace565b6119f53384612722565b80611a2857503360126000611a0986611993565b6001600160a01b03908116825260208201929092526040016000205416145b611a79576040805162461bcd60e51b815260206004820152601a60248201527f4f776e6572206f72207065726d697373696f6e6564206f6e6c79000000000000604482015290519081900360640190fd5b60608151604051908082528060200260200182016040528015611aa6578160200160208202803883390190505b50905060005b8351811015611c21576000600e60008781526020019081526020016000206002016000868481518110611adb57fe5b6020026020010151815260200190815260200160002090508060000154848381518110611b0457fe5b602002602001015112158015611b3157508060010154848381518110611b2657fe5b602002602001015113155b611b70576040805162461bcd60e51b815260206004820152600b60248201526a125b9d985b1a59081d985b60aa1b604482015290519081900360640190fd5b8060020154848381518110611b8157fe5b60200260200101511415611bdc576040805162461bcd60e51b815260206004820152601a60248201527f4d7573742070726f7669646520646966666572656e742076616c000000000000604482015290519081900360640190fd5b60028101548451859084908110611bef57fe5b6020026020010151826002018190555080848481518110611c0c57fe5b60209081029190910101525050600101611aac565b503415611c63576017546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015611c61573d6000803e3d6000fd5b505b7f1864c0e277c81ec1608d84e54d6f6c849f227acc0da19d9169fb0094d962f1c9843485848660405180868152602001858152602001806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b83811015611cdd578181015183820152602001611cc5565b50505050905001848103835286818151815260200191508051906020019060200280838360005b83811015611d1c578181015183820152602001611d04565b50505050905001848103825285818151815260200191508051906020019060200280838360005b83811015611d5b578181015183820152602001611d43565b505050509050019850505050505050505060405180910390a150505050565b6017546001600160a01b03163314611d9157600080fd5b60648310611d9e57600080fd5b6064611db0838363ffffffff612ad216565b10611dba57600080fd5b601383905560148290556015819055604080518481526020810184905280820183905290517fd946966340b57e0fdcf288c7bb51c470709dcfcd5d883779d28cf85679f758149181900360600190a1505050565b6017546001600160a01b03163314611e2557600080fd5b601780546001600160a01b0383166001600160a01b0319909116811790915560408051918252517fb29030287f33baad1941013143d2e1bd5e66c87318f0bd99bc0fae51fe4b191f9181900360200190a150565b600a8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156110205780601f10610ff557610100808354040283529160200191611020565b6000818152600e602052604090206001015460609060ff16611efb57600080fd5b6000828152600e602052604090208054606090611f1f90600363ffffffff612b3316565b604051908082528060200260200182016040528015611f48578160200160208202803883390190505b5090506000805b83548110156120235760008181526002850160205260409020548351849084908110611f7757fe5b6020908102919091010152611f9382600163ffffffff612ad216565b915083600201600082815260200190815260200160002060010154838381518110611fba57fe5b6020908102919091010152611fd682600163ffffffff612ad216565b915083600201600082815260200190815260200160002060020154838381518110611ffd57fe5b602090810291909101015261201982600163ffffffff612ad216565b9150600101611f4f565b5090949350505050565b6012602052600090815260409020546001600160a01b031681565b336000908152600c602052604090205460ff16151560011461206957600080fd5b60165483146120bf576040805162461bcd60e51b815260206004820152601d60248201527f4578706563746564546f6b656e537570706c7920646966666572656e74000000604482015290519081900360640190fd5b6120c9338461268f565b6016805460010190556120dc83836126a9565b6000838152600d60209081526040822080546001810182559083529082200180546001600160a01b031916331790555b815181101561230c5760006001600160a01b031682828151811061212c57fe5b60200260200101516001600160a01b0316141561214857600080fd5b60168054600181019091556000818152600d60205260409020835184908490811061216f57fe5b602090810291909101810151825460018082018555600094855283852090910180546001600160a01b0319166001600160a01b039093169290921790915560408051606081018252848152808401838152818301868152878752600e90955291909420935184555192018054915160ff199092169215159290921761ff001916610100911515919091021790558251339084908490811061220c57fe5b60200260200101516001600160a01b031614612303576000805b6000878152600d60205260409020548110156122a35784848151811061224857fe5b60200260200101516001600160a01b0316600d6000898152602001908152602001600020828154811061227757fe5b6000918252602090912001546001600160a01b0316141561229b57600191506122a3565b600101612226565b5080612301576000868152600d6020526040902084518590859081106122c557fe5b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b039092169190911790555b505b5060010161210c565b50505050565b6001600160a01b03821633141561232857600080fd5b3360008181526004602090815260408083206001600160a01b03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600f6020526000908152604090205481565b600d60205281600052604060002081815481106123c157fe5b6000918252602090912001546001600160a01b03169150829050565b6123e73383612722565b6123f057600080fd5b61230c848484612781565b60135481565b60155481565b6000818152600b602090815260409182902080548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084526060939283018282801561249c5780601f106124715761010080835404028352916020019161249c565b820191906000526020600020905b81548152906001019060200180831161247f57829003601f168201915b50505050509050919050565b6010602052600090815260409020805460018201546002909201546001600160a01b03909116919060ff1683565b60145481565b6124e63383612722565b6124ef57600080fd5b6000828152600f6020908152604091829020839055815184815290810183905281517fd765eb1cf8aab1a01381fef8dcc9f755ef2d2233849716da96a90e32da84821a929181900390910190a15050565b6017546001600160a01b031681565b6125593382612722565b1561256357600080fd5b6000818152600f60205260409020548061257c57600080fd5b8034101561258957600080fd5b60008281526010602052604090206002015460ff161561265257600082815260106020526040808220805460019091015491516001600160a01b039091169282156108fc02929190818181858888f193505050501580156125ee573d6000803e3d6000fd5b506040805160608101825260008082526020808301828152838501838152878452601090925293909120915182546001600160a01b0319166001600160a01b039091161782559151600182015590516002909101805460ff19169115159190911790555b61265d82823361279f565b5050565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b61265d828260405180602001604052806000815250612b8c565b6126b282612b96565b612703576040805162461bcd60e51b815260206004820152601c60248201527f55524920736574206f66206e6f6e6578697374656e7420746f6b656e00000000604482015290519081900360640190fd5b6000828152600b6020908152604090912082516116f2928401906131ae565b60008061272e83611993565b9050806001600160a01b0316846001600160a01b031614806127695750836001600160a01b031661275e8461102b565b6001600160a01b0316145b8061277957506127798185612661565b949350505050565b61278c838383612bb3565b6000908152600f60205260408120555050565b60008381526011602052604090205460ff16156129115760006127de60646127d260145486612b3390919063ffffffff16565b9063ffffffff612bd216565b6017546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015612819573d6000803e3d6000fd5b50600061283660646127d260155487612b3390919063ffffffff16565b6000868152600d602090815260409182902080548351818402810184019094528084529394506128a69385939283018282801561289c57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161287e575b5050505050612c14565b60006128b186611993565b90506001600160a01b0381166108fc6128e0846128d4898863ffffffff612c8d16565b9063ffffffff612c8d16565b6040518115909202916000818181858888f19350505050158015612908573d6000803e3d6000fd5b505050506129fc565b6000838152601160205260408120805460ff19166001179055601354612945906064906127d290869063ffffffff612b3316565b6017546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015612980573d6000803e3d6000fd5b506129fa612994848363ffffffff612c8d16565b6000868152600d60209081526040918290208054835181840281018401909452808452909183018282801561289c576020028201919060005260206000209081546001600160a01b0316815260019091019060200180831161287e575050505050612c14565b505b6040805160608101825260008082526020808301828152838501838152888452601090925293909120915182546001600160a01b0319166001600160a01b039091161782559151600182015590516002909101805460ff1916911515919091179055612a81612a6a84611993565b8285604051806020016040528060008152506123dd565b60408051848152602081018490526001600160a01b0383168183015290517fe8038e253f57f3f9c7277af1d801786319db71cc5491fe5db55a0e04f1b3466f9181900360600190a1505050565b5490565b600082820183811015612b2c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600082612b4257506000611786565b82820282848281612b4f57fe5b0414612b2c5760405162461bcd60e51b81526004018080602001828103825260218152602001806132676021913960400191505060405180910390fd5b6116f28383612ccf565b6000908152600160205260409020546001600160a01b0316151590565b612bbe838383612cec565b612bc88382612e00565b6116f28282612ef5565b6000612b2c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612f33565b6000612c2a825184612bd290919063ffffffff16565b905060005b825181101561230c57828181518110612c4457fe5b60200260200101516001600160a01b03166108fc839081150290604051600060405180830381858888f19350505050158015612c84573d6000803e3d6000fd5b50600101612c2f565b6000612b2c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612fd5565b612cd9828261302f565b612ce38282612ef5565b61265d8161310f565b826001600160a01b0316612cff82611993565b6001600160a01b031614612d46576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b038216612d5957600080fd5b612d6281613153565b6001600160a01b0383166000908152600360205260409020612d839061318e565b6001600160a01b0382166000908152600360205260409020612da4906131a5565b60008181526001602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216600090815260056020526040812054612e2a90600163ffffffff612c8d16565b600083815260066020526040902054909150808214612ec5576001600160a01b0384166000908152600560205260408120805484908110612e6757fe5b906000526020600020015490508060056000876001600160a01b03166001600160a01b031681526020019081526020016000208381548110612ea557fe5b600091825260208083209091019290925591825260069052604090208190555b6001600160a01b0384166000908152600560205260409020805490612eee90600019830161322c565b5050505050565b6001600160a01b0390911660009081526005602081815260408084208054868652600684529185208290559282526001810183559183529091200155565b60008183612fbf5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612f84578181015183820152602001612f6c565b50505050905090810190601f168015612fb15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612fcb57fe5b0495945050505050565b600081848411156130275760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612f84578181015183820152602001612f6c565b505050900390565b6001600160a01b03821661304257600080fd5b61304b81612b96565b15613094576040805162461bcd60e51b81526020600482015260146024820152731d1bdad95b88185b1c9958591e481b5a5b9d195960621b604482015290519081900360640190fd5b600081815260016020908152604080832080546001600160a01b0319166001600160a01b0387169081179091558352600390915290206130d3906131a5565b60405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600780546000838152600860205260408120829055600182018355919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880155565b6000818152600260205260409020546001600160a01b03161561175157600090815260026020526040902080546001600160a01b0319169055565b80546131a190600163ffffffff612c8d16565b9055565b80546001019055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106131ef57805160ff191683800117855561321c565b8280016001018555821561321c579182015b8281111561321c578251825591602001919060010190613201565b5061322892915061324c565b5090565b8154818355818111156116f2576000838152602090206116f29181019083015b61102891905b80821115613228576000815560010161325256fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158200936a4eac3bd0be25d4c56cc9bbe34abecbb5db23cd25afd9077a952b1e3ca0364736f6c63430005100032

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

0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000094173796e6320417274000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000054153594e43000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name (string): Async Art
Arg [1] : symbol (string): ASYNC

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [3] : 4173796e63204172740000000000000000000000000000000000000000000000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [5] : 4153594e43000000000000000000000000000000000000000000000000000000


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.