Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
WorldsImplementation
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// Sources flattened with hardhat v2.22.2 https://hardhat.org // SPDX-License-Identifier: MIT // File contracts/WorldsImplementation.sol /** *Submitted for verification at Etherscan.io on 2023-11-16 */ // File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol) // Original license: SPDX_License_Identifier: MIT pragma solidity ^0.8.20; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the Merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates Merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** *@dev The multiproof provided is not valid. */ error MerkleProofInvalidMultiproof(); /** * @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} */ 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. */ 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} */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds 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 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // 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 from 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) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds 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 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // 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 from 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) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Sorts the pair (a, b) and hashes the result. */ function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } /** * @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory. */ 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) } } } // File: @limitbreak/creator-token-contracts/contracts/minting/SequentialMintBase.sol pragma solidity ^0.8.4; /** * @title SequentialMintBase * @author Limit Break, Inc. * @dev In order to support multiple sequential mint mix-ins in a single contract, the token id counter has been moved to this based contract. */ abstract contract SequentialMintBase { /// @dev The next token id that will be minted - if zero, the next minted token id will be 1 uint256 private nextTokenIdCounter; /// @dev Minting mixins must use this function to advance the next token id counter. function _initializeNextTokenIdCounter() internal { if(nextTokenIdCounter == 0) { nextTokenIdCounter = 1; } } /// @dev Minting mixins must use this function to advance the next token id counter. function _advanceNextTokenIdCounter(uint256 amount) internal { nextTokenIdCounter += amount; } /// @dev Returns the next token id counter value function getNextTokenId() public view returns (uint256) { return nextTokenIdCounter; } } // File: @limitbreak/creator-token-contracts/contracts/minting/MintTokenBase.sol pragma solidity ^0.8.4; /** * @title MintTokenBase * @author Limit Break, Inc. * @dev Standard mint token interface for mixins to mint tokens. */ abstract contract MintTokenBase { /// @dev Inheriting contracts must implement the token minting logic - inheriting contract should use _mint, or something equivalent /// The minting function should throw if `to` is address(0) function _mintToken(address to, uint256 tokenId) internal virtual; } // File: @openzeppelin/contracts/utils/Context.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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; } } // File: @limitbreak/creator-token-contracts/contracts/access/OwnablePermissions.sol pragma solidity ^0.8.4; abstract contract OwnablePermissions is Context { function _requireCallerIsContractOwner() internal view virtual; } // File: @limitbreak/creator-token-contracts/contracts/minting/MaxSupply.sol pragma solidity ^0.8.4; /** * @title MaxSupplyBase * @author Limit Break, Inc. * @notice In order to support multiple contracts with a global maximum supply, the max supply has been moved to this base contract. * @dev Inheriting contracts must implement `_mintToken`. */ abstract contract MaxSupplyBase is OwnablePermissions, MintTokenBase, SequentialMintBase { error MaxSupplyBase__CannotClaimMoreThanMaximumAmountOfOwnerMints(); error MaxSupplyBase__CannotMintToAddressZero(); error MaxSupplyBase__MaxSupplyCannotBeSetToMaxUint256(); error MaxSupplyBase__MaxSupplyExceeded(); error MaxSupplyBase__MintedQuantityMustBeGreaterThanZero(); /// @dev The global maximum supply for a contract. Inheriting contracts must reference this maximum supply in addition to any other /// @dev constraints they are looking to enforce. /// @dev If `_maxSupply` is set to zero, the global max supply will match the combined max allowable mints for each minting mix-in used. /// @dev If the `_maxSupply` is below the total sum of allowable mints, the `_maxSupply` will be prioritized. uint256 private _maxSupply; /// @dev The number of tokens remaining to mint via owner mint. /// @dev This can be used to guarantee minting out by allowing the owner to mint unclaimed supply after the public mint is completed. uint256 private _remainingOwnerMints; /// @dev Emitted when the maximum supply is initialized event MaxSupplyInitialized(uint256 maxSupply, uint256 maxOwnerMints); /// @notice Mints the specified quantity to the provided address /// /// Throws when the caller is not the owner /// Throws when provided quantity is zero /// Throws when provided address is address zero /// Throws if the quantity minted plus amount already minted exceeds the maximum amount mintable by the owner function ownerMint(address to, uint256 quantity) external { _requireCallerIsContractOwner(); if(to == address(0)) { revert MaxSupplyBase__CannotMintToAddressZero(); } if(quantity > _remainingOwnerMints) { revert MaxSupplyBase__CannotClaimMoreThanMaximumAmountOfOwnerMints(); } _requireLessThanMaxSupply(mintedSupply() + quantity); unchecked { _remainingOwnerMints -= quantity; } _mintBatch(to, quantity); } function maxSupply() public virtual view returns (uint256) { return _maxSupply; } function remainingOwnerMints() public view returns (uint256) { return _remainingOwnerMints; } function mintedSupply() public view returns (uint256) { return getNextTokenId() - 1; } function _setMaxSupplyAndOwnerMints(uint256 maxSupply_, uint256 maxOwnerMints_) internal { if(maxSupply_ == type(uint256).max) { revert MaxSupplyBase__MaxSupplyCannotBeSetToMaxUint256(); } _maxSupply = maxSupply_; _remainingOwnerMints = maxOwnerMints_; _initializeNextTokenIdCounter(); emit MaxSupplyInitialized(maxSupply_, maxOwnerMints_); } function _requireLessThanMaxSupply(uint256 supplyAfterMint) internal view { uint256 maxSupplyCache = maxSupply(); if (maxSupplyCache > 0) { if (supplyAfterMint > maxSupplyCache) { revert MaxSupplyBase__MaxSupplyExceeded(); } } } /// @dev Batch mints the specified quantity to the specified address /// Throws if quantity is zero /// Throws if `to` is a smart contract that does not implement IERC721 receiver function _mintBatch(address to, uint256 quantity) internal returns (uint256 startTokenId, uint256 endTokenId) { if(quantity == 0) { revert MaxSupplyBase__MintedQuantityMustBeGreaterThanZero(); } startTokenId = getNextTokenId(); unchecked { endTokenId = startTokenId + quantity - 1; _advanceNextTokenIdCounter(quantity); for(uint256 i = 0; i < quantity; ++i) { _mintToken(to, startTokenId + i); } } return (startTokenId, endTokenId); } } /** * @title MaxSupply * @author Limit Break, Inc. * @notice Constructable implementation of the MaxSupplyBase mixin. */ abstract contract MaxSupply is MaxSupplyBase { uint256 internal immutable _maxSupplyImmutable; constructor(uint256 maxSupply_, uint256 maxOwnerMints_) { _setMaxSupplyAndOwnerMints(maxSupply_, maxOwnerMints_); _maxSupplyImmutable = maxSupply_; } function maxSupply() public virtual view override returns (uint256) { return _maxSupplyImmutable; } } /** * @title MaxSupplyInitializable * @author Limit Break, Inc. * @notice Initializable implementation of the MaxSupplyBase mixin to allow for EIP-1167 clones. */ abstract contract MaxSupplyInitializable is MaxSupplyBase { error InitializableMaxSupplyBase__MaxSupplyAlreadyInitialized(); /// @dev Boolean value set during initialization to prevent reinitializing the value. bool private _maxSupplyInitialized; function initializeMaxSupply(uint256 maxSupply_, uint256 maxOwnerMints_) external { _requireCallerIsContractOwner(); if(_maxSupplyInitialized) { revert InitializableMaxSupplyBase__MaxSupplyAlreadyInitialized(); } _maxSupplyInitialized = true; _setMaxSupplyAndOwnerMints(maxSupply_, maxOwnerMints_); } function maxSupplyInitialized() public view returns (bool) { return _maxSupplyInitialized; } } // File: @limitbreak/creator-token-contracts/contracts/minting/ClaimPeriodBase.sol pragma solidity ^0.8.4; /** * @title ClaimPeriodBase * @author Limit Break, Inc. * @notice In order to support multiple contracts with enforced claim periods, the claim period has been moved to this base contract. * */ abstract contract ClaimPeriodBase is OwnablePermissions { error ClaimPeriodBase__ClaimsMustBeClosedToReopen(); error ClaimPeriodBase__ClaimPeriodIsNotOpen(); error ClaimPeriodBase__ClaimPeriodMustBeClosedInTheFuture(); /// @dev True if claims have been initalized, false otherwise. bool private claimPeriodInitialized; /// @dev The timestamp when the claim period closes - when this value is zero and claims are open, the claim period is open indefinitely uint256 private claimPeriodClosingTimestamp; /// @dev Emitted when a claim period is scheduled to be closed. event ClaimPeriodClosing(uint256 claimPeriodClosingTimestamp); /// @dev Emitted when a claim period is scheduled to be opened. event ClaimPeriodOpened(uint256 claimPeriodClosingTimestamp); /// @dev Opens the claim period. Claims can be closed with a custom amount of warning time using the closeClaims function. /// Accepts a claimPeriodClosingTimestamp_ timestamp which will open the period ending at that time (in seconds) /// NOTE: Use as high a window as possible to prevent gas wars for claiming /// For an unbounded claim window, pass in type(uint256).max function openClaims(uint256 claimPeriodClosingTimestamp_) external { _requireCallerIsContractOwner(); if(claimPeriodClosingTimestamp_ <= block.timestamp) { revert ClaimPeriodBase__ClaimPeriodMustBeClosedInTheFuture(); } _onClaimPeriodOpening(); if(claimPeriodInitialized) { if(block.timestamp < claimPeriodClosingTimestamp) { revert ClaimPeriodBase__ClaimsMustBeClosedToReopen(); } } else { claimPeriodInitialized = true; } claimPeriodClosingTimestamp = claimPeriodClosingTimestamp_; emit ClaimPeriodOpened(claimPeriodClosingTimestamp_); } /// @dev Closes claims at a specified timestamp. /// /// Throws when the specified timestamp is not in the future. function closeClaims(uint256 claimPeriodClosingTimestamp_) external { _requireCallerIsContractOwner(); _requireClaimsOpen(); if(claimPeriodClosingTimestamp_ <= block.timestamp) { revert ClaimPeriodBase__ClaimPeriodMustBeClosedInTheFuture(); } claimPeriodClosingTimestamp = claimPeriodClosingTimestamp_; emit ClaimPeriodClosing(claimPeriodClosingTimestamp_); } /// @dev Returns the Claim Period Timestamp function getClaimPeriodClosingTimestamp() external view returns (uint256) { return claimPeriodClosingTimestamp; } /// @notice Returns true if the claim period has been opened, false otherwise function isClaimPeriodOpen() external view returns (bool) { return _isClaimPeriodOpen(); } /// @dev Returns true if claim period is open, false otherwise. function _isClaimPeriodOpen() internal view returns (bool) { return claimPeriodInitialized && block.timestamp < claimPeriodClosingTimestamp; } /// @dev Validates that the claim period is open. /// Throws if claims are not open. function _requireClaimsOpen() internal view { if(!_isClaimPeriodOpen()) { revert ClaimPeriodBase__ClaimPeriodIsNotOpen(); } } /// @dev Hook to allow inheriting contracts to perform state validation when opening the claim period function _onClaimPeriodOpening() internal virtual {} } // File: @limitbreak/creator-token-contracts/contracts/minting/MerkleWhitelistMint.sol pragma solidity ^0.8.4; /** * @title MerkleWhitelistMint * @author Limit Break, Inc. * @notice Base functionality of a contract mix-in that may optionally be used with extend ERC-721 tokens with merkle-proof based whitelist minting capabilities. * @dev Inheriting contracts must implement `_mintToken`. * * @dev The leaf nodes of the merkle tree contain the address and quantity of tokens that may be minted by that address. * Duplicate addresses are not permitted. For instance, address(Bob) may only appear once in the merkle tree. * If address(Bob) appears more than once, Bob will be able to claim from only one of the leaves that contain his * address. In the event a mistake is made and duplicates are included in the merkle tree, the owner of the * contract may be able to de-duplicate the tree and submit a new root, provided * `_remainingNumberOfMerkleRootChanges` is greater than 0. The number of permitted merkle root changes is set * during contract construction/initialization, so take this into account when deploying your contracts. */ abstract contract MerkleWhitelistMintBase is ClaimPeriodBase, MaxSupplyBase { error MerkleWhitelistMint__AddressHasAlreadyClaimed(); error MerkleWhitelistMint__CannotClaimMoreThanMaximumAmountOfMerkleMints(); error MerkleWhitelistMint__InvalidProof(); error MerkleWhitelistMint__MaxMintsMustBeGreaterThanZero(); error MerkleWhitelistMint__MerkleRootCannotBeZero(); error MerkleWhitelistMint__MerkleRootHasNotBeenInitialized(); error MerkleWhitelistMint__MerkleRootImmutable(); error MerkleWhitelistMint__PermittedNumberOfMerkleRootChangesMustBeGreaterThanZero(); /// @dev The number of times the merkle root may be updated uint256 private _remainingNumberOfMerkleRootChanges; /// @dev This is the root ERC-721 contract from which claims can be made bytes32 private _merkleRoot; /// @dev This is the current amount of tokens mintable via merkle whitelist claims uint256 private _remainingMerkleMints; /// @dev Mapping that tracks whether or not an address has claimed their whitelist mint mapping (address => bool) private whitelistClaimed; /// @notice Emitted when a merkle root is updated event MerkleRootUpdated(bytes32 merkleRoot_); /// @notice Mints the specified quantity to the calling address if the submitted merkle proof successfully verifies the reserved quantity for the caller in the whitelist. /// /// Throws when the claim period has not opened. /// Throws when the claim period has closed. /// Throws if a merkle root has not been set. /// Throws if the caller has already successfully claimed. /// Throws if the quantity minted plus amount already minted exceeds the maximum amount claimable via merkle root. /// Throws if the submitted merkle proof does not successfully verify the reserved quantity for the caller. function whitelistMint(uint256 quantity, bytes32[] calldata merkleProof_) external { _requireClaimsOpen(); bytes32 merkleRootCache = _merkleRoot; if(merkleRootCache == bytes32(0)) { revert MerkleWhitelistMint__MerkleRootHasNotBeenInitialized(); } if(whitelistClaimed[_msgSender()]) { revert MerkleWhitelistMint__AddressHasAlreadyClaimed(); } uint256 supplyAfterMint = mintedSupply() + quantity; if(quantity > _remainingMerkleMints) { revert MerkleWhitelistMint__CannotClaimMoreThanMaximumAmountOfMerkleMints(); } _requireLessThanMaxSupply(supplyAfterMint); // if(!MerkleProof.verify(merkleProof_, merkleRootCache, keccak256(abi.encodePacked(_msgSender(), quantity)))) { // revert MerkleWhitelistMint__InvalidProof(); // } if(!MerkleProof.verify(merkleProof_, merkleRootCache, keccak256(bytes.concat(keccak256(abi.encode(_msgSender(), quantity)))))) { revert MerkleWhitelistMint__InvalidProof(); } whitelistClaimed[_msgSender()] = true; unchecked { _remainingMerkleMints -= quantity; } _mintBatch(_msgSender(), quantity); } /// @notice Update the merkle root if the merkle root was marked as changeable during initialization /// /// Throws if the `merkleRootChangable` boolean is false /// Throws if provided merkle root is 0 function setMerkleRoot(bytes32 merkleRoot_) external { _requireCallerIsContractOwner(); if(_remainingNumberOfMerkleRootChanges == 0) { revert MerkleWhitelistMint__MerkleRootImmutable(); } if(merkleRoot_ == bytes32(0)) { revert MerkleWhitelistMint__MerkleRootCannotBeZero(); } _merkleRoot = merkleRoot_; emit MerkleRootUpdated(merkleRoot_); unchecked { _remainingNumberOfMerkleRootChanges--; } } /// @notice Returns the merkle root function getMerkleRoot() external view returns (bytes32) { return _merkleRoot; } /// @notice Returns the remaining amount of token mints via merkle claiming function remainingMerkleMints() external view returns (uint256) { return _remainingMerkleMints; } /// @notice Returns true if the account already claimed their whitelist mint, false otherwise function isWhitelistClaimed(address account) external view returns (bool) { return whitelistClaimed[account]; } function _setMaxMerkleMintsAndPermittedNumberOfMerkleRootChanges( uint256 maxMerkleMints_, uint256 permittedNumberOfMerkleRootChanges_) internal { if(maxMerkleMints_ == 0) { revert MerkleWhitelistMint__MaxMintsMustBeGreaterThanZero(); } if (permittedNumberOfMerkleRootChanges_ == 0) { revert MerkleWhitelistMint__PermittedNumberOfMerkleRootChangesMustBeGreaterThanZero(); } _remainingMerkleMints = maxMerkleMints_; _remainingNumberOfMerkleRootChanges = permittedNumberOfMerkleRootChanges_; _initializeNextTokenIdCounter(); } } /** * @title MerkleWhitelistMint * @author Limit Break, Inc. * @notice Constructable MerkleWhitelistMint Contract implementation. */ abstract contract MerkleWhitelistMint is MerkleWhitelistMintBase, MaxSupply { constructor(uint256 maxMerkleMints_, uint256 permittedNumberOfMerkleRootChanges_) { _setMaxMerkleMintsAndPermittedNumberOfMerkleRootChanges( maxMerkleMints_, permittedNumberOfMerkleRootChanges_ ); } function maxSupply() public view override(MaxSupplyBase, MaxSupply) returns (uint256) { return _maxSupplyImmutable; } } /** * @title MerkleWhitelistMintInitializable * @author Limit Break, Inc. * @notice Initializable MerkleWhitelistMint Contract implementation to allow for EIP-1167 clones. */ abstract contract MerkleWhitelistMintInitializable is MerkleWhitelistMintBase, MaxSupplyInitializable { error MerkleWhitelistMintInitializable__MerkleSupplyAlreadyInitialized(); /// @dev Flag indicating that the merkle mint max supply has been initialized. bool private _merkleSupplyInitialized; function initializeMaxMerkleMintsAndPermittedNumberOfMerkleRootChanges( uint256 maxMerkleMints_, uint256 permittedNumberOfMerkleRootChanges_) public { _requireCallerIsContractOwner(); if(_merkleSupplyInitialized) { revert MerkleWhitelistMintInitializable__MerkleSupplyAlreadyInitialized(); } _merkleSupplyInitialized = true; _setMaxMerkleMintsAndPermittedNumberOfMerkleRootChanges( maxMerkleMints_, permittedNumberOfMerkleRootChanges_ ); } } // File: @openzeppelin/contracts/utils/StorageSlot.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.20; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(newImplementation.code.length > 0); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } } // File: @openzeppelin/contracts/utils/Address.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } } // File: @openzeppelin/contracts/proxy/beacon/IBeacon.sol // OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.20; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {UpgradeableBeacon} will check that this address is a contract. */ function implementation() external view returns (address); } // File: @openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol // OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol) pragma solidity ^0.8.20; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. */ library ERC1967Utils { // We re-declare ERC-1967 events here because they can't be used directly from IERC1967. // This will be fixed in Solidity 0.8.21. At that point we should remove these events. /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev The `implementation` of the proxy is invalid. */ error ERC1967InvalidImplementation(address implementation); /** * @dev The `admin` of the proxy is invalid. */ error ERC1967InvalidAdmin(address admin); /** * @dev The `beacon` of the proxy is invalid. */ error ERC1967InvalidBeacon(address beacon); /** * @dev An upgrade function sees `msg.value > 0` that may be lost. */ error ERC1967NonPayable(); /** * @dev Returns the current implementation address. */ function getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { if (newImplementation.code.length == 0) { revert ERC1967InvalidImplementation(newImplementation); } StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Performs implementation upgrade with additional setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); if (data.length > 0) { Address.functionDelegateCall(newImplementation, data); } else { _checkNonPayable(); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` */ function getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { if (newAdmin == address(0)) { revert ERC1967InvalidAdmin(address(0)); } StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {IERC1967-AdminChanged} event. */ function changeAdmin(address newAdmin) internal { emit AdminChanged(getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { if (newBeacon.code.length == 0) { revert ERC1967InvalidBeacon(newBeacon); } StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon; address beaconImplementation = IBeacon(newBeacon).implementation(); if (beaconImplementation.code.length == 0) { revert ERC1967InvalidImplementation(beaconImplementation); } } /** * @dev Change the beacon and trigger a setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-BeaconUpgraded} event. * * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for * efficiency. */ function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } else { _checkNonPayable(); } } /** * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract * if an upgrade doesn't perform an initialization call. */ function _checkNonPayable() private { if (msg.value > 0) { revert ERC1967NonPayable(); } } } // File: @openzeppelin/contracts/interfaces/draft-IERC1822.sol // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.20; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822Proxiable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); } // File: @openzeppelin/contracts/interfaces/draft-IERC6093.sol // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); } // File: @openzeppelin/contracts/utils/math/SignedMath.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } } // File: @openzeppelin/contracts/utils/math/Math.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } } // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; 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_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } 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); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } } // File: @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } } // File: @openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.20; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. */ abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable address private immutable __self = address(this); /** * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)` * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called, * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string. * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function * during an upgrade. */ string public constant UPGRADE_INTERFACE_VERSION = "5.0.0"; /** * @dev The call is from an unauthorized context. */ error UUPSUnauthorizedCallContext(); /** * @dev The storage `slot` is unsupported as a UUID. */ error UUPSUnsupportedProxiableUUID(bytes32 slot); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { _checkProxy(); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { _checkNotDelegated(); _; } function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual notDelegated returns (bytes32) { return ERC1967Utils.IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data); } /** * @dev Reverts if the execution is not performed via delegatecall or the execution * context is not of a proxy with an ERC1967-compliant implementation pointing to self. * See {_onlyProxy}. */ function _checkProxy() internal view virtual { if ( address(this) == __self || // Must be called through delegatecall ERC1967Utils.getImplementation() != __self // Must be called through an active proxy ) { revert UUPSUnauthorizedCallContext(); } } /** * @dev Reverts if the execution is performed via delegatecall. * See {notDelegated}. */ function _checkNotDelegated() internal view virtual { if (address(this) != __self) { // Must not be called through delegatecall revert UUPSUnauthorizedCallContext(); } } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call. * * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value * is expected to be the implementation slot in ERC1967. * * Emits an {IERC1967-Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private { try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) { if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) { revert UUPSUnsupportedProxiableUUID(slot); } ERC1967Utils.upgradeToAndCall(newImplementation, data); } catch { // The implementation is not UUPS revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation); } } } // File: @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // File: @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; /** * @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. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.Ownable struct OwnableStorage { address _owner; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300; function _getOwnableStorage() private pure returns (OwnableStorage storage $) { assembly { $.slot := OwnableStorageLocation } } /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ function __Ownable_init(address initialOwner) internal onlyInitializing { __Ownable_init_unchained(initialOwner); } function __Ownable_init_unchained(address initialOwner) internal onlyInitializing { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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) { OwnableStorage storage $ = _getOwnableStorage(); return $._owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { OwnableStorage storage $ = _getOwnableStorage(); address oldOwner = $._owner; $._owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be * reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } // File: @openzeppelin/contracts/utils/introspection/IERC165.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } // File: @openzeppelin/contracts/utils/introspection/ERC165.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; /** * @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); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } } // File: @openzeppelin/contracts/interfaces/IERC2981.sol // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.20; /** * @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. */ 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); } // File: @openzeppelin/contracts/token/common/ERC2981.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/common/ERC2981.sol) pragma solidity ^0.8.20; /** * @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. */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 tokenId => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator); /** * @dev The default royalty receiver is invalid. */ error ERC2981InvalidDefaultRoyaltyReceiver(address receiver); /** * @dev The royalty set for an specific `tokenId` is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator); /** * @dev The royalty receiver for `tokenId` is invalid. */ error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver); /** * @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 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 { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidDefaultRoyaltyReceiver(address(0)); } _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 { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0)); } _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]; } } // File: @limitbreak/creator-token-contracts/contracts/programmable-royalties/BasicRoyalties.sol pragma solidity ^0.8.4; /** * @title BasicRoyaltiesBase * @author Limit Break, Inc. * @dev Base functionality of an NFT mix-in contract implementing the most basic form of programmable royalties. */ abstract contract BasicRoyaltiesBase is ERC2981 { event DefaultRoyaltySet(address indexed receiver, uint96 feeNumerator); event TokenRoyaltySet(uint256 indexed tokenId, address indexed receiver, uint96 feeNumerator); function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual override { super._setDefaultRoyalty(receiver, feeNumerator); emit DefaultRoyaltySet(receiver, feeNumerator); } function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual override { super._setTokenRoyalty(tokenId, receiver, feeNumerator); emit TokenRoyaltySet(tokenId, receiver, feeNumerator); } } /** * @title BasicRoyalties * @author Limit Break, Inc. * @notice Constructable BasicRoyalties Contract implementation. */ abstract contract BasicRoyalties is BasicRoyaltiesBase { constructor(address receiver, uint96 feeNumerator) { _setDefaultRoyalty(receiver, feeNumerator); } } /** * @title BasicRoyaltiesInitializable * @author Limit Break, Inc. * @notice Initializable BasicRoyalties Contract implementation to allow for EIP-1167 clones. */ abstract contract BasicRoyaltiesInitializable is BasicRoyaltiesBase {} // File: @openzeppelin/contracts/interfaces/IERC165.sol // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; // File: @openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; /** * @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); * } * ``` */ abstract contract ERC165Upgradeable is Initializable, IERC165 { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } } // File: @openzeppelin/contracts/token/ERC721/IERC721.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or * {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the address zero. * * 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); } // File: @openzeppelin/contracts/interfaces/IERC721.sol // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol) pragma solidity ^0.8.20; // File: @openzeppelin/contracts/interfaces/IERC4906.sol // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4906.sol) pragma solidity ^0.8.20; /// @title EIP-721 Metadata Update Extension interface IERC4906 is IERC165, IERC721 { /// @dev This event emits when the metadata of a token is changed. /// So that the third-party platforms such as NFT market could /// timely update the images and related attributes of the NFT. event MetadataUpdate(uint256 _tokenId); /// @dev This event emits when the metadata of a range of tokens is changed. /// So that the third-party platforms such as NFT market could /// timely update the images and related attributes of the NFTs. event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); } // File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.20; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); } // File: @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ abstract contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; /// @custom:storage-location erc7201:openzeppelin.storage.ERC721 struct ERC721Storage { // Token name string _name; // Token symbol string _symbol; mapping(uint256 tokenId => address) _owners; mapping(address owner => uint256) _balances; mapping(uint256 tokenId => address) _tokenApprovals; mapping(address owner => mapping(address operator => bool)) _operatorApprovals; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC721")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ERC721StorageLocation = 0x80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300; function _getERC721Storage() private pure returns (ERC721Storage storage $) { assembly { $.slot := ERC721StorageLocation } } /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { ERC721Storage storage $ = _getERC721Storage(); $._name = name_; $._symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual returns (uint256) { ERC721Storage storage $ = _getERC721Storage(); if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return $._balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { ERC721Storage storage $ = _getERC721Storage(); return $._name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { ERC721Storage storage $ = _getERC721Storage(); return $._symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { ERC721Storage storage $ = _getERC721Storage(); return $._operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); return $._owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); return $._tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets * the `spender` for the specific `tokenId`. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { ERC721Storage storage $ = _getERC721Storage(); unchecked { $._balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { $._balances[from] -= 1; } } if (to != address(0)) { unchecked { $._balances[to] += 1; } } $._owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); _checkOnERC721Received(address(0), to, tokenId, data); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC721 standard to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { ERC721Storage storage $ = _getERC721Storage(); // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } $._tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { ERC721Storage storage $ = _getERC721Storage(); if (operator == address(0)) { revert ERC721InvalidOperator(operator); } $._operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { revert ERC721InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { revert ERC721InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } } // File: @openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721URIStorage.sol) pragma solidity ^0.8.20; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorageUpgradeable is Initializable, IERC4906, ERC721Upgradeable { using Strings for uint256; // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only // defines events and does not include any external function. bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906); /// @custom:storage-location erc7201:openzeppelin.storage.ERC721URIStorage struct ERC721URIStorageStorage { // Optional mapping for token URIs mapping(uint256 tokenId => string) _tokenURIs; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC721URIStorage")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ERC721URIStorageStorageLocation = 0x0542a41881ee128a365a727b282c86fa859579490b9bb45aab8503648c8e7900; function _getERC721URIStorageStorage() private pure returns (ERC721URIStorageStorage storage $) { assembly { $.slot := ERC721URIStorageStorageLocation } } function __ERC721URIStorage_init() internal onlyInitializing { } function __ERC721URIStorage_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface} */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165) returns (bool) { return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { ERC721URIStorageStorage storage $ = _getERC721URIStorageStorage(); _requireOwned(tokenId); string memory _tokenURI = $._tokenURIs[tokenId]; string memory base = _baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via string.concat). if (bytes(_tokenURI).length > 0) { return string.concat(base, _tokenURI); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Emits {MetadataUpdate}. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { ERC721URIStorageStorage storage $ = _getERC721URIStorageStorage(); $._tokenURIs[tokenId] = _tokenURI; emit MetadataUpdate(tokenId); } } // File: src/templates/cloneable/erc721c/merkle/basic-royalties/WorldsImplementation.sol pragma solidity ^0.8.20; // NFT contract with metadata, whitelist minting, and royalties functionality contract WorldsImplementation is ERC721Upgradeable, ERC721URIStorageUpgradeable, OwnableUpgradeable, UUPSUpgradeable, MerkleWhitelistMintInitializable, BasicRoyaltiesInitializable { using Strings for uint256; struct TokenInfo { uint tokenId; uint status; // status - 0: default, 1: staked } string private baseURI; ///////////////////////////////// upgrade ///////////////////////////////// // auth account mapping(address => bool) public auth; mapping(uint => TokenInfo) public _tokenInfoOf; ///////////////////////////////// event ///////////////////////////////// event Update(address indexed oprator, uint indexed tokenId, TokenInfo oldTokenInfo, TokenInfo newTokenInfo); ///////////////////////////////// error ///////////////////////////////// /** * @dev Error transfer status disable. * @param tokenId tokenId * @param status status */ error TransferStatusDisable(uint tokenId, uint status); /** * @dev Error only invoke by auth address. */ error OnlyAuth(); modifier onlyAuth() { if(!auth[msg.sender]) { revert OnlyAuth(); } _; } // Constructor to initialize the NFT contract with a name, symbol, and Merkle root hash function initialize( string memory _name, string memory _symbol, uint256 _maxSupply, uint256 _maxOwnerMints, uint256 _maxMerkleMints, uint256 _permittedNumberOfMerkleRootChanges, string memory _baseURI ) public initializer { __ERC721_init(_name, _symbol); __ERC721URIStorage_init(); __Ownable_init(msg.sender); __UUPSUpgradeable_init(); MerkleWhitelistMintInitializable.initializeMaxMerkleMintsAndPermittedNumberOfMerkleRootChanges( _maxMerkleMints, _permittedNumberOfMerkleRootChanges ); _setMaxSupplyAndOwnerMints(_maxSupply, _maxOwnerMints); setBaseURI(_baseURI); } // Function to check if an interface is supported function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, ERC2981, ERC721URIStorageUpgradeable) returns (bool) { return ERC721Upgradeable.supportsInterface(interfaceId) || ERC721URIStorageUpgradeable.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId) || super.supportsInterface(interfaceId); } function _msgData() internal view override(Context,ContextUpgradeable) returns (bytes calldata) { return super._msgData(); } function _msgSender() internal view override(Context,ContextUpgradeable) returns (address) { return super._msgSender(); } function _requireCallerIsContractOwner() internal view override virtual { return super._checkOwner(); } function setBaseURI(string memory _baseURI)public onlyOwner { baseURI = _baseURI; } // Function to set the default royalty for the contract function setDefaultRoyalty(address receiver, uint96 feeNumerator) public onlyOwner { super._setDefaultRoyalty(receiver, feeNumerator); } function setAuth(address _account, bool _authState) external onlyOwner { auth[_account] = _authState; } // Internal function to mint a single token function _mintToken(address _to, uint256 _tokenId) internal override virtual { _safeMint(_to, _tokenId); } // Returns whether `spender` is allowed to manage `tokenId` function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } function burn(uint256 tokenId) public { require(_isApprovedOrOwner(_msgSender(), tokenId),"burn caller is not owner nor approved"); _burn(tokenId); } function tokenURI(uint256 _tokenId) public view virtual override(ERC721Upgradeable, ERC721URIStorageUpgradeable) returns (string memory) { super._requireOwned(_tokenId); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, _tokenId.toString(), ".json")) : ""; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public override(ERC721Upgradeable, IERC721) { uint mask = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; TokenInfo memory tokenInfo = getTokenInfo(tokenId); if (tokenInfo.status ^ mask != type(uint).max) { revert TransferStatusDisable(tokenId, tokenInfo.status); } super.transferFrom(from, to, tokenId); } function getTokenInfo(uint _tokenId) public view returns (TokenInfo memory tokenInfo) { _requireOwned(_tokenId); tokenInfo = _tokenInfoOf[_tokenId]; tokenInfo.tokenId = _tokenId; } function getTokenInfos(uint[] memory _tokenIds) public view returns (TokenInfo[] memory) { TokenInfo[] memory tokenInfos = new TokenInfo[](_tokenIds.length); for (uint i = 0; i < _tokenIds.length; i++) { tokenInfos[i] = getTokenInfo(_tokenIds[i]); } return tokenInfos; } /** * @dev update tokenInfo by _tokenId */ function update(uint _tokenId, TokenInfo memory _tokenInfo) external onlyAuth returns (bool) { _checkAuthorized(ownerOf(_tokenId), msg.sender, _tokenId); TokenInfo memory tokenInfo = _tokenInfoOf[_tokenId]; _tokenInfoOf[_tokenId] = _tokenInfo; emit Update(msg.sender, _tokenId, tokenInfo, _tokenInfo); return true; } function _authorizeUpgrade(address newImplementation) internal view override onlyOwner { require(newImplementation != address(0), "Invalid implementation address"); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "remappings": [] }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[],"name":"ClaimPeriodBase__ClaimPeriodIsNotOpen","type":"error"},{"inputs":[],"name":"ClaimPeriodBase__ClaimPeriodMustBeClosedInTheFuture","type":"error"},{"inputs":[],"name":"ClaimPeriodBase__ClaimsMustBeClosedToReopen","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidDefaultRoyalty","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidDefaultRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidTokenRoyalty","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidTokenRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InitializableMaxSupplyBase__MaxSupplyAlreadyInitialized","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"MaxSupplyBase__CannotClaimMoreThanMaximumAmountOfOwnerMints","type":"error"},{"inputs":[],"name":"MaxSupplyBase__CannotMintToAddressZero","type":"error"},{"inputs":[],"name":"MaxSupplyBase__MaxSupplyCannotBeSetToMaxUint256","type":"error"},{"inputs":[],"name":"MaxSupplyBase__MaxSupplyExceeded","type":"error"},{"inputs":[],"name":"MaxSupplyBase__MintedQuantityMustBeGreaterThanZero","type":"error"},{"inputs":[],"name":"MerkleWhitelistMintInitializable__MerkleSupplyAlreadyInitialized","type":"error"},{"inputs":[],"name":"MerkleWhitelistMint__AddressHasAlreadyClaimed","type":"error"},{"inputs":[],"name":"MerkleWhitelistMint__CannotClaimMoreThanMaximumAmountOfMerkleMints","type":"error"},{"inputs":[],"name":"MerkleWhitelistMint__InvalidProof","type":"error"},{"inputs":[],"name":"MerkleWhitelistMint__MaxMintsMustBeGreaterThanZero","type":"error"},{"inputs":[],"name":"MerkleWhitelistMint__MerkleRootCannotBeZero","type":"error"},{"inputs":[],"name":"MerkleWhitelistMint__MerkleRootHasNotBeenInitialized","type":"error"},{"inputs":[],"name":"MerkleWhitelistMint__MerkleRootImmutable","type":"error"},{"inputs":[],"name":"MerkleWhitelistMint__PermittedNumberOfMerkleRootChangesMustBeGreaterThanZero","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"OnlyAuth","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"status","type":"uint256"}],"name":"TransferStatusDisable","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","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":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"claimPeriodClosingTimestamp","type":"uint256"}],"name":"ClaimPeriodClosing","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"claimPeriodClosingTimestamp","type":"uint256"}],"name":"ClaimPeriodOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"DefaultRoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxOwnerMints","type":"uint256"}],"name":"MaxSupplyInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"}],"name":"MerkleRootUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","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":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"TokenRoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oprator","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"status","type":"uint256"}],"indexed":false,"internalType":"struct WorldsImplementation.TokenInfo","name":"oldTokenInfo","type":"tuple"},{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"status","type":"uint256"}],"indexed":false,"internalType":"struct WorldsImplementation.TokenInfo","name":"newTokenInfo","type":"tuple"}],"name":"Update","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_tokenInfoOf","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"status","type":"uint256"}],"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":"","type":"address"}],"name":"auth","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":[{"internalType":"uint256","name":"claimPeriodClosingTimestamp_","type":"uint256"}],"name":"closeClaims","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getClaimPeriodClosingTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTokenInfo","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"status","type":"uint256"}],"internalType":"struct WorldsImplementation.TokenInfo","name":"tokenInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"getTokenInfos","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"status","type":"uint256"}],"internalType":"struct WorldsImplementation.TokenInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint256","name":"_maxSupply","type":"uint256"},{"internalType":"uint256","name":"_maxOwnerMints","type":"uint256"},{"internalType":"uint256","name":"_maxMerkleMints","type":"uint256"},{"internalType":"uint256","name":"_permittedNumberOfMerkleRootChanges","type":"uint256"},{"internalType":"string","name":"_baseURI","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxMerkleMints_","type":"uint256"},{"internalType":"uint256","name":"permittedNumberOfMerkleRootChanges_","type":"uint256"}],"name":"initializeMaxMerkleMintsAndPermittedNumberOfMerkleRootChanges","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxSupply_","type":"uint256"},{"internalType":"uint256","name":"maxOwnerMints_","type":"uint256"}],"name":"initializeMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isClaimPeriodOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isWhitelistClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintedSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"claimPeriodClosingTimestamp_","type":"uint256"}],"name":"openClaims","outputs":[],"stateMutability":"nonpayable","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":"quantity","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":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingMerkleMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingOwnerMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_authState","type":"bool"}],"name":"setAuth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"uint256","name":"_tokenId","type":"uint256"},{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"status","type":"uint256"}],"internalType":"struct WorldsImplementation.TokenInfo","name":"_tokenInfo","type":"tuple"}],"name":"update","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof_","type":"bytes32[]"}],"name":"whitelistMint","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a0604052306080523480156012575f80fd5b50608051612fdc6100395f395f81816118530152818161187c0152611a110152612fdc5ff3fe608060405260043610610280575f3560e01c806370a0823111610155578063ad3cb1cc116100be578063cd5d211811610078578063cd5d2118146107db578063d2cab05614610809578063d5abeb0114610828578063e985e9c51461083c578063ee16edb71461085b578063f2fde38b1461087a575f80fd5b8063ad3cb1cc14610726578063b88d4fde14610756578063c1bd8cf914610775578063c25043e914610789578063c87b56dd146107a8578063caa0f92a146107c7575f80fd5b80638c7a63ae1161010f5780638c7a63ae146106585780638da5cb5b146106845780638f50d0a8146106c057806395d89b41146106df578063970f9fc8146106f3578063a22cb46514610707575f80fd5b806370a0823114610591578063715018a6146105b057806372be0d8b146105c4578063772bcfb9146105e35780637cb64759146106025780638521b8e314610621575f80fd5b80632a55205a116101f75780634f1ef286116101b15780634f1ef286146104c657806352d1902d146104d957806355f804b3146104ed5780635c0238a91461050c5780636352211e14610553578063650286e914610572575f80fd5b80632a55205a1461040057806333b3a8071461043e57806342842e0e1461045557806342966c6814610474578063484b973c1461049357806349590657146104b2575f80fd5b80630b44a218116102485780630b44a218146103505780630da63d6f1461036f578063222f320f1461039b57806323b872dd146103b957806324933ba6146103d857806329758bd4146103ec575f80fd5b806301ffc9a71461028457806304634d8d146102b857806306fdde03146102d9578063081812fc146102fa578063095ea7b314610331575b5f80fd5b34801561028f575f80fd5b506102a361029e36600461266a565b610899565b60405190151581526020015b60405180910390f35b3480156102c3575f80fd5b506102d76102d23660046126a0565b6108d6565b005b3480156102e4575f80fd5b506102ed6108ec565b6040516102af919061270e565b348015610305575f80fd5b50610319610314366004612720565b61098d565b6040516001600160a01b0390911681526020016102af565b34801561033c575f80fd5b506102d761034b366004612737565b6109a1565b34801561035b575f80fd5b506102d761036a36600461275f565b6109ac565b34801561037a575f80fd5b5061038e6103893660046127d1565b6109de565b6040516102af919061287b565b3480156103a6575f80fd5b506007545b6040519081526020016102af565b3480156103c4575f80fd5b506102d76103d33660046128d2565b610a9a565b3480156103e3575f80fd5b506102a3610afa565b3480156103f7575f80fd5b506004546103ab565b34801561040b575f80fd5b5061041f61041a36600461290c565b610b08565b604080516001600160a01b0390931683526020830191909152016102af565b348015610449575f80fd5b5060095460ff166102a3565b348015610460575f80fd5b506102d761046f3660046128d2565b610bb2565b34801561047f575f80fd5b506102d761048e366004612720565b610bd1565b34801561049e575f80fd5b506102d76104ad366004612737565b610c41565b3480156104bd575f80fd5b506006546103ab565b6102d76104d436600461299d565b610cc7565b3480156104e4575f80fd5b506103ab610ce2565b3480156104f8575f80fd5b506102d76105073660046129e7565b610cfd565b348015610517575f80fd5b5061053e610526366004612720565b600e6020525f90815260409020805460019091015482565b604080519283526020830191909152016102af565b34801561055e575f80fd5b5061031961056d366004612720565b610d11565b34801561057d575f80fd5b506102a361058c366004612a18565b610d1b565b34801561059c575f80fd5b506103ab6105ab366004612a80565b610ddb565b3480156105bb575f80fd5b506102d7610e33565b3480156105cf575f80fd5b506102d76105de366004612720565b610e46565b3480156105ee575f80fd5b506102d76105fd366004612720565b610ee9565b34801561060d575f80fd5b506102d761061c366004612720565b610f4e565b34801561062c575f80fd5b506102a361063b366004612a80565b6001600160a01b03165f9081526008602052604090205460ff1690565b348015610663575f80fd5b50610677610672366004612720565b610fda565b6040516102af9190612a99565b34801561068f575f80fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610319565b3480156106cb575f80fd5b506102d76106da36600461290c565b61101f565b3480156106ea575f80fd5b506102ed611069565b3480156106fe575f80fd5b506001546103ab565b348015610712575f80fd5b506102d761072136600461275f565b6110a7565b348015610731575f80fd5b506102ed604051806040016040528060058152602001640352e302e360dc1b81525081565b348015610761575f80fd5b506102d7610770366004612ab0565b6110b2565b348015610780575f80fd5b506103ab6110c9565b348015610794575f80fd5b506102d76107a3366004612b13565b6110df565b3480156107b3575f80fd5b506102ed6107c2366004612720565b611228565b3480156107d2575f80fd5b506002546103ab565b3480156107e6575f80fd5b506102a36107f5366004612a80565b600d6020525f908152604090205460ff1681565b348015610814575f80fd5b506102d7610823366004612bc3565b61128e565b348015610833575f80fd5b506003546103ab565b348015610847575f80fd5b506102a3610856366004612c3b565b611410565b348015610866575f80fd5b506102d761087536600461290c565b61145c565b348015610885575f80fd5b506102d7610894366004612a80565b61149f565b5f6108a3826114d9565b806108b257506108b282611518565b806108c157506108c18261153c565b806108d057506108d08261153c565b92915050565b6108de611560565b6108e882826115ac565b5050565b5f80516020612f67833981519152805460609190819061090b90612c6c565b80601f016020809104026020016040519081016040528092919081815260200182805461093790612c6c565b80156109825780601f1061095957610100808354040283529160200191610982565b820191905f5260205f20905b81548152906001019060200180831161096557829003601f168201915b505050505091505090565b5f61099782611601565b506108d082611638565b6108e8828233611675565b6109b4611560565b6001600160a01b03919091165f908152600d60205260409020805460ff1916911515919091179055565b60605f82516001600160401b038111156109fa576109fa61278d565b604051908082528060200260200182016040528015610a3e57816020015b604080518082019091525f8082526020820152815260200190600190039081610a185790505b5090505f5b8351811015610a9357610a6e848281518110610a6157610a61612ca4565b6020026020010151610fda565b828281518110610a8057610a80612ca4565b6020908102919091010152600101610a43565b5092915050565b5f195f610aa683610fda565b90505f198282602001511814610ae85760208101516040516328211da560e21b8152610adf918591600401918252602082015260400190565b60405180910390fd5b610af3858585611682565b5050505050565b5f610b03611705565b905090565b5f828152600b602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610b7c575060408051808201909152600a546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101515f9061271090610b9a906001600160601b031687612ccc565b610ba49190612ce3565b915196919550909350505050565b610bcc83838360405180602001604052805f8152506110b2565b505050565b610bdb338261171b565b610c355760405162461bcd60e51b815260206004820152602560248201527f6275726e2063616c6c6572206973206e6f74206f776e6572206e6f72206170706044820152641c9bdd995960da1b6064820152608401610adf565b610c3e81611779565b50565b610c496117b1565b6001600160a01b038216610c705760405163147487d560e11b815260040160405180910390fd5b600454811115610c935760405163081a4b7f60e01b815260040160405180910390fd5b610cae81610c9f6110c9565b610ca99190612d02565b6117b9565b600480548290039055610cc182826117ec565b50505050565b610ccf611848565b610cd8826118ec565b6108e8828261194a565b5f610ceb611a06565b505f80516020612f8783398151915290565b610d05611560565b600c6108e88282612d59565b5f6108d082611601565b335f908152600d602052604081205460ff16610d4a5760405163ace6c44f60e01b815260040160405180910390fd5b610d5d610d5684610d11565b3385611a4f565b5f838152600e602081815260408084208151808301835281548152600182018054828601529589905293835286519055908501519092559051849033907f05960a5f70025e9914df9504017285b8b806d8f2b4c36b487f50110a863b15d790610dc99085908890612e13565b60405180910390a35060019392505050565b5f5f80516020612f678339815191526001600160a01b038316610e13576040516322718ad960e21b81525f6004820152602401610adf565b6001600160a01b039092165f908152600390920160205250604090205490565b610e3b611560565b610e445f611ab3565b565b610e4e6117b1565b428111610e6e5760405163af3e22bd60e01b815260040160405180910390fd5b5f5460ff1615610ea057600154421015610e9b5760405163d705ba2f60e01b815260040160405180910390fd5b610ead565b5f805460ff191660011790555b60018190556040518181527ff05c67ac09cc489b8b8a4713b524acfbf22fca066ee972319956423eca41e81d906020015b60405180910390a150565b610ef16117b1565b610ef9611b23565b428111610f195760405163af3e22bd60e01b815260040160405180910390fd5b60018190556040518181527f8ef44b9f15cd912828f8c65a0bc6364c6918b2128c541fa639a6b21f7fdb6b6b90602001610ede565b610f566117b1565b6005545f03610f785760405163058eb39760e01b815260040160405180910390fd5b80610f965760405163910c15a760e01b815260040160405180910390fd5b60068190556040518181527f90004c04698bc3322499a575ed3752dd4abf33e0a7294c06a787a0fe01bea9419060200160405180910390a150600580545f19019055565b604080518082019091525f8082526020820152610ff682611601565b50505f818152600e60209081526040918290208251808401909352600101549082015290815290565b6110276117b1565b600954610100900460ff16156110505760405163f5950a1560e01b815260040160405180910390fd5b6009805461ff0019166101001790556108e88282611b48565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930180546060915f80516020612f678339815191529161090b90612c6c565b6108e8338383611b9a565b6110bd848484610a9a565b610cc184848484611c49565b5f60016110d560025490565b610b039190612e39565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156111235750825b90505f826001600160401b0316600114801561113e5750303b155b90508115801561114c575080155b1561116a5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561119457845460ff60401b1916600160401b1785555b61119e8c8c611d68565b6111a6611d7a565b6111af33611d82565b6111b7611d7a565b6111c1888861101f565b6111cb8a8a611d93565b6111d486610cfd565b831561121a57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050505050565b606061123382611601565b505f600c805461124290612c6c565b90501161125d5760405180602001604052805f8152506108d0565b600c61126883611e03565b604051602001611279929190612e63565b60405160208183030381529060405292915050565b611296611b23565b600654806112b75760405163d8a88d9760e01b815260040160405180910390fd5b335f9081526008602052604090205460ff16156112e75760405163515717ab60e11b815260040160405180910390fd5b5f846112f16110c9565b6112fb9190612d02565b9050600754851115611320576040516336da9a2760e11b815260040160405180910390fd5b611329816117b9565b6113be8484808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525086925061136a91506116719050565b604080516001600160a01b039092166020830152810189905260600160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120611e92565b6113db57604051637b52e59360e01b815260040160405180910390fd5b335f818152600860205260409020805460ff1916600117905560078054879003905561140790866117ec565b50505050505050565b6001600160a01b039182165f9081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793056020908152604080832093909416825291909152205460ff1690565b6114646117b1565b60095460ff16156114885760405163213c129760e11b815260040160405180910390fd5b6009805460ff191660011790556108e88282611d93565b6114a7611560565b6001600160a01b0381166114d057604051631e4fbdf760e01b81525f6004820152602401610adf565b610c3e81611ab3565b5f6001600160e01b031982166380ac58cd60e01b148061150957506001600160e01b03198216635b5e139f60e01b145b806108d057506108d082611ea9565b5f6001600160e01b03198216632483248360e11b14806108d057506108d0826114d9565b5f6001600160e01b0319821663152a902d60e11b14806108d057506108d082611ea9565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03163314610e445760405163118cdaa760e01b8152336004820152602401610adf565b6115b68282611ebf565b6040516001600160601b03821681526001600160a01b038316907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9060200160405180910390a25050565b5f8061160c83611f61565b90506001600160a01b0381166108d057604051637e27328960e01b815260048101849052602401610adf565b5f9081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930460205260409020546001600160a01b031690565b3390565b610bcc8383836001611f9a565b6001600160a01b0382166116ab57604051633250574960e11b81525f6004820152602401610adf565b5f6116b78383336120ad565b9050836001600160a01b0316816001600160a01b031614610cc1576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610adf565b5f805460ff168015610b03575050600154421090565b5f8061172683610d11565b9050806001600160a01b0316846001600160a01b0316148061174d575061174d8185611410565b806117715750836001600160a01b03166117668461098d565b6001600160a01b0316145b949350505050565b5f6117855f835f6120ad565b90506001600160a01b0381166108e857604051637e27328960e01b815260048101839052602401610adf565b610e44611560565b5f6117c360035490565b905080156108e857808211156108e8576040516358662d6160e11b815260040160405180910390fd5b5f80825f0361180e576040516363b2594760e01b815260040160405180910390fd5b50506002548181015f1901611822836121af565b5f5b8381101561184057611838858285016121c8565b600101611824565b509250929050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806118ce57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166118c25f80516020612f87833981519152546001600160a01b031690565b6001600160a01b031614155b15610e445760405163703e46dd60e11b815260040160405180910390fd5b6118f4611560565b6001600160a01b038116610c3e5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420696d706c656d656e746174696f6e206164647265737300006044820152606401610adf565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156119a4575060408051601f3d908101601f191682019092526119a191810190612eed565b60015b6119cc57604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610adf565b5f80516020612f8783398151915281146119fc57604051632a87526960e21b815260048101829052602401610adf565b610bcc83836121d2565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e445760405163703e46dd60e11b815260040160405180910390fd5b611a5a838383612227565b610bcc576001600160a01b038316611a8857604051637e27328960e01b815260048101829052602401610adf565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610adf565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b611b2b611705565b610e44576040516303ee804960e11b815260040160405180910390fd5b815f03611b6857604051632eff76af60e01b815260040160405180910390fd5b805f03611b88576040516307a64f9b60e21b815260040160405180910390fd5b600782905560058190556108e8612279565b5f80516020612f678339815191526001600160a01b038316611bda57604051630b61174360e31b81526001600160a01b0384166004820152602401610adf565b6001600160a01b038481165f818152600584016020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a350505050565b6001600160a01b0383163b15610cc157604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611c8b903390889087908790600401612f04565b6020604051808303815f875af1925050508015611cc5575060408051601f3d908101601f19168201909252611cc291810190612f40565b60015b611d2c573d808015611cf2576040519150601f19603f3d011682016040523d82523d5f602084013e611cf7565b606091505b5080515f03611d2457604051633250574960e11b81526001600160a01b0385166004820152602401610adf565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14610af357604051633250574960e11b81526001600160a01b0385166004820152602401610adf565b611d70612289565b6108e882826122d2565b610e44612289565b611d8a612289565b610c3e81612302565b5f198203611db457604051630fd46e6760e11b815260040160405180910390fd5b60038290556004819055611dc6612279565b60408051838152602081018390527fdc589a019ee1db2e96132d94ab25ea6587a689283849d4dca055d8742bcdf970910160405180910390a15050565b60605f611e0f8361230a565b60010190505f816001600160401b03811115611e2d57611e2d61278d565b6040519080825280601f01601f191660200182016040528015611e57576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611e6157509392505050565b5f82611e9e85846123e1565b1490505b9392505050565b6001600160e01b0319166301ffc9a760e01b1490565b6127106001600160601b038216811015611efe57604051636f483d0960e01b81526001600160601b038316600482015260248101829052604401610adf565b6001600160a01b038316611f2757604051635b6cc80560e11b81525f6004820152602401610adf565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600a55565b5f9081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930260205260409020546001600160a01b031690565b5f80516020612f678339815191528180611fbc57506001600160a01b03831615155b1561207d575f611fcb85611601565b90506001600160a01b03841615801590611ff75750836001600160a01b0316816001600160a01b031614155b801561200a57506120088185611410565b155b156120335760405163a9fbf51f60e01b81526001600160a01b0385166004820152602401610adf565b821561207b5784866001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5f93845260040160205250506040902080546001600160a01b0319166001600160a01b0392909216919091179055565b5f5f80516020612f67833981519152816120c685611f61565b90506001600160a01b038416156120e2576120e2818587611a4f565b6001600160a01b0381161561211e576120fd5f865f80611f9a565b6001600160a01b0381165f908152600383016020526040902080545f190190555b6001600160a01b0386161561214e576001600160a01b0386165f9081526003830160205260409020805460010190555b5f85815260028301602052604080822080546001600160a01b0319166001600160a01b038a811691821790925591518893918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a495945050505050565b8060025f8282546121c09190612d02565b909155505050565b6108e88282612423565b6121db8261243c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561221f57610bcc828261249f565b6108e8612511565b5f6001600160a01b038316158015906117715750826001600160a01b0316846001600160a01b0316148061226057506122608484611410565b806117715750826001600160a01b031661176683611638565b6002545f03610e44576001600255565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610e4457604051631afcd79f60e31b815260040160405180910390fd5b6122da612289565b5f80516020612f67833981519152806122f38482612d59565b5060018101610cc18382612d59565b6114a7612289565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106123485772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612374576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061239257662386f26fc10000830492506010015b6305f5e10083106123aa576305f5e100830492506008015b61271083106123be57612710830492506004015b606483106123d0576064830492506002015b600a83106108d05760010192915050565b5f81815b845181101561241b576124118286838151811061240457612404612ca4565b6020026020010151612530565b91506001016123e5565b509392505050565b6108e8828260405180602001604052805f815250612559565b806001600160a01b03163b5f0361247157604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610adf565b5f80516020612f8783398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516124bb9190612f5b565b5f60405180830381855af49150503d805f81146124f3576040519150601f19603f3d011682016040523d82523d5f602084013e6124f8565b606091505b509150915061250885838361256f565b95945050505050565b3415610e445760405163b398979f60e01b815260040160405180910390fd5b5f81831061254a575f828152602084905260409020611ea2565b505f9182526020526040902090565b61256383836125cb565b610bcc5f848484611c49565b6060826125845761257f8261262c565b611ea2565b815115801561259b57506001600160a01b0384163b155b156125c457604051639996b31560e01b81526001600160a01b0385166004820152602401610adf565b5080611ea2565b6001600160a01b0382166125f457604051633250574960e11b81525f6004820152602401610adf565b5f61260083835f6120ad565b90506001600160a01b03811615610bcc576040516339e3563760e11b81525f6004820152602401610adf565b80511561263c5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160e01b031981168114610c3e575f80fd5b5f6020828403121561267a575f80fd5b8135611ea281612655565b80356001600160a01b038116811461269b575f80fd5b919050565b5f80604083850312156126b1575f80fd5b6126ba83612685565b915060208301356001600160601b03811681146126d5575f80fd5b809150509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611ea260208301846126e0565b5f60208284031215612730575f80fd5b5035919050565b5f8060408385031215612748575f80fd5b61275183612685565b946020939093013593505050565b5f8060408385031215612770575f80fd5b61277983612685565b9150602083013580151581146126d5575f80fd5b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b03811182821017156127c9576127c961278d565b604052919050565b5f602082840312156127e1575f80fd5b81356001600160401b038111156127f6575f80fd5b8201601f81018413612806575f80fd5b80356001600160401b0381111561281f5761281f61278d565b8060051b61282f602082016127a1565b9182526020818401810192908101908784111561284a575f80fd5b6020850194505b8385101561287057843580835260209586019590935090910190612851565b979650505050505050565b602080825282518282018190525f918401906040840190835b818110156128c7576128b183855180518252602090810151910152565b6020939093019260409290920191600101612894565b509095945050505050565b5f805f606084860312156128e4575f80fd5b6128ed84612685565b92506128fb60208501612685565b929592945050506040919091013590565b5f806040838503121561291d575f80fd5b50508035926020909101359150565b5f82601f83011261293b575f80fd5b8135602083015f806001600160401b0384111561295a5761295a61278d565b50601f8301601f191660200161296f816127a1565b915050828152858383011115612983575f80fd5b828260208301375f92810160200192909252509392505050565b5f80604083850312156129ae575f80fd5b6129b783612685565b915060208301356001600160401b038111156129d1575f80fd5b6129dd8582860161292c565b9150509250929050565b5f602082840312156129f7575f80fd5b81356001600160401b03811115612a0c575f80fd5b6117718482850161292c565b5f808284036060811215612a2a575f80fd5b833592506040601f1982011215612a3f575f80fd5b50604080519081016001600160401b0381118282101715612a6257612a6261278d565b60409081526020858101358352940135938101939093525092909150565b5f60208284031215612a90575f80fd5b611ea282612685565b8151815260208083015190820152604081016108d0565b5f805f8060808587031215612ac3575f80fd5b612acc85612685565b9350612ada60208601612685565b92506040850135915060608501356001600160401b03811115612afb575f80fd5b612b078782880161292c565b91505092959194509250565b5f805f805f805f60e0888a031215612b29575f80fd5b87356001600160401b03811115612b3e575f80fd5b612b4a8a828b0161292c565b97505060208801356001600160401b03811115612b65575f80fd5b612b718a828b0161292c565b96505060408801359450606088013593506080880135925060a0880135915060c08801356001600160401b03811115612ba8575f80fd5b612bb48a828b0161292c565b91505092959891949750929550565b5f805f60408486031215612bd5575f80fd5b8335925060208401356001600160401b03811115612bf1575f80fd5b8401601f81018613612c01575f80fd5b80356001600160401b03811115612c16575f80fd5b8660208260051b8401011115612c2a575f80fd5b939660209190910195509293505050565b5f8060408385031215612c4c575f80fd5b612c5583612685565b9150612c6360208401612685565b90509250929050565b600181811c90821680612c8057607f821691505b602082108103612c9e57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176108d0576108d0612cb8565b5f82612cfd57634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156108d0576108d0612cb8565b601f821115610bcc57805f5260205f20601f840160051c81016020851015612d3a5750805b601f840160051c820191505b81811015610af3575f8155600101612d46565b81516001600160401b03811115612d7257612d7261278d565b612d8681612d808454612c6c565b84612d15565b6020601f821160018114612db8575f8315612da15750848201515b5f19600385901b1c1916600184901b178455610af3565b5f84815260208120601f198516915b82811015612de75787850151825560209485019460019092019101612dc7565b5084821015612e0457868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b825181526020808401518183015282516040830152820151606082015260808101611ea2565b818103818111156108d0576108d0612cb8565b5f81518060208401855e5f93019283525090919050565b5f808454612e7081612c6c565b600182168015612e875760018114612e9c57612ec9565b60ff1983168652811515820286019350612ec9565b875f5260205f205f5b83811015612ec157815488820152600190910190602001612ea5565b505081860193505b505050612ed68185612e4c565b64173539b7b760d91b815260050195945050505050565b5f60208284031215612efd575f80fd5b5051919050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90612f36908301846126e0565b9695505050505050565b5f60208284031215612f50575f80fd5b8151611ea281612655565b5f611ea28284612e4c56fe80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220a3780ea95f01ed31228ab46c3cda687a8b6b975927302866f2ff34477e0fd4b064736f6c634300081a0033
Deployed Bytecode
0x608060405260043610610280575f3560e01c806370a0823111610155578063ad3cb1cc116100be578063cd5d211811610078578063cd5d2118146107db578063d2cab05614610809578063d5abeb0114610828578063e985e9c51461083c578063ee16edb71461085b578063f2fde38b1461087a575f80fd5b8063ad3cb1cc14610726578063b88d4fde14610756578063c1bd8cf914610775578063c25043e914610789578063c87b56dd146107a8578063caa0f92a146107c7575f80fd5b80638c7a63ae1161010f5780638c7a63ae146106585780638da5cb5b146106845780638f50d0a8146106c057806395d89b41146106df578063970f9fc8146106f3578063a22cb46514610707575f80fd5b806370a0823114610591578063715018a6146105b057806372be0d8b146105c4578063772bcfb9146105e35780637cb64759146106025780638521b8e314610621575f80fd5b80632a55205a116101f75780634f1ef286116101b15780634f1ef286146104c657806352d1902d146104d957806355f804b3146104ed5780635c0238a91461050c5780636352211e14610553578063650286e914610572575f80fd5b80632a55205a1461040057806333b3a8071461043e57806342842e0e1461045557806342966c6814610474578063484b973c1461049357806349590657146104b2575f80fd5b80630b44a218116102485780630b44a218146103505780630da63d6f1461036f578063222f320f1461039b57806323b872dd146103b957806324933ba6146103d857806329758bd4146103ec575f80fd5b806301ffc9a71461028457806304634d8d146102b857806306fdde03146102d9578063081812fc146102fa578063095ea7b314610331575b5f80fd5b34801561028f575f80fd5b506102a361029e36600461266a565b610899565b60405190151581526020015b60405180910390f35b3480156102c3575f80fd5b506102d76102d23660046126a0565b6108d6565b005b3480156102e4575f80fd5b506102ed6108ec565b6040516102af919061270e565b348015610305575f80fd5b50610319610314366004612720565b61098d565b6040516001600160a01b0390911681526020016102af565b34801561033c575f80fd5b506102d761034b366004612737565b6109a1565b34801561035b575f80fd5b506102d761036a36600461275f565b6109ac565b34801561037a575f80fd5b5061038e6103893660046127d1565b6109de565b6040516102af919061287b565b3480156103a6575f80fd5b506007545b6040519081526020016102af565b3480156103c4575f80fd5b506102d76103d33660046128d2565b610a9a565b3480156103e3575f80fd5b506102a3610afa565b3480156103f7575f80fd5b506004546103ab565b34801561040b575f80fd5b5061041f61041a36600461290c565b610b08565b604080516001600160a01b0390931683526020830191909152016102af565b348015610449575f80fd5b5060095460ff166102a3565b348015610460575f80fd5b506102d761046f3660046128d2565b610bb2565b34801561047f575f80fd5b506102d761048e366004612720565b610bd1565b34801561049e575f80fd5b506102d76104ad366004612737565b610c41565b3480156104bd575f80fd5b506006546103ab565b6102d76104d436600461299d565b610cc7565b3480156104e4575f80fd5b506103ab610ce2565b3480156104f8575f80fd5b506102d76105073660046129e7565b610cfd565b348015610517575f80fd5b5061053e610526366004612720565b600e6020525f90815260409020805460019091015482565b604080519283526020830191909152016102af565b34801561055e575f80fd5b5061031961056d366004612720565b610d11565b34801561057d575f80fd5b506102a361058c366004612a18565b610d1b565b34801561059c575f80fd5b506103ab6105ab366004612a80565b610ddb565b3480156105bb575f80fd5b506102d7610e33565b3480156105cf575f80fd5b506102d76105de366004612720565b610e46565b3480156105ee575f80fd5b506102d76105fd366004612720565b610ee9565b34801561060d575f80fd5b506102d761061c366004612720565b610f4e565b34801561062c575f80fd5b506102a361063b366004612a80565b6001600160a01b03165f9081526008602052604090205460ff1690565b348015610663575f80fd5b50610677610672366004612720565b610fda565b6040516102af9190612a99565b34801561068f575f80fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610319565b3480156106cb575f80fd5b506102d76106da36600461290c565b61101f565b3480156106ea575f80fd5b506102ed611069565b3480156106fe575f80fd5b506001546103ab565b348015610712575f80fd5b506102d761072136600461275f565b6110a7565b348015610731575f80fd5b506102ed604051806040016040528060058152602001640352e302e360dc1b81525081565b348015610761575f80fd5b506102d7610770366004612ab0565b6110b2565b348015610780575f80fd5b506103ab6110c9565b348015610794575f80fd5b506102d76107a3366004612b13565b6110df565b3480156107b3575f80fd5b506102ed6107c2366004612720565b611228565b3480156107d2575f80fd5b506002546103ab565b3480156107e6575f80fd5b506102a36107f5366004612a80565b600d6020525f908152604090205460ff1681565b348015610814575f80fd5b506102d7610823366004612bc3565b61128e565b348015610833575f80fd5b506003546103ab565b348015610847575f80fd5b506102a3610856366004612c3b565b611410565b348015610866575f80fd5b506102d761087536600461290c565b61145c565b348015610885575f80fd5b506102d7610894366004612a80565b61149f565b5f6108a3826114d9565b806108b257506108b282611518565b806108c157506108c18261153c565b806108d057506108d08261153c565b92915050565b6108de611560565b6108e882826115ac565b5050565b5f80516020612f67833981519152805460609190819061090b90612c6c565b80601f016020809104026020016040519081016040528092919081815260200182805461093790612c6c565b80156109825780601f1061095957610100808354040283529160200191610982565b820191905f5260205f20905b81548152906001019060200180831161096557829003601f168201915b505050505091505090565b5f61099782611601565b506108d082611638565b6108e8828233611675565b6109b4611560565b6001600160a01b03919091165f908152600d60205260409020805460ff1916911515919091179055565b60605f82516001600160401b038111156109fa576109fa61278d565b604051908082528060200260200182016040528015610a3e57816020015b604080518082019091525f8082526020820152815260200190600190039081610a185790505b5090505f5b8351811015610a9357610a6e848281518110610a6157610a61612ca4565b6020026020010151610fda565b828281518110610a8057610a80612ca4565b6020908102919091010152600101610a43565b5092915050565b5f195f610aa683610fda565b90505f198282602001511814610ae85760208101516040516328211da560e21b8152610adf918591600401918252602082015260400190565b60405180910390fd5b610af3858585611682565b5050505050565b5f610b03611705565b905090565b5f828152600b602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610b7c575060408051808201909152600a546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101515f9061271090610b9a906001600160601b031687612ccc565b610ba49190612ce3565b915196919550909350505050565b610bcc83838360405180602001604052805f8152506110b2565b505050565b610bdb338261171b565b610c355760405162461bcd60e51b815260206004820152602560248201527f6275726e2063616c6c6572206973206e6f74206f776e6572206e6f72206170706044820152641c9bdd995960da1b6064820152608401610adf565b610c3e81611779565b50565b610c496117b1565b6001600160a01b038216610c705760405163147487d560e11b815260040160405180910390fd5b600454811115610c935760405163081a4b7f60e01b815260040160405180910390fd5b610cae81610c9f6110c9565b610ca99190612d02565b6117b9565b600480548290039055610cc182826117ec565b50505050565b610ccf611848565b610cd8826118ec565b6108e8828261194a565b5f610ceb611a06565b505f80516020612f8783398151915290565b610d05611560565b600c6108e88282612d59565b5f6108d082611601565b335f908152600d602052604081205460ff16610d4a5760405163ace6c44f60e01b815260040160405180910390fd5b610d5d610d5684610d11565b3385611a4f565b5f838152600e602081815260408084208151808301835281548152600182018054828601529589905293835286519055908501519092559051849033907f05960a5f70025e9914df9504017285b8b806d8f2b4c36b487f50110a863b15d790610dc99085908890612e13565b60405180910390a35060019392505050565b5f5f80516020612f678339815191526001600160a01b038316610e13576040516322718ad960e21b81525f6004820152602401610adf565b6001600160a01b039092165f908152600390920160205250604090205490565b610e3b611560565b610e445f611ab3565b565b610e4e6117b1565b428111610e6e5760405163af3e22bd60e01b815260040160405180910390fd5b5f5460ff1615610ea057600154421015610e9b5760405163d705ba2f60e01b815260040160405180910390fd5b610ead565b5f805460ff191660011790555b60018190556040518181527ff05c67ac09cc489b8b8a4713b524acfbf22fca066ee972319956423eca41e81d906020015b60405180910390a150565b610ef16117b1565b610ef9611b23565b428111610f195760405163af3e22bd60e01b815260040160405180910390fd5b60018190556040518181527f8ef44b9f15cd912828f8c65a0bc6364c6918b2128c541fa639a6b21f7fdb6b6b90602001610ede565b610f566117b1565b6005545f03610f785760405163058eb39760e01b815260040160405180910390fd5b80610f965760405163910c15a760e01b815260040160405180910390fd5b60068190556040518181527f90004c04698bc3322499a575ed3752dd4abf33e0a7294c06a787a0fe01bea9419060200160405180910390a150600580545f19019055565b604080518082019091525f8082526020820152610ff682611601565b50505f818152600e60209081526040918290208251808401909352600101549082015290815290565b6110276117b1565b600954610100900460ff16156110505760405163f5950a1560e01b815260040160405180910390fd5b6009805461ff0019166101001790556108e88282611b48565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930180546060915f80516020612f678339815191529161090b90612c6c565b6108e8338383611b9a565b6110bd848484610a9a565b610cc184848484611c49565b5f60016110d560025490565b610b039190612e39565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156111235750825b90505f826001600160401b0316600114801561113e5750303b155b90508115801561114c575080155b1561116a5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561119457845460ff60401b1916600160401b1785555b61119e8c8c611d68565b6111a6611d7a565b6111af33611d82565b6111b7611d7a565b6111c1888861101f565b6111cb8a8a611d93565b6111d486610cfd565b831561121a57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050505050565b606061123382611601565b505f600c805461124290612c6c565b90501161125d5760405180602001604052805f8152506108d0565b600c61126883611e03565b604051602001611279929190612e63565b60405160208183030381529060405292915050565b611296611b23565b600654806112b75760405163d8a88d9760e01b815260040160405180910390fd5b335f9081526008602052604090205460ff16156112e75760405163515717ab60e11b815260040160405180910390fd5b5f846112f16110c9565b6112fb9190612d02565b9050600754851115611320576040516336da9a2760e11b815260040160405180910390fd5b611329816117b9565b6113be8484808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525086925061136a91506116719050565b604080516001600160a01b039092166020830152810189905260600160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120611e92565b6113db57604051637b52e59360e01b815260040160405180910390fd5b335f818152600860205260409020805460ff1916600117905560078054879003905561140790866117ec565b50505050505050565b6001600160a01b039182165f9081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793056020908152604080832093909416825291909152205460ff1690565b6114646117b1565b60095460ff16156114885760405163213c129760e11b815260040160405180910390fd5b6009805460ff191660011790556108e88282611d93565b6114a7611560565b6001600160a01b0381166114d057604051631e4fbdf760e01b81525f6004820152602401610adf565b610c3e81611ab3565b5f6001600160e01b031982166380ac58cd60e01b148061150957506001600160e01b03198216635b5e139f60e01b145b806108d057506108d082611ea9565b5f6001600160e01b03198216632483248360e11b14806108d057506108d0826114d9565b5f6001600160e01b0319821663152a902d60e11b14806108d057506108d082611ea9565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03163314610e445760405163118cdaa760e01b8152336004820152602401610adf565b6115b68282611ebf565b6040516001600160601b03821681526001600160a01b038316907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9060200160405180910390a25050565b5f8061160c83611f61565b90506001600160a01b0381166108d057604051637e27328960e01b815260048101849052602401610adf565b5f9081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930460205260409020546001600160a01b031690565b3390565b610bcc8383836001611f9a565b6001600160a01b0382166116ab57604051633250574960e11b81525f6004820152602401610adf565b5f6116b78383336120ad565b9050836001600160a01b0316816001600160a01b031614610cc1576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610adf565b5f805460ff168015610b03575050600154421090565b5f8061172683610d11565b9050806001600160a01b0316846001600160a01b0316148061174d575061174d8185611410565b806117715750836001600160a01b03166117668461098d565b6001600160a01b0316145b949350505050565b5f6117855f835f6120ad565b90506001600160a01b0381166108e857604051637e27328960e01b815260048101839052602401610adf565b610e44611560565b5f6117c360035490565b905080156108e857808211156108e8576040516358662d6160e11b815260040160405180910390fd5b5f80825f0361180e576040516363b2594760e01b815260040160405180910390fd5b50506002548181015f1901611822836121af565b5f5b8381101561184057611838858285016121c8565b600101611824565b509250929050565b306001600160a01b037f00000000000000000000000028bdd40acd4524b4f301a310610b0ca322eb0a621614806118ce57507f00000000000000000000000028bdd40acd4524b4f301a310610b0ca322eb0a626001600160a01b03166118c25f80516020612f87833981519152546001600160a01b031690565b6001600160a01b031614155b15610e445760405163703e46dd60e11b815260040160405180910390fd5b6118f4611560565b6001600160a01b038116610c3e5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420696d706c656d656e746174696f6e206164647265737300006044820152606401610adf565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156119a4575060408051601f3d908101601f191682019092526119a191810190612eed565b60015b6119cc57604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610adf565b5f80516020612f8783398151915281146119fc57604051632a87526960e21b815260048101829052602401610adf565b610bcc83836121d2565b306001600160a01b037f00000000000000000000000028bdd40acd4524b4f301a310610b0ca322eb0a621614610e445760405163703e46dd60e11b815260040160405180910390fd5b611a5a838383612227565b610bcc576001600160a01b038316611a8857604051637e27328960e01b815260048101829052602401610adf565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610adf565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b611b2b611705565b610e44576040516303ee804960e11b815260040160405180910390fd5b815f03611b6857604051632eff76af60e01b815260040160405180910390fd5b805f03611b88576040516307a64f9b60e21b815260040160405180910390fd5b600782905560058190556108e8612279565b5f80516020612f678339815191526001600160a01b038316611bda57604051630b61174360e31b81526001600160a01b0384166004820152602401610adf565b6001600160a01b038481165f818152600584016020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a350505050565b6001600160a01b0383163b15610cc157604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611c8b903390889087908790600401612f04565b6020604051808303815f875af1925050508015611cc5575060408051601f3d908101601f19168201909252611cc291810190612f40565b60015b611d2c573d808015611cf2576040519150601f19603f3d011682016040523d82523d5f602084013e611cf7565b606091505b5080515f03611d2457604051633250574960e11b81526001600160a01b0385166004820152602401610adf565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14610af357604051633250574960e11b81526001600160a01b0385166004820152602401610adf565b611d70612289565b6108e882826122d2565b610e44612289565b611d8a612289565b610c3e81612302565b5f198203611db457604051630fd46e6760e11b815260040160405180910390fd5b60038290556004819055611dc6612279565b60408051838152602081018390527fdc589a019ee1db2e96132d94ab25ea6587a689283849d4dca055d8742bcdf970910160405180910390a15050565b60605f611e0f8361230a565b60010190505f816001600160401b03811115611e2d57611e2d61278d565b6040519080825280601f01601f191660200182016040528015611e57576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611e6157509392505050565b5f82611e9e85846123e1565b1490505b9392505050565b6001600160e01b0319166301ffc9a760e01b1490565b6127106001600160601b038216811015611efe57604051636f483d0960e01b81526001600160601b038316600482015260248101829052604401610adf565b6001600160a01b038316611f2757604051635b6cc80560e11b81525f6004820152602401610adf565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600a55565b5f9081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930260205260409020546001600160a01b031690565b5f80516020612f678339815191528180611fbc57506001600160a01b03831615155b1561207d575f611fcb85611601565b90506001600160a01b03841615801590611ff75750836001600160a01b0316816001600160a01b031614155b801561200a57506120088185611410565b155b156120335760405163a9fbf51f60e01b81526001600160a01b0385166004820152602401610adf565b821561207b5784866001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5f93845260040160205250506040902080546001600160a01b0319166001600160a01b0392909216919091179055565b5f5f80516020612f67833981519152816120c685611f61565b90506001600160a01b038416156120e2576120e2818587611a4f565b6001600160a01b0381161561211e576120fd5f865f80611f9a565b6001600160a01b0381165f908152600383016020526040902080545f190190555b6001600160a01b0386161561214e576001600160a01b0386165f9081526003830160205260409020805460010190555b5f85815260028301602052604080822080546001600160a01b0319166001600160a01b038a811691821790925591518893918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a495945050505050565b8060025f8282546121c09190612d02565b909155505050565b6108e88282612423565b6121db8261243c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561221f57610bcc828261249f565b6108e8612511565b5f6001600160a01b038316158015906117715750826001600160a01b0316846001600160a01b0316148061226057506122608484611410565b806117715750826001600160a01b031661176683611638565b6002545f03610e44576001600255565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610e4457604051631afcd79f60e31b815260040160405180910390fd5b6122da612289565b5f80516020612f67833981519152806122f38482612d59565b5060018101610cc18382612d59565b6114a7612289565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106123485772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612374576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061239257662386f26fc10000830492506010015b6305f5e10083106123aa576305f5e100830492506008015b61271083106123be57612710830492506004015b606483106123d0576064830492506002015b600a83106108d05760010192915050565b5f81815b845181101561241b576124118286838151811061240457612404612ca4565b6020026020010151612530565b91506001016123e5565b509392505050565b6108e8828260405180602001604052805f815250612559565b806001600160a01b03163b5f0361247157604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610adf565b5f80516020612f8783398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516124bb9190612f5b565b5f60405180830381855af49150503d805f81146124f3576040519150601f19603f3d011682016040523d82523d5f602084013e6124f8565b606091505b509150915061250885838361256f565b95945050505050565b3415610e445760405163b398979f60e01b815260040160405180910390fd5b5f81831061254a575f828152602084905260409020611ea2565b505f9182526020526040902090565b61256383836125cb565b610bcc5f848484611c49565b6060826125845761257f8261262c565b611ea2565b815115801561259b57506001600160a01b0384163b155b156125c457604051639996b31560e01b81526001600160a01b0385166004820152602401610adf565b5080611ea2565b6001600160a01b0382166125f457604051633250574960e11b81525f6004820152602401610adf565b5f61260083835f6120ad565b90506001600160a01b03811615610bcc576040516339e3563760e11b81525f6004820152602401610adf565b80511561263c5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160e01b031981168114610c3e575f80fd5b5f6020828403121561267a575f80fd5b8135611ea281612655565b80356001600160a01b038116811461269b575f80fd5b919050565b5f80604083850312156126b1575f80fd5b6126ba83612685565b915060208301356001600160601b03811681146126d5575f80fd5b809150509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611ea260208301846126e0565b5f60208284031215612730575f80fd5b5035919050565b5f8060408385031215612748575f80fd5b61275183612685565b946020939093013593505050565b5f8060408385031215612770575f80fd5b61277983612685565b9150602083013580151581146126d5575f80fd5b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b03811182821017156127c9576127c961278d565b604052919050565b5f602082840312156127e1575f80fd5b81356001600160401b038111156127f6575f80fd5b8201601f81018413612806575f80fd5b80356001600160401b0381111561281f5761281f61278d565b8060051b61282f602082016127a1565b9182526020818401810192908101908784111561284a575f80fd5b6020850194505b8385101561287057843580835260209586019590935090910190612851565b979650505050505050565b602080825282518282018190525f918401906040840190835b818110156128c7576128b183855180518252602090810151910152565b6020939093019260409290920191600101612894565b509095945050505050565b5f805f606084860312156128e4575f80fd5b6128ed84612685565b92506128fb60208501612685565b929592945050506040919091013590565b5f806040838503121561291d575f80fd5b50508035926020909101359150565b5f82601f83011261293b575f80fd5b8135602083015f806001600160401b0384111561295a5761295a61278d565b50601f8301601f191660200161296f816127a1565b915050828152858383011115612983575f80fd5b828260208301375f92810160200192909252509392505050565b5f80604083850312156129ae575f80fd5b6129b783612685565b915060208301356001600160401b038111156129d1575f80fd5b6129dd8582860161292c565b9150509250929050565b5f602082840312156129f7575f80fd5b81356001600160401b03811115612a0c575f80fd5b6117718482850161292c565b5f808284036060811215612a2a575f80fd5b833592506040601f1982011215612a3f575f80fd5b50604080519081016001600160401b0381118282101715612a6257612a6261278d565b60409081526020858101358352940135938101939093525092909150565b5f60208284031215612a90575f80fd5b611ea282612685565b8151815260208083015190820152604081016108d0565b5f805f8060808587031215612ac3575f80fd5b612acc85612685565b9350612ada60208601612685565b92506040850135915060608501356001600160401b03811115612afb575f80fd5b612b078782880161292c565b91505092959194509250565b5f805f805f805f60e0888a031215612b29575f80fd5b87356001600160401b03811115612b3e575f80fd5b612b4a8a828b0161292c565b97505060208801356001600160401b03811115612b65575f80fd5b612b718a828b0161292c565b96505060408801359450606088013593506080880135925060a0880135915060c08801356001600160401b03811115612ba8575f80fd5b612bb48a828b0161292c565b91505092959891949750929550565b5f805f60408486031215612bd5575f80fd5b8335925060208401356001600160401b03811115612bf1575f80fd5b8401601f81018613612c01575f80fd5b80356001600160401b03811115612c16575f80fd5b8660208260051b8401011115612c2a575f80fd5b939660209190910195509293505050565b5f8060408385031215612c4c575f80fd5b612c5583612685565b9150612c6360208401612685565b90509250929050565b600181811c90821680612c8057607f821691505b602082108103612c9e57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176108d0576108d0612cb8565b5f82612cfd57634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156108d0576108d0612cb8565b601f821115610bcc57805f5260205f20601f840160051c81016020851015612d3a5750805b601f840160051c820191505b81811015610af3575f8155600101612d46565b81516001600160401b03811115612d7257612d7261278d565b612d8681612d808454612c6c565b84612d15565b6020601f821160018114612db8575f8315612da15750848201515b5f19600385901b1c1916600184901b178455610af3565b5f84815260208120601f198516915b82811015612de75787850151825560209485019460019092019101612dc7565b5084821015612e0457868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b825181526020808401518183015282516040830152820151606082015260808101611ea2565b818103818111156108d0576108d0612cb8565b5f81518060208401855e5f93019283525090919050565b5f808454612e7081612c6c565b600182168015612e875760018114612e9c57612ec9565b60ff1983168652811515820286019350612ec9565b875f5260205f205f5b83811015612ec157815488820152600190910190602001612ea5565b505081860193505b505050612ed68185612e4c565b64173539b7b760d91b815260050195945050505050565b5f60208284031215612efd575f80fd5b5051919050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90612f36908301846126e0565b9695505050505050565b5f60208284031215612f50575f80fd5b8151611ea281612655565b5f611ea28284612e4c56fe80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220a3780ea95f01ed31228ab46c3cda687a8b6b975927302866f2ff34477e0fd4b064736f6c634300081a0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.