Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- GameItemContract
- Optimization enabled
- true
- Compiler version
- v0.8.9+commit.e5eed63a
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-04-22T12:09:31.508022Z
Contract source code
// Sources flattened with hardhat v2.10.1 https://hardhat.org // File openzeppelin-contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol // OpenZeppelin Contracts v4.4.0 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @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-upgradeable/token/ERC721/IERC721Upgradeable.sol // OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } // File openzeppelin-contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @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-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @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-upgradeable/utils/AddressUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // File openzeppelin-contracts-upgradeable/proxy/utils/Initializable.sol // OpenZeppelin Contracts v4.4.0 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } } // File openzeppelin-contracts-upgradeable/utils/ContextUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (utils/Context.sol) pragma solidity ^0.8.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 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 ContextUpgradeable is Initializable { function __Context_init() internal initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; } // File openzeppelin-contracts-upgradeable/utils/StringsUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal 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); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } } // File openzeppelin-contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol // OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal initializer { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal initializer { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } uint256[50] private __gap; } // File openzeppelin-contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol // OpenZeppelin Contracts v4.4.0 (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // 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; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal initializer { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.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 virtual 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 { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual 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 mechanisms 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 virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `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); _balances[to] += 1; _owners[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 = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[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(ERC721Upgradeable.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); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @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()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @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` and `to` are never both zero. * * 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 {} uint256[44] private __gap; } // File openzeppelin-contracts-upgradeable/token/ERC721/extensions/IERC721EnumerableUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @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-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable { function __ERC721Enumerable_init() internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC721Enumerable_init_unchained(); } function __ERC721Enumerable_init_unchained() internal initializer { } // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) { return interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @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 override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721Upgradeable.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } uint256[46] private __gap; } // File openzeppelin-contracts-upgradeable/access/OwnableUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (access/Ownable.sol) pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal initializer { __Context_init_unchained(); __Ownable_init_unchained(); } function __Ownable_init_unchained() internal initializer { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } uint256[49] private __gap; } // File openzeppelin-contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } } // File openzeppelin-contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol // OpenZeppelin Contracts v4.4.0 (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712Upgradeable is Initializable { /* solhint-disable var-name-mixedcase */ bytes32 private _HASHED_NAME; bytes32 private _HASHED_VERSION; bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ function __EIP712_init(string memory name, string memory version) internal initializer { __EIP712_init_unchained(name, version); } function __EIP712_init_unchained(string memory name, string memory version) internal initializer { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash()); } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash); } /** * @dev The hash of the name parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712NameHash() internal virtual view returns (bytes32) { return _HASHED_NAME; } /** * @dev The hash of the version parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712VersionHash() internal virtual view returns (bytes32) { return _HASHED_VERSION; } uint256[50] private __gap; } // File contracts/utils/EIP712Custom.sol // contracts/Market.sol pragma solidity ^0.8.0; /// @title Contract for game Item sale /// @notice User can use this contract for selling and buying game Items /// @dev this's an upgradeable contract with creating item for sale, selling and unlisting gameItem from sale /// @dev Marketplace is inheriting from IMarketplace and EIP712Upgradeable contract EIP712Custom is EIP712Upgradeable { error IncorrectSigner(address signer); error DeadlineExpired(uint256 deadline, uint256 currentTimestamp); } // File contracts/interfaces/IGameItem.sol pragma solidity ^0.8.0; /// @notice Interface for GameItemContract interface IGameItem { /// @notice this event is emitted when NFT GameItem is minted /// @param to new owner of GameItem /// @param tokenID id ow new GameItem /// @param quality quality(0-4) of new GameItem /// @param seasonID BattlePass season of new GameItem /// @param hacker the hacker who minted this item event Minted( address indexed to, uint256 indexed tokenID, uint8 quality, uint256 seasonID, address hacker); event MintedForUser( address indexed to, uint256 indexed tokenID, uint8 quality, uint256 financialWalletPayment, uint256 seasonID, address hacker); function version() external view returns (uint32); /// @notice gets creator's address of specific GameItem /// @param _tokenID token id of specific GameItem /// @return minter's address function getItemCreator(uint256 _tokenID) external view returns(address); /// @notice gets (hacker) address of specific GameItem /// @param _tokenID token id of specific GameItem /// @return hacker's address function getItemHacker(uint256 _tokenID) external view returns(address); /// @notice gets validator's(hacker) address of specific GameItem /// @param _tokenID token id of specific GameItem /// @return validator's address function getItemValidator(uint256 _tokenID) external view returns(uint256); /// @notice gets quality of specific GameItem /// @param _tokenID token id of specific GameItem /// @return uint8 parameter. quality of GameItem function getItemQuality(uint256 _tokenID) external view returns(uint8); /// @notice gets season of specific GameItem /// @param _tokenID token id of specific GameItem /// @return uint256 parameter. season id function getItemSeason(uint256 _tokenID) external view returns(uint256); /// @notice gets market state of specific GameItem /// @param _tokenID token id of specific GameItem /// @return uint8 parameter. Market state of GameItem function getItemState(uint256 _tokenID) external view returns(uint8); /// @notice changes market state of specific GameItem /// @param _tokenID token id of specific GameItem /// @param _state (0-2) new item state function changeItemState(uint256 _tokenID, uint8 _state) external; /// @notice mints new GameItem /// @dev can be called only via DataCubeContract or ValidatorLicenseContract /// @dev emits "Minted" event /// @param _receiver receiver's address of new GameItem /// @param _VLTokenID token id of specific ValidatorLicense /// @param _seasonID token id of season /// @param _DCQuality quality of new GameItem /// @param _metadataURL URL to metadata storage function mintFromCube( address _receiver, uint256 _VLTokenID, uint256 _seasonID, uint8 _DCQuality, string memory _metadataURL) external; /// @notice mints new GameItem /// @dev can be called by user, with signature /// @dev sends GUNs to this contract address /// @param _VLTokenID token id of specific ValidatorLicense /// @param _seasonID token id of season /// @param _quality quality of new GameItem /// @param _price price(in GUNs) od DataCube decoding /// @param _metadataURL URL to metadata storage function mintForUser( uint256 _VLTokenID, uint256 _seasonID, uint8 _quality, uint256 _price, string memory _metadataURL, address receiver) payable external; function burn(uint256 _tokenID) external; function bridgeBurn(uint256 _tokenID) external; function bridgeMint(address to, uint256 _tokenID) external; } // File openzeppelin-contracts-upgradeable/access/IAccessControlUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @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 {AccessControl-_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) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @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) external; /** * @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) external; /** * @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) external; } // File openzeppelin-contracts-upgradeable/access/AccessControlUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (access/AccessControl.sol) pragma solidity ^0.8.0; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * 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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); } function __AccessControl_init_unchained() internal initializer { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @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 override 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 override onlyRole(getRoleAdmin(role)) { _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 override onlyRole(getRoleAdmin(role)) { _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 revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { 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}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ 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 { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } uint256[49] private __gap; } // File openzeppelin-contracts-upgradeable/security/PausableUpgradeable.sol // OpenZeppelin Contracts v4.4.0 (security/Pausable.sol) pragma solidity ^0.8.0; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal initializer { __Context_init_unchained(); __Pausable_init_unchained(); } function __Pausable_init_unchained() internal initializer { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } uint256[49] private __gap; } // File contracts/PlatformSettings.sol pragma solidity ^0.8.0; /// @title A platform settings for OTG contracts /// @notice Admin can use this contract for granting and revoking roles, pause and unpause platform, set new wallets for fee receiving /// @dev This contract inherits 'Initializable', 'AccessControlUpgradeable', 'PausableUpgradeable' contracts form openzeppelin library contract PlatformSettings is Initializable, AccessControlUpgradeable, PausableUpgradeable{ bytes32 public constant SECONDARY_ADMIN_ROLE = keccak256("SECONDARY_ADMIN_ROLE"); bytes32 public constant BACKEND_ROLE = keccak256("BACKEND_ROLE"); uint256 public constant gunDecimals = 10**18; uint256 public constant PERCENT_DENOMINATOR = 100; // address of main admin address public initialAdmin; // address of financial wallet (withdraws GUNs from contract) address payable public financialWallet; // percentage that represents validator fee during decoding process uint256 public validatorFeePercentageForDecoding; // percentage that represents platform fee during decoding process uint256 public platformFeePercentageForDecoding; bytes32 public constant BRIDGE_ROLE = keccak256("BRIDGE_ROLE"); /// @notice this event is emitted when new financial wallet is set /// @param newWallet address of new financial wallet event newFinancialWallet( address indexed newWallet ); error InvalidRole(address caller, bytes32 role); error IncorrectFeeDistribution(); error AlreadyHasRole(address account, bytes32 role); error AlreadyHasNotRole(address account, bytes32 role); /// @notice A disposable function for initializing contract /// @param _admin address of initial admin of contract /// @dev Grants caller with admin role /// @dev Also calls initializers of AccessControl and Pausable contracts. /// @dev Sets caller as an initialAdmin and financeWallet(wallet for receiving fees and royalties) /// @dev Sets initial fee percentage for decoding process function initialize( address _admin )public initializer{ __AccessControl_init(); __Pausable_init_unchained(); _setupRole(DEFAULT_ADMIN_ROLE, _admin); initialAdmin = _admin; financialWallet = payable(msg.sender); validatorFeePercentageForDecoding = 50; platformFeePercentageForDecoding = 50; } // *********************** MODIFIERS ********************************************* /// @notice verifies if message sender is an admin or secondary admin modifier onlyAdmin{ if(!(hasRole(DEFAULT_ADMIN_ROLE, msg.sender) || hasRole(SECONDARY_ADMIN_ROLE,msg.sender))){ revert InvalidRole(msg.sender, SECONDARY_ADMIN_ROLE); } _; } // *********************** VIEW FUNCTIONS ********************************************* /// TODO restrict function visibility from view to pure function version() public pure returns (uint32){ //version in format aaa.bbb.ccc => aaa*1E6+bbb*1E3+ccc; return uint32(1000001); } // *********************** FUNCTIONS ********************************************* /// @notice checks account for admin roles function isAdmin(address account) public view returns(bool){ return (hasRole(DEFAULT_ADMIN_ROLE, account)||hasRole(SECONDARY_ADMIN_ROLE, account)); } /// @notice checks account for backend role function isBackendRole(address account) public view returns(bool){ return hasRole(BACKEND_ROLE, account); } function isBridgeRole(address account) public view returns(bool){ return hasRole(BRIDGE_ROLE, account); } /// @notice checks account for admin roles or if platform is not paused function isAdminOrNotPaused(address caller) public view returns(bool){ return(!paused()||hasRole(DEFAULT_ADMIN_ROLE,caller)||hasRole(SECONDARY_ADMIN_ROLE,caller)); } /// TODO check if this function must exist /// @notice returns a number, that represents amount of fee, which validator will receive after decoding process function getValidatorFeeForDecoding(uint256 _price)public view returns(uint256){ if((platformFeePercentageForDecoding + validatorFeePercentageForDecoding)!=100){ revert IncorrectFeeDistribution(); } return (_price* gunDecimals * validatorFeePercentageForDecoding)/PERCENT_DENOMINATOR; } /// TODO check if this function must exist /// @notice returns a number, that represents amount of fee, which financialWallet will receive after decoding process function getPlatformFeeForDecoding(uint256 _price)public view returns(uint256){ if((platformFeePercentageForDecoding + validatorFeePercentageForDecoding)!=100){ revert IncorrectFeeDistribution(); } return (_price* gunDecimals * platformFeePercentageForDecoding)/PERCENT_DENOMINATOR; } /// @notice suspends most functions in contracts /// @dev Caller must be admin function pause() public onlyAdmin{ _pause(); } /// @notice restores most functions in contracts /// @dev Caller must be admin function unpause() public onlyAdmin{ _unpause(); } /// @notice sets new address as a payable financialWallet /// @dev caller must be admin, emits 'newFinancialWallet' function setNewFinancialWallet(address _newWalletAddress) public onlyAdmin{ financialWallet = payable(_newWalletAddress); emit newFinancialWallet(_newWalletAddress); } /// @notice granting secondary admin role to a specific address /// @param account address of a specific account function grantSecondaryAdminRole(address account) public onlyRole(DEFAULT_ADMIN_ROLE){ if(hasRole(SECONDARY_ADMIN_ROLE, account)){ revert AlreadyHasRole(account, SECONDARY_ADMIN_ROLE); } grantRole(SECONDARY_ADMIN_ROLE, account); } /// @notice revoking secondary admin role from a specific address /// @param account address of a specific account function revokeSecondaryAdminRole(address account) public onlyRole(DEFAULT_ADMIN_ROLE){ if(!hasRole(SECONDARY_ADMIN_ROLE, account)){ revert AlreadyHasNotRole(account, SECONDARY_ADMIN_ROLE); } revokeRole(SECONDARY_ADMIN_ROLE, account); } /// @notice granting backend admin role from a specific address /// @param account address of a specific account function grantBackendRole(address account) public onlyRole(DEFAULT_ADMIN_ROLE){ if(hasRole(BACKEND_ROLE, account)){ revert AlreadyHasRole(account, BACKEND_ROLE); } grantRole(BACKEND_ROLE, account); } /// @notice revoking backend admin role from a specific address /// @param account address of a specific account function revokeBackendRole(address account) public onlyRole(DEFAULT_ADMIN_ROLE){ if(!hasRole(BACKEND_ROLE, account)){ revert AlreadyHasNotRole(account, BACKEND_ROLE); } revokeRole(BACKEND_ROLE, account); } function grantBridgeRole(address account) public onlyRole(DEFAULT_ADMIN_ROLE){ if(hasRole(BRIDGE_ROLE, account)){ revert AlreadyHasRole(account, BRIDGE_ROLE); } grantRole(BRIDGE_ROLE, account); } function revokeBridgeRole(address account) public onlyRole(DEFAULT_ADMIN_ROLE){ if(!hasRole(BRIDGE_ROLE, account)){ revert AlreadyHasNotRole(account, BRIDGE_ROLE); } revokeRole(BRIDGE_ROLE, account); } /// TODO maybe it will be better, to set validatorFeePercentageForDecoding and platformFeePercentageForDecoding with one function /// @notice Sets a number, that represents amount of fee, which validator will receive after /// @dev caller must be admin function setValidatorFeePercentageForDecoding(uint256 _percentage) public onlyAdmin{ validatorFeePercentageForDecoding = _percentage; } /// @notice Sets a number, that represents amount of fee, which financialWallet will receive after /// @dev caller must be admin function setPlatformFeePercentageForDecoding(uint256 _percentage) public onlyAdmin{ platformFeePercentageForDecoding = _percentage; } // TODO DEPRECATED, will be deleted sooner function getValidatorFeePercentageForDecoding() external view returns(uint256){ return(validatorFeePercentageForDecoding); } // TODO DEPRECATED, will be deleted sooner function getPlatformFeePercentageForDecoding() external view returns(uint256){ return(platformFeePercentageForDecoding); } } // File contracts/utils/ERC721BatchUpgradeable.sol pragma solidity ^0.8.0; contract ERC721BatchUpgradeable is ERC721EnumerableUpgradeable { function batchApprove(address to, uint256[] memory tokenIDs) public { for (uint256 i = 0; i < tokenIDs.length; ++i) { approve(to, tokenIDs[i]); } } } // File contracts/GameItemContract.sol //SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title Contract for game item management /// @notice User can use this contract for reading info about GameItem, also user can transfer GameItem /// @dev EIP712Upgradeable will be removed sooner /// @notice Abbreviations: GI - GameItem contract GameItemContract is ERC721BatchUpgradeable, IGameItem, EIP712Custom{ using StringsUpgradeable for uint256; // last minted token id of GameItem uint256 public lastMintedTokenID; // address of Decoder contract address address public decoderAddress; // address of DataCubeContract address public dataCubeContractAddress; // address of BattlePassContract address public battlePassContractAddress; // address of PlatformSettings contracct address public platformSettingsContractAddress; // GameItem tokens mapping(uint256 => GameItem) public items; address public validatorLicenseContractAddress; /// structure of GameItem token /// creator - minter, validator - owner of ValidatorLicense, quality - item quality, season - item season, state - (Instant, Auction, Sold) state of item,metadataURL - URL to metadata storage struct GameItem{ address creator; uint256 validator; Quality quality; uint256 season; MarketState state; string metadataURL; address hacker; } /// enumeration for GameItem marketplace state, new state will be added sooner enum MarketState{ Instant, Auction, Sold } /// enumeration for GameItem quality enum Quality{ Standard, Professional, Elite, Overclocked, Hacked } event setHackerForItem(uint256 tokenID, address hacker); error ContractsIsPaused(); error ContractsIsNotPaused(); error InvalidRole(address caller, bytes32 role); error CallerNotDataCubeContractNorDecoder(address caller); error CallerNotOwner(address caller, address owner, uint256 tokenID); error IncorrectValue(uint256 value, uint256 price); error UnsuccessfulPayment(address from, address to, uint256 amount); error NonexistingToken(uint256 tokenID); /// @notice A disposable function for initializing contract /// @param _dataCubeContractAddress address of DataCubeContract /// @param _platformSettingsContractAddress address of PlatformSettings contract /// @dev calls initializer from ERC721Upgradeable and EIP712Upgradeable contract function initialize( address _dataCubeContractAddress, address _platformSettingsContractAddress, address _validatorLicenseContractAddress ) public initializer{ __ERC721_init("Game Item", "GI"); __EIP712_init('GameItemContract','1'); dataCubeContractAddress = _dataCubeContractAddress; platformSettingsContractAddress = _platformSettingsContractAddress; validatorLicenseContractAddress = _validatorLicenseContractAddress; } // *********************** MODIFIERS ********************************************* /// TODO check if this modifier must exist /// @notice verifies if switch "_paused" in PlatformSettings contract is on modifier whenPaused{ if(!PlatformSettings(platformSettingsContractAddress).paused()){ revert ContractsIsPaused(); } _; } /// @notice verifies if switch "_paused" in PlatformSettings contract is off modifier whenNotPaused{ if(PlatformSettings(platformSettingsContractAddress).paused()){ revert ContractsIsNotPaused(); } _; } /// @notice verifies if message sender is an admin or secondary admin modifier onlyAdmin{ if(!(PlatformSettings(platformSettingsContractAddress).hasRole(PlatformSettings(platformSettingsContractAddress).DEFAULT_ADMIN_ROLE(),msg.sender)||PlatformSettings(platformSettingsContractAddress).hasRole(PlatformSettings(platformSettingsContractAddress).SECONDARY_ADMIN_ROLE(),msg.sender))){ revert InvalidRole(msg.sender, PlatformSettings(platformSettingsContractAddress).SECONDARY_ADMIN_ROLE()); } _; } modifier onlyDataCubeContractOrDecoder{ if(decoderAddress != msg.sender && dataCubeContractAddress != msg.sender){ revert CallerNotDataCubeContractNorDecoder(msg.sender); } _; } modifier onlyBridge{ if(!PlatformSettings(platformSettingsContractAddress).isBridgeRole(msg.sender)){ revert InvalidRole(msg.sender, PlatformSettings(platformSettingsContractAddress).BRIDGE_ROLE()); } _; } // *********************** VIEW FUNCTIONS ********************************************* /// TODO restrict function visibility from view to pure function version() public override pure returns (uint32){ //version in format aaa.bbb.ccc => aaa*1E6+bbb*1E3+ccc; return uint32(1000003); } /// @notice gets creator's address of specific GameItem /// @dev inherited from IGameItem interface /// @param _tokenID token id of specific GameItem /// @return minter's address function getItemCreator(uint256 _tokenID) public view override returns(address){ return items[_tokenID].creator; } /// @notice gets validator's(hacker) address of specific GameItem /// @dev inherited from IGameItem interface /// @param _tokenID token id of specific GameItem /// @return validator's address function getItemValidator(uint256 _tokenID) public view override returns(uint256){ return items[_tokenID].validator; } /// @notice gets (hacker) address of specific GameItem /// @dev inherited from IGameItem interface /// @param _tokenID token id of specific GameItem /// @return hacker's address function getItemHacker(uint256 _tokenID) public view override returns(address){ return items[_tokenID].hacker; } /// @notice gets quality of specific GameItem /// @dev inherited from IGameItem interface /// @param _tokenID token id of specific GameItem /// @return uint8 parameter. quality of GameItem function getItemQuality(uint256 _tokenID) public view override returns(uint8){ return uint8(items[_tokenID].quality); } /// @notice gets season of specific GameItem /// @dev inherited from IGameItem interface /// @param _tokenID token id of specific GameItem /// @return uint256 parameter. season id function getItemSeason(uint256 _tokenID) public view override returns(uint256){ return items[_tokenID].season; } /// @notice gets market state of specific GameItem /// @dev inherited from IGameItem interface /// @param _tokenID token id of specific GameItem /// @return uint8 parameter. Market state of GameItem function getItemState(uint256 _tokenID) public view override returns(uint8){ return uint8(items[_tokenID].state); } /// @dev Returns the Uniform Resource Identifier (URI) for `_tokenID` GameItem function tokenURI(uint256 _tokenID) public view override returns (string memory) { if(!_exists(_tokenID)){ revert NonexistingToken(_tokenID); } string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, _tokenID.toString())) : ""; } function _baseURI() internal view override returns (string memory) { return "https://metadata.gunz.dev/api/v1/0x4646bfacFe64CB27403Ff58Ae7Cbf9398971F1a0/"; } // *********************** FUNCTIONS ********************************************* /// @notice Admin sets new address for Decoder contract function setDecoderAddress(address _contractAddress) public onlyAdmin{ decoderAddress = _contractAddress; } /// @notice Admin sets new address for validatorLicenseContractAddress contract function setValidatorLicenseAddress(address _contractAddress) public onlyAdmin{ validatorLicenseContractAddress = _contractAddress; } /// @notice changes market state of specific GameItem /// @dev inherited from IGameItem interface /// @param _tokenID token id of specific GameItem /// @param _state (0-2) new item state function changeItemState(uint256 _tokenID, uint8 _state)public override { items[_tokenID].state = MarketState(_state); } function setItemHacker(uint256 _tokenID) public onlyAdmin { address hacker = IERC721Upgradeable(validatorLicenseContractAddress).ownerOf(getItemValidator(_tokenID)); items[_tokenID].hacker = hacker; emit setHackerForItem(_tokenID, hacker); } ///TODO add check if VL is activated /// @notice mints new GameItem /// @dev can be called only via DataCubeContract or Decoder contract /// @dev emits "Minted" event, calls '_safeMint' function from ERC721Upgradeable contract /// @param _receiver receiver's address of new GameItem /// @param _VLTokenID token id of specific ValidatorLicense /// @param _seasonID token id of season /// @param _DCQuality quality of new GameItem /// @param _metadataURL URL to metadata storage function mintFromCube( address _receiver, uint256 _VLTokenID, uint256 _seasonID, uint8 _DCQuality, string memory _metadataURL ) public override onlyDataCubeContractOrDecoder(){ uint256 _tokenID = ++lastMintedTokenID; address hacker = IERC721Upgradeable(validatorLicenseContractAddress).ownerOf(_VLTokenID); _safeMint(_receiver, _tokenID); items[_tokenID].creator = _receiver; items[_tokenID].quality = Quality(_DCQuality); items[_tokenID].validator = _VLTokenID; items[_tokenID].hacker = hacker; items[_tokenID].metadataURL = _metadataURL; items[_tokenID].season = _seasonID; emit Minted( _receiver, _tokenID, _DCQuality, _seasonID, hacker); } ///TODO add check if VL is activated /// @notice mints new GameItem /// @dev can be called by user, with signature /// @dev emits "Minted" event, sends GUNs to this contract address /// @param _VLTokenID token id of specific ValidatorLicense /// @param _seasonID token id of season /// @param _quality quality of new GameItem /// @param _price price(in GUNs) od DataCube decoding /// @param _metadataURL URL to metadata storage function mintForUser( uint256 _VLTokenID, uint256 _seasonID, uint8 _quality, uint256 _price, string memory _metadataURL, address receiver ) public payable override whenNotPaused onlyAdmin{ if(msg.value != _price){ revert IncorrectValue(msg.value, _price); } address payable financialWallet = PlatformSettings(platformSettingsContractAddress).financialWallet(); (bool success,) = financialWallet.call{value:(_price)}(""); if(!success){ revert UnsuccessfulPayment(address(this), financialWallet, _price); } //// uint256 _tokenID = ++lastMintedTokenID; address hacker = IERC721Upgradeable(validatorLicenseContractAddress).ownerOf(_VLTokenID); _safeMint(receiver, _tokenID); items[_tokenID].creator = receiver; items[_tokenID].quality = Quality(_quality); items[_tokenID].validator = _VLTokenID; items[_tokenID].hacker = hacker; items[_tokenID].metadataURL = _metadataURL; items[_tokenID].season = _seasonID; emit MintedForUser( receiver, _tokenID, _quality, (_price), _seasonID, hacker); } /// TODO tech debt for current version - contract will inherit ERC721BurnableUpgradeable contract sooner /// @notice burns token with specific id /** * @dev Destroys `tokenID`. * The approval is cleared when the token is burned. * * Requirements: * * - caller must be owner of 'tokenID' * - `tokenID` must exist. * * Emits a {Transfer} event. */ function burn(uint256 _tokenID) public override { if(ERC721Upgradeable.ownerOf(_tokenID) != msg.sender){ revert CallerNotOwner(msg.sender, ERC721Upgradeable.ownerOf(_tokenID), _tokenID); } super._burn(_tokenID); } function bridgeMint(address to, uint256 _tokenID) public override onlyBridge { _mint(to, _tokenID); } function bridgeBurn(uint256 _tokenID) public override onlyBridge { super._burn(_tokenID); } // *********************** INTERNAL FUNCTIONS ********************************************* /// @dev verifies if caller is an admin /// @dev tech debt for current version - inherits same function from ERC721EnumerableUpgradeable contract /// @dev inherited from contract ERC721Upgradeable function _beforeTokenTransfer( address from, address to, uint256 tokenID ) internal override virtual { // require(!PlatformSettings(platformSettingsContractAddress).paused()||PlatformSettings(platformSettingsContractAddress).hasRole(PlatformSettings(platformSettingsContractAddress).DEFAULT_ADMIN_ROLE(),msg.sender)||PlatformSettings(platformSettingsContractAddress).hasRole(PlatformSettings(platformSettingsContractAddress).SECONDARY_ADMIN_ROLE(),msg.sender),"IP1"); super._beforeTokenTransfer(from,to,tokenID); from;to;tokenID; } // Function to receive Ether. msg.data must be empty receive() external payable {} // Fallback function is called when msg.data is not empty fallback() external payable {} }
Contract ABI
[{"type":"error","name":"CallerNotDataCubeContractNorDecoder","inputs":[{"type":"address","name":"caller","internalType":"address"}]},{"type":"error","name":"CallerNotOwner","inputs":[{"type":"address","name":"caller","internalType":"address"},{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"tokenID","internalType":"uint256"}]},{"type":"error","name":"ContractsIsNotPaused","inputs":[]},{"type":"error","name":"ContractsIsPaused","inputs":[]},{"type":"error","name":"DeadlineExpired","inputs":[{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"uint256","name":"currentTimestamp","internalType":"uint256"}]},{"type":"error","name":"IncorrectSigner","inputs":[{"type":"address","name":"signer","internalType":"address"}]},{"type":"error","name":"IncorrectValue","inputs":[{"type":"uint256","name":"value","internalType":"uint256"},{"type":"uint256","name":"price","internalType":"uint256"}]},{"type":"error","name":"InvalidRole","inputs":[{"type":"address","name":"caller","internalType":"address"},{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"error","name":"NonexistingToken","inputs":[{"type":"uint256","name":"tokenID","internalType":"uint256"}]},{"type":"error","name":"UnsuccessfulPayment","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"approved","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"operator","internalType":"address","indexed":true},{"type":"bool","name":"approved","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"Minted","inputs":[{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"tokenID","internalType":"uint256","indexed":true},{"type":"uint8","name":"quality","internalType":"uint8","indexed":false},{"type":"uint256","name":"seasonID","internalType":"uint256","indexed":false},{"type":"address","name":"hacker","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"MintedForUser","inputs":[{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"tokenID","internalType":"uint256","indexed":true},{"type":"uint8","name":"quality","internalType":"uint8","indexed":false},{"type":"uint256","name":"financialWalletPayment","internalType":"uint256","indexed":false},{"type":"uint256","name":"seasonID","internalType":"uint256","indexed":false},{"type":"address","name":"hacker","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"setHackerForItem","inputs":[{"type":"uint256","name":"tokenID","internalType":"uint256","indexed":false},{"type":"address","name":"hacker","internalType":"address","indexed":false}],"anonymous":false},{"type":"fallback","stateMutability":"payable"},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"approve","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"batchApprove","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256[]","name":"tokenIDs","internalType":"uint256[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"battlePassContractAddress","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"bridgeBurn","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"bridgeMint","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changeItemState","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"},{"type":"uint8","name":"_state","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"dataCubeContractAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"decoderAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getApproved","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getItemCreator","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getItemHacker","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"getItemQuality","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getItemSeason","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"getItemState","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getItemValidator","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_dataCubeContractAddress","internalType":"address"},{"type":"address","name":"_platformSettingsContractAddress","internalType":"address"},{"type":"address","name":"_validatorLicenseContractAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"creator","internalType":"address"},{"type":"uint256","name":"validator","internalType":"uint256"},{"type":"uint8","name":"quality","internalType":"enum GameItemContract.Quality"},{"type":"uint256","name":"season","internalType":"uint256"},{"type":"uint8","name":"state","internalType":"enum GameItemContract.MarketState"},{"type":"string","name":"metadataURL","internalType":"string"},{"type":"address","name":"hacker","internalType":"address"}],"name":"items","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastMintedTokenID","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"mintForUser","inputs":[{"type":"uint256","name":"_VLTokenID","internalType":"uint256"},{"type":"uint256","name":"_seasonID","internalType":"uint256"},{"type":"uint8","name":"_quality","internalType":"uint8"},{"type":"uint256","name":"_price","internalType":"uint256"},{"type":"string","name":"_metadataURL","internalType":"string"},{"type":"address","name":"receiver","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintFromCube","inputs":[{"type":"address","name":"_receiver","internalType":"address"},{"type":"uint256","name":"_VLTokenID","internalType":"uint256"},{"type":"uint256","name":"_seasonID","internalType":"uint256"},{"type":"uint8","name":"_DCQuality","internalType":"uint8"},{"type":"string","name":"_metadataURL","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"platformSettingsContractAddress","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDecoderAddress","inputs":[{"type":"address","name":"_contractAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setItemHacker","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setValidatorLicenseAddress","inputs":[{"type":"address","name":"_contractAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenByIndex","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenOfOwnerByIndex","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"tokenURI","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"validatorLicenseContractAddress","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"version","inputs":[]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x608060405234801561001057600080fd5b50613aa1806100206000396000f3fe6080604052600436106102325760003560e01c80636744be5d1161012d578063b88d4fde116100b0578063d615797211610077578063d615797214610709578063dcc67de914610729578063e34128e414610749578063e985e9c51461076a578063f52d779f146107b3578063f7d00423146107ed57005b8063b88d4fde14610655578063bfb231d214610675578063c0c53b8b146106a8578063c6a319fa146106c8578063c87b56dd146106e957005b806395d89b41116100f457806395d89b41146105ca57806396786ed4146105df5780639b1075c0146105ff578063a22cb46514610615578063a869f9931461063557005b80636744be5d1461053657806370a082311461055757806371ab618c146105775780637fa56211146105975780638c2a993e146105aa57005b806342842e0e116101b55780635686f69e1161017c5780635686f69e1461046e5780636236921e1461048e57806362848c0f146104bf5780636352211e146104f657806365d5a9d01461051657005b806342842e0e146103be57806342966c68146103de57806345bdac10146103fe5780634f6ccce71461043057806354fd4d501461045057005b806318160ddd116101f957806318160ddd1461032957806323b872dd1461033e5780632e1a09b31461035e5780632f745c591461037e5780633407fc511461039e57005b806301ffc9a71461023b578063036e7da11461027057806306fdde03146102af578063081812fc146102d1578063095ea7b31461030957005b3661023957005b005b34801561024757600080fd5b5061025b610256366004613195565b61080d565b60405190151581526020015b60405180910390f35b34801561027c57600080fd5b506102a161028b3660046131b2565b6000908152610102602052604090206003015490565b604051908152602001610267565b3480156102bb57600080fd5b506102c4610838565b6040516102679190613223565b3480156102dd57600080fd5b506102f16102ec3660046131b2565b6108ca565b6040516001600160a01b039091168152602001610267565b34801561031557600080fd5b5061023961032436600461324b565b610964565b34801561033557600080fd5b506099546102a1565b34801561034a57600080fd5b50610239610359366004613277565b610a7a565b34801561036a57600080fd5b506102396103793660046132b8565b610aab565b34801561038a57600080fd5b506102a161039936600461324b565b610d75565b3480156103aa57600080fd5b5060fe546102f1906001600160a01b031681565b3480156103ca57600080fd5b506102396103d9366004613277565b610e0b565b3480156103ea57600080fd5b506102396103f93660046131b2565b610e26565b34801561040a57600080fd5b5061041e6104193660046131b2565b610e87565b60405160ff9091168152602001610267565b34801561043c57600080fd5b506102a161044b3660046131b2565b610eae565b34801561045c57600080fd5b50604051620f42438152602001610267565b34801561047a57600080fd5b5060ff546102f1906001600160a01b031681565b34801561049a57600080fd5b506102a16104a93660046131b2565b6000908152610102602052604090206001015490565b3480156104cb57600080fd5b506102f16104da3660046131b2565b600090815261010260205260409020546001600160a01b031690565b34801561050257600080fd5b506102f16105113660046131b2565b610f41565b34801561052257600080fd5b5061023961053136600461331c565b610fb8565b34801561054257600080fd5b50610103546102f1906001600160a01b031681565b34801561056357600080fd5b506102a16105723660046132b8565b610ff7565b34801561058357600080fd5b506102396105923660046131b2565b61107e565b6102396105a5366004613465565b6113cd565b3480156105b657600080fd5b506102396105c536600461324b565b6119c6565b3480156105d657600080fd5b506102c4611a99565b3480156105eb57600080fd5b506102396105fa3660046134e3565b611aa8565b34801561060b57600080fd5b506102a160fd5481565b34801561062157600080fd5b5061023961063036600461351d565b611af2565b34801561064157600080fd5b50610239610650366004613556565b611afd565b34801561066157600080fd5b506102396106703660046135ca565b611d12565b34801561068157600080fd5b506106956106903660046131b2565b611d4a565b6040516102679796959493929190613660565b3480156106b457600080fd5b506102396106c33660046136d4565b611e2b565b3480156106d457600080fd5b50610101546102f1906001600160a01b031681565b3480156106f557600080fd5b506102c46107043660046131b2565b611f68565b34801561071557600080fd5b5061041e6107243660046131b2565b611fff565b34801561073557600080fd5b506102396107443660046131b2565b612026565b34801561075557600080fd5b50610100546102f1906001600160a01b031681565b34801561077657600080fd5b5061025b61078536600461371f565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b3480156107bf57600080fd5b506102f16107ce3660046131b2565b600090815261010260205260409020600601546001600160a01b031690565b3480156107f957600080fd5b506102396108083660046132b8565b6120eb565b60006001600160e01b0319821663780e9d6360e01b1480610832575061083282612352565b92915050565b6060606580546108479061374d565b80601f01602080910402602001604051908101604052809291908181526020018280546108739061374d565b80156108c05780601f10610895576101008083540402835291602001916108c0565b820191906000526020600020905b8154815290600101906020018083116108a357829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b03166109485760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b600061096f82610f41565b9050806001600160a01b0316836001600160a01b031614156109dd5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161093f565b336001600160a01b03821614806109f957506109f98133610785565b610a6b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161093f565b610a7583836123a2565b505050565b610a843382612410565b610aa05760405162461bcd60e51b815260040161093f90613788565b610a75838383612507565b610101546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b158015610af957600080fd5b505afa158015610b0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3191906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015610b6e57600080fd5b505afa158015610b82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba691906137f2565b80610ca75750610101546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b158015610bfa57600080fd5b505afa158015610c0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3291906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015610c6f57600080fd5b505afa158015610c83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca791906137f2565b610d5257610101546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610cf057600080fd5b505afa158015610d04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2891906137d9565b6040516316b4d34b60e31b81526001600160a01b039092166004830152602482015260440161093f565b61010380546001600160a01b0319166001600160a01b0392909216919091179055565b6000610d8083610ff7565b8210610de25760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161093f565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b610a7583838360405180602001604052806000815250611d12565b33610e3082610f41565b6001600160a01b031614610e7b5733610e4882610f41565b60405163f604c2ef60e01b81526001600160a01b039283166004820152911660248201526044810182905260640161093f565b610e84816126b2565b50565b6000818152610102602052604081206004015460ff1660028111156108325761083261364a565b6000610eb960995490565b8210610f1c5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161093f565b60998281548110610f2f57610f2f61380f565b90600052602060002001549050919050565b6000818152606760205260408120546001600160a01b0316806108325760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161093f565b60005b8151811015610a7557610fe783838381518110610fda57610fda61380f565b6020026020010151610964565b610ff08161383b565b9050610fbb565b60006001600160a01b0382166110625760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161093f565b506001600160a01b031660009081526068602052604090205490565b610101546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b1580156110cc57600080fd5b505afa1580156110e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110491906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561114157600080fd5b505afa158015611155573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117991906137f2565b8061127a5750610101546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b1580156111cd57600080fd5b505afa1580156111e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120591906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561124257600080fd5b505afa158015611256573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127a91906137f2565b6112c357610101546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610cf057600080fd5b610103546000906001600160a01b0316636352211e6112f2846000908152610102602052604090206001015490565b6040518263ffffffff1660e01b815260040161131091815260200190565b60206040518083038186803b15801561132857600080fd5b505afa15801561133c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113609190613856565b6000838152610102602090815260409182902060060180546001600160a01b0319166001600160a01b0385169081179091558251868152918201529192507f8a3a14dacbb53f545e020304630c1255fcd812d52819ad6e2f6ca608c20e6aa7910160405180910390a15050565b61010160009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561141c57600080fd5b505afa158015611430573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145491906137f2565b156114725760405163b5c05c3160e01b815260040160405180910390fd5b610101546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b1580156114c057600080fd5b505afa1580156114d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f891906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561153557600080fd5b505afa158015611549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156d91906137f2565b8061166e5750610101546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b1580156115c157600080fd5b505afa1580156115d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f991906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561163657600080fd5b505afa15801561164a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166e91906137f2565b6116b757610101546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610cf057600080fd5b8234146116e057604051635928816d60e11b81523460048201526024810184905260440161093f565b610101546040805163220ce7e760e21b815290516000926001600160a01b0316916388339f9c916004808301926020929190829003018186803b15801561172657600080fd5b505afa15801561173a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175e9190613856565b90506000816001600160a01b03168560405160006040518083038185875af1925050503d80600081146117ad576040519150601f19603f3d011682016040523d82523d6000602084013e6117b2565b606091505b50509050806117ec57604051634eb3d3e160e11b81523060048201526001600160a01b03831660248201526044810186905260640161093f565b600060fd600081546117fd9061383b565b9182905550610103546040516331a9108f60e11b8152600481018c90529192506000916001600160a01b0390911690636352211e9060240160206040518083038186803b15801561184d57600080fd5b505afa158015611861573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118859190613856565b90506118918583612759565b60008281526101026020526040902080546001600160a01b0319166001600160a01b03871617905560ff881660048111156118ce576118ce61364a565b600083815261010260205260409020600201805460ff191660018360048111156118fa576118fa61364a565b0217905550600082815261010260209081526040909120600181018c90556006810180546001600160a01b0319166001600160a01b0385161790558751611949926005909201918901906130e6565b50600082815261010260209081526040918290206003018b9055815160ff8b1681529081018990529081018a90526001600160a01b0382811660608301528391908716907f40b7887b94eb4035e71b5defdaf0a7a3250417d0bc9cf130d89a9af5cc39efcf9060800160405180910390a350505050505050505050565b61010154604051633db50c8560e11b81523360048201526001600160a01b0390911690637b6a190a9060240160206040518083038186803b158015611a0a57600080fd5b505afa158015611a1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4291906137f2565b611a8b576101015460408051635adfeef560e11b8152905133926001600160a01b03169163b5bfddea916004808301926020929190829003018186803b158015610cf057600080fd5b611a958282612773565b5050565b6060606680546108479061374d565b8060ff166002811115611abd57611abd61364a565b600083815261010260205260409020600401805460ff19166001836002811115611ae957611ae961364a565b02179055505050565b611a953383836128c1565b60fe546001600160a01b03163314801590611b23575060ff546001600160a01b03163314155b15611b435760405163e250604360e01b815233600482015260240161093f565b600060fd60008154611b549061383b565b9182905550610103546040516331a9108f60e11b8152600481018890529192506000916001600160a01b0390911690636352211e9060240160206040518083038186803b158015611ba457600080fd5b505afa158015611bb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bdc9190613856565b9050611be88783612759565b60008281526101026020526040902080546001600160a01b0319166001600160a01b03891617905560ff84166004811115611c2557611c2561364a565b600083815261010260205260409020600201805460ff19166001836004811115611c5157611c5161364a565b0217905550600082815261010260209081526040909120600181018890556006810180546001600160a01b0319166001600160a01b0385161790558451611ca0926005909201918601906130e6565b5060008281526101026020908152604091829020600301879055815160ff871681529081018790526001600160a01b0383811682840152915184928a16917fb066c58d88e45c60193e8f469ea8c6deec985a9c707021dcbc439815abbfd018919081900360600190a350505050505050565b611d1c3383612410565b611d385760405162461bcd60e51b815260040161093f90613788565b611d4484848484612990565b50505050565b610102602052600090815260409020805460018201546002830154600384015460048501546005860180546001600160a01b0390961696949560ff9485169593949092169291611d999061374d565b80601f0160208091040260200160405190810160405280929190818152602001828054611dc59061374d565b8015611e125780601f10611de757610100808354040283529160200191611e12565b820191906000526020600020905b815481529060010190602001808311611df557829003601f168201915b505050600690930154919250506001600160a01b031687565b600054610100900460ff1680611e44575060005460ff16155b611e605760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015611e82576000805461ffff19166101011790555b611ec76040518060400160405280600981526020016847616d65204974656d60b81b81525060405180604001604052806002815260200161474960f01b8152506129c3565b611f126040518060400160405280601081526020016f11d85b59525d195b50dbdb9d1c9858dd60821b815250604051806040016040528060018152602001603160f81b815250612a4a565b60ff80546001600160a01b038087166001600160a01b03199283161790925561010180548684169083161790556101038054928516929091169190911790558015611d44576000805461ff001916905550505050565b6000818152606760205260409020546060906001600160a01b0316611fa35760405163b5f06ed760e01b81526004810183905260240161093f565b6000611fad612aab565b90506000815111611fcd5760405180602001604052806000815250611ff8565b80611fd784612acb565b604051602001611fe89291906138c1565b6040516020818303038152906040525b9392505050565b6000818152610102602052604081206002015460ff1660048111156108325761083261364a565b61010154604051633db50c8560e11b81523360048201526001600160a01b0390911690637b6a190a9060240160206040518083038186803b15801561206a57600080fd5b505afa15801561207e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a291906137f2565b610e7b576101015460408051635adfeef560e11b8152905133926001600160a01b03169163b5bfddea916004808301926020929190829003018186803b158015610cf057600080fd5b610101546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b15801561213957600080fd5b505afa15801561214d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061217191906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b1580156121ae57600080fd5b505afa1580156121c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e691906137f2565b806122e75750610101546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b15801561223a57600080fd5b505afa15801561224e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227291906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b1580156122af57600080fd5b505afa1580156122c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e791906137f2565b61233057610101546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610cf057600080fd5b60fe80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b031982166380ac58cd60e01b148061238357506001600160e01b03198216635b5e139f60e01b145b8061083257506301ffc9a760e01b6001600160e01b0319831614610832565b600081815260696020526040902080546001600160a01b0319166001600160a01b03841690811790915581906123d782610f41565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152606760205260408120546001600160a01b03166124895760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161093f565b600061249483610f41565b9050806001600160a01b0316846001600160a01b031614806124cf5750836001600160a01b03166124c4846108ca565b6001600160a01b0316145b806124ff57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661251a82610f41565b6001600160a01b0316146125825760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161093f565b6001600160a01b0382166125e45760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161093f565b6125ef838383612bc9565b6125fa6000826123a2565b6001600160a01b03831660009081526068602052604081208054600192906126239084906138f0565b90915550506001600160a01b0382166000908152606860205260408120805460019290612651908490613907565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006126bd82610f41565b90506126cb81600084612bc9565b6126d66000836123a2565b6001600160a01b03811660009081526068602052604081208054600192906126ff9084906138f0565b909155505060008281526067602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b611a95828260405180602001604052806000815250612bd4565b6001600160a01b0382166127c95760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161093f565b6000818152606760205260409020546001600160a01b03161561282e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161093f565b61283a60008383612bc9565b6001600160a01b0382166000908152606860205260408120805460019290612863908490613907565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b816001600160a01b0316836001600160a01b031614156129235760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161093f565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61299b848484612507565b6129a784848484612c07565b611d445760405162461bcd60e51b815260040161093f9061391f565b600054610100900460ff16806129dc575060005460ff16155b6129f85760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015612a1a576000805461ffff19166101011790555b612a22612d14565b612a2a612d14565b612a348383612d7f565b8015610a75576000805461ff0019169055505050565b600054610100900460ff1680612a63575060005460ff16155b612a7f5760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015612aa1576000805461ffff19166101011790555b612a348383612e14565b60606040518060800160405280604c8152602001613a20604c9139905090565b606081612aef5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612b195780612b038161383b565b9150612b129050600a83613987565b9150612af3565b60008167ffffffffffffffff811115612b3457612b346132d5565b6040519080825280601f01601f191660200182016040528015612b5e576020820181803683370190505b5090505b84156124ff57612b736001836138f0565b9150612b80600a8661399b565b612b8b906030613907565b60f81b818381518110612ba057612ba061380f565b60200101906001600160f81b031916908160001a905350612bc2600a86613987565b9450612b62565b610a75838383612e9e565b612bde8383612773565b612beb6000848484612c07565b610a755760405162461bcd60e51b815260040161093f9061391f565b60006001600160a01b0384163b15612d0957604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612c4b9033908990889088906004016139af565b602060405180830381600087803b158015612c6557600080fd5b505af1925050508015612c95575060408051601f3d908101601f19168201909252612c92918101906139ec565b60015b612cef573d808015612cc3576040519150601f19603f3d011682016040523d82523d6000602084013e612cc8565b606091505b508051612ce75760405162461bcd60e51b815260040161093f9061391f565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506124ff565b506001949350505050565b600054610100900460ff1680612d2d575060005460ff16155b612d495760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015612d6b576000805461ffff19166101011790555b8015610e84576000805461ff001916905550565b600054610100900460ff1680612d98575060005460ff16155b612db45760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015612dd6576000805461ffff19166101011790555b8251612de99060659060208601906130e6565b508151612dfd9060669060208501906130e6565b508015610a75576000805461ff0019169055505050565b600054610100900460ff1680612e2d575060005460ff16155b612e495760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015612e6b576000805461ffff19166101011790555b825160208085019190912083519184019190912060c99190915560ca558015610a75576000805461ff0019169055505050565b6001600160a01b038316612ef957612ef481609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b612f1c565b816001600160a01b0316836001600160a01b031614612f1c57612f1c8382612f56565b6001600160a01b038216612f3357610a7581612ff3565b826001600160a01b0316826001600160a01b031614610a7557610a7582826130a2565b60006001612f6384610ff7565b612f6d91906138f0565b600083815260986020526040902054909150808214612fc0576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b609954600090613005906001906138f0565b6000838152609a60205260408120546099805493945090928490811061302d5761302d61380f565b90600052602060002001549050806099838154811061304e5761304e61380f565b6000918252602080832090910192909255828152609a9091526040808220849055858252812055609980548061308657613086613a09565b6001900381819060005260206000200160009055905550505050565b60006130ad83610ff7565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b8280546130f29061374d565b90600052602060002090601f016020900481019282613114576000855561315a565b82601f1061312d57805160ff191683800117855561315a565b8280016001018555821561315a579182015b8281111561315a57825182559160200191906001019061313f565b5061316692915061316a565b5090565b5b80821115613166576000815560010161316b565b6001600160e01b031981168114610e8457600080fd5b6000602082840312156131a757600080fd5b8135611ff88161317f565b6000602082840312156131c457600080fd5b5035919050565b60005b838110156131e65781810151838201526020016131ce565b83811115611d445750506000910152565b6000815180845261320f8160208601602086016131cb565b601f01601f19169290920160200192915050565b602081526000611ff860208301846131f7565b6001600160a01b0381168114610e8457600080fd5b6000806040838503121561325e57600080fd5b823561326981613236565b946020939093013593505050565b60008060006060848603121561328c57600080fd5b833561329781613236565b925060208401356132a781613236565b929592945050506040919091013590565b6000602082840312156132ca57600080fd5b8135611ff881613236565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613314576133146132d5565b604052919050565b6000806040838503121561332f57600080fd5b823561333a81613236565b915060208381013567ffffffffffffffff8082111561335857600080fd5b818601915086601f83011261336c57600080fd5b81358181111561337e5761337e6132d5565b8060051b915061338f8483016132eb565b81815291830184019184810190898411156133a957600080fd5b938501935b838510156133c7578435825293850193908501906133ae565b8096505050505050509250929050565b803560ff811681146133e857600080fd5b919050565b600067ffffffffffffffff831115613407576134076132d5565b61341a601f8401601f19166020016132eb565b905082815283838301111561342e57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261345657600080fd5b611ff8838335602085016133ed565b60008060008060008060c0878903121561347e57600080fd5b8635955060208701359450613495604088016133d7565b935060608701359250608087013567ffffffffffffffff8111156134b857600080fd5b6134c489828a01613445565b92505060a08701356134d581613236565b809150509295509295509295565b600080604083850312156134f657600080fd5b82359150613506602084016133d7565b90509250929050565b8015158114610e8457600080fd5b6000806040838503121561353057600080fd5b823561353b81613236565b9150602083013561354b8161350f565b809150509250929050565b600080600080600060a0868803121561356e57600080fd5b853561357981613236565b94506020860135935060408601359250613595606087016133d7565b9150608086013567ffffffffffffffff8111156135b157600080fd5b6135bd88828901613445565b9150509295509295909350565b600080600080608085870312156135e057600080fd5b84356135eb81613236565b935060208501356135fb81613236565b925060408501359150606085013567ffffffffffffffff81111561361e57600080fd5b8501601f8101871361362f57600080fd5b61363e878235602084016133ed565b91505092959194509250565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b03888116825260208201889052600090600588106136875761368761364a565b876040840152866060840152600386106136a3576136a361364a565b85608084015260e060a08401526136bd60e08401866131f7565b915080841660c08401525098975050505050505050565b6000806000606084860312156136e957600080fd5b83356136f481613236565b9250602084013561370481613236565b9150604084013561371481613236565b809150509250925092565b6000806040838503121561373257600080fd5b823561373d81613236565b9150602083013561354b81613236565b600181811c9082168061376157607f821691505b6020821081141561378257634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000602082840312156137eb57600080fd5b5051919050565b60006020828403121561380457600080fd5b8151611ff88161350f565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561384f5761384f613825565b5060010190565b60006020828403121561386857600080fd5b8151611ff881613236565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600083516138d38184602088016131cb565b8351908301906138e78183602088016131cb565b01949350505050565b60008282101561390257613902613825565b500390565b6000821982111561391a5761391a613825565b500190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b60008261399657613996613971565b500490565b6000826139aa576139aa613971565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906139e2908301846131f7565b9695505050505050565b6000602082840312156139fe57600080fd5b8151611ff88161317f565b634e487b7160e01b600052603160045260246000fdfe68747470733a2f2f6d657461646174612e67756e7a2e6465762f6170692f76312f3078343634366266616346653634434232373430334666353841653743626639333938393731463161302fa2646970667358221220a67d0fce17535b82cca5bb2bd64101524d8cb1ba2053d3a9937ce42791cfc22f64736f6c63430008090033
Deployed ByteCode
0x6080604052600436106102325760003560e01c80636744be5d1161012d578063b88d4fde116100b0578063d615797211610077578063d615797214610709578063dcc67de914610729578063e34128e414610749578063e985e9c51461076a578063f52d779f146107b3578063f7d00423146107ed57005b8063b88d4fde14610655578063bfb231d214610675578063c0c53b8b146106a8578063c6a319fa146106c8578063c87b56dd146106e957005b806395d89b41116100f457806395d89b41146105ca57806396786ed4146105df5780639b1075c0146105ff578063a22cb46514610615578063a869f9931461063557005b80636744be5d1461053657806370a082311461055757806371ab618c146105775780637fa56211146105975780638c2a993e146105aa57005b806342842e0e116101b55780635686f69e1161017c5780635686f69e1461046e5780636236921e1461048e57806362848c0f146104bf5780636352211e146104f657806365d5a9d01461051657005b806342842e0e146103be57806342966c68146103de57806345bdac10146103fe5780634f6ccce71461043057806354fd4d501461045057005b806318160ddd116101f957806318160ddd1461032957806323b872dd1461033e5780632e1a09b31461035e5780632f745c591461037e5780633407fc511461039e57005b806301ffc9a71461023b578063036e7da11461027057806306fdde03146102af578063081812fc146102d1578063095ea7b31461030957005b3661023957005b005b34801561024757600080fd5b5061025b610256366004613195565b61080d565b60405190151581526020015b60405180910390f35b34801561027c57600080fd5b506102a161028b3660046131b2565b6000908152610102602052604090206003015490565b604051908152602001610267565b3480156102bb57600080fd5b506102c4610838565b6040516102679190613223565b3480156102dd57600080fd5b506102f16102ec3660046131b2565b6108ca565b6040516001600160a01b039091168152602001610267565b34801561031557600080fd5b5061023961032436600461324b565b610964565b34801561033557600080fd5b506099546102a1565b34801561034a57600080fd5b50610239610359366004613277565b610a7a565b34801561036a57600080fd5b506102396103793660046132b8565b610aab565b34801561038a57600080fd5b506102a161039936600461324b565b610d75565b3480156103aa57600080fd5b5060fe546102f1906001600160a01b031681565b3480156103ca57600080fd5b506102396103d9366004613277565b610e0b565b3480156103ea57600080fd5b506102396103f93660046131b2565b610e26565b34801561040a57600080fd5b5061041e6104193660046131b2565b610e87565b60405160ff9091168152602001610267565b34801561043c57600080fd5b506102a161044b3660046131b2565b610eae565b34801561045c57600080fd5b50604051620f42438152602001610267565b34801561047a57600080fd5b5060ff546102f1906001600160a01b031681565b34801561049a57600080fd5b506102a16104a93660046131b2565b6000908152610102602052604090206001015490565b3480156104cb57600080fd5b506102f16104da3660046131b2565b600090815261010260205260409020546001600160a01b031690565b34801561050257600080fd5b506102f16105113660046131b2565b610f41565b34801561052257600080fd5b5061023961053136600461331c565b610fb8565b34801561054257600080fd5b50610103546102f1906001600160a01b031681565b34801561056357600080fd5b506102a16105723660046132b8565b610ff7565b34801561058357600080fd5b506102396105923660046131b2565b61107e565b6102396105a5366004613465565b6113cd565b3480156105b657600080fd5b506102396105c536600461324b565b6119c6565b3480156105d657600080fd5b506102c4611a99565b3480156105eb57600080fd5b506102396105fa3660046134e3565b611aa8565b34801561060b57600080fd5b506102a160fd5481565b34801561062157600080fd5b5061023961063036600461351d565b611af2565b34801561064157600080fd5b50610239610650366004613556565b611afd565b34801561066157600080fd5b506102396106703660046135ca565b611d12565b34801561068157600080fd5b506106956106903660046131b2565b611d4a565b6040516102679796959493929190613660565b3480156106b457600080fd5b506102396106c33660046136d4565b611e2b565b3480156106d457600080fd5b50610101546102f1906001600160a01b031681565b3480156106f557600080fd5b506102c46107043660046131b2565b611f68565b34801561071557600080fd5b5061041e6107243660046131b2565b611fff565b34801561073557600080fd5b506102396107443660046131b2565b612026565b34801561075557600080fd5b50610100546102f1906001600160a01b031681565b34801561077657600080fd5b5061025b61078536600461371f565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b3480156107bf57600080fd5b506102f16107ce3660046131b2565b600090815261010260205260409020600601546001600160a01b031690565b3480156107f957600080fd5b506102396108083660046132b8565b6120eb565b60006001600160e01b0319821663780e9d6360e01b1480610832575061083282612352565b92915050565b6060606580546108479061374d565b80601f01602080910402602001604051908101604052809291908181526020018280546108739061374d565b80156108c05780601f10610895576101008083540402835291602001916108c0565b820191906000526020600020905b8154815290600101906020018083116108a357829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b03166109485760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b600061096f82610f41565b9050806001600160a01b0316836001600160a01b031614156109dd5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161093f565b336001600160a01b03821614806109f957506109f98133610785565b610a6b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161093f565b610a7583836123a2565b505050565b610a843382612410565b610aa05760405162461bcd60e51b815260040161093f90613788565b610a75838383612507565b610101546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b158015610af957600080fd5b505afa158015610b0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3191906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015610b6e57600080fd5b505afa158015610b82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba691906137f2565b80610ca75750610101546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b158015610bfa57600080fd5b505afa158015610c0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3291906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015610c6f57600080fd5b505afa158015610c83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca791906137f2565b610d5257610101546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610cf057600080fd5b505afa158015610d04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2891906137d9565b6040516316b4d34b60e31b81526001600160a01b039092166004830152602482015260440161093f565b61010380546001600160a01b0319166001600160a01b0392909216919091179055565b6000610d8083610ff7565b8210610de25760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161093f565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b610a7583838360405180602001604052806000815250611d12565b33610e3082610f41565b6001600160a01b031614610e7b5733610e4882610f41565b60405163f604c2ef60e01b81526001600160a01b039283166004820152911660248201526044810182905260640161093f565b610e84816126b2565b50565b6000818152610102602052604081206004015460ff1660028111156108325761083261364a565b6000610eb960995490565b8210610f1c5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161093f565b60998281548110610f2f57610f2f61380f565b90600052602060002001549050919050565b6000818152606760205260408120546001600160a01b0316806108325760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161093f565b60005b8151811015610a7557610fe783838381518110610fda57610fda61380f565b6020026020010151610964565b610ff08161383b565b9050610fbb565b60006001600160a01b0382166110625760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161093f565b506001600160a01b031660009081526068602052604090205490565b610101546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b1580156110cc57600080fd5b505afa1580156110e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110491906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561114157600080fd5b505afa158015611155573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117991906137f2565b8061127a5750610101546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b1580156111cd57600080fd5b505afa1580156111e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120591906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561124257600080fd5b505afa158015611256573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127a91906137f2565b6112c357610101546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610cf057600080fd5b610103546000906001600160a01b0316636352211e6112f2846000908152610102602052604090206001015490565b6040518263ffffffff1660e01b815260040161131091815260200190565b60206040518083038186803b15801561132857600080fd5b505afa15801561133c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113609190613856565b6000838152610102602090815260409182902060060180546001600160a01b0319166001600160a01b0385169081179091558251868152918201529192507f8a3a14dacbb53f545e020304630c1255fcd812d52819ad6e2f6ca608c20e6aa7910160405180910390a15050565b61010160009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561141c57600080fd5b505afa158015611430573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145491906137f2565b156114725760405163b5c05c3160e01b815260040160405180910390fd5b610101546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b1580156114c057600080fd5b505afa1580156114d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f891906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561153557600080fd5b505afa158015611549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156d91906137f2565b8061166e5750610101546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b1580156115c157600080fd5b505afa1580156115d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f991906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561163657600080fd5b505afa15801561164a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166e91906137f2565b6116b757610101546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610cf057600080fd5b8234146116e057604051635928816d60e11b81523460048201526024810184905260440161093f565b610101546040805163220ce7e760e21b815290516000926001600160a01b0316916388339f9c916004808301926020929190829003018186803b15801561172657600080fd5b505afa15801561173a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175e9190613856565b90506000816001600160a01b03168560405160006040518083038185875af1925050503d80600081146117ad576040519150601f19603f3d011682016040523d82523d6000602084013e6117b2565b606091505b50509050806117ec57604051634eb3d3e160e11b81523060048201526001600160a01b03831660248201526044810186905260640161093f565b600060fd600081546117fd9061383b565b9182905550610103546040516331a9108f60e11b8152600481018c90529192506000916001600160a01b0390911690636352211e9060240160206040518083038186803b15801561184d57600080fd5b505afa158015611861573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118859190613856565b90506118918583612759565b60008281526101026020526040902080546001600160a01b0319166001600160a01b03871617905560ff881660048111156118ce576118ce61364a565b600083815261010260205260409020600201805460ff191660018360048111156118fa576118fa61364a565b0217905550600082815261010260209081526040909120600181018c90556006810180546001600160a01b0319166001600160a01b0385161790558751611949926005909201918901906130e6565b50600082815261010260209081526040918290206003018b9055815160ff8b1681529081018990529081018a90526001600160a01b0382811660608301528391908716907f40b7887b94eb4035e71b5defdaf0a7a3250417d0bc9cf130d89a9af5cc39efcf9060800160405180910390a350505050505050505050565b61010154604051633db50c8560e11b81523360048201526001600160a01b0390911690637b6a190a9060240160206040518083038186803b158015611a0a57600080fd5b505afa158015611a1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4291906137f2565b611a8b576101015460408051635adfeef560e11b8152905133926001600160a01b03169163b5bfddea916004808301926020929190829003018186803b158015610cf057600080fd5b611a958282612773565b5050565b6060606680546108479061374d565b8060ff166002811115611abd57611abd61364a565b600083815261010260205260409020600401805460ff19166001836002811115611ae957611ae961364a565b02179055505050565b611a953383836128c1565b60fe546001600160a01b03163314801590611b23575060ff546001600160a01b03163314155b15611b435760405163e250604360e01b815233600482015260240161093f565b600060fd60008154611b549061383b565b9182905550610103546040516331a9108f60e11b8152600481018890529192506000916001600160a01b0390911690636352211e9060240160206040518083038186803b158015611ba457600080fd5b505afa158015611bb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bdc9190613856565b9050611be88783612759565b60008281526101026020526040902080546001600160a01b0319166001600160a01b03891617905560ff84166004811115611c2557611c2561364a565b600083815261010260205260409020600201805460ff19166001836004811115611c5157611c5161364a565b0217905550600082815261010260209081526040909120600181018890556006810180546001600160a01b0319166001600160a01b0385161790558451611ca0926005909201918601906130e6565b5060008281526101026020908152604091829020600301879055815160ff871681529081018790526001600160a01b0383811682840152915184928a16917fb066c58d88e45c60193e8f469ea8c6deec985a9c707021dcbc439815abbfd018919081900360600190a350505050505050565b611d1c3383612410565b611d385760405162461bcd60e51b815260040161093f90613788565b611d4484848484612990565b50505050565b610102602052600090815260409020805460018201546002830154600384015460048501546005860180546001600160a01b0390961696949560ff9485169593949092169291611d999061374d565b80601f0160208091040260200160405190810160405280929190818152602001828054611dc59061374d565b8015611e125780601f10611de757610100808354040283529160200191611e12565b820191906000526020600020905b815481529060010190602001808311611df557829003601f168201915b505050600690930154919250506001600160a01b031687565b600054610100900460ff1680611e44575060005460ff16155b611e605760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015611e82576000805461ffff19166101011790555b611ec76040518060400160405280600981526020016847616d65204974656d60b81b81525060405180604001604052806002815260200161474960f01b8152506129c3565b611f126040518060400160405280601081526020016f11d85b59525d195b50dbdb9d1c9858dd60821b815250604051806040016040528060018152602001603160f81b815250612a4a565b60ff80546001600160a01b038087166001600160a01b03199283161790925561010180548684169083161790556101038054928516929091169190911790558015611d44576000805461ff001916905550505050565b6000818152606760205260409020546060906001600160a01b0316611fa35760405163b5f06ed760e01b81526004810183905260240161093f565b6000611fad612aab565b90506000815111611fcd5760405180602001604052806000815250611ff8565b80611fd784612acb565b604051602001611fe89291906138c1565b6040516020818303038152906040525b9392505050565b6000818152610102602052604081206002015460ff1660048111156108325761083261364a565b61010154604051633db50c8560e11b81523360048201526001600160a01b0390911690637b6a190a9060240160206040518083038186803b15801561206a57600080fd5b505afa15801561207e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a291906137f2565b610e7b576101015460408051635adfeef560e11b8152905133926001600160a01b03169163b5bfddea916004808301926020929190829003018186803b158015610cf057600080fd5b610101546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b15801561213957600080fd5b505afa15801561214d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061217191906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b1580156121ae57600080fd5b505afa1580156121c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e691906137f2565b806122e75750610101546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b15801561223a57600080fd5b505afa15801561224e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227291906137d9565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b1580156122af57600080fd5b505afa1580156122c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e791906137f2565b61233057610101546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610cf057600080fd5b60fe80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b031982166380ac58cd60e01b148061238357506001600160e01b03198216635b5e139f60e01b145b8061083257506301ffc9a760e01b6001600160e01b0319831614610832565b600081815260696020526040902080546001600160a01b0319166001600160a01b03841690811790915581906123d782610f41565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152606760205260408120546001600160a01b03166124895760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161093f565b600061249483610f41565b9050806001600160a01b0316846001600160a01b031614806124cf5750836001600160a01b03166124c4846108ca565b6001600160a01b0316145b806124ff57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661251a82610f41565b6001600160a01b0316146125825760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161093f565b6001600160a01b0382166125e45760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161093f565b6125ef838383612bc9565b6125fa6000826123a2565b6001600160a01b03831660009081526068602052604081208054600192906126239084906138f0565b90915550506001600160a01b0382166000908152606860205260408120805460019290612651908490613907565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006126bd82610f41565b90506126cb81600084612bc9565b6126d66000836123a2565b6001600160a01b03811660009081526068602052604081208054600192906126ff9084906138f0565b909155505060008281526067602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b611a95828260405180602001604052806000815250612bd4565b6001600160a01b0382166127c95760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161093f565b6000818152606760205260409020546001600160a01b03161561282e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161093f565b61283a60008383612bc9565b6001600160a01b0382166000908152606860205260408120805460019290612863908490613907565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b816001600160a01b0316836001600160a01b031614156129235760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161093f565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61299b848484612507565b6129a784848484612c07565b611d445760405162461bcd60e51b815260040161093f9061391f565b600054610100900460ff16806129dc575060005460ff16155b6129f85760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015612a1a576000805461ffff19166101011790555b612a22612d14565b612a2a612d14565b612a348383612d7f565b8015610a75576000805461ff0019169055505050565b600054610100900460ff1680612a63575060005460ff16155b612a7f5760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015612aa1576000805461ffff19166101011790555b612a348383612e14565b60606040518060800160405280604c8152602001613a20604c9139905090565b606081612aef5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612b195780612b038161383b565b9150612b129050600a83613987565b9150612af3565b60008167ffffffffffffffff811115612b3457612b346132d5565b6040519080825280601f01601f191660200182016040528015612b5e576020820181803683370190505b5090505b84156124ff57612b736001836138f0565b9150612b80600a8661399b565b612b8b906030613907565b60f81b818381518110612ba057612ba061380f565b60200101906001600160f81b031916908160001a905350612bc2600a86613987565b9450612b62565b610a75838383612e9e565b612bde8383612773565b612beb6000848484612c07565b610a755760405162461bcd60e51b815260040161093f9061391f565b60006001600160a01b0384163b15612d0957604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612c4b9033908990889088906004016139af565b602060405180830381600087803b158015612c6557600080fd5b505af1925050508015612c95575060408051601f3d908101601f19168201909252612c92918101906139ec565b60015b612cef573d808015612cc3576040519150601f19603f3d011682016040523d82523d6000602084013e612cc8565b606091505b508051612ce75760405162461bcd60e51b815260040161093f9061391f565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506124ff565b506001949350505050565b600054610100900460ff1680612d2d575060005460ff16155b612d495760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015612d6b576000805461ffff19166101011790555b8015610e84576000805461ff001916905550565b600054610100900460ff1680612d98575060005460ff16155b612db45760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015612dd6576000805461ffff19166101011790555b8251612de99060659060208601906130e6565b508151612dfd9060669060208501906130e6565b508015610a75576000805461ff0019169055505050565b600054610100900460ff1680612e2d575060005460ff16155b612e495760405162461bcd60e51b815260040161093f90613873565b600054610100900460ff16158015612e6b576000805461ffff19166101011790555b825160208085019190912083519184019190912060c99190915560ca558015610a75576000805461ff0019169055505050565b6001600160a01b038316612ef957612ef481609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b612f1c565b816001600160a01b0316836001600160a01b031614612f1c57612f1c8382612f56565b6001600160a01b038216612f3357610a7581612ff3565b826001600160a01b0316826001600160a01b031614610a7557610a7582826130a2565b60006001612f6384610ff7565b612f6d91906138f0565b600083815260986020526040902054909150808214612fc0576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b609954600090613005906001906138f0565b6000838152609a60205260408120546099805493945090928490811061302d5761302d61380f565b90600052602060002001549050806099838154811061304e5761304e61380f565b6000918252602080832090910192909255828152609a9091526040808220849055858252812055609980548061308657613086613a09565b6001900381819060005260206000200160009055905550505050565b60006130ad83610ff7565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b8280546130f29061374d565b90600052602060002090601f016020900481019282613114576000855561315a565b82601f1061312d57805160ff191683800117855561315a565b8280016001018555821561315a579182015b8281111561315a57825182559160200191906001019061313f565b5061316692915061316a565b5090565b5b80821115613166576000815560010161316b565b6001600160e01b031981168114610e8457600080fd5b6000602082840312156131a757600080fd5b8135611ff88161317f565b6000602082840312156131c457600080fd5b5035919050565b60005b838110156131e65781810151838201526020016131ce565b83811115611d445750506000910152565b6000815180845261320f8160208601602086016131cb565b601f01601f19169290920160200192915050565b602081526000611ff860208301846131f7565b6001600160a01b0381168114610e8457600080fd5b6000806040838503121561325e57600080fd5b823561326981613236565b946020939093013593505050565b60008060006060848603121561328c57600080fd5b833561329781613236565b925060208401356132a781613236565b929592945050506040919091013590565b6000602082840312156132ca57600080fd5b8135611ff881613236565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613314576133146132d5565b604052919050565b6000806040838503121561332f57600080fd5b823561333a81613236565b915060208381013567ffffffffffffffff8082111561335857600080fd5b818601915086601f83011261336c57600080fd5b81358181111561337e5761337e6132d5565b8060051b915061338f8483016132eb565b81815291830184019184810190898411156133a957600080fd5b938501935b838510156133c7578435825293850193908501906133ae565b8096505050505050509250929050565b803560ff811681146133e857600080fd5b919050565b600067ffffffffffffffff831115613407576134076132d5565b61341a601f8401601f19166020016132eb565b905082815283838301111561342e57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261345657600080fd5b611ff8838335602085016133ed565b60008060008060008060c0878903121561347e57600080fd5b8635955060208701359450613495604088016133d7565b935060608701359250608087013567ffffffffffffffff8111156134b857600080fd5b6134c489828a01613445565b92505060a08701356134d581613236565b809150509295509295509295565b600080604083850312156134f657600080fd5b82359150613506602084016133d7565b90509250929050565b8015158114610e8457600080fd5b6000806040838503121561353057600080fd5b823561353b81613236565b9150602083013561354b8161350f565b809150509250929050565b600080600080600060a0868803121561356e57600080fd5b853561357981613236565b94506020860135935060408601359250613595606087016133d7565b9150608086013567ffffffffffffffff8111156135b157600080fd5b6135bd88828901613445565b9150509295509295909350565b600080600080608085870312156135e057600080fd5b84356135eb81613236565b935060208501356135fb81613236565b925060408501359150606085013567ffffffffffffffff81111561361e57600080fd5b8501601f8101871361362f57600080fd5b61363e878235602084016133ed565b91505092959194509250565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b03888116825260208201889052600090600588106136875761368761364a565b876040840152866060840152600386106136a3576136a361364a565b85608084015260e060a08401526136bd60e08401866131f7565b915080841660c08401525098975050505050505050565b6000806000606084860312156136e957600080fd5b83356136f481613236565b9250602084013561370481613236565b9150604084013561371481613236565b809150509250925092565b6000806040838503121561373257600080fd5b823561373d81613236565b9150602083013561354b81613236565b600181811c9082168061376157607f821691505b6020821081141561378257634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000602082840312156137eb57600080fd5b5051919050565b60006020828403121561380457600080fd5b8151611ff88161350f565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561384f5761384f613825565b5060010190565b60006020828403121561386857600080fd5b8151611ff881613236565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600083516138d38184602088016131cb565b8351908301906138e78183602088016131cb565b01949350505050565b60008282101561390257613902613825565b500390565b6000821982111561391a5761391a613825565b500190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b60008261399657613996613971565b500490565b6000826139aa576139aa613971565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906139e2908301846131f7565b9695505050505050565b6000602082840312156139fe57600080fd5b8151611ff88161317f565b634e487b7160e01b600052603160045260246000fdfe68747470733a2f2f6d657461646174612e67756e7a2e6465762f6170692f76312f3078343634366266616346653634434232373430334666353841653743626639333938393731463161302fa2646970667358221220a67d0fce17535b82cca5bb2bd64101524d8cb1ba2053d3a9937ce42791cfc22f64736f6c63430008090033