ERC-721
NFT
Overview
Max Total Supply
1,500 CENT_AAA
Holders
426
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 CENT_AAALoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
GenesisMint
Compiler Version
v0.8.15+commit.e14f2714
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.15; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./GenesisStorage.sol"; /// @title Centaurify Collection AAA - GenesisMint.sol /// @author @dadogg80 - Viken Blockchain Solutions. /// @notice This is the Centaurify Genesis Mint smart contract used for the Collection AAA. /// @notice This smart contract is built on the ERC721A smart contract from ChiruLabs for cheaper batch minting and better fee optimisation. /// @dev Link to ERC721a docs - { https://chiru-labs.github.io/ERC721A/#/ }. /// @dev Supports ERC2981 Royalty Standard. /// @dev Supports OpenSea's - Royalty Standard { https://docs.opensea.io/docs/contract-level-metadata }. contract GenesisMint is GenesisStorage { // @notice Constructor arguments to be passed at the deployment of this contract // @param __contractURI Read { https://docs.opensea.io/docs/contract-level-metadata } for more information. // @param _operator The _operator is the relayer address that will initiate the { setPhase*MintValues } method. // @param _royalty The _royalty address is a smart contract used to split the royalty amount between preset addresses.. constructor(string memory __contractURI, address _operator, address payable _royalty) ERC721A("Centaurify_Collection_AAA", "CENT_AAA") { _contractURI = __contractURI; royalty = _royalty; _setupRole(DEFAULT_ADMIN_ROLE, _msgSenderERC721A()); _setupRole(ADMIN_ROLE, _msgSenderERC721A()); _setupRole(OPERATOR_ROLE, _operator); _setDefaultRoyalty(royalty, 750); _mintERC2309(_msgSenderERC721A(), 500); } /// @dev Receive function will revert if triggered. receive() external payable { if (msg.value > 0) revert Code_3(_ReceivefunctionError); } /// @notice Allow first phase whitelisted accounts to mint. /// @dev Require phaseOneIsOpen /// @param amount The amount of nft's to mint. /// @param leaf The leaf node of the three. /// @param proof The proof from the merkletree. function whitelistPhase1Mint(uint amount, bytes32 leaf, bytes32[] memory proof) external payable phaseOneIsOpen costs(amount) { if (block.timestamp > endTimestamp) revert MintPhaseEnded(endTimestamp); if (!whitelistPhase1Used[_msgSenderERC721A()]) { if (keccak256(abi.encodePacked(_msgSenderERC721A())) != leaf) revert Code_3(_MerkleLeafMatchError ); if (!verify(merkleRoot, leaf, proof)) revert Code_3(_MerkleLeafValidationError ); whitelistPhase1Used[_msgSenderERC721A()] = true; whitelistPhase1Remaining[_msgSenderERC721A()] = maxItemsPerTx; } if (amount <= 0) revert NoZeroValues(); if (whitelistPhase1Remaining[_msgSenderERC721A()] < amount) revert Code_3(_RemainingAllocationError); whitelistPhase1Remaining[_msgSenderERC721A()] -= amount; _mintWithoutValidation(_msgSenderERC721A(), amount, false); } /// @notice Allow second whitelisted accounts to mint. /// @dev Require phaseTwoIsOpen. /// @param amount The amount of nft's to mint. /// @param leaf the leaf node of the three. /// @param proof the proof from the merkletree. function whitelistPhase2Mint(uint amount, bytes32 leaf, bytes32[] memory proof) external payable phaseTwoIsOpen costs(amount) { if (block.timestamp > endTimestamp) revert MintPhaseEnded(endTimestamp); if (!whitelistPhase2Used[_msgSenderERC721A()]) { if (keccak256(abi.encodePacked(_msgSenderERC721A())) != leaf) revert Code_3(_MerkleLeafMatchError ); if (!verify(merkleRoot, leaf, proof)) revert Code_3(_MerkleLeafValidationError ); whitelistPhase2Used[_msgSenderERC721A()] = true; whitelistPhase2Remaining[_msgSenderERC721A()] = maxItemsPerTx; } if (amount <= 0) revert NoZeroValues(); if (whitelistPhase2Remaining[_msgSenderERC721A()] < amount) revert Code_3(_RemainingAllocationError); whitelistPhase2Remaining[_msgSenderERC721A()] -= amount; _mintWithoutValidation(_msgSenderERC721A(), amount, false); } /// @notice Allow third phase whitelisted accounts to mint. /// @dev Require phaseThreeIsOpen. /// @param amount The amount of nft's to mint. /// @param leaf the leaf node of the three. /// @param proof the proof from the merkletree. function whitelistPhase3Mint(uint amount, bytes32 leaf, bytes32[] memory proof) external payable phaseThreeIsOpen costs(amount) { if (block.timestamp > endTimestamp) revert MintPhaseEnded(endTimestamp); if (!whitelistPhase3Used[_msgSenderERC721A()]) { if (keccak256(abi.encodePacked(_msgSenderERC721A())) != leaf) revert Code_3(_MerkleLeafMatchError); if (!verify(merkleRoot, leaf, proof)) revert Code_3(_MerkleLeafValidationError ); whitelistPhase3Used[_msgSenderERC721A()] = true; whitelistPhase3Remaining[_msgSenderERC721A()] = maxItemsPerTx; } if (amount <= 0) revert NoZeroValues(); if (whitelistPhase3Remaining[_msgSenderERC721A()] < amount) revert Code_3(_RemainingAllocationError); whitelistPhase3Remaining[_msgSenderERC721A()] -= amount; _mintWithoutValidation(_msgSenderERC721A(), amount, false); } /// @notice Allows the public to mint if public minting is open. /// @dev Require publicMintingIsOpen. /// @param amount The amount of nft's to mint. function publicMint(uint amount) external payable publicMintingIsOpen costs(amount) { if (block.timestamp > endTimestamp) revert MintPhaseEnded(endTimestamp); if (!publicMintUsed[_msgSenderERC721A()]) { publicMintUsed[_msgSenderERC721A()] = true; publicMintRemaining[_msgSenderERC721A()] = maxItemsPerTx; } if (amount <= 0) revert NoZeroValues(); if (publicMintRemaining[_msgSenderERC721A()] < amount) revert Code_3(_RemainingAllocationError); publicMintRemaining[_msgSenderERC721A()] -= amount; _mintWithoutValidation(_msgSenderERC721A(), amount, false); } /// @notice Method dedicated for the FrontEnd to query the remaining mints of an account. /// @dev Method returns the max phase mint if user has not minted before, and the remaining mints if user has minted before. /// @dev Attention! This method does NOT verify if the `user` is whitelisted. It only checks if the `user` has minted or not. The normal Merkle tree procedure is still required. /// @param user The user address to query the remaining mints of. function getRemainingMints(address user) external view returns (uint remaining) { Status _status = status; if (_status == Status(0)) { if (!whitelistPhase1Used[user]) return PHASE1_MAX_MINT; return whitelistPhase1Remaining[user]; } else if (_status == Status(1)) { if (!whitelistPhase2Used[user]) return PHASE2_MAX_MINT; return whitelistPhase2Remaining[user]; } else if (_status == Status(2)) { if (!whitelistPhase3Used[user]) return PHASE3_MAX_MINT; return whitelistPhase3Remaining[user]; } else if (_status == Status(3)) { if (!publicMintUsed[user]) return PUBLIC_MAX_MINT; return publicMintRemaining[user]; } } /// @notice Burns a token. /// @dev Completes an approval check in derived { _burn } method. /// @param _tokenId The token Id to burn. function burn(uint _tokenId) external { if (!_exists(_tokenId)) revert Code_3("Didn't exist"); super._burn(_tokenId, true); } /// @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(uint _tokenId) public view override(ERC721A, IERC721A) returns (string memory) { return bytes(_baseTokenURI).length != 0 ? string(abi.encodePacked(_baseTokenURI, _toString(_tokenId), _uriSuffix)) : ""; } /// @dev Method is used by OpenSea's - Royalty Standard { https://docs.opensea.io/docs/contract-level-metadata } function contractURI() public view returns (string memory) { return _contractURI; } /// @notice Allows the owner to call on { _mintWithoutValidation() } method. /// @dev Restricted with onlyRole(ADMIN_ROLE) modifier. /// @param to Address to receive the minted nft's. /// @param amount The amount of tokens to mint. function ownerMint(address to, uint amount) external onlyRole(ADMIN_ROLE) { _mintWithoutValidation(to, amount, true); } /* ------------------------------------------------------------ INTERNAL FUNCTIONS ----------------------------------------------------------- */ /// @notice Private method used to mint the NFT's. /// @param to The address that will receive the tokens. /// @param amount The amount of tokens to mint. /// @param skipMaxItems Pass true to skip maxItemsPerTx. function _mintWithoutValidation(address to, uint amount, bool skipMaxItems) private { uint _totalSupply = totalSupply(); if (_totalSupply + amount > MAX_ITEMS) revert Code_3(_MaxItemsError); require( skipMaxItems || amount <= maxItemsPerTx, "Surpasses maxItemsPerTx" ); _mint(to, amount); uint _nextToken = _nextTokenId(); emit Minted(to, amount, _nextToken - 1, status); } /// @notice Verify the address against the merkletree. /// @param root The root node to validate. /// @param leaf The leaf node to validate. /// @param proof The proof to validate. function verify(bytes32 root, bytes32 leaf, bytes32[] memory proof) public pure returns (bool) { return MerkleProof.verify(proof, root, leaf); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "erc721a/contracts/ERC721A.sol"; import "erc721a/contracts/extensions/ERC721AQueryable.sol"; /// @title Centaurify Collection AAA - GenesisStorage.sol /// @author @dadogg80 - Viken Blockchain Solutions. /// @notice This is one of the Centaurify Collection AAA smart contracts used for the GenesisMint - Golden Ticket. /// @notice This smart contract Contains the state variables and admin methods for the GenesisMint.sol abstract contract GenesisStorage is AccessControl, Ownable, ERC721A, ERC721AQueryable, ERC2981 { using SafeERC20 for IERC20; enum Status { Phase1, Phase2, Phase3, Public, EarlyReveal, Revealed } Status public status; bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE"); bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); /// @notice recipient is the receiver of the withdraw method. address payable public recipient; /// @notice royalty is the address to receive the royalty payouts. address payable public royalty; /// @notice The current mint phase values. uint public mintPrice; uint public maxItemsPerTx; /// @notice Timestamps to keep track of the start and end time of each phase. uint public startTimestamp; uint public endTimestamp; /// @notice The merkleRoot of the current running phase. bytes32 public merkleRoot = ""; /// @dev Minting restrictions. uint internal constant MAX_ITEMS = 5000; uint internal constant PHASE1_PRICE = 0.05 ether; uint internal constant PHASE2_PRICE = 0.055 ether; uint internal constant PHASE3_PRICE = 0.075 ether; uint internal constant PUBLIC_MINT_PRICE = 0.1 ether; uint internal constant PHASE1_MAX_MINT = 5; uint internal constant PHASE2_MAX_MINT = 3; uint internal constant PHASE3_MAX_MINT = 1; uint internal constant PUBLIC_MAX_MINT = 1; /// @notice URIs used in this contract. string internal _baseTokenURI; string internal _contractURI; string internal _uriSuffix; string internal _RemainingAllocationError = "Can't mint more than remaining allocation"; string internal _MerkleLeafMatchError = "Don't match Merkle leaf"; string internal _MerkleLeafValidationError = "Not a valid Merkle Leaf"; string internal _ReceivefunctionError = "Not a payable receive function!"; string internal _MaxItemsError = "Sold out"; string internal _TransactionError = "Failed tx"; /// @dev Maps user address to their remaining mints if they have minted some but not all of their allocation mapping(address => uint) internal whitelistPhase1Remaining; mapping(address => uint) internal whitelistPhase2Remaining; mapping(address => uint) internal whitelistPhase3Remaining; mapping(address => uint) internal publicMintRemaining; /// @dev Maps user address to bool, true if user has minted mapping(address => bool) internal whitelistPhase1Used; mapping(address => bool) internal whitelistPhase2Used; mapping(address => bool) internal whitelistPhase3Used; mapping(address => bool) internal publicMintUsed; /// @notice error codes can be located in the documentation /// { https://centaurifyorg.github.io/Centaurify_Docs/GenesisMint/ReadTheDocs_Genesis_Mint.html#read-the-docs---genesis-mint } /// @dev Wrong status. error Code_1(Status Current, Status Required); /// @dev Wrong timestamp. error Code_2(uint Timestamp); /// @dev Returns an error message. error Code_3(string Message); /// @dev Returns the endTimestamp. error MintPhaseEnded(uint EndTimestamp); /// @dev Zero value not allowed. error NoZeroValues(); /// @dev Wrong amount. error WrongValue(uint Value); /// @notice Modifier checks that the {msg.value} is correct. modifier costs(uint amount) { uint value = (mintPrice * amount); if (msg.value != value) revert WrongValue(msg.value); _; } /// @notice Modifier checks if the premint Phase1 has started. modifier phaseOneIsOpen() { uint currentTime = block.timestamp; if (status != Status.Phase1) revert Code_1(status, Status.Phase1); if (currentTime <= startTimestamp) revert Code_2(startTimestamp); if (startTimestamp == 0) revert Code_2(startTimestamp); _; } /// @notice Modifier checks if the premint Phase2 has started. modifier phaseTwoIsOpen() { uint currentTime = block.timestamp; if (status != Status.Phase2) revert Code_1(status, Status.Phase2); if (currentTime <= startTimestamp) revert Code_2(startTimestamp); if (startTimestamp == 0) revert Code_2(startTimestamp); _; } /// @notice Modifier checks if the premint Phase3 has started. modifier phaseThreeIsOpen() { uint currentTime = block.timestamp; if (status != Status.Phase3) revert Code_1(status, Status.Phase3); if (currentTime <= startTimestamp) revert Code_2(startTimestamp); if (startTimestamp == 0) revert Code_2(startTimestamp); _; } /// @notice Modifier checks if the public minting has started. modifier publicMintingIsOpen() { uint currentTime = block.timestamp; if (status != Status.Public) revert Code_1(status, Status.Public); if (currentTime <= startTimestamp) revert Code_2(startTimestamp); if (startTimestamp == 0) revert Code_2(startTimestamp); _; } /// @notice Modifier checks if the early reveal period has started. modifier earlyRevealIsOpen() { uint currentTime = block.timestamp; if (status != Status.EarlyReveal) revert Code_1(status, Status.EarlyReveal); if (currentTime <= startTimestamp) revert Code_2(startTimestamp); if (startTimestamp == 0) revert Code_2(startTimestamp); _; } /// @notice Event is emitted when the status is changed. /// @param status Indexed -The current mint phase status. /// @param startTimestamp The start timestamp of this current mint phase. /// @param endTimestamp The end timestamp of this current mint phase. event StatusChange( Status indexed status, uint startTimestamp, uint endTimestamp ); /// @notice Event is emitted when a new token has been minted. /// @param owner Indexed -The owner of the newly minted tokens. /// @param amount The amount of tokens minted. /// @param lastTokenId Indexed - The id of the last token minted in this batch. /// @param mintPhase Indexed - The mint phase it was minted in. event Minted( address indexed owner, uint amount, uint indexed lastTokenId, Status indexed mintPhase ); /// @notice Event is emitted when the Withdraw method has been executed successfull. /// @param amount The amount withdrawn from the contract. /// @param receiver Indexed - The receiving address of the smart contract funds. event Withdraw( uint amount, address indexed receiver ); /// @notice Event is emitted when tokens has been saved by the ADMIN_ROLE. /// @param ContractAddress Indexed - The contract address of the ERC20 token. /// @param To Indexed - The address of the receiver. /// @param Amount Indexed - The transacted amount. event SavedStuckTokens( address indexed ContractAddress, address indexed To, uint indexed Amount ); /// @notice Event is emitted when the MerkleRoot has been adjusted by the ADMIN_ROLE. /// @dev Execute public method to read the new parameter. event NewMerkleRoot(); /// @notice Event is emitted when the maxItemPerTx has been adjusted by the ADMIN_ROLE.. /// @dev Execute public method to read the new parameter. event NewMaxItemPerTx(); /// @notice Event is emitted when the recipient is adjusted by the ADMIN_ROLE. /// @dev Execute public method to read the new parameter. event NewRecipient(); /// @notice Event is emitted when the royalty receiver has been adjusted by the ADMIN_ROLE. /// @dev Execute public method to read the new parameter. event NewRoyaltyReceiver(); /// @notice Event is emitted when the contractURI has been adjusted by the ADMIN_ROLE. /// @dev Execute public method to read the new parameter. event NewContractUri(); /// @notice Event is emitted when the baseURI has been adjusted by the ADMIN_ROLE. /// @dev The new BaseURI is internal and should not be revealed before the REVEAL phase. event NewBaseUriSet(); /// @notice Event is emitted when the uriSuffix has been set by the ADMIN_ROLE. /// @param Suffix The uriSuffix. event InitUriSuffix(string Suffix); /* ------------------------------------------------------------ ADMIN FUNCTIONS ----------------------------------------------------------- */ /// @notice Adjust the merkleroot of the current phase. /// @dev Restricted to onlyRole(ADMIN_ROLE). /// @param _merkleRoot The new merkleRoot hash. function setMerkleRoot(bytes32 _merkleRoot) external onlyRole(ADMIN_ROLE) { merkleRoot = _merkleRoot; emit NewMerkleRoot(); } /// @notice Adjust the current max items per transaction. /// @dev Only use during the public mint to adjust the max amount of mints. /// @dev Restricted to onlyRole(ADMIN_ROLE). /// @param _maxItemsPerTx The new max items per transaction. function setMaxItemsPerTx(uint _maxItemsPerTx) external onlyRole(ADMIN_ROLE) publicMintingIsOpen { if (_maxItemsPerTx > 5) revert Code_3("Cannot set to mint more than five tokens per tx."); maxItemsPerTx = _maxItemsPerTx; emit NewMaxItemPerTx(); } /// @notice Adjust the recipient address. /// @dev Restricted to onlyRole(ADMIN_ROLE). /// @param _recipient The receiver address is a smart contract that will split the withdraw payouts to preset accounts. function setRecipient(address payable _recipient) external onlyRole(ADMIN_ROLE) { recipient = _recipient; emit NewRecipient(); } /// @notice Adjust the royalty address. /// @dev Restricted to onlyRole(ADMIN_ROLE). /// @dev This royalty address will be a payment splitter smart contract. /// @param _royalty The royalty amount to receive the royalty payouts. function setRoyaltyReceiver(address payable _royalty) external onlyRole(ADMIN_ROLE) { royalty = _royalty; emit NewRoyaltyReceiver(); } /// @notice Removes stuck erc20 tokens from contract. /// @dev Restricted to onlyRole(ADMIN_ROLE). /// @param _token The contract address of the token to remove. /// @param _to The to account. function removeStuckTokens(address _token, address _to) external onlyRole(ADMIN_ROLE) { uint _amount = balanceOf(address(_token)); IERC20(_token).safeTransfer(_to, _amount); emit SavedStuckTokens(_token, _to, _amount); } /// @notice Function to adjust the BaseTokenURI. /// @dev Restricted to onlyRole(ADMIN_ROLE). /// @param __baseTokenURI The new baseTokenURI. function setBaseTokenURI(string memory __baseTokenURI) external onlyRole(ADMIN_ROLE) { _baseTokenURI = __baseTokenURI; emit NewBaseUriSet(); } /// @notice Function to adjust the ContractURI. /// @dev Restricted to onlyRole(ADMIN_ROLE). /// @param __contractURI The new contractURI. function setContractURI(string memory __contractURI) external onlyRole(ADMIN_ROLE) { _contractURI = __contractURI; emit NewContractUri(); } /// @notice Function to se the uriSuffix of the tokenURI. /// @dev Restricted to onlyRole(ADMIN_ROLE). /// @param _suffix The new _uriSuffix. function setURISuffix(string memory _suffix) external onlyRole(ADMIN_ROLE) { _uriSuffix = _suffix; emit InitUriSuffix(_uriSuffix); } /// @notice Withdraw the contract balance to the recipient's address. /// @dev Restricted to onlyRole(ADMIN_ROLE). function withdraw() external onlyRole(ADMIN_ROLE) { if (recipient == address(0x0)) revert Code_3("Set recipient first"); uint amount = address(this).balance; (bool success, ) = recipient.call{value: amount}(""); if (!success) revert Code_3(_TransactionError); emit Withdraw(amount, recipient); } /// @notice Used to check if spesific interfaceID is supported. /// @dev Supports the following `interfaceId`s: /// @dev - IERC165: 0x01ffc9a7 /// @dev - IERC721: 0x80ac58cd /// @dev - IERC721Metadata: 0x5b5e139f /// @dev - IERC2981: 0x2a55205a function supportsInterface(bytes4 interfaceId) public view override(AccessControl, ERC2981, ERC721A, IERC721A) returns (bool) { return ERC721A.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); } /* ------------------------------------------------------------ ADMIN ROYALTY FUNCTIONS ----------------------------------------------------------- */ /// @notice Adjust the royalty data of a given token id {will override default royalty for this contact}. /// @dev Restricted to onlyRole(ADMIN_ROLE). /// @param tokenId The id of the token. /// @param _royaltyAddress The account to receive the royalty amount. /// @param feeNumerator The royalty amount in BIPS. example: 750 is 7,5%. function setTokenRoyalty(uint tokenId, address payable _royaltyAddress, uint96 feeNumerator) external onlyRole(ADMIN_ROLE) { _setTokenRoyalty(tokenId, _royaltyAddress, feeNumerator); } /// @notice Adjust the current default royalty data. /// @dev Restricted to onlyRole(ADMIN_ROLE). /// @param _royaltyAddress The account to receive the royalty amount. /// @param feeNumerator The royalty amount in BIPS. example: 750 is 7,5%. function setDefaultRoyalty(address payable _royaltyAddress, uint96 feeNumerator) external onlyRole(ADMIN_ROLE) { _setDefaultRoyalty(_royaltyAddress, feeNumerator); } /* ------------------------------------------------------------ ADMIN (SET PREMINT & PUBLICMINT) FUNCTIONS ----------------------------------------------------------- */ /// @notice Used to set the Status to Premint Phase 1. /// @dev Restricted to onlyRole(OPERATOR_ROLE). /// @param _startTimestamp The timestamp to start the Premint Phase 1. /// @param _endTimestamp The timestamp to end the Premint Phase 1. /// @param _merkleRoot The MerkleRoot of the Phase1 whitelist to mint from. function setPhaseOneMintValues(uint _startTimestamp, uint _endTimestamp, bytes32 _merkleRoot) external onlyRole(OPERATOR_ROLE) { if (status != Status(0)) revert Code_1(status, Status(0)); merkleRoot = _merkleRoot; startTimestamp = _startTimestamp; endTimestamp = _endTimestamp; status = Status.Phase1; mintPrice = PHASE1_PRICE; maxItemsPerTx = PHASE1_MAX_MINT; emit StatusChange(status, startTimestamp, endTimestamp); } /// @notice Used to set the Status to Premint Phase 2. /// @dev Restricted to onlyRole(OPERATOR_ROLE). /// @param _startTimestamp The timestamp to start the Premint Phase 2. /// @param _endTimestamp The timestamp to end the Premint Phase 2. /// @param _merkleRoot The MerkleRoot of the Phase2 whitelist to mint from. function setPhaseTwoMintValues(uint _startTimestamp, uint _endTimestamp, bytes32 _merkleRoot) external onlyRole(OPERATOR_ROLE) phaseOneIsOpen { merkleRoot = _merkleRoot; startTimestamp = _startTimestamp; endTimestamp = _endTimestamp; status = Status.Phase2; mintPrice = PHASE2_PRICE; maxItemsPerTx = PHASE2_MAX_MINT; emit StatusChange(status, startTimestamp, endTimestamp); } /// @notice Used to set the Status to Premint Phase 3. /// @dev Restricted to onlyRole(OPERATOR_ROLE). /// @param _startTimestamp The timestamp to start the Premint Phase 3. /// @param _endTimestamp The timestamp to end the Premint Phase 3. /// @param _merkleRoot The MerkleRoot of the Phase3 whitelist to mint from. function setPhaseThreeMintValues(uint _startTimestamp, uint _endTimestamp, bytes32 _merkleRoot) external onlyRole(OPERATOR_ROLE) phaseTwoIsOpen { merkleRoot = _merkleRoot; startTimestamp = _startTimestamp; endTimestamp = _endTimestamp; status = Status.Phase3; mintPrice = PHASE3_PRICE; maxItemsPerTx = PHASE3_MAX_MINT; emit StatusChange(status, startTimestamp, endTimestamp); } /// @notice Used to set the Status to Public mint. /// @dev Restricted to onlyRole(OPERATOR_ROLE). /// @param _startTimestamp The timestamp to start the Public minting. /// @param _endTimestamp The timestamp to end the Public minting. function setPublicMintValues(uint _startTimestamp, uint _endTimestamp) external onlyRole(OPERATOR_ROLE) phaseThreeIsOpen { startTimestamp = _startTimestamp; endTimestamp = _endTimestamp; merkleRoot = ""; status = Status.Public; mintPrice = PUBLIC_MINT_PRICE; maxItemsPerTx = PUBLIC_MAX_MINT; emit StatusChange(status, startTimestamp, endTimestamp); } /// @notice Used to set the Status to EarlyReveal. /// @dev Restricted to onlyRole(OPERATOR_ROLE). /// @param _earlyRevealTimestamp The timestamp when earlyReveal is allowed. function setEarlyRevealValues(uint _earlyRevealTimestamp) external onlyRole(OPERATOR_ROLE) publicMintingIsOpen { startTimestamp = _earlyRevealTimestamp; endTimestamp = 0; status = Status.EarlyReveal; emit StatusChange(status, startTimestamp, endTimestamp); } /// @notice Function to set the status to Revealed. /// @dev Restricted to onlyRole(OPERATOR_ROLE). function setRevealValues() external onlyRole(OPERATOR_ROLE) earlyRevealIsOpen { startTimestamp = 0; status = Status.Revealed; emit StatusChange(status, startTimestamp, endTimestamp); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. * * 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. */ 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 proved to be a part of a Merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * _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} * * _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 the sibling nodes in `proof`, * consuming from one or the other at each step according to the instructions given by * `proofFlags`. * * _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} * * _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 // ERC721A Contracts v4.2.2 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Reference type for token approval. struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @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, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @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) public virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @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) public virtual override { if (operator == _msgSenderERC721A()) revert ApproveToCaller(); _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @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. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId]`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) public virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @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 memory _data ) public virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), // but we allocate 0x80 bytes to keep the free memory pointer 32-byte word aliged. // We will need 1 32-byte word to store the length, // and 3 32-byte words to store a maximum of 78 digits. Total: 0x20 + 3 * 0x20 = 0x80. str := add(mload(0x40), 0x80) // Update the free memory pointer to allocate. mstore(0x40, str) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// 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 // ERC721A Contracts v4.2.2 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AQueryable.sol'; import '../ERC721A.sol'; /** * @title ERC721AQueryable. * * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable { /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) { return ownership; } ownership = _ownershipAt(tokenId); if (ownership.burned) { return ownership; } return _ownershipOf(tokenId); } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] calldata tokenIds) external view virtual override returns (TokenOwnership[] memory) { unchecked { uint256 tokenIdsLength = tokenIds.length; TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength); for (uint256 i; i != tokenIdsLength; ++i) { ownerships[i] = explicitOwnershipOf(tokenIds[i]); } return ownerships; } } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view virtual override returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _nextTokenId(); // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, stopLimit)`. if (stop > stopLimit) { stop = stopLimit; } uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (start < stop) { uint256 rangeLength = stop - start; if (rangeLength < tokenIdsMaxLength) { tokenIdsMaxLength = rangeLength; } } else { tokenIdsMaxLength = 0; } uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength); if (tokenIdsMaxLength == 0) { return tokenIds; } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`. // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range. if (!ownership.burned) { currOwnershipAddr = ownership.addr; } for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } // Downsize the array to fit. assembly { mstore(tokenIds, tokenIdsIdx) } return tokenIds; } } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); TokenOwnership memory ownership; for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// 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 // ERC721A Contracts v4.2.2 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * The caller cannot approve to their own address. */ error ApproveToCaller(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev 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); // ============================================================= // IERC721Metadata // ============================================================= /** * @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); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_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) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @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 // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// 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 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 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 // ERC721A Contracts v4.2.2 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../IERC721A.sol'; /** * @dev Interface of ERC721AQueryable. */ interface IERC721AQueryable is IERC721A { /** * Invalid query range (`start` >= `stop`). */ error InvalidQueryRange(); /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory); /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory); /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory); /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view returns (uint256[] memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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 functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev 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) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @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 v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// 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); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"__contractURI","type":"string"},{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address payable","name":"_royalty","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[{"internalType":"enum GenesisStorage.Status","name":"Current","type":"uint8"},{"internalType":"enum GenesisStorage.Status","name":"Required","type":"uint8"}],"name":"Code_1","type":"error"},{"inputs":[{"internalType":"uint256","name":"Timestamp","type":"uint256"}],"name":"Code_2","type":"error"},{"inputs":[{"internalType":"string","name":"Message","type":"string"}],"name":"Code_3","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[{"internalType":"uint256","name":"EndTimestamp","type":"uint256"}],"name":"MintPhaseEnded","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NoZeroValues","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"Value","type":"uint256"}],"name":"WrongValue","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":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"Suffix","type":"string"}],"name":"InitUriSuffix","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"lastTokenId","type":"uint256"},{"indexed":true,"internalType":"enum GenesisStorage.Status","name":"mintPhase","type":"uint8"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[],"name":"NewBaseUriSet","type":"event"},{"anonymous":false,"inputs":[],"name":"NewContractUri","type":"event"},{"anonymous":false,"inputs":[],"name":"NewMaxItemPerTx","type":"event"},{"anonymous":false,"inputs":[],"name":"NewMerkleRoot","type":"event"},{"anonymous":false,"inputs":[],"name":"NewRecipient","type":"event"},{"anonymous":false,"inputs":[],"name":"NewRoyaltyReceiver","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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ContractAddress","type":"address"},{"indexed":true,"internalType":"address","name":"To","type":"address"},{"indexed":true,"internalType":"uint256","name":"Amount","type":"uint256"}],"name":"SavedStuckTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"enum GenesisStorage.Status","name":"status","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"name":"StatusChange","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":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":"endTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"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":"address","name":"user","type":"address"}],"name":"getRemainingMints","outputs":[{"internalType":"uint256","name":"remaining","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"recipient","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"removeStuckTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royalty","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","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":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"__contractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_royaltyAddress","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_earlyRevealTimestamp","type":"uint256"}],"name":"setEarlyRevealValues","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxItemsPerTx","type":"uint256"}],"name":"setMaxItemsPerTx","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTimestamp","type":"uint256"},{"internalType":"uint256","name":"_endTimestamp","type":"uint256"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setPhaseOneMintValues","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTimestamp","type":"uint256"},{"internalType":"uint256","name":"_endTimestamp","type":"uint256"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setPhaseThreeMintValues","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTimestamp","type":"uint256"},{"internalType":"uint256","name":"_endTimestamp","type":"uint256"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setPhaseTwoMintValues","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTimestamp","type":"uint256"},{"internalType":"uint256","name":"_endTimestamp","type":"uint256"}],"name":"setPublicMintValues","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_recipient","type":"address"}],"name":"setRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setRevealValues","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_royalty","type":"address"}],"name":"setRoyaltyReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address payable","name":"_royaltyAddress","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_suffix","type":"string"}],"name":"setURISuffix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"status","outputs":[{"internalType":"enum GenesisStorage.Status","name":"","type":"uint8"}],"stateMutability":"view","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":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"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":[{"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"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"leaf","type":"bytes32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"whitelistPhase1Mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"leaf","type":"bytes32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"whitelistPhase2Mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"leaf","type":"bytes32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"whitelistPhase3Mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
600060125560e0604052602960808181529062004e8360a03960169062000027908262000687565b506040805180820190915260178082527f446f6e2774206d61746368204d65726b6c65206c6561660000000000000000006020830152906200006a908262000687565b5060408051808201909152601781527f4e6f7420612076616c6964204d65726b6c65204c6561660000000000000000006020820152601890620000ae908262000687565b5060408051808201909152601f81527f4e6f7420612070617961626c6520726563656976652066756e6374696f6e21006020820152601990620000f2908262000687565b5060408051808201909152600881526714dbdb19081bdd5d60c21b6020820152601a9062000121908262000687565b5060408051808201909152600981526808cc2d2d8cac840e8f60bb1b6020820152601b9062000151908262000687565b503480156200015f57600080fd5b5060405162004eac38038062004eac833981016040819052620001829162000770565b6040518060400160405280601981526020017f43656e746175726966795f436f6c6c656374696f6e5f414141000000000000008152506040518060400160405280600881526020016743454e545f41414160c01b815250620001f3620001ed620002df60201b60201c565b620002e3565b600462000201838262000687565b50600562000210828262000687565b5050600060025550601462000226848262000687565b50600d80546001600160a01b0319166001600160a01b038316179055620002566000620002503390565b62000335565b620002827fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217753362000335565b620002ae7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9298362000335565b600d54620002c8906001600160a01b03166102ee62000345565b620002d6336101f46200044a565b50505062000873565b3390565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b62000341828262000543565b5050565b6127106001600160601b0382161115620003b95760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620004115760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620003b0565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600a55565b6002546001600160a01b0383166200047457604051622e076360e81b815260040160405180910390fd5b81600003620004965760405163b562e8dd60e01b815260040160405180910390fd5b611388821115620004ba57604051633db1f9af60e01b815260040160405180910390fd5b6001600160a01b03831660008181526007602090815260408083208054680100000000000000018802019055848352600682528083206001871460e11b4260a01b17851790558051600019868801018152905185927fdeaa91b6123d068f5821d0fb0678463d1a8a6079fe8af5de3ce5e896dcf9133d928290030190a48082016002555b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000341576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200059f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200060e57607f821691505b6020821081036200062f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200053e57600081815260208120601f850160051c810160208610156200065e5750805b601f850160051c820191505b818110156200067f578281556001016200066a565b505050505050565b81516001600160401b03811115620006a357620006a3620005e3565b620006bb81620006b48454620005f9565b8462000635565b602080601f831160018114620006f35760008415620006da5750858301515b600019600386901b1c1916600185901b1785556200067f565b600085815260208120601f198616915b82811015620007245788860151825594840194600190910190840162000703565b5085821015620007435787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80516001600160a01b03811681146200076b57600080fd5b919050565b6000806000606084860312156200078657600080fd5b83516001600160401b03808211156200079e57600080fd5b818601915086601f830112620007b357600080fd5b815181811115620007c857620007c8620005e3565b604051601f8201601f19908116603f01168101908382118183101715620007f357620007f3620005e3565b816040528281526020935089848487010111156200081057600080fd5b600091505b8282101562000834578482018401518183018501529083019062000815565b82821115620008465760008484830101525b96506200085891505086820162000753565b935050506200086a6040850162000753565b90509250925092565b61460080620008836000396000f3fe6080604052600436106103c75760003560e01c806371fa5521116101f2578063a217fddf1161010d578063e303417e116100a0578063e985e9c51161006f578063e985e9c514610b75578063f2fde38b14610bbe578063f5b541a614610bde578063f708ba6a14610c0057600080fd5b8063e303417e14610b0a578063e5935c2814610b2a578063e6fd48bc14610b4a578063e8a3d48514610b6057600080fd5b8063b88d4fde116100dc578063b88d4fde14610a7d578063c23dc68f14610a9d578063c87b56dd14610aca578063d547741f14610aea57600080fd5b8063a217fddf14610a1f578063a22cb46514610a34578063a85adeab14610a54578063aea46d1214610a6a57600080fd5b806381b3e5751161018557806391d148541161015457806391d14854146109aa578063938e3d7b146109ca57806395d89b41146109ea57806399a2557a146109ff57600080fd5b806381b3e5751461091f5780638462151c1461093f5780638da5cb5b1461096c5780638dc251e31461098a57600080fd5b80637cb64759116101c15780637cb64759146108ac5780637e64c6fb146108cc5780637fa803c3146108df5780638056e87f146108ff57600080fd5b806371fa55211461082a578063749ee3851461084a57806375b238fc1461086a5780637a4e57151461088c57600080fd5b806330666a4d116102e2578063571349101161027557806366d003ac1161024457806366d003ac146107ba5780636817c76c146107df57806370a08231146107f5578063715018a61461081557600080fd5b8063571349101461073a5780635944c7531461074d5780635bbb21771461076d5780636352211e1461079a57600080fd5b80633ccfd60b116102b15780633ccfd60b146106c557806342842e0e146106da57806342966c68146106fa578063484b973c1461071a57600080fd5b806330666a4d1461064f5780633423e5481461066557806336568abe146106855780633bbed4a0146106a557600080fd5b806323b872dd1161035a5780632db11544116103295780632db11544146105e65780632eb4a7ab146105f95780632f2ff15d1461060f57806330176e131461062f57600080fd5b806323b872dd14610537578063248a9ca31461055757806329ee566c146105875780632a55205a146105a757600080fd5b8063095ea7b311610396578063095ea7b3146104ad57806318160ddd146104cd57806318eaa36a146104f0578063200d2ed21461051057600080fd5b806301ffc9a7146103fe57806304634d8d1461043357806306fdde0314610453578063081812fc1461047557600080fd5b366103f95734156103f75760196040516393c4c99f60e01b81526004016103ee9190613a3f565b60405180910390fd5b005b600080fd5b34801561040a57600080fd5b5061041e610419366004613ae0565b610c15565b60405190151581526020015b60405180910390f35b34801561043f57600080fd5b506103f761044e366004613b2e565b610c35565b34801561045f57600080fd5b50610468610c5c565b60405161042a9190613bbb565b34801561048157600080fd5b50610495610490366004613bce565b610cee565b6040516001600160a01b03909116815260200161042a565b3480156104b957600080fd5b506103f76104c8366004613be7565b610d32565b3480156104d957600080fd5b50600354600254035b60405190815260200161042a565b3480156104fc57600080fd5b506103f761050b366004613c13565b610dd2565b34801561051c57600080fd5b50600c5461052a9060ff1681565b60405161042a9190613c77565b34801561054357600080fd5b506103f7610552366004613c85565b610ee8565b34801561056357600080fd5b506104e2610572366004613bce565b60009081526020819052604090206001015490565b34801561059357600080fd5b50600d54610495906001600160a01b031681565b3480156105b357600080fd5b506105c76105c2366004613cc6565b611079565b604080516001600160a01b03909316835260208301919091520161042a565b6103f76105f4366004613bce565b611125565b34801561060557600080fd5b506104e260125481565b34801561061b57600080fd5b506103f761062a366004613ce8565b6112e2565b34801561063b57600080fd5b506103f761064a366004613db5565b611307565b34801561065b57600080fd5b506104e2600f5481565b34801561067157600080fd5b5061041e610680366004613e71565b611359565b34801561069157600080fd5b506103f76106a0366004613ce8565b611370565b3480156106b157600080fd5b506103f76106c0366004613ec0565b6113ee565b3480156106d157600080fd5b506103f7611453565b3480156106e657600080fd5b506103f76106f5366004613c85565b61158f565b34801561070657600080fd5b506103f7610715366004613bce565b6115aa565b34801561072657600080fd5b506103f7610735366004613be7565b6115fd565b6103f7610748366004613e71565b611621565b34801561075957600080fd5b506103f7610768366004613edd565b61186e565b34801561077957600080fd5b5061078d610788366004613f1b565b611891565b60405161042a9190613fcb565b3480156107a657600080fd5b506104956107b5366004613bce565b61195c565b3480156107c657600080fd5b50600c546104959061010090046001600160a01b031681565b3480156107eb57600080fd5b506104e2600e5481565b34801561080157600080fd5b506104e2610810366004613ec0565b611967565b34801561082157600080fd5b506103f76119b5565b34801561083657600080fd5b506103f7610845366004613cc6565b6119c9565b34801561085657600080fd5b506103f7610865366004613bce565b611adf565b34801561087657600080fd5b506104e26000805160206145ab83398151915281565b34801561089857600080fd5b506103f76108a7366004613bce565b611bd0565b3480156108b857600080fd5b506103f76108c7366004613bce565b611d19565b6103f76108da366004613e71565b611d63565b3480156108eb57600080fd5b506104e26108fa366004613ec0565b611f73565b34801561090b57600080fd5b506103f761091a366004613c13565b6120fc565b34801561092b57600080fd5b506103f761093a366004613db5565b6121dc565b34801561094b57600080fd5b5061095f61095a366004613ec0565b61223d565b60405161042a919061400d565b34801561097857600080fd5b506001546001600160a01b0316610495565b34801561099657600080fd5b506103f76109a5366004613ec0565b612345565b3480156109b657600080fd5b5061041e6109c5366004613ce8565b6123a5565b3480156109d657600080fd5b506103f76109e5366004613db5565b6123ce565b3480156109f657600080fd5b50610468612420565b348015610a0b57600080fd5b5061095f610a1a366004614045565b61242f565b348015610a2b57600080fd5b506104e2600081565b348015610a4057600080fd5b506103f7610a4f366004614088565b6125a6565b348015610a6057600080fd5b506104e260115481565b6103f7610a78366004613e71565b61263b565b348015610a8957600080fd5b506103f7610a983660046140b6565b612848565b348015610aa957600080fd5b50610abd610ab8366004613bce565b61288c565b60405161042a9190614135565b348015610ad657600080fd5b50610468610ae5366004613bce565b612904565b348015610af657600080fd5b506103f7610b05366004613ce8565b612965565b348015610b1657600080fd5b506103f7610b25366004614143565b61298a565b348015610b3657600080fd5b506103f7610b45366004613c13565b612a0a565b348015610b5657600080fd5b506104e260105481565b348015610b6c57600080fd5b50610468612a93565b348015610b8157600080fd5b5061041e610b90366004614143565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205460ff1690565b348015610bca57600080fd5b506103f7610bd9366004613ec0565b612aa2565b348015610bea57600080fd5b506104e260008051602061456b83398151915281565b348015610c0c57600080fd5b506103f7612b18565b6000610c2082612c0f565b80610c2f5750610c2f82612c5d565b92915050565b6000805160206145ab833981519152610c4d81612c82565b610c578383612c8c565b505050565b606060048054610c6b90613a0b565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9790613a0b565b8015610ce45780601f10610cb957610100808354040283529160200191610ce4565b820191906000526020600020905b815481529060010190602001808311610cc757829003601f168201915b5050505050905090565b6000610cf982612d46565b610d16576040516333d1c03960e21b815260040160405180910390fd5b506000908152600860205260409020546001600160a01b031690565b6000610d3d8261195c565b9050336001600160a01b03821614610d7657610d598133610b90565b610d76576040516367d9dca160e11b815260040160405180910390fd5b60008281526008602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60008051602061456b833981519152610dea81612c82565b426000600c5460ff166005811115610e0457610e04613c3f565b14610e2c57600c54604051637634defd60e01b81526103ee9160ff1690600090600401614171565b6010548111610e5457601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003610e7d57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601283905560108590556011849055600c805460ff1916600190811790915566c3663566a58000600e556003600f555b60008051602061454b833981519152601054601154604051610ed9929190918252602082015260400190565b60405180910390a25050505050565b6000610ef382612d6e565b9050836001600160a01b0316816001600160a01b031614610f265760405162a1148160e81b815260040160405180910390fd5b60008281526008602052604090208054610f528187335b6001600160a01b039081169116811491141790565b610f7d57610f608633610b90565b610f7d57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610fa457604051633a954ecd60e21b815260040160405180910390fd5b8015610faf57600082555b6001600160a01b038681166000908152600760205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260066020526040812091909155600160e11b841690036110415760018401600081815260066020526040812054900361103f57600254811461103f5760008181526006602052604090208490555b505b83856001600160a01b0316876001600160a01b031660008051602061458b83398151915260405160405180910390a45b505050505050565b6000828152600b602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916110ee575060408051808201909152600a546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101516000906127109061110d906001600160601b0316876141a2565b61111791906141c1565b915196919550909350505050565b426003600c5460ff16600581111561113f5761113f613c3f565b1461116757600c54604051637634defd60e01b81526103ee9160ff1690600390600401614171565b601054811161118f57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6010546000036111b857601054604051630d8d0ae760e41b81526004016103ee91815260200190565b81600081600e546111c991906141a2565b90508034146111ed5760405163cfde146160e01b81523460048201526024016103ee565b60115442111561121657601154604051636128b0ff60e11b81526004016103ee91815260200190565b3360009081526023602052604090205460ff1661125757336000908152602360209081526040808320805460ff19166001179055600f54601f909252909120555b6000841161127857604051630373865960e11b815260040160405180910390fd5b336000908152601f60205260409020548411156112ab5760166040516393c4c99f60e01b81526004016103ee9190613a3f565b336000908152601f6020526040812080548692906112ca9084906141e3565b909155506112dc905033856000612dd5565b50505050565b6000828152602081905260409020600101546112fd81612c82565b610c578383612ef3565b6000805160206145ab83398151915261131f81612c82565b601361132b8382614240565b506040517f7cb256135e6848c25e7fa75bd63422b863cce128733d167b3dca5c3f1d1e95c790600090a15050565b6000611366828585612f77565b90505b9392505050565b6001600160a01b03811633146113e05760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016103ee565b6113ea8282612f8d565b5050565b6000805160206145ab83398151915261140681612c82565b600c8054610100600160a81b0319166101006001600160a01b038516021790556040517f76ebe21503c8eefd1ef7bfbb7c5a6a515a5b82d2190512af021e18daf62dcfb890600090a15050565b6000805160206145ab83398151915261146b81612c82565b600c5461010090046001600160a01b03166114bf576040516393c4c99f60e01b815260206004820152601360248201527214d95d081c9958da5c1a595b9d08199a5c9cdd606a1b60448201526064016103ee565b600c5460405147916000916101009091046001600160a01b031690839060006040518083038185875af1925050503d8060008114611519576040519150601f19603f3d011682016040523d82523d6000602084013e61151e565b606091505b505090508061154357601b6040516393c4c99f60e01b81526004016103ee9190613a3f565b600c546040518381526101009091046001600160a01b0316907f8353ffcac0876ad14e226d9783c04540bfebf13871e868157d2a391cad98e918906020015b60405180910390a2505050565b610c5783838360405180602001604052806000815250612848565b6115b381612d46565b6115ef576040516393c4c99f60e01b815260206004820152600c60248201526b111a591b89dd08195e1a5cdd60a21b60448201526064016103ee565b6115fa816001612ff2565b50565b6000805160206145ab83398151915261161581612c82565b610c5783836001612dd5565b426002600c5460ff16600581111561163b5761163b613c3f565b1461166357600c54604051637634defd60e01b81526103ee9160ff1690600290600401614171565b601054811161168b57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6010546000036116b457601054604051630d8d0ae760e41b81526004016103ee91815260200190565b83600081600e546116c591906141a2565b90508034146116e95760405163cfde146160e01b81523460048201526024016103ee565b60115442111561171257601154604051636128b0ff60e11b81526004016103ee91815260200190565b3360009081526022602052604090205460ff166117d2576040516001600160601b03193360601b1660208201528590603401604051602081830303815290604052805190602001201461177b5760176040516393c4c99f60e01b81526004016103ee9190613a3f565b6117886012548686611359565b6117a85760186040516393c4c99f60e01b81526004016103ee9190613a3f565b336000908152602260209081526040808320805460ff19166001179055600f54601e909252909120555b600086116117f357604051630373865960e11b815260040160405180910390fd5b336000908152601e60205260409020548611156118265760166040516393c4c99f60e01b81526004016103ee9190613a3f565b85601e6000335b6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461185c91906141e3565b90915550611071905033876000612dd5565b6000805160206145ab83398151915261188681612c82565b6112dc84848461312b565b6060816000816001600160401b038111156118ae576118ae613d18565b60405190808252806020026020018201604052801561190057816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816118cc5790505b50905060005b8281146119535761192e868683818110611922576119226142ff565b9050602002013561288c565b828281518110611940576119406142ff565b6020908102919091010152600101611906565b50949350505050565b6000610c2f82612d6e565b60006001600160a01b038216611990576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600760205260409020546001600160401b031690565b6119bd6131f6565b6119c76000613250565b565b60008051602061456b8339815191526119e181612c82565b426002600c5460ff1660058111156119fb576119fb613c3f565b14611a2357600c54604051637634defd60e01b81526103ee9160ff1690600290600401614171565b6010548111611a4b57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003611a7457601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601084905560118390556000601255600c805460ff1916600390811790915567016345785d8a0000600e556001600f555b60008051602061454b833981519152601054601154604051611ad1929190918252602082015260400190565b60405180910390a250505050565b60008051602061456b833981519152611af781612c82565b426003600c5460ff166005811115611b1157611b11613c3f565b14611b3957600c54604051637634defd60e01b81526103ee9160ff1690600390600401614171565b6010548111611b6157601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003611b8a57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b60108390556000601155600c805460ff1916600490811790915560008051602061454b833981519152601054601154604051611582929190918252602082015260400190565b6000805160206145ab833981519152611be881612c82565b426003600c5460ff166005811115611c0257611c02613c3f565b14611c2a57600c54604051637634defd60e01b81526103ee9160ff1690600390600401614171565b6010548111611c5257601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003611c7b57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6005831115611ce6576040516393c4c99f60e01b815260206004820152603060248201527f43616e6e6f742073657420746f206d696e74206d6f7265207468616e2066697660448201526f32903a37b5b2b739903832b9103a3c1760811b60648201526084016103ee565b600f8390556040517f8f8d067a33478dc5bdb0e420040799235781948260a19b9196160eba357c5fc590600090a1505050565b6000805160206145ab833981519152611d3181612c82565b60128290556040517f337d84549cb00ae45c0df486a93deb72962c6783c9b2677bf7049772a9f733b590600090a15050565b426001600c5460ff166005811115611d7d57611d7d613c3f565b14611da557600c54604051637634defd60e01b81526103ee9160ff1690600190600401614171565b6010548111611dcd57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003611df657601054604051630d8d0ae760e41b81526004016103ee91815260200190565b83600081600e54611e0791906141a2565b9050803414611e2b5760405163cfde146160e01b81523460048201526024016103ee565b601154421115611e5457601154604051636128b0ff60e11b81526004016103ee91815260200190565b3360009081526021602052604090205460ff16611f14576040516001600160601b03193360601b16602082015285906034016040516020818303038152906040528051906020012014611ebd5760176040516393c4c99f60e01b81526004016103ee9190613a3f565b611eca6012548686611359565b611eea5760186040516393c4c99f60e01b81526004016103ee9190613a3f565b336000908152602160209081526040808320805460ff19166001179055600f54601d909252909120555b60008611611f3557604051630373865960e11b815260040160405180910390fd5b336000908152601d6020526040902054861115611f685760166040516393c4c99f60e01b81526004016103ee9190613a3f565b85601d60003361182d565b600c5460009060ff1681816005811115611f8f57611f8f613c3f565b03611fd9576001600160a01b038316600090815260208052604090205460ff16611fbc5750600592915050565b50506001600160a01b03166000908152601c602052604090205490565b6001816005811115611fed57611fed613c3f565b03612038576001600160a01b03831660009081526021602052604090205460ff1661201b5750600392915050565b50506001600160a01b03166000908152601d602052604090205490565b600281600581111561204c5761204c613c3f565b03612097576001600160a01b03831660009081526022602052604090205460ff1661207a5750600192915050565b50506001600160a01b03166000908152601e602052604090205490565b60038160058111156120ab576120ab613c3f565b036120f6576001600160a01b03831660009081526023602052604090205460ff166120d95750600192915050565b50506001600160a01b03166000908152601f602052604090205490565b50919050565b60008051602061456b83398151915261211481612c82565b426001600c5460ff16600581111561212e5761212e613c3f565b1461215657600c54604051637634defd60e01b81526103ee9160ff1690600190600401614171565b601054811161217e57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6010546000036121a757601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601283905560108590556011849055600c805460ff1916600290811790915567010a741a46278000600e556001600f55610ead565b6000805160206145ab8339815191526121f481612c82565b60156122008382614240565b507f2e0db0a61141ee97c3d706ac7d959541ab3ece3af117b52b798dc8459c431e1c60156040516122319190613a3f565b60405180910390a15050565b6060600080600061224d85611967565b90506000816001600160401b0381111561226957612269613d18565b604051908082528060200260200182016040528015612292578160200160208202803683370190505b5090506122bf60408051608081018252600080825260208201819052918101829052606081019190915290565b60005b838614612339576122d2816132a2565b915081604001516123315781516001600160a01b0316156122f257815194505b876001600160a01b0316856001600160a01b0316036123315780838780600101985081518110612324576123246142ff565b6020026020010181815250505b6001016122c2565b50909695505050505050565b6000805160206145ab83398151915261235d81612c82565b600d80546001600160a01b0319166001600160a01b0384161790556040517fa5d62f6e89147c44beb767502a83a9880a705f995168366220b41906f169817590600090a15050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000805160206145ab8339815191526123e681612c82565b60146123f28382614240565b506040517fbae9dd3fac3ffb892e06f64e18c5e8877d858bd5f1e1e142ff2eb2f60ba625ad90600090a15050565b606060058054610c6b90613a0b565b606081831061245157604051631960ccad60e11b815260040160405180910390fd5b60008061245d60025490565b90508084111561246b578093505b600061247687611967565b905084861015612495578585038181101561248f578091505b50612499565b5060005b6000816001600160401b038111156124b3576124b3613d18565b6040519080825280602002602001820160405280156124dc578160200160208202803683370190505b509050816000036124f257935061136992505050565b60006124fd8861288c565b90506000816040015161250e575080515b885b8881141580156125205750848714155b156125955761252e816132a2565b9250826040015161258d5782516001600160a01b03161561254e57825191505b8a6001600160a01b0316826001600160a01b03160361258d5780848880600101995081518110612580576125806142ff565b6020026020010181815250505b600101612510565b505050928352509095945050505050565b336001600160a01b038316036125cf5760405163b06307db60e01b815260040160405180910390fd5b3360008181526009602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b426000600c5460ff16600581111561265557612655613c3f565b1461267d57600c54604051637634defd60e01b81526103ee9160ff1690600090600401614171565b60105481116126a557601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6010546000036126ce57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b83600081600e546126df91906141a2565b90508034146127035760405163cfde146160e01b81523460048201526024016103ee565b60115442111561272c57601154604051636128b0ff60e11b81526004016103ee91815260200190565b33600090815260208052604090205460ff166127e9576040516001600160601b03193360601b166020820152859060340160405160208183030381529060405280519060200120146127945760176040516393c4c99f60e01b81526004016103ee9190613a3f565b6127a16012548686611359565b6127c15760186040516393c4c99f60e01b81526004016103ee9190613a3f565b33600090815260208080526040808320805460ff19166001179055600f54601c909252909120555b6000861161280a57604051630373865960e11b815260040160405180910390fd5b336000908152601c602052604090205486111561283d5760166040516393c4c99f60e01b81526004016103ee9190613a3f565b85601c60003361182d565b612853848484610ee8565b6001600160a01b0383163b156112dc5761286f848484846132de565b6112dc576040516368d2bf6b60e11b815260040160405180910390fd5b60408051608080820183526000808352602080840182905283850182905260608085018390528551938401865282845290830182905293820181905292810183905290915060025483106128e05792915050565b6128e9836132a2565b90508060400151156128fb5792915050565b611369836133ca565b60606013805461291390613a0b565b90506000036129315760405180602001604052806000815250610c2f565b601361293c836133ff565b601560405160200161295093929190614388565b60405160208183030381529060405292915050565b60008281526020819052604090206001015461298081612c82565b610c578383612f8d565b6000805160206145ab8339815191526129a281612c82565b60006129ad84611967565b90506129c36001600160a01b0385168483613437565b80836001600160a01b0316856001600160a01b03167f184eded68f65d6d476b95be4e471503d6fb58f657a974292cd02928af347582360405160405180910390a450505050565b60008051602061456b833981519152612a2281612c82565b6000600c5460ff166005811115612a3b57612a3b613c3f565b14612a6357600c5460ff166000604051637634defd60e01b81526004016103ee929190614171565b601282905560108490556011839055600c805460ff1916905566b1a2bc2ec50000600e556005600f556000611aa5565b606060148054610c6b90613a0b565b612aaa6131f6565b6001600160a01b038116612b0f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103ee565b6115fa81613250565b60008051602061456b833981519152612b3081612c82565b426004600c5460ff166005811115612b4a57612b4a613c3f565b14612b7157600c54604051637634defd60e01b81526103ee9160ff16906004908101614171565b6010548111612b9957601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003612bc257601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6000601055600c805460ff1916600590811790915560008051602061454b833981519152601054601154604051612c03929190918252602082015260400190565b60405180910390a25050565b60006301ffc9a760e01b6001600160e01b031983161480612c4057506380ac58cd60e01b6001600160e01b03198316145b80610c2f5750506001600160e01b031916635b5e139f60e01b1490565b60006001600160e01b0319821663152a902d60e11b1480610c2f5750610c2f82612c0f565b6115fa8133613489565b6127106001600160601b0382161115612cb75760405162461bcd60e51b81526004016103ee906143b0565b6001600160a01b038216612d0d5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016103ee565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600a55565b600060025482108015610c2f575050600090815260066020526040902054600160e01b161590565b600081600254811015612dbc5760008181526006602052604081205490600160e01b82169003612dba575b80600003611369575060001901600081815260066020526040902054612d99565b505b604051636f96cda160e11b815260040160405180910390fd5b6000612de46003546002540390565b9050611388612df384836143fa565b1115612e1557601a6040516393c4c99f60e01b81526004016103ee9190613a3f565b8180612e235750600f548311155b612e6f5760405162461bcd60e51b815260206004820152601760248201527f537572706173736573206d61784974656d73506572547800000000000000000060448201526064016103ee565b612e7984846134ed565b6000612e8460025490565b600c5490915060ff166005811115612e9e57612e9e613c3f565b612ea96001836141e3565b866001600160a01b03167fc18738b1be8b64e92125eb15627eb8465afe416c501eaaadbdeeccab1944e11987604051612ee491815260200190565b60405180910390a45050505050565b612efd82826123a5565b6113ea576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055612f333390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082612f8485846135c7565b14949350505050565b612f9782826123a5565b156113ea576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000612ffd83612d6e565b90508060008061301b86600090815260086020526040902080549091565b91509150841561305b57613030818433610f3d565b61305b5761303e8333610b90565b61305b57604051632ce44b5f60e11b815260040160405180910390fd5b801561306657600082555b6001600160a01b038316600081815260076020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260066020526040812091909155600160e11b851690036130f4576001860160008181526006602052604081205490036130f25760025481146130f25760008181526006602052604090208590555b505b60405186906000906001600160a01b0386169060008051602061458b833981519152908390a4505060038054600101905550505050565b6127106001600160601b03821611156131565760405162461bcd60e51b81526004016103ee906143b0565b6001600160a01b0382166131ac5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d6574657273000000000060448201526064016103ee565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600b90529190942093519051909116600160a01b029116179055565b6001546001600160a01b031633146119c75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ee565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260066020526040902054610c2f90613614565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613313903390899088908890600401614412565b6020604051808303816000875af192505050801561334e575060408051601f3d908101601f1916820190925261334b9181019061444f565b60015b6133ac573d80801561337c576040519150601f19603f3d011682016040523d82523d6000602084013e613381565b606091505b5080516000036133a4576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b604080516080810182526000808252602082018190529181018290526060810191909152610c2f6133fa83612d6e565b613614565b604080516080019081905280825b600183039250600a81066030018353600a90048061340d5750819003601f19909101908152919050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610c5790849061365b565b61349382826123a5565b6113ea576134ab816001600160a01b0316601461372d565b6134b683602061372d565b6040516020016134c792919061446c565b60408051601f198184030181529082905262461bcd60e51b82526103ee91600401613bbb565b60025460008290036135125760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526007602090815260408083208054680100000000000000018802019055848352600690915281206001851460e11b4260a01b1783179055828401908390839060008051602061458b8339815191528180a4600183015b81811461359d578083600060008051602061458b833981519152600080a4600101613577565b50816000036135be57604051622e076360e81b815260040160405180910390fd5b60025550505050565b600081815b845181101561360c576135f8828683815181106135eb576135eb6142ff565b60200260200101516138c8565b915080613604816144e1565b9150506135cc565b509392505050565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b60006136b0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166138f79092919063ffffffff16565b805190915015610c5757808060200190518101906136ce91906144fa565b610c575760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103ee565b6060600061373c8360026141a2565b6137479060026143fa565b6001600160401b0381111561375e5761375e613d18565b6040519080825280601f01601f191660200182016040528015613788576020820181803683370190505b509050600360fc1b816000815181106137a3576137a36142ff565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106137d2576137d26142ff565b60200101906001600160f81b031916908160001a90535060006137f68460026141a2565b6138019060016143fa565b90505b6001811115613879576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613835576138356142ff565b1a60f81b82828151811061384b5761384b6142ff565b60200101906001600160f81b031916908160001a90535060049490941c9361387281614517565b9050613804565b5083156113695760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016103ee565b60008183106138e4576000828152602084905260409020611369565b6000838152602083905260409020611369565b60606113668484600085856001600160a01b0385163b6139595760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103ee565b600080866001600160a01b03168587604051613975919061452e565b60006040518083038185875af1925050503d80600081146139b2576040519150601f19603f3d011682016040523d82523d6000602084013e6139b7565b606091505b50915091506139c78282866139d2565b979650505050505050565b606083156139e1575081611369565b8251156139f15782518084602001fd5b8160405162461bcd60e51b81526004016103ee9190613bbb565b600181811c90821680613a1f57607f821691505b6020821081036120f657634e487b7160e01b600052602260045260246000fd5b6000602080835260008454613a5381613a0b565b80848701526040600180841660008114613a745760018114613a8e57613abc565b60ff1985168984015283151560051b890183019550613abc565b896000528660002060005b85811015613ab45781548b8201860152908301908801613a99565b8a0184019650505b509398975050505050505050565b6001600160e01b0319811681146115fa57600080fd5b600060208284031215613af257600080fd5b813561136981613aca565b6001600160a01b03811681146115fa57600080fd5b80356001600160601b0381168114613b2957600080fd5b919050565b60008060408385031215613b4157600080fd5b8235613b4c81613afd565b9150613b5a60208401613b12565b90509250929050565b60005b83811015613b7e578181015183820152602001613b66565b838111156112dc5750506000910152565b60008151808452613ba7816020860160208601613b63565b601f01601f19169290920160200192915050565b6020815260006113696020830184613b8f565b600060208284031215613be057600080fd5b5035919050565b60008060408385031215613bfa57600080fd5b8235613c0581613afd565b946020939093013593505050565b600080600060608486031215613c2857600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052602160045260246000fd5b60068110613c7357634e487b7160e01b600052602160045260246000fd5b9052565b60208101610c2f8284613c55565b600080600060608486031215613c9a57600080fd5b8335613ca581613afd565b92506020840135613cb581613afd565b929592945050506040919091013590565b60008060408385031215613cd957600080fd5b50508035926020909101359150565b60008060408385031215613cfb57600080fd5b823591506020830135613d0d81613afd565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613d5657613d56613d18565b604052919050565b60006001600160401b03831115613d7757613d77613d18565b613d8a601f8401601f1916602001613d2e565b9050828152838383011115613d9e57600080fd5b828260208301376000602084830101529392505050565b600060208284031215613dc757600080fd5b81356001600160401b03811115613ddd57600080fd5b8201601f81018413613dee57600080fd5b6133c284823560208401613d5e565b600082601f830112613e0e57600080fd5b813560206001600160401b03821115613e2957613e29613d18565b8160051b613e38828201613d2e565b9283528481018201928281019087851115613e5257600080fd5b83870192505b848310156139c757823582529183019190830190613e58565b600080600060608486031215613e8657600080fd5b833592506020840135915060408401356001600160401b03811115613eaa57600080fd5b613eb686828701613dfd565b9150509250925092565b600060208284031215613ed257600080fd5b813561136981613afd565b600080600060608486031215613ef257600080fd5b833592506020840135613f0481613afd565b9150613f1260408501613b12565b90509250925092565b60008060208385031215613f2e57600080fd5b82356001600160401b0380821115613f4557600080fd5b818501915085601f830112613f5957600080fd5b813581811115613f6857600080fd5b8660208260051b8501011115613f7d57600080fd5b60209290920196919550909350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b8181101561233957613ffa838551613f8f565b9284019260809290920191600101613fe7565b6020808252825182820181905260009190848201906040850190845b8181101561233957835183529284019291840191600101614029565b60008060006060848603121561405a57600080fd5b833561406581613afd565b95602085013595506040909401359392505050565b80151581146115fa57600080fd5b6000806040838503121561409b57600080fd5b82356140a681613afd565b91506020830135613d0d8161407a565b600080600080608085870312156140cc57600080fd5b84356140d781613afd565b935060208501356140e781613afd565b92506040850135915060608501356001600160401b0381111561410957600080fd5b8501601f8101871361411a57600080fd5b61412987823560208401613d5e565b91505092959194509250565b60808101610c2f8284613f8f565b6000806040838503121561415657600080fd5b823561416181613afd565b91506020830135613d0d81613afd565b6040810161417f8285613c55565b6113696020830184613c55565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156141bc576141bc61418c565b500290565b6000826141de57634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156141f5576141f561418c565b500390565b601f821115610c5757600081815260208120601f850160051c810160208610156142215750805b601f850160051c820191505b818110156110715782815560010161422d565b81516001600160401b0381111561425957614259613d18565b61426d816142678454613a0b565b846141fa565b602080601f8311600181146142a2576000841561428a5750858301515b600019600386901b1c1916600185901b178555611071565b600085815260208120601f198616915b828110156142d1578886015182559484019460019091019084016142b2565b50858210156142ef5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b6000815461432281613a0b565b6001828116801561433a576001811461434f5761437e565b60ff198416875282151583028701945061437e565b8560005260208060002060005b858110156143755781548a82015290840190820161435c565b50505082870194505b5050505092915050565b60006143948286614315565b84516143a4818360208901613b63565b6139c781830186614315565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b6000821982111561440d5761440d61418c565b500190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061444590830184613b8f565b9695505050505050565b60006020828403121561446157600080fd5b815161136981613aca565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516144a4816017850160208801613b63565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516144d5816028840160208801613b63565b01602801949350505050565b6000600182016144f3576144f361418c565b5060010190565b60006020828403121561450c57600080fd5b81516113698161407a565b6000816145265761452661418c565b506000190190565b60008251614540818460208701613b63565b919091019291505056fed3e381736ec19ff322372203ec9cf7033b43f2396baedd7f2e07bda44473505097667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212205bb6e6df9050c658f0ea661b96224d04e033eeccb5b554c78ac30f6e9382d91664736f6c634300080f003343616e2774206d696e74206d6f7265207468616e2072656d61696e696e6720616c6c6f636174696f6e0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000e3dd3573e2fcebb1cf7729f1c6f517a0cf2f1a11000000000000000000000000c4ae79593e2f290c350ec4ab3ff130be9ad95c41000000000000000000000000000000000000000000000000000000000000002c68747470733a2f2f656e656674652e696e666f2f63656e746175726966792f636f6e74726163742e6a736f6e0000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106103c75760003560e01c806371fa5521116101f2578063a217fddf1161010d578063e303417e116100a0578063e985e9c51161006f578063e985e9c514610b75578063f2fde38b14610bbe578063f5b541a614610bde578063f708ba6a14610c0057600080fd5b8063e303417e14610b0a578063e5935c2814610b2a578063e6fd48bc14610b4a578063e8a3d48514610b6057600080fd5b8063b88d4fde116100dc578063b88d4fde14610a7d578063c23dc68f14610a9d578063c87b56dd14610aca578063d547741f14610aea57600080fd5b8063a217fddf14610a1f578063a22cb46514610a34578063a85adeab14610a54578063aea46d1214610a6a57600080fd5b806381b3e5751161018557806391d148541161015457806391d14854146109aa578063938e3d7b146109ca57806395d89b41146109ea57806399a2557a146109ff57600080fd5b806381b3e5751461091f5780638462151c1461093f5780638da5cb5b1461096c5780638dc251e31461098a57600080fd5b80637cb64759116101c15780637cb64759146108ac5780637e64c6fb146108cc5780637fa803c3146108df5780638056e87f146108ff57600080fd5b806371fa55211461082a578063749ee3851461084a57806375b238fc1461086a5780637a4e57151461088c57600080fd5b806330666a4d116102e2578063571349101161027557806366d003ac1161024457806366d003ac146107ba5780636817c76c146107df57806370a08231146107f5578063715018a61461081557600080fd5b8063571349101461073a5780635944c7531461074d5780635bbb21771461076d5780636352211e1461079a57600080fd5b80633ccfd60b116102b15780633ccfd60b146106c557806342842e0e146106da57806342966c68146106fa578063484b973c1461071a57600080fd5b806330666a4d1461064f5780633423e5481461066557806336568abe146106855780633bbed4a0146106a557600080fd5b806323b872dd1161035a5780632db11544116103295780632db11544146105e65780632eb4a7ab146105f95780632f2ff15d1461060f57806330176e131461062f57600080fd5b806323b872dd14610537578063248a9ca31461055757806329ee566c146105875780632a55205a146105a757600080fd5b8063095ea7b311610396578063095ea7b3146104ad57806318160ddd146104cd57806318eaa36a146104f0578063200d2ed21461051057600080fd5b806301ffc9a7146103fe57806304634d8d1461043357806306fdde0314610453578063081812fc1461047557600080fd5b366103f95734156103f75760196040516393c4c99f60e01b81526004016103ee9190613a3f565b60405180910390fd5b005b600080fd5b34801561040a57600080fd5b5061041e610419366004613ae0565b610c15565b60405190151581526020015b60405180910390f35b34801561043f57600080fd5b506103f761044e366004613b2e565b610c35565b34801561045f57600080fd5b50610468610c5c565b60405161042a9190613bbb565b34801561048157600080fd5b50610495610490366004613bce565b610cee565b6040516001600160a01b03909116815260200161042a565b3480156104b957600080fd5b506103f76104c8366004613be7565b610d32565b3480156104d957600080fd5b50600354600254035b60405190815260200161042a565b3480156104fc57600080fd5b506103f761050b366004613c13565b610dd2565b34801561051c57600080fd5b50600c5461052a9060ff1681565b60405161042a9190613c77565b34801561054357600080fd5b506103f7610552366004613c85565b610ee8565b34801561056357600080fd5b506104e2610572366004613bce565b60009081526020819052604090206001015490565b34801561059357600080fd5b50600d54610495906001600160a01b031681565b3480156105b357600080fd5b506105c76105c2366004613cc6565b611079565b604080516001600160a01b03909316835260208301919091520161042a565b6103f76105f4366004613bce565b611125565b34801561060557600080fd5b506104e260125481565b34801561061b57600080fd5b506103f761062a366004613ce8565b6112e2565b34801561063b57600080fd5b506103f761064a366004613db5565b611307565b34801561065b57600080fd5b506104e2600f5481565b34801561067157600080fd5b5061041e610680366004613e71565b611359565b34801561069157600080fd5b506103f76106a0366004613ce8565b611370565b3480156106b157600080fd5b506103f76106c0366004613ec0565b6113ee565b3480156106d157600080fd5b506103f7611453565b3480156106e657600080fd5b506103f76106f5366004613c85565b61158f565b34801561070657600080fd5b506103f7610715366004613bce565b6115aa565b34801561072657600080fd5b506103f7610735366004613be7565b6115fd565b6103f7610748366004613e71565b611621565b34801561075957600080fd5b506103f7610768366004613edd565b61186e565b34801561077957600080fd5b5061078d610788366004613f1b565b611891565b60405161042a9190613fcb565b3480156107a657600080fd5b506104956107b5366004613bce565b61195c565b3480156107c657600080fd5b50600c546104959061010090046001600160a01b031681565b3480156107eb57600080fd5b506104e2600e5481565b34801561080157600080fd5b506104e2610810366004613ec0565b611967565b34801561082157600080fd5b506103f76119b5565b34801561083657600080fd5b506103f7610845366004613cc6565b6119c9565b34801561085657600080fd5b506103f7610865366004613bce565b611adf565b34801561087657600080fd5b506104e26000805160206145ab83398151915281565b34801561089857600080fd5b506103f76108a7366004613bce565b611bd0565b3480156108b857600080fd5b506103f76108c7366004613bce565b611d19565b6103f76108da366004613e71565b611d63565b3480156108eb57600080fd5b506104e26108fa366004613ec0565b611f73565b34801561090b57600080fd5b506103f761091a366004613c13565b6120fc565b34801561092b57600080fd5b506103f761093a366004613db5565b6121dc565b34801561094b57600080fd5b5061095f61095a366004613ec0565b61223d565b60405161042a919061400d565b34801561097857600080fd5b506001546001600160a01b0316610495565b34801561099657600080fd5b506103f76109a5366004613ec0565b612345565b3480156109b657600080fd5b5061041e6109c5366004613ce8565b6123a5565b3480156109d657600080fd5b506103f76109e5366004613db5565b6123ce565b3480156109f657600080fd5b50610468612420565b348015610a0b57600080fd5b5061095f610a1a366004614045565b61242f565b348015610a2b57600080fd5b506104e2600081565b348015610a4057600080fd5b506103f7610a4f366004614088565b6125a6565b348015610a6057600080fd5b506104e260115481565b6103f7610a78366004613e71565b61263b565b348015610a8957600080fd5b506103f7610a983660046140b6565b612848565b348015610aa957600080fd5b50610abd610ab8366004613bce565b61288c565b60405161042a9190614135565b348015610ad657600080fd5b50610468610ae5366004613bce565b612904565b348015610af657600080fd5b506103f7610b05366004613ce8565b612965565b348015610b1657600080fd5b506103f7610b25366004614143565b61298a565b348015610b3657600080fd5b506103f7610b45366004613c13565b612a0a565b348015610b5657600080fd5b506104e260105481565b348015610b6c57600080fd5b50610468612a93565b348015610b8157600080fd5b5061041e610b90366004614143565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205460ff1690565b348015610bca57600080fd5b506103f7610bd9366004613ec0565b612aa2565b348015610bea57600080fd5b506104e260008051602061456b83398151915281565b348015610c0c57600080fd5b506103f7612b18565b6000610c2082612c0f565b80610c2f5750610c2f82612c5d565b92915050565b6000805160206145ab833981519152610c4d81612c82565b610c578383612c8c565b505050565b606060048054610c6b90613a0b565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9790613a0b565b8015610ce45780601f10610cb957610100808354040283529160200191610ce4565b820191906000526020600020905b815481529060010190602001808311610cc757829003601f168201915b5050505050905090565b6000610cf982612d46565b610d16576040516333d1c03960e21b815260040160405180910390fd5b506000908152600860205260409020546001600160a01b031690565b6000610d3d8261195c565b9050336001600160a01b03821614610d7657610d598133610b90565b610d76576040516367d9dca160e11b815260040160405180910390fd5b60008281526008602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60008051602061456b833981519152610dea81612c82565b426000600c5460ff166005811115610e0457610e04613c3f565b14610e2c57600c54604051637634defd60e01b81526103ee9160ff1690600090600401614171565b6010548111610e5457601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003610e7d57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601283905560108590556011849055600c805460ff1916600190811790915566c3663566a58000600e556003600f555b60008051602061454b833981519152601054601154604051610ed9929190918252602082015260400190565b60405180910390a25050505050565b6000610ef382612d6e565b9050836001600160a01b0316816001600160a01b031614610f265760405162a1148160e81b815260040160405180910390fd5b60008281526008602052604090208054610f528187335b6001600160a01b039081169116811491141790565b610f7d57610f608633610b90565b610f7d57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610fa457604051633a954ecd60e21b815260040160405180910390fd5b8015610faf57600082555b6001600160a01b038681166000908152600760205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260066020526040812091909155600160e11b841690036110415760018401600081815260066020526040812054900361103f57600254811461103f5760008181526006602052604090208490555b505b83856001600160a01b0316876001600160a01b031660008051602061458b83398151915260405160405180910390a45b505050505050565b6000828152600b602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916110ee575060408051808201909152600a546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101516000906127109061110d906001600160601b0316876141a2565b61111791906141c1565b915196919550909350505050565b426003600c5460ff16600581111561113f5761113f613c3f565b1461116757600c54604051637634defd60e01b81526103ee9160ff1690600390600401614171565b601054811161118f57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6010546000036111b857601054604051630d8d0ae760e41b81526004016103ee91815260200190565b81600081600e546111c991906141a2565b90508034146111ed5760405163cfde146160e01b81523460048201526024016103ee565b60115442111561121657601154604051636128b0ff60e11b81526004016103ee91815260200190565b3360009081526023602052604090205460ff1661125757336000908152602360209081526040808320805460ff19166001179055600f54601f909252909120555b6000841161127857604051630373865960e11b815260040160405180910390fd5b336000908152601f60205260409020548411156112ab5760166040516393c4c99f60e01b81526004016103ee9190613a3f565b336000908152601f6020526040812080548692906112ca9084906141e3565b909155506112dc905033856000612dd5565b50505050565b6000828152602081905260409020600101546112fd81612c82565b610c578383612ef3565b6000805160206145ab83398151915261131f81612c82565b601361132b8382614240565b506040517f7cb256135e6848c25e7fa75bd63422b863cce128733d167b3dca5c3f1d1e95c790600090a15050565b6000611366828585612f77565b90505b9392505050565b6001600160a01b03811633146113e05760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016103ee565b6113ea8282612f8d565b5050565b6000805160206145ab83398151915261140681612c82565b600c8054610100600160a81b0319166101006001600160a01b038516021790556040517f76ebe21503c8eefd1ef7bfbb7c5a6a515a5b82d2190512af021e18daf62dcfb890600090a15050565b6000805160206145ab83398151915261146b81612c82565b600c5461010090046001600160a01b03166114bf576040516393c4c99f60e01b815260206004820152601360248201527214d95d081c9958da5c1a595b9d08199a5c9cdd606a1b60448201526064016103ee565b600c5460405147916000916101009091046001600160a01b031690839060006040518083038185875af1925050503d8060008114611519576040519150601f19603f3d011682016040523d82523d6000602084013e61151e565b606091505b505090508061154357601b6040516393c4c99f60e01b81526004016103ee9190613a3f565b600c546040518381526101009091046001600160a01b0316907f8353ffcac0876ad14e226d9783c04540bfebf13871e868157d2a391cad98e918906020015b60405180910390a2505050565b610c5783838360405180602001604052806000815250612848565b6115b381612d46565b6115ef576040516393c4c99f60e01b815260206004820152600c60248201526b111a591b89dd08195e1a5cdd60a21b60448201526064016103ee565b6115fa816001612ff2565b50565b6000805160206145ab83398151915261161581612c82565b610c5783836001612dd5565b426002600c5460ff16600581111561163b5761163b613c3f565b1461166357600c54604051637634defd60e01b81526103ee9160ff1690600290600401614171565b601054811161168b57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6010546000036116b457601054604051630d8d0ae760e41b81526004016103ee91815260200190565b83600081600e546116c591906141a2565b90508034146116e95760405163cfde146160e01b81523460048201526024016103ee565b60115442111561171257601154604051636128b0ff60e11b81526004016103ee91815260200190565b3360009081526022602052604090205460ff166117d2576040516001600160601b03193360601b1660208201528590603401604051602081830303815290604052805190602001201461177b5760176040516393c4c99f60e01b81526004016103ee9190613a3f565b6117886012548686611359565b6117a85760186040516393c4c99f60e01b81526004016103ee9190613a3f565b336000908152602260209081526040808320805460ff19166001179055600f54601e909252909120555b600086116117f357604051630373865960e11b815260040160405180910390fd5b336000908152601e60205260409020548611156118265760166040516393c4c99f60e01b81526004016103ee9190613a3f565b85601e6000335b6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461185c91906141e3565b90915550611071905033876000612dd5565b6000805160206145ab83398151915261188681612c82565b6112dc84848461312b565b6060816000816001600160401b038111156118ae576118ae613d18565b60405190808252806020026020018201604052801561190057816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816118cc5790505b50905060005b8281146119535761192e868683818110611922576119226142ff565b9050602002013561288c565b828281518110611940576119406142ff565b6020908102919091010152600101611906565b50949350505050565b6000610c2f82612d6e565b60006001600160a01b038216611990576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600760205260409020546001600160401b031690565b6119bd6131f6565b6119c76000613250565b565b60008051602061456b8339815191526119e181612c82565b426002600c5460ff1660058111156119fb576119fb613c3f565b14611a2357600c54604051637634defd60e01b81526103ee9160ff1690600290600401614171565b6010548111611a4b57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003611a7457601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601084905560118390556000601255600c805460ff1916600390811790915567016345785d8a0000600e556001600f555b60008051602061454b833981519152601054601154604051611ad1929190918252602082015260400190565b60405180910390a250505050565b60008051602061456b833981519152611af781612c82565b426003600c5460ff166005811115611b1157611b11613c3f565b14611b3957600c54604051637634defd60e01b81526103ee9160ff1690600390600401614171565b6010548111611b6157601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003611b8a57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b60108390556000601155600c805460ff1916600490811790915560008051602061454b833981519152601054601154604051611582929190918252602082015260400190565b6000805160206145ab833981519152611be881612c82565b426003600c5460ff166005811115611c0257611c02613c3f565b14611c2a57600c54604051637634defd60e01b81526103ee9160ff1690600390600401614171565b6010548111611c5257601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003611c7b57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6005831115611ce6576040516393c4c99f60e01b815260206004820152603060248201527f43616e6e6f742073657420746f206d696e74206d6f7265207468616e2066697660448201526f32903a37b5b2b739903832b9103a3c1760811b60648201526084016103ee565b600f8390556040517f8f8d067a33478dc5bdb0e420040799235781948260a19b9196160eba357c5fc590600090a1505050565b6000805160206145ab833981519152611d3181612c82565b60128290556040517f337d84549cb00ae45c0df486a93deb72962c6783c9b2677bf7049772a9f733b590600090a15050565b426001600c5460ff166005811115611d7d57611d7d613c3f565b14611da557600c54604051637634defd60e01b81526103ee9160ff1690600190600401614171565b6010548111611dcd57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003611df657601054604051630d8d0ae760e41b81526004016103ee91815260200190565b83600081600e54611e0791906141a2565b9050803414611e2b5760405163cfde146160e01b81523460048201526024016103ee565b601154421115611e5457601154604051636128b0ff60e11b81526004016103ee91815260200190565b3360009081526021602052604090205460ff16611f14576040516001600160601b03193360601b16602082015285906034016040516020818303038152906040528051906020012014611ebd5760176040516393c4c99f60e01b81526004016103ee9190613a3f565b611eca6012548686611359565b611eea5760186040516393c4c99f60e01b81526004016103ee9190613a3f565b336000908152602160209081526040808320805460ff19166001179055600f54601d909252909120555b60008611611f3557604051630373865960e11b815260040160405180910390fd5b336000908152601d6020526040902054861115611f685760166040516393c4c99f60e01b81526004016103ee9190613a3f565b85601d60003361182d565b600c5460009060ff1681816005811115611f8f57611f8f613c3f565b03611fd9576001600160a01b038316600090815260208052604090205460ff16611fbc5750600592915050565b50506001600160a01b03166000908152601c602052604090205490565b6001816005811115611fed57611fed613c3f565b03612038576001600160a01b03831660009081526021602052604090205460ff1661201b5750600392915050565b50506001600160a01b03166000908152601d602052604090205490565b600281600581111561204c5761204c613c3f565b03612097576001600160a01b03831660009081526022602052604090205460ff1661207a5750600192915050565b50506001600160a01b03166000908152601e602052604090205490565b60038160058111156120ab576120ab613c3f565b036120f6576001600160a01b03831660009081526023602052604090205460ff166120d95750600192915050565b50506001600160a01b03166000908152601f602052604090205490565b50919050565b60008051602061456b83398151915261211481612c82565b426001600c5460ff16600581111561212e5761212e613c3f565b1461215657600c54604051637634defd60e01b81526103ee9160ff1690600190600401614171565b601054811161217e57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6010546000036121a757601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601283905560108590556011849055600c805460ff1916600290811790915567010a741a46278000600e556001600f55610ead565b6000805160206145ab8339815191526121f481612c82565b60156122008382614240565b507f2e0db0a61141ee97c3d706ac7d959541ab3ece3af117b52b798dc8459c431e1c60156040516122319190613a3f565b60405180910390a15050565b6060600080600061224d85611967565b90506000816001600160401b0381111561226957612269613d18565b604051908082528060200260200182016040528015612292578160200160208202803683370190505b5090506122bf60408051608081018252600080825260208201819052918101829052606081019190915290565b60005b838614612339576122d2816132a2565b915081604001516123315781516001600160a01b0316156122f257815194505b876001600160a01b0316856001600160a01b0316036123315780838780600101985081518110612324576123246142ff565b6020026020010181815250505b6001016122c2565b50909695505050505050565b6000805160206145ab83398151915261235d81612c82565b600d80546001600160a01b0319166001600160a01b0384161790556040517fa5d62f6e89147c44beb767502a83a9880a705f995168366220b41906f169817590600090a15050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000805160206145ab8339815191526123e681612c82565b60146123f28382614240565b506040517fbae9dd3fac3ffb892e06f64e18c5e8877d858bd5f1e1e142ff2eb2f60ba625ad90600090a15050565b606060058054610c6b90613a0b565b606081831061245157604051631960ccad60e11b815260040160405180910390fd5b60008061245d60025490565b90508084111561246b578093505b600061247687611967565b905084861015612495578585038181101561248f578091505b50612499565b5060005b6000816001600160401b038111156124b3576124b3613d18565b6040519080825280602002602001820160405280156124dc578160200160208202803683370190505b509050816000036124f257935061136992505050565b60006124fd8861288c565b90506000816040015161250e575080515b885b8881141580156125205750848714155b156125955761252e816132a2565b9250826040015161258d5782516001600160a01b03161561254e57825191505b8a6001600160a01b0316826001600160a01b03160361258d5780848880600101995081518110612580576125806142ff565b6020026020010181815250505b600101612510565b505050928352509095945050505050565b336001600160a01b038316036125cf5760405163b06307db60e01b815260040160405180910390fd5b3360008181526009602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b426000600c5460ff16600581111561265557612655613c3f565b1461267d57600c54604051637634defd60e01b81526103ee9160ff1690600090600401614171565b60105481116126a557601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6010546000036126ce57601054604051630d8d0ae760e41b81526004016103ee91815260200190565b83600081600e546126df91906141a2565b90508034146127035760405163cfde146160e01b81523460048201526024016103ee565b60115442111561272c57601154604051636128b0ff60e11b81526004016103ee91815260200190565b33600090815260208052604090205460ff166127e9576040516001600160601b03193360601b166020820152859060340160405160208183030381529060405280519060200120146127945760176040516393c4c99f60e01b81526004016103ee9190613a3f565b6127a16012548686611359565b6127c15760186040516393c4c99f60e01b81526004016103ee9190613a3f565b33600090815260208080526040808320805460ff19166001179055600f54601c909252909120555b6000861161280a57604051630373865960e11b815260040160405180910390fd5b336000908152601c602052604090205486111561283d5760166040516393c4c99f60e01b81526004016103ee9190613a3f565b85601c60003361182d565b612853848484610ee8565b6001600160a01b0383163b156112dc5761286f848484846132de565b6112dc576040516368d2bf6b60e11b815260040160405180910390fd5b60408051608080820183526000808352602080840182905283850182905260608085018390528551938401865282845290830182905293820181905292810183905290915060025483106128e05792915050565b6128e9836132a2565b90508060400151156128fb5792915050565b611369836133ca565b60606013805461291390613a0b565b90506000036129315760405180602001604052806000815250610c2f565b601361293c836133ff565b601560405160200161295093929190614388565b60405160208183030381529060405292915050565b60008281526020819052604090206001015461298081612c82565b610c578383612f8d565b6000805160206145ab8339815191526129a281612c82565b60006129ad84611967565b90506129c36001600160a01b0385168483613437565b80836001600160a01b0316856001600160a01b03167f184eded68f65d6d476b95be4e471503d6fb58f657a974292cd02928af347582360405160405180910390a450505050565b60008051602061456b833981519152612a2281612c82565b6000600c5460ff166005811115612a3b57612a3b613c3f565b14612a6357600c5460ff166000604051637634defd60e01b81526004016103ee929190614171565b601282905560108490556011839055600c805460ff1916905566b1a2bc2ec50000600e556005600f556000611aa5565b606060148054610c6b90613a0b565b612aaa6131f6565b6001600160a01b038116612b0f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103ee565b6115fa81613250565b60008051602061456b833981519152612b3081612c82565b426004600c5460ff166005811115612b4a57612b4a613c3f565b14612b7157600c54604051637634defd60e01b81526103ee9160ff16906004908101614171565b6010548111612b9957601054604051630d8d0ae760e41b81526004016103ee91815260200190565b601054600003612bc257601054604051630d8d0ae760e41b81526004016103ee91815260200190565b6000601055600c805460ff1916600590811790915560008051602061454b833981519152601054601154604051612c03929190918252602082015260400190565b60405180910390a25050565b60006301ffc9a760e01b6001600160e01b031983161480612c4057506380ac58cd60e01b6001600160e01b03198316145b80610c2f5750506001600160e01b031916635b5e139f60e01b1490565b60006001600160e01b0319821663152a902d60e11b1480610c2f5750610c2f82612c0f565b6115fa8133613489565b6127106001600160601b0382161115612cb75760405162461bcd60e51b81526004016103ee906143b0565b6001600160a01b038216612d0d5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016103ee565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600a55565b600060025482108015610c2f575050600090815260066020526040902054600160e01b161590565b600081600254811015612dbc5760008181526006602052604081205490600160e01b82169003612dba575b80600003611369575060001901600081815260066020526040902054612d99565b505b604051636f96cda160e11b815260040160405180910390fd5b6000612de46003546002540390565b9050611388612df384836143fa565b1115612e1557601a6040516393c4c99f60e01b81526004016103ee9190613a3f565b8180612e235750600f548311155b612e6f5760405162461bcd60e51b815260206004820152601760248201527f537572706173736573206d61784974656d73506572547800000000000000000060448201526064016103ee565b612e7984846134ed565b6000612e8460025490565b600c5490915060ff166005811115612e9e57612e9e613c3f565b612ea96001836141e3565b866001600160a01b03167fc18738b1be8b64e92125eb15627eb8465afe416c501eaaadbdeeccab1944e11987604051612ee491815260200190565b60405180910390a45050505050565b612efd82826123a5565b6113ea576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055612f333390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082612f8485846135c7565b14949350505050565b612f9782826123a5565b156113ea576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000612ffd83612d6e565b90508060008061301b86600090815260086020526040902080549091565b91509150841561305b57613030818433610f3d565b61305b5761303e8333610b90565b61305b57604051632ce44b5f60e11b815260040160405180910390fd5b801561306657600082555b6001600160a01b038316600081815260076020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260066020526040812091909155600160e11b851690036130f4576001860160008181526006602052604081205490036130f25760025481146130f25760008181526006602052604090208590555b505b60405186906000906001600160a01b0386169060008051602061458b833981519152908390a4505060038054600101905550505050565b6127106001600160601b03821611156131565760405162461bcd60e51b81526004016103ee906143b0565b6001600160a01b0382166131ac5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d6574657273000000000060448201526064016103ee565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600b90529190942093519051909116600160a01b029116179055565b6001546001600160a01b031633146119c75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ee565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260066020526040902054610c2f90613614565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613313903390899088908890600401614412565b6020604051808303816000875af192505050801561334e575060408051601f3d908101601f1916820190925261334b9181019061444f565b60015b6133ac573d80801561337c576040519150601f19603f3d011682016040523d82523d6000602084013e613381565b606091505b5080516000036133a4576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b604080516080810182526000808252602082018190529181018290526060810191909152610c2f6133fa83612d6e565b613614565b604080516080019081905280825b600183039250600a81066030018353600a90048061340d5750819003601f19909101908152919050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610c5790849061365b565b61349382826123a5565b6113ea576134ab816001600160a01b0316601461372d565b6134b683602061372d565b6040516020016134c792919061446c565b60408051601f198184030181529082905262461bcd60e51b82526103ee91600401613bbb565b60025460008290036135125760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526007602090815260408083208054680100000000000000018802019055848352600690915281206001851460e11b4260a01b1783179055828401908390839060008051602061458b8339815191528180a4600183015b81811461359d578083600060008051602061458b833981519152600080a4600101613577565b50816000036135be57604051622e076360e81b815260040160405180910390fd5b60025550505050565b600081815b845181101561360c576135f8828683815181106135eb576135eb6142ff565b60200260200101516138c8565b915080613604816144e1565b9150506135cc565b509392505050565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b60006136b0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166138f79092919063ffffffff16565b805190915015610c5757808060200190518101906136ce91906144fa565b610c575760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103ee565b6060600061373c8360026141a2565b6137479060026143fa565b6001600160401b0381111561375e5761375e613d18565b6040519080825280601f01601f191660200182016040528015613788576020820181803683370190505b509050600360fc1b816000815181106137a3576137a36142ff565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106137d2576137d26142ff565b60200101906001600160f81b031916908160001a90535060006137f68460026141a2565b6138019060016143fa565b90505b6001811115613879576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613835576138356142ff565b1a60f81b82828151811061384b5761384b6142ff565b60200101906001600160f81b031916908160001a90535060049490941c9361387281614517565b9050613804565b5083156113695760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016103ee565b60008183106138e4576000828152602084905260409020611369565b6000838152602083905260409020611369565b60606113668484600085856001600160a01b0385163b6139595760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103ee565b600080866001600160a01b03168587604051613975919061452e565b60006040518083038185875af1925050503d80600081146139b2576040519150601f19603f3d011682016040523d82523d6000602084013e6139b7565b606091505b50915091506139c78282866139d2565b979650505050505050565b606083156139e1575081611369565b8251156139f15782518084602001fd5b8160405162461bcd60e51b81526004016103ee9190613bbb565b600181811c90821680613a1f57607f821691505b6020821081036120f657634e487b7160e01b600052602260045260246000fd5b6000602080835260008454613a5381613a0b565b80848701526040600180841660008114613a745760018114613a8e57613abc565b60ff1985168984015283151560051b890183019550613abc565b896000528660002060005b85811015613ab45781548b8201860152908301908801613a99565b8a0184019650505b509398975050505050505050565b6001600160e01b0319811681146115fa57600080fd5b600060208284031215613af257600080fd5b813561136981613aca565b6001600160a01b03811681146115fa57600080fd5b80356001600160601b0381168114613b2957600080fd5b919050565b60008060408385031215613b4157600080fd5b8235613b4c81613afd565b9150613b5a60208401613b12565b90509250929050565b60005b83811015613b7e578181015183820152602001613b66565b838111156112dc5750506000910152565b60008151808452613ba7816020860160208601613b63565b601f01601f19169290920160200192915050565b6020815260006113696020830184613b8f565b600060208284031215613be057600080fd5b5035919050565b60008060408385031215613bfa57600080fd5b8235613c0581613afd565b946020939093013593505050565b600080600060608486031215613c2857600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052602160045260246000fd5b60068110613c7357634e487b7160e01b600052602160045260246000fd5b9052565b60208101610c2f8284613c55565b600080600060608486031215613c9a57600080fd5b8335613ca581613afd565b92506020840135613cb581613afd565b929592945050506040919091013590565b60008060408385031215613cd957600080fd5b50508035926020909101359150565b60008060408385031215613cfb57600080fd5b823591506020830135613d0d81613afd565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613d5657613d56613d18565b604052919050565b60006001600160401b03831115613d7757613d77613d18565b613d8a601f8401601f1916602001613d2e565b9050828152838383011115613d9e57600080fd5b828260208301376000602084830101529392505050565b600060208284031215613dc757600080fd5b81356001600160401b03811115613ddd57600080fd5b8201601f81018413613dee57600080fd5b6133c284823560208401613d5e565b600082601f830112613e0e57600080fd5b813560206001600160401b03821115613e2957613e29613d18565b8160051b613e38828201613d2e565b9283528481018201928281019087851115613e5257600080fd5b83870192505b848310156139c757823582529183019190830190613e58565b600080600060608486031215613e8657600080fd5b833592506020840135915060408401356001600160401b03811115613eaa57600080fd5b613eb686828701613dfd565b9150509250925092565b600060208284031215613ed257600080fd5b813561136981613afd565b600080600060608486031215613ef257600080fd5b833592506020840135613f0481613afd565b9150613f1260408501613b12565b90509250925092565b60008060208385031215613f2e57600080fd5b82356001600160401b0380821115613f4557600080fd5b818501915085601f830112613f5957600080fd5b813581811115613f6857600080fd5b8660208260051b8501011115613f7d57600080fd5b60209290920196919550909350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b8181101561233957613ffa838551613f8f565b9284019260809290920191600101613fe7565b6020808252825182820181905260009190848201906040850190845b8181101561233957835183529284019291840191600101614029565b60008060006060848603121561405a57600080fd5b833561406581613afd565b95602085013595506040909401359392505050565b80151581146115fa57600080fd5b6000806040838503121561409b57600080fd5b82356140a681613afd565b91506020830135613d0d8161407a565b600080600080608085870312156140cc57600080fd5b84356140d781613afd565b935060208501356140e781613afd565b92506040850135915060608501356001600160401b0381111561410957600080fd5b8501601f8101871361411a57600080fd5b61412987823560208401613d5e565b91505092959194509250565b60808101610c2f8284613f8f565b6000806040838503121561415657600080fd5b823561416181613afd565b91506020830135613d0d81613afd565b6040810161417f8285613c55565b6113696020830184613c55565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156141bc576141bc61418c565b500290565b6000826141de57634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156141f5576141f561418c565b500390565b601f821115610c5757600081815260208120601f850160051c810160208610156142215750805b601f850160051c820191505b818110156110715782815560010161422d565b81516001600160401b0381111561425957614259613d18565b61426d816142678454613a0b565b846141fa565b602080601f8311600181146142a2576000841561428a5750858301515b600019600386901b1c1916600185901b178555611071565b600085815260208120601f198616915b828110156142d1578886015182559484019460019091019084016142b2565b50858210156142ef5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b6000815461432281613a0b565b6001828116801561433a576001811461434f5761437e565b60ff198416875282151583028701945061437e565b8560005260208060002060005b858110156143755781548a82015290840190820161435c565b50505082870194505b5050505092915050565b60006143948286614315565b84516143a4818360208901613b63565b6139c781830186614315565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b6000821982111561440d5761440d61418c565b500190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061444590830184613b8f565b9695505050505050565b60006020828403121561446157600080fd5b815161136981613aca565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516144a4816017850160208801613b63565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516144d5816028840160208801613b63565b01602801949350505050565b6000600182016144f3576144f361418c565b5060010190565b60006020828403121561450c57600080fd5b81516113698161407a565b6000816145265761452661418c565b506000190190565b60008251614540818460208701613b63565b919091019291505056fed3e381736ec19ff322372203ec9cf7033b43f2396baedd7f2e07bda44473505097667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212205bb6e6df9050c658f0ea661b96224d04e033eeccb5b554c78ac30f6e9382d91664736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000e3dd3573e2fcebb1cf7729f1c6f517a0cf2f1a11000000000000000000000000c4ae79593e2f290c350ec4ab3ff130be9ad95c41000000000000000000000000000000000000000000000000000000000000002c68747470733a2f2f656e656674652e696e666f2f63656e746175726966792f636f6e74726163742e6a736f6e0000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : __contractURI (string): https://enefte.info/centaurify/contract.json
Arg [1] : _operator (address): 0xE3DD3573E2fCEbB1CF7729f1C6f517A0cf2f1A11
Arg [2] : _royalty (address): 0xC4AE79593E2F290C350eC4Ab3Ff130bE9AD95C41
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 000000000000000000000000e3dd3573e2fcebb1cf7729f1c6f517a0cf2f1a11
Arg [2] : 000000000000000000000000c4ae79593e2f290c350ec4ab3ff130be9ad95c41
Arg [3] : 000000000000000000000000000000000000000000000000000000000000002c
Arg [4] : 68747470733a2f2f656e656674652e696e666f2f63656e746175726966792f63
Arg [5] : 6f6e74726163742e6a736f6e0000000000000000000000000000000000000000
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.