ERC-721
Overview
Max Total Supply
0 KOE
Holders
218
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
2 KOELoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
AdventurersOfEther
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "./adventurer/PublicSale.sol"; import "./adventurer/PreSale.sol"; import "./adventurer/WhiteList.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "operator-filter-registry/src/DefaultOperatorFilterer.sol"; /// @title Kingdoms of Ether is a CC0 & open-sourced franchise inhabited by 3D Knights, Archers & Wizards of Ether. /// @author Founded by Ludvig Holmen & Janus-Faced. /// @author Contract developed by @dadogg80, VBS-Viken Blockchain Solutions AS. /// @notice AdventurersOfEther.sol is the ERC721 standard smart-contract, and it incorperates multiple features and phases like: /// @notice - Whitelist, PreSale, PublicSale. contract AdventurersOfEther is DefaultOperatorFilterer, PublicSale, WhiteList, PreSale { using Strings for uint256; /// @notice Emittet when the collection is initiated. event Initiated(); constructor(address payable _royaltyReceiver, uint96 _feePercentInBIPS) { _setDefaultRoyalty(_royaltyReceiver, _feePercentInBIPS); } /// @notice Restricted method will initiate the collection. /// @dev Restricted with onlyOwner modifier. /// @param __contractURI The contractURI. function initCollection(string memory __contractURI) external onlyOwner { _contractURI = __contractURI; emit Initiated(); } /// @notice Used to burn multiple nft´s in one transaction. /// @dev Restricted with onlyOwner modifier. /// @param _tokenId An array of tokenIds to burn. function burn(uint256 _tokenId) external onlyOwner { _burn(_tokenId); } /// @notice Used to set a new treasury address. /// @dev Restricted with onlyOwner modifier. /// @param _treasury The contract address of the treasury contract. function setTreasury(address payable _treasury) external onlyOwner { treasury = _treasury; emit TreasurySet(treasury); } /// @notice Transfer Funds to the treasury address. function transferToTreasury() external onlyOwner { if (payable(treasury) == address(0)) revert NoZeroAddress(); (bool success, ) = treasury.call{value: address(this).balance}(""); if (!success) revert TreasuryError(); } /// @dev Method returns the URI with a given token ID's metadata. /// @dev Returns the uri for the token ID given, with additional suffix if set. /// @param _tokenId The token id to retrieve the metadata of. function tokenURI( uint256 _tokenId ) public view override returns (string memory) { return bytes(_baseTokenURI).length != 0 ? string( abi.encodePacked( _baseTokenURI, Strings.toString(_tokenId), _uriSuffix ) ) : ""; } function setApprovalForAll( address operator, bool approved ) public virtual override(ERC721, IERC721) onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve( address operator, uint256 tokenId ) public virtual override(ERC721, IERC721) onlyAllowedOperatorApproval(operator) { super.approve(operator, tokenId); } function transferFrom( address from, address to, uint256 tokenId ) public virtual override(ERC721, IERC721) onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override(ERC721, IERC721) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override(ERC721, IERC721) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {OperatorFilterer} from "./OperatorFilterer.sol"; import {CANONICAL_CORI_SUBSCRIPTION} from "./lib/Constants.sol"; /** * @title DefaultOperatorFilterer * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription. * @dev Please note that if your token contract does not provide an owner with EIP-173, it must provide * administration methods on the contract itself to interact with the registry otherwise the subscription * will be locked to the options set during construction. */ abstract contract DefaultOperatorFilterer is OperatorFilterer { /// @dev The constructor that is called when the contract is being deployed. constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
//SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "../AdventurersStorage.sol"; /// @title Whitelist.sol /// @author @Dadogg80 - Viken Blockchain Solutions. /// @notice Whitelist.sol will allow the "whitelisted accounts to mint their pre-allocated amount of adventurers. /// @dev The main methods in this contract are [ setMerkleRoot } and { mintSelected }, read more about the methods in their description. abstract contract WhiteList is AdventurersStorage { mapping (address => bool) internal whitelistUsed; mapping (address => uint256) internal whitelistRemaining; bytes32 internal merkleRoot; uint256 public maxItemsPerTx = 2; uint256 internal price; /// @notice Allow whitelisted accounts to mint according to the merkletree. /// @param amount The amount of nft's to mint. /// @param totalAllocation The allocated amount to mint. /// @param leaf the leaf node of the three. /// @param proof the proof from the merkletree. function mintSelected(uint amount, uint totalAllocation, bytes32 leaf, bytes32[] memory proof) external payable { require(msg.value == price, "wrong amount!"); // Create storage element tracking user mints if this is the first mint for them if (!whitelistUsed[msg.sender]) { // Verify that (msg.sender, amount) correspond to Merkle leaf require(keccak256(abi.encodePacked(msg.sender, totalAllocation)) == leaf, "don't match Merkle leaf"); // Verify that (leaf, proof) matches the Merkle root require(verify(merkleRoot, leaf, proof), "Not a valid leaf"); whitelistUsed[msg.sender] = true; whitelistRemaining[msg.sender] = totalAllocation; } // Require nonzero amount require(amount > 0, "Can't mint zero"); require(amount <= maxItemsPerTx, "Above MaxItemsPerTx"); require(whitelistRemaining[msg.sender] >= amount, "more than remaining allocation"); whitelistRemaining[msg.sender] -= amount; _mint(msg.sender, amount); emit MintSelected(msg.sender, amount); } /// @notice verify the merkleProof. /// @param root the root node in the merkletree. /// @param leaf The leaf node in the merkletree. /// @param proof The proof in the merkletree. function verify(bytes32 root, bytes32 leaf, bytes32[] memory proof) public pure returns (bool) { return MerkleProof.verify(proof, root, leaf); } function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner { merkleRoot = _merkleRoot; } function setMintSelectedActive(bool result, uint _price) external onlyOwner { mintSelectedActive = result; price = _price; } }
//SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "../AdventurersStorage.sol"; /** * @notice Presale (Crystal exchange) stage of Adventurers Token workflow */ abstract contract PreSale is AdventurersStorage { using ERC165Checker for address; string constant internal invalidPayment = "presale: invalid payment amount"; string constant internal invalidCount = "presale: invalid count"; string constant internal invalid1155 = "presale: 0 or valid IERC1155"; /// @notice PreSaleConfig struct. /// @param price The PreSale price. /// @param tokensPerCrystal The amount of tokens per crystal. struct PresaleConfig { uint128 price; uint32 tokensPerCrystal; } /// @notice Address to the crystal smart contract. address public crystal; /// @notice Returns the preSaleConfig. PresaleConfig public presaleConfig = PresaleConfig({ price: 0.095 ether, tokensPerCrystal: 4 // 3 + extra 1 for < }); modifier cost(uint _count) { PresaleConfig memory _cfg = presaleConfig; if (msg.value != _cfg.price * _count) revert ErrorMessage(invalidPayment); _; } /// @dev Emittet if the presale is disabled. error PresaleDisabled(); event PreSaleConfigSet( uint128 indexed price, uint32 indexed tokensPerCrystal ); event CrystalSet(address indexed value); /// @notice Used by the crystal holders to mint from the presale. /// @dev Transfers the crytstal nft from the msg.sender to this contract. /// @param _count The amount of tokens to mint. /// @param _id The tokenId of the crystal held by the msg.sender. function mintCrystalHolders(uint _count, uint _id) external payable cost(_count) { if(crystal == address(0)) revert PresaleDisabled(); PresaleConfig memory _cfg = presaleConfig; if (_count <= 0 && _count > _cfg.tokensPerCrystal) revert ErrorMessage(invalidCount); IERC1155(crystal).safeTransferFrom(msg.sender, address(this), _id, 1, ""); _mint(msg.sender, _count); } /// @notice Used to adjust the presale config values. /// @dev Restricted with onlyOwner modifier. /// @param _price The presale mint price. /// @param _tokensPerCrystal The tokens required per crystal. function setPresaleConfig(uint128 _price, uint32 _tokensPerCrystal) external onlyOwner { presaleConfig = PresaleConfig({ price: _price, tokensPerCrystal: _tokensPerCrystal + 1 }); emit PreSaleConfigSet(_price, _tokensPerCrystal +1); } /// @notice Used to set the Crystal contract address. /// @dev Restricted to onlyOwner modifier. /// @param _value The Crystal contract address function setCrystal(address _value) external onlyOwner { require(_value == address(0) || _value.supportsInterface(type(IERC1155).interfaceId), invalid1155); crystal = _value; if (_value != address(0)) { IERC1155(_value).setApprovalForAll(owner(), true); // we want to regift crystals } emit CrystalSet(_value); } }
//SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "../AdventurersStorage.sol"; /** * @notice Public sale stage of Adventurers Token workflow */ abstract contract PublicSale is AdventurersStorage { /// @notice PublicSaleConfig struct. /// @param price The PublicSale price. /// @param tokensPerTransaction The amount of tokens per tx. struct PublicSaleConfig { uint128 price; uint32 tokensPerTransaction; } /// @notice Returns the publicSaleConfig. PublicSaleConfig public publicSaleConfig = PublicSaleConfig({ price: 0.02 ether, tokensPerTransaction: 0 // 10 + extra 1 for < }); /// @notice Used to mint in the public mint phase. /// @param _count The amount of tokens to mint. function mintPublic(uint256 _count) external payable { PublicSaleConfig memory _cfg = publicSaleConfig; require(_cfg.tokensPerTransaction > 0, "publicsale: disabled"); require(msg.value == _cfg.price * _count, "publicsale: payment amount"); require(_count < _cfg.tokensPerTransaction, "publicsale: invalid count"); _mint(msg.sender, _count); } /// @notice Used to adjust the publicsale config values. /// @dev Restricted with onlyOwner modifier. /// @param _price The publicSale mint price. /// @param _tokensPerTransaction The amount of tokens allowed per tx. function setPublicSaleConfig(uint128 _price, uint32 _tokensPerTransaction) external onlyOwner { uint32 _perTx = _tokensPerTransaction += 1; publicSaleConfig = PublicSaleConfig({ price: _price, tokensPerTransaction: _perTx }); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E; address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol"; import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol"; /** * @title OperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. * Please note that if your token contract does not provide an owner with EIP-173, it must provide * administration methods on the contract itself to interact with the registry otherwise the subscription * will be locked to the options set during construction. */ abstract contract OperatorFilterer { /// @dev Emitted when an operator is not allowed. error OperatorNotAllowed(address operator); IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS); /// @dev The constructor that is called when the contract is being deployed. constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (subscribe) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { OPERATOR_FILTER_REGISTRY.register(address(this)); } } } } /** * @dev A helper function to check if an operator is allowed. */ modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } /** * @dev A helper function to check if an operator approval is allowed. */ modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } /** * @dev A helper function to check if an operator is allowed. */ function _checkFilterOperator(address operator) internal view virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { // under normal circumstances, this function will revert rather than return false, but inheriting contracts // may specify their own OperatorFilterRegistry implementations, which may behave differently if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract AdventurersStorage is Ownable, ERC721("Adventurers Of Ether", "KOE"), ERC2981, IERC721Enumerable { using Counters for Counters.Counter; Counters.Counter private _tokenIdTracker; uint256 internal MAX_SUPPLY = 6001; // +1 extra 1 for < uint256 public maxSupply = 3001; event Minted(address to, uint256 amount); /// @notice Address of the receiver of the smart contract funds. address payable public treasury; /// @notice The suffix to use at the end of the baseTokenURI. string internal _uriSuffix; string internal _contractURI; /// @notice The Base uri string for these tokens. string internal _baseTokenURI; /// @notice The internal condition is used to validate if the { whitelist } feature is active. bool internal mintSelectedActive; string internal constant _MerkleLeafMatchError = "Don't match Merkle leaf"; string internal constant _MerkleLeafValidationError = "Not a valid Merkle Leaf"; string internal constant _RemainingAllocationError = "Can't mint more than remaining allocation"; /// @notice Thrown by { transferToTreasury } method if the treasury address is a zero address. error NoZeroAddress(); error NoZeroValues(); /// @notice Thrown by { transferToTreasury } method if the transaction fails. error TreasuryError(); /// @dev Emitted with a message. /// @param message The error message. error ErrorMessage(string message); /// @notice Thrown by { tierChecks } modifier if the msg.value is to low. /// @param sent Is the transacted value. /// @param expected Is the expected value. error ErrorPrice(uint256 sent, uint256 expected); /// @notice Emitted when the MaxSupply has been adjusted. /// @param maxSupply The new maxSupply set for this contract. event SetMaxSupply(uint256 maxSupply); /// @notice Emitted when the Treasury address has been adjusted. /// @param treasury The new Treasury address. event TreasurySet(address treasury); /// @notice Emitted when the default royalty data has been adjusted. /// @param receiver The new Royalty receiver address. /// @param feeNumerator The new Royalty amount. Example: 750 is equal to 7.5% event UpdatedDefaultRoyalty( address indexed receiver, uint96 indexed feeNumerator ); /// @notice Emitted when the royalty data of a given token has been adjusted. /// @param tokenId The tokenId of the token. /// @param receiver The new Royalty receiver address. /// @param feeNumerator The new Royalty amount. Example: 750 is equal to 7.5% event UpdatedTokenRoyalty( uint256 indexed tokenId, address indexed receiver, uint96 indexed feeNumerator ); /// @notice Emmited when a new whitelisted account mint a new token. /// @param account Indexed - The address of the minter. /// @param amount The amount minted. event MintSelected(address indexed account, uint256 amount); /* ------------------------------------------------------------ ADMIN ROYALTY FUNCTIONS ----------------------------------------------------------- */ /// @notice Adjust the royalty data of a given token id {will override default royalty for this contact}. /// @dev Restricted to onlyOwner. /// @param tokenId The id of the token. /// @param receiver The account to receive the royalty amount. /// @param feeNumerator The royalty amount in BIPS. example: 750 is 7,5%. function setTokenRoyalty( uint256 tokenId, address payable receiver, uint96 feeNumerator ) external onlyOwner { _setTokenRoyalty(tokenId, receiver, feeNumerator); emit UpdatedTokenRoyalty(tokenId, receiver, feeNumerator); } /// @notice Adjust the current default royalty data. /// @dev Restricted to onlyOwner. /// @param receiver The account to receive the royalty amount. /// @param feeNumerator The royalty amount in BIPS. example: 750 is 7,5%. function setDefaultRoyalty( address payable receiver, uint96 feeNumerator ) external onlyOwner { _setDefaultRoyalty(receiver, feeNumerator); emit UpdatedDefaultRoyalty(receiver, feeNumerator); } /// @notice Method is used by openSea to read contract information. /// @dev Go to { https://docs.opensea.io/docs/contract-level-metadata } to learn more about this method. function contractURI() public view returns (string memory) { return _contractURI; } /// @notice Method is used to adjust the baseTokenURI. /// @param baseTokenURI The new baseTokenUri to use. function setBaseURI(string memory baseTokenURI) external onlyOwner { _baseTokenURI = baseTokenURI; } /// @notice Method is used to adjust the baseTokenURI suffix. /// @param suffix The suffix to use at the end of the baseTokenURI. function setSuffix(string memory suffix) external onlyOwner { _uriSuffix = suffix; } /// @notice Function is used to adjust the maxSupply variable. /// @dev Restricted with onlyOwner modifier. /// @param _maxSupply The new max supply amount. function setMaxSupply(uint256 _maxSupply) external onlyOwner { require(_maxSupply < MAX_SUPPLY, "max supply exceeded"); maxSupply = _maxSupply; emit SetMaxSupply(maxSupply); } function setTotalSupply(uint256 _totalSupply) external onlyOwner { MAX_SUPPLY = _totalSupply; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC2981, ERC721, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IERC721Enumerable).interfaceId || interfaceId == type(ERC2981).interfaceId || interfaceId == type(IERC165).interfaceId; } function _mint(address _to, uint256 _amount) internal override { for (uint256 i = 0; i < _amount; i++) { _tokenIdTracker.increment(); super._mint(_to, _tokenIdTracker.current()); } emit Minted(_to, _tokenIdTracker.current()); } function mintBatch(address[] memory to, uint256[] memory amount) external onlyOwner { for (uint256 i; i < to.length; i++) { _mint(to[i], amount[i]); } } function totalSupply() external view override returns (uint256) {} function tokenOfOwnerByIndex( address owner, uint256 index ) external view override returns (uint256) {} function tokenByIndex( uint256 index ) external view override returns (uint256) {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/introspection/ERC165Checker.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Library used to query support of an interface declared via {IERC165}. * * Note that these functions return the actual result of the query: they do not * `revert` if an interface is not supported. It is up to the caller to decide * what to do in these cases. */ library ERC165Checker { // As per the EIP-165 spec, no interface should ever match 0xffffffff bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff; /** * @dev Returns true if `account` supports the {IERC165} interface. */ function supportsERC165(address account) internal view returns (bool) { // Any contract that implements ERC165 must explicitly indicate support of // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid return supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) && !supportsERC165InterfaceUnchecked(account, _INTERFACE_ID_INVALID); } /** * @dev Returns true if `account` supports the interface defined by * `interfaceId`. Support for {IERC165} itself is queried automatically. * * See {IERC165-supportsInterface}. */ function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) { // query support of both ERC165 as per the spec and support of _interfaceId return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId); } /** * @dev Returns a boolean array where each value corresponds to the * interfaces passed in and whether they're supported or not. This allows * you to batch check interfaces for a contract where your expectation * is that some interfaces may not be supported. * * See {IERC165-supportsInterface}. * * _Available since v3.4._ */ function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool[] memory) { // an array of booleans corresponding to interfaceIds and whether they're supported or not bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length); // query support of ERC165 itself if (supportsERC165(account)) { // query support of each interface in interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]); } } return interfaceIdsSupported; } /** * @dev Returns true if `account` supports all the interfaces defined in * `interfaceIds`. Support for {IERC165} itself is queried automatically. * * Batch-querying can lead to gas savings by skipping repeated checks for * {IERC165} support. * * See {IERC165-supportsInterface}. */ function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) { // query support of ERC165 itself if (!supportsERC165(account)) { return false; } // query support of each interface in interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) { return false; } } // all interfaces supported return true; } /** * @notice Query if a contract implements an interface, does not check ERC165 support * @param account The address of the contract to query for support of an interface * @param interfaceId The interface identifier, as specified in ERC-165 * @return true if the contract at account indicates support of the interface with * identifier interfaceId, false otherwise * @dev Assumes that account contains a contract that supports ERC165, otherwise * the behavior of this method is undefined. This precondition can be checked * with {supportsERC165}. * Interface identification is specified in ERC-165. */ function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) { // prepare call bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId); // perform static call bool success; uint256 returnSize; uint256 returnValue; assembly { success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20) returnSize := returndatasize() returnValue := mload(0x00) } return success && returnSize >= 0x20 && returnValue > 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { /** * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns * true if supplied registrant address is not registered. */ function isOperatorAllowed(address registrant, address operator) external view returns (bool); /** * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner. */ function register(address registrant) external; /** * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes. */ function registerAndSubscribe(address registrant, address subscription) external; /** * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another * address without subscribing. */ function registerAndCopyEntries(address registrant, address registrantToCopy) external; /** * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner. * Note that this does not remove any filtered addresses or codeHashes. * Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes. */ function unregister(address addr) external; /** * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered. */ function updateOperator(address registrant, address operator, bool filtered) external; /** * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates. */ function updateOperators(address registrant, address[] calldata operators, bool filtered) external; /** * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered. */ function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; /** * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates. */ function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; /** * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous * subscription if present. * Note that accounts with subscriptions may go on to subscribe to other accounts - in this case, * subscriptions will not be forwarded. Instead the former subscription's existing entries will still be * used. */ function subscribe(address registrant, address registrantToSubscribe) external; /** * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes. */ function unsubscribe(address registrant, bool copyExistingEntries) external; /** * @notice Get the subscription address of a given registrant, if any. */ function subscriptionOf(address addr) external returns (address registrant); /** * @notice Get the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscribers(address registrant) external returns (address[] memory); /** * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscriberAt(address registrant, uint256 index) external returns (address); /** * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr. */ function copyEntriesOf(address registrant, address registrantToCopy) external; /** * @notice Returns true if operator is filtered by a given address or its subscription. */ function isOperatorFiltered(address registrant, address operator) external returns (bool); /** * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription. */ function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); /** * @notice Returns true if a codeHash is filtered by a given address or its subscription. */ function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); /** * @notice Returns a list of filtered operators for a given address or its subscription. */ function filteredOperators(address addr) external returns (address[] memory); /** * @notice Returns the set of filtered codeHashes for a given address or its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashes(address addr) external returns (bytes32[] memory); /** * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredOperatorAt(address registrant, uint256 index) external returns (address); /** * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); /** * @notice Returns true if an address has registered */ function isRegistered(address addr) external returns (bool); /** * @dev Convenience method to compute the code hash of an arbitrary contract */ function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @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 ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings 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. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); 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) { _requireMinted(tokenId); 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 overridden 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 = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); 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: caller is not token owner or 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: caller is not token owner or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @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 _ownerOf(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) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @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(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {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 Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @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 IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256, /* firstTokenId */ uint256 batchSize ) internal virtual { if (batchSize > 1) { if (from != address(0)) { _balances[from] -= batchSize; } if (to != address(0)) { _balances[to] += batchSize; } } } /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @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 Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { 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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @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 ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @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`. * * 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; /** * @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 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * 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 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 the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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 IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address payable","name":"_royaltyReceiver","type":"address"},{"internalType":"uint96","name":"_feePercentInBIPS","type":"uint96"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"string","name":"message","type":"string"}],"name":"ErrorMessage","type":"error"},{"inputs":[{"internalType":"uint256","name":"sent","type":"uint256"},{"internalType":"uint256","name":"expected","type":"uint256"}],"name":"ErrorPrice","type":"error"},{"inputs":[],"name":"NoZeroAddress","type":"error"},{"inputs":[],"name":"NoZeroValues","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"PresaleDisabled","type":"error"},{"inputs":[],"name":"TreasuryError","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"value","type":"address"}],"name":"CrystalSet","type":"event"},{"anonymous":false,"inputs":[],"name":"Initiated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MintSelected","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint128","name":"price","type":"uint128"},{"indexed":true,"internalType":"uint32","name":"tokensPerCrystal","type":"uint32"}],"name":"PreSaleConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"SetMaxSupply","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"treasury","type":"address"}],"name":"TreasurySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"UpdatedDefaultRoyalty","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"UpdatedTokenRoyalty","type":"event"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crystal","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"__contractURI","type":"string"}],"name":"initCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxItemsPerTx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amount","type":"uint256[]"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"mintCrystalHolders","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"mintPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"totalAllocation","type":"uint256"},{"internalType":"bytes32","name":"leaf","type":"bytes32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintSelected","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleConfig","outputs":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint32","name":"tokensPerCrystal","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleConfig","outputs":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint32","name":"tokensPerTransaction","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseTokenURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_value","type":"address"}],"name":"setCrystal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"result","type":"bool"},{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setMintSelectedActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_price","type":"uint128"},{"internalType":"uint32","name":"_tokensPerCrystal","type":"uint32"}],"name":"setPresaleConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_price","type":"uint128"},{"internalType":"uint32","name":"_tokensPerTransaction","type":"uint32"}],"name":"setPublicSaleConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"suffix","type":"string"}],"name":"setSuffix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalSupply","type":"uint256"}],"name":"setTotalSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferToTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"bytes32","name":"leaf","type":"bytes32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}]
Contract Creation Code
611771600a55610bb9600b5566470de4df8200006080819052600060a052601180546001600160a01b03199081169092179055600260155561010060405267015181ff25a9800060c052600460e0526018805490911670040000000000000000015181ff25a980001790553480156200007757600080fd5b50604051620038c5380380620038c58339810160408190526200009a91620003e2565b604080518082018252601481527f416476656e747572657273204f66204574686572000000000000000000000000602080830191909152825180840190935260038352624b4f4560e81b9083015290733cc6cdda760b79bafa08df41ecfa224f810dceb660016daaeb6d7670e522a718067333cd4e3b15620002455780156200019357604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200017457600080fd5b505af115801562000189573d6000803e3d6000fd5b5050505062000245565b6001600160a01b03821615620001e45760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440162000159565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b1580156200022b57600080fd5b505af115801562000240573d6000803e3d6000fd5b505050505b50620002539050336200028d565b6001620002618382620004dc565b506002620002708282620004dc565b505050620002858282620002dd60201b60201c565b5050620005a8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6127106001600160601b0382161115620003515760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620003a95760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640162000348565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600755565b60008060408385031215620003f657600080fd5b82516001600160a01b03811681146200040e57600080fd5b60208401519092506001600160601b03811681146200042c57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200046257607f821691505b6020821081036200048357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d757600081815260208120601f850160051c81016020861015620004b25750805b601f850160051c820191505b81811015620004d357828155600101620004be565b5050505b505050565b81516001600160401b03811115620004f857620004f862000437565b62000510816200050984546200044d565b8462000489565b602080601f8311600181146200054857600084156200052f5750858301515b600019600386901b1c1916600185901b178555620004d3565b600085815260208120601f198616915b82811015620005795788860151825594840194600190910190840162000558565b5085821015620005985787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61330d80620005b86000396000f3fe6080604052600436106102935760003560e01c8063715018a61161015a578063b88d4fde116100c1578063e985e9c51161007a578063e985e9c514610803578063efd0cbf914610823578063f0f4426014610836578063f2fde38b14610856578063f7ea7a3d14610876578063fd88fa691461089657600080fd5b8063b88d4fde14610758578063b8df5d7d14610778578063c87b56dd14610798578063d5abeb01146107b8578063db398744146107ce578063e8a3d485146107ee57600080fd5b80639305561411610113578063930556141461067d57806395d89b411461069d578063971a9091146106b2578063a22cb465146106d2578063a3fd2c44146106f2578063aa767a8c1461074557600080fd5b8063715018a6146105d757806375d5ae9f146105ec5780637c88e3d91461060c5780637cb647591461062c57806384268ac91461064c5780638da5cb5b1461065f57600080fd5b806341f43434116101fe57806361d027b3116101b757806361d027b3146105225780636352211e1461054257806367433b18146105625780636f8b44b0146105825780636ff86162146105a257806370a08231146105b757600080fd5b806341f434341461045f57806342842e0e1461048157806342966c68146104a15780634f6ccce7146104c157806355f804b3146104e25780635944c7531461050257600080fd5b80631eb92fed116102505780631eb92fed1461038757806323b872dd146103a75780632a55205a146103c75780632f745c591461040657806330666a4d146104295780633423e5481461043f57600080fd5b806301ffc9a71461029857806304634d8d146102cd57806306fdde03146102ef578063081812fc14610311578063095ea7b31461034957806318160ddd14610369575b600080fd5b3480156102a457600080fd5b506102b86102b3366004612871565b6108c5565b60405190151581526020015b60405180910390f35b3480156102d957600080fd5b506102ed6102e83660046128bf565b61094d565b005b3480156102fb57600080fd5b506103046109a2565b6040516102c49190612944565b34801561031d57600080fd5b5061033161032c366004612957565b610a34565b6040516001600160a01b0390911681526020016102c4565b34801561035557600080fd5b506102ed610364366004612970565b610a5b565b34801561037557600080fd5b5060005b6040519081526020016102c4565b34801561039357600080fd5b506102ed6103a236600461299c565b610a74565b3480156103b357600080fd5b506102ed6103c23660046129ea565b610ad7565b3480156103d357600080fd5b506103e76103e2366004612a2b565b610b02565b604080516001600160a01b0390931683526020830191909152016102c4565b34801561041257600080fd5b50610379610421366004612970565b600092915050565b34801561043557600080fd5b5061037960155481565b34801561044b57600080fd5b506102b861045a366004612b23565b610bae565b34801561046b57600080fd5b506103316daaeb6d7670e522a718067333cd4e81565b34801561048d57600080fd5b506102ed61049c3660046129ea565b610bc3565b3480156104ad57600080fd5b506102ed6104bc366004612957565b610be8565b3480156104cd57600080fd5b506103796104dc366004612957565b50600090565b3480156104ee57600080fd5b506102ed6104fd366004612bcb565b610bfc565b34801561050e57600080fd5b506102ed61051d366004612c14565b610c14565b34801561052e57600080fd5b50600c54610331906001600160a01b031681565b34801561054e57600080fd5b5061033161055d366004612957565b610c6d565b34801561056e57600080fd5b506102ed61057d366004612bcb565b610cd2565b34801561058e57600080fd5b506102ed61059d366004612957565b610d13565b3480156105ae57600080fd5b506102ed610d9e565b3480156105c357600080fd5b506103796105d2366004612c52565b610e43565b3480156105e357600080fd5b506102ed610ec9565b3480156105f857600080fd5b506102ed610607366004612bcb565b610edd565b34801561061857600080fd5b506102ed610627366004612c6f565b610ef1565b34801561063857600080fd5b506102ed610647366004612957565b610f53565b6102ed61065a366004612d31565b610f60565b34801561066b57600080fd5b506000546001600160a01b0316610331565b34801561068957600080fd5b506102ed610698366004612c52565b611209565b3480156106a957600080fd5b5061030461136d565b3480156106be57600080fd5b50601754610331906001600160a01b031681565b3480156106de57600080fd5b506102ed6106ed366004612d99565b61137c565b3480156106fe57600080fd5b50601154610721906001600160801b03811690600160801b900463ffffffff1682565b604080516001600160801b03909316835263ffffffff9091166020830152016102c4565b6102ed610753366004612a2b565b611390565b34801561076457600080fd5b506102ed610773366004612dc7565b611562565b34801561078457600080fd5b506102ed610793366004612e3b565b611588565b3480156107a457600080fd5b506103046107b3366004612957565b6115a7565b3480156107c457600080fd5b50610379600b5481565b3480156107da57600080fd5b506102ed6107e936600461299c565b611608565b3480156107fa57600080fd5b506103046116c0565b34801561080f57600080fd5b506102b861081e366004612e59565b6116cf565b6102ed610831366004612957565b6116fd565b34801561084257600080fd5b506102ed610851366004612c52565b611834565b34801561086257600080fd5b506102ed610871366004612c52565b61188a565b34801561088257600080fd5b506102ed610891366004612957565b611900565b3480156108a257600080fd5b50601854610721906001600160801b03811690600160801b900463ffffffff1682565b60006001600160e01b031982166380ac58cd60e01b14806108f657506001600160e01b03198216635b5e139f60e01b145b8061091157506001600160e01b0319821663780e9d6360e01b145b8061092c57506001600160e01b03198216632baae9fd60e01b145b8061094757506001600160e01b031982166301ffc9a760e01b145b92915050565b61095561190d565b61095f8282611967565b6040516001600160601b038216906001600160a01b038416907fbdb7168f5a71b01c3b3c1306756d53f4f9ea5c35b15d5c9977987ce6fd18b8fa90600090a35050565b6060600180546109b190612e87565b80601f01602080910402602001604051908101604052809291908181526020018280546109dd90612e87565b8015610a2a5780601f106109ff57610100808354040283529160200191610a2a565b820191906000526020600020905b815481529060010190602001808311610a0d57829003601f168201915b5050505050905090565b6000610a3f82611a21565b506000908152600560205260409020546001600160a01b031690565b81610a6581611a80565b610a6f8383611b39565b505050565b610a7c61190d565b6000610a89600183612ed7565b604080518082019091526001600160801b0390941680855263ffffffff909116602090940184905260118054600160801b9095026001600160a01b0319909516909117939093179092555050565b826001600160a01b0381163314610af157610af133611a80565b610afc848484611c49565b50505050565b60008281526008602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610b775750604080518082019091526007546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610b96906001600160601b031687612efb565b610ba09190612f12565b915196919550909350505050565b6000610bbb828585611c7a565b949350505050565b826001600160a01b0381163314610bdd57610bdd33611a80565b610afc848484611c90565b610bf061190d565b610bf981611cab565b50565b610c0461190d565b600f610c108282612f82565b5050565b610c1c61190d565b610c27838383611d4e565b806001600160601b0316826001600160a01b0316847ff074ee765862c88cba798fdd5514b21b45a61cb7098c4d87abc047019e7f28e760405160405180910390a4505050565b6000818152600360205260408120546001600160a01b0316806109475760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064015b60405180910390fd5b610cda61190d565b600e610ce68282612f82565b506040517fe899121c4f1c7f070ab8ee107ad3d28ff5fe98442026a1361d1c1e1ded66e38e90600090a150565b610d1b61190d565b600a548110610d625760405162461bcd60e51b81526020600482015260136024820152721b585e081cdd5c1c1b1e48195e18d959591959606a1b6044820152606401610cc9565b600b8190556040518181527f3f8118fc46e72ecde0c5e090803cad8c88e817b2f1e93e820aa9bfbf51f2468d906020015b60405180910390a150565b610da661190d565b600c546001600160a01b0316610dcf5760405163ddbadd5f60e01b815260040160405180910390fd5b600c546040516000916001600160a01b03169047908381818185875af1925050503d8060008114610e1c576040519150601f19603f3d011682016040523d82523d6000602084013e610e21565b606091505b5050905080610bf9576040516354c26e5160e11b815260040160405180910390fd5b60006001600160a01b038216610ead5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610cc9565b506001600160a01b031660009081526004602052604090205490565b610ed161190d565b610edb6000611e19565b565b610ee561190d565b600d610c108282612f82565b610ef961190d565b60005b8251811015610a6f57610f41838281518110610f1a57610f1a613042565b6020026020010151838381518110610f3457610f34613042565b6020026020010151611e69565b80610f4b81613058565b915050610efc565b610f5b61190d565b601455565b6016543414610fa15760405162461bcd60e51b815260206004820152600d60248201526c77726f6e6720616d6f756e742160981b6044820152606401610cc9565b3360009081526012602052604090205460ff166110b6576040516bffffffffffffffffffffffff193360601b16602082015260348101849052829060540160405160208183030381529060405280519060200120146110425760405162461bcd60e51b815260206004820152601760248201527f646f6e2774206d61746368204d65726b6c65206c6561660000000000000000006044820152606401610cc9565b61104f6014548383610bae565b61108e5760405162461bcd60e51b815260206004820152601060248201526f2737ba1030903b30b634b2103632b0b360811b6044820152606401610cc9565b336000908152601260209081526040808320805460ff19166001179055601390915290208390555b600084116110f85760405162461bcd60e51b815260206004820152600f60248201526e43616e2774206d696e74207a65726f60881b6044820152606401610cc9565b6015548411156111405760405162461bcd60e51b8152602060048201526013602482015272082c4deecca409ac2f092e8cadae6a0cae4a8f606b1b6044820152606401610cc9565b3360009081526013602052604090205484111561119f5760405162461bcd60e51b815260206004820152601e60248201527f6d6f7265207468616e2072656d61696e696e6720616c6c6f636174696f6e00006044820152606401610cc9565b33600090815260136020526040812080548692906111be908490613071565b909155506111ce90503385611e69565b60405184815233907fa470e09ff8ddc8c2c2e29bea4ac19db87e2f638ec2049ba53e891c70d1faf7689060200160405180910390a250505050565b61121161190d565b6001600160a01b038116158061123c575061123c6001600160a01b038216636cdb3d1360e11b611ef8565b6040518060400160405280601c81526020017f70726573616c653a2030206f722076616c696420494552433131353500000000815250906112905760405162461bcd60e51b8152600401610cc99190612944565b50601780546001600160a01b0319166001600160a01b0383169081179091551561133657806001600160a01b031663a22cb4656112d56000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260016024820152604401600060405180830381600087803b15801561131d57600080fd5b505af1158015611331573d6000803e3d6000fd5b505050505b6040516001600160a01b038216907f678ead203b6585110a621f02c7dffc8d0332253cf634630fbd2d80434c47298090600090a250565b6060600280546109b190612e87565b8161138681611a80565b610a6f8383611f1b565b604080518082019091526018546001600160801b038116808352600160801b90910463ffffffff1660208301528391906113cb908390612efb565b341461141d57604080518082018252601f81527f70726573616c653a20696e76616c6964207061796d656e7420616d6f756e74006020820152905163a183e9a560e01b8152610cc99190600401612944565b6017546001600160a01b03166114465760405163743ffa5f60e11b815260040160405180910390fd5b604080518082019091526018546001600160801b0381168252600160801b900463ffffffff166020820152841580156114885750806020015163ffffffff1685115b156114d25760408051808201825260168152751c1c995cd85b194e881a5b9d985b1a590818dbdd5b9d60521b6020820152905163a183e9a560e01b8152610cc99190600401612944565b601754604051637921219560e11b8152336004820152306024820152604481018690526001606482015260a06084820152600060a48201526001600160a01b039091169063f242432a9060c401600060405180830381600087803b15801561153957600080fd5b505af115801561154d573d6000803e3d6000fd5b5050505061155b3386611e69565b5050505050565b836001600160a01b038116331461157c5761157c33611a80565b61155b85858585611f26565b61159061190d565b6010805460ff191692151592909217909155601655565b6060600f80546115b690612e87565b90506000036115d45760405180602001604052806000815250610947565b600f6115df83611f58565b600d6040516020016115f3939291906130f7565b60405160208183030381529060405292915050565b61161061190d565b6040518060400160405280836001600160801b031681526020018260016116379190612ed7565b63ffffffff908116909152815160188054602090940151909216600160801b026001600160a01b03199093166001600160801b0390911617919091179055611680816001612ed7565b63ffffffff16826001600160801b03167f3bc95bf53fbac399303d5bca7c2b733b156534894e329012206b8fecf5152d0260405160405180910390a35050565b6060600e80546109b190612e87565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b604080518082019091526011546001600160801b0381168252600160801b900463ffffffff166020820181905261176d5760405162461bcd60e51b81526020600482015260146024820152731c1d589b1a58dcd85b194e88191a5cd8589b195960621b6044820152606401610cc9565b80516117839083906001600160801b0316612efb565b34146117d15760405162461bcd60e51b815260206004820152601a60248201527f7075626c696373616c653a207061796d656e7420616d6f756e740000000000006044820152606401610cc9565b806020015163ffffffff16821061182a5760405162461bcd60e51b815260206004820152601960248201527f7075626c696373616c653a20696e76616c696420636f756e74000000000000006044820152606401610cc9565b610c103383611e69565b61183c61190d565b600c80546001600160a01b0319166001600160a01b0383169081179091556040519081527f3c864541ef71378c6229510ed90f376565ee42d9c5e0904a984a9e863e6db44f90602001610d93565b61189261190d565b6001600160a01b0381166118f75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610cc9565b610bf981611e19565b61190861190d565b600a55565b6000546001600160a01b03163314610edb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cc9565b6127106001600160601b03821611156119925760405162461bcd60e51b8152600401610cc99061311f565b6001600160a01b0382166119e85760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610cc9565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600755565b6000818152600360205260409020546001600160a01b0316610bf95760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610cc9565b6daaeb6d7670e522a718067333cd4e3b15610bf957604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b119190613169565b610bf957604051633b79c77360e21b81526001600160a01b0382166004820152602401610cc9565b6000611b4482610c6d565b9050806001600160a01b0316836001600160a01b031603611bb15760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610cc9565b336001600160a01b0382161480611bcd5750611bcd81336116cf565b611c3f5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610cc9565b610a6f8383611feb565b611c533382612059565b611c6f5760405162461bcd60e51b8152600401610cc990613186565b610a6f8383836120b7565b600082611c878584612228565b14949350505050565b610a6f83838360405180602001604052806000815250611562565b6000611cb682610c6d565b9050611cc6816000846001612275565b611ccf82610c6d565b600083815260056020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526004845282852080546000190190558785526003909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6127106001600160601b0382161115611d795760405162461bcd60e51b8152600401610cc99061311f565b6001600160a01b038216611dcf5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610cc9565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600890529190942093519051909116600160a01b029116179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60005b81811015611ea657611e82600980546001019055565b611e9483611e8f60095490565b6122fd565b80611e9e81613058565b915050611e6c565b507f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe82611ed260095490565b604080516001600160a01b03909316835260208301919091520160405180910390a15050565b6000611f0383612496565b8015611f145750611f1483836124c9565b9392505050565b610c10338383612552565b611f303383612059565b611f4c5760405162461bcd60e51b8152600401610cc990613186565b610afc84848484612620565b60606000611f6583612653565b600101905060008167ffffffffffffffff811115611f8557611f85612a4d565b6040519080825280601f01601f191660200182016040528015611faf576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611fb957509392505050565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061202082610c6d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061206583610c6d565b9050806001600160a01b0316846001600160a01b0316148061208c575061208c81856116cf565b80610bbb5750836001600160a01b03166120a584610a34565b6001600160a01b031614949350505050565b826001600160a01b03166120ca82610c6d565b6001600160a01b0316146120f05760405162461bcd60e51b8152600401610cc9906131d3565b6001600160a01b0382166121525760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610cc9565b61215f8383836001612275565b826001600160a01b031661217282610c6d565b6001600160a01b0316146121985760405162461bcd60e51b8152600401610cc9906131d3565b600081815260056020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260048552838620805460001901905590871680865283862080546001019055868652600390945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600081815b845181101561226d576122598286838151811061224c5761224c613042565b602002602001015161272b565b91508061226581613058565b91505061222d565b509392505050565b6001811115610afc576001600160a01b038416156122bb576001600160a01b038416600090815260046020526040812080548392906122b5908490613071565b90915550505b6001600160a01b03831615610afc576001600160a01b038316600090815260046020526040812080548392906122f2908490613218565b909155505050505050565b6001600160a01b0382166123535760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610cc9565b6000818152600360205260409020546001600160a01b0316156123b85760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610cc9565b6123c6600083836001612275565b6000818152600360205260409020546001600160a01b03161561242b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610cc9565b6001600160a01b038216600081815260046020908152604080832080546001019055848352600390915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006124a9826301ffc9a760e01b6124c9565b801561094757506124c2826001600160e01b03196124c9565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d9150600051905082801561253b575060208210155b80156125475750600081115b979650505050505050565b816001600160a01b0316836001600160a01b0316036125b35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610cc9565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61262b8484846120b7565b6126378484848461275a565b610afc5760405162461bcd60e51b8152600401610cc99061322b565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106126925772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106126be576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106126dc57662386f26fc10000830492506010015b6305f5e10083106126f4576305f5e100830492506008015b612710831061270857612710830492506004015b6064831061271a576064830492506002015b600a83106109475760010192915050565b6000818310612747576000828152602084905260409020611f14565b6000838152602083905260409020611f14565b60006001600160a01b0384163b1561285057604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061279e90339089908890889060040161327d565b6020604051808303816000875af19250505080156127d9575060408051601f3d908101601f191682019092526127d6918101906132ba565b60015b612836573d808015612807576040519150601f19603f3d011682016040523d82523d6000602084013e61280c565b606091505b50805160000361282e5760405162461bcd60e51b8152600401610cc99061322b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610bbb565b506001949350505050565b6001600160e01b031981168114610bf957600080fd5b60006020828403121561288357600080fd5b8135611f148161285b565b6001600160a01b0381168114610bf957600080fd5b80356001600160601b03811681146128ba57600080fd5b919050565b600080604083850312156128d257600080fd5b82356128dd8161288e565b91506128eb602084016128a3565b90509250929050565b60005b8381101561290f5781810151838201526020016128f7565b50506000910152565b600081518084526129308160208601602086016128f4565b601f01601f19169290920160200192915050565b602081526000611f146020830184612918565b60006020828403121561296957600080fd5b5035919050565b6000806040838503121561298357600080fd5b823561298e8161288e565b946020939093013593505050565b600080604083850312156129af57600080fd5b82356001600160801b03811681146129c657600080fd5b9150602083013563ffffffff811681146129df57600080fd5b809150509250929050565b6000806000606084860312156129ff57600080fd5b8335612a0a8161288e565b92506020840135612a1a8161288e565b929592945050506040919091013590565b60008060408385031215612a3e57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612a8c57612a8c612a4d565b604052919050565b600067ffffffffffffffff821115612aae57612aae612a4d565b5060051b60200190565b600082601f830112612ac957600080fd5b81356020612ade612ad983612a94565b612a63565b82815260059290921b84018101918181019086841115612afd57600080fd5b8286015b84811015612b185780358352918301918301612b01565b509695505050505050565b600080600060608486031215612b3857600080fd5b8335925060208401359150604084013567ffffffffffffffff811115612b5d57600080fd5b612b6986828701612ab8565b9150509250925092565b600067ffffffffffffffff831115612b8d57612b8d612a4d565b612ba0601f8401601f1916602001612a63565b9050828152838383011115612bb457600080fd5b828260208301376000602084830101529392505050565b600060208284031215612bdd57600080fd5b813567ffffffffffffffff811115612bf457600080fd5b8201601f81018413612c0557600080fd5b610bbb84823560208401612b73565b600080600060608486031215612c2957600080fd5b833592506020840135612c3b8161288e565b9150612c49604085016128a3565b90509250925092565b600060208284031215612c6457600080fd5b8135611f148161288e565b60008060408385031215612c8257600080fd5b823567ffffffffffffffff80821115612c9a57600080fd5b818501915085601f830112612cae57600080fd5b81356020612cbe612ad983612a94565b82815260059290921b84018101918181019089841115612cdd57600080fd5b948201945b83861015612d04578535612cf58161288e565b82529482019490820190612ce2565b96505086013592505080821115612d1a57600080fd5b50612d2785828601612ab8565b9150509250929050565b60008060008060808587031215612d4757600080fd5b843593506020850135925060408501359150606085013567ffffffffffffffff811115612d7357600080fd5b612d7f87828801612ab8565b91505092959194509250565b8015158114610bf957600080fd5b60008060408385031215612dac57600080fd5b8235612db78161288e565b915060208301356129df81612d8b565b60008060008060808587031215612ddd57600080fd5b8435612de88161288e565b93506020850135612df88161288e565b925060408501359150606085013567ffffffffffffffff811115612e1b57600080fd5b8501601f81018713612e2c57600080fd5b612d7f87823560208401612b73565b60008060408385031215612e4e57600080fd5b823561298e81612d8b565b60008060408385031215612e6c57600080fd5b8235612e778161288e565b915060208301356129df8161288e565b600181811c90821680612e9b57607f821691505b602082108103612ebb57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b63ffffffff818116838216019080821115612ef457612ef4612ec1565b5092915050565b808202811582820484141761094757610947612ec1565b600082612f2f57634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610a6f57600081815260208120601f850160051c81016020861015612f5b5750805b601f850160051c820191505b81811015612f7a57828155600101612f67565b505050505050565b815167ffffffffffffffff811115612f9c57612f9c612a4d565b612fb081612faa8454612e87565b84612f34565b602080601f831160018114612fe55760008415612fcd5750858301515b600019600386901b1c1916600185901b178555612f7a565b600085815260208120601f198616915b8281101561301457888601518255948401946001909101908401612ff5565b50858210156130325787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b60006001820161306a5761306a612ec1565b5060010190565b8181038181111561094757610947612ec1565b6000815461309181612e87565b600182811680156130a957600181146130be576130ed565b60ff19841687528215158302870194506130ed565b8560005260208060002060005b858110156130e45781548a8201529084019082016130cb565b50505082870194505b5050505092915050565b60006131038286613084565b84516131138183602089016128f4565b61254781830186613084565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b60006020828403121561317b57600080fd5b8151611f1481612d8b565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b8082018082111561094757610947612ec1565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906132b090830184612918565b9695505050505050565b6000602082840312156132cc57600080fd5b8151611f148161285b56fea2646970667358221220c8cd8b12b12316812b33b5d57ba5e4d76f4841518bdfcaedd57433fb8e1fb1d164736f6c63430008110033000000000000000000000000472706fccd94bdb5070438fb04b633f1e6921d7400000000000000000000000000000000000000000000000000000000000001c2
Deployed Bytecode
0x6080604052600436106102935760003560e01c8063715018a61161015a578063b88d4fde116100c1578063e985e9c51161007a578063e985e9c514610803578063efd0cbf914610823578063f0f4426014610836578063f2fde38b14610856578063f7ea7a3d14610876578063fd88fa691461089657600080fd5b8063b88d4fde14610758578063b8df5d7d14610778578063c87b56dd14610798578063d5abeb01146107b8578063db398744146107ce578063e8a3d485146107ee57600080fd5b80639305561411610113578063930556141461067d57806395d89b411461069d578063971a9091146106b2578063a22cb465146106d2578063a3fd2c44146106f2578063aa767a8c1461074557600080fd5b8063715018a6146105d757806375d5ae9f146105ec5780637c88e3d91461060c5780637cb647591461062c57806384268ac91461064c5780638da5cb5b1461065f57600080fd5b806341f43434116101fe57806361d027b3116101b757806361d027b3146105225780636352211e1461054257806367433b18146105625780636f8b44b0146105825780636ff86162146105a257806370a08231146105b757600080fd5b806341f434341461045f57806342842e0e1461048157806342966c68146104a15780634f6ccce7146104c157806355f804b3146104e25780635944c7531461050257600080fd5b80631eb92fed116102505780631eb92fed1461038757806323b872dd146103a75780632a55205a146103c75780632f745c591461040657806330666a4d146104295780633423e5481461043f57600080fd5b806301ffc9a71461029857806304634d8d146102cd57806306fdde03146102ef578063081812fc14610311578063095ea7b31461034957806318160ddd14610369575b600080fd5b3480156102a457600080fd5b506102b86102b3366004612871565b6108c5565b60405190151581526020015b60405180910390f35b3480156102d957600080fd5b506102ed6102e83660046128bf565b61094d565b005b3480156102fb57600080fd5b506103046109a2565b6040516102c49190612944565b34801561031d57600080fd5b5061033161032c366004612957565b610a34565b6040516001600160a01b0390911681526020016102c4565b34801561035557600080fd5b506102ed610364366004612970565b610a5b565b34801561037557600080fd5b5060005b6040519081526020016102c4565b34801561039357600080fd5b506102ed6103a236600461299c565b610a74565b3480156103b357600080fd5b506102ed6103c23660046129ea565b610ad7565b3480156103d357600080fd5b506103e76103e2366004612a2b565b610b02565b604080516001600160a01b0390931683526020830191909152016102c4565b34801561041257600080fd5b50610379610421366004612970565b600092915050565b34801561043557600080fd5b5061037960155481565b34801561044b57600080fd5b506102b861045a366004612b23565b610bae565b34801561046b57600080fd5b506103316daaeb6d7670e522a718067333cd4e81565b34801561048d57600080fd5b506102ed61049c3660046129ea565b610bc3565b3480156104ad57600080fd5b506102ed6104bc366004612957565b610be8565b3480156104cd57600080fd5b506103796104dc366004612957565b50600090565b3480156104ee57600080fd5b506102ed6104fd366004612bcb565b610bfc565b34801561050e57600080fd5b506102ed61051d366004612c14565b610c14565b34801561052e57600080fd5b50600c54610331906001600160a01b031681565b34801561054e57600080fd5b5061033161055d366004612957565b610c6d565b34801561056e57600080fd5b506102ed61057d366004612bcb565b610cd2565b34801561058e57600080fd5b506102ed61059d366004612957565b610d13565b3480156105ae57600080fd5b506102ed610d9e565b3480156105c357600080fd5b506103796105d2366004612c52565b610e43565b3480156105e357600080fd5b506102ed610ec9565b3480156105f857600080fd5b506102ed610607366004612bcb565b610edd565b34801561061857600080fd5b506102ed610627366004612c6f565b610ef1565b34801561063857600080fd5b506102ed610647366004612957565b610f53565b6102ed61065a366004612d31565b610f60565b34801561066b57600080fd5b506000546001600160a01b0316610331565b34801561068957600080fd5b506102ed610698366004612c52565b611209565b3480156106a957600080fd5b5061030461136d565b3480156106be57600080fd5b50601754610331906001600160a01b031681565b3480156106de57600080fd5b506102ed6106ed366004612d99565b61137c565b3480156106fe57600080fd5b50601154610721906001600160801b03811690600160801b900463ffffffff1682565b604080516001600160801b03909316835263ffffffff9091166020830152016102c4565b6102ed610753366004612a2b565b611390565b34801561076457600080fd5b506102ed610773366004612dc7565b611562565b34801561078457600080fd5b506102ed610793366004612e3b565b611588565b3480156107a457600080fd5b506103046107b3366004612957565b6115a7565b3480156107c457600080fd5b50610379600b5481565b3480156107da57600080fd5b506102ed6107e936600461299c565b611608565b3480156107fa57600080fd5b506103046116c0565b34801561080f57600080fd5b506102b861081e366004612e59565b6116cf565b6102ed610831366004612957565b6116fd565b34801561084257600080fd5b506102ed610851366004612c52565b611834565b34801561086257600080fd5b506102ed610871366004612c52565b61188a565b34801561088257600080fd5b506102ed610891366004612957565b611900565b3480156108a257600080fd5b50601854610721906001600160801b03811690600160801b900463ffffffff1682565b60006001600160e01b031982166380ac58cd60e01b14806108f657506001600160e01b03198216635b5e139f60e01b145b8061091157506001600160e01b0319821663780e9d6360e01b145b8061092c57506001600160e01b03198216632baae9fd60e01b145b8061094757506001600160e01b031982166301ffc9a760e01b145b92915050565b61095561190d565b61095f8282611967565b6040516001600160601b038216906001600160a01b038416907fbdb7168f5a71b01c3b3c1306756d53f4f9ea5c35b15d5c9977987ce6fd18b8fa90600090a35050565b6060600180546109b190612e87565b80601f01602080910402602001604051908101604052809291908181526020018280546109dd90612e87565b8015610a2a5780601f106109ff57610100808354040283529160200191610a2a565b820191906000526020600020905b815481529060010190602001808311610a0d57829003601f168201915b5050505050905090565b6000610a3f82611a21565b506000908152600560205260409020546001600160a01b031690565b81610a6581611a80565b610a6f8383611b39565b505050565b610a7c61190d565b6000610a89600183612ed7565b604080518082019091526001600160801b0390941680855263ffffffff909116602090940184905260118054600160801b9095026001600160a01b0319909516909117939093179092555050565b826001600160a01b0381163314610af157610af133611a80565b610afc848484611c49565b50505050565b60008281526008602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610b775750604080518082019091526007546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610b96906001600160601b031687612efb565b610ba09190612f12565b915196919550909350505050565b6000610bbb828585611c7a565b949350505050565b826001600160a01b0381163314610bdd57610bdd33611a80565b610afc848484611c90565b610bf061190d565b610bf981611cab565b50565b610c0461190d565b600f610c108282612f82565b5050565b610c1c61190d565b610c27838383611d4e565b806001600160601b0316826001600160a01b0316847ff074ee765862c88cba798fdd5514b21b45a61cb7098c4d87abc047019e7f28e760405160405180910390a4505050565b6000818152600360205260408120546001600160a01b0316806109475760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064015b60405180910390fd5b610cda61190d565b600e610ce68282612f82565b506040517fe899121c4f1c7f070ab8ee107ad3d28ff5fe98442026a1361d1c1e1ded66e38e90600090a150565b610d1b61190d565b600a548110610d625760405162461bcd60e51b81526020600482015260136024820152721b585e081cdd5c1c1b1e48195e18d959591959606a1b6044820152606401610cc9565b600b8190556040518181527f3f8118fc46e72ecde0c5e090803cad8c88e817b2f1e93e820aa9bfbf51f2468d906020015b60405180910390a150565b610da661190d565b600c546001600160a01b0316610dcf5760405163ddbadd5f60e01b815260040160405180910390fd5b600c546040516000916001600160a01b03169047908381818185875af1925050503d8060008114610e1c576040519150601f19603f3d011682016040523d82523d6000602084013e610e21565b606091505b5050905080610bf9576040516354c26e5160e11b815260040160405180910390fd5b60006001600160a01b038216610ead5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610cc9565b506001600160a01b031660009081526004602052604090205490565b610ed161190d565b610edb6000611e19565b565b610ee561190d565b600d610c108282612f82565b610ef961190d565b60005b8251811015610a6f57610f41838281518110610f1a57610f1a613042565b6020026020010151838381518110610f3457610f34613042565b6020026020010151611e69565b80610f4b81613058565b915050610efc565b610f5b61190d565b601455565b6016543414610fa15760405162461bcd60e51b815260206004820152600d60248201526c77726f6e6720616d6f756e742160981b6044820152606401610cc9565b3360009081526012602052604090205460ff166110b6576040516bffffffffffffffffffffffff193360601b16602082015260348101849052829060540160405160208183030381529060405280519060200120146110425760405162461bcd60e51b815260206004820152601760248201527f646f6e2774206d61746368204d65726b6c65206c6561660000000000000000006044820152606401610cc9565b61104f6014548383610bae565b61108e5760405162461bcd60e51b815260206004820152601060248201526f2737ba1030903b30b634b2103632b0b360811b6044820152606401610cc9565b336000908152601260209081526040808320805460ff19166001179055601390915290208390555b600084116110f85760405162461bcd60e51b815260206004820152600f60248201526e43616e2774206d696e74207a65726f60881b6044820152606401610cc9565b6015548411156111405760405162461bcd60e51b8152602060048201526013602482015272082c4deecca409ac2f092e8cadae6a0cae4a8f606b1b6044820152606401610cc9565b3360009081526013602052604090205484111561119f5760405162461bcd60e51b815260206004820152601e60248201527f6d6f7265207468616e2072656d61696e696e6720616c6c6f636174696f6e00006044820152606401610cc9565b33600090815260136020526040812080548692906111be908490613071565b909155506111ce90503385611e69565b60405184815233907fa470e09ff8ddc8c2c2e29bea4ac19db87e2f638ec2049ba53e891c70d1faf7689060200160405180910390a250505050565b61121161190d565b6001600160a01b038116158061123c575061123c6001600160a01b038216636cdb3d1360e11b611ef8565b6040518060400160405280601c81526020017f70726573616c653a2030206f722076616c696420494552433131353500000000815250906112905760405162461bcd60e51b8152600401610cc99190612944565b50601780546001600160a01b0319166001600160a01b0383169081179091551561133657806001600160a01b031663a22cb4656112d56000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260016024820152604401600060405180830381600087803b15801561131d57600080fd5b505af1158015611331573d6000803e3d6000fd5b505050505b6040516001600160a01b038216907f678ead203b6585110a621f02c7dffc8d0332253cf634630fbd2d80434c47298090600090a250565b6060600280546109b190612e87565b8161138681611a80565b610a6f8383611f1b565b604080518082019091526018546001600160801b038116808352600160801b90910463ffffffff1660208301528391906113cb908390612efb565b341461141d57604080518082018252601f81527f70726573616c653a20696e76616c6964207061796d656e7420616d6f756e74006020820152905163a183e9a560e01b8152610cc99190600401612944565b6017546001600160a01b03166114465760405163743ffa5f60e11b815260040160405180910390fd5b604080518082019091526018546001600160801b0381168252600160801b900463ffffffff166020820152841580156114885750806020015163ffffffff1685115b156114d25760408051808201825260168152751c1c995cd85b194e881a5b9d985b1a590818dbdd5b9d60521b6020820152905163a183e9a560e01b8152610cc99190600401612944565b601754604051637921219560e11b8152336004820152306024820152604481018690526001606482015260a06084820152600060a48201526001600160a01b039091169063f242432a9060c401600060405180830381600087803b15801561153957600080fd5b505af115801561154d573d6000803e3d6000fd5b5050505061155b3386611e69565b5050505050565b836001600160a01b038116331461157c5761157c33611a80565b61155b85858585611f26565b61159061190d565b6010805460ff191692151592909217909155601655565b6060600f80546115b690612e87565b90506000036115d45760405180602001604052806000815250610947565b600f6115df83611f58565b600d6040516020016115f3939291906130f7565b60405160208183030381529060405292915050565b61161061190d565b6040518060400160405280836001600160801b031681526020018260016116379190612ed7565b63ffffffff908116909152815160188054602090940151909216600160801b026001600160a01b03199093166001600160801b0390911617919091179055611680816001612ed7565b63ffffffff16826001600160801b03167f3bc95bf53fbac399303d5bca7c2b733b156534894e329012206b8fecf5152d0260405160405180910390a35050565b6060600e80546109b190612e87565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b604080518082019091526011546001600160801b0381168252600160801b900463ffffffff166020820181905261176d5760405162461bcd60e51b81526020600482015260146024820152731c1d589b1a58dcd85b194e88191a5cd8589b195960621b6044820152606401610cc9565b80516117839083906001600160801b0316612efb565b34146117d15760405162461bcd60e51b815260206004820152601a60248201527f7075626c696373616c653a207061796d656e7420616d6f756e740000000000006044820152606401610cc9565b806020015163ffffffff16821061182a5760405162461bcd60e51b815260206004820152601960248201527f7075626c696373616c653a20696e76616c696420636f756e74000000000000006044820152606401610cc9565b610c103383611e69565b61183c61190d565b600c80546001600160a01b0319166001600160a01b0383169081179091556040519081527f3c864541ef71378c6229510ed90f376565ee42d9c5e0904a984a9e863e6db44f90602001610d93565b61189261190d565b6001600160a01b0381166118f75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610cc9565b610bf981611e19565b61190861190d565b600a55565b6000546001600160a01b03163314610edb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cc9565b6127106001600160601b03821611156119925760405162461bcd60e51b8152600401610cc99061311f565b6001600160a01b0382166119e85760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610cc9565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600755565b6000818152600360205260409020546001600160a01b0316610bf95760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610cc9565b6daaeb6d7670e522a718067333cd4e3b15610bf957604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b119190613169565b610bf957604051633b79c77360e21b81526001600160a01b0382166004820152602401610cc9565b6000611b4482610c6d565b9050806001600160a01b0316836001600160a01b031603611bb15760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610cc9565b336001600160a01b0382161480611bcd5750611bcd81336116cf565b611c3f5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610cc9565b610a6f8383611feb565b611c533382612059565b611c6f5760405162461bcd60e51b8152600401610cc990613186565b610a6f8383836120b7565b600082611c878584612228565b14949350505050565b610a6f83838360405180602001604052806000815250611562565b6000611cb682610c6d565b9050611cc6816000846001612275565b611ccf82610c6d565b600083815260056020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526004845282852080546000190190558785526003909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6127106001600160601b0382161115611d795760405162461bcd60e51b8152600401610cc99061311f565b6001600160a01b038216611dcf5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610cc9565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600890529190942093519051909116600160a01b029116179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60005b81811015611ea657611e82600980546001019055565b611e9483611e8f60095490565b6122fd565b80611e9e81613058565b915050611e6c565b507f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe82611ed260095490565b604080516001600160a01b03909316835260208301919091520160405180910390a15050565b6000611f0383612496565b8015611f145750611f1483836124c9565b9392505050565b610c10338383612552565b611f303383612059565b611f4c5760405162461bcd60e51b8152600401610cc990613186565b610afc84848484612620565b60606000611f6583612653565b600101905060008167ffffffffffffffff811115611f8557611f85612a4d565b6040519080825280601f01601f191660200182016040528015611faf576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611fb957509392505050565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061202082610c6d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061206583610c6d565b9050806001600160a01b0316846001600160a01b0316148061208c575061208c81856116cf565b80610bbb5750836001600160a01b03166120a584610a34565b6001600160a01b031614949350505050565b826001600160a01b03166120ca82610c6d565b6001600160a01b0316146120f05760405162461bcd60e51b8152600401610cc9906131d3565b6001600160a01b0382166121525760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610cc9565b61215f8383836001612275565b826001600160a01b031661217282610c6d565b6001600160a01b0316146121985760405162461bcd60e51b8152600401610cc9906131d3565b600081815260056020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260048552838620805460001901905590871680865283862080546001019055868652600390945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600081815b845181101561226d576122598286838151811061224c5761224c613042565b602002602001015161272b565b91508061226581613058565b91505061222d565b509392505050565b6001811115610afc576001600160a01b038416156122bb576001600160a01b038416600090815260046020526040812080548392906122b5908490613071565b90915550505b6001600160a01b03831615610afc576001600160a01b038316600090815260046020526040812080548392906122f2908490613218565b909155505050505050565b6001600160a01b0382166123535760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610cc9565b6000818152600360205260409020546001600160a01b0316156123b85760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610cc9565b6123c6600083836001612275565b6000818152600360205260409020546001600160a01b03161561242b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610cc9565b6001600160a01b038216600081815260046020908152604080832080546001019055848352600390915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006124a9826301ffc9a760e01b6124c9565b801561094757506124c2826001600160e01b03196124c9565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d9150600051905082801561253b575060208210155b80156125475750600081115b979650505050505050565b816001600160a01b0316836001600160a01b0316036125b35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610cc9565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61262b8484846120b7565b6126378484848461275a565b610afc5760405162461bcd60e51b8152600401610cc99061322b565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106126925772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106126be576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106126dc57662386f26fc10000830492506010015b6305f5e10083106126f4576305f5e100830492506008015b612710831061270857612710830492506004015b6064831061271a576064830492506002015b600a83106109475760010192915050565b6000818310612747576000828152602084905260409020611f14565b6000838152602083905260409020611f14565b60006001600160a01b0384163b1561285057604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061279e90339089908890889060040161327d565b6020604051808303816000875af19250505080156127d9575060408051601f3d908101601f191682019092526127d6918101906132ba565b60015b612836573d808015612807576040519150601f19603f3d011682016040523d82523d6000602084013e61280c565b606091505b50805160000361282e5760405162461bcd60e51b8152600401610cc99061322b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610bbb565b506001949350505050565b6001600160e01b031981168114610bf957600080fd5b60006020828403121561288357600080fd5b8135611f148161285b565b6001600160a01b0381168114610bf957600080fd5b80356001600160601b03811681146128ba57600080fd5b919050565b600080604083850312156128d257600080fd5b82356128dd8161288e565b91506128eb602084016128a3565b90509250929050565b60005b8381101561290f5781810151838201526020016128f7565b50506000910152565b600081518084526129308160208601602086016128f4565b601f01601f19169290920160200192915050565b602081526000611f146020830184612918565b60006020828403121561296957600080fd5b5035919050565b6000806040838503121561298357600080fd5b823561298e8161288e565b946020939093013593505050565b600080604083850312156129af57600080fd5b82356001600160801b03811681146129c657600080fd5b9150602083013563ffffffff811681146129df57600080fd5b809150509250929050565b6000806000606084860312156129ff57600080fd5b8335612a0a8161288e565b92506020840135612a1a8161288e565b929592945050506040919091013590565b60008060408385031215612a3e57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612a8c57612a8c612a4d565b604052919050565b600067ffffffffffffffff821115612aae57612aae612a4d565b5060051b60200190565b600082601f830112612ac957600080fd5b81356020612ade612ad983612a94565b612a63565b82815260059290921b84018101918181019086841115612afd57600080fd5b8286015b84811015612b185780358352918301918301612b01565b509695505050505050565b600080600060608486031215612b3857600080fd5b8335925060208401359150604084013567ffffffffffffffff811115612b5d57600080fd5b612b6986828701612ab8565b9150509250925092565b600067ffffffffffffffff831115612b8d57612b8d612a4d565b612ba0601f8401601f1916602001612a63565b9050828152838383011115612bb457600080fd5b828260208301376000602084830101529392505050565b600060208284031215612bdd57600080fd5b813567ffffffffffffffff811115612bf457600080fd5b8201601f81018413612c0557600080fd5b610bbb84823560208401612b73565b600080600060608486031215612c2957600080fd5b833592506020840135612c3b8161288e565b9150612c49604085016128a3565b90509250925092565b600060208284031215612c6457600080fd5b8135611f148161288e565b60008060408385031215612c8257600080fd5b823567ffffffffffffffff80821115612c9a57600080fd5b818501915085601f830112612cae57600080fd5b81356020612cbe612ad983612a94565b82815260059290921b84018101918181019089841115612cdd57600080fd5b948201945b83861015612d04578535612cf58161288e565b82529482019490820190612ce2565b96505086013592505080821115612d1a57600080fd5b50612d2785828601612ab8565b9150509250929050565b60008060008060808587031215612d4757600080fd5b843593506020850135925060408501359150606085013567ffffffffffffffff811115612d7357600080fd5b612d7f87828801612ab8565b91505092959194509250565b8015158114610bf957600080fd5b60008060408385031215612dac57600080fd5b8235612db78161288e565b915060208301356129df81612d8b565b60008060008060808587031215612ddd57600080fd5b8435612de88161288e565b93506020850135612df88161288e565b925060408501359150606085013567ffffffffffffffff811115612e1b57600080fd5b8501601f81018713612e2c57600080fd5b612d7f87823560208401612b73565b60008060408385031215612e4e57600080fd5b823561298e81612d8b565b60008060408385031215612e6c57600080fd5b8235612e778161288e565b915060208301356129df8161288e565b600181811c90821680612e9b57607f821691505b602082108103612ebb57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b63ffffffff818116838216019080821115612ef457612ef4612ec1565b5092915050565b808202811582820484141761094757610947612ec1565b600082612f2f57634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610a6f57600081815260208120601f850160051c81016020861015612f5b5750805b601f850160051c820191505b81811015612f7a57828155600101612f67565b505050505050565b815167ffffffffffffffff811115612f9c57612f9c612a4d565b612fb081612faa8454612e87565b84612f34565b602080601f831160018114612fe55760008415612fcd5750858301515b600019600386901b1c1916600185901b178555612f7a565b600085815260208120601f198616915b8281101561301457888601518255948401946001909101908401612ff5565b50858210156130325787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b60006001820161306a5761306a612ec1565b5060010190565b8181038181111561094757610947612ec1565b6000815461309181612e87565b600182811680156130a957600181146130be576130ed565b60ff19841687528215158302870194506130ed565b8560005260208060002060005b858110156130e45781548a8201529084019082016130cb565b50505082870194505b5050505092915050565b60006131038286613084565b84516131138183602089016128f4565b61254781830186613084565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b60006020828403121561317b57600080fd5b8151611f1481612d8b565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b8082018082111561094757610947612ec1565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906132b090830184612918565b9695505050505050565b6000602082840312156132cc57600080fd5b8151611f148161285b56fea2646970667358221220c8cd8b12b12316812b33b5d57ba5e4d76f4841518bdfcaedd57433fb8e1fb1d164736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000472706fccd94bdb5070438fb04b633f1e6921d7400000000000000000000000000000000000000000000000000000000000001c2
-----Decoded View---------------
Arg [0] : _royaltyReceiver (address): 0x472706fcCD94BDb5070438Fb04B633F1e6921d74
Arg [1] : _feePercentInBIPS (uint96): 450
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000472706fccd94bdb5070438fb04b633f1e6921d74
Arg [1] : 00000000000000000000000000000000000000000000000000000000000001c2
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.