ERC-721
Overview
Max Total Supply
8,000 MAL3D
Holders
222
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 MAL3DLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
MoonApeLab3D
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.8.13 <0.9.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "./RandomlyAssigned.sol"; interface IMoonStaking { function getTokenYield( address contractAddress, uint256 tokenId ) external view returns (uint256); function getStakerNFT( address staker ) external view returns ( uint256[] memory, uint256[] memory, uint256[] memory, uint256[] memory, uint256[] memory ); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf( address contractAddress, uint256 tokenId ) external view returns (address); } interface IMoonPass { function balanceOf(address owner) external view returns (uint256 balance); function tokenOfOwnerByIndex( address owner, uint256 index ) external view returns (uint256 tokenId); function ownerOf(uint256 tokenId) external view returns (address owner); function pass_value_in_apes( uint256 _tokenId ) external view returns (uint256); } contract MoonApeLab3D is ERC721, Ownable, ReentrancyGuard, ERC2981, RandomlyAssigned { using Strings for uint256; address public constant GENESIS = 0x34c4EBA1966B502dfCF0868b6f271d85CC8A2312; address public constant MOONSTAKING = 0x00a103267A22971375C3C37d6E1f1BDfb548e946; address public constant MOONSTAKING2 = 0x34E391FdAE0965e4b0F85EA702572A13F6B5eBa2; address public constant MOONPASS = 0xbBCCBD7BD5601232334CD64846e0cC64dFE37b4E; mapping(address => bool) public partnerCollections; // partner collections uint256 public royalties; bytes32 public merkleRoot; mapping(address => bool) public ambassadorClaimed; mapping(address => uint256) public staffClaimed; mapping(uint256 => bool) public matchminted; string public uriPrefix = "https://storage.moonapelab.io/static/moonapes3d/metadata/"; string public uriSuffix = ".json"; string public hiddenMetadataUri; uint256 public cost; uint256 public maxMintAmountPerTx = 10; uint256 public maxMintAmountPerWallet = 30; bool public paused = true; bool public revealed = false; uint256 public mintPhase = 0; mapping(uint256 => uint256) private discountLadder; constructor() ERC721("Moon Ape Lab 3D", "MAL3D") Ownable() RandomlyAssigned(8000, 1) { setCost(50000000000000000); setMaxMintAmountPerTx(10); setHiddenMetadataUri( "https://storage.moonapelab.io/static/moonapes3d/metadata/hidden.json" ); discountLadder[1] = 5; discountLadder[5] = 10; discountLadder[10] = 15; royalties = 500; } // ----- Modifiers ------ modifier mintCompliance(uint256 _mintAmount) { require( _mintAmount > 0 && _mintAmount <= maxMintAmountPerTx, "Invalid mint amount!" ); require( tokenCount() + _mintAmount <= totalSupply(), "Max supply exceeded!" ); _; } modifier mintPriceDiscountCompliance( uint256 _mintAmount, uint256 _discountToken ) { require( verifyMoonPassOwnership(_discountToken), "You are not the owner of this pass!" ); uint256 value = IMoonPass(MOONPASS).pass_value_in_apes(_discountToken); uint256 discount = discountLadder[value]; require( msg.value >= ((cost * (100 - discount)) / 100) * _mintAmount, "Insufficient funds!" ); _; } modifier mintPriceCompliance(uint256 _mintAmount) { require(msg.value >= cost * _mintAmount, "Insufficient funds!"); _; } function verifyMALOwnership(uint256 _tokenId) private view returns (bool) { address _owner = IERC721(GENESIS).ownerOf(_tokenId); if (_owner == _msgSender()) return true; if (_owner == MOONSTAKING) { _owner = IMoonStaking(MOONSTAKING).ownerOf(GENESIS, _tokenId); } else if (_owner == MOONSTAKING2) { _owner = IMoonStaking(MOONSTAKING2).ownerOf(GENESIS, _tokenId); } if (_msgSender() == _owner) { return true; } return false; } function verifyMoonPassOwnership( uint256 _tokenId ) private view returns (bool) { address _owner = IERC721(MOONPASS).ownerOf(_tokenId); if (_msgSender() == _owner) { return true; } return false; } // ----- Mint Functions ------ function matchedMint( uint256[] memory _tokens, bytes32[] calldata _merkleProof ) public payable mintCompliance(_tokens.length) mintPriceCompliance(_tokens.length) { require(!paused, "The contract is paused!"); require( (mintPhase == 1 || mintPhase == 2 || mintPhase == 5), "Snapshot mint is not enabled!" ); _matchedMint(_tokens, _merkleProof); } function matchedMintDicounted( uint256[] memory _tokens, bytes32[] calldata _merkleProof, uint256 _discountToken ) public payable mintCompliance(_tokens.length) mintPriceDiscountCompliance(_tokens.length, _discountToken) { require(!paused, "The contract is paused!"); require( (mintPhase == 1 || mintPhase == 2), "Snapshot mint is not enabled!" ); _matchedMint(_tokens, _merkleProof); } function _matchedMint( uint256[] memory _tokens, bytes32[] calldata _merkleProof ) private { bytes32 leaf = keccak256(abi.encodePacked(_msgSender())); require( MerkleProof.verify(_merkleProof, merkleRoot, leaf), "Invalid proof!" ); for (uint256 i = 0; i < _tokens.length; i++) { require( verifyMALOwnership(_tokens[i]), "You are not the owner of this NFT!" ); _safeMint(_msgSender(), fakeNextToken(_tokens[i])); matchminted[_tokens[i]] = true; } } // phase 3 - free, no need for discount function transactionLimitedMatchedMint( uint256[] memory _tokens, bytes32[] calldata _merkleProof ) public payable { require(mintPhase == 3, "The Abassador mint is not enabled!"); require(!ambassadorClaimed[_msgSender()], "Address already claimed!"); _matchedMint(_tokens, _merkleProof); ambassadorClaimed[_msgSender()] = true; } function walletLimitedMatchedMint( uint256[] memory _tokens, bytes32[] calldata _merkleProof ) public payable { require(mintPhase == 4, "The Abassador mint is not enabled!"); require( staffClaimed[_msgSender()] + _tokens.length <= maxMintAmountPerWallet, "Limit reached!" ); _matchedMint(_tokens, _merkleProof); staffClaimed[_msgSender()] = staffClaimed[_msgSender()] + _tokens.length; } // phase 6 function partnerMint( uint256 _mintAmount, address _collection ) public payable mintCompliance(_mintAmount) mintPriceCompliance(_mintAmount) { require(mintPhase == 6, "The partner mint is not enabled!"); // require(!partnerClaimed[_msgSender()], "Address already claimed!"); // TODO Remove limit? require(partnerCollections[_collection], "Collection not whitelisted!"); require( IERC721(_collection).balanceOf(_msgSender()) > 0, "Address does not hold any partner NFTs!" ); for (uint256 index = 0; index < _mintAmount; index++) { _safeMint(_msgSender(), nextToken()); } } function partnerMintDiscount( uint256 _mintAmount, address _collection, uint256 _discountToken ) public payable mintCompliance(_mintAmount) mintPriceDiscountCompliance(_mintAmount, _discountToken) { require(mintPhase == 6, "The partner mint is not enabled!"); require(partnerCollections[_collection], "Collection not whitelisted!"); require( IERC721(_collection).balanceOf(_msgSender()) > 0, "Address does not hold any partner NFTs!" ); for (uint256 index = 0; index < _mintAmount; index++) { _safeMint(_msgSender(), nextToken()); } } // PUBLIC MINT function mint( uint256 _mintAmount ) public payable mintCompliance(_mintAmount) mintPriceCompliance(_mintAmount) ensureAvailabilityFor(_mintAmount) { require(!paused, "The contract is paused!"); require(mintPhase == 7, "Public mint not started"); for (uint256 index = 0; index < _mintAmount; index++) { _safeMint(_msgSender(), nextToken()); } } function mintDiscount( uint256 _mintAmount, uint256 _discountToken ) public payable mintCompliance(_mintAmount) mintPriceDiscountCompliance(_mintAmount, _discountToken) { require(!paused, "The contract is paused!"); require(mintPhase == 7, "Public mint not started"); _safeMint(_msgSender(), nextToken()); } // Only Owner for giveaway etc function mintForAddress( uint256 _mintAmount, address _receiver ) public mintCompliance(_mintAmount) onlyOwner { for (uint256 index = 0; index < _mintAmount; index++) { _safeMint(_receiver, nextToken()); } } function mintMatchedForAddress( uint256[] memory _tokens, address _receiver ) public mintCompliance(_tokens.length) onlyOwner { for (uint256 i = 0; i < _tokens.length; i++) { _safeMint(_receiver, fakeNextToken(_tokens[i])); matchminted[_tokens[i]] = true; } } function getMintPhase() public view returns (uint256) { return mintPhase; } function isTokenMinted(uint256 _token) external view returns (bool) { if (_ownerOf(_token) != address(0)) return true; return false; } // ----- Admin Functions ------ function tokenURI( uint256 _tokenId ) public view virtual override(ERC721) returns (string memory) { require( _ownerOf(_tokenId) != address(0), "URI query for nonexistent token" ); if (!matchminted[_tokenId] && revealed == false) { return hiddenMetadataUri; } string memory currentBaseURI = _baseURI(); return bytes(currentBaseURI).length > 0 ? string( abi.encodePacked( currentBaseURI, _tokenId.toString(), uriSuffix ) ) : ""; } function _baseURI() internal view virtual override returns (string memory) { return uriPrefix; } // ----- Start mintphase function ------ function setupPhase( uint256 _mintPhase, uint256 _cost, bytes32 _merkleRoot ) external onlyOwner { mintPhase = _mintPhase; setCost(_cost); merkleRoot = _merkleRoot; } // ----- Only Owner Functions ------ function setRevealed(bool _state) public onlyOwner { revealed = _state; } function setCost(uint256 _cost) public onlyOwner { cost = _cost; } function setMaxMintAmountPerTx( uint256 _maxMintAmountPerTx ) public onlyOwner { maxMintAmountPerTx = _maxMintAmountPerTx; } function setMaxMintAmountPerWallet( uint256 _maxMintAmountPerWallet ) public onlyOwner { maxMintAmountPerWallet = _maxMintAmountPerWallet; } function setHiddenMetadataUri( string memory _hiddenMetadataUri ) public onlyOwner { hiddenMetadataUri = _hiddenMetadataUri; } function setUriPrefix(string memory _uriPrefix) public onlyOwner { uriPrefix = _uriPrefix; } function setUriSuffix(string memory _uriSuffix) public onlyOwner { uriSuffix = _uriSuffix; } function setPaused(bool _state) public onlyOwner { paused = _state; } function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner { merkleRoot = _merkleRoot; } function addPartnerCollection(address _collection) public onlyOwner { partnerCollections[_collection] = true; } function removePartnerCollection(address _collection) public onlyOwner { partnerCollections[_collection] = false; } function royaltyInfo( uint256, uint256 _salePrice ) public view virtual override returns (address, uint256) { uint256 royaltyAmount = (_salePrice * royalties) / _feeDenominator(); return (owner(), royaltyAmount); } function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721, ERC2981) returns (bool) { return ERC721.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); // TODO check if can use only super here... } function withdraw() public onlyOwner nonReentrant { // This will transfer the contract balance to the owner. // Do not remove this otherwise you will not be able to withdraw the funds. // ============================================================================= (bool os, ) = payable(owner()).call{value: address(this).balance}(""); require(os); // ============================================================================= } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "./WithLimitedSupply.sol"; /// @author 1001.digital /// @title Randomly assign tokenIDs from a given set of tokens. abstract contract RandomlyAssigned is WithLimitedSupply { // Used for random index assignment mapping(uint256 => uint256) private tokenMatrix; mapping(uint256 => uint256) private reverseTokenMatrix; // The initial token ID uint256 private startFrom; /// Instanciate the contract /// @param _totalSupply how many tokens this collection should hold /// @param _startFrom the tokenID with which to start counting constructor( uint256 _totalSupply, uint256 _startFrom ) WithLimitedSupply(_totalSupply) { startFrom = _startFrom; } /// Get the next token ID /// @dev Randomly gets a new token ID and keeps track of the ones that are still available. /// @return the next token ID function nextToken() internal override ensureAvailability returns (uint256) { uint256 maxIndex = totalSupply() - tokenCount(); uint256 random = uint256( keccak256( abi.encodePacked( msg.sender, block.coinbase, block.difficulty, block.gaslimit, block.timestamp ) ) ) % maxIndex; uint256 value = 0; if (tokenMatrix[random] == 0) { // If this matrix position is empty, set the value to the generated random number. value = random; } else { // Otherwise, use the previously stored number from the matrix. value = tokenMatrix[random]; } // If the last available tokenID is still unused... if (tokenMatrix[maxIndex - 1] == 0) { // ...store that ID in the current matrix position. tokenMatrix[random] = maxIndex - 1; } else { // ...otherwise copy over the stored number to the current matrix position. tokenMatrix[random] = tokenMatrix[maxIndex - 1]; } // Increment counts super.nextToken(); return value + startFrom; } function fakeNextToken( uint256 tokenId ) internal ensureAvailability returns (uint256) { uint256 maxIndex = totalSupply() - tokenCount(); uint256 random = tokenId - startFrom; uint256 value = 0; if (tokenMatrix[random] == 0) { // If this matrix position is empty, set the value to the generated random number. value = random; } else { // Otherwise, use the previously stored number from the matrix. value = tokenMatrix[random]; } uint256 lastIndex = maxIndex - 1; if (lastIndex < random) { lastIndex = reverseTokenMatrix[random]; } // If the last available tokenID is still unused... if (tokenMatrix[lastIndex] == 0) { // ...store that ID in the current matrix position. tokenMatrix[random] = lastIndex; reverseTokenMatrix[lastIndex] = random; } else { // ...otherwise copy over the stored number to the current matrix position. tokenMatrix[random] = maxIndex - 1; } // Increment counts super.nextToken(); return tokenId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/common/ERC2981.sol) pragma solidity ^0.8.20; import {IERC2981} from "../../interfaces/IERC2981.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. */ 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]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol) 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) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "./IERC721.sol"; import {IERC721Receiver} from "./IERC721Receiver.sol"; import {IERC721Metadata} from "./extensions/IERC721Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {Strings} from "../../utils/Strings.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; import {IERC721Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; mapping(uint256 tokenId => address) private _owners; mapping(address owner => uint256) private _balances; mapping(uint256 tokenId => address) private _tokenApprovals; mapping(address owner => mapping(address operator => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual returns (uint256) { 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) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { 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) { 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) { 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) { 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 { 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) { 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 { // 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 { 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)) } } } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/utils/Counters.sol"; /// @author 1001.digital /// @title A token tracker that limits the token supply and increments token IDs on each new mint. abstract contract WithLimitedSupply { using Counters for Counters.Counter; /// @dev Emitted when the supply of this collection changes event SupplyChanged(uint256 indexed supply); // Keeps track of how many we have minted Counters.Counter private _tokenCount; /// @dev The maximum count of tokens this token tracker will hold. uint256 private _totalSupply; /// Instanciate the contract /// @param totalSupply_ how many tokens this collection should hold constructor(uint256 totalSupply_) { _totalSupply = totalSupply_; } /// @dev Get the max Supply /// @return the maximum token count function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /// @dev Get the current token count /// @return the created token count function tokenCount() public view returns (uint256) { return _tokenCount.current(); } /// @dev Check whether tokens are still available /// @return the available token count function availableTokenCount() public view returns (uint256) { return totalSupply() - tokenCount(); } /// @dev Increment the token count and fetch the latest count /// @return the next token id function nextToken() internal virtual returns (uint256) { uint256 token = _tokenCount.current(); _tokenCount.increment(); return token; } /// @dev Check whether another token is still available modifier ensureAvailability() { require(availableTokenCount() > 0, "No more tokens available"); _; } /// @param amount Check whether number of tokens are still available /// @dev Check whether tokens are still available modifier ensureAvailabilityFor(uint256 amount) { require( availableTokenCount() >= amount, "Requested number of tokens not available" ); _; } /// Update the supply for the collection /// @param _supply the new token supply. /// @dev create additional token supply for this collection. function _setSupply(uint256 _supply) internal virtual { require( _supply > tokenCount(), "Can't set the supply to less than the current token count" ); _totalSupply = _supply; emit SupplyChanged(totalSupply()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @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)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.20; import {IERC721} from "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (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); } } }
// SPDX-License-Identifier: MIT // 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; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"supply","type":"uint256"}],"name":"SupplyChanged","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"},{"inputs":[],"name":"GENESIS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MOONPASS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MOONSTAKING","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MOONSTAKING2","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"}],"name":"addPartnerCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"ambassadorClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"availableTokenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMintPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hiddenMetadataUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_token","type":"uint256"}],"name":"isTokenMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokens","type":"uint256[]"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"matchedMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokens","type":"uint256[]"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"_discountToken","type":"uint256"}],"name":"matchedMintDicounted","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"matchminted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintAmountPerTx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintAmountPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"},{"internalType":"uint256","name":"_discountToken","type":"uint256"}],"name":"mintDiscount","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"mintForAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokens","type":"uint256[]"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"mintMatchedForAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"partnerCollections","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"},{"internalType":"address","name":"_collection","type":"address"}],"name":"partnerMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"},{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_discountToken","type":"uint256"}],"name":"partnerMintDiscount","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"}],"name":"removePartnerCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royalties","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","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":"uint256","name":"_cost","type":"uint256"}],"name":"setCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_hiddenMetadataUri","type":"string"}],"name":"setHiddenMetadataUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxMintAmountPerTx","type":"uint256"}],"name":"setMaxMintAmountPerTx","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxMintAmountPerWallet","type":"uint256"}],"name":"setMaxMintAmountPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setRevealed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uriPrefix","type":"string"}],"name":"setUriPrefix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uriSuffix","type":"string"}],"name":"setUriSuffix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintPhase","type":"uint256"},{"internalType":"uint256","name":"_cost","type":"uint256"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setupPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"staffClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokens","type":"uint256[]"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"transactionLimitedMatchedMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uriPrefix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uriSuffix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokens","type":"uint256[]"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"walletLimitedMatchedMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e0604052603960808181529062003e8760a0396015906200002290826200035d565b50604080518082019091526005815264173539b7b760d91b60208201526016906200004e90826200035d565b50600a601955601e601a55601b805461ffff191660011790555f601c5534801562000077575f80fd5b50611f406001816040518060400160405280600f81526020016e135bdbdb88105c1948131858880cd1608a1b815250604051806040016040528060058152602001641350530cd160da1b815250815f9081620000d491906200035d565b506001620000e382826200035d565b50505062000100620000fa620001cf60201b60201c565b620001d3565b6001600755600b55600e55506200011e66b1a2bc2ec5000062000224565b6200012a600a62000233565b6200014e60405180608001604052806044815260200162003ec06044913962000242565b601d60205260057f9de6abd965d55c3bb0cdbf6fa175050624c6ff8fe86f682dc08f2a450ede227855600a7fd19a5fe801b7c1f3d54e7cd62d56e46f02f2ab5a22ee5edcfdddda6c80cf4c118190555f52600f7f9a6dd49d3ca08bac537513f283fa0ffb756ffca298e0ca3426e59487125eb8db556101f460105562000429565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6200022e6200025e565b601855565b6200023d6200025e565b601955565b6200024c6200025e565b60176200025a82826200035d565b5050565b6006546001600160a01b03163314620002bd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b565b634e487b7160e01b5f52604160045260245ffd5b600181811c90821680620002e857607f821691505b6020821081036200030757634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200035857805f5260205f20601f840160051c81016020851015620003345750805b601f840160051c820191505b8181101562000355575f815560010162000340565b50505b505050565b81516001600160401b03811115620003795762000379620002bf565b62000391816200038a8454620002d3565b846200030d565b602080601f831160018114620003c7575f8415620003af5750858301515b5f19600386901b1c1916600185901b17855562000421565b5f85815260208120601f198616915b82811015620003f757888601518255948401946001909101908401620003d6565b50858210156200041557878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b613a5080620004375f395ff3fe6080604052600436106103b3575f3560e01c80638418d7a3116101e9578063b7dec1b711610108578063e14ca3531161009d578063f1a30ca31161006d578063f1a30ca314610ab6578063f2fde38b14610ac9578063f6b89c0514610ae8578063fa84e75414610b07575f80fd5b8063e14ca35314610a4f578063e985e9c514610a63578063efbd73f414610a82578063f053dc5c14610aa1575f80fd5b8063c52766c6116100d8578063c52766c6146109d2578063c87b56dd146109e6578063d527624b14610a05578063e0a8085314610a30575f80fd5b8063b7dec1b714610949578063b88d4fde14610970578063bc951b911461098f578063c441d692146109a4575f80fd5b80639f181b5e1161017e578063a8b8bdb21161014e578063a8b8bdb2146108b6578063b06ab712146108e4578063b071401b1461090b578063b115c74f1461092a575f80fd5b80639f181b5e1461085c578063a0712d6814610870578063a22cb46514610883578063a45ba8e7146108a2575f80fd5b806391c39a5b116101b957806391c39a5b146107f957806394354fd01461080c57806395d89b411461082157806397022d2c14610835575f80fd5b80638418d7a3146107695780638da5cb5b1461078f5780638dd59bda146107ac5780638f96a7cb146107da575f80fd5b8063437f1f3f116102d55780636d9814a61161026a578063766b7d091161023a578063766b7d09146106f957806376c3537b146107185780637cb647591461072b5780637ec4a6591461074a575f80fd5b80636d9814a61461069457806370a08231146106a7578063715018a6146106c65780637190f205146106da575f80fd5b80635503a0e8116102a55780635503a0e8146106345780635c975abb1461064857806362b99ad4146106615780636352211e14610675575f80fd5b8063437f1f3f146105c557806344a0d68a146105d85780634fdd43cb146105f75780635183022714610616575f80fd5b806318160ddd1161034b5780632eb4a7ab1161031b5780632eb4a7ab1461056a578063364993b21461057f5780633ccfd60b1461059257806342842e0e146105a6575f80fd5b806318160ddd146104da57806323b872dd146104ee578063267864491461050d5780632a55205a1461052c575f80fd5b806313faede61161038657806313faede61461046457806316ba10e01461048757806316c38b3c146104a657806317881cbf146104c5575f80fd5b806301ffc9a7146103b757806306fdde03146103eb578063081812fc1461040c578063095ea7b314610443575b5f80fd5b3480156103c2575f80fd5b506103d66103d1366004613017565b610b1a565b60405190151581526020015b60405180910390f35b3480156103f6575f80fd5b506103ff610b39565b6040516103e2919061307f565b348015610417575f80fd5b5061042b610426366004613091565b610bc8565b6040516001600160a01b0390911681526020016103e2565b34801561044e575f80fd5b5061046261045d3660046130bc565b610bef565b005b34801561046f575f80fd5b5061047960185481565b6040519081526020016103e2565b348015610492575f80fd5b506104626104a1366004613180565b610bfe565b3480156104b1575f80fd5b506104626104c03660046131d4565b610c12565b3480156104d0575f80fd5b50610479601c5481565b3480156104e5575f80fd5b50600b54610479565b3480156104f9575f80fd5b506104626105083660046131ed565b610c2d565b348015610518575f80fd5b5061046261052736600461322b565b610cbb565b348015610537575f80fd5b5061054b610546366004613246565b610ce3565b604080516001600160a01b0390931683526020830191909152016103e2565b348015610575575f80fd5b5061047960115481565b61046261058d366004613324565b610d2f565b34801561059d575f80fd5b50610462610de8565b3480156105b1575f80fd5b506104626105c03660046131ed565b610e71565b6104626105d3366004613324565b610e90565b3480156105e3575f80fd5b506104626105f2366004613091565b610fc3565b348015610602575f80fd5b50610462610611366004613180565b610fd0565b348015610621575f80fd5b50601b546103d690610100900460ff1681565b34801561063f575f80fd5b506103ff610fe4565b348015610653575f80fd5b50601b546103d69060ff1681565b34801561066c575f80fd5b506103ff611070565b348015610680575f80fd5b5061042b61068f366004613091565b61107d565b6104626106a2366004613388565b611087565b3480156106b2575f80fd5b506104796106c136600461322b565b611288565b3480156106d1575f80fd5b506104626112cd565b3480156106e5575f80fd5b506104626106f436600461322b565b6112de565b348015610704575f80fd5b50610462610713366004613091565b611309565b610462610726366004613324565b611316565b348015610736575f80fd5b50610462610745366004613091565b6113c0565b348015610755575f80fd5b50610462610764366004613180565b6113cd565b348015610774575f80fd5b5061042b72a103267a22971375c3c37d6e1f1bdfb548e94681565b34801561079a575f80fd5b506006546001600160a01b031661042b565b3480156107b7575f80fd5b506103d66107c636600461322b565b600f6020525f908152604090205460ff1681565b3480156107e5575f80fd5b506103d66107f4366004613091565b6113e1565b610462610807366004613246565b61140c565b348015610817575f80fd5b5061047960195481565b34801561082c575f80fd5b506103ff6115e8565b348015610840575f80fd5b5061042b73bbccbd7bd5601232334cd64846e0cc64dfe37b4e81565b348015610867575f80fd5b506104796115f7565b61046261087e366004613091565b611606565b34801561088e575f80fd5b5061046261089d3660046133b6565b611789565b3480156108ad575f80fd5b506103ff611794565b3480156108c1575f80fd5b506103d66108d036600461322b565b60126020525f908152604090205460ff1681565b3480156108ef575f80fd5b5061042b7334e391fdae0965e4b0f85ea702572a13f6b5eba281565b348015610916575f80fd5b50610462610925366004613091565b6117a1565b348015610935575f80fd5b506104626109443660046133e9565b6117ae565b348015610954575f80fd5b5061042b7334c4eba1966b502dfcf0868b6f271d85cc8a231281565b34801561097b575f80fd5b5061046261098a366004613412565b6117cb565b34801561099a575f80fd5b50610479601a5481565b3480156109af575f80fd5b506103d66109be366004613091565b60146020525f908152604090205460ff1681565b3480156109dd575f80fd5b50601c54610479565b3480156109f1575f80fd5b506103ff610a00366004613091565b6117e2565b348015610a10575f80fd5b50610479610a1f36600461322b565b60136020525f908152604090205481565b348015610a3b575f80fd5b50610462610a4a3660046131d4565b61195f565b348015610a5a575f80fd5b50610479611981565b348015610a6e575f80fd5b506103d6610a7d36600461348d565b611997565b348015610a8d575f80fd5b50610462610a9c366004613388565b6119c4565b348015610aac575f80fd5b5061047960105481565b610462610ac43660046134b9565b611a4c565b348015610ad4575f80fd5b50610462610ae336600461322b565b611d1a565b348015610af3575f80fd5b50610462610b023660046134dd565b611d93565b610462610b15366004613521565b611e76565b5f610b2482612060565b80610b335750610b33826120af565b92915050565b60605f8054610b479061358c565b80601f0160208091040260200160405190810160405280929190818152602001828054610b739061358c565b8015610bbe5780601f10610b9557610100808354040283529160200191610bbe565b820191905f5260205f20905b815481529060010190602001808311610ba157829003601f168201915b5050505050905090565b5f610bd2826120d3565b505f828152600460205260409020546001600160a01b0316610b33565b610bfa82823361210b565b5050565b610c06612118565b6016610bfa8282613608565b610c1a612118565b601b805460ff1916911515919091179055565b6001600160a01b038216610c5b57604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c67838333612172565b9050836001600160a01b0316816001600160a01b031614610cb5576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610c52565b50505050565b610cc3612118565b6001600160a01b03165f908152600f60205260409020805460ff19169055565b5f80806127106bffffffffffffffffffffffff1660105485610d0591906136dc565b610d0f9190613707565b9050610d236006546001600160a01b031690565b925090505b9250929050565b601c54600414610d515760405162461bcd60e51b8152600401610c529061371a565b601a548351335f90815260136020526040902054610d6f919061375c565b1115610dae5760405162461bcd60e51b815260206004820152600e60248201526d4c696d697420726561636865642160901b6044820152606401610c52565b610db9838383612264565b8251335f90815260136020526040902054610dd4919061375c565b335f90815260136020526040902055505050565b610df0612118565b610df86123fd565b5f610e0b6006546001600160a01b031690565b6001600160a01b0316476040515f6040518083038185875af1925050503d805f8114610e52576040519150601f19603f3d011682016040523d82523d5f602084013e610e57565b606091505b5050905080610e64575f80fd5b50610e6f6001600755565b565b610e8b83838360405180602001604052805f8152506117cb565b505050565b82515f81118015610ea357506019548111155b610ebf5760405162461bcd60e51b8152600401610c529061376f565b600b5481610ecb6115f7565b610ed5919061375c565b1115610ef35760405162461bcd60e51b8152600401610c529061379d565b835180601854610f0391906136dc565b341015610f225760405162461bcd60e51b8152600401610c52906137cb565b601b5460ff1615610f455760405162461bcd60e51b8152600401610c52906137f8565b601c5460011480610f585750601c546002145b80610f655750601c546005145b610fb15760405162461bcd60e51b815260206004820152601d60248201527f536e617073686f74206d696e74206973206e6f7420656e61626c6564210000006044820152606401610c52565b610fbc858585612264565b5050505050565b610fcb612118565b601855565b610fd8612118565b6017610bfa8282613608565b60168054610ff19061358c565b80601f016020809104026020016040519081016040528092919081815260200182805461101d9061358c565b80156110685780601f1061103f57610100808354040283529160200191611068565b820191905f5260205f20905b81548152906001019060200180831161104b57829003601f168201915b505050505081565b60158054610ff19061358c565b5f610b33826120d3565b815f8111801561109957506019548111155b6110b55760405162461bcd60e51b8152600401610c529061376f565b600b54816110c16115f7565b6110cb919061375c565b11156110e95760405162461bcd60e51b8152600401610c529061379d565b82806018546110f891906136dc565b3410156111175760405162461bcd60e51b8152600401610c52906137cb565b601c546006146111695760405162461bcd60e51b815260206004820181905260248201527f54686520706172746e6572206d696e74206973206e6f7420656e61626c6564216044820152606401610c52565b6001600160a01b0383165f908152600f602052604090205460ff166111d05760405162461bcd60e51b815260206004820152601b60248201527f436f6c6c656374696f6e206e6f742077686974656c69737465642100000000006044820152606401610c52565b5f6001600160a01b0384166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611223573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611247919061382f565b116112645760405162461bcd60e51b8152600401610c5290613846565b5f5b84811015610fbc57611280335b61127b612456565b6125de565b600101611266565b5f6001600160a01b0382166112b2576040516322718ad960e21b81525f6004820152602401610c52565b506001600160a01b03165f9081526003602052604090205490565b6112d5612118565b610e6f5f6125f7565b6112e6612118565b6001600160a01b03165f908152600f60205260409020805460ff19166001179055565b611311612118565b601a55565b601c546003146113385760405162461bcd60e51b8152600401610c529061371a565b335f9081526012602052604090205460ff16156113975760405162461bcd60e51b815260206004820152601860248201527f4164647265737320616c726561647920636c61696d65642100000000000000006044820152606401610c52565b6113a2838383612264565b5050335f908152601260205260409020805460ff1916600117905550565b6113c8612118565b601155565b6113d5612118565b6015610bfa8282613608565b5f818152600260205260408120546001600160a01b03161561140557506001919050565b505f919050565b815f8111801561141e57506019548111155b61143a5760405162461bcd60e51b8152600401610c529061376f565b600b54816114466115f7565b611450919061375c565b111561146e5760405162461bcd60e51b8152600401610c529061379d565b828261147981612648565b6114955760405162461bcd60e51b8152600401610c529061388d565b60405163e876b6f560e01b8152600481018290525f9073bbccbd7bd5601232334cd64846e0cc64dfe37b4e9063e876b6f590602401602060405180830381865afa1580156114e5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611509919061382f565b5f818152601d602052604090205490915083606461152783826138d0565b60185461153491906136dc565b61153e9190613707565b61154891906136dc565b3410156115675760405162461bcd60e51b8152600401610c52906137cb565b601b5460ff161561158a5760405162461bcd60e51b8152600401610c52906137f8565b601c546007146115d65760405162461bcd60e51b8152602060048201526017602482015276141d589b1a58c81b5a5b9d081b9bdd081cdd185c9d1959604a1b6044820152606401610c52565b6115df33611273565b50505050505050565b606060018054610b479061358c565b5f611601600a5490565b905090565b805f8111801561161857506019548111155b6116345760405162461bcd60e51b8152600401610c529061376f565b600b54816116406115f7565b61164a919061375c565b11156116685760405162461bcd60e51b8152600401610c529061379d565b818060185461167791906136dc565b3410156116965760405162461bcd60e51b8152600401610c52906137cb565b82806116a0611981565b10156116ff5760405162461bcd60e51b815260206004820152602860248201527f526571756573746564206e756d626572206f6620746f6b656e73206e6f7420616044820152677661696c61626c6560c01b6064820152608401610c52565b601b5460ff16156117225760405162461bcd60e51b8152600401610c52906137f8565b601c5460071461176e5760405162461bcd60e51b8152602060048201526017602482015276141d589b1a58c81b5a5b9d081b9bdd081cdd185c9d1959604a1b6044820152606401610c52565b5f5b84811015610fbc5761178133611273565b600101611770565b610bfa3383836126ec565b60178054610ff19061358c565b6117a9612118565b601955565b6117b6612118565b601c8390556117c482610fc3565b6011555050565b6117d6848484610c2d565b610cb58484848461278a565b5f818152600260205260409020546060906001600160a01b03166118485760405162461bcd60e51b815260206004820152601f60248201527f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e006044820152606401610c52565b5f8281526014602052604090205460ff1615801561186e5750601b54610100900460ff16155b1561190357601780546118809061358c565b80601f01602080910402602001604051908101604052809291908181526020018280546118ac9061358c565b80156118f75780601f106118ce576101008083540402835291602001916118f7565b820191905f5260205f20905b8154815290600101906020018083116118da57829003601f168201915b50505050509050919050565b5f61190c6128a9565b90505f81511161192a5760405180602001604052805f815250611958565b80611934846128b8565b6016604051602001611948939291906138e3565b6040516020818303038152906040525b9392505050565b611967612118565b601b80549115156101000261ff0019909216919091179055565b5f61198a6115f7565b600b5461160191906138d0565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b815f811180156119d657506019548111155b6119f25760405162461bcd60e51b8152600401610c529061376f565b600b54816119fe6115f7565b611a08919061375c565b1115611a265760405162461bcd60e51b8152600401610c529061379d565b611a2e612118565b5f5b83811015610cb557611a448361127b612456565b600101611a30565b825f81118015611a5e57506019548111155b611a7a5760405162461bcd60e51b8152600401610c529061376f565b600b5481611a866115f7565b611a90919061375c565b1115611aae5760405162461bcd60e51b8152600401610c529061379d565b8382611ab981612648565b611ad55760405162461bcd60e51b8152600401610c529061388d565b60405163e876b6f560e01b8152600481018290525f9073bbccbd7bd5601232334cd64846e0cc64dfe37b4e9063e876b6f590602401602060405180830381865afa158015611b25573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b49919061382f565b5f818152601d6020526040902054909150836064611b6783826138d0565b601854611b7491906136dc565b611b7e9190613707565b611b8891906136dc565b341015611ba75760405162461bcd60e51b8152600401610c52906137cb565b601c54600614611bf95760405162461bcd60e51b815260206004820181905260248201527f54686520706172746e6572206d696e74206973206e6f7420656e61626c6564216044820152606401610c52565b6001600160a01b0387165f908152600f602052604090205460ff16611c605760405162461bcd60e51b815260206004820152601b60248201527f436f6c6c656374696f6e206e6f742077686974656c69737465642100000000006044820152606401610c52565b5f6001600160a01b0388166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611cb3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611cd7919061382f565b11611cf45760405162461bcd60e51b8152600401610c5290613846565b5f5b88811015611d0f57611d0733611273565b600101611cf6565b505050505050505050565b611d22612118565b6001600160a01b038116611d875760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c52565b611d90816125f7565b50565b81515f81118015611da657506019548111155b611dc25760405162461bcd60e51b8152600401610c529061376f565b600b5481611dce6115f7565b611dd8919061375c565b1115611df65760405162461bcd60e51b8152600401610c529061379d565b611dfe612118565b5f5b8351811015610cb557611e2f8361127b868481518110611e2257611e22613981565b6020026020010151612948565b600160145f868481518110611e4657611e46613981565b60209081029190910181015182528101919091526040015f20805460ff1916911515919091179055600101611e00565b83515f81118015611e8957506019548111155b611ea55760405162461bcd60e51b8152600401610c529061376f565b600b5481611eb16115f7565b611ebb919061375c565b1115611ed95760405162461bcd60e51b8152600401610c529061379d565b845182611ee581612648565b611f015760405162461bcd60e51b8152600401610c529061388d565b60405163e876b6f560e01b8152600481018290525f9073bbccbd7bd5601232334cd64846e0cc64dfe37b4e9063e876b6f590602401602060405180830381865afa158015611f51573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f75919061382f565b5f818152601d6020526040902054909150836064611f9383826138d0565b601854611fa091906136dc565b611faa9190613707565b611fb491906136dc565b341015611fd35760405162461bcd60e51b8152600401610c52906137cb565b601b5460ff1615611ff65760405162461bcd60e51b8152600401610c52906137f8565b601c54600114806120095750601c546002145b6120555760405162461bcd60e51b815260206004820152601d60248201527f536e617073686f74206d696e74206973206e6f7420656e61626c6564210000006044820152606401610c52565b611d0f898989612264565b5f6001600160e01b031982166380ac58cd60e01b148061209057506001600160e01b03198216635b5e139f60e01b145b80610b3357506301ffc9a760e01b6001600160e01b0319831614610b33565b5f6001600160e01b0319821663152a902d60e11b1480610b335750610b3382612060565b5f818152600260205260408120546001600160a01b031680610b3357604051637e27328960e01b815260048101849052602401610c52565b610e8b8383836001612a7f565b6006546001600160a01b03163314610e6f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c52565b5f828152600260205260408120546001600160a01b039081169083161561219e5761219e818486612b83565b6001600160a01b038116156121d8576121b95f855f80612a7f565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b03851615612206576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6040516bffffffffffffffffffffffff193360601b1660208201525f906034016040516020818303038152906040528051906020012090506122dc8383808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506011549150849050612be7565b6123195760405162461bcd60e51b815260206004820152600e60248201526d496e76616c69642070726f6f662160901b6044820152606401610c52565b5f5b8451811015610fbc5761234685828151811061233957612339613981565b6020026020010151612bfc565b61239d5760405162461bcd60e51b815260206004820152602260248201527f596f7520617265206e6f7420746865206f776e6572206f662074686973204e46604482015261542160f01b6064820152608401610c52565b6123b63361127b878481518110611e2257611e22613981565b600160145f8784815181106123cd576123cd613981565b60209081029190910181015182528101919091526040015f20805460ff191691151591909117905560010161231b565b60026007540361244f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c52565b6002600755565b5f80612460611981565b116124a85760405162461bcd60e51b81526020600482015260186024820152774e6f206d6f726520746f6b656e7320617661696c61626c6560401b6044820152606401610c52565b5f6124b16115f7565b600b546124be91906138d0565b6040516bffffffffffffffffffffffff1933606090811b8216602084015241901b1660348201524460488201524560688201524260888201529091505f90829060a801604051602081830303815290604052805190602001205f1c6125239190613995565b5f818152600c6020526040812054919250908103612542575080612552565b505f818152600c60205260409020545b600c5f6125606001866138d0565b81526020019081526020015f20545f036125925761257f6001846138d0565b5f838152600c60205260409020556125c0565b600c5f6125a06001866138d0565b815260208082019290925260409081015f90812054858252600c90935220555b6125c8612dca565b50600e546125d6908261375c565b935050505090565b610bfa828260405180602001604052805f815250612de5565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6040516331a9108f60e11b8152600481018290525f90819073bbccbd7bd5601232334cd64846e0cc64dfe37b4e90636352211e906024015b602060405180830381865afa15801561269b573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126bf91906139a8565b90506001600160a01b038116335b6001600160a01b0316036126e45750600192915050565b505f92915050565b6001600160a01b03821661271e57604051630b61174360e31b81526001600160a01b0383166004820152602401610c52565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610cb557604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906127cc9033908890879087906004016139c3565b6020604051808303815f875af1925050508015612806575060408051601f3d908101601f19168201909252612803918101906139ff565b60015b61286d573d808015612833576040519150601f19603f3d011682016040523d82523d5f602084013e612838565b606091505b5080515f0361286557604051633250574960e11b81526001600160a01b0385166004820152602401610c52565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14610fbc57604051633250574960e11b81526001600160a01b0385166004820152602401610c52565b606060158054610b479061358c565b60605f6128c483612dfb565b60010190505f8167ffffffffffffffff8111156128e3576128e36130e6565b6040519080825280601f01601f19166020018201604052801561290d576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461291757509392505050565b5f80612952611981565b1161299a5760405162461bcd60e51b81526020600482015260186024820152774e6f206d6f726520746f6b656e7320617661696c61626c6560401b6044820152606401610c52565b5f6129a36115f7565b600b546129b091906138d0565b90505f600e54846129c191906138d0565b5f818152600c60205260408120549192509081036129e05750806129f0565b505f818152600c60205260409020545b5f6129fc6001856138d0565b905082811015612a1657505f828152600d60205260409020545b5f818152600c60205260408120549003612a4f575f838152600c60209081526040808320849055838352600d9091529020839055612a69565b612a5a6001856138d0565b5f848152600c60205260409020555b612a71612dca565b50859450505050505b919050565b8080612a9357506001600160a01b03821615155b15612b54575f612aa2846120d3565b90506001600160a01b03831615801590612ace5750826001600160a01b0316816001600160a01b031614155b8015612ae15750612adf8184611997565b155b15612b0a5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610c52565b8115612b525783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b612b8e838383612ed2565b610e8b576001600160a01b038316612bbc57604051637e27328960e01b815260048101829052602401610c52565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610c52565b5f82612bf38584612f36565b14949350505050565b6040516331a9108f60e11b8152600481018290525f9081907334c4eba1966b502dfcf0868b6f271d85cc8a231290636352211e90602401602060405180830381865afa158015612c4e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c7291906139a8565b9050336001600160a01b03821603612c8d5750600192915050565b72a103267a22971375c3c37d6e1f1bdfb548e945196001600160a01b03821601612d43576040516307ca74b760e21b81527334c4eba1966b502dfcf0868b6f271d85cc8a231260048201526024810184905272a103267a22971375c3c37d6e1f1bdfb548e94690631f29d2dc90604401602060405180830381865afa158015612d18573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612d3c91906139a8565b9050612dba565b7334e391fdae0965e4b0f85ea702572a13f6b5eba1196001600160a01b03821601612dba576040516307ca74b760e21b81527334c4eba1966b502dfcf0868b6f271d85cc8a23126004820152602481018490527334e391fdae0965e4b0f85ea702572a13f6b5eba290631f29d2dc90604401612680565b6001600160a01b038116336126cd565b5f80612dd5600a5490565b9050612a7a600a80546001019055565b612def8383612f78565b610e8b5f84848461278a565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612e395772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612e65576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612e8357662386f26fc10000830492506010015b6305f5e1008310612e9b576305f5e100830492506008015b6127108310612eaf57612710830492506004015b60648310612ec1576064830492506002015b600a8310610b335760010192915050565b5f6001600160a01b03831615801590612f2e5750826001600160a01b0316846001600160a01b03161480612f0b5750612f0b8484611997565b80612f2e57505f828152600460205260409020546001600160a01b038481169116145b949350505050565b5f81815b8451811015612f7057612f6682868381518110612f5957612f59613981565b6020026020010151612fd9565b9150600101612f3a565b509392505050565b6001600160a01b038216612fa157604051633250574960e11b81525f6004820152602401610c52565b5f612fad83835f612172565b90506001600160a01b03811615610e8b576040516339e3563760e11b81525f6004820152602401610c52565b5f818310612ff3575f828152602084905260409020611958565b505f9182526020526040902090565b6001600160e01b031981168114611d90575f80fd5b5f60208284031215613027575f80fd5b813561195881613002565b5f5b8381101561304c578181015183820152602001613034565b50505f910152565b5f815180845261306b816020860160208601613032565b601f01601f19169290920160200192915050565b602081525f6119586020830184613054565b5f602082840312156130a1575f80fd5b5035919050565b6001600160a01b0381168114611d90575f80fd5b5f80604083850312156130cd575f80fd5b82356130d8816130a8565b946020939093013593505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613123576131236130e6565b604052919050565b5f67ffffffffffffffff831115613144576131446130e6565b613157601f8401601f19166020016130fa565b905082815283838301111561316a575f80fd5b828260208301375f602084830101529392505050565b5f60208284031215613190575f80fd5b813567ffffffffffffffff8111156131a6575f80fd5b8201601f810184136131b6575f80fd5b612f2e8482356020840161312b565b80358015158114612a7a575f80fd5b5f602082840312156131e4575f80fd5b611958826131c5565b5f805f606084860312156131ff575f80fd5b833561320a816130a8565b9250602084013561321a816130a8565b929592945050506040919091013590565b5f6020828403121561323b575f80fd5b8135611958816130a8565b5f8060408385031215613257575f80fd5b50508035926020909101359150565b5f82601f830112613275575f80fd5b8135602067ffffffffffffffff821115613291576132916130e6565b8160051b6132a08282016130fa565b92835284810182019282810190878511156132b9575f80fd5b83870192505b848310156132d8578235825291830191908301906132bf565b979650505050505050565b5f8083601f8401126132f3575f80fd5b50813567ffffffffffffffff81111561330a575f80fd5b6020830191508360208260051b8501011115610d28575f80fd5b5f805f60408486031215613336575f80fd5b833567ffffffffffffffff8082111561334d575f80fd5b61335987838801613266565b9450602086013591508082111561336e575f80fd5b5061337b868287016132e3565b9497909650939450505050565b5f8060408385031215613399575f80fd5b8235915060208301356133ab816130a8565b809150509250929050565b5f80604083850312156133c7575f80fd5b82356133d2816130a8565b91506133e0602084016131c5565b90509250929050565b5f805f606084860312156133fb575f80fd5b505081359360208301359350604090920135919050565b5f805f8060808587031215613425575f80fd5b8435613430816130a8565b93506020850135613440816130a8565b925060408501359150606085013567ffffffffffffffff811115613462575f80fd5b8501601f81018713613472575f80fd5b6134818782356020840161312b565b91505092959194509250565b5f806040838503121561349e575f80fd5b82356134a9816130a8565b915060208301356133ab816130a8565b5f805f606084860312156134cb575f80fd5b83359250602084013561321a816130a8565b5f80604083850312156134ee575f80fd5b823567ffffffffffffffff811115613504575f80fd5b61351085828601613266565b92505060208301356133ab816130a8565b5f805f8060608587031215613534575f80fd5b843567ffffffffffffffff8082111561354b575f80fd5b61355788838901613266565b9550602087013591508082111561356c575f80fd5b50613579878288016132e3565b9598909750949560400135949350505050565b600181811c908216806135a057607f821691505b6020821081036135be57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115610e8b57805f5260205f20601f840160051c810160208510156135e95750805b601f840160051c820191505b81811015610fbc575f81556001016135f5565b815167ffffffffffffffff811115613622576136226130e6565b61363681613630845461358c565b846135c4565b602080601f831160018114613669575f84156136525750858301515b5f19600386901b1c1916600185901b1785556136c0565b5f85815260208120601f198616915b8281101561369757888601518255948401946001909101908401613678565b50858210156136b457878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610b3357610b336136c8565b634e487b7160e01b5f52601260045260245ffd5b5f82613715576137156136f3565b500490565b60208082526022908201527f54686520416261737361646f72206d696e74206973206e6f7420656e61626c65604082015261642160f01b606082015260800190565b80820180821115610b3357610b336136c8565b602080825260149082015273496e76616c6964206d696e7420616d6f756e742160601b604082015260600190565b6020808252601490820152734d617820737570706c792065786365656465642160601b604082015260600190565b602080825260139082015272496e73756666696369656e742066756e64732160681b604082015260600190565b60208082526017908201527f54686520636f6e74726163742069732070617573656421000000000000000000604082015260600190565b5f6020828403121561383f575f80fd5b5051919050565b60208082526027908201527f4164647265737320646f6573206e6f7420686f6c6420616e7920706172746e6560408201526672204e4654732160c81b606082015260800190565b60208082526023908201527f596f7520617265206e6f7420746865206f776e6572206f66207468697320706160408201526273732160e81b606082015260800190565b81810381811115610b3357610b336136c8565b5f845160206138f6828560208a01613032565b85519184019161390a818460208a01613032565b85549201915f9061391a8161358c565b60018281168015613932576001811461394757613971565b60ff1984168752821515830287019450613971565b895f5260205f205f5b8481101561396957815489820152908301908701613950565b505082870194505b50929a9950505050505050505050565b634e487b7160e01b5f52603260045260245ffd5b5f826139a3576139a36136f3565b500690565b5f602082840312156139b8575f80fd5b8151611958816130a8565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906139f590830184613054565b9695505050505050565b5f60208284031215613a0f575f80fd5b81516119588161300256fea26469706673582212206e4f0193d03ad76f1253535d30a447fafe0f211bf3016c7267b388fea44cb4ea64736f6c6343000818003368747470733a2f2f73746f726167652e6d6f6f6e6170656c61622e696f2f7374617469632f6d6f6f6e6170657333642f6d657461646174612f68747470733a2f2f73746f726167652e6d6f6f6e6170656c61622e696f2f7374617469632f6d6f6f6e6170657333642f6d657461646174612f68696464656e2e6a736f6e
Deployed Bytecode
0x6080604052600436106103b3575f3560e01c80638418d7a3116101e9578063b7dec1b711610108578063e14ca3531161009d578063f1a30ca31161006d578063f1a30ca314610ab6578063f2fde38b14610ac9578063f6b89c0514610ae8578063fa84e75414610b07575f80fd5b8063e14ca35314610a4f578063e985e9c514610a63578063efbd73f414610a82578063f053dc5c14610aa1575f80fd5b8063c52766c6116100d8578063c52766c6146109d2578063c87b56dd146109e6578063d527624b14610a05578063e0a8085314610a30575f80fd5b8063b7dec1b714610949578063b88d4fde14610970578063bc951b911461098f578063c441d692146109a4575f80fd5b80639f181b5e1161017e578063a8b8bdb21161014e578063a8b8bdb2146108b6578063b06ab712146108e4578063b071401b1461090b578063b115c74f1461092a575f80fd5b80639f181b5e1461085c578063a0712d6814610870578063a22cb46514610883578063a45ba8e7146108a2575f80fd5b806391c39a5b116101b957806391c39a5b146107f957806394354fd01461080c57806395d89b411461082157806397022d2c14610835575f80fd5b80638418d7a3146107695780638da5cb5b1461078f5780638dd59bda146107ac5780638f96a7cb146107da575f80fd5b8063437f1f3f116102d55780636d9814a61161026a578063766b7d091161023a578063766b7d09146106f957806376c3537b146107185780637cb647591461072b5780637ec4a6591461074a575f80fd5b80636d9814a61461069457806370a08231146106a7578063715018a6146106c65780637190f205146106da575f80fd5b80635503a0e8116102a55780635503a0e8146106345780635c975abb1461064857806362b99ad4146106615780636352211e14610675575f80fd5b8063437f1f3f146105c557806344a0d68a146105d85780634fdd43cb146105f75780635183022714610616575f80fd5b806318160ddd1161034b5780632eb4a7ab1161031b5780632eb4a7ab1461056a578063364993b21461057f5780633ccfd60b1461059257806342842e0e146105a6575f80fd5b806318160ddd146104da57806323b872dd146104ee578063267864491461050d5780632a55205a1461052c575f80fd5b806313faede61161038657806313faede61461046457806316ba10e01461048757806316c38b3c146104a657806317881cbf146104c5575f80fd5b806301ffc9a7146103b757806306fdde03146103eb578063081812fc1461040c578063095ea7b314610443575b5f80fd5b3480156103c2575f80fd5b506103d66103d1366004613017565b610b1a565b60405190151581526020015b60405180910390f35b3480156103f6575f80fd5b506103ff610b39565b6040516103e2919061307f565b348015610417575f80fd5b5061042b610426366004613091565b610bc8565b6040516001600160a01b0390911681526020016103e2565b34801561044e575f80fd5b5061046261045d3660046130bc565b610bef565b005b34801561046f575f80fd5b5061047960185481565b6040519081526020016103e2565b348015610492575f80fd5b506104626104a1366004613180565b610bfe565b3480156104b1575f80fd5b506104626104c03660046131d4565b610c12565b3480156104d0575f80fd5b50610479601c5481565b3480156104e5575f80fd5b50600b54610479565b3480156104f9575f80fd5b506104626105083660046131ed565b610c2d565b348015610518575f80fd5b5061046261052736600461322b565b610cbb565b348015610537575f80fd5b5061054b610546366004613246565b610ce3565b604080516001600160a01b0390931683526020830191909152016103e2565b348015610575575f80fd5b5061047960115481565b61046261058d366004613324565b610d2f565b34801561059d575f80fd5b50610462610de8565b3480156105b1575f80fd5b506104626105c03660046131ed565b610e71565b6104626105d3366004613324565b610e90565b3480156105e3575f80fd5b506104626105f2366004613091565b610fc3565b348015610602575f80fd5b50610462610611366004613180565b610fd0565b348015610621575f80fd5b50601b546103d690610100900460ff1681565b34801561063f575f80fd5b506103ff610fe4565b348015610653575f80fd5b50601b546103d69060ff1681565b34801561066c575f80fd5b506103ff611070565b348015610680575f80fd5b5061042b61068f366004613091565b61107d565b6104626106a2366004613388565b611087565b3480156106b2575f80fd5b506104796106c136600461322b565b611288565b3480156106d1575f80fd5b506104626112cd565b3480156106e5575f80fd5b506104626106f436600461322b565b6112de565b348015610704575f80fd5b50610462610713366004613091565b611309565b610462610726366004613324565b611316565b348015610736575f80fd5b50610462610745366004613091565b6113c0565b348015610755575f80fd5b50610462610764366004613180565b6113cd565b348015610774575f80fd5b5061042b72a103267a22971375c3c37d6e1f1bdfb548e94681565b34801561079a575f80fd5b506006546001600160a01b031661042b565b3480156107b7575f80fd5b506103d66107c636600461322b565b600f6020525f908152604090205460ff1681565b3480156107e5575f80fd5b506103d66107f4366004613091565b6113e1565b610462610807366004613246565b61140c565b348015610817575f80fd5b5061047960195481565b34801561082c575f80fd5b506103ff6115e8565b348015610840575f80fd5b5061042b73bbccbd7bd5601232334cd64846e0cc64dfe37b4e81565b348015610867575f80fd5b506104796115f7565b61046261087e366004613091565b611606565b34801561088e575f80fd5b5061046261089d3660046133b6565b611789565b3480156108ad575f80fd5b506103ff611794565b3480156108c1575f80fd5b506103d66108d036600461322b565b60126020525f908152604090205460ff1681565b3480156108ef575f80fd5b5061042b7334e391fdae0965e4b0f85ea702572a13f6b5eba281565b348015610916575f80fd5b50610462610925366004613091565b6117a1565b348015610935575f80fd5b506104626109443660046133e9565b6117ae565b348015610954575f80fd5b5061042b7334c4eba1966b502dfcf0868b6f271d85cc8a231281565b34801561097b575f80fd5b5061046261098a366004613412565b6117cb565b34801561099a575f80fd5b50610479601a5481565b3480156109af575f80fd5b506103d66109be366004613091565b60146020525f908152604090205460ff1681565b3480156109dd575f80fd5b50601c54610479565b3480156109f1575f80fd5b506103ff610a00366004613091565b6117e2565b348015610a10575f80fd5b50610479610a1f36600461322b565b60136020525f908152604090205481565b348015610a3b575f80fd5b50610462610a4a3660046131d4565b61195f565b348015610a5a575f80fd5b50610479611981565b348015610a6e575f80fd5b506103d6610a7d36600461348d565b611997565b348015610a8d575f80fd5b50610462610a9c366004613388565b6119c4565b348015610aac575f80fd5b5061047960105481565b610462610ac43660046134b9565b611a4c565b348015610ad4575f80fd5b50610462610ae336600461322b565b611d1a565b348015610af3575f80fd5b50610462610b023660046134dd565b611d93565b610462610b15366004613521565b611e76565b5f610b2482612060565b80610b335750610b33826120af565b92915050565b60605f8054610b479061358c565b80601f0160208091040260200160405190810160405280929190818152602001828054610b739061358c565b8015610bbe5780601f10610b9557610100808354040283529160200191610bbe565b820191905f5260205f20905b815481529060010190602001808311610ba157829003601f168201915b5050505050905090565b5f610bd2826120d3565b505f828152600460205260409020546001600160a01b0316610b33565b610bfa82823361210b565b5050565b610c06612118565b6016610bfa8282613608565b610c1a612118565b601b805460ff1916911515919091179055565b6001600160a01b038216610c5b57604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c67838333612172565b9050836001600160a01b0316816001600160a01b031614610cb5576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610c52565b50505050565b610cc3612118565b6001600160a01b03165f908152600f60205260409020805460ff19169055565b5f80806127106bffffffffffffffffffffffff1660105485610d0591906136dc565b610d0f9190613707565b9050610d236006546001600160a01b031690565b925090505b9250929050565b601c54600414610d515760405162461bcd60e51b8152600401610c529061371a565b601a548351335f90815260136020526040902054610d6f919061375c565b1115610dae5760405162461bcd60e51b815260206004820152600e60248201526d4c696d697420726561636865642160901b6044820152606401610c52565b610db9838383612264565b8251335f90815260136020526040902054610dd4919061375c565b335f90815260136020526040902055505050565b610df0612118565b610df86123fd565b5f610e0b6006546001600160a01b031690565b6001600160a01b0316476040515f6040518083038185875af1925050503d805f8114610e52576040519150601f19603f3d011682016040523d82523d5f602084013e610e57565b606091505b5050905080610e64575f80fd5b50610e6f6001600755565b565b610e8b83838360405180602001604052805f8152506117cb565b505050565b82515f81118015610ea357506019548111155b610ebf5760405162461bcd60e51b8152600401610c529061376f565b600b5481610ecb6115f7565b610ed5919061375c565b1115610ef35760405162461bcd60e51b8152600401610c529061379d565b835180601854610f0391906136dc565b341015610f225760405162461bcd60e51b8152600401610c52906137cb565b601b5460ff1615610f455760405162461bcd60e51b8152600401610c52906137f8565b601c5460011480610f585750601c546002145b80610f655750601c546005145b610fb15760405162461bcd60e51b815260206004820152601d60248201527f536e617073686f74206d696e74206973206e6f7420656e61626c6564210000006044820152606401610c52565b610fbc858585612264565b5050505050565b610fcb612118565b601855565b610fd8612118565b6017610bfa8282613608565b60168054610ff19061358c565b80601f016020809104026020016040519081016040528092919081815260200182805461101d9061358c565b80156110685780601f1061103f57610100808354040283529160200191611068565b820191905f5260205f20905b81548152906001019060200180831161104b57829003601f168201915b505050505081565b60158054610ff19061358c565b5f610b33826120d3565b815f8111801561109957506019548111155b6110b55760405162461bcd60e51b8152600401610c529061376f565b600b54816110c16115f7565b6110cb919061375c565b11156110e95760405162461bcd60e51b8152600401610c529061379d565b82806018546110f891906136dc565b3410156111175760405162461bcd60e51b8152600401610c52906137cb565b601c546006146111695760405162461bcd60e51b815260206004820181905260248201527f54686520706172746e6572206d696e74206973206e6f7420656e61626c6564216044820152606401610c52565b6001600160a01b0383165f908152600f602052604090205460ff166111d05760405162461bcd60e51b815260206004820152601b60248201527f436f6c6c656374696f6e206e6f742077686974656c69737465642100000000006044820152606401610c52565b5f6001600160a01b0384166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611223573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611247919061382f565b116112645760405162461bcd60e51b8152600401610c5290613846565b5f5b84811015610fbc57611280335b61127b612456565b6125de565b600101611266565b5f6001600160a01b0382166112b2576040516322718ad960e21b81525f6004820152602401610c52565b506001600160a01b03165f9081526003602052604090205490565b6112d5612118565b610e6f5f6125f7565b6112e6612118565b6001600160a01b03165f908152600f60205260409020805460ff19166001179055565b611311612118565b601a55565b601c546003146113385760405162461bcd60e51b8152600401610c529061371a565b335f9081526012602052604090205460ff16156113975760405162461bcd60e51b815260206004820152601860248201527f4164647265737320616c726561647920636c61696d65642100000000000000006044820152606401610c52565b6113a2838383612264565b5050335f908152601260205260409020805460ff1916600117905550565b6113c8612118565b601155565b6113d5612118565b6015610bfa8282613608565b5f818152600260205260408120546001600160a01b03161561140557506001919050565b505f919050565b815f8111801561141e57506019548111155b61143a5760405162461bcd60e51b8152600401610c529061376f565b600b54816114466115f7565b611450919061375c565b111561146e5760405162461bcd60e51b8152600401610c529061379d565b828261147981612648565b6114955760405162461bcd60e51b8152600401610c529061388d565b60405163e876b6f560e01b8152600481018290525f9073bbccbd7bd5601232334cd64846e0cc64dfe37b4e9063e876b6f590602401602060405180830381865afa1580156114e5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611509919061382f565b5f818152601d602052604090205490915083606461152783826138d0565b60185461153491906136dc565b61153e9190613707565b61154891906136dc565b3410156115675760405162461bcd60e51b8152600401610c52906137cb565b601b5460ff161561158a5760405162461bcd60e51b8152600401610c52906137f8565b601c546007146115d65760405162461bcd60e51b8152602060048201526017602482015276141d589b1a58c81b5a5b9d081b9bdd081cdd185c9d1959604a1b6044820152606401610c52565b6115df33611273565b50505050505050565b606060018054610b479061358c565b5f611601600a5490565b905090565b805f8111801561161857506019548111155b6116345760405162461bcd60e51b8152600401610c529061376f565b600b54816116406115f7565b61164a919061375c565b11156116685760405162461bcd60e51b8152600401610c529061379d565b818060185461167791906136dc565b3410156116965760405162461bcd60e51b8152600401610c52906137cb565b82806116a0611981565b10156116ff5760405162461bcd60e51b815260206004820152602860248201527f526571756573746564206e756d626572206f6620746f6b656e73206e6f7420616044820152677661696c61626c6560c01b6064820152608401610c52565b601b5460ff16156117225760405162461bcd60e51b8152600401610c52906137f8565b601c5460071461176e5760405162461bcd60e51b8152602060048201526017602482015276141d589b1a58c81b5a5b9d081b9bdd081cdd185c9d1959604a1b6044820152606401610c52565b5f5b84811015610fbc5761178133611273565b600101611770565b610bfa3383836126ec565b60178054610ff19061358c565b6117a9612118565b601955565b6117b6612118565b601c8390556117c482610fc3565b6011555050565b6117d6848484610c2d565b610cb58484848461278a565b5f818152600260205260409020546060906001600160a01b03166118485760405162461bcd60e51b815260206004820152601f60248201527f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e006044820152606401610c52565b5f8281526014602052604090205460ff1615801561186e5750601b54610100900460ff16155b1561190357601780546118809061358c565b80601f01602080910402602001604051908101604052809291908181526020018280546118ac9061358c565b80156118f75780601f106118ce576101008083540402835291602001916118f7565b820191905f5260205f20905b8154815290600101906020018083116118da57829003601f168201915b50505050509050919050565b5f61190c6128a9565b90505f81511161192a5760405180602001604052805f815250611958565b80611934846128b8565b6016604051602001611948939291906138e3565b6040516020818303038152906040525b9392505050565b611967612118565b601b80549115156101000261ff0019909216919091179055565b5f61198a6115f7565b600b5461160191906138d0565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b815f811180156119d657506019548111155b6119f25760405162461bcd60e51b8152600401610c529061376f565b600b54816119fe6115f7565b611a08919061375c565b1115611a265760405162461bcd60e51b8152600401610c529061379d565b611a2e612118565b5f5b83811015610cb557611a448361127b612456565b600101611a30565b825f81118015611a5e57506019548111155b611a7a5760405162461bcd60e51b8152600401610c529061376f565b600b5481611a866115f7565b611a90919061375c565b1115611aae5760405162461bcd60e51b8152600401610c529061379d565b8382611ab981612648565b611ad55760405162461bcd60e51b8152600401610c529061388d565b60405163e876b6f560e01b8152600481018290525f9073bbccbd7bd5601232334cd64846e0cc64dfe37b4e9063e876b6f590602401602060405180830381865afa158015611b25573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b49919061382f565b5f818152601d6020526040902054909150836064611b6783826138d0565b601854611b7491906136dc565b611b7e9190613707565b611b8891906136dc565b341015611ba75760405162461bcd60e51b8152600401610c52906137cb565b601c54600614611bf95760405162461bcd60e51b815260206004820181905260248201527f54686520706172746e6572206d696e74206973206e6f7420656e61626c6564216044820152606401610c52565b6001600160a01b0387165f908152600f602052604090205460ff16611c605760405162461bcd60e51b815260206004820152601b60248201527f436f6c6c656374696f6e206e6f742077686974656c69737465642100000000006044820152606401610c52565b5f6001600160a01b0388166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611cb3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611cd7919061382f565b11611cf45760405162461bcd60e51b8152600401610c5290613846565b5f5b88811015611d0f57611d0733611273565b600101611cf6565b505050505050505050565b611d22612118565b6001600160a01b038116611d875760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c52565b611d90816125f7565b50565b81515f81118015611da657506019548111155b611dc25760405162461bcd60e51b8152600401610c529061376f565b600b5481611dce6115f7565b611dd8919061375c565b1115611df65760405162461bcd60e51b8152600401610c529061379d565b611dfe612118565b5f5b8351811015610cb557611e2f8361127b868481518110611e2257611e22613981565b6020026020010151612948565b600160145f868481518110611e4657611e46613981565b60209081029190910181015182528101919091526040015f20805460ff1916911515919091179055600101611e00565b83515f81118015611e8957506019548111155b611ea55760405162461bcd60e51b8152600401610c529061376f565b600b5481611eb16115f7565b611ebb919061375c565b1115611ed95760405162461bcd60e51b8152600401610c529061379d565b845182611ee581612648565b611f015760405162461bcd60e51b8152600401610c529061388d565b60405163e876b6f560e01b8152600481018290525f9073bbccbd7bd5601232334cd64846e0cc64dfe37b4e9063e876b6f590602401602060405180830381865afa158015611f51573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f75919061382f565b5f818152601d6020526040902054909150836064611f9383826138d0565b601854611fa091906136dc565b611faa9190613707565b611fb491906136dc565b341015611fd35760405162461bcd60e51b8152600401610c52906137cb565b601b5460ff1615611ff65760405162461bcd60e51b8152600401610c52906137f8565b601c54600114806120095750601c546002145b6120555760405162461bcd60e51b815260206004820152601d60248201527f536e617073686f74206d696e74206973206e6f7420656e61626c6564210000006044820152606401610c52565b611d0f898989612264565b5f6001600160e01b031982166380ac58cd60e01b148061209057506001600160e01b03198216635b5e139f60e01b145b80610b3357506301ffc9a760e01b6001600160e01b0319831614610b33565b5f6001600160e01b0319821663152a902d60e11b1480610b335750610b3382612060565b5f818152600260205260408120546001600160a01b031680610b3357604051637e27328960e01b815260048101849052602401610c52565b610e8b8383836001612a7f565b6006546001600160a01b03163314610e6f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c52565b5f828152600260205260408120546001600160a01b039081169083161561219e5761219e818486612b83565b6001600160a01b038116156121d8576121b95f855f80612a7f565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b03851615612206576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6040516bffffffffffffffffffffffff193360601b1660208201525f906034016040516020818303038152906040528051906020012090506122dc8383808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506011549150849050612be7565b6123195760405162461bcd60e51b815260206004820152600e60248201526d496e76616c69642070726f6f662160901b6044820152606401610c52565b5f5b8451811015610fbc5761234685828151811061233957612339613981565b6020026020010151612bfc565b61239d5760405162461bcd60e51b815260206004820152602260248201527f596f7520617265206e6f7420746865206f776e6572206f662074686973204e46604482015261542160f01b6064820152608401610c52565b6123b63361127b878481518110611e2257611e22613981565b600160145f8784815181106123cd576123cd613981565b60209081029190910181015182528101919091526040015f20805460ff191691151591909117905560010161231b565b60026007540361244f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c52565b6002600755565b5f80612460611981565b116124a85760405162461bcd60e51b81526020600482015260186024820152774e6f206d6f726520746f6b656e7320617661696c61626c6560401b6044820152606401610c52565b5f6124b16115f7565b600b546124be91906138d0565b6040516bffffffffffffffffffffffff1933606090811b8216602084015241901b1660348201524460488201524560688201524260888201529091505f90829060a801604051602081830303815290604052805190602001205f1c6125239190613995565b5f818152600c6020526040812054919250908103612542575080612552565b505f818152600c60205260409020545b600c5f6125606001866138d0565b81526020019081526020015f20545f036125925761257f6001846138d0565b5f838152600c60205260409020556125c0565b600c5f6125a06001866138d0565b815260208082019290925260409081015f90812054858252600c90935220555b6125c8612dca565b50600e546125d6908261375c565b935050505090565b610bfa828260405180602001604052805f815250612de5565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6040516331a9108f60e11b8152600481018290525f90819073bbccbd7bd5601232334cd64846e0cc64dfe37b4e90636352211e906024015b602060405180830381865afa15801561269b573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126bf91906139a8565b90506001600160a01b038116335b6001600160a01b0316036126e45750600192915050565b505f92915050565b6001600160a01b03821661271e57604051630b61174360e31b81526001600160a01b0383166004820152602401610c52565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610cb557604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906127cc9033908890879087906004016139c3565b6020604051808303815f875af1925050508015612806575060408051601f3d908101601f19168201909252612803918101906139ff565b60015b61286d573d808015612833576040519150601f19603f3d011682016040523d82523d5f602084013e612838565b606091505b5080515f0361286557604051633250574960e11b81526001600160a01b0385166004820152602401610c52565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14610fbc57604051633250574960e11b81526001600160a01b0385166004820152602401610c52565b606060158054610b479061358c565b60605f6128c483612dfb565b60010190505f8167ffffffffffffffff8111156128e3576128e36130e6565b6040519080825280601f01601f19166020018201604052801561290d576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461291757509392505050565b5f80612952611981565b1161299a5760405162461bcd60e51b81526020600482015260186024820152774e6f206d6f726520746f6b656e7320617661696c61626c6560401b6044820152606401610c52565b5f6129a36115f7565b600b546129b091906138d0565b90505f600e54846129c191906138d0565b5f818152600c60205260408120549192509081036129e05750806129f0565b505f818152600c60205260409020545b5f6129fc6001856138d0565b905082811015612a1657505f828152600d60205260409020545b5f818152600c60205260408120549003612a4f575f838152600c60209081526040808320849055838352600d9091529020839055612a69565b612a5a6001856138d0565b5f848152600c60205260409020555b612a71612dca565b50859450505050505b919050565b8080612a9357506001600160a01b03821615155b15612b54575f612aa2846120d3565b90506001600160a01b03831615801590612ace5750826001600160a01b0316816001600160a01b031614155b8015612ae15750612adf8184611997565b155b15612b0a5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610c52565b8115612b525783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b612b8e838383612ed2565b610e8b576001600160a01b038316612bbc57604051637e27328960e01b815260048101829052602401610c52565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610c52565b5f82612bf38584612f36565b14949350505050565b6040516331a9108f60e11b8152600481018290525f9081907334c4eba1966b502dfcf0868b6f271d85cc8a231290636352211e90602401602060405180830381865afa158015612c4e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c7291906139a8565b9050336001600160a01b03821603612c8d5750600192915050565b72a103267a22971375c3c37d6e1f1bdfb548e945196001600160a01b03821601612d43576040516307ca74b760e21b81527334c4eba1966b502dfcf0868b6f271d85cc8a231260048201526024810184905272a103267a22971375c3c37d6e1f1bdfb548e94690631f29d2dc90604401602060405180830381865afa158015612d18573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612d3c91906139a8565b9050612dba565b7334e391fdae0965e4b0f85ea702572a13f6b5eba1196001600160a01b03821601612dba576040516307ca74b760e21b81527334c4eba1966b502dfcf0868b6f271d85cc8a23126004820152602481018490527334e391fdae0965e4b0f85ea702572a13f6b5eba290631f29d2dc90604401612680565b6001600160a01b038116336126cd565b5f80612dd5600a5490565b9050612a7a600a80546001019055565b612def8383612f78565b610e8b5f84848461278a565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612e395772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612e65576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612e8357662386f26fc10000830492506010015b6305f5e1008310612e9b576305f5e100830492506008015b6127108310612eaf57612710830492506004015b60648310612ec1576064830492506002015b600a8310610b335760010192915050565b5f6001600160a01b03831615801590612f2e5750826001600160a01b0316846001600160a01b03161480612f0b5750612f0b8484611997565b80612f2e57505f828152600460205260409020546001600160a01b038481169116145b949350505050565b5f81815b8451811015612f7057612f6682868381518110612f5957612f59613981565b6020026020010151612fd9565b9150600101612f3a565b509392505050565b6001600160a01b038216612fa157604051633250574960e11b81525f6004820152602401610c52565b5f612fad83835f612172565b90506001600160a01b03811615610e8b576040516339e3563760e11b81525f6004820152602401610c52565b5f818310612ff3575f828152602084905260409020611958565b505f9182526020526040902090565b6001600160e01b031981168114611d90575f80fd5b5f60208284031215613027575f80fd5b813561195881613002565b5f5b8381101561304c578181015183820152602001613034565b50505f910152565b5f815180845261306b816020860160208601613032565b601f01601f19169290920160200192915050565b602081525f6119586020830184613054565b5f602082840312156130a1575f80fd5b5035919050565b6001600160a01b0381168114611d90575f80fd5b5f80604083850312156130cd575f80fd5b82356130d8816130a8565b946020939093013593505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613123576131236130e6565b604052919050565b5f67ffffffffffffffff831115613144576131446130e6565b613157601f8401601f19166020016130fa565b905082815283838301111561316a575f80fd5b828260208301375f602084830101529392505050565b5f60208284031215613190575f80fd5b813567ffffffffffffffff8111156131a6575f80fd5b8201601f810184136131b6575f80fd5b612f2e8482356020840161312b565b80358015158114612a7a575f80fd5b5f602082840312156131e4575f80fd5b611958826131c5565b5f805f606084860312156131ff575f80fd5b833561320a816130a8565b9250602084013561321a816130a8565b929592945050506040919091013590565b5f6020828403121561323b575f80fd5b8135611958816130a8565b5f8060408385031215613257575f80fd5b50508035926020909101359150565b5f82601f830112613275575f80fd5b8135602067ffffffffffffffff821115613291576132916130e6565b8160051b6132a08282016130fa565b92835284810182019282810190878511156132b9575f80fd5b83870192505b848310156132d8578235825291830191908301906132bf565b979650505050505050565b5f8083601f8401126132f3575f80fd5b50813567ffffffffffffffff81111561330a575f80fd5b6020830191508360208260051b8501011115610d28575f80fd5b5f805f60408486031215613336575f80fd5b833567ffffffffffffffff8082111561334d575f80fd5b61335987838801613266565b9450602086013591508082111561336e575f80fd5b5061337b868287016132e3565b9497909650939450505050565b5f8060408385031215613399575f80fd5b8235915060208301356133ab816130a8565b809150509250929050565b5f80604083850312156133c7575f80fd5b82356133d2816130a8565b91506133e0602084016131c5565b90509250929050565b5f805f606084860312156133fb575f80fd5b505081359360208301359350604090920135919050565b5f805f8060808587031215613425575f80fd5b8435613430816130a8565b93506020850135613440816130a8565b925060408501359150606085013567ffffffffffffffff811115613462575f80fd5b8501601f81018713613472575f80fd5b6134818782356020840161312b565b91505092959194509250565b5f806040838503121561349e575f80fd5b82356134a9816130a8565b915060208301356133ab816130a8565b5f805f606084860312156134cb575f80fd5b83359250602084013561321a816130a8565b5f80604083850312156134ee575f80fd5b823567ffffffffffffffff811115613504575f80fd5b61351085828601613266565b92505060208301356133ab816130a8565b5f805f8060608587031215613534575f80fd5b843567ffffffffffffffff8082111561354b575f80fd5b61355788838901613266565b9550602087013591508082111561356c575f80fd5b50613579878288016132e3565b9598909750949560400135949350505050565b600181811c908216806135a057607f821691505b6020821081036135be57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115610e8b57805f5260205f20601f840160051c810160208510156135e95750805b601f840160051c820191505b81811015610fbc575f81556001016135f5565b815167ffffffffffffffff811115613622576136226130e6565b61363681613630845461358c565b846135c4565b602080601f831160018114613669575f84156136525750858301515b5f19600386901b1c1916600185901b1785556136c0565b5f85815260208120601f198616915b8281101561369757888601518255948401946001909101908401613678565b50858210156136b457878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610b3357610b336136c8565b634e487b7160e01b5f52601260045260245ffd5b5f82613715576137156136f3565b500490565b60208082526022908201527f54686520416261737361646f72206d696e74206973206e6f7420656e61626c65604082015261642160f01b606082015260800190565b80820180821115610b3357610b336136c8565b602080825260149082015273496e76616c6964206d696e7420616d6f756e742160601b604082015260600190565b6020808252601490820152734d617820737570706c792065786365656465642160601b604082015260600190565b602080825260139082015272496e73756666696369656e742066756e64732160681b604082015260600190565b60208082526017908201527f54686520636f6e74726163742069732070617573656421000000000000000000604082015260600190565b5f6020828403121561383f575f80fd5b5051919050565b60208082526027908201527f4164647265737320646f6573206e6f7420686f6c6420616e7920706172746e6560408201526672204e4654732160c81b606082015260800190565b60208082526023908201527f596f7520617265206e6f7420746865206f776e6572206f66207468697320706160408201526273732160e81b606082015260800190565b81810381811115610b3357610b336136c8565b5f845160206138f6828560208a01613032565b85519184019161390a818460208a01613032565b85549201915f9061391a8161358c565b60018281168015613932576001811461394757613971565b60ff1984168752821515830287019450613971565b895f5260205f205f5b8481101561396957815489820152908301908701613950565b505082870194505b50929a9950505050505050505050565b634e487b7160e01b5f52603260045260245ffd5b5f826139a3576139a36136f3565b500690565b5f602082840312156139b8575f80fd5b8151611958816130a8565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906139f590830184613054565b9695505050505050565b5f60208284031215613a0f575f80fd5b81516119588161300256fea26469706673582212206e4f0193d03ad76f1253535d30a447fafe0f211bf3016c7267b388fea44cb4ea64736f6c63430008180033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.