Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- DataCubeContract
- Optimization enabled
- true
- Compiler version
- v0.8.9+commit.e5eed63a
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-03-22T08:14:48.633998Z
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/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/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/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/interfaces/IBattlePass.sol pragma solidity ^0.8.0; /// @notice Interface for BattlePassContract interface IBattlePass{ /// @notice this event is emitted when user activates BattlePass /// @param account owner of BatlePass /// @param tokenID token id of specific BattlePass event BattlePassActivated(address indexed account, uint256 indexed tokenID); /// @notice this event is emitted when user deactivates BattlePass /// @param account owner of BatlePass /// @param tokenID token id of specific BattlePass event BattlePassDeactivated(address indexed account, uint256 indexed tokenID); /// @notice this event is emitted when admin mints BattlePass /// @param to receiver of new BatlePass /// @param tokenID token id of BattlePass /// @param rarity rarity(0-4) of BattlePass event BattlePassMinted(address indexed to, uint256 indexed tokenID, uint8 rarity); /// @notice this event is emitted when admin creates season /// @param seasonID id of created season /// @param startDate unix time of season beginning /// @param duration duration of season in seconds event SeasonCreated(uint256 indexed seasonID, uint256 startDate, uint256 duration); /// @notice this event is emitted when admin starts current season /// @param seasonID id of current season event SeasonStarted(uint256 indexed seasonID); function version() external view returns (uint32); /// @notice gets current season id /// @return id of current season function getCurrentSeason() external view returns(uint256); /// @notice gets mode(activated or deactivated) of specific BattlePass /// @param _tokenID token id of specific BattlePass /// @return bool mode of specific BattlePass function getMode(uint256 _tokenID) external view returns(bool); /// @notice gets rarity of specific BattlePass /// @param _tokenID token id of specific BattlePass /// @return uint8 rarity parameter of specific BattlePass function getRarity(uint256 _tokenID) external view returns(uint8); /// @notice gets start date(in seconds) of specific season /// @param _seasonID token id of specific season /// @return uint64 parameter, startDate of specific season function getSeasonStartDate(uint256 _seasonID) external view returns(uint64); /// @notice gets end date(in seconds) of specific season /// @param _seasonID token id of specific season /// @return uint64 parameter, endDate of specific season function getSeasonEndDate(uint256 _seasonID) external view returns(uint64); /// @notice gets duration(in seconds) of specific season /// @param _seasonID token id of specific season /// @return uint64 parameter, duration of specific season function getSeasonDuration(uint256 _seasonID) external view returns(uint64); } // File contracts/interfaces/IDataCube.sol pragma solidity ^0.8.0; /// @notice Interface for DataCubeContract interface IDataCube { /// @notice this event is emitted when admin mints NFT DataCube /// @param to receiver of new DataCube /// @param tokenID id of new DataCube /// @param quality quality of new DataCube /// @param season BattlePass season of new DataCube event DataCubeMinted( address indexed to, uint256 indexed tokenID, uint8 quality, uint256 season); /// @notice this event is emitted when DataCube is burnt /// @param DCTokenID id of NFT DataCube /// @param DCBackendTokenID if of backend nonNFT DataCube event DataCubeBurnt( uint256 indexed DCTokenID, uint256 DCBackendTokenID); /// Deprecated, will be deleted sooner event DataCubeMintable( bool indexed ); function version() external view returns (uint32); /// @notice during decoding, ValidatorLicenseContract calls this function to open DataCube and mint GameItem /// @dev data cube will be burned. Emits "Burnt" event. Calls "mintFromCube" function from GameItemContract via IGameItem interface /// @param _DCTokenID token id of specific DataCube /// @param _VLTokenID token id of specific Validator License /// @param _seasonID token id of season /// @param _DCQuality DataCube quality /// @param _receiver receiver's address of new item /// @param _DCBackendTokenID backend token id of specific DataCube /// @param _data metadata URL function open( uint256 _DCTokenID, uint256 _VLTokenID, uint256 _seasonID, uint8 _DCQuality, address _receiver, uint256 _DCBackendTokenID, string memory _data) external; /// @notice gets season of specific DataCube /// @return uint256 id of specific DataCube function getCubeSeason(uint256 _tokenID) external view returns(uint256); /// @notice gets lever of minting for DataCubes /// @return bool parameter, lever is on or not function getLeverMintable() external view returns(bool); /// @notice gets quality of specific DataCube /// @return uint8 quality parameter of specific DataCube function getCubeQuality(uint256 _tokenID) external view returns(uint8); /// @notice gets initial owner of specific DataCube /// @return address of initial owner of specific DataCube function getCubeInitialOwner(uint256 _tokenID) external view returns(address); function getFeeDepensOnQuality(uint8 _quality) external view returns(uint256); /// @notice changes state of minting lever for dataCubes function changeLeverMintable() external; function burn(uint256 _tokenID) external; } // 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 /// @param _deadline date of expiring signature(in unix time) /// @param _signature signature of signed data by backender function mintForUser( uint256 _VLTokenID, uint256 _seasonID, uint8 _quality, uint256 _price, string memory _metadataURL, uint256 _deadline, bytes memory _signature) payable external; function burn(uint256 _tokenID) external; function bridgeBurn(uint256 _tokenID) external; function bridgeMint(address to, uint256 _tokenID) external; } // File contracts/DataCubeContract.sol pragma solidity ^0.8.0; /// @title Contract for data cube management /// @notice User can use this contract for reading info about DataCube /// @dev This contract inherits 'ERC721EnumerableUpgradeable', contracts form openzeppelin library and IDataCube interface /// @notice Abbreviation: DC - DataCube contract DataCubeContract is ERC721BatchUpgradeable, IDataCube{ // last minted token id of DataCube uint256 public lastMintedTokenID; // address of decoder contract address address public decoderAddress; // address of BattlePassContract address public battlePassContractAddress; // address of GameItemContract address public gameItemContractAddress; // address of PlatformSettings contract address public platformSettingsContractAddress; // lever to Mint DataCube or not; deprecated, will be deleted sooner bool private dataCubeMintable; // storage for DataCube tokens mapping(uint256 => DataCube) public dataCubes; // Fee for decoding hex from License Storage mapping(Quality => uint256) public feeForDecodingHex; /// enumeration for ValidatorLicense quality enum Quality{ Standard, Professional, Elite, Overclocked, Hacked } /// structure of DataCube token /// quality - quality of cube(Hex), season - season of cube struct DataCube{ Quality quality; uint256 season; address initialOwner; } error ContractsIsPaused(); error ContractsIsNotPaused(); error InvalidRole(address caller, bytes32 role); error CallerNotDecoder(address caller); error IncorrectQuality(uint8 quality); /// @notice A disposable function for initializing contract /// @param _battlePassContractAddress address of BattlePassContract /// @param _platformSettingsContractAddress address of PlatformSettings contract /// @dev calls initializer from ERC721Upgradeable contract function initialize( address _battlePassContractAddress, address _platformSettingsContractAddress, uint256 _feeForStandartHex, uint256 _feeForProfessionalHex, uint256 _feeForEliteHex, uint256 _feeForOverclockedHex, uint256 _feeForHackedHex ) public initializer{ __ERC721_init("DataCube", "DC"); battlePassContractAddress = _battlePassContractAddress; platformSettingsContractAddress = _platformSettingsContractAddress; dataCubeMintable = true; feeForDecodingHex[Quality.Standard] = _feeForStandartHex; feeForDecodingHex[Quality.Professional] = _feeForProfessionalHex; feeForDecodingHex[Quality.Elite] = _feeForEliteHex; feeForDecodingHex[Quality.Overclocked] = _feeForOverclockedHex; feeForDecodingHex[Quality.Hacked] = _feeForHackedHex; } // *********************** MODIFIERS ********************************************* /// @notice verifies if switch "_paused" in PlatformSettings contract is on modifier whenPaused{ if(!PlatformSettings(platformSettingsContractAddress).paused()){ revert ContractsIsNotPaused(); } _; } /// @notice verifies if switch "_paused" in PlatformSettings contract is off modifier whenNotPaused{ if(PlatformSettings(platformSettingsContractAddress).paused()){ revert ContractsIsPaused(); } _; } /// @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 onlyDecoder{ if(decoderAddress != msg.sender){ revert CallerNotDecoder(msg.sender); } _; } modifier onlyAdminOrDecoder{ if(decoderAddress != msg.sender && !(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()); } _; } // *********************** 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(1000002); } /// @notice gets quality of specific DataCube /// @dev inherited from IDataCube interface /// @return uint8 quality parameter of specific DataCube function getCubeQuality(uint256 _tokenID) public view override returns(uint8){ return uint8(dataCubes[_tokenID].quality); } /// @notice gets season of specific DataCube /// @dev inherited from IDataCube interface /// @return uint256 id of specific season function getCubeSeason(uint256 _tokenID) public view override returns(uint256){ return dataCubes[_tokenID].season; } /// @notice gets season of specific DataCube /// @dev inherited from IDataCube interface /// @return address of DC's first owner function getCubeInitialOwner(uint256 _tokenID) public view override returns(address){ return dataCubes[_tokenID].initialOwner; } /// TODO Deprecated, will be deleted sooner. Or check docs /// @notice gets lever of minting for DataCubes /// @dev inherited from IDataCube interface /// @return bool parameter, lever is on or not function getLeverMintable() public view override returns(bool){ return dataCubeMintable; } function getFeeDepensOnQuality(uint8 _quality) public view override returns(uint256){ return feeForDecodingHex[Quality(_quality)]; } // *********************** ADMIN FUNCTIONS ********************************************* /// @notice Admin sets new address for GameItemContract function setGameItemContractAddress(address _contractAddress) public onlyAdmin{ gameItemContractAddress = _contractAddress; } /// @notice Admin sets new address for Decoder contract function setDecoderAddress(address _contractAddress) public onlyAdmin{ decoderAddress = _contractAddress; } /// TODO may be deprecated, read docs /// @notice changes state of minting lever for dataCubes function changeLeverMintable() public override onlyAdmin{ dataCubeMintable = !dataCubeMintable; emit DataCubeMintable(dataCubeMintable); } /// @notice Admin sets initial owner to DataCube /// @dev Admin during bulk transfer sets initial owner to DataCube /// @param _tokenID token id of specific DataCube /// @param _initialOwner first user, who obtained DataCube function setCubeInitialOwner(uint256 _tokenID, address _initialOwner) public onlyAdmin{ dataCubes[_tokenID].initialOwner = _initialOwner; } function setFeeForDecodingHex(uint8 _quality, uint256 amount) public onlyAdmin{ feeForDecodingHex[Quality(_quality)] = amount; } /// @notice admin mints DataCube /// @dev Emits "DataCubeMinted" event. Requirements: the season must be going on at the moment; rarity of DC must be acceptable(0-4); caller must be admin /// @dev if receiver(_to) is an admin, DC's parameter initialOwner will be skipped /// @dev calls _safeMint function from ERC721Upgradeable contract /// @param _to receiver address of DataCube /// @param _quality quality of new DataCube function mint(address _to, uint8 _quality) public onlyAdmin{ if(!(_quality>=0 && _quality<=4)){ revert IncorrectQuality(_quality); } uint256 _tokenID = ++lastMintedTokenID; _safeMint(_to, _tokenID); dataCubes[_tokenID].quality = Quality(_quality); if ((!PlatformSettings(platformSettingsContractAddress).hasRole(PlatformSettings(platformSettingsContractAddress).DEFAULT_ADMIN_ROLE(),_to))||(!PlatformSettings(platformSettingsContractAddress).hasRole(PlatformSettings(platformSettingsContractAddress).SECONDARY_ADMIN_ROLE(),_to))){ dataCubes[_tokenID].initialOwner = _to;} emit DataCubeMinted(_to, _tokenID, _quality, 0); } // *********************** FUNCTIONS ********************************************* /// @notice during decoding, Decoder calls this function to open DataCube and mint GameItem /// @dev data cube will be burned. Emits "DataCubeBurnt" event. Calls "mintFromCube" function from GameItemContract via IGameItem interface /// @dev modifier 'whenNotPaused' deprecated, will be deleted sooner /// @param _DCTokenID token id of specific DataCube /// @param _VLTokenID token id of specific ValidatorLicense /// @param _seasonID token id of season /// @param _DCQuality DataCube quality /// @param _receiver receiver's address of new item /// @param _DCBackendTokenID backend token id of specific DataCube /// @param _data metadata URL function open( uint256 _DCTokenID, uint256 _VLTokenID, uint256 _seasonID, uint8 _DCQuality, address _receiver, uint256 _DCBackendTokenID, string memory _data) public override whenNotPaused onlyDecoder { IGameItem(gameItemContractAddress).mintFromCube( _receiver, _VLTokenID, _seasonID, _DCQuality, _data); super._burn(_DCTokenID); emit DataCubeBurnt(_DCTokenID, _DCBackendTokenID); } /// @dev inherits IDataCube interface /// TODO tech debt for current version - calls function from ERC721Upgradeable contract function burn(uint256 _tokenID) public override{ super._burn(_tokenID); } /// @dev verifies if caller is an admin /// @dev inherited from contract ERC721Upgradeable /// TODO tech debt for current version - inherits same function from ERC721EnumerableUpgradeable contract function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override virtual onlyAdminOrDecoder{ super._beforeTokenTransfer(from,to,tokenId); } }
Contract ABI
[{"type":"error","name":"CallerNotDecoder","inputs":[{"type":"address","name":"caller","internalType":"address"}]},{"type":"error","name":"ContractsIsNotPaused","inputs":[]},{"type":"error","name":"ContractsIsPaused","inputs":[]},{"type":"error","name":"IncorrectQuality","inputs":[{"type":"uint8","name":"quality","internalType":"uint8"}]},{"type":"error","name":"InvalidRole","inputs":[{"type":"address","name":"caller","internalType":"address"},{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"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":"DataCubeBurnt","inputs":[{"type":"uint256","name":"DCTokenID","internalType":"uint256","indexed":true},{"type":"uint256","name":"DCBackendTokenID","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DataCubeMintable","inputs":[{"type":"bool","name":"","internalType":"bool","indexed":true}],"anonymous":false},{"type":"event","name":"DataCubeMinted","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":"season","internalType":"uint256","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":"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":"burn","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changeLeverMintable","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"quality","internalType":"enum DataCubeContract.Quality"},{"type":"uint256","name":"season","internalType":"uint256"},{"type":"address","name":"initialOwner","internalType":"address"}],"name":"dataCubes","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"decoderAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"feeForDecodingHex","inputs":[{"type":"uint8","name":"","internalType":"enum DataCubeContract.Quality"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"gameItemContractAddress","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":"getCubeInitialOwner","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"getCubeQuality","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCubeSeason","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getFeeDepensOnQuality","inputs":[{"type":"uint8","name":"_quality","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"getLeverMintable","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_battlePassContractAddress","internalType":"address"},{"type":"address","name":"_platformSettingsContractAddress","internalType":"address"},{"type":"uint256","name":"_feeForStandartHex","internalType":"uint256"},{"type":"uint256","name":"_feeForProfessionalHex","internalType":"uint256"},{"type":"uint256","name":"_feeForEliteHex","internalType":"uint256"},{"type":"uint256","name":"_feeForOverclockedHex","internalType":"uint256"},{"type":"uint256","name":"_feeForHackedHex","internalType":"uint256"}]},{"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":"uint256","name":"","internalType":"uint256"}],"name":"lastMintedTokenID","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mint","inputs":[{"type":"address","name":"_to","internalType":"address"},{"type":"uint8","name":"_quality","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"open","inputs":[{"type":"uint256","name":"_DCTokenID","internalType":"uint256"},{"type":"uint256","name":"_VLTokenID","internalType":"uint256"},{"type":"uint256","name":"_seasonID","internalType":"uint256"},{"type":"uint8","name":"_DCQuality","internalType":"uint8"},{"type":"address","name":"_receiver","internalType":"address"},{"type":"uint256","name":"_DCBackendTokenID","internalType":"uint256"},{"type":"string","name":"_data","internalType":"string"}]},{"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":"setCubeInitialOwner","inputs":[{"type":"uint256","name":"_tokenID","internalType":"uint256"},{"type":"address","name":"_initialOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDecoderAddress","inputs":[{"type":"address","name":"_contractAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeForDecodingHex","inputs":[{"type":"uint8","name":"_quality","internalType":"uint8"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setGameItemContractAddress","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":"pure","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"version","inputs":[]}]
Contract Creation Code
0x608060405234801561001057600080fd5b50613a63806100206000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c8063629dc9d71161013b578063a22cb465116100b8578063dba8d1a91161007c578063dba8d1a914610548578063e34128e414610568578063e985e9c51461057b578063edbf4ac2146105b7578063f7d00423146105ca57600080fd5b8063a22cb465146104e9578063b88d4fde146104fc578063becc8b761461050f578063c6a319fa14610522578063c87b56dd1461053557600080fd5b806370a08231116100ff57806370a082311461049f578063727ad862146104b257806395d89b41146104c557806397c92220146104cd5780639b1075c0146104e057600080fd5b8063629dc9d7146103f65780636352211e1461041b57806365d5a9d01461042e578063691562a0146104415780636a04c0541461045457600080fd5b806323b872dd116101c957806340738b7f1161018d57806340738b7f1461039957806342842e0e146103ac57806342966c68146103bf5780634f6ccce7146103d257806354fd4d50146103e557600080fd5b806323b872dd1461032a57806323fb5cc21461033d5780632f745c59146103605780633407fc511461037357806335f0d8861461038657600080fd5b80630f109abf116102105780630f109abf146102bf578063140a6473146102eb57806318160ddd146102fd5780631b8757d31461030f57806322f3f7561461031757600080fd5b806301ffc9a71461024257806306fdde031461026a578063081812fc1461027f578063095ea7b3146102aa575b600080fd5b6102556102503660046131ab565b6105dd565b60405190151581526020015b60405180910390f35b610272610608565b6040516102619190613220565b61029261028d366004613233565b61069a565b6040516001600160a01b039091168152602001610261565b6102bd6102b8366004613268565b610734565b005b6102926102cd366004613233565b600090815260ce60205260409020600201546001600160a01b031690565b60cd54600160a01b900460ff16610255565b6099545b604051908152602001610261565b6102bd61084a565b6102bd610325366004613292565b610b47565b6102bd6103383660046132be565b610dba565b61030161034b366004613233565b600090815260ce602052604090206001015490565b61030161036e366004613268565b610deb565b60ca54610292906001600160a01b031681565b60cc54610292906001600160a01b031681565b6102bd6103a73660046133aa565b610e81565b6102bd6103ba3660046132be565b611008565b6102bd6103cd366004613233565b611023565b6103016103e0366004613233565b61102f565b604051620f42428152602001610261565b610409610404366004613233565b6110c2565b60405160ff9091168152602001610261565b610292610429366004613233565b6110e5565b6102bd61043c366004613443565b61115c565b6102bd61044f3660046134fc565b61119b565b610490610462366004613233565b60ce6020526000908152604090208054600182015460029092015460ff90911691906001600160a01b031683565b6040516102619392919061353c565b6103016104ad36600461357b565b6116f9565b6102bd6104c036600461357b565b611780565b6102726119e4565b6102bd6104db366004613596565b6119f3565b61030160c95481565b6102bd6104f73660046135c0565b611c86565b6102bd61050a3660046135f7565b611c95565b61030161051d366004613673565b611ccd565b60cd54610292906001600160a01b031681565b610272610543366004613233565b611d20565b61030161055636600461368e565b60cf6020526000908152604090205481565b60cb54610292906001600160a01b031681565b6102556105893660046136af565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6102bd6105c53660046136d9565b611e08565b6102bd6105d836600461357b565b611fbc565b60006001600160e01b0319821663780e9d6360e01b1480610602575061060282612220565b92915050565b60606065805461061790613737565b80601f016020809104026020016040519081016040528092919081815260200182805461064390613737565b80156106905780601f1061066557610100808354040283529160200191610690565b820191906000526020600020905b81548152906001019060200180831161067357829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b03166107185760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b600061073f826110e5565b9050806001600160a01b0316836001600160a01b031614156107ad5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161070f565b336001600160a01b03821614806107c957506107c98133610589565b61083b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161070f565b6108458383612270565b505050565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b15801561089757600080fd5b505afa1580156108ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cf9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561090c57600080fd5b505afa158015610920573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610944919061378b565b80610a44575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b15801561099757600080fd5b505afa1580156109ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cf9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015610a0c57600080fd5b505afa158015610a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a44919061378b565b610aee5760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b505afa158015610aa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac49190613772565b6040516316b4d34b60e31b81526001600160a01b039092166004830152602482015260440161070f565b60cd805460ff600160a01b808304821615810260ff60a01b199093169290921792839055604051919092049091161515907f02117308b9b8dc6f7218333b8ab5a8c7951c9ea3e4478b8c52a5439ff1693f0390600090a2565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b158015610b9457600080fd5b505afa158015610ba8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcc9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015610c0957600080fd5b505afa158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c41919061378b565b80610d41575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b158015610c9457600080fd5b505afa158015610ca8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccc9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015610d0957600080fd5b505afa158015610d1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d41919061378b565b610d895760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b600091825260ce602052604090912060020180546001600160a01b0319166001600160a01b03909216919091179055565b610dc433826122de565b610de05760405162461bcd60e51b815260040161070f906137a8565b6108458383836123d5565b6000610df6836116f9565b8210610e585760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161070f565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b60cd60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ecf57600080fd5b505afa158015610ee3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f07919061378b565b15610f255760405163487ea6bb60e11b815260040160405180910390fd5b60ca546001600160a01b03163314610f525760405163b371549960e01b815233600482015260240161070f565b60cc5460405163a869f99360e01b81526001600160a01b039091169063a869f99390610f8a9086908a908a908a9088906004016137f9565b600060405180830381600087803b158015610fa457600080fd5b505af1158015610fb8573d6000803e3d6000fd5b50505050610fc587612580565b867f15d6da64d29db7bef5a10e6345fa16aa7d7b0e03ea9c52ac3740538613f2effe83604051610ff791815260200190565b60405180910390a250505050505050565b61084583838360405180602001604052806000815250611c95565b61102c81612580565b50565b600061103a60995490565b821061109d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161070f565b609982815481106110b0576110b061383a565b90600052602060002001549050919050565b600081815260ce602052604081205460ff16600481111561060257610602613526565b6000818152606760205260408120546001600160a01b0316806106025760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161070f565b60005b81518110156108455761118b8383838151811061117e5761117e61383a565b6020026020010151610734565b61119481613866565b905061115f565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b1580156111e857600080fd5b505afa1580156111fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112209190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561125d57600080fd5b505afa158015611271573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611295919061378b565b80611395575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b1580156112e857600080fd5b505afa1580156112fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113209190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561135d57600080fd5b505afa158015611371573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611395919061378b565b6113dd5760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b60048160ff161115611407576040516351cce0f960e11b815260ff8216600482015260240161070f565b600060c96000815461141890613866565b918290555090506114298382612627565b8160ff16600481111561143e5761143e613526565b600082815260ce60205260409020805460ff1916600183600481111561146657611466613526565b021790555060cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b1580156114b857600080fd5b505afa1580156114cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f09190613772565b6040516001600160e01b031960e084901b16815260048101919091526001600160a01b038616602482015260440160206040518083038186803b15801561153657600080fd5b505afa15801561154a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156e919061378b565b158061167a575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b1580156115c257600080fd5b505afa1580156115d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fa9190613772565b6040516001600160e01b031960e084901b16815260048101919091526001600160a01b038616602482015260440160206040518083038186803b15801561164057600080fd5b505afa158015611654573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611678919061378b565b155b156116aa57600081815260ce6020526040902060020180546001600160a01b0319166001600160a01b0385161790555b6040805160ff841681526000602082015282916001600160a01b038616917f84a8982b892013b303414b68237e79d226dac0392c5da412fdba5575d1b91bf191015b60405180910390a3505050565b60006001600160a01b0382166117645760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161070f565b506001600160a01b031660009081526068602052604090205490565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b1580156117cd57600080fd5b505afa1580156117e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118059190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561184257600080fd5b505afa158015611856573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187a919061378b565b8061197a575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b1580156118cd57600080fd5b505afa1580156118e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119059190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561194257600080fd5b505afa158015611956573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197a919061378b565b6119c25760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b60cc80546001600160a01b0319166001600160a01b0392909216919091179055565b60606066805461061790613737565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b158015611a4057600080fd5b505afa158015611a54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a789190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015611ab557600080fd5b505afa158015611ac9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aed919061378b565b80611bed575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b158015611b4057600080fd5b505afa158015611b54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b789190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015611bb557600080fd5b505afa158015611bc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bed919061378b565b611c355760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b8060cf60008460ff166004811115611c4f57611c4f613526565b6004811115611c6057611c60613526565b6004811115611c7157611c71613526565b81526020810191909152604001600020555050565b611c91338383612641565b5050565b611c9f33836122de565b611cbb5760405162461bcd60e51b815260040161070f906137a8565b611cc784848484612708565b50505050565b600060cf60008360ff166004811115611ce857611ce8613526565b6004811115611cf957611cf9613526565b6004811115611d0a57611d0a613526565b8152602001908152602001600020549050919050565b6000818152606760205260409020546060906001600160a01b0316611d9f5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161070f565b6000611db660408051602081019091526000815290565b90506000815111611dd65760405180602001604052806000815250611e01565b80611de08461273b565b604051602001611df1929190613881565b6040516020818303038152906040525b9392505050565b600054610100900460ff1680611e21575060005460ff16155b611e3d5760405162461bcd60e51b815260040161070f906138b0565b600054610100900460ff16158015611e5f576000805461ffff19166101011790555b611ea360405180604001604052806008815260200167446174614375626560c01b81525060405180604001604052806002815260200161444360f01b815250612839565b60cb80546001600160a01b038a81166001600160a01b03199092169190911790915560cd80546001600160a81b03191691891691909117600160a01b17905560cf6020527fe02c59459e6ae69bba35526a32783b104c6119df0d640a9ac4990ec2f8d493a98690557f9bb4860ae4018b7a63008e1d4c4f2ef74d5a095e46377c820dc3f962c67498e88590557fd0ae466d391fc1f33c08f0ded38b0edd84e4ee092dcf838570f20223ba1511f68490557f0786b2e448a85075fbbd634a589a96f16f04f79fafbba799f8cb3c20a382e73483905560046000527f487d9825d239fc0eb73c636da4d301a97d621defb19d737cd772aae6955d6a8c8290558015611fb2576000805461ff00191690555b5050505050505050565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b15801561200957600080fd5b505afa15801561201d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120419190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561207e57600080fd5b505afa158015612092573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b6919061378b565b806121b6575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b15801561210957600080fd5b505afa15801561211d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121419190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561217e57600080fd5b505afa158015612192573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121b6919061378b565b6121fe5760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b60ca80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b031982166380ac58cd60e01b148061225157506001600160e01b03198216635b5e139f60e01b145b8061060257506301ffc9a760e01b6001600160e01b0319831614610602565b600081815260696020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122a5826110e5565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152606760205260408120546001600160a01b03166123575760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161070f565b6000612362836110e5565b9050806001600160a01b0316846001600160a01b0316148061239d5750836001600160a01b03166123928461069a565b6001600160a01b0316145b806123cd57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166123e8826110e5565b6001600160a01b0316146124505760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161070f565b6001600160a01b0382166124b25760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161070f565b6124bd8383836128c0565b6124c8600082612270565b6001600160a01b03831660009081526068602052604081208054600192906124f19084906138fe565b90915550506001600160a01b038216600090815260686020526040812080546001929061251f908490613915565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061258b826110e5565b9050612599816000846128c0565b6125a4600083612270565b6001600160a01b03811660009081526068602052604081208054600192906125cd9084906138fe565b909155505060008281526067602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b611c91828260405180602001604052806000815250612b26565b816001600160a01b0316836001600160a01b031614156126a35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161070f565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191016116ec565b6127138484846123d5565b61271f84848484612b59565b611cc75760405162461bcd60e51b815260040161070f9061392d565b60608161275f5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612789578061277381613866565b91506127829050600a83613995565b9150612763565b60008167ffffffffffffffff8111156127a4576127a461330b565b6040519080825280601f01601f1916602001820160405280156127ce576020820181803683370190505b5090505b84156123cd576127e36001836138fe565b91506127f0600a866139a9565b6127fb906030613915565b60f81b8183815181106128105761281061383a565b60200101906001600160f81b031916908160001a905350612832600a86613995565b94506127d2565b600054610100900460ff1680612852575060005460ff16155b61286e5760405162461bcd60e51b815260040161070f906138b0565b600054610100900460ff16158015612890576000805461ffff19166101011790555b612898612c66565b6128a0612c66565b6128aa8383612cd1565b8015610845576000805461ff0019169055505050565b60ca546001600160a01b03163314801590612ad2575060cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b15801561292357600080fd5b505afa158015612937573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061295b9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561299857600080fd5b505afa1580156129ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d0919061378b565b80612ad0575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b158015612a2357600080fd5b505afa158015612a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a5b9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015612a9857600080fd5b505afa158015612aac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ad0919061378b565b155b15612b1b5760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b610845838383612d66565b612b308383612e1e565b612b3d6000848484612b59565b6108455760405162461bcd60e51b815260040161070f9061392d565b60006001600160a01b0384163b15612c5b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612b9d9033908990889088906004016139bd565b602060405180830381600087803b158015612bb757600080fd5b505af1925050508015612be7575060408051601f3d908101601f19168201909252612be4918101906139fa565b60015b612c41573d808015612c15576040519150601f19603f3d011682016040523d82523d6000602084013e612c1a565b606091505b508051612c395760405162461bcd60e51b815260040161070f9061392d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506123cd565b506001949350505050565b600054610100900460ff1680612c7f575060005460ff16155b612c9b5760405162461bcd60e51b815260040161070f906138b0565b600054610100900460ff16158015612cbd576000805461ffff19166101011790555b801561102c576000805461ff001916905550565b600054610100900460ff1680612cea575060005460ff16155b612d065760405162461bcd60e51b815260040161070f906138b0565b600054610100900460ff16158015612d28576000805461ffff19166101011790555b8251612d3b9060659060208601906130fc565b508151612d4f9060669060208501906130fc565b508015610845576000805461ff0019169055505050565b6001600160a01b038316612dc157612dbc81609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b612de4565b816001600160a01b0316836001600160a01b031614612de457612de48382612f6c565b6001600160a01b038216612dfb5761084581613009565b826001600160a01b0316826001600160a01b0316146108455761084582826130b8565b6001600160a01b038216612e745760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161070f565b6000818152606760205260409020546001600160a01b031615612ed95760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161070f565b612ee5600083836128c0565b6001600160a01b0382166000908152606860205260408120805460019290612f0e908490613915565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001612f79846116f9565b612f8391906138fe565b600083815260986020526040902054909150808214612fd6576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b60995460009061301b906001906138fe565b6000838152609a6020526040812054609980549394509092849081106130435761304361383a565b9060005260206000200154905080609983815481106130645761306461383a565b6000918252602080832090910192909255828152609a9091526040808220849055858252812055609980548061309c5761309c613a17565b6001900381819060005260206000200160009055905550505050565b60006130c3836116f9565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b82805461310890613737565b90600052602060002090601f01602090048101928261312a5760008555613170565b82601f1061314357805160ff1916838001178555613170565b82800160010185558215613170579182015b82811115613170578251825591602001919060010190613155565b5061317c929150613180565b5090565b5b8082111561317c5760008155600101613181565b6001600160e01b03198116811461102c57600080fd5b6000602082840312156131bd57600080fd5b8135611e0181613195565b60005b838110156131e35781810151838201526020016131cb565b83811115611cc75750506000910152565b6000815180845261320c8160208601602086016131c8565b601f01601f19169290920160200192915050565b602081526000611e0160208301846131f4565b60006020828403121561324557600080fd5b5035919050565b80356001600160a01b038116811461326357600080fd5b919050565b6000806040838503121561327b57600080fd5b6132848361324c565b946020939093013593505050565b600080604083850312156132a557600080fd5b823591506132b56020840161324c565b90509250929050565b6000806000606084860312156132d357600080fd5b6132dc8461324c565b92506132ea6020850161324c565b9150604084013590509250925092565b803560ff8116811461326357600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561334a5761334a61330b565b604052919050565b600067ffffffffffffffff83111561336c5761336c61330b565b61337f601f8401601f1916602001613321565b905082815283838301111561339357600080fd5b828260208301376000602084830101529392505050565b600080600080600080600060e0888a0312156133c557600080fd5b8735965060208801359550604088013594506133e3606089016132fa565b93506133f16080890161324c565b925060a0880135915060c088013567ffffffffffffffff81111561341457600080fd5b8801601f81018a1361342557600080fd5b6134348a823560208401613352565b91505092959891949750929550565b6000806040838503121561345657600080fd5b61345f8361324c565b915060208084013567ffffffffffffffff8082111561347d57600080fd5b818601915086601f83011261349157600080fd5b8135818111156134a3576134a361330b565b8060051b91506134b4848301613321565b81815291830184019184810190898411156134ce57600080fd5b938501935b838510156134ec578435825293850193908501906134d3565b8096505050505050509250929050565b6000806040838503121561350f57600080fd5b6135188361324c565b91506132b5602084016132fa565b634e487b7160e01b600052602160045260246000fd5b606081016005851061355e57634e487b7160e01b600052602160045260246000fd5b93815260208101929092526001600160a01b031660409091015290565b60006020828403121561358d57600080fd5b611e018261324c565b600080604083850312156135a957600080fd5b613284836132fa565b801515811461102c57600080fd5b600080604083850312156135d357600080fd5b6135dc8361324c565b915060208301356135ec816135b2565b809150509250929050565b6000806000806080858703121561360d57600080fd5b6136168561324c565b93506136246020860161324c565b925060408501359150606085013567ffffffffffffffff81111561364757600080fd5b8501601f8101871361365857600080fd5b61366787823560208401613352565b91505092959194509250565b60006020828403121561368557600080fd5b611e01826132fa565b6000602082840312156136a057600080fd5b813560058110611e0157600080fd5b600080604083850312156136c257600080fd5b6136cb8361324c565b91506132b56020840161324c565b600080600080600080600060e0888a0312156136f457600080fd5b6136fd8861324c565b965061370b6020890161324c565b96999698505050506040850135946060810135946080820135945060a0820135935060c0909101359150565b600181811c9082168061374b57607f821691505b6020821081141561376c57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561378457600080fd5b5051919050565b60006020828403121561379d57600080fd5b8151611e01816135b2565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60018060a01b038616815284602082015283604082015260ff8316606082015260a06080820152600061382f60a08301846131f4565b979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561387a5761387a613850565b5060010190565b600083516138938184602088016131c8565b8351908301906138a78183602088016131c8565b01949350505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60008282101561391057613910613850565b500390565b6000821982111561392857613928613850565b500190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b6000826139a4576139a461397f565b500490565b6000826139b8576139b861397f565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906139f0908301846131f4565b9695505050505050565b600060208284031215613a0c57600080fd5b8151611e0181613195565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220a57a2e276a5fee00334e0021e64917460c25e48b7ffb4865b8489e9b12ce840e64736f6c63430008090033
Deployed ByteCode
0x608060405234801561001057600080fd5b506004361061023d5760003560e01c8063629dc9d71161013b578063a22cb465116100b8578063dba8d1a91161007c578063dba8d1a914610548578063e34128e414610568578063e985e9c51461057b578063edbf4ac2146105b7578063f7d00423146105ca57600080fd5b8063a22cb465146104e9578063b88d4fde146104fc578063becc8b761461050f578063c6a319fa14610522578063c87b56dd1461053557600080fd5b806370a08231116100ff57806370a082311461049f578063727ad862146104b257806395d89b41146104c557806397c92220146104cd5780639b1075c0146104e057600080fd5b8063629dc9d7146103f65780636352211e1461041b57806365d5a9d01461042e578063691562a0146104415780636a04c0541461045457600080fd5b806323b872dd116101c957806340738b7f1161018d57806340738b7f1461039957806342842e0e146103ac57806342966c68146103bf5780634f6ccce7146103d257806354fd4d50146103e557600080fd5b806323b872dd1461032a57806323fb5cc21461033d5780632f745c59146103605780633407fc511461037357806335f0d8861461038657600080fd5b80630f109abf116102105780630f109abf146102bf578063140a6473146102eb57806318160ddd146102fd5780631b8757d31461030f57806322f3f7561461031757600080fd5b806301ffc9a71461024257806306fdde031461026a578063081812fc1461027f578063095ea7b3146102aa575b600080fd5b6102556102503660046131ab565b6105dd565b60405190151581526020015b60405180910390f35b610272610608565b6040516102619190613220565b61029261028d366004613233565b61069a565b6040516001600160a01b039091168152602001610261565b6102bd6102b8366004613268565b610734565b005b6102926102cd366004613233565b600090815260ce60205260409020600201546001600160a01b031690565b60cd54600160a01b900460ff16610255565b6099545b604051908152602001610261565b6102bd61084a565b6102bd610325366004613292565b610b47565b6102bd6103383660046132be565b610dba565b61030161034b366004613233565b600090815260ce602052604090206001015490565b61030161036e366004613268565b610deb565b60ca54610292906001600160a01b031681565b60cc54610292906001600160a01b031681565b6102bd6103a73660046133aa565b610e81565b6102bd6103ba3660046132be565b611008565b6102bd6103cd366004613233565b611023565b6103016103e0366004613233565b61102f565b604051620f42428152602001610261565b610409610404366004613233565b6110c2565b60405160ff9091168152602001610261565b610292610429366004613233565b6110e5565b6102bd61043c366004613443565b61115c565b6102bd61044f3660046134fc565b61119b565b610490610462366004613233565b60ce6020526000908152604090208054600182015460029092015460ff90911691906001600160a01b031683565b6040516102619392919061353c565b6103016104ad36600461357b565b6116f9565b6102bd6104c036600461357b565b611780565b6102726119e4565b6102bd6104db366004613596565b6119f3565b61030160c95481565b6102bd6104f73660046135c0565b611c86565b6102bd61050a3660046135f7565b611c95565b61030161051d366004613673565b611ccd565b60cd54610292906001600160a01b031681565b610272610543366004613233565b611d20565b61030161055636600461368e565b60cf6020526000908152604090205481565b60cb54610292906001600160a01b031681565b6102556105893660046136af565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6102bd6105c53660046136d9565b611e08565b6102bd6105d836600461357b565b611fbc565b60006001600160e01b0319821663780e9d6360e01b1480610602575061060282612220565b92915050565b60606065805461061790613737565b80601f016020809104026020016040519081016040528092919081815260200182805461064390613737565b80156106905780601f1061066557610100808354040283529160200191610690565b820191906000526020600020905b81548152906001019060200180831161067357829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b03166107185760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b600061073f826110e5565b9050806001600160a01b0316836001600160a01b031614156107ad5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161070f565b336001600160a01b03821614806107c957506107c98133610589565b61083b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161070f565b6108458383612270565b505050565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b15801561089757600080fd5b505afa1580156108ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cf9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561090c57600080fd5b505afa158015610920573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610944919061378b565b80610a44575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b15801561099757600080fd5b505afa1580156109ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cf9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015610a0c57600080fd5b505afa158015610a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a44919061378b565b610aee5760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b505afa158015610aa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac49190613772565b6040516316b4d34b60e31b81526001600160a01b039092166004830152602482015260440161070f565b60cd805460ff600160a01b808304821615810260ff60a01b199093169290921792839055604051919092049091161515907f02117308b9b8dc6f7218333b8ab5a8c7951c9ea3e4478b8c52a5439ff1693f0390600090a2565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b158015610b9457600080fd5b505afa158015610ba8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcc9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015610c0957600080fd5b505afa158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c41919061378b565b80610d41575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b158015610c9457600080fd5b505afa158015610ca8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccc9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015610d0957600080fd5b505afa158015610d1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d41919061378b565b610d895760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b600091825260ce602052604090912060020180546001600160a01b0319166001600160a01b03909216919091179055565b610dc433826122de565b610de05760405162461bcd60e51b815260040161070f906137a8565b6108458383836123d5565b6000610df6836116f9565b8210610e585760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161070f565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b60cd60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ecf57600080fd5b505afa158015610ee3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f07919061378b565b15610f255760405163487ea6bb60e11b815260040160405180910390fd5b60ca546001600160a01b03163314610f525760405163b371549960e01b815233600482015260240161070f565b60cc5460405163a869f99360e01b81526001600160a01b039091169063a869f99390610f8a9086908a908a908a9088906004016137f9565b600060405180830381600087803b158015610fa457600080fd5b505af1158015610fb8573d6000803e3d6000fd5b50505050610fc587612580565b867f15d6da64d29db7bef5a10e6345fa16aa7d7b0e03ea9c52ac3740538613f2effe83604051610ff791815260200190565b60405180910390a250505050505050565b61084583838360405180602001604052806000815250611c95565b61102c81612580565b50565b600061103a60995490565b821061109d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161070f565b609982815481106110b0576110b061383a565b90600052602060002001549050919050565b600081815260ce602052604081205460ff16600481111561060257610602613526565b6000818152606760205260408120546001600160a01b0316806106025760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161070f565b60005b81518110156108455761118b8383838151811061117e5761117e61383a565b6020026020010151610734565b61119481613866565b905061115f565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b1580156111e857600080fd5b505afa1580156111fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112209190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561125d57600080fd5b505afa158015611271573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611295919061378b565b80611395575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b1580156112e857600080fd5b505afa1580156112fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113209190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561135d57600080fd5b505afa158015611371573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611395919061378b565b6113dd5760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b60048160ff161115611407576040516351cce0f960e11b815260ff8216600482015260240161070f565b600060c96000815461141890613866565b918290555090506114298382612627565b8160ff16600481111561143e5761143e613526565b600082815260ce60205260409020805460ff1916600183600481111561146657611466613526565b021790555060cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b1580156114b857600080fd5b505afa1580156114cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f09190613772565b6040516001600160e01b031960e084901b16815260048101919091526001600160a01b038616602482015260440160206040518083038186803b15801561153657600080fd5b505afa15801561154a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156e919061378b565b158061167a575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b1580156115c257600080fd5b505afa1580156115d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fa9190613772565b6040516001600160e01b031960e084901b16815260048101919091526001600160a01b038616602482015260440160206040518083038186803b15801561164057600080fd5b505afa158015611654573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611678919061378b565b155b156116aa57600081815260ce6020526040902060020180546001600160a01b0319166001600160a01b0385161790555b6040805160ff841681526000602082015282916001600160a01b038616917f84a8982b892013b303414b68237e79d226dac0392c5da412fdba5575d1b91bf191015b60405180910390a3505050565b60006001600160a01b0382166117645760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161070f565b506001600160a01b031660009081526068602052604090205490565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b1580156117cd57600080fd5b505afa1580156117e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118059190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561184257600080fd5b505afa158015611856573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187a919061378b565b8061197a575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b1580156118cd57600080fd5b505afa1580156118e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119059190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561194257600080fd5b505afa158015611956573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197a919061378b565b6119c25760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b60cc80546001600160a01b0319166001600160a01b0392909216919091179055565b60606066805461061790613737565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b158015611a4057600080fd5b505afa158015611a54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a789190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015611ab557600080fd5b505afa158015611ac9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aed919061378b565b80611bed575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b158015611b4057600080fd5b505afa158015611b54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b789190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015611bb557600080fd5b505afa158015611bc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bed919061378b565b611c355760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b8060cf60008460ff166004811115611c4f57611c4f613526565b6004811115611c6057611c60613526565b6004811115611c7157611c71613526565b81526020810191909152604001600020555050565b611c91338383612641565b5050565b611c9f33836122de565b611cbb5760405162461bcd60e51b815260040161070f906137a8565b611cc784848484612708565b50505050565b600060cf60008360ff166004811115611ce857611ce8613526565b6004811115611cf957611cf9613526565b6004811115611d0a57611d0a613526565b8152602001908152602001600020549050919050565b6000818152606760205260409020546060906001600160a01b0316611d9f5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161070f565b6000611db660408051602081019091526000815290565b90506000815111611dd65760405180602001604052806000815250611e01565b80611de08461273b565b604051602001611df1929190613881565b6040516020818303038152906040525b9392505050565b600054610100900460ff1680611e21575060005460ff16155b611e3d5760405162461bcd60e51b815260040161070f906138b0565b600054610100900460ff16158015611e5f576000805461ffff19166101011790555b611ea360405180604001604052806008815260200167446174614375626560c01b81525060405180604001604052806002815260200161444360f01b815250612839565b60cb80546001600160a01b038a81166001600160a01b03199092169190911790915560cd80546001600160a81b03191691891691909117600160a01b17905560cf6020527fe02c59459e6ae69bba35526a32783b104c6119df0d640a9ac4990ec2f8d493a98690557f9bb4860ae4018b7a63008e1d4c4f2ef74d5a095e46377c820dc3f962c67498e88590557fd0ae466d391fc1f33c08f0ded38b0edd84e4ee092dcf838570f20223ba1511f68490557f0786b2e448a85075fbbd634a589a96f16f04f79fafbba799f8cb3c20a382e73483905560046000527f487d9825d239fc0eb73c636da4d301a97d621defb19d737cd772aae6955d6a8c8290558015611fb2576000805461ff00191690555b5050505050505050565b60cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b15801561200957600080fd5b505afa15801561201d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120419190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561207e57600080fd5b505afa158015612092573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b6919061378b565b806121b6575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b15801561210957600080fd5b505afa15801561211d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121419190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561217e57600080fd5b505afa158015612192573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121b6919061378b565b6121fe5760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b60ca80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b031982166380ac58cd60e01b148061225157506001600160e01b03198216635b5e139f60e01b145b8061060257506301ffc9a760e01b6001600160e01b0319831614610602565b600081815260696020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122a5826110e5565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152606760205260408120546001600160a01b03166123575760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161070f565b6000612362836110e5565b9050806001600160a01b0316846001600160a01b0316148061239d5750836001600160a01b03166123928461069a565b6001600160a01b0316145b806123cd57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166123e8826110e5565b6001600160a01b0316146124505760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161070f565b6001600160a01b0382166124b25760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161070f565b6124bd8383836128c0565b6124c8600082612270565b6001600160a01b03831660009081526068602052604081208054600192906124f19084906138fe565b90915550506001600160a01b038216600090815260686020526040812080546001929061251f908490613915565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061258b826110e5565b9050612599816000846128c0565b6125a4600083612270565b6001600160a01b03811660009081526068602052604081208054600192906125cd9084906138fe565b909155505060008281526067602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b611c91828260405180602001604052806000815250612b26565b816001600160a01b0316836001600160a01b031614156126a35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161070f565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191016116ec565b6127138484846123d5565b61271f84848484612b59565b611cc75760405162461bcd60e51b815260040161070f9061392d565b60608161275f5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612789578061277381613866565b91506127829050600a83613995565b9150612763565b60008167ffffffffffffffff8111156127a4576127a461330b565b6040519080825280601f01601f1916602001820160405280156127ce576020820181803683370190505b5090505b84156123cd576127e36001836138fe565b91506127f0600a866139a9565b6127fb906030613915565b60f81b8183815181106128105761281061383a565b60200101906001600160f81b031916908160001a905350612832600a86613995565b94506127d2565b600054610100900460ff1680612852575060005460ff16155b61286e5760405162461bcd60e51b815260040161070f906138b0565b600054610100900460ff16158015612890576000805461ffff19166101011790555b612898612c66565b6128a0612c66565b6128aa8383612cd1565b8015610845576000805461ff0019169055505050565b60ca546001600160a01b03163314801590612ad2575060cd546040805163a217fddf60e01b815290516001600160a01b03909216916391d1485491839163a217fddf91600480820192602092909190829003018186803b15801561292357600080fd5b505afa158015612937573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061295b9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b15801561299857600080fd5b505afa1580156129ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d0919061378b565b80612ad0575060cd546040805163a6b4321160e01b815290516001600160a01b03909216916391d1485491839163a6b4321191600480820192602092909190829003018186803b158015612a2357600080fd5b505afa158015612a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a5b9190613772565b6040516001600160e01b031960e084901b168152600481019190915233602482015260440160206040518083038186803b158015612a9857600080fd5b505afa158015612aac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ad0919061378b565b155b15612b1b5760cd546040805163a6b4321160e01b8152905133926001600160a01b03169163a6b43211916004808301926020929190829003018186803b158015610a8c57600080fd5b610845838383612d66565b612b308383612e1e565b612b3d6000848484612b59565b6108455760405162461bcd60e51b815260040161070f9061392d565b60006001600160a01b0384163b15612c5b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612b9d9033908990889088906004016139bd565b602060405180830381600087803b158015612bb757600080fd5b505af1925050508015612be7575060408051601f3d908101601f19168201909252612be4918101906139fa565b60015b612c41573d808015612c15576040519150601f19603f3d011682016040523d82523d6000602084013e612c1a565b606091505b508051612c395760405162461bcd60e51b815260040161070f9061392d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506123cd565b506001949350505050565b600054610100900460ff1680612c7f575060005460ff16155b612c9b5760405162461bcd60e51b815260040161070f906138b0565b600054610100900460ff16158015612cbd576000805461ffff19166101011790555b801561102c576000805461ff001916905550565b600054610100900460ff1680612cea575060005460ff16155b612d065760405162461bcd60e51b815260040161070f906138b0565b600054610100900460ff16158015612d28576000805461ffff19166101011790555b8251612d3b9060659060208601906130fc565b508151612d4f9060669060208501906130fc565b508015610845576000805461ff0019169055505050565b6001600160a01b038316612dc157612dbc81609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b612de4565b816001600160a01b0316836001600160a01b031614612de457612de48382612f6c565b6001600160a01b038216612dfb5761084581613009565b826001600160a01b0316826001600160a01b0316146108455761084582826130b8565b6001600160a01b038216612e745760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161070f565b6000818152606760205260409020546001600160a01b031615612ed95760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161070f565b612ee5600083836128c0565b6001600160a01b0382166000908152606860205260408120805460019290612f0e908490613915565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001612f79846116f9565b612f8391906138fe565b600083815260986020526040902054909150808214612fd6576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b60995460009061301b906001906138fe565b6000838152609a6020526040812054609980549394509092849081106130435761304361383a565b9060005260206000200154905080609983815481106130645761306461383a565b6000918252602080832090910192909255828152609a9091526040808220849055858252812055609980548061309c5761309c613a17565b6001900381819060005260206000200160009055905550505050565b60006130c3836116f9565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b82805461310890613737565b90600052602060002090601f01602090048101928261312a5760008555613170565b82601f1061314357805160ff1916838001178555613170565b82800160010185558215613170579182015b82811115613170578251825591602001919060010190613155565b5061317c929150613180565b5090565b5b8082111561317c5760008155600101613181565b6001600160e01b03198116811461102c57600080fd5b6000602082840312156131bd57600080fd5b8135611e0181613195565b60005b838110156131e35781810151838201526020016131cb565b83811115611cc75750506000910152565b6000815180845261320c8160208601602086016131c8565b601f01601f19169290920160200192915050565b602081526000611e0160208301846131f4565b60006020828403121561324557600080fd5b5035919050565b80356001600160a01b038116811461326357600080fd5b919050565b6000806040838503121561327b57600080fd5b6132848361324c565b946020939093013593505050565b600080604083850312156132a557600080fd5b823591506132b56020840161324c565b90509250929050565b6000806000606084860312156132d357600080fd5b6132dc8461324c565b92506132ea6020850161324c565b9150604084013590509250925092565b803560ff8116811461326357600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561334a5761334a61330b565b604052919050565b600067ffffffffffffffff83111561336c5761336c61330b565b61337f601f8401601f1916602001613321565b905082815283838301111561339357600080fd5b828260208301376000602084830101529392505050565b600080600080600080600060e0888a0312156133c557600080fd5b8735965060208801359550604088013594506133e3606089016132fa565b93506133f16080890161324c565b925060a0880135915060c088013567ffffffffffffffff81111561341457600080fd5b8801601f81018a1361342557600080fd5b6134348a823560208401613352565b91505092959891949750929550565b6000806040838503121561345657600080fd5b61345f8361324c565b915060208084013567ffffffffffffffff8082111561347d57600080fd5b818601915086601f83011261349157600080fd5b8135818111156134a3576134a361330b565b8060051b91506134b4848301613321565b81815291830184019184810190898411156134ce57600080fd5b938501935b838510156134ec578435825293850193908501906134d3565b8096505050505050509250929050565b6000806040838503121561350f57600080fd5b6135188361324c565b91506132b5602084016132fa565b634e487b7160e01b600052602160045260246000fd5b606081016005851061355e57634e487b7160e01b600052602160045260246000fd5b93815260208101929092526001600160a01b031660409091015290565b60006020828403121561358d57600080fd5b611e018261324c565b600080604083850312156135a957600080fd5b613284836132fa565b801515811461102c57600080fd5b600080604083850312156135d357600080fd5b6135dc8361324c565b915060208301356135ec816135b2565b809150509250929050565b6000806000806080858703121561360d57600080fd5b6136168561324c565b93506136246020860161324c565b925060408501359150606085013567ffffffffffffffff81111561364757600080fd5b8501601f8101871361365857600080fd5b61366787823560208401613352565b91505092959194509250565b60006020828403121561368557600080fd5b611e01826132fa565b6000602082840312156136a057600080fd5b813560058110611e0157600080fd5b600080604083850312156136c257600080fd5b6136cb8361324c565b91506132b56020840161324c565b600080600080600080600060e0888a0312156136f457600080fd5b6136fd8861324c565b965061370b6020890161324c565b96999698505050506040850135946060810135946080820135945060a0820135935060c0909101359150565b600181811c9082168061374b57607f821691505b6020821081141561376c57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561378457600080fd5b5051919050565b60006020828403121561379d57600080fd5b8151611e01816135b2565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60018060a01b038616815284602082015283604082015260ff8316606082015260a06080820152600061382f60a08301846131f4565b979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561387a5761387a613850565b5060010190565b600083516138938184602088016131c8565b8351908301906138a78183602088016131c8565b01949350505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60008282101561391057613910613850565b500390565b6000821982111561392857613928613850565b500190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b6000826139a4576139a461397f565b500490565b6000826139b8576139b861397f565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906139f0908301846131f4565b9695505050505050565b600060208284031215613a0c57600080fd5b8151611e0181613195565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220a57a2e276a5fee00334e0021e64917460c25e48b7ffb4865b8489e9b12ce840e64736f6c63430008090033