Contract
0xbccaa7acb552a2c7eb27c7eb77c2cc99580735b9
2
[ Download CSV Export ]
OVERVIEW
Artvatars created with the collaboration of over 60 of the world's best CryptoArtists, Artvatars represent a rare work of art. Artvatars are composed from the artwork of each artist, which is spliced into various components.Contract Name:
ArtvatarsMintableERC721Child
Compiler Version
v0.6.6+commit.6c089d02
Contract Source Code (Solidity)
/** *Submitted for verification at polygonscan.com on 2021-06-30 */ // File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // File: @openzeppelin/contracts/introspection/IERC165.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } // File: @openzeppelin/contracts/token/ERC721/IERC721.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transfered from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; } // File: @openzeppelin/contracts/token/ERC721/IERC721Metadata.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); } // File: @openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); } // File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4); } // File: @openzeppelin/contracts/introspection/ERC165.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Implementation of the {IERC165} interface. * * Contracts may inherit from this and call {_registerInterface} to declare * their support of an interface. */ contract ERC165 is IERC165 { /* * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7 */ bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; /** * @dev Mapping of interface ids to whether or not it's supported. */ mapping(bytes4 => bool) private _supportedInterfaces; constructor () internal { // Derived contracts need only register support for their own interfaces, // we register support for ERC165 itself here _registerInterface(_INTERFACE_ID_ERC165); } /** * @dev See {IERC165-supportsInterface}. * * Time complexity O(1), guaranteed to always use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) public view override returns (bool) { return _supportedInterfaces[interfaceId]; } /** * @dev Registers the contract as an implementer of the interface defined by * `interfaceId`. Support of the actual ERC165 interface is automatic and * registering its interface id is not required. * * See {IERC165-supportsInterface}. * * Requirements: * * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`). */ function _registerInterface(bytes4 interfaceId) internal virtual { require(interfaceId != 0xffffffff, "ERC165: invalid interface id"); _supportedInterfaces[interfaceId] = true; } } // File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // File: @openzeppelin/contracts/utils/Address.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // 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 != accountHash && codehash != 0x0); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success,) = recipient.call{value : amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value : weiValue}(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // File: @openzeppelin/contracts/utils/EnumerableSet.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) {// Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } // File: @openzeppelin/contracts/utils/EnumerableMap.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Library for managing an enumerable variant of Solidity's * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] * type. * * Maps have the following properties: * * - Entries are added, removed, and checked for existence in constant time * (O(1)). * - Entries are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableMap for EnumerableMap.UintToAddressMap; * * // Declare a set state variable * EnumerableMap.UintToAddressMap private myMap; * } * ``` * * As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are * supported. */ library EnumerableMap { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Map type with // bytes32 keys and values. // The Map implementation uses private functions, and user-facing // implementations (such as Uint256ToAddressMap) are just wrappers around // the underlying Map. // This means that we can only create new EnumerableMaps for types that fit // in bytes32. struct MapEntry { bytes32 _key; bytes32 _value; } struct Map { // Storage of map keys and values MapEntry[] _entries; // Position of the entry defined by a key in the `entries` array, plus 1 // because index 0 means a key is not in the map. mapping(bytes32 => uint256) _indexes; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) { // We read and store the key's index to prevent multiple reads from the same storage slot uint256 keyIndex = map._indexes[key]; if (keyIndex == 0) {// Equivalent to !contains(map, key) map._entries.push(MapEntry({_key : key, _value : value})); // The entry is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value map._indexes[key] = map._entries.length; return true; } else { map._entries[keyIndex - 1]._value = value; return false; } } /** * @dev Removes a key-value pair from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function _remove(Map storage map, bytes32 key) private returns (bool) { // We read and store the key's index to prevent multiple reads from the same storage slot uint256 keyIndex = map._indexes[key]; if (keyIndex != 0) {// Equivalent to contains(map, key) // To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one // in the array, and then remove the last entry (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = keyIndex - 1; uint256 lastIndex = map._entries.length - 1; // When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. MapEntry storage lastEntry = map._entries[lastIndex]; // Move the last entry to the index where the entry to delete is map._entries[toDeleteIndex] = lastEntry; // Update the index for the moved entry map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved entry was stored map._entries.pop(); // Delete the index for the deleted slot delete map._indexes[key]; return true; } else { return false; } } /** * @dev Returns true if the key is in the map. O(1). */ function _contains(Map storage map, bytes32 key) private view returns (bool) { return map._indexes[key] != 0; } /** * @dev Returns the number of key-value pairs in the map. O(1). */ function _length(Map storage map) private view returns (uint256) { return map._entries.length; } /** * @dev Returns the key-value pair stored at position `index` in the map. O(1). * * Note that there are no guarantees on the ordering of entries inside the * array, and it may change when more entries are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) { require(map._entries.length > index, "EnumerableMap: index out of bounds"); MapEntry storage entry = map._entries[index]; return (entry._key, entry._value); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function _get(Map storage map, bytes32 key) private view returns (bytes32) { return _get(map, key, "EnumerableMap: nonexistent key"); } /** * @dev Same as {_get}, with a custom error message when `key` is not in the map. */ function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) { uint256 keyIndex = map._indexes[key]; require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key) return map._entries[keyIndex - 1]._value; // All indexes are 1-based } // UintToAddressMap struct UintToAddressMap { Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) { return _set(map._inner, bytes32(key), bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) { return _remove(map._inner, bytes32(key)); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) { return _contains(map._inner, bytes32(key)); } /** * @dev Returns the number of elements in the map. O(1). */ function length(UintToAddressMap storage map) internal view returns (uint256) { return _length(map._inner); } /** * @dev Returns the element stored at position `index` in the set. O(1). * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) { (bytes32 key, bytes32 value) = _at(map._inner, index); return (uint256(key), address(uint256(value))); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(UintToAddressMap storage map, uint256 key) internal view returns (address) { return address(uint256(_get(map._inner, bytes32(key)))); } /** * @dev Same as {get}, with a custom error message when `key` is not in the map. */ function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) { return address(uint256(_get(map._inner, bytes32(key), errorMessage))); } } // File: @openzeppelin/contracts/utils/Strings.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev String operations. */ library Strings { /** * @dev Converts a `uint256` to its ASCII `string` representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); uint256 index = digits - 1; temp = value; while (temp != 0) { buffer[index--] = byte(uint8(48 + temp % 10)); temp /= 10; } return string(buffer); } } // File: @openzeppelin/contracts/token/ERC721/ERC721.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @title ERC721 Non-Fungible Token Standard basic implementation * @dev see https://eips.ethereum.org/EIPS/eip-721 */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using SafeMath for uint256; using Address for address; using EnumerableSet for EnumerableSet.UintSet; using EnumerableMap for EnumerableMap.UintToAddressMap; using Strings for uint256; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` bytes4 private constant _ERC721_RECEIVED = 0x150b7a02; // Mapping from holder address to their (enumerable) set of owned tokens mapping(address => EnumerableSet.UintSet) private _holderTokens; // Enumerable mapping from token ids to their owners EnumerableMap.UintToAddressMap private _tokenOwners; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Token name string private _name; // Token symbol string private _symbol; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; // Base URI string private _baseURI; /* * 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; /* * 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; /* * 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 Initializes the contract by setting a `name` and a `symbol` to the token collection. */ 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); _registerInterface(_INTERFACE_ID_ERC721_METADATA); _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _holderTokens[owner].length(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token"); } /** * @dev See {IERC721Metadata-name}. */ function name() public view override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory _tokenURI = _tokenURIs[tokenId]; // If there is no base URI, return the token URI. if (bytes(_baseURI).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(_baseURI, _tokenURI)); } // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI. return string(abi.encodePacked(_baseURI, tokenId.toString())); } /** * @dev Returns the base URI set via {_setBaseURI}. This will be * automatically added as a prefix in {tokenURI} to each token's URI, or * to the token ID if no specific URI is set for that token ID. */ function baseURI() public view returns (string memory) { return _baseURI; } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { return _holderTokens[owner].at(index); } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view override returns (uint256) { // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds return _tokenOwners.length(); } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view override returns (uint256) { (uint256 tokenId,) = _tokenOwners.at(index); return tokenId; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mecanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view returns (bool) { return _tokenOwners.contains(tokenId); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: d* * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual { _mint(to, tokenId); require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _holderTokens[to].add(tokenId); _tokenOwners.set(tokenId, to); emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); // Clear metadata (if any) if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } _holderTokens[owner].remove(tokenId); _tokenOwners.remove(tokenId); emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _holderTokens[from].remove(tokenId); _holderTokens[to].add(tokenId); _tokenOwners.set(tokenId, to); emit Transfer(from, to, tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev Internal function to set the base URI for all token IDs. It is * automatically added as a prefix to the value returned in {tokenURI}, * or to the token ID if {tokenURI} is empty. */ function _setBaseURI(string memory baseURI_) internal virtual { _baseURI = baseURI_; } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) { if (!to.isContract()) { return true; } bytes memory returndata = to.functionCall(abi.encodeWithSelector( IERC721Receiver(to).onERC721Received.selector, _msgSender(), from, tokenId, _data ), "ERC721: transfer to non ERC721Receiver implementer"); bytes4 retval = abi.decode(returndata, (bytes4)); return (retval == _ERC721_RECEIVED); } function _approve(address to, uint256 tokenId) private { _tokenApprovals[tokenId] = to; emit Approval(ownerOf(tokenId), to, tokenId); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual {} } // File: @openzeppelin/contracts/access/AccessControl.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } } // File: contracts/common/AccessControlMixin.sol pragma solidity 0.6.6; contract AccessControlMixin is AccessControl { string private _revertMsg; function _setupContractId(string memory contractId) internal { _revertMsg = string(abi.encodePacked(contractId, ": INSUFFICIENT_PERMISSIONS")); } modifier only(bytes32 role) { require( hasRole(role, _msgSender()), _revertMsg ); _; } } // File: contracts/child/ChildToken/IChildToken.sol pragma solidity 0.6.6; interface IChildToken { function deposit(address user, bytes calldata depositData) external; } // File: contracts/common/Initializable.sol pragma solidity 0.6.6; contract Initializable { bool inited = false; modifier initializer() { require(!inited, "already inited"); _; inited = true; } } // File: contracts/common/EIP712Base.sol pragma solidity 0.6.6; contract EIP712Base is Initializable { struct EIP712Domain { string name; string version; address verifyingContract; bytes32 salt; } string constant public ERC712_VERSION = "1"; bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256( bytes( "EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)" ) ); bytes32 internal domainSeperator; // supposed to be called once while initializing. // one of the contractsa that inherits this contract follows proxy pattern // so it is not possible to do this in a constructor function _initializeEIP712( string memory name ) internal initializer { _setDomainSeperator(name); } function _setDomainSeperator(string memory name) internal { domainSeperator = keccak256( abi.encode( EIP712_DOMAIN_TYPEHASH, keccak256(bytes(name)), keccak256(bytes(ERC712_VERSION)), address(this), bytes32(getChainId()) ) ); } function getDomainSeperator() public view returns (bytes32) { return domainSeperator; } function getChainId() public pure returns (uint256) { uint256 id; assembly { id := chainid() } return id; } /** * Accept message hash and returns hash message in EIP712 compatible form * So that it can be used to recover signer from signature signed using EIP712 formatted data * https://eips.ethereum.org/EIPS/eip-712 * "\\x19" makes the encoding deterministic * "\\x01" is the version byte to make it compatible to EIP-191 */ function toTypedMessageHash(bytes32 messageHash) internal view returns (bytes32) { return keccak256( abi.encodePacked("\x19\x01", getDomainSeperator(), messageHash) ); } } // File: contracts/common/NativeMetaTransaction.sol pragma solidity 0.6.6; contract NativeMetaTransaction is EIP712Base { using SafeMath for uint256; bytes32 private constant META_TRANSACTION_TYPEHASH = keccak256( bytes( "MetaTransaction(uint256 nonce,address from,bytes functionSignature)" ) ); event MetaTransactionExecuted( address userAddress, address payable relayerAddress, bytes functionSignature ); mapping(address => uint256) nonces; /* * Meta transaction structure. * No point of including value field here as if user is doing value transfer then he has the funds to pay for gas * He should call the desired function directly in that case. */ struct MetaTransaction { uint256 nonce; address from; bytes functionSignature; } function executeMetaTransaction( address userAddress, bytes memory functionSignature, bytes32 sigR, bytes32 sigS, uint8 sigV ) public payable returns (bytes memory) { MetaTransaction memory metaTx = MetaTransaction({ nonce : nonces[userAddress], from : userAddress, functionSignature : functionSignature }); require( verify(userAddress, metaTx, sigR, sigS, sigV), "Signer and signature do not match" ); // increase nonce for user (to avoid re-use) nonces[userAddress] = nonces[userAddress].add(1); emit MetaTransactionExecuted( userAddress, msg.sender, functionSignature ); // Append userAddress and relayer address at the end to extract it from calling context (bool success, bytes memory returnData) = address(this).call( abi.encodePacked(functionSignature, userAddress) ); require(success, "Function call not successful"); return returnData; } function hashMetaTransaction(MetaTransaction memory metaTx) internal pure returns (bytes32) { return keccak256( abi.encode( META_TRANSACTION_TYPEHASH, metaTx.nonce, metaTx.from, keccak256(metaTx.functionSignature) ) ); } function getNonce(address user) public view returns (uint256 nonce) { nonce = nonces[user]; } function verify( address signer, MetaTransaction memory metaTx, bytes32 sigR, bytes32 sigS, uint8 sigV ) internal view returns (bool) { require(signer != address(0), "NativeMetaTransaction: INVALID_SIGNER"); return signer == ecrecover( toTypedMessageHash(hashMetaTransaction(metaTx)), sigV, sigR, sigS ); } } // File: contracts/common/ContextMixin.sol pragma solidity 0.6.6; abstract contract ContextMixin { function msgSender() internal view returns (address payable sender) { if (msg.sender == address(this)) { bytes memory array = msg.data; uint256 index = msg.data.length; assembly { // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those. sender := and( mload(add(array, index)), 0xffffffffffffffffffffffffffffffffffffffff ) } } else { sender = msg.sender; } return sender; } } interface WETHInterface { function transferFrom(address _from, address _to, uint256 _value) external returns (bool); function approve(address _spender, uint256 _value) external returns (bool); function balanceOf(address _owner) external view returns (uint256); function transfer(address _to, uint256 _value) external returns (bool); } // File: contracts/child/ChildToken/ChildMintableERC721.sol pragma experimental ABIEncoderV2; pragma solidity 0.6.6; contract ArtvatarsMintableERC721Child is ERC721, IChildToken, AccessControlMixin, NativeMetaTransaction, ContextMixin { using SafeMath for uint256; bytes32 public constant DEPOSITOR_ROLE = keccak256("DEPOSITOR_ROLE"); bytes32 public constant SERVER_ROLE = keccak256("SERVER_ROLE"); WETHInterface WETHContract; mapping(uint256 => bool) public withdrawnTokens; mapping(uint256 => Artvatar) public tokenToArtvatar; uint256 MAX_SUPPLY = 20000; uint256 MAX_BUY_ONCE = 2; // limit batching of tokens due to gas limit restrictions uint256 public constant BATCH_LIMIT = 20; uint256 public mintedTokens; bool public mintingClosed = false; bool public init = false; struct Attribute { string title; string name; } struct Artvatar { uint256 id; string series; string title; string description; string image; Attribute[] attributes; bool metadataChanged; } event WithdrawnBatch(address indexed user, uint256[] tokenIds); event TransferWithMetadata(address indexed from, address indexed to, uint256 indexed tokenId, bytes metaData); constructor( string memory name_, string memory symbol_, address server, address childChainManager ) public ERC721(name_, symbol_) { WETHContract = WETHInterface(address(0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619)); _setupContractId("ChildMintableERC721"); _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(SERVER_ROLE, server); _setupRole(DEPOSITOR_ROLE, childChainManager); _initializeEIP712(name_); } function initializeMinting() public only(DEFAULT_ADMIN_ROLE) { require(init == false, "INIT_ALREADY_CALLED"); init = true; for (uint256 i = 0; i < 26; i++) { uint256 tokenId = mintedTokens; Artvatar storage artvatar = tokenToArtvatar[tokenId]; artvatar.id = tokenId; require(!withdrawnTokens[tokenId], "ChildMintableERC721: TOKEN_EXISTS_ON_ROOT_CHAIN"); _mint(_msgSender(), tokenId); mintedTokens = mintedTokens.add(1); } } function balanceWETH() public view returns (uint256) { return WETHContract.balanceOf(msgSender()); } function setBaseURI(string memory _baseURI) public only(DEFAULT_ADMIN_ROLE) { _setBaseURI(_baseURI); } function ceil(uint a, uint m) public pure returns (uint) { return ((a + m - 1) / m) * m; } function calcPrice(uint256 _totalSupply, uint8 _amount) public pure returns (uint256) { return ceil(_totalSupply.mul(10000).div(5000), 10000).div(10000).mul(150000000000000000).mul(_amount); } // This is to support Native meta transactions // never use msg.sender directly, use _msgSender() instead function _msgSender() internal override view returns (address payable sender) { return ContextMixin.msgSender(); } /** * @notice called when token is deposited on root chain * @dev Should be callable only by ChildChainManager * Should handle deposit by minting the required tokenId(s) for user * Should set `withdrawnTokens` mapping to `false` for the tokenId being deposited * Minting can also be done by other functions * @param user user address for whom deposit is being done * @param depositData abi encoded tokenIds. Batch deposit also supported. */ function deposit(address user, bytes calldata depositData) external override only(DEPOSITOR_ROLE) { // deposit single if (depositData.length == 32) { uint256 tokenId = abi.decode(depositData, (uint256)); withdrawnTokens[tokenId] = false; _mint(user, tokenId); // deposit batch } else { uint256[] memory tokenIds = abi.decode(depositData, (uint256[])); uint256 length = tokenIds.length; for (uint256 i; i < length; i++) { withdrawnTokens[tokenIds[i]] = false; _mint(user, tokenIds[i]); } } } /** * @notice called when user wants to withdraw token back to root chain * @dev Should handle withraw by burning user's token. * Should set `withdrawnTokens` mapping to `true` for the tokenId being withdrawn * This transaction will be verified when exiting on root chain * @param tokenId tokenId to withdraw */ function withdraw(uint256 tokenId) external { require(_msgSender() == ownerOf(tokenId), "ChildMintableERC721: INVALID_TOKEN_OWNER"); withdrawnTokens[tokenId] = true; emit TransferWithMetadata(ownerOf(tokenId), address(0), tokenId, this.encodeTokenMetadata(tokenId)); _burn(tokenId); } /** * @notice called when user wants to withdraw multiple tokens back to root chain * @dev Should burn user's tokens. This transaction will be verified when exiting on root chain * @param tokenIds tokenId list to withdraw */ function withdrawBatch(uint256[] calldata tokenIds) external { uint256 length = tokenIds.length; require(length <= BATCH_LIMIT, "ChildMintableERC721: EXCEEDS_BATCH_LIMIT"); // Iteratively burn ERC721 tokens, for performing // batch withdraw for (uint256 i; i < length; i++) { uint256 tokenId = tokenIds[i]; require(_msgSender() == ownerOf(tokenId), string(abi.encodePacked("ChildMintableERC721: INVALID_TOKEN_OWNER ", tokenId))); withdrawnTokens[tokenId] = true; emit TransferWithMetadata(ownerOf(tokenId), address(0), tokenId, this.encodeTokenMetadata(tokenId)); _burn(tokenId); } // At last emit this event, which will be used // in MintableERC721 predicate contract on L1 // while verifying burn proof emit WithdrawnBatch(_msgSender(), tokenIds); } /** * @notice called when user wants to withdraw token back to root chain with token URI * @dev Should handle withraw by burning user's token. * Should set `withdrawnTokens` mapping to `true` for the tokenId being withdrawn * This transaction will be verified when exiting on root chain * * @param tokenId tokenId to withdraw */ function withdrawWithMetadata(uint256 tokenId) external { require(_msgSender() == ownerOf(tokenId), "ChildMintableERC721: INVALID_TOKEN_OWNER"); withdrawnTokens[tokenId] = true; // Encoding metadata associated with tokenId & emitting event emit TransferWithMetadata(ownerOf(tokenId), address(0), tokenId, this.encodeTokenMetadata(tokenId)); _burn(tokenId); } /** * @notice This method is supposed to be called by client when withdrawing token with metadata * and pass return value of this function as second paramter of `withdrawWithMetadata` method * * It can be overridden by clients to encode data in a different form, which needs to * be decoded back by them correctly during exiting * * @param tokenId Token for which URI to be fetched */ function encodeTokenMetadata(uint256 tokenId) external view virtual returns (bytes memory) { // You're always free to change this default implementation // and pack more data in byte array which can be decoded back // in L1 Artvatar memory artvatar = tokenToArtvatar[tokenId]; return abi.encode(artvatar, tokenURI(tokenId)); } /** * @notice Example function to handle minting tokens on matic chain * @dev Minting can be done as per requirement, * This implementation allows only admin to mint tokens but it can be changed as per requirement * Should verify if token is withdrawn by checking `withdrawnTokens` mapping * @param user user for whom tokens are being minted * @param tokenId tokenId to mint */ function mint(address user, uint256 tokenId) public only(DEFAULT_ADMIN_ROLE) { require(!withdrawnTokens[tokenId], "ChildMintableERC721: TOKEN_EXISTS_ON_ROOT_CHAIN"); _mint(user, tokenId); } function buyTokens(address _toAddress, uint8 _amount, uint256 _value) public { require(mintingClosed == false && init == true, "MINTING_CLOSED"); require(mintedTokens.add(_amount) <= MAX_SUPPLY, "MAX_SUPPLY reached."); require(MAX_BUY_ONCE > 0 && _amount <= MAX_BUY_ONCE, "MAX_BUY_ONCE"); uint256 totalPrice; for (uint256 i = 0; i < _amount; i++) { uint256 price = calcPrice(mintedTokens.add(1), 1); require(WETHContract.transferFrom(msgSender(), address(this), price) == true, "Not enough WETH"); WETHContract.transfer(address(0x6F24CBca9A3Ae5eC552d94f8A69B4046a2794C67), price); uint256 tokenId = mintedTokens; Artvatar storage artvatar = tokenToArtvatar[tokenId]; artvatar.id = tokenId; require(!withdrawnTokens[tokenId], "ChildMintableERC721: TOKEN_EXISTS_ON_ROOT_CHAIN"); _mint(_toAddress, tokenId); mintedTokens = mintedTokens.add(1); totalPrice = totalPrice.add(price); } require(_value == totalPrice, "VALUE_TOTAL_MISSMATCH"); } function changeMetadata(Artvatar memory _artvatar) public only(SERVER_ROLE) { Artvatar storage artvatar = tokenToArtvatar[_artvatar.id]; require(artvatar.metadataChanged == false, "Metadata of token already changed"); Attribute[] memory _attributes = _artvatar.attributes; artvatar.series = _artvatar.series; artvatar.title = _artvatar.title; artvatar.description = _artvatar.description; artvatar.image = _artvatar.image; for (uint256 i = 0; i < _attributes.length; i++) { Attribute memory attribute = _attributes[i]; artvatar.attributes.push(attribute); } artvatar.metadataChanged = true; } function getArtvatarByTokenId(uint256 _tokenId) public view returns (Artvatar memory artvatar) { return tokenToArtvatar[_tokenId]; } function closeMinting() public only(DEFAULT_ADMIN_ROLE) { mintingClosed = true; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"server","type":"address"},{"internalType":"address","name":"childChainManager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"address payable","name":"relayerAddress","type":"address"},{"indexed":false,"internalType":"bytes","name":"functionSignature","type":"bytes"}],"name":"MetaTransactionExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"metaData","type":"bytes"}],"name":"TransferWithMetadata","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"WithdrawnBatch","type":"event"},{"inputs":[],"name":"BATCH_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSITOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERC712_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SERVER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balanceWETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_toAddress","type":"address"},{"internalType":"uint8","name":"_amount","type":"uint8"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"buyTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalSupply","type":"uint256"},{"internalType":"uint8","name":"_amount","type":"uint8"}],"name":"calcPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"m","type":"uint256"}],"name":"ceil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"series","type":"string"},{"internalType":"string","name":"title","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"image","type":"string"},{"components":[{"internalType":"string","name":"title","type":"string"},{"internalType":"string","name":"name","type":"string"}],"internalType":"struct ArtvatarsMintableERC721Child.Attribute[]","name":"attributes","type":"tuple[]"},{"internalType":"bool","name":"metadataChanged","type":"bool"}],"internalType":"struct ArtvatarsMintableERC721Child.Artvatar","name":"_artvatar","type":"tuple"}],"name":"changeMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closeMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bytes","name":"depositData","type":"bytes"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"encodeTokenMetadata","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"bytes","name":"functionSignature","type":"bytes"},{"internalType":"bytes32","name":"sigR","type":"bytes32"},{"internalType":"bytes32","name":"sigS","type":"bytes32"},{"internalType":"uint8","name":"sigV","type":"uint8"}],"name":"executeMetaTransaction","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getArtvatarByTokenId","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"series","type":"string"},{"internalType":"string","name":"title","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"image","type":"string"},{"components":[{"internalType":"string","name":"title","type":"string"},{"internalType":"string","name":"name","type":"string"}],"internalType":"struct ArtvatarsMintableERC721Child.Attribute[]","name":"attributes","type":"tuple[]"},{"internalType":"bool","name":"metadataChanged","type":"bool"}],"internalType":"struct ArtvatarsMintableERC721Child.Artvatar","name":"artvatar","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getDomainSeperator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"init","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initializeMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintingClosed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenToArtvatar","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"series","type":"string"},{"internalType":"string","name":"title","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"image","type":"string"},{"internalType":"bool","name":"metadataChanged","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"withdrawBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawWithMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"withdrawnTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6080604052600c805460ff19169055614e2060125560026013556015805461ffff191690553480156200003157600080fd5b50604051620057f4380380620057f4833981016040819052620000549162000674565b8383620000716301ffc9a760e01b6001600160e01b03620001fa16565b81516200008690600690602085019062000539565b5080516200009c90600790602084019062000539565b50620000b86380ac58cd60e01b6001600160e01b03620001fa16565b620000d3635b5e139f60e01b6001600160e01b03620001fa16565b620000ee63780e9d6360e01b6001600160e01b03620001fa16565b5050600f80546001600160a01b031916737ceb23fd6bc0add59e62ac25578270cff1b9f61917905560408051808201909152601381527f4368696c644d696e7461626c654552433732310000000000000000000000000060208201526200015e906001600160e01b036200025516565b620001866000620001776001600160e01b036200029216565b6001600160e01b03620002af16565b620001b160405162000198906200075f565b604051908190039020836001600160e01b03620002af16565b620001dc604051620001c39062000745565b604051908190039020826001600160e01b03620002af16565b620001f0846001600160e01b03620002c416565b5050505062000834565b6001600160e01b03198082161415620002305760405162461bcd60e51b81526004016200022790620007a2565b60405180910390fd5b6001600160e01b0319166000908152602081905260409020805460ff19166001179055565b8060405160200162000268919062000702565b604051602081830303815290604052600b90805190602001906200028e92919062000539565b5050565b6000620002a96200030e60201b62002edc1760201c565b90505b90565b6200028e82826001600160e01b036200036d16565b600c5460ff1615620002ea5760405162461bcd60e51b81526004016200022790620007d9565b620002fe816001600160e01b03620003f116565b50600c805460ff19166001179055565b600033301415620003685760606000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b03169150620002ac9050565b503390565b6000828152600a60209081526040909120620003949183906200316d6200049c821b17901c565b156200028e57620003ad6001600160e01b036200029216565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6040518060800160405280604f8152602001620057a5604f913980516020918201208251838301206040805180820190915260018152603160f81b930192909252907fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc630620004686001600160e01b03620004c516565b6040516200047e95949392919060200162000776565b60408051601f198184030181529190528051602090910120600d5550565b6000620004bc836001600160a01b0384166001600160e01b03620004c916565b90505b92915050565b4690565b6000620004e083836001600160e01b036200052116565b6200051857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620004bf565b506000620004bf565b60009081526001919091016020526040902054151590565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200057c57805160ff1916838001178555620005ac565b82800160010185558215620005ac579182015b82811115620005ac5782518255916020019190600101906200058f565b50620005ba929150620005be565b5090565b620002ac91905b80821115620005ba5760008155600101620005c5565b80516001600160a01b0381168114620004bf57600080fd5b600082601f83011262000604578081fd5b81516001600160401b03808211156200061b578283fd5b604051601f8301601f1916810160200182811182821017156200063c578485fd5b6040528281529250828483016020018610156200065857600080fd5b6200066b83602083016020880162000801565b50505092915050565b600080600080608085870312156200068a578384fd5b84516001600160401b0380821115620006a1578586fd5b620006af88838901620005f3565b95506020870151915080821115620006c5578485fd5b50620006d487828801620005f3565b935050620006e68660408701620005db565b9150620006f78660608701620005db565b905092959194509250565b600082516200071681846020870162000801565b7f3a20494e53554646494349454e545f5045524d495353494f4e53000000000000920191825250601a01919050565b6d4445504f5349544f525f524f4c4560901b8152600e0190565b6a5345525645525f524f4c4560a81b8152600b0190565b948552602085019390935260408401919091526001600160a01b03166060830152608082015260a00190565b6020808252601c908201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604082015260600190565b6020808252600e908201526d185b1c9958591e481a5b9a5d195960921b604082015260600190565b60005b838110156200081e57818101518382015260200162000804565b838111156200082e576000848401525b50505050565b614f6180620008446000396000f3fe60806040526004361061031a5760003560e01c80636352211e116101ab578063a217fddf116100f7578063c87b56dd11610095578063d547741f1161006f578063d547741f146108b3578063da2fdcf7146108d3578063e1c7392a14610900578063e985e9c5146109155761031a565b8063c87b56dd14610853578063ca15c87314610873578063cf2c52cb146108935761031a565b8063a5e584dc116100d1578063a5e584dc1461050f578063b2b93b73146107ec578063b60ad57114610801578063b88d4fde146108335761031a565b8063a217fddf146107a2578063a22cb465146107b7578063a3b0b5a3146107d75761031a565b80638827c1cd1161016457806391d148541161013e57806391d14854146107385780639559c0bd1461075857806395d89b411461076d5780639c8d4156146107825761031a565b80638827c1cd146106ee5780638d75fe05146107035780639010d07c146107185761031a565b80636352211e146106445780636c0360eb1461066457806370a082311461067957806378b33411146106995780638587be6e146106b957806387491c60146106d95761031a565b8063248a9ca31161026a5780633408e4701161022357806342842e0e116101fd57806342842e0e146105c45780634f6ccce7146105e457806355f804b3146106045780635e295e7e146106245761031a565b80633408e4701461056f57806336568abe1461058457806340c10f19146105a45761031a565b8063248a9ca3146104af5780632c69118c146104cf5780632d0335ab146104ef5780632e1a7d4d1461050f5780632f2ff15d1461052f5780632f745c591461054f5761031a565b80630c53c51c116102d757806318160ddd116102b157806318160ddd1461044357806318cf28341461046557806320379ee51461047a57806323b872dd1461048f5761031a565b80630c53c51c146103fb5780630f7e59701461040e5780631653c39a146104235761031a565b806301ffc9a71461031f57806305c4405b1461035557806306fdde031461036c57806307a974fc1461038e578063081812fc146103ae578063095ea7b3146103db575b600080fd5b34801561032b57600080fd5b5061033f61033a366004613db7565b610935565b60405161034c9190614381565b60405180910390f35b34801561036157600080fd5b5061036a610958565b005b34801561037857600080fd5b50610381610a49565b60405161034c91906143d7565b34801561039a57600080fd5b5061033f6103a9366004613d5a565b610ae0565b3480156103ba57600080fd5b506103ce6103c9366004613d5a565b610af5565b60405161034c919061428d565b3480156103e757600080fd5b5061036a6103f6366004613bda565b610b38565b610381610409366004613b69565b610bd0565b34801561041a57600080fd5b50610381610d61565b34801561042f57600080fd5b5061038161043e366004613d5a565b610d7e565b34801561044f57600080fd5b506104586111dc565b60405161034c919061438c565b34801561047157600080fd5b506104586111ed565b34801561048657600080fd5b50610458611204565b34801561049b57600080fd5b5061036a6104aa366004613a0e565b61120a565b3480156104bb57600080fd5b506104586104ca366004613d5a565b611242565b3480156104db57600080fd5b506104586104ea366004613fc2565b611257565b3480156104fb57600080fd5b5061045861050a3660046139bf565b6112b0565b34801561051b57600080fd5b5061036a61052a366004613d5a565b6112cb565b34801561053b57600080fd5b5061036a61054a366004613d72565b6113fa565b34801561055b57600080fd5b5061045861056a366004613bda565b61143e565b34801561057b57600080fd5b50610458611466565b34801561059057600080fd5b5061036a61059f366004613d72565b61146a565b3480156105b057600080fd5b5061036a6105bf366004613bda565b6114ac565b3480156105d057600080fd5b5061036a6105df366004613a0e565b611514565b3480156105f057600080fd5b506104586105ff366004613d5a565b61152f565b34801561061057600080fd5b5061036a61061f366004613e64565b61154b565b34801561063057600080fd5b5061036a61063f366004613c04565b611583565b34801561065057600080fd5b506103ce61065f366004613d5a565b61184a565b34801561067057600080fd5b50610381611878565b34801561068557600080fd5b506104586106943660046139bf565b6118d9565b3480156106a557600080fd5b5061036a6106b4366004613e96565b611922565b3480156106c557600080fd5b506104586106d4366004613d96565b611aa7565b3480156106e557600080fd5b5061036a611ac1565b3480156106fa57600080fd5b50610458611b00565b34801561070f57600080fd5b50610458611b88565b34801561072457600080fd5b506103ce610733366004613d96565b611b8e565b34801561074457600080fd5b5061033f610753366004613d72565b611bac565b34801561076457600080fd5b50610458611bca565b34801561077957600080fd5b50610381611bcf565b34801561078e57600080fd5b5061036a61079d366004613c41565b611c30565b3480156107ae57600080fd5b50610458611e1c565b3480156107c357600080fd5b5061036a6107d2366004613ab5565b611e21565b3480156107e357600080fd5b50610458611eef565b3480156107f857600080fd5b5061033f611efb565b34801561080d57600080fd5b5061082161081c366004613d5a565b611f04565b60405161034c96959493929190614d4c565b34801561083f57600080fd5b5061036a61084e366004613a4e565b612166565b34801561085f57600080fd5b5061038161086e366004613d5a565b61219f565b34801561087f57600080fd5b5061045861088e366004613d5a565b6122d2565b34801561089f57600080fd5b5061036a6108ae366004613aec565b6122e9565b3480156108bf57600080fd5b5061036a6108ce366004613d72565b6123f4565b3480156108df57600080fd5b506108f36108ee366004613d5a565b61242e565b60405161034c9190614d14565b34801561090c57600080fd5b5061033f61285c565b34801561092157600080fd5b5061033f6109303660046139da565b61286a565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b600061096681610753612898565b600b9061098f5760405162461bcd60e51b815260040161098691906143ea565b60405180910390fd5b50601554610100900460ff16156109b85760405162461bcd60e51b8152600401610986906144de565b6015805461ff00191661010017905560005b601a811015610a4557601454600081815260116020908152604080832084815560109092529091205460ff1615610a135760405162461bcd60e51b8152600401610986906145ac565b610a24610a1e612898565b836128a2565b601454610a3890600163ffffffff61297216565b60145550506001016109ca565b5050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610ad55780601f10610aaa57610100808354040283529160200191610ad5565b820191906000526020600020905b815481529060010190602001808311610ab857829003601f168201915b505050505090505b90565b60106020526000908152604090205460ff1681565b6000610b0082612997565b610b1c5760405162461bcd60e51b815260040161098690614a67565b506000908152600460205260409020546001600160a01b031690565b6000610b438261184a565b9050806001600160a01b0316836001600160a01b03161415610b775760405162461bcd60e51b815260040161098690614b8c565b806001600160a01b0316610b89612898565b6001600160a01b03161480610ba55750610ba581610930612898565b610bc15760405162461bcd60e51b815260040161098690614822565b610bcb83836129aa565b505050565b6060610bda613716565b50604080516060810182526001600160a01b0388166000818152600e602090815290849020548352820152908101869052610c188782878787612a18565b610c345760405162461bcd60e51b815260040161098690614afc565b6001600160a01b0387166000908152600e6020526040902054610c5e90600163ffffffff61297216565b6001600160a01b0388166000908152600e60205260409081902091909155517f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b90610cae90899033908a90614302565b60405180910390a160006060306001600160a01b0316888a604051602001610cd7929190614146565b60408051601f1981840301815290829052610cf19161412a565b6000604051808303816000865af19150503d8060008114610d2e576040519150601f19603f3d011682016040523d82523d6000602084013e610d33565b606091505b509150915081610d555760405162461bcd60e51b8152600401610986906145fb565b98975050505050505050565b604051806040016040528060018152602001603160f81b81525081565b6060610d88613740565b601160008481526020019081526020016000206040518060e001604052908160008201548152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e495780601f10610e1e57610100808354040283529160200191610e49565b820191906000526020600020905b815481529060010190602001808311610e2c57829003601f168201915b5050509183525050600282810180546040805160206001841615610100026000190190931694909404601f81018390048302850183019091528084529381019390830182828015610edb5780601f10610eb057610100808354040283529160200191610edb565b820191906000526020600020905b815481529060010190602001808311610ebe57829003601f168201915b505050918352505060038201805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152938201939291830182828015610f6f5780601f10610f4457610100808354040283529160200191610f6f565b820191906000526020600020905b815481529060010190602001808311610f5257829003601f168201915b505050918352505060048201805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529382019392918301828280156110035780601f10610fd857610100808354040283529160200191611003565b820191906000526020600020905b815481529060010190602001808311610fe657829003601f168201915b5050505050815260200160058201805480602002602001604051908101604052809291908181526020016000905b8282101561118f5760008481526020908190206040805160028681029093018054600181161561010002600019011693909304601f8101859004909402810160609081018352918101848152909384928491908401828280156110d55780601f106110aa576101008083540402835291602001916110d5565b820191906000526020600020905b8154815290600101906020018083116110b857829003601f168201915b50505050508152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111775780601f1061114c57610100808354040283529160200191611177565b820191906000526020600020905b81548152906001019060200180831161115a57829003601f168201915b50505050508152505081526020019060010190611031565b505050908252506006919091015460ff1615156020909101529050806111b48461219f565b6040516020016111c5929190614d27565b604051602081830303815290604052915050919050565b60006111e86002612abe565b905090565b6040516111f990614276565b604051809103902081565b600d5490565b61121b611215612898565b82612ac9565b6112375760405162461bcd60e51b815260040161098690614bcd565b610bcb838383612b4e565b6000908152600a602052604090206002015490565b60006112a760ff831661129b670214e8348c4f000081612710611287611293611388828c8563ffffffff612c6e16565b9063ffffffff612ca816565b612710611aa7565b9063ffffffff612c6e16565b90505b92915050565b6001600160a01b03166000908152600e602052604090205490565b6112d48161184a565b6001600160a01b03166112e5612898565b6001600160a01b03161461130b5760405162461bcd60e51b81526004016109869061487f565b6000818152601060205260408120805460ff19166001179055819061132f8261184a565b6001600160a01b03167ff94915c6d1fd521cee85359239227480c7e8776d7caf1fc3bacad5c269b66a14306001600160a01b0316631653c39a866040518263ffffffff1660e01b8152600401611385919061438c565b60006040518083038186803b15801561139d57600080fd5b505afa1580156113b1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113d99190810190613def565b6040516113e691906143d7565b60405180910390a46113f781612cea565b50565b6000828152600a602052604090206002015461141890610753612898565b6114345760405162461bcd60e51b81526004016109869061450b565b610a458282612dc3565b6001600160a01b03821660009081526001602052604081206112a7908363ffffffff612e3216565b4690565b611472612898565b6001600160a01b0316816001600160a01b0316146114a25760405162461bcd60e51b815260040161098690614cc5565b610a458282612e3e565b60006114ba81610753612898565b600b906114da5760405162461bcd60e51b815260040161098691906143ea565b5060008281526010602052604090205460ff161561150a5760405162461bcd60e51b8152600401610986906145ac565b610bcb83836128a2565b610bcb83838360405180602001604052806000815250612166565b60008061154360028463ffffffff612ead16565b509392505050565b600061155981610753612898565b600b906115795760405162461bcd60e51b815260040161098691906143ea565b50610a4582612ec9565b60155460ff161580156115a3575060155460ff6101009091041615156001145b6115bf5760405162461bcd60e51b8152600401610986906144b6565b6012546014546115d89060ff851663ffffffff61297216565b11156115f65760405162461bcd60e51b81526004016109869061493a565b600060135411801561160d57506013548260ff1611155b6116295760405162461bcd60e51b815260040161098690614767565b6000805b8360ff1681101561182457600061165a611653600160145461297290919063ffffffff16565b6001611257565b600f549091506001600160a01b03166323b872dd611676612edc565b30846040518463ffffffff1660e01b8152600401611696939291906142a1565b602060405180830381600087803b1580156116b057600080fd5b505af11580156116c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e89190613d3e565b15156001146117095760405162461bcd60e51b815260040161098690614911565b600f5460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061174f90736f24cbca9a3ae5ec552d94f8a69b4046a2794c6790859060040161432e565b602060405180830381600087803b15801561176957600080fd5b505af115801561177d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a19190613d3e565b50601454600081815260116020908152604080832084815560109092529091205460ff16156117e25760405162461bcd60e51b8152600401610986906145ac565b6117ec88836128a2565b60145461180090600163ffffffff61297216565b601455611813858463ffffffff61297216565b9450506001909201915061162d9050565b508082146118445760405162461bcd60e51b815260040161098690614c96565b50505050565b60006112aa82604051806060016040528060298152602001614f03602991396002919063ffffffff612f3916565b60098054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610ad55780601f10610aaa57610100808354040283529160200191610ad5565b60006001600160a01b0382166119015760405162461bcd60e51b8152600401610986906148c7565b6001600160a01b03821660009081526001602052604090206112aa90612abe565b60405161192e90614276565b604051809103902061194281610753612898565b600b906119625760405162461bcd60e51b815260040161098691906143ea565b5081516000908152601160205260409020600681015460ff16156119985760405162461bcd60e51b815260040161098690614c55565b60a083015160208085015180516119b5926001860192019061377f565b50604084015180516119d191600285019160209091019061377f565b50606084015180516119ed91600385019160209091019061377f565b5060808401518051611a0991600485019160209091019061377f565b5060005b8151811015611a9357611a1e6137fd565b828281518110611a2a57fe5b602090810291909101810151600586018054600181018255600091825290839020825180519395508594600290930290910192611a6a928492019061377f565b506020828101518051611a83926001850192019061377f565b505060019092019150611a0d9050565b5050600601805460ff191660011790555050565b6000818260018486010381611ab857fe5b04029392505050565b6000611acf81610753612898565b600b90611aef5760405162461bcd60e51b815260040161098691906143ea565b50506015805460ff19166001179055565b600f546000906001600160a01b03166370a08231611b1c612edc565b6040518263ffffffff1660e01b8152600401611b38919061428d565b60206040518083038186803b158015611b5057600080fd5b505afa158015611b64573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e89190613faa565b60145481565b6000828152600a602052604081206112a7908363ffffffff612e3216565b6000828152600a602052604081206112a7908363ffffffff612f5016565b601481565b60078054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610ad55780601f10610aaa57610100808354040283529160200191610ad5565b806014811115611c525760405162461bcd60e51b8152600401610986906149a9565b60005b81811015611dcc576000848483818110611c6b57fe5b905060200201359050611c7d8161184a565b6001600160a01b0316611c8e612898565b6001600160a01b03161481604051602001611ca99190614219565b60405160208183030381529060405290611cd65760405162461bcd60e51b815260040161098691906143d7565b506000818152601060205260408120805460ff191660011790558190611cfb8261184a565b6001600160a01b03167ff94915c6d1fd521cee85359239227480c7e8776d7caf1fc3bacad5c269b66a14306001600160a01b0316631653c39a866040518263ffffffff1660e01b8152600401611d51919061438c565b60006040518083038186803b158015611d6957600080fd5b505afa158015611d7d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611da59190810190613def565b604051611db291906143d7565b60405180910390a4611dc381612cea565b50600101611c55565b50611dd5612898565b6001600160a01b03167ff871896b17e9cb7a64941c62c188a4f5c621b86800e3d15452ece01ce56073df8484604051611e0f929190614347565b60405180910390a2505050565b600081565b611e29612898565b6001600160a01b0316826001600160a01b03161415611e5a5760405162461bcd60e51b8152600401610986906146e4565b8060056000611e67612898565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611eab612898565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611ee39190614381565b60405180910390a35050565b6040516111f99061425c565b60155460ff1681565b6011602090815260009182526040918290208054600180830180548651600293821615610100026000190190911692909204601f810186900486028301860190965285825291949293909290830182828015611fa15780601f10611f7657610100808354040283529160200191611fa1565b820191906000526020600020905b815481529060010190602001808311611f8457829003601f168201915b50505060028085018054604080516020601f60001961010060018716150201909416959095049283018590048502810185019091528181529596959450909250908301828280156120335780601f1061200857610100808354040283529160200191612033565b820191906000526020600020905b81548152906001019060200180831161201657829003601f168201915b5050505060038301805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529495949350908301828280156120c35780601f10612098576101008083540402835291602001916120c3565b820191906000526020600020905b8154815290600101906020018083116120a657829003601f168201915b5050505060048301805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529495949350908301828280156121535780601f1061212857610100808354040283529160200191612153565b820191906000526020600020905b81548152906001019060200180831161213657829003601f168201915b5050506006909301549192505060ff1686565b612177612171612898565b83612ac9565b6121935760405162461bcd60e51b815260040161098690614bcd565b61184484848484612f65565b60606121aa82612997565b6121c65760405162461bcd60e51b815260040161098690614b3d565b60008281526008602090815260409182902080548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084526060939283018282801561225b5780601f106122305761010080835404028352916020019161225b565b820191906000526020600020905b81548152906001019060200180831161223e57829003601f168201915b505060095493945050505060026000196101006001841615020190911604612284579050610953565b8051156122b65760098160405160200161229f92919061417d565b604051602081830303815290604052915050610953565b60096122c184612f98565b6040516020016111c592919061417d565b6000818152600a602052604081206112aa90612abe565b6040516122f59061425c565b604051809103902061230981610753612898565b600b906123295760405162461bcd60e51b815260040161098691906143ea565b50602082141561236957600061234183850185613d5a565b6000818152601060205260409020805460ff19169055905061236385826128a2565b50611844565b606061237783850185613cac565b805190915060005b818110156123eb5760006010600085848151811061239957fe5b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055506123e3878483815181106123d657fe5b60200260200101516128a2565b60010161237f565b50505050505050565b6000828152600a602052604090206002015461241290610753612898565b6114a25760405162461bcd60e51b81526004016109869061478d565b612436613740565b601160008381526020019081526020016000206040518060e001604052908160008201548152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124f75780601f106124cc576101008083540402835291602001916124f7565b820191906000526020600020905b8154815290600101906020018083116124da57829003601f168201915b5050509183525050600282810180546040805160206001841615610100026000190190931694909404601f810183900483028501830190915280845293810193908301828280156125895780601f1061255e57610100808354040283529160200191612589565b820191906000526020600020905b81548152906001019060200180831161256c57829003601f168201915b505050918352505060038201805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815293820193929183018282801561261d5780601f106125f25761010080835404028352916020019161261d565b820191906000526020600020905b81548152906001019060200180831161260057829003601f168201915b505050918352505060048201805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529382019392918301828280156126b15780601f10612686576101008083540402835291602001916126b1565b820191906000526020600020905b81548152906001019060200180831161269457829003601f168201915b5050505050815260200160058201805480602002602001604051908101604052809291908181526020016000905b8282101561283d5760008481526020908190206040805160028681029093018054600181161561010002600019011693909304601f8101859004909402810160609081018352918101848152909384928491908401828280156127835780601f1061275857610100808354040283529160200191612783565b820191906000526020600020905b81548152906001019060200180831161276657829003601f168201915b50505050508152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128255780601f106127fa57610100808354040283529160200191612825565b820191906000526020600020905b81548152906001019060200180831161280857829003601f168201915b505050505081525050815260200190600101906126df565b505050908252506006919091015460ff16151560209091015292915050565b601554610100900460ff1681565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006111e8612edc565b6001600160a01b0382166128c85760405162461bcd60e51b8152600401610986906149f1565b6128d181612997565b156128ee5760405162461bcd60e51b815260040161098690614632565b6128fa60008383610bcb565b6001600160a01b0382166000908152600160205260409020612922908263ffffffff61307216565b506129356002828463ffffffff61307e16565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000828201838110156112a75760405162461bcd60e51b815260040161098690614669565b60006112aa60028363ffffffff61309416565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906129df8261184a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006001600160a01b038616612a405760405162461bcd60e51b8152600401610986906147dd565b6001612a53612a4e876130a0565b6130fe565b83868660405160008152602001604052604051612a7394939291906143b9565b6020604051602081039080840390855afa158015612a95573d6000803e3d6000fd5b505050602060405103516001600160a01b0316866001600160a01b031614905095945050505050565b60006112aa8261311a565b6000612ad482612997565b612af05760405162461bcd60e51b81526004016109869061471b565b6000612afb8361184a565b9050806001600160a01b0316846001600160a01b03161480612b365750836001600160a01b0316612b2b84610af5565b6001600160a01b0316145b80612b465750612b46818561286a565b949350505050565b826001600160a01b0316612b618261184a565b6001600160a01b031614612b875760405162461bcd60e51b815260040161098690614ab3565b6001600160a01b038216612bad5760405162461bcd60e51b8152600401610986906146a0565b612bb8838383610bcb565b612bc36000826129aa565b6001600160a01b0383166000908152600160205260409020612beb908263ffffffff61311e16565b506001600160a01b0382166000908152600160205260409020612c14908263ffffffff61307216565b50612c276002828463ffffffff61307e16565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b600082612c7d575060006112aa565b82820282848281612c8a57fe5b04146112a75760405162461bcd60e51b815260040161098690614a26565b60006112a783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061312a565b6000612cf58261184a565b9050612d0381600084610bcb565b612d0e6000836129aa565b6000828152600860205260409020546002600019610100600184161502019091160415612d4c576000828152600860205260408120612d4c91613817565b6001600160a01b0381166000908152600160205260409020612d74908363ffffffff61311e16565b50612d8660028363ffffffff61316116565b5060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000828152600a60205260409020612de1908263ffffffff61316d16565b15610a4557612dee612898565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006112a78383613182565b6000828152600a60205260409020612e5c908263ffffffff6131c716565b15610a4557612e69612898565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000808080612ebc86866131dc565b9097909650945050505050565b8051610a4590600990602084019061377f565b600033301415612f345760606000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b03169150610add9050565b503390565b6000612f46848484613238565b90505b9392505050565b60006112a7836001600160a01b038416613297565b612f70848484612b4e565b612f7c848484846132af565b6118445760405162461bcd60e51b81526004016109869061455a565b606081612fbd57506040805180820190915260018152600360fc1b6020820152610953565b8160005b8115612fd557600101600a82049150612fc1565b6060816001600160401b0381118015612fed57600080fd5b506040519080825280601f01601f191660200182016040528015613018576020820181803683370190505b50859350905060001982015b831561306957600a840660300160f81b8282806001900393508151811061304757fe5b60200101906001600160f81b031916908160001a905350600a84049350613024565b50949350505050565b60006112a78383613394565b6000612f4684846001600160a01b0385166133de565b60006112a78383613297565b6000604051806080016040528060438152602001614ec060439139805160209182012083518483015160408087015180519086012090516130e19501614395565b604051602081830303815290604052805190602001209050919050565b6000613108611204565b826040516020016130e19291906141fe565b5490565b60006112a78383613475565b6000818361314b5760405162461bcd60e51b815260040161098691906143d7565b50600083858161315757fe5b0495945050505050565b60006112a7838361353b565b60006112a7836001600160a01b038416613394565b815460009082106131a55760405162461bcd60e51b815260040161098690614474565b8260000182815481106131b457fe5b9060005260206000200154905092915050565b60006112a7836001600160a01b038416613475565b8154600090819083106132015760405162461bcd60e51b815260040161098690614967565b600084600001848154811061321257fe5b906000526020600020906002020190508060000154816001015492509250509250929050565b600082815260018401602052604081205482816132685760405162461bcd60e51b815260040161098691906143d7565b5084600001600182038154811061327b57fe5b9060005260206000209060020201600101549150509392505050565b60009081526001919091016020526040902054151590565b60006132c3846001600160a01b031661360f565b6132cf57506001612b46565b606061335d630a85bd0160e11b6132e4612898565b8887876040516024016132fa94939291906142c5565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b038381831617835250505050604051806060016040528060328152602001614e8e603291396001600160a01b038816919063ffffffff61364816565b90506000818060200190518101906133759190613dd3565b6001600160e01b031916630a85bd0160e11b1492505050949350505050565b60006133a08383613297565b6133d6575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556112aa565b5060006112aa565b600082815260018401602052604081205480613443575050604080518082018252838152602080820184815286546001818101895560008981528481209551600290930290950191825591519082015586548684528188019092529290912055612f49565b8285600001600183038154811061345657fe5b9060005260206000209060020201600101819055506000915050612f49565b6000818152600183016020526040812054801561353157835460001980830191908101906000908790839081106134a857fe5b90600052602060002001549050808760000184815481106134c557fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806134f557fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506112aa565b60009150506112aa565b60008181526001830160205260408120548015613531578354600019808301919081019060009087908390811061356e57fe5b906000526020600020906002020190508087600001848154811061358e57fe5b6000918252602080832084546002909302019182556001938401549184019190915583548252898301905260409020908401905586548790806135cd57fe5b60008281526020808220600260001990940193840201828155600190810183905592909355888152898201909252604082209190915594506112aa9350505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590612b46575050151592915050565b6060612f468484600085606061365d8561360f565b6136795760405162461bcd60e51b815260040161098690614c1e565b60006060866001600160a01b03168587604051613696919061412a565b60006040518083038185875af1925050503d80600081146136d3576040519150601f19603f3d011682016040523d82523d6000602084013e6136d8565b606091505b509150915081156136ec579150612b469050565b8051156136fc5780518082602001fd5b8360405162461bcd60e51b815260040161098691906143d7565b60405180606001604052806000815260200160006001600160a01b03168152602001606081525090565b6040518060e001604052806000815260200160608152602001606081526020016060815260200160608152602001606081526020016000151581525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106137c057805160ff19168380011785556137ed565b828001600101855582156137ed579182015b828111156137ed5782518255916020019190600101906137d2565b506137f9929150613857565b5090565b604051806040016040528060608152602001606081525090565b50805460018160011615610100020316600290046000825580601f1061383d57506113f7565b601f0160209004906000526020600020908101906113f791905b610add91905b808211156137f9576000815560010161385d565b80356001600160a01b03811681146112aa57600080fd5b600082601f830112613898578081fd5b81356138ab6138a682614dda565b614db4565b818152915060208083019084810160005b8481101561394a5781358701604080601f19838c030112156138dd57600080fd5b6138e681614db4565b858301356001600160401b03808211156138ff57600080fd5b61390d8d8984880101613960565b83528385013591508082111561392257600080fd5b506139318c8883870101613960565b82880152508652505092820192908201906001016138bc565b505050505092915050565b80356112aa81614e69565b600082601f830112613970578081fd5b813561397e6138a682614df9565b915080825283602082850101111561399557600080fd5b8060208401602084013760009082016020015292915050565b803560ff811681146112aa57600080fd5b6000602082840312156139d0578081fd5b6112a78383613871565b600080604083850312156139ec578081fd5b6139f68484613871565b9150613a058460208501613871565b90509250929050565b600080600060608486031215613a22578081fd5b8335613a2d81614e54565b92506020840135613a3d81614e54565b929592945050506040919091013590565b60008060008060808587031215613a63578081fd5b613a6d8686613871565b9350613a7c8660208701613871565b92506040850135915060608501356001600160401b03811115613a9d578182fd5b613aa987828801613960565b91505092959194509250565b60008060408385031215613ac7578081fd5b613ad18484613871565b91506020830135613ae181614e69565b809150509250929050565b600080600060408486031215613b00578081fd5b8335613b0b81614e54565b925060208401356001600160401b0380821115613b26578283fd5b81860187601f820112613b37578384fd5b8035925081831115613b47578384fd5b876020848301011115613b58578384fd5b949760209095019650909450505050565b600080600080600060a08688031215613b80578283fd5b613b8a8787613871565b945060208601356001600160401b03811115613ba4578384fd5b613bb088828901613960565b9450506040860135925060608601359150613bce87608088016139ae565b90509295509295909350565b60008060408385031215613bec578182fd5b613bf68484613871565b946020939093013593505050565b600080600060608486031215613c18578081fd5b613c228585613871565b9250613c3185602086016139ae565b9150604084013590509250925092565b60008060208385031215613c53578182fd5b82356001600160401b0380821115613c69578384fd5b81850186601f820112613c7a578485fd5b8035925081831115613c8a578485fd5b8660208085028301011115613c9d578485fd5b60200196919550909350505050565b60006020808385031215613cbe578182fd5b82356001600160401b03811115613cd3578283fd5b80840185601f820112613ce4578384fd5b80359150613cf46138a683614dda565b8281528381019082850185850284018601891015613d10578687fd5b8693505b84841015613d32578035835260019390930192918501918501613d14565b50979650505050505050565b600060208284031215613d4f578081fd5b81516112a781614e69565b600060208284031215613d6b578081fd5b5035919050565b60008060408385031215613d84578182fd5b823591506020830135613ae181614e54565b60008060408385031215613da8578182fd5b50508035926020909101359150565b600060208284031215613dc8578081fd5b81356112a781614e77565b600060208284031215613de4578081fd5b81516112a781614e77565b600060208284031215613e00578081fd5b81516001600160401b03811115613e15578182fd5b80830184601f820112613e26578283fd5b80519150613e366138a683614df9565b828152856020848401011115613e4a578384fd5b613e5b836020830160208501614e28565b95945050505050565b600060208284031215613e75578081fd5b81356001600160401b03811115613e8a578182fd5b612b4684828501613960565b600060208284031215613ea7578081fd5b81356001600160401b0380821115613ebd578283fd5b81840160e08187031215613ecf578384fd5b613ed960e0614db4565b925080358352602081013582811115613ef0578485fd5b613efc87828401613960565b602085015250604081013582811115613f13578485fd5b613f1f87828401613960565b604085015250606081013582811115613f36578485fd5b613f4287828401613960565b606085015250608081013582811115613f59578485fd5b613f6587828401613960565b60808501525060a081013582811115613f7c578485fd5b613f8887828401613888565b60a085015250613f9b8660c08301613955565b60c08401525090949350505050565b600060208284031215613fbb578081fd5b5051919050565b60008060408385031215613fd4578182fd5b82359150602083013560ff81168114613ae1578182fd5b15159052565b60008151808452614009816020860160208601614e28565b601f01601f19169290920160200192915050565b60008151835260208083015160e08286015261403c60e0860182613ff1565b6040915081850151868203838801526140558282613ff1565b60608701519250878103606089015261406e8184613ff1565b91505060808601519150868103608088015261408a8183613ff1565b60a0870151925087810360a089015280915082518082528582019250858682028301018685018895505b8286101561410857838203601f19018552805180518884526140d889850182613ff1565b8a83015191508481038b8601526140ef8183613ff1565b60019990990198978b01979450505090880190506140b4565b5060c0890151965061411d60c08b0188613feb565b9998505050505050505050565b6000825161413c818460208701614e28565b9190910192915050565b60008351614158818460208801614e28565b60609390931b6bffffffffffffffffffffffff19169190920190815260140192915050565b600080845460018082166000811461419c57600181146141b3576141e2565b60ff198316865260028304607f16860193506141e2565b600283048886526020808720875b838110156141da5781548a8201529085019082016141c1565b505050860193505b50505083516141f5818360208801614e28565b01949350505050565b61190160f01b81526002810192909252602282015260420190565b7f4368696c644d696e7461626c654552433732313a20494e56414c49445f544f4b815268022a72fa7aba722a9160bd1b6020820152602981019190915260490190565b6d4445504f5349544f525f524f4c4560901b8152600e0190565b6a5345525645525f524f4c4560a81b8152600b0190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906142f890830184613ff1565b9695505050505050565b6001600160a01b03848116825283166020820152606060408201819052600090613e5b90830184613ff1565b6001600160a01b03929092168252602082015260400190565b6020808252810182905260006001600160fb1b03831115614366578081fd5b60208302808560408501379190910160400190815292915050565b901515815260200190565b90815260200190565b93845260208401929092526001600160a01b03166040830152606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526112a76020830184613ff1565b60006020808301818452828554600180821660008114614411576001811461442f57614467565b60028304607f16855260ff1983166040890152606088019350614467565b6002830480865261443f8a614e1c565b885b8281101561445d5781548b820160400152908401908801614441565b8a01604001955050505b5091979650505050505050565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252600e908201526d13525395125391d7d0d313d4d15160921b604082015260600190565b6020808252601390820152721253925517d053149150511657d0d053131151606a1b604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526e0818591b5a5b881d1bc819dc985b9d608a1b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602f908201527f4368696c644d696e7461626c654552433732313a20544f4b454e5f455849535460408201526e29afa7a72fa927a7aa2fa1a420a4a760891b606082015260800190565b6020808252601c908201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c00000000604082015260600190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252600c908201526b4d41585f4255595f4f4e434560a01b604082015260600190565b60208082526030908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526f2061646d696e20746f207265766f6b6560801b606082015260800190565b60208082526025908201527f4e61746976654d6574615472616e73616374696f6e3a20494e56414c49445f5360408201526424a3a722a960d91b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b60208082526028908201527f4368696c644d696e7461626c654552433732313a20494e56414c49445f544f4b60408201526722a72fa7aba722a960c11b606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b6020808252600f908201526e09cdee840cadcdeeaced040ae8aa89608b1b604082015260600190565b60208082526013908201527226a0ac2fa9aaa828262c903932b0b1b432b21760691b604082015260600190565b60208082526022908201527f456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b60208082526028908201527f4368696c644d696e7461626c654552433732313a20455843454544535f42415460408201526710d217d31253525560c21b606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b60208082526021908201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636040820152600d60fb1b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60208082526021908201527f4d65746164617461206f6620746f6b656e20616c7265616479206368616e67656040820152601960fa1b606082015260800190565b6020808252601590820152740ac8298aa8abea89ea88298be9a92a6a69a82a8869605b1b604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b6000602082526112a7602083018461401d565b600060408252614d3a604083018561401d565b8281036020840152613e5b8185613ff1565b600087825260c06020830152614d6560c0830188613ff1565b8281036040840152614d778188613ff1565b8381036060850152614d898188613ff1565b9150508281036080840152614d9e8186613ff1565b91505082151560a0830152979650505050505050565b6040518181016001600160401b0381118282101715614dd257600080fd5b604052919050565b60006001600160401b03821115614def578081fd5b5060209081020190565b60006001600160401b03821115614e0e578081fd5b50601f01601f191660200190565b60009081526020902090565b60005b83811015614e43578181015183820152602001614e2b565b838111156118445750506000910152565b6001600160a01b03811681146113f757600080fd5b80151581146113f757600080fd5b6001600160e01b0319811681146113f757600080fdfe4552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e6174757265294552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656ea2646970667358221220265589f8a223d2da1601a154c8e3a430530a0cbde7017ceab25e1081f00c317c64736f6c63430006060033454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c6164647265737320766572696679696e67436f6e74726163742c627974657333322073616c7429000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000c6b5f5084c9d80a40be1c6a9f1e62c086f5a43ef000000000000000000000000a6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa0000000000000000000000000000000000000000000000000000000000000009417274766174617273000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044152545600000000000000000000000000000000000000000000000000000000
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000c6b5f5084c9d80a40be1c6a9f1e62c086f5a43ef000000000000000000000000a6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa0000000000000000000000000000000000000000000000000000000000000009417274766174617273000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044152545600000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name_ (string): Artvatars
Arg [1] : symbol_ (string): ARTV
Arg [2] : server (address): 0xc6b5f5084c9d80a40be1c6a9f1e62c086f5a43ef
Arg [3] : childChainManager (address): 0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 000000000000000000000000c6b5f5084c9d80a40be1c6a9f1e62c086f5a43ef
Arg [3] : 000000000000000000000000a6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [5] : 4172747661746172730000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [7] : 4152545600000000000000000000000000000000000000000000000000000000
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.