Overview
TokenID
84
Total Transfers
-
Market
Price
$0.00 @ 0.000000 APE
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 0 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Goobaloo
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@limitbreak/creator-token-contracts/contracts/access/OwnableBasic.sol"; import "@limitbreak/creator-token-contracts/contracts/erc721c/ERC721AC.sol"; import "@limitbreak/creator-token-contracts/contracts/programmable-royalties/ImmutableMinterRoyalties.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/Base64.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; interface IGoobalooData { function getGoobalooSVG( uint256 tokenId ) external view returns (string memory); function getTraits(uint256 tokenId) external view returns (string memory); } contract Goobaloo is OwnableBasic, ERC721AC, ImmutableMinterRoyalties, ReentrancyGuard { using ECDSA for bytes32; using Strings for uint256; // Pack booleans together in a single slot struct TokenData { bool backgroundChanged; bool usesSecondaryColor; bool hasClaimedShare; } mapping(uint256 => TokenData) public tokenData; // Group immutable/constant variables uint256 public constant MAX_SUPPLY = 2222; uint256 public MINT_PRICE; uint256 public MAX_MINTS_PER_WALLET; uint256 public COLOR_CHANGE_PRICE; uint256 public immutable GAME_END_TIME; // Group addresses together address private signer; address private metadataContract; // Group counters together uint256 private defaultCount; uint256 private aquamarineCount; uint256 private orangeCount; uint256 private totalColorChangeFees; mapping(address => uint256) public mintedPerWallet; string private constant DEFAULT_BACKGROUND = "#0054fa"; string private constant AQUAMARINE = "#16E6B6"; string private constant ORANGE = "#EF9729"; error SameColorAlreadySet(); error InvalidColorChoice(); error GameEnded(); error GameNotEnded(); error AlreadyClaimed(); error NoWinningColor(); error MaxSupplyExceeded(); error GameNotEndedOrNotTied(); // Add winning color state struct WinningColorState { uint8 color; // 0 = default, 1 = aquamarine, 2 = orange bool isTie; } WinningColorState public currentWinningColor; // Simplify event to only emit new state event WinningColorChanged(uint8 newWinningColor, bool isTie); // Add mapping to track who has used their free mint mapping(address => bool) public hasUsedFreeMint; // Add state variable for signature requirement bool public signatureRequired = true; // Add event at the top with other events event MetadataUpdate(uint256 _tokenId); bytes32 constant MINT_TYPEHASH = keccak256("Mint(address minter)"); bytes32 constant FREEMINT_TYPEHASH = keccak256("FreeMint(address minter)"); // Add domain separator for EIP-712 bytes32 public immutable DOMAIN_SEPARATOR = keccak256( abi.encode( keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ), keccak256(bytes("Goobaloo")), keccak256(bytes("1")), block.chainid, address(this) ) ); // Add state variable to track if metadata contract is locked bool public isMetadataContractLocked; // Add error for locked metadata error MetadataContractLocked(); constructor( uint256 royaltyFeeNumerator_, string memory name_, string memory symbol_, uint256 mintPrice_, uint256 maxMintsPerWallet_, uint256 colorChangePrice_, address transferValidator_ ) ERC721AC(name_, symbol_) ImmutableMinterRoyalties(royaltyFeeNumerator_) { if (transferValidator_ != address(0)) { setTransferValidator(transferValidator_); } signer = address(msg.sender); GAME_END_TIME = block.timestamp + 1 weeks; defaultCount = MAX_SUPPLY; currentWinningColor = WinningColorState(0, false); MINT_PRICE = mintPrice_; MAX_MINTS_PER_WALLET = maxMintsPerWallet_; COLOR_CHANGE_PRICE = colorChangePrice_; } function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721AC, ImmutableMinterRoyaltiesBase) returns (bool) { return super.supportsInterface(interfaceId); } function mint( address to, uint256 quantity, bytes calldata signature ) external payable nonReentrant { uint256 nextTokenId = _nextTokenId(); require(nextTokenId < MAX_SUPPLY, "Max supply reached"); uint256 remainingSupply = MAX_SUPPLY - nextTokenId; uint256 remainingMints = MAX_MINTS_PER_WALLET - mintedPerWallet[msg.sender]; require(remainingMints > 0, "No mints remaining"); // Adjust quantity based on remaining supply and wallet limit uint256 actualMintQuantity = quantity; if (quantity > remainingMints) { actualMintQuantity = remainingMints; } if (actualMintQuantity > remainingSupply) { actualMintQuantity = remainingSupply; } // Skip signature check if not required if (signatureRequired) { bytes32 structHash = keccak256( abi.encode(MINT_TYPEHASH, msg.sender) ); bytes32 hash = keccak256( abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR, structHash) ); address recoveredSigner = ECDSA.recover(hash, signature); require(recoveredSigner == signer, "Invalid signature"); } uint256 requiredPayment = MINT_PRICE * actualMintQuantity; require(msg.value >= requiredPayment, "Insufficient payment"); // Refund excess payment including adjustment for reduced quantity uint256 refundAmount = msg.value - requiredPayment; if (refundAmount > 0) { (bool success, ) = payable(msg.sender).call{value: refundAmount}( "" ); require(success, "Refund failed"); } mintedPerWallet[msg.sender] += actualMintQuantity; _mint(to, actualMintQuantity); } function _mint(address to, uint256 quantity) internal virtual override { uint256 nextTokenId = _nextTokenId(); for (uint256 i = 0; i < quantity; ) { _onMinted(to, nextTokenId + i); unchecked { ++i; } } super._mint(to, quantity); } function withdraw() external onlyOwner { // Calculate withdrawable amount (total balance minus game fees) uint256 withdrawableAmount = address(this).balance - totalColorChangeFees; require(withdrawableAmount > 0, "No funds to withdraw"); // Transfer withdrawable amount to owner (bool success, ) = payable(msg.sender).call{value: withdrawableAmount}( "" ); require(success, "Transfer failed"); } function setMetadataContract(address _metadataContract) external onlyOwner { if (isMetadataContractLocked) revert MetadataContractLocked(); require(_metadataContract != address(0), "Invalid metadata contract"); metadataContract = _metadataContract; } function getBackgroundColor( uint256 tokenId ) public view returns (string memory) { if (!tokenData[tokenId].backgroundChanged) { return DEFAULT_BACKGROUND; } return tokenData[tokenId].usesSecondaryColor ? ORANGE : AQUAMARINE; } function setBackground( uint256 tokenId, uint8 colorChoice ) external payable { require(_exists(tokenId), "Token does not exist"); require(ownerOf(tokenId) == msg.sender, "Not token owner"); if (block.timestamp >= GAME_END_TIME) revert GameEnded(); if (msg.value != COLOR_CHANGE_PRICE) revert("Incorrect payment amount"); if (colorChoice != 1 && colorChoice != 2) revert InvalidColorChoice(); TokenData storage data = tokenData[tokenId]; bool isSecondaryColor = colorChoice == 2; if ( data.backgroundChanged && data.usesSecondaryColor == isSecondaryColor ) { revert SameColorAlreadySet(); } unchecked { // Update color counts if (!data.backgroundChanged) { --defaultCount; } else { if (data.usesSecondaryColor) { --orangeCount; } else { --aquamarineCount; } } // Update to new color if (isSecondaryColor) { ++orangeCount; } else { ++aquamarineCount; } totalColorChangeFees += msg.value; } data.backgroundChanged = true; data.usesSecondaryColor = isSecondaryColor; // Update winning color state _updateWinningColor(); // Emit metadata update event emit MetadataUpdate(tokenId); } function _updateWinningColor() private { unchecked { uint256 maxCount = defaultCount; uint8 winningColor = 0; bool isTie = false; if (aquamarineCount >= maxCount) { if (aquamarineCount > maxCount) { maxCount = aquamarineCount; winningColor = 1; isTie = false; } else { isTie = true; } } if (orangeCount >= maxCount) { if (orangeCount > maxCount) { winningColor = 2; isTie = false; } else { isTie = true; } } // Only emit event if state changed if ( currentWinningColor.color != winningColor || currentWinningColor.isTie != isTie ) { currentWinningColor = WinningColorState(winningColor, isTie); emit WinningColorChanged(winningColor, isTie); } } } function claimShares(uint256[] calldata tokenIds) external nonReentrant { if (block.timestamp < GAME_END_TIME) revert GameNotEnded(); if (currentWinningColor.isTie) revert NoWinningColor(); uint256 totalShare; uint256 winningCount = currentWinningColor.color == 0 ? defaultCount : (currentWinningColor.color == 1 ? aquamarineCount : orangeCount); uint256 sharePerToken = totalColorChangeFees / winningCount; for (uint256 i = 0; i < tokenIds.length; ) { uint256 tokenId = tokenIds[i]; if (!_exists(tokenId)) revert("Token does not exist"); if (ownerOf(tokenId) != msg.sender) revert("Not token owner"); TokenData storage data = tokenData[tokenId]; if (data.hasClaimedShare) revert AlreadyClaimed(); bool hasWinningColor = currentWinningColor.color == 0 ? !data.backgroundChanged : (data.backgroundChanged && data.usesSecondaryColor == (currentWinningColor.color == 2)); if (!hasWinningColor) revert("Token does not have winning color"); data.hasClaimedShare = true; totalShare += sharePerToken; unchecked { ++i; } } (bool success, ) = payable(msg.sender).call{value: totalShare}(""); require(success, "Transfer failed"); } function claimShare(uint256 tokenId) external nonReentrant { uint256[] memory tokenIds = new uint256[](1); tokenIds[0] = tokenId; this.claimShares(tokenIds); } // Add view function to get game state function getGameState() external view returns ( uint256 endTime, uint256 defaultCount_, uint256 aquaCount, uint256 orangeCount_, uint256 totalFees ) { return ( GAME_END_TIME, defaultCount, aquamarineCount, orangeCount, totalColorChangeFees ); } // Add helper function for random number generation function _random(uint256 seed) private view returns (uint256) { return uint256( keccak256( abi.encodePacked(block.timestamp, block.prevrandao, seed) ) ); } function airdrop( address[] calldata recipients, uint256[] calldata quantities ) external onlyOwner { require( recipients.length == quantities.length, "Recipients and quantities length mismatch" ); // Calculate total quantity and check max supply uint256 totalQuantity; for (uint256 i = 0; i < quantities.length; ) { require(quantities[i] > 0, "Quantity must be greater than 0"); totalQuantity += quantities[i]; unchecked { ++i; } } // Check max supply before proceeding _checkSupply(totalQuantity); // Create array of recipient addresses repeated by their quantities address[] memory expandedRecipients = new address[](totalQuantity); uint256 currentIndex; for (uint256 i = 0; i < recipients.length; ) { for (uint256 j = 0; j < quantities[i]; ) { expandedRecipients[currentIndex] = recipients[i]; unchecked { ++currentIndex; ++j; } } unchecked { ++i; } } // Fisher-Yates shuffle for (uint256 i = expandedRecipients.length - 1; i > 0; ) { uint256 randomIndex = _random(i) % (i + 1); // Swap elements address temp = expandedRecipients[i]; expandedRecipients[i] = expandedRecipients[randomIndex]; expandedRecipients[randomIndex] = temp; unchecked { --i; } } // Mint tokens in shuffled order for (uint256 i = 0; i < expandedRecipients.length; ) { _mint(expandedRecipients[i], 1); unchecked { ++i; } } } // Add separate function for NPC holder free mint function freeMint(bytes calldata signature) external { // Check max supply before proceeding _checkSupply(1); require(!hasUsedFreeMint[msg.sender], "Free mint already used"); // Verify signature bytes32 structHash = keccak256( abi.encode(FREEMINT_TYPEHASH, msg.sender) ); bytes32 hash = keccak256( abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR, structHash) ); address recoveredSigner = ECDSA.recover(hash, signature); require(recoveredSigner == signer, "Invalid signature"); hasUsedFreeMint[msg.sender] = true; _mint(msg.sender, 1); } // Add function to toggle signature requirement (owner only) function setSignatureRequired(bool required) external onlyOwner { signatureRequired = required; } // Add helper function to check supply function _checkSupply(uint256 quantity) private view { if (_nextTokenId() + quantity > MAX_SUPPLY) { revert MaxSupplyExceeded(); } } function tokenURI( uint256 tokenId ) public view override returns (string memory) { require(_exists(tokenId), "Token does not exist"); // Get SVG data and traits from metadata contract string memory svgData = IGoobalooData(metadataContract).getGoobalooSVG( tokenId ); string memory traits = IGoobalooData(metadataContract).getTraits( tokenId ); // Get current background color for this token string memory background = getBackgroundColor(tokenId); // Construct full SVG with background and data string memory fullSVG = string( abi.encodePacked( '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048">', '<rect width="100%" height="100%" fill="', background, '"/>', svgData, "</svg>" ) ); // Construct the JSON metadata string memory json = string( abi.encodePacked( '{"name": "Goobaloo #', tokenId.toString(), '", "image": "data:image/svg+xml;base64,', Base64.encode(bytes(fullSVG)), '", "attributes": ', traits, "}" ) ); // Return base64 encoded JSON return string( abi.encodePacked( "data:application/json;base64,", Base64.encode(bytes(json)) ) ); } // Add function to lock metadata contract function lockMetadataContract() external onlyOwner { require(metadataContract != address(0), "Metadata contract not set"); isMetadataContractLocked = true; } // Add function to withdraw color change fees in case of tie function withdrawColorChangeFees() external onlyOwner { if (block.timestamp < GAME_END_TIME || !currentWinningColor.isTie) revert GameNotEndedOrNotTied(); uint256 fees = totalColorChangeFees; require(fees > 0, "No fees to withdraw"); // Reset fees before transfer to prevent reentrancy totalColorChangeFees = 0; // Transfer fees to owner (bool success, ) = payable(msg.sender).call{value: fees}(""); require(success, "Transfer failed"); } // Add at the top with other functions function contractURI() public pure returns (string memory) { return "https://goobaloo.xyz/goobaloo.json"; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./OwnablePermissions.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; abstract contract OwnableBasic is OwnablePermissions, Ownable { function _requireCallerIsContractOwner() internal view virtual override { _checkOwner(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/Context.sol"; abstract contract OwnablePermissions is Context { function _requireCallerIsContractOwner() internal view virtual; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../utils/CreatorTokenBase.sol"; import "erc721a/contracts/ERC721A.sol"; /** * @title ERC721AC * @author Limit Break, Inc. * @notice Extends Azuki's ERC721-A implementation with Creator Token functionality, which * allows the contract owner to update the transfer validation logic by managing a security policy in * an external transfer validation security policy registry. See {CreatorTokenTransferValidator}. */ abstract contract ERC721AC is ERC721A, CreatorTokenBase { constructor(string memory name_, string memory symbol_) CreatorTokenBase() ERC721A(name_, symbol_) {} function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(ICreatorToken).interfaceId || super.supportsInterface(interfaceId); } /// @dev Ties the erc721a _beforeTokenTransfers hook to more granular transfer validation logic function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override { for (uint256 i = 0; i < quantity;) { _validateBeforeTransfer(from, to, startTokenId + i); unchecked { ++i; } } } /// @dev Ties the erc721a _afterTokenTransfer hook to more granular transfer validation logic function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override { for (uint256 i = 0; i < quantity;) { _validateAfterTransfer(from, to, startTokenId + i); unchecked { ++i; } } } function _msgSenderERC721A() internal view virtual override returns (address) { return _msgSender(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../interfaces/ICreatorTokenTransferValidator.sol"; interface ICreatorToken { event TransferValidatorUpdated(address oldValidator, address newValidator); function getTransferValidator() external view returns (ICreatorTokenTransferValidator); function getSecurityPolicy() external view returns (CollectionSecurityPolicy memory); function getWhitelistedOperators() external view returns (address[] memory); function getPermittedContractReceivers() external view returns (address[] memory); function isOperatorWhitelisted(address operator) external view returns (bool); function isContractReceiverPermitted(address receiver) external view returns (bool); function isTransferAllowed(address caller, address from, address to) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./IEOARegistry.sol"; import "./ITransferSecurityRegistry.sol"; import "./ITransferValidator.sol"; interface ICreatorTokenTransferValidator is ITransferSecurityRegistry, ITransferValidator, IEOARegistry {}
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; interface IEOARegistry is IERC165 { function isVerifiedEOA(address account) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../utils/TransferPolicy.sol"; interface ITransferSecurityRegistry { event AddedToAllowlist(AllowlistTypes indexed kind, uint256 indexed id, address indexed account); event CreatedAllowlist(AllowlistTypes indexed kind, uint256 indexed id, string indexed name); event ReassignedAllowlistOwnership(AllowlistTypes indexed kind, uint256 indexed id, address indexed newOwner); event RemovedFromAllowlist(AllowlistTypes indexed kind, uint256 indexed id, address indexed account); event SetAllowlist(AllowlistTypes indexed kind, address indexed collection, uint120 indexed id); event SetTransferSecurityLevel(address indexed collection, TransferSecurityLevels level); function createOperatorWhitelist(string calldata name) external returns (uint120); function createPermittedContractReceiverAllowlist(string calldata name) external returns (uint120); function reassignOwnershipOfOperatorWhitelist(uint120 id, address newOwner) external; function reassignOwnershipOfPermittedContractReceiverAllowlist(uint120 id, address newOwner) external; function renounceOwnershipOfOperatorWhitelist(uint120 id) external; function renounceOwnershipOfPermittedContractReceiverAllowlist(uint120 id) external; function setTransferSecurityLevelOfCollection(address collection, TransferSecurityLevels level) external; function setOperatorWhitelistOfCollection(address collection, uint120 id) external; function setPermittedContractReceiverAllowlistOfCollection(address collection, uint120 id) external; function addOperatorToWhitelist(uint120 id, address operator) external; function addPermittedContractReceiverToAllowlist(uint120 id, address receiver) external; function removeOperatorFromWhitelist(uint120 id, address operator) external; function removePermittedContractReceiverFromAllowlist(uint120 id, address receiver) external; function getCollectionSecurityPolicy(address collection) external view returns (CollectionSecurityPolicy memory); function getWhitelistedOperators(uint120 id) external view returns (address[] memory); function getPermittedContractReceivers(uint120 id) external view returns (address[] memory); function isOperatorWhitelisted(uint120 id, address operator) external view returns (bool); function isContractReceiverPermitted(uint120 id, address receiver) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../utils/TransferPolicy.sol"; interface ITransferValidator { function applyCollectionTransferPolicy(address caller, address from, address to) external view; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../access/OwnablePermissions.sol"; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; /** * @title ImmutableMinterRoyaltiesBase * @author Limit Break, Inc. * @dev Base functionality of an NFT mix-in contract implementing programmable royalties for minters */ abstract contract ImmutableMinterRoyaltiesBase is IERC2981, ERC165 { error ImmutableMinterRoyalties__MinterCannotBeZeroAddress(); error ImmutableMinterRoyalties__MinterHasAlreadyBeenAssignedToTokenId(); error ImmutableMinterRoyalties__RoyaltyFeeWillExceedSalePrice(); uint256 public constant FEE_DENOMINATOR = 10_000; uint256 private _royaltyFeeNumerator; mapping (uint256 => address) private _minters; /** * @notice Indicates whether the contract implements the specified interface. * @dev Overrides supportsInterface in ERC165. * @param interfaceId The interface id * @return true if the contract implements the specified interface, false otherwise */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } function royaltyFeeNumerator() public virtual view returns (uint256) { return _royaltyFeeNumerator; } /** * @notice Returns the royalty info for a given token ID and sale price. * @dev Implements the IERC2981 interface. * @param tokenId The token ID * @param salePrice The sale price * @return receiver The minter's address * @return royaltyAmount The royalty amount */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view override returns (address receiver, uint256 royaltyAmount) { return (_minters[tokenId], (salePrice * royaltyFeeNumerator()) / FEE_DENOMINATOR); } /** * @dev Internal function to be called when a new token is minted. * * @dev Throws when the minter is the zero address. * @dev Throws when a minter has already been assigned to the specified token ID. * @param minter The minter's address * @param tokenId The token ID */ function _onMinted(address minter, uint256 tokenId) internal { if (minter == address(0)) { revert ImmutableMinterRoyalties__MinterCannotBeZeroAddress(); } if (_minters[tokenId] != address(0)) { revert ImmutableMinterRoyalties__MinterHasAlreadyBeenAssignedToTokenId(); } _minters[tokenId] = minter; } /** * @dev Internal function to be called when a token is burned. Clears the minter's address. * @param tokenId The token ID */ function _onBurned(uint256 tokenId) internal { delete _minters[tokenId]; } function _setRoyaltyFeeNumerator(uint256 royaltyFeeNumerator_) internal { if(royaltyFeeNumerator_ > FEE_DENOMINATOR) { revert ImmutableMinterRoyalties__RoyaltyFeeWillExceedSalePrice(); } _royaltyFeeNumerator = royaltyFeeNumerator_; } } /** * @title ImmutableMinterRoyalties * @author Limit Break, Inc. * @notice Constructable ImmutableMinterRoyalties Contract implementation. */ abstract contract ImmutableMinterRoyalties is ImmutableMinterRoyaltiesBase { uint256 private immutable _royaltyFeeNumeratorImmutable; constructor(uint256 royaltyFeeNumerator_) { _setRoyaltyFeeNumerator(royaltyFeeNumerator_); _royaltyFeeNumeratorImmutable = royaltyFeeNumerator_; } function royaltyFeeNumerator() public view override returns (uint256) { return _royaltyFeeNumeratorImmutable; } } /** * @title ImmutableMinterRoyaltiesInitializable * @author Limit Break, Inc. * @notice Initializable ImmutableMinterRoyalties Contract implementation to allow for EIP-1167 clones. */ abstract contract ImmutableMinterRoyaltiesInitializable is OwnablePermissions, ImmutableMinterRoyaltiesBase { error ImmutableMinterRoyaltiesInitializable__MinterRoyaltyFeeAlreadyInitialized(); bool private _minterRoyaltyFeeInitialized; function initializeMinterRoyaltyFee(uint256 royaltyFeeNumerator_) public { _requireCallerIsContractOwner(); if(_minterRoyaltyFeeInitialized) { revert ImmutableMinterRoyaltiesInitializable__MinterRoyaltyFeeAlreadyInitialized(); } _minterRoyaltyFeeInitialized = true; _setRoyaltyFeeNumerator(royaltyFeeNumerator_); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../access/OwnablePermissions.sol"; import "../interfaces/ICreatorToken.sol"; import "../interfaces/ICreatorTokenTransferValidator.sol"; import "../utils/TransferValidation.sol"; import "@openzeppelin/contracts/interfaces/IERC165.sol"; /** * @title CreatorTokenBase * @author Limit Break, Inc. * @notice CreatorTokenBase is an abstract contract that provides basic functionality for managing token * transfer policies through an implementation of ICreatorTokenTransferValidator. This contract is intended to be used * as a base for creator-specific token contracts, enabling customizable transfer restrictions and security policies. * * <h4>Features:</h4> * <ul>Ownable: This contract can have an owner who can set and update the transfer validator.</ul> * <ul>TransferValidation: Implements the basic token transfer validation interface.</ul> * <ul>ICreatorToken: Implements the interface for creator tokens, providing view functions for token security policies.</ul> * * <h4>Benefits:</h4> * <ul>Provides a flexible and modular way to implement custom token transfer restrictions and security policies.</ul> * <ul>Allows creators to enforce policies such as whitelisted operators and permitted contract receivers.</ul> * <ul>Can be easily integrated into other token contracts as a base contract.</ul> * * <h4>Intended Usage:</h4> * <ul>Use as a base contract for creator token implementations that require advanced transfer restrictions and * security policies.</ul> * <ul>Set and update the ICreatorTokenTransferValidator implementation contract to enforce desired policies for the * creator token.</ul> */ abstract contract CreatorTokenBase is OwnablePermissions, TransferValidation, ICreatorToken { error CreatorTokenBase__InvalidTransferValidatorContract(); error CreatorTokenBase__SetTransferValidatorFirst(); address public constant DEFAULT_TRANSFER_VALIDATOR = address(0x0000721C310194CcfC01E523fc93C9cCcFa2A0Ac); TransferSecurityLevels public constant DEFAULT_TRANSFER_SECURITY_LEVEL = TransferSecurityLevels.One; uint120 public constant DEFAULT_OPERATOR_WHITELIST_ID = uint120(1); ICreatorTokenTransferValidator private transferValidator; /** * @notice Allows the contract owner to set the transfer validator to the official validator contract * and set the security policy to the recommended default settings. * @dev May be overridden to change the default behavior of an individual collection. */ function setToDefaultSecurityPolicy() public virtual { _requireCallerIsContractOwner(); setTransferValidator(DEFAULT_TRANSFER_VALIDATOR); ICreatorTokenTransferValidator(DEFAULT_TRANSFER_VALIDATOR).setTransferSecurityLevelOfCollection(address(this), DEFAULT_TRANSFER_SECURITY_LEVEL); ICreatorTokenTransferValidator(DEFAULT_TRANSFER_VALIDATOR).setOperatorWhitelistOfCollection(address(this), DEFAULT_OPERATOR_WHITELIST_ID); } /** * @notice Allows the contract owner to set the transfer validator to a custom validator contract * and set the security policy to their own custom settings. */ function setToCustomValidatorAndSecurityPolicy( address validator, TransferSecurityLevels level, uint120 operatorWhitelistId, uint120 permittedContractReceiversAllowlistId) public { _requireCallerIsContractOwner(); setTransferValidator(validator); ICreatorTokenTransferValidator(validator). setTransferSecurityLevelOfCollection(address(this), level); ICreatorTokenTransferValidator(validator). setOperatorWhitelistOfCollection(address(this), operatorWhitelistId); ICreatorTokenTransferValidator(validator). setPermittedContractReceiverAllowlistOfCollection(address(this), permittedContractReceiversAllowlistId); } /** * @notice Allows the contract owner to set the security policy to their own custom settings. * @dev Reverts if the transfer validator has not been set. */ function setToCustomSecurityPolicy( TransferSecurityLevels level, uint120 operatorWhitelistId, uint120 permittedContractReceiversAllowlistId) public { _requireCallerIsContractOwner(); ICreatorTokenTransferValidator validator = getTransferValidator(); if (address(validator) == address(0)) { revert CreatorTokenBase__SetTransferValidatorFirst(); } validator.setTransferSecurityLevelOfCollection(address(this), level); validator.setOperatorWhitelistOfCollection(address(this), operatorWhitelistId); validator.setPermittedContractReceiverAllowlistOfCollection(address(this), permittedContractReceiversAllowlistId); } /** * @notice Sets the transfer validator for the token contract. * * @dev Throws when provided validator contract is not the zero address and doesn't support * the ICreatorTokenTransferValidator interface. * @dev Throws when the caller is not the contract owner. * * @dev <h4>Postconditions:</h4> * 1. The transferValidator address is updated. * 2. The `TransferValidatorUpdated` event is emitted. * * @param transferValidator_ The address of the transfer validator contract. */ function setTransferValidator(address transferValidator_) public { _requireCallerIsContractOwner(); bool isValidTransferValidator = false; if(transferValidator_.code.length > 0) { try IERC165(transferValidator_).supportsInterface(type(ICreatorTokenTransferValidator).interfaceId) returns (bool supportsInterface) { isValidTransferValidator = supportsInterface; } catch {} } if(transferValidator_ != address(0) && !isValidTransferValidator) { revert CreatorTokenBase__InvalidTransferValidatorContract(); } emit TransferValidatorUpdated(address(transferValidator), transferValidator_); transferValidator = ICreatorTokenTransferValidator(transferValidator_); } /** * @notice Returns the transfer validator contract address for this token contract. */ function getTransferValidator() public view override returns (ICreatorTokenTransferValidator) { return transferValidator; } /** * @notice Returns the security policy for this token contract, which includes: * Transfer security level, operator whitelist id, permitted contract receiver allowlist id. */ function getSecurityPolicy() public view override returns (CollectionSecurityPolicy memory) { if (address(transferValidator) != address(0)) { return transferValidator.getCollectionSecurityPolicy(address(this)); } return CollectionSecurityPolicy({ transferSecurityLevel: TransferSecurityLevels.Zero, operatorWhitelistId: 0, permittedContractReceiversId: 0 }); } /** * @notice Returns the list of all whitelisted operators for this token contract. * @dev This can be an expensive call and should only be used in view-only functions. */ function getWhitelistedOperators() public view override returns (address[] memory) { if (address(transferValidator) != address(0)) { return transferValidator.getWhitelistedOperators( transferValidator.getCollectionSecurityPolicy(address(this)).operatorWhitelistId); } return new address[](0); } /** * @notice Returns the list of permitted contract receivers for this token contract. * @dev This can be an expensive call and should only be used in view-only functions. */ function getPermittedContractReceivers() public view override returns (address[] memory) { if (address(transferValidator) != address(0)) { return transferValidator.getPermittedContractReceivers( transferValidator.getCollectionSecurityPolicy(address(this)).permittedContractReceiversId); } return new address[](0); } /** * @notice Checks if an operator is whitelisted for this token contract. * @param operator The address of the operator to check. */ function isOperatorWhitelisted(address operator) public view override returns (bool) { if (address(transferValidator) != address(0)) { return transferValidator.isOperatorWhitelisted( transferValidator.getCollectionSecurityPolicy(address(this)).operatorWhitelistId, operator); } return false; } /** * @notice Checks if a contract receiver is permitted for this token contract. * @param receiver The address of the receiver to check. */ function isContractReceiverPermitted(address receiver) public view override returns (bool) { if (address(transferValidator) != address(0)) { return transferValidator.isContractReceiverPermitted( transferValidator.getCollectionSecurityPolicy(address(this)).permittedContractReceiversId, receiver); } return false; } /** * @notice Determines if a transfer is allowed based on the token contract's security policy. Use this function * to simulate whether or not a transfer made by the specified `caller` from the `from` address to the `to` * address would be allowed by this token's security policy. * * @notice This function only checks the security policy restrictions and does not check whether token ownership * or approvals are in place. * * @param caller The address of the simulated caller. * @param from The address of the sender. * @param to The address of the receiver. * @return True if the transfer is allowed, false otherwise. */ function isTransferAllowed(address caller, address from, address to) public view override returns (bool) { if (address(transferValidator) != address(0)) { try transferValidator.applyCollectionTransferPolicy(caller, from, to) { return true; } catch { return false; } } return true; } /** * @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy. * Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent * and calling _validateBeforeTransfer so that checks can be properly applied during token transfers. * * @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is * set to a non-zero address. * * @param caller The address of the caller. * @param from The address of the sender. * @param to The address of the receiver. */ function _preValidateTransfer( address caller, address from, address to, uint256 /*tokenId*/, uint256 /*value*/) internal virtual override { if (address(transferValidator) != address(0)) { transferValidator.applyCollectionTransferPolicy(caller, from, to); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; enum AllowlistTypes { Operators, PermittedContractReceivers } enum ReceiverConstraints { None, NoCode, EOA } enum CallerConstraints { None, OperatorWhitelistEnableOTC, OperatorWhitelistDisableOTC } enum StakerConstraints { None, CallerIsTxOrigin, EOA } enum TransferSecurityLevels { Zero, One, Two, Three, Four, Five, Six } struct TransferSecurityPolicy { CallerConstraints callerConstraints; ReceiverConstraints receiverConstraints; } struct CollectionSecurityPolicy { TransferSecurityLevels transferSecurityLevel; uint120 operatorWhitelistId; uint120 permittedContractReceiversId; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/Context.sol"; /** * @title TransferValidation * @author Limit Break, Inc. * @notice A mix-in that can be combined with ERC-721 contracts to provide more granular hooks. * Openzeppelin's ERC721 contract only provides hooks for before and after transfer. This allows * developers to validate or customize transfers within the context of a mint, a burn, or a transfer. */ abstract contract TransferValidation is Context { error ShouldNotMintToBurnAddress(); /// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks. function _validateBeforeTransfer(address from, address to, uint256 tokenId) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _preValidateMint(_msgSender(), to, tokenId, msg.value); } else if(toZeroAddress) { _preValidateBurn(_msgSender(), from, tokenId, msg.value); } else { _preValidateTransfer(_msgSender(), from, to, tokenId, msg.value); } } /// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks. function _validateAfterTransfer(address from, address to, uint256 tokenId) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _postValidateMint(_msgSender(), to, tokenId, msg.value); } else if(toZeroAddress) { _postValidateBurn(_msgSender(), from, tokenId, msg.value); } else { _postValidateTransfer(_msgSender(), from, to, tokenId, msg.value); } } /// @dev Optional validation hook that fires before a mint function _preValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a mint function _postValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a burn function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a burn function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a transfer function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a transfer function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.6) (utils/Base64.sol) pragma solidity ^0.8.0; /** * @dev Provides a set of functions to operate with Base64 strings. * * _Available since v4.5._ */ library Base64 { /** * @dev Base64 Encoding/Decoding Table */ string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * @dev Converts a `bytes` to its Bytes64 `string` representation. */ function encode(bytes memory data) internal pure returns (string memory) { /** * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol */ if (data.length == 0) return ""; // Loads the table into memory string memory table = _TABLE; // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter // and split into 4 numbers of 6 bits. // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up // - `data.length + 2` -> Round up // - `/ 3` -> Number of 3-bytes chunks // - `4 *` -> 4 characters for each chunk string memory result = new string(4 * ((data.length + 2) / 3)); /// @solidity memory-safe-assembly assembly { // Prepare the lookup table (skip the first "length" byte) let tablePtr := add(table, 1) // Prepare result pointer, jump over length let resultPtr := add(result, 0x20) let dataPtr := data let endPtr := add(data, mload(data)) // In some cases, the last iteration will read bytes after the end of the data. We cache the value, and // set it to zero to make sure no dirty bytes are read in that section. let afterPtr := add(endPtr, 0x20) let afterCache := mload(afterPtr) mstore(afterPtr, 0x00) // Run over the input, 3 bytes at a time for { } lt(dataPtr, endPtr) { } { // Advance 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // To write each character, shift the 3 byte (24 bits) chunk // 4 times in blocks of 6 bits for each character (18, 12, 6, 0) // and apply logical AND with 0x3F to bitmask the least significant 6 bits. // Use this as an index into the lookup table, mload an entire word // so the desired character is in the least significant byte, and // mstore8 this least significant byte into the result and continue. mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F)))) resultPtr := add(resultPtr, 1) // Advance } // Reset the value that was cached mstore(afterPtr, afterCache) // When data `bytes` is not exactly 3 bytes long // it is padded with `=` characters at the end switch mod(mload(data), 3) case 1 { mstore8(sub(resultPtr, 1), 0x3d) mstore8(sub(resultPtr, 2), 0x3d) } case 2 { mstore8(sub(resultPtr, 1), 0x3d) } } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // 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. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 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 + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @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 v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(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) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * The `_sequentialUpTo()` function can be overriden to enable spot mints * (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // The amount of tokens minted above `_sequentialUpTo()`. // We call these spot mints (i.e. non-sequential mints). uint256 private _spotMinted; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID for sequential mints. * * Override this function to change the starting token ID for sequential mints. * * Note: The value returned must never change after any tokens have been minted. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the maximum token ID (inclusive) for sequential mints. * * Override this function to return a value less than 2**256 - 1, * but greater than `_startTokenId()`, to enable spot (non-sequential) mints. * * Note: The value returned must never change after any tokens have been minted. */ function _sequentialUpTo() internal view virtual returns (uint256) { return type(uint256).max; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256 result) { // Counter underflow is impossible as `_burnCounter` cannot be incremented // more than `_currentIndex + _spotMinted - _startTokenId()` times. unchecked { // With spot minting, the intermediate `result` can be temporarily negative, // and the computation must be unchecked. result = _currentIndex - _burnCounter - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += _spotMinted; } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256 result) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { result = _currentIndex - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += _spotMinted; } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } /** * @dev Returns the total number of tokens that are spot-minted. */ function _totalSpotMinted() internal view virtual returns (uint256) { return _spotMinted; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Returns whether the ownership slot at `index` is initialized. * An uninitialized slot does not necessarily mean that the slot has no owner. */ function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) { return _packedOwnerships[index] != 0; } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * @dev Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) { if (_startTokenId() <= tokenId) { packed = _packedOwnerships[tokenId]; if (tokenId > _sequentialUpTo()) { if (_packedOwnershipExists(packed)) return packed; _revert(OwnerQueryForNonexistentToken.selector); } // If the data at the starting slot does not exist, start the scan. if (packed == 0) { if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector); // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `tokenId` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. for (;;) { unchecked { packed = _packedOwnerships[--tokenId]; } if (packed == 0) continue; if (packed & _BITMASK_BURNED == 0) return packed; // Otherwise, the token is burned, and we must revert. // This handles the case of batch burned tokens, where only the burned bit // of the starting slot is set, and remaining slots are left uninitialized. _revert(OwnerQueryForNonexistentToken.selector); } } // Otherwise, the data exists and we can skip the scan. // This is possible because we have already achieved the target condition. // This saves 2143 gas on transfers of initialized tokens. // If the token is not burned, return `packed`. Otherwise, revert. if (packed & _BITMASK_BURNED == 0) return packed; } _revert(OwnerQueryForNonexistentToken.selector); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}. * * Requirements: * * - The caller must own the token or be an approved operator. */ function approve(address to, uint256 tokenId) public payable virtual override { _approve(to, tokenId, true); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector); return _tokenApprovals[tokenId].value; } /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool result) { if (_startTokenId() <= tokenId) { if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]); if (tokenId < _currentIndex) { uint256 packed; while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId; result = packed & _BITMASK_BURNED == 0; } } } /** * @dev Returns whether `packed` represents a token that exists. */ function _packedOwnershipExists(uint256 packed) private pure returns (bool result) { assembly { // The following is equivalent to `owner != address(0) && burned == false`. // Symbolically tested. result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_BURNED)) } } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean. from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS)); if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. from, // `from`. toMasked, // `to`. tokenId // `tokenId`. ) } if (toMasked == 0) _revert(TransferToZeroAddress.selector); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { _revert(TransferToNonERC721ReceiverImplementer.selector); } assembly { revert(add(32, reason), mload(reason)) } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) _revert(MintZeroQuantity.selector); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); uint256 end = startTokenId + quantity; uint256 tokenId = startTokenId; if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); do { assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. tokenId // `tokenId`. ) } // The `!=` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. } while (++tokenId != end); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) _revert(MintToZeroAddress.selector); if (quantity == 0) _revert(MintZeroQuantity.selector); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } } while (index < end); // This prevents reentrancy to `_safeMint`. // It does not prevent reentrancy to `_safeMintSpot`. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } /** * @dev Mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * Emits a {Transfer} event for each mint. */ function _mintSpot(address to, uint256 tokenId) internal virtual { if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector); uint256 prevOwnershipPacked = _packedOwnerships[tokenId]; if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector); _beforeTokenTransfers(address(0), to, tokenId, 1); // Overflows are incredibly unrealistic. // The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1. // `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1. unchecked { // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `true` (as `quantity == 1`). _packedOwnerships[tokenId] = _packOwnershipData( to, _nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked) ); // Updates: // - `balance += 1`. // - `numberMinted += 1`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1; // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. tokenId // `tokenId`. ) } ++_spotMinted; } _afterTokenTransfers(address(0), to, tokenId, 1); } /** * @dev Safely mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * See {_mintSpot}. * * Emits a {Transfer} event. */ function _safeMintSpot( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mintSpot(to, tokenId); unchecked { if (to.code.length != 0) { uint256 currentSpotMinted = _spotMinted; if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } // This prevents reentrancy to `_safeMintSpot`. // It does not prevent reentrancy to `_safeMint`. if (_spotMinted != currentSpotMinted) revert(); } } } /** * @dev Equivalent to `_safeMintSpot(to, tokenId, '')`. */ function _safeMintSpot(address to, uint256 tokenId) internal virtual { _safeMintSpot(to, tokenId, ''); } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Equivalent to `_approve(to, tokenId, false)`. */ function _approve(address to, uint256 tokenId) internal virtual { _approve(to, tokenId, false); } /** * @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: * * - `tokenId` must exist. * * Emits an {Approval} event. */ function _approve( address to, uint256 tokenId, bool approvalCheck ) internal virtual { address owner = ownerOf(tokenId); if (approvalCheck && _msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { _revert(ApprovalCallerNotOwnerNorApproved.selector); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as `_burnCounter` cannot be exceed `_currentIndex + _spotMinted` times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } /** * @dev For more efficient reverts. */ function _revert(bytes4 errorSelector) internal pure { assembly { mstore(0x00, errorSelector) revert(0x00, 0x04) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); /** * `_sequentialUpTo()` must be greater than `_startTokenId()`. */ error SequentialUpToTooSmall(); /** * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`. */ error SequentialMintExceedsLimit(); /** * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`. */ error SpotMintTokenIdTooSmall(); /** * Cannot mint over a token that already exists. */ error TokenAlreadyExists(); /** * The feature is not compatible with spot mints. */ error NotCompatibleWithSpotMints(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @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 payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
{ "optimizer": { "enabled": true, "runs": 200 }, "debug": { "revertStrings": "debug" }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"royaltyFeeNumerator_","type":"uint256"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint256","name":"mintPrice_","type":"uint256"},{"internalType":"uint256","name":"maxMintsPerWallet_","type":"uint256"},{"internalType":"uint256","name":"colorChangePrice_","type":"uint256"},{"internalType":"address","name":"transferValidator_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"inputs":[],"name":"CreatorTokenBase__SetTransferValidatorFirst","type":"error"},{"inputs":[],"name":"GameEnded","type":"error"},{"inputs":[],"name":"GameNotEnded","type":"error"},{"inputs":[],"name":"GameNotEndedOrNotTied","type":"error"},{"inputs":[],"name":"ImmutableMinterRoyalties__MinterCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"ImmutableMinterRoyalties__MinterHasAlreadyBeenAssignedToTokenId","type":"error"},{"inputs":[],"name":"ImmutableMinterRoyalties__RoyaltyFeeWillExceedSalePrice","type":"error"},{"inputs":[],"name":"InvalidColorChoice","type":"error"},{"inputs":[],"name":"MaxSupplyExceeded","type":"error"},{"inputs":[],"name":"MetadataContractLocked","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NoWinningColor","type":"error"},{"inputs":[],"name":"NotCompatibleWithSpotMints","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"SameColorAlreadySet","type":"error"},{"inputs":[],"name":"SequentialMintExceedsLimit","type":"error"},{"inputs":[],"name":"SequentialUpToTooSmall","type":"error"},{"inputs":[],"name":"ShouldNotMintToBurnAddress","type":"error"},{"inputs":[],"name":"SpotMintTokenIdTooSmall","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"newWinningColor","type":"uint8"},{"indexed":false,"internalType":"bool","name":"isTie","type":"bool"}],"name":"WinningColorChanged","type":"event"},{"inputs":[],"name":"COLOR_CHANGE_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_OPERATOR_WHITELIST_ID","outputs":[{"internalType":"uint120","name":"","type":"uint120"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_SECURITY_LEVEL","outputs":[{"internalType":"enum TransferSecurityLevels","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GAME_END_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MINTS_PER_WALLET","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"quantities","type":"uint256[]"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"claimShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"currentWinningColor","outputs":[{"internalType":"uint8","name":"color","type":"uint8"},{"internalType":"bool","name":"isTie","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"freeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getBackgroundColor","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGameState","outputs":[{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"defaultCount_","type":"uint256"},{"internalType":"uint256","name":"aquaCount","type":"uint256"},{"internalType":"uint256","name":"orangeCount_","type":"uint256"},{"internalType":"uint256","name":"totalFees","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPermittedContractReceivers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSecurityPolicy","outputs":[{"components":[{"internalType":"enum TransferSecurityLevels","name":"transferSecurityLevel","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversId","type":"uint120"}],"internalType":"struct CollectionSecurityPolicy","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"contract ICreatorTokenTransferValidator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistedOperators","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasUsedFreeMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"isContractReceiverPermitted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMetadataContractLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"isOperatorWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"isTransferAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockMetadataContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mintedPerWallet","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":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyFeeNumerator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","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":"payable","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":"payable","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":"tokenId","type":"uint256"},{"internalType":"uint8","name":"colorChoice","type":"uint8"}],"name":"setBackground","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_metadataContract","type":"address"}],"name":"setMetadataContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"required","type":"bool"}],"name":"setSignatureRequired","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum TransferSecurityLevels","name":"level","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversAllowlistId","type":"uint120"}],"name":"setToCustomSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"},{"internalType":"enum TransferSecurityLevels","name":"level","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversAllowlistId","type":"uint120"}],"name":"setToCustomValidatorAndSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setToDefaultSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signatureRequired","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenData","outputs":[{"internalType":"bool","name":"backgroundChanged","type":"bool"},{"internalType":"bool","name":"usesSecondaryColor","type":"bool"},{"internalType":"bool","name":"hasClaimedShare","type":"bool"}],"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":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawColorChangeFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
601b805460ff19166001908117909155600860e05267476f6f62616c6f6f60c01b6101005261012052603160f81b610140527f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6101809081527fa69e5b72e8cddcab60e3e3891509d5d25b9bef35987678286c3f8bb17304076a6101a0527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66101c052466101e052306102005260a0610160819052610220604052902060c0523480156101185760405162461bcd60e51b815260206004820152602260248201527f45746865722073656e7420746f206e6f6e2d70617961626c652066756e637469604482019081526137b760f11b6064830152608482fd5b506040516165be3803806165be83398101604081905261013791610658565b86868681816002610148838261079e565b506003610155828261079e565b50506000805550610165336101ef565b50610171905081610241565b6080526001600d556001600160a01b038116156101915761019181610269565b601280546001600160a01b031916331790556101b04262093a8061085c565b60a052506108ae6014556040805180820190915260008082526020909101526019805461ffff19169055600f92909255601055601155506108af915050565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61271081111561026457604051634ca36f5f60e11b815260040160405180910390fd5b600b55565b6102716103e9565b60006001600160a01b0382163b1561034b576040516301ffc9a760e01b8152600060048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b1580156103135760405162461bcd60e51b815260206004820152602560248201527f54617267657420636f6e747261637420646f6573206e6f7420636f6e7461696e604482019081526420636f646560d81b6064830152608482fd5b505afa925050508015610343575060408051601f3d908101601f1916820190925261034091810190610883565b60015b1561034b5790505b6001600160a01b03821615801590610361575080155b1561037f576040516332483afb60e01b815260040160405180910390fd5b600a54604080516001600160a01b03928316815291841660208301527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a150600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6103f16103f3565b565b6009546001600160a01b031633146103f15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f6044820152611c9d60f21b6064820152608481fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a20696e76616c6964207475706c65206f666673604482015261195d60f21b6064820152608481fd5b634e487b7160e01b600052604160045260246000fd5b60005b8381101561052257818101518382015260200161050a565b50506000910152565b600082601f8301126105905760405162461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201526a1c9c985e481bd9999cd95d60aa1b6064820152608481fd5b81516001600160401b038111156105a9576105a96104f1565b604051601f8201601f19908116603f011681016001600160401b03811182821017156105d7576105d76104f1565b60405281815283820160200185101561063f5760405162461bcd60e51b815260206004820152602760248201527f414249206465636f64696e673a20696e76616c69642062797465206172726179604482015266040d8cadccee8d60cb1b6064820152608481fd5b610650826020830160208701610507565b949350505050565b600080600080600080600060e0888a03121561067657610676610451565b875160208901519097506001600160401b03811115610697576106976104a1565b6106a38a828b0161052b565b60408a015190975090506001600160401b038111156106c4576106c46104a1565b6106d08a828b0161052b565b60608a015160808b015160a08c015160c08d01519399509197509550935090506001600160a01b038116811461070557600080fd5b8091505092959891949750929550565b600181811c9082168061072957607f821691505b60208210810361074957634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561079957806000526020600020601f840160051c810160208510156107765750805b601f840160051c820191505b818110156107965760008155600101610782565b50505b505050565b81516001600160401b038111156107b7576107b76104f1565b6107cb816107c58454610715565b8461074f565b6020601f8211600181146107ff57600083156107e75750848201515b600019600385901b1c1916600184901b178455610796565b600084815260208120601f198516915b8281101561082f578785015182556020948501946001909201910161080f565b508482101561084d5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b8082018082111561087d57634e487b7160e01b600052601160045260246000fd5b92915050565b60006020828403121561089857610898610451565b815180151581146108a857600080fd5b9392505050565b60805160a05160c051615caf61090f60003960008181610952015281816130f901526135800152600081816113f2015281816117c6015281816122b001528181612cc40152612de8015260008181610f890152611d640152615caf6000f3fe6080604052600436106103975760003560e01c806370a08231116101dc578063b4b5b48f11610102578063d73792a9116100a0578063e985e9c51161006f578063e985e9c5146116f5578063e9c3e26514611779578063f2fde38b146117e8578063fd762d921461184357610397565b8063d73792a9146115a8578063e5187f43146115f9578063e78fba2214611654578063e8a3d485146116a557610397565b8063be537f43116100dc578063be537f431461144f578063c002d23d146114ac578063c87b56dd146114fd578063d007af5c1461155857610397565b8063b4b5b48f146112fc578063b7d0628b14611399578063b88d4fde1461143c57610397565b806395d89b411161017a578063a30b8ed411610149578063a30b8ed41461117a578063a4513e92146111cf578063a9fc664e1461122a578063b4799b421461128557610397565b806395d89b411461101957806399ffbe5f146110695780639d645a44146110c4578063a22cb4651461111f57610397565b80637b19beea116101b65780637b19beea14610f2c57806381ddcc1f14610f3f5780638da5cb5b14610fad57806394d008ef1461100657610397565b806370a0823114610e31578063715018a614610e8c5780637169d83b14610edc57610397565b80633644e515116102c1578063495c8bf91161025f5780636352211e1161022e5780636352211e14610cd157806365ed9b5914610d2c5780636724348214610d865780636c3b869914610de157610397565b8063495c8bf914610b56578063524d60d214610bb35780635d4c1d4614610c0e5780636134716214610c7657610397565b806342842e0e1161029b57806342842e0e14610a2c578063435b424614610a3f57806345c72b1c14610aaa5780634671059f14610afb57610397565b80633644e515146109055780633a602b4d146109745780633ccfd60b146109dc57610397565b806318160ddd1161033957806323b872dd1161030857806323b872dd146107cc5780632a55205a146107df5780632e8da8291461085957806332cb6b0c146108b457610397565b806318160ddd146106665780631b25b077146106c45780631c33b3281461071f5780631e6fc1da1461077c57610397565b8063081812fc11610375578063081812fc14610542578063095ea7b31461059d578063098144d4146105b25780630cc03e7a1461060b57610397565b806301463546146103fc57806301ffc9a71461047a57806306fdde03146104e5575b60405162461bcd60e51b815260206004820152603560248201527f436f6e747261637420646f6573206e6f7420686176652066616c6c6261636b2060448201908152746e6f7220726563656976652066756e6374696f6e7360581b6064830152608482fd5b3480156104435760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061045d71721c310194ccfc01e523fc93c9cccfa2a0ac81565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156104c15760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d56104d0366004614d94565b61189e565b6040519015158152602001610471565b34801561052c5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105356118af565b6040516104719190614e04565b3480156105895760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061045d610598366004614e17565b611941565b6105b06105ab366004614e48565b61197c565b005b3480156105f95760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50600a546001600160a01b031661045d565b3480156106525760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0610661366004614e17565b61198c565b3480156106ad5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50600154600054035b604051908152602001610471565b34801561070b5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d561071a366004614e77565b611a76565b3480156107665760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061076f600181565b6040516104719190614efd565b3480156107c35760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0611b4d565b6105b06107da366004614f0b565b611bc3565b3480156108265760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061083a610835366004614f4f565b611d42565b604080516001600160a01b039093168352602083019190915201610471565b3480156108a05760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d56108af366004614f74565b611d9f565b3480156108fb5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b66108ae81565b34801561094c5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b67f000000000000000000000000000000000000000000000000000000000000000081565b3480156109bb5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b66109ca366004614f74565b60186020526000908152604090205481565b348015610a235760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0611f45565b6105b0610a3a366004614f0b565b61203c565b348015610a865760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d5610a95366004614f74565b601a6020526000908152604090205460ff1681565b348015610af15760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b660115481565b348015610b425760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610535610b51366004614e17565b61205c565b348015610b9d5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610ba66120fb565b6040516104719190614f94565b348015610bfa5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0610c09366004615138565b6122a6565b348015610c555760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610c5e600181565b6040516001600160781b039091168152602001610471565b348015610cbd5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0610ccc3660046151a1565b61258e565b348015610d185760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061045d610d27366004614e17565b6127b3565b348015610d735760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50601b546104d590610100900460ff1681565b348015610dcd5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0610ddc3660046151e4565b6127be565b348015610e285760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0612aec565b348015610e785760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b6610e87366004614f74565b612c61565b348015610ed35760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0612ca6565b348015610f235760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0612cba565b6105b0610f3a36600461525c565b612d6f565b348015610f865760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b507f00000000000000000000000000000000000000000000000000000000000000006106b6565b348015610ff45760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506009546001600160a01b031661045d565b6105b06110143660046152df565b612fba565b3480156110605760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610535613310565b3480156110b05760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b06110bf366004615342565b61331f565b34801561110b5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d561111a366004614f74565b61333a565b3480156111665760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0611175366004615362565b61344f565b3480156111c15760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50601b546104d59060ff1681565b3480156112165760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0611225366004615393565b6134c8565b3480156112715760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0611280366004614f74565b61368b565b3480156112cc5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506019546112e39060ff8082169161010090041682565b6040805160ff9093168352901515602083015201610471565b3480156113435760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061137a611352366004614e17565b600e6020526000908152604090205460ff808216916101008104821691620100009091041683565b6040805193151584529115156020840152151590820152606001610471565b3480156113e05760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506114146014546015546016546017547f000000000000000000000000000000000000000000000000000000000000000094565b604080519586526020860194909452928401919091526060830152608082015260a001610471565b6105b061144a366004615490565b6137f9565b3480156114965760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061149f613834565b604051610471919061554a565b3480156114f35760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b6600f5481565b3480156115445760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610535611553366004614e17565b61393c565b34801561159f5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610ba6613b87565b3480156115ef5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b661271081565b3480156116405760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b061164f366004614f74565b613c8d565b34801561169b5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b660105481565b3480156116ec5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610535613d36565b34801561173c5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d561174b366004615589565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156117c05760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b67f000000000000000000000000000000000000000000000000000000000000000081565b34801561182f5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b061183e366004614f74565b613d56565b34801561188a5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b06118993660046155ba565b613dcc565b60006118a982613f47565b92915050565b6060600280546118be90615619565b80601f01602080910402602001604051908101604052809291908181526020018280546118ea90615619565b80156119375780601f1061190c57610100808354040283529160200191611937565b820191906000526020600020905b81548152906001019060200180831161191a57829003601f168201915b5050505050905090565b600061194c82613f7c565b611960576119606333d1c03960e21b613fc1565b506000908152600660205260409020546001600160a01b031690565b61198882826001613fcb565b5050565b61199461406e565b6040805160018082528183019092526000916020808301908036833701905050905081816000815181106119ca576119ca615653565b6020908102919091010152604051632926b06960e11b8152309063524d60d2906119f8908490600401615669565b600060405180830381600087803b158015611a505760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1158015611a64573d6000803e3d6000fd5b5050505050611a736001600d55565b50565b600a546000906001600160a01b031615611b4257600a5460405163050bf71960e31b81526001600160a01b038681166004830152858116602483015284811660448301529091169063285fb8c89060640160006040518083038186803b158015611b1d5760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa925050508015611b2e575060015b611b3a57506000611b46565b506001611b46565b5060015b9392505050565b611b556140c7565b6013546001600160a01b0316611bb25760405162461bcd60e51b815260206004820152601960248201527f4d6574616461746120636f6e7472616374206e6f74207365740000000000000060448201526064015b60405180910390fd5b601b805461ff001916610100179055565b6000611bce82614121565b6001600160a01b039485169490915081168414611bf457611bf462a1148160e81b613fc1565b60008281526006602052604090208054338082146001600160a01b03881690911417611c3857611c24863361174b565b611c3857611c38632ce44b5f60e11b613fc1565b611c4586868660016141b7565b8015611c5057600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b84169003611ce257600184016000818152600460205260408120549003611ce0576000548114611ce05760008181526004602052604090208490555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003611d2c57611d2c633a954ecd60e21b613fc1565b611d3987878760016141de565b50505050505050565b6000828152600c602052604081205481906001600160a01b0316612710611d897f0000000000000000000000000000000000000000000000000000000000000000866156b7565b611d9391906156e4565b915091505b9250929050565b600a546000906001600160a01b031615611f3d57600a54604051635caaa2a960e11b81523060048201526001600160a01b039091169063d72dde5e90829063b95545529060240160606040518083038186803b158015611e3c5760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015611e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e7491906156f8565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b03851660248201526044015b60206040518083038186803b158015611f055760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015611f19573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a9919061576e565b506000919050565b611f4d6140c7565b600060175447611f5d919061578e565b905060008111611fa65760405162461bcd60e51b81526020600482015260146024820152734e6f2066756e647320746f20776974686472617760601b6044820152606401611ba9565b6000336001600160a01b0316826040515b60006040518083038185875af1925050503d8060008114611ff4576040519150601f19603f3d011682016040523d82523d6000602084013e611ff9565b606091505b50509050806119885760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401611ba9565b612057838383604051806020016040528060008152506137f9565b505050565b6000818152600e602052604090205460609060ff166120985750506040805180820190915260078152662330303534666160c81b602082015290565b6000828152600e6020526040902054610100900460ff166120d8576040518060400160405280600781526020016611989b229b211b60c91b8152506118a9565b50506040805180820190915260078152662345463937323960c81b602082015290565b600a546060906001600160a01b03161561229357600a54604051635caaa2a960e11b81523060048201526001600160a01b0390911690633fe5df9990829063b95545529060240160606040518083038186803b1580156121985760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa1580156121ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d091906156f8565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526024015b60006040518083038186803b1580156122525760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015612266573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261228e91908101906157a1565b905090565b5060408051600081526020810190915290565b6122ae61406e565b7f00000000000000000000000000000000000000000000000000000000000000004210156122ef57604051638f86c6b360e01b815260040160405180910390fd5b601954610100900460ff16156123185760405163f1b9e4ab60e01b815260040160405180910390fd5b601954600090819060ff16156123455760195460ff1660011461233d57601654612349565b601554612349565b6014545b905060008160175461235b91906156e4565b905060005b848110156124f557600086868381811061237c5761237c615653565b90506020020135905061238e81613f7c565b6123aa5760405162461bcd60e51b8152600401611ba990615864565b336123b4826127b3565b6001600160a01b0316146123fc5760405162461bcd60e51b815260206004820152600f60248201526e2737ba103a37b5b2b71037bbb732b960891b6044820152606401611ba9565b6000818152600e60205260409020805462010000900460ff161561243357604051630c8d9eab60e31b815260040160405180910390fd5b60195460009060ff161561246c57815460ff16801561246757506019548254610100900460ff908116151560029190921614145b612473565b815460ff16155b9050806124cc5760405162461bcd60e51b815260206004820152602160248201527f546f6b656e20646f6573206e6f7420686176652077696e6e696e6720636f6c6f6044820152603960f91b6064820152608401611ba9565b815462ff00001916620100001782556124e58588615892565b9650836001019350505050612360565b50604051600090339085908381818185875af1925050503d8060008114612538576040519150601f19603f3d011682016040523d82523d6000602084013e61253d565b606091505b50509050806125805760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401611ba9565b505050506119886001600d55565b612596614205565b60006125aa600a546001600160a01b031690565b90506001600160a01b0381166125d357604051631cffe3dd60e11b815260040160405180910390fd5b604051630368065360e61b81526001600160a01b0382169063da0194c09061260190309088906004016158a5565b600060405180830381600087803b1580156126595760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af115801561266d573d6000803e3d6000fd5b5050604051631182550160e11b81526001600160a01b0384169250632304aa02915061269f90309087906004016158c2565b600060405180830381600087803b1580156126f75760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af115801561270b573d6000803e3d6000fd5b505060405163235d10c560e21b81526001600160a01b0384169250638d744314915061273d90309086906004016158c2565b600060405180830381600087803b1580156127955760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af11580156127a9573d6000803e3d6000fd5b5050505050505050565b60006118a982614121565b6127c66140c7565b8281146128275760405162461bcd60e51b815260206004820152602960248201527f526563697069656e747320616e64207175616e746974696573206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401611ba9565b6000805b828110156128c957600084848381811061284757612847615653565b905060200201351161289b5760405162461bcd60e51b815260206004820152601f60248201527f5175616e74697479206d7573742062652067726561746572207468616e2030006044820152606401611ba9565b8383828181106128ad576128ad615653565b90506020020135826128bf9190615892565b915060010161282b565b506128d38161420d565b6000816001600160401b038111156128ed576128ed615423565b604051908082528060200260200182016040528015612916578160200160208202803683370190505b5090506000805b868110156129ae5760005b86868381811061293a5761293a615653565b905060200201358110156129a55788888381811061295a5761295a615653565b905060200201602081019061296f9190614f74565b84848151811061298157612981615653565b6001600160a01b039092166020928302919091019091015260019283019201612928565b5060010161291d565b506000600183516129bf919061578e565b90505b8015612ab35760006129d5826001615892565b6040805142602080830191909152448284015260608083018790528351808403909101815260809092019092528051910120612a1191906158e4565b90506000848381518110612a2757612a27615653565b60200260200101519050848281518110612a4357612a43615653565b6020026020010151858481518110612a5d57612a5d615653565b60200260200101906001600160a01b031690816001600160a01b03168152505080858381518110612a9057612a90615653565b6001600160a01b03909216602092830291909101909101525050600019016129c2565b5060005b82518110156127a957612ae4838281518110612ad557612ad5615653565b60200260200101516001614243565b600101612ab7565b612af4614205565b612b0f71721c310194ccfc01e523fc93c9cccfa2a0ac61368b565b604051630368065360e61b815271721c310194ccfc01e523fc93c9cccfa2a0ac9063da0194c090612b479030906001906004016158a5565b600060405180830381600087803b158015612b9f5760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1158015612bb3573d6000803e3d6000fd5b5050604051631182550160e11b815271721c310194ccfc01e523fc93c9cccfa2a0ac9250632304aa029150612bef9030906001906004016158c2565b600060405180830381600087803b158015612c475760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1158015612c5b573d6000803e3d6000fd5b50505050565b60006001600160a01b038216612c8157612c816323d3ad8160e21b613fc1565b506001600160a01b03166000908152600560205260409020546001600160401b031690565b612cae6140c7565b612cb86000614277565b565b612cc26140c7565b7f0000000000000000000000000000000000000000000000000000000000000000421080612cf85750601954610100900460ff16155b15612d165760405163d8b4a23360e01b815260040160405180910390fd5b60175480612d5c5760405162461bcd60e51b81526020600482015260136024820152724e6f206665657320746f20776974686472617760681b6044820152606401611ba9565b6000601781905560405133908390611fb7565b612d7882613f7c565b612d945760405162461bcd60e51b8152600401611ba990615864565b33612d9e836127b3565b6001600160a01b031614612de65760405162461bcd60e51b815260206004820152600f60248201526e2737ba103a37b5b2b71037bbb732b960891b6044820152606401611ba9565b7f00000000000000000000000000000000000000000000000000000000000000004210612e26576040516308426a3f60e11b815260040160405180910390fd5b6011543414612e775760405162461bcd60e51b815260206004820152601860248201527f496e636f7272656374207061796d656e7420616d6f756e7400000000000000006044820152606401611ba9565b8060ff16600114158015612e8f57508060ff16600214155b15612ead5760405163878814d760e01b815260040160405180910390fd5b6000828152600e60205260409020805460ff83811660021491168015612ee05750815460ff610100909104161515811515145b15612efe57604051633c9588ab60e21b815260040160405180910390fd5b815460ff16612f165760148054600019019055612f3f565b8154610100900460ff1615612f345760168054600019019055612f3f565b601580546000190190555b8015612f5357601680546001019055612f5d565b6015805460010190555b6017805434019055815461ffff191661010082151502176001178255612f816142c9565b6040518481527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a150505050565b612fc261406e565b6000546108ae811061300b5760405162461bcd60e51b815260206004820152601260248201527113585e081cdd5c1c1b1e481c995858da195960721b6044820152606401611ba9565b6000613019826108ae61578e565b33600090815260186020526040812054601054929350909161303b919061578e565b9050600081116130825760405162461bcd60e51b81526020600482015260126024820152714e6f206d696e74732072656d61696e696e6760701b6044820152606401611ba9565b858181111561308e5750805b828111156130995750815b601b5460ff16156131da57604080517f0bbb78faec1ba872c3f2bca4b11ae7050bb6600ff726df7975aa912ad6f29d50602080830191909152338284015282518083038401815260608301845280519082012061190160f01b60808401527f0000000000000000000000000000000000000000000000000000000000000000608284015260a28084018290528451808503909101815260c2840180865281519184019190912060e2601f8c018590049094028501840190955289815290939260009261318292859290918d918d918291018382808284376000920191909152506143b292505050565b6012549091506001600160a01b038083169116146131d65760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401611ba9565b5050505b600081600f546131ea91906156b7565b9050803410156132335760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b6044820152606401611ba9565b600061323f823461578e565b905080156132d157604051600090339083908381818185875af1925050503d8060008114613289576040519150601f19603f3d011682016040523d82523d6000602084013e61328e565b606091505b50509050806132cf5760405162461bcd60e51b815260206004820152600d60248201526c1499599d5b990819985a5b1959609a1b6044820152606401611ba9565b505b33600090815260186020526040812080548592906132f0908490615892565b9091555061330090508a84614243565b505050505050612c5b6001600d55565b6060600380546118be90615619565b6133276140c7565b601b805460ff1916911515919091179055565b600a546000906001600160a01b031615611f3d57600a54604051635caaa2a960e11b81523060048201526001600160a01b0390911690639445f53090829063b95545529060240160606040518083038186803b1580156133d75760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa1580156133eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061340f91906156f8565b60409081015190516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b0385166024820152604401611eaf565b3360008181526007602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516134bc911515815260200190565b60405180910390a35050565b6134d2600161420d565b336000908152601a602052604090205460ff161561352b5760405162461bcd60e51b8152602060048201526016602482015275119c9959481b5a5b9d08185b1c9958591e481d5cd95960521b6044820152606401611ba9565b604080517f710c958037951d9b50974f16f0afd8492e1900938da9bbae1edb078e83a257b7602080830191909152338284015282518083038401815260608301845280519082012061190160f01b60808401527f0000000000000000000000000000000000000000000000000000000000000000608284015260a28084018290528451808503909101815260c2840180865281519184019190912060e2601f8801859004909402850184019095528581529093926000926136099285929091899189918291018382808284376000920191909152506143b292505050565b6012549091506001600160a01b0380831691161461365d5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401611ba9565b336000818152601a60205260409020805460ff191660019081179091556136849190614243565b5050505050565b613693614205565b60006001600160a01b0382163b1561375b576040516301ffc9a760e01b8152600060048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b1580156137235760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa925050508015613753575060408051601f3d908101601f191682019092526137509181019061576e565b60015b1561375b5790505b6001600160a01b03821615801590613771575080155b1561378f576040516332483afb60e01b815260040160405180910390fd5b600a54604080516001600160a01b03928316815291841660208301527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a150600a80546001600160a01b0319166001600160a01b0392909216919091179055565b613804848484611bc3565b6001600160a01b0383163b15612c5b57613820848484846143d6565b612c5b57612c5b6368d2bf6b60e11b613fc1565b6040805160608101825260008082526020820181905291810191909152600a546001600160a01b03161561391b57600a54604051635caaa2a960e11b81523060048201526001600160a01b039091169063b95545529060240160606040518083038186803b1580156138e35760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa1580156138f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228e91906156f8565b50604080516060810182526000808252602082018190529181019190915290565b606061394782613f7c565b6139635760405162461bcd60e51b8152600401611ba990615864565b601354604051639d1facc360e01b8152600481018490526000916001600160a01b031690639d1facc39060240160006040518083038186803b1580156139e65760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa1580156139fa573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613a2291908101906158f8565b60135460405163e1dc076160e01b8152600481018690529192506000916001600160a01b039091169063e1dc07619060240160006040518083038186803b158015613aaa5760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015613abe573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613ae691908101906158f8565b90506000613af38561205c565b905060008184604051602001613b0a92919061597a565b60405160208183030381529060405290506000613b2687614505565b613b2f83614597565b85604051602001613b4293929190615a50565b6040516020818303038152906040529050613b5c81614597565b604051602001613b6c9190615b1e565b60405160208183030381529060405295505050505050919050565b600a546060906001600160a01b03161561229357600a54604051635caaa2a960e11b81523060048201526001600160a01b03909116906317e94a6c90829063b95545529060240160606040518083038186803b158015613c245760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015613c38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c5c91906156f8565b60409081015190516001600160e01b031960e084901b1681526001600160781b0390911660048201526024016121fc565b613c956140c7565b601b54610100900460ff1615613cbe57604051631dbdb68760e11b815260040160405180910390fd5b6001600160a01b038116613d145760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206d6574616461746120636f6e7472616374000000000000006044820152606401611ba9565b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6060604051806060016040528060228152602001615c3860229139905090565b613d5e6140c7565b6001600160a01b038116613dc35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611ba9565b611a7381614277565b613dd4614205565b613ddd8461368b565b604051630368065360e61b81526001600160a01b0385169063da0194c090613e0b90309087906004016158a5565b600060405180830381600087803b158015613e635760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1158015613e77573d6000803e3d6000fd5b5050604051631182550160e11b81526001600160a01b0387169250632304aa029150613ea990309086906004016158c2565b600060405180830381600087803b158015613f015760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1158015613f15573d6000803e3d6000fd5b505060405163235d10c560e21b81526001600160a01b0387169250638d744314915061273d90309085906004016158c2565b60006001600160e01b0319821663152a902d60e11b14806118a957506301ffc9a760e01b6001600160e01b03198316146118a9565b60008054821015613fbc5760005b5060008281526004602052604081205490819003613fb257613fab83615b63565b9250613f8a565b600160e01b161590505b919050565b8060005260046000fd5b6000613fd6836127b3565b9050818015613fee5750336001600160a01b03821614155b1561401157613ffd813361174b565b614011576140116367d9dca160e11b613fc1565b60008381526006602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b6002600d54036140c05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611ba9565b6002600d55565b6009546001600160a01b03163314612cb85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611ba9565b6000818152600460205260409020548060000361419457600054821061415157614151636f96cda160e11b613fc1565b5b5060001901600081815260046020526040902054801561415257600160e01b811660000361417f57919050565b61418f636f96cda160e11b613fc1565b614152565b600160e01b81166000036141a757919050565b613fbc636f96cda160e11b613fc1565b60005b81811015613684576141d685856141d18487615892565b6146f6565b6001016141ba565b60005b81811015613684576141fd85856141f88487615892565b61474c565b6001016141e1565b612cb86140c7565b6108ae8161421a60005490565b6142249190615892565b1115611a7357604051638a164f6360e01b815260040160405180910390fd5b60008054905b8281101561426c576142648461425f8385615892565b614793565b600101614249565b50612057838361481e565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000601454905060008082601554106142fa578260155411156142f65750506015549050600160006142fa565b5060015b826016541061431d57826016541115614319575060029050600061431d565b5060015b60195460ff8381169116141580614343575060195460ff61010090910416151581151514155b156120575760408051808201825260ff841680825283151560209283018190526019805461ffff1916831761010083021790558351918252918101919091527f6a7acb65b222fc6586e5de0c0c03792192c5db534b62071e40e8df664b265e90910160405180910390a1505050565b60008060006143c185856148f3565b915091506143ce81614935565b509392505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061440b903390899088908890600401615b7a565b602060405180830381600087803b1580156144635760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1925050508015614493575060408051601f3d908101601f1916820190925261449091810190615bb7565b60015b6144e8573d8080156144c1576040519150601f19603f3d011682016040523d82523d6000602084013e6144c6565b606091505b5080516000036144e0576144e06368d2bf6b60e11b613fc1565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060600061451283614a7f565b60010190506000816001600160401b0381111561453157614531615423565b6040519080825280601f01601f19166020018201604052801561455b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461456557509392505050565b606081516000036145b657505060408051602081019091526000815290565b6000604051806060016040528060408152602001615bf860409139905060006003845160026145e59190615892565b6145ef91906156e4565b6145fa9060046156b7565b6001600160401b0381111561461157614611615423565b6040519080825280601f01601f19166020018201604052801561463b576020820181803683370190505b50905060018201602082018586518701602081018051600082525b828410156146b1576003840193508351603f8160121c168701518653600186019550603f81600c1c168701518653600186019550603f8160061c168701518653600186019550603f8116870151865350600185019450614656565b90525050855160039006600181146146d057600281146146e3576146eb565b603d6001830353603d60028303536146eb565b603d60018303535b509195945050505050565b6001600160a01b0383811615908316158180156147105750805b1561472e57604051635cbd944160e01b815260040160405180910390fd5b811561473a575b613684565b80614735576136843386868634614b57565b6001600160a01b0383811615908316158180156147665750805b1561478457604051635cbd944160e01b815260040160405180910390fd5b81614735578061473557613684565b6001600160a01b0382166147ba57604051632a485cc960e21b815260040160405180910390fd5b6000818152600c60205260409020546001600160a01b0316156147f057604051633343309b60e01b815260040160405180910390fd5b6000908152600c6020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080549082900361483a5761483a63b562e8dd60e01b613fc1565b61484760008483856141b7565b60008181526004602090815260408083206001600160a01b0387164260a01b6001881460e11b178117909155808452600590925282208054680100000000000000018602019055908190036148a5576148a5622e076360e81b613fc1565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a48181600101915081036148aa5750600090815561205791508483856141de565b60008082516041036149295760208301516040840151606085015160001a61491d87828585614c1a565b94509450505050611d98565b50600090506002611d98565b600081600481111561494957614949614ec5565b036149515750565b600181600481111561496557614965614ec5565b036149b25760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401611ba9565b60028160048111156149c6576149c6614ec5565b03614a135760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401611ba9565b6003816004811115614a2757614a27614ec5565b03611a735760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401611ba9565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310614abe5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614aea576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310614b0857662386f26fc10000830492506010015b6305f5e1008310614b20576305f5e100830492506008015b6127108310614b3457612710830492506004015b60648310614b46576064830492506002015b600a83106118a95760010192915050565b600a546001600160a01b03161561368457600a5460405163050bf71960e31b81526001600160a01b038781166004830152868116602483015285811660448301529091169063285fb8c89060640160006040518083038186803b158015614bfb5760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015614c0f573d6000803e3d6000fd5b505050505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614c515750600090506003614cd5565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614ca5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614cce57600060019250925050614cd5565b9150600090505b94509492505050565b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f6044820152611c9d60f21b6064820152608481fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a20696e76616c6964207475706c65206f666673604482015261195d60f21b6064820152608481fd5b6001600160e01b031981168114611a7357600080fd5b600060208284031215614da957614da9614cde565b8135611b4681614d7e565b60005b83811015614dcf578181015183820152602001614db7565b50506000910152565b60008151808452614df0816020860160208601614db4565b601f01601f19169290920160200192915050565b602081526000611b466020830184614dd8565b600060208284031215614e2c57614e2c614cde565b5035919050565b6001600160a01b0381168114611a7357600080fd5b60008060408385031215614e5e57614e5e614cde565b8235614e6981614e33565b946020939093013593505050565b600080600060608486031215614e8f57614e8f614cde565b8335614e9a81614e33565b92506020840135614eaa81614e33565b91506040840135614eba81614e33565b809150509250925092565b634e487b7160e01b600052602160045260246000fd5b60078110614ef957634e487b7160e01b600052602160045260246000fd5b9052565b602081016118a98284614edb565b600080600060608486031215614f2357614f23614cde565b8335614f2e81614e33565b92506020840135614f3e81614e33565b929592945050506040919091013590565b60008060408385031215614f6557614f65614cde565b50508035926020909101359150565b600060208284031215614f8957614f89614cde565b8135611b4681614e33565b602080825282518282018190526000918401906040840190835b81811015614fd55783516001600160a01b0316835260209384019390920191600101614fae565b509095945050505050565b60405162461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201526a1c9c985e481bd9999cd95d60aa1b6064820152608481fd5b60405162461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201526a0e4e4c2f240d8cadccee8d60ab1b6064820152608481fd5b60405162461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201526a727261792073747269646560a81b6064820152608481fd5b60008083601f84011261510057615100614fe0565b5081356001600160401b0381111561511a5761511a615039565b6020830191508360208260051b8501011115611d9857611d98615092565b6000806020838503121561514e5761514e614cde565b82356001600160401b0381111561516757615167614d2e565b615173858286016150eb565b90969095509350505050565b60078110611a7357600080fd5b6001600160781b0381168114611a7357600080fd5b6000806000606084860312156151b9576151b9614cde565b83356151c48161517f565b925060208401356151d48161518c565b91506040840135614eba8161518c565b600080600080604085870312156151fd576151fd614cde565b84356001600160401b0381111561521657615216614d2e565b615222878288016150eb565b90955093505060208501356001600160401b0381111561524457615244614d2e565b615250878288016150eb565b95989497509550505050565b6000806040838503121561527257615272614cde565b82359150602083013560ff8116811461528a57600080fd5b809150509250929050565b60008083601f8401126152aa576152aa614fe0565b5081356001600160401b038111156152c4576152c4615039565b602083019150836020828501011115611d9857611d98615092565b600080600080606085870312156152f8576152f8614cde565b843561530381614e33565b93506020850135925060408501356001600160401b0381111561532857615328614d2e565b61525087828801615295565b8015158114611a7357600080fd5b60006020828403121561535757615357614cde565b8135611b4681615334565b6000806040838503121561537857615378614cde565b823561538381614e33565b9150602083013561528a81615334565b600080602083850312156153a9576153a9614cde565b82356001600160401b038111156153c2576153c2614d2e565b61517385828601615295565b60405162461bcd60e51b815260206004820152602760248201527f414249206465636f64696e673a20696e76616c69642062797465206172726179604482015266040d8cadccee8d60cb1b6064820152608481fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561546157615461615423565b604052919050565b60006001600160401b0382111561548257615482615423565b50601f01601f191660200190565b600080600080608085870312156154a9576154a9614cde565b84356154b481614e33565b935060208501356154c481614e33565b92506040850135915060608501356001600160401b038111156154e9576154e9614d2e565b8501601f810187136154fd576154fd614fe0565b803561551061550b82615469565b615439565b818152886020838501011115615528576155286153ce565b8160208401602083013760006020838301015280935050505092959194509250565b600060608201905061555d828451614edb565b6001600160781b0360208401511660208301526001600160781b03604084015116604083015292915050565b6000806040838503121561559f5761559f614cde565b82356155aa81614e33565b9150602083013561528a81614e33565b600080600080608085870312156155d3576155d3614cde565b84356155de81614e33565b935060208501356155ee8161517f565b925060408501356155fe8161518c565b9150606085013561560e8161518c565b939692955090935050565b600181811c9082168061562d57607f821691505b60208210810361564d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b602080825282518282018190526000918401906040840190835b81811015614fd5578351835260209384019390920191600101615683565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176118a9576118a96156a1565b634e487b7160e01b600052601260045260246000fd5b6000826156f3576156f36156ce565b500490565b6000606082840312801561570e5761570e614cde565b50604051606081016001600160401b038111828210171561573157615731615423565b604052825161573f8161517f565b8152602083015161574f8161518c565b602082015260408301516157628161518c565b60408201529392505050565b60006020828403121561578357615783614cde565b8151611b4681615334565b818103818111156118a9576118a96156a1565b6000602082840312156157b6576157b6614cde565b81516001600160401b038111156157cf576157cf614d2e565b8201601f810184136157e3576157e3614fe0565b80516001600160401b038111156157fc576157fc615423565b8060051b61580c60208201615439565b9182526020818401810192908101908784111561582b5761582b615092565b6020850194505b83851015615859578451925061584783614e33565b82825260209485019490910190615832565b979650505050505050565b602080825260149082015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b808201808211156118a9576118a96156a1565b6001600160a01b038316815260408101611b466020830184614edb565b6001600160a01b039290921682526001600160781b0316602082015260400190565b6000826158f3576158f36156ce565b500690565b60006020828403121561590d5761590d614cde565b81516001600160401b0381111561592657615926614d2e565b8201601f8101841361593a5761593a614fe0565b805161594861550b82615469565b818152856020838501011115615960576159606153ce565b615971826020830160208601614db4565b95945050505050565b7f3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323081527f30302f737667222076696577426f783d2230203020323034382032303438223e60208201527f3c726563742077696474683d223130302522206865696768743d223130302522604082015266103334b6361e9160c91b606082015260008351615a0e816067850160208801614db4565b6211179f60e91b6067918401918201528351615a3181606a840160208801614db4565b651e17b9bb339f60d11b606a9290910191820152607001949350505050565b737b226e616d65223a2022476f6f62616c6f6f202360601b81528351600090615a80816014850160208901614db4565b7f222c2022696d616765223a2022646174613a696d6167652f7376672b786d6c3b6014918401918201526618985cd94d8d0b60ca1b60348201528451615acd81603b840160208901614db4565b6014818301019150507001116101130ba3a3934b13aba32b9911d1607d1b60278201528351615b03816038840160208801614db4565b607d60f81b6038929091019182015260390195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251615b5681601d850160208701614db4565b91909101601d0192915050565b600081615b7257615b726156a1565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615bad90830184614dd8565b9695505050505050565b600060208284031215615bcc57615bcc614cde565b8151611b4681614d7e56fe45746865722073656e7420746f206e6f6e2d70617961626c652066756e6374694142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f68747470733a2f2f676f6f62616c6f6f2e78797a2f676f6f62616c6f6f2e6a736f6e54617267657420636f6e747261637420646f6573206e6f7420636f6e7461696ea2646970667358221220b3ff3af5b318932d3208b5c30e4d503c68045f1a19a474046e9f9d09bed0bdfc64736f6c634300081c003300000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000004563918244f400000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000721c00d4fb075b22a5469e9cf2440697f729aa130000000000000000000000000000000000000000000000000000000000000008476f6f62616c6f6f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004474f4f4200000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106103975760003560e01c806370a08231116101dc578063b4b5b48f11610102578063d73792a9116100a0578063e985e9c51161006f578063e985e9c5146116f5578063e9c3e26514611779578063f2fde38b146117e8578063fd762d921461184357610397565b8063d73792a9146115a8578063e5187f43146115f9578063e78fba2214611654578063e8a3d485146116a557610397565b8063be537f43116100dc578063be537f431461144f578063c002d23d146114ac578063c87b56dd146114fd578063d007af5c1461155857610397565b8063b4b5b48f146112fc578063b7d0628b14611399578063b88d4fde1461143c57610397565b806395d89b411161017a578063a30b8ed411610149578063a30b8ed41461117a578063a4513e92146111cf578063a9fc664e1461122a578063b4799b421461128557610397565b806395d89b411461101957806399ffbe5f146110695780639d645a44146110c4578063a22cb4651461111f57610397565b80637b19beea116101b65780637b19beea14610f2c57806381ddcc1f14610f3f5780638da5cb5b14610fad57806394d008ef1461100657610397565b806370a0823114610e31578063715018a614610e8c5780637169d83b14610edc57610397565b80633644e515116102c1578063495c8bf91161025f5780636352211e1161022e5780636352211e14610cd157806365ed9b5914610d2c5780636724348214610d865780636c3b869914610de157610397565b8063495c8bf914610b56578063524d60d214610bb35780635d4c1d4614610c0e5780636134716214610c7657610397565b806342842e0e1161029b57806342842e0e14610a2c578063435b424614610a3f57806345c72b1c14610aaa5780634671059f14610afb57610397565b80633644e515146109055780633a602b4d146109745780633ccfd60b146109dc57610397565b806318160ddd1161033957806323b872dd1161030857806323b872dd146107cc5780632a55205a146107df5780632e8da8291461085957806332cb6b0c146108b457610397565b806318160ddd146106665780631b25b077146106c45780631c33b3281461071f5780631e6fc1da1461077c57610397565b8063081812fc11610375578063081812fc14610542578063095ea7b31461059d578063098144d4146105b25780630cc03e7a1461060b57610397565b806301463546146103fc57806301ffc9a71461047a57806306fdde03146104e5575b60405162461bcd60e51b815260206004820152603560248201527f436f6e747261637420646f6573206e6f7420686176652066616c6c6261636b2060448201908152746e6f7220726563656976652066756e6374696f6e7360581b6064830152608482fd5b3480156104435760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061045d71721c310194ccfc01e523fc93c9cccfa2a0ac81565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156104c15760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d56104d0366004614d94565b61189e565b6040519015158152602001610471565b34801561052c5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105356118af565b6040516104719190614e04565b3480156105895760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061045d610598366004614e17565b611941565b6105b06105ab366004614e48565b61197c565b005b3480156105f95760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50600a546001600160a01b031661045d565b3480156106525760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0610661366004614e17565b61198c565b3480156106ad5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50600154600054035b604051908152602001610471565b34801561070b5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d561071a366004614e77565b611a76565b3480156107665760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061076f600181565b6040516104719190614efd565b3480156107c35760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0611b4d565b6105b06107da366004614f0b565b611bc3565b3480156108265760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061083a610835366004614f4f565b611d42565b604080516001600160a01b039093168352602083019190915201610471565b3480156108a05760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d56108af366004614f74565b611d9f565b3480156108fb5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b66108ae81565b34801561094c5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b67f2d7582b363582efc4f1c51a4c73da034d59a891e6471534d85519576dd40af3681565b3480156109bb5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b66109ca366004614f74565b60186020526000908152604090205481565b348015610a235760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0611f45565b6105b0610a3a366004614f0b565b61203c565b348015610a865760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d5610a95366004614f74565b601a6020526000908152604090205460ff1681565b348015610af15760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b660115481565b348015610b425760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610535610b51366004614e17565b61205c565b348015610b9d5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610ba66120fb565b6040516104719190614f94565b348015610bfa5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0610c09366004615138565b6122a6565b348015610c555760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610c5e600181565b6040516001600160781b039091168152602001610471565b348015610cbd5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0610ccc3660046151a1565b61258e565b348015610d185760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061045d610d27366004614e17565b6127b3565b348015610d735760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50601b546104d590610100900460ff1681565b348015610dcd5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0610ddc3660046151e4565b6127be565b348015610e285760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0612aec565b348015610e785760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b6610e87366004614f74565b612c61565b348015610ed35760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0612ca6565b348015610f235760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0612cba565b6105b0610f3a36600461525c565b612d6f565b348015610f865760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b507f00000000000000000000000000000000000000000000000000000000000001f46106b6565b348015610ff45760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506009546001600160a01b031661045d565b6105b06110143660046152df565b612fba565b3480156110605760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610535613310565b3480156110b05760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b06110bf366004615342565b61331f565b34801561110b5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d561111a366004614f74565b61333a565b3480156111665760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0611175366004615362565b61344f565b3480156111c15760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50601b546104d59060ff1681565b3480156112165760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0611225366004615393565b6134c8565b3480156112715760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b0611280366004614f74565b61368b565b3480156112cc5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506019546112e39060ff8082169161010090041682565b6040805160ff9093168352901515602083015201610471565b3480156113435760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061137a611352366004614e17565b600e6020526000908152604090205460ff808216916101008104821691620100009091041683565b6040805193151584529115156020840152151590820152606001610471565b3480156113e05760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506114146014546015546016546017547f00000000000000000000000000000000000000000000000000000000678c4a3994565b604080519586526020860194909452928401919091526060830152608082015260a001610471565b6105b061144a366004615490565b6137f9565b3480156114965760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b5061149f613834565b604051610471919061554a565b3480156114f35760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b6600f5481565b3480156115445760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610535611553366004614e17565b61393c565b34801561159f5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610ba6613b87565b3480156115ef5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b661271081565b3480156116405760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b061164f366004614f74565b613c8d565b34801561169b5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b660105481565b3480156116ec5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b50610535613d36565b34801561173c5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506104d561174b366004615589565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156117c05760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506106b67f00000000000000000000000000000000000000000000000000000000678c4a3981565b34801561182f5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b061183e366004614f74565b613d56565b34801561188a5760405162461bcd60e51b81526020600482015260226024820152600080516020615bd8833981519152604482019081526137b760f11b6064830152608482fd5b506105b06118993660046155ba565b613dcc565b60006118a982613f47565b92915050565b6060600280546118be90615619565b80601f01602080910402602001604051908101604052809291908181526020018280546118ea90615619565b80156119375780601f1061190c57610100808354040283529160200191611937565b820191906000526020600020905b81548152906001019060200180831161191a57829003601f168201915b5050505050905090565b600061194c82613f7c565b611960576119606333d1c03960e21b613fc1565b506000908152600660205260409020546001600160a01b031690565b61198882826001613fcb565b5050565b61199461406e565b6040805160018082528183019092526000916020808301908036833701905050905081816000815181106119ca576119ca615653565b6020908102919091010152604051632926b06960e11b8152309063524d60d2906119f8908490600401615669565b600060405180830381600087803b158015611a505760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1158015611a64573d6000803e3d6000fd5b5050505050611a736001600d55565b50565b600a546000906001600160a01b031615611b4257600a5460405163050bf71960e31b81526001600160a01b038681166004830152858116602483015284811660448301529091169063285fb8c89060640160006040518083038186803b158015611b1d5760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa925050508015611b2e575060015b611b3a57506000611b46565b506001611b46565b5060015b9392505050565b611b556140c7565b6013546001600160a01b0316611bb25760405162461bcd60e51b815260206004820152601960248201527f4d6574616461746120636f6e7472616374206e6f74207365740000000000000060448201526064015b60405180910390fd5b601b805461ff001916610100179055565b6000611bce82614121565b6001600160a01b039485169490915081168414611bf457611bf462a1148160e81b613fc1565b60008281526006602052604090208054338082146001600160a01b03881690911417611c3857611c24863361174b565b611c3857611c38632ce44b5f60e11b613fc1565b611c4586868660016141b7565b8015611c5057600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b84169003611ce257600184016000818152600460205260408120549003611ce0576000548114611ce05760008181526004602052604090208490555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003611d2c57611d2c633a954ecd60e21b613fc1565b611d3987878760016141de565b50505050505050565b6000828152600c602052604081205481906001600160a01b0316612710611d897f00000000000000000000000000000000000000000000000000000000000001f4866156b7565b611d9391906156e4565b915091505b9250929050565b600a546000906001600160a01b031615611f3d57600a54604051635caaa2a960e11b81523060048201526001600160a01b039091169063d72dde5e90829063b95545529060240160606040518083038186803b158015611e3c5760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015611e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e7491906156f8565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b03851660248201526044015b60206040518083038186803b158015611f055760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015611f19573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a9919061576e565b506000919050565b611f4d6140c7565b600060175447611f5d919061578e565b905060008111611fa65760405162461bcd60e51b81526020600482015260146024820152734e6f2066756e647320746f20776974686472617760601b6044820152606401611ba9565b6000336001600160a01b0316826040515b60006040518083038185875af1925050503d8060008114611ff4576040519150601f19603f3d011682016040523d82523d6000602084013e611ff9565b606091505b50509050806119885760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401611ba9565b612057838383604051806020016040528060008152506137f9565b505050565b6000818152600e602052604090205460609060ff166120985750506040805180820190915260078152662330303534666160c81b602082015290565b6000828152600e6020526040902054610100900460ff166120d8576040518060400160405280600781526020016611989b229b211b60c91b8152506118a9565b50506040805180820190915260078152662345463937323960c81b602082015290565b600a546060906001600160a01b03161561229357600a54604051635caaa2a960e11b81523060048201526001600160a01b0390911690633fe5df9990829063b95545529060240160606040518083038186803b1580156121985760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa1580156121ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d091906156f8565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526024015b60006040518083038186803b1580156122525760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015612266573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261228e91908101906157a1565b905090565b5060408051600081526020810190915290565b6122ae61406e565b7f00000000000000000000000000000000000000000000000000000000678c4a394210156122ef57604051638f86c6b360e01b815260040160405180910390fd5b601954610100900460ff16156123185760405163f1b9e4ab60e01b815260040160405180910390fd5b601954600090819060ff16156123455760195460ff1660011461233d57601654612349565b601554612349565b6014545b905060008160175461235b91906156e4565b905060005b848110156124f557600086868381811061237c5761237c615653565b90506020020135905061238e81613f7c565b6123aa5760405162461bcd60e51b8152600401611ba990615864565b336123b4826127b3565b6001600160a01b0316146123fc5760405162461bcd60e51b815260206004820152600f60248201526e2737ba103a37b5b2b71037bbb732b960891b6044820152606401611ba9565b6000818152600e60205260409020805462010000900460ff161561243357604051630c8d9eab60e31b815260040160405180910390fd5b60195460009060ff161561246c57815460ff16801561246757506019548254610100900460ff908116151560029190921614145b612473565b815460ff16155b9050806124cc5760405162461bcd60e51b815260206004820152602160248201527f546f6b656e20646f6573206e6f7420686176652077696e6e696e6720636f6c6f6044820152603960f91b6064820152608401611ba9565b815462ff00001916620100001782556124e58588615892565b9650836001019350505050612360565b50604051600090339085908381818185875af1925050503d8060008114612538576040519150601f19603f3d011682016040523d82523d6000602084013e61253d565b606091505b50509050806125805760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401611ba9565b505050506119886001600d55565b612596614205565b60006125aa600a546001600160a01b031690565b90506001600160a01b0381166125d357604051631cffe3dd60e11b815260040160405180910390fd5b604051630368065360e61b81526001600160a01b0382169063da0194c09061260190309088906004016158a5565b600060405180830381600087803b1580156126595760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af115801561266d573d6000803e3d6000fd5b5050604051631182550160e11b81526001600160a01b0384169250632304aa02915061269f90309087906004016158c2565b600060405180830381600087803b1580156126f75760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af115801561270b573d6000803e3d6000fd5b505060405163235d10c560e21b81526001600160a01b0384169250638d744314915061273d90309086906004016158c2565b600060405180830381600087803b1580156127955760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af11580156127a9573d6000803e3d6000fd5b5050505050505050565b60006118a982614121565b6127c66140c7565b8281146128275760405162461bcd60e51b815260206004820152602960248201527f526563697069656e747320616e64207175616e746974696573206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401611ba9565b6000805b828110156128c957600084848381811061284757612847615653565b905060200201351161289b5760405162461bcd60e51b815260206004820152601f60248201527f5175616e74697479206d7573742062652067726561746572207468616e2030006044820152606401611ba9565b8383828181106128ad576128ad615653565b90506020020135826128bf9190615892565b915060010161282b565b506128d38161420d565b6000816001600160401b038111156128ed576128ed615423565b604051908082528060200260200182016040528015612916578160200160208202803683370190505b5090506000805b868110156129ae5760005b86868381811061293a5761293a615653565b905060200201358110156129a55788888381811061295a5761295a615653565b905060200201602081019061296f9190614f74565b84848151811061298157612981615653565b6001600160a01b039092166020928302919091019091015260019283019201612928565b5060010161291d565b506000600183516129bf919061578e565b90505b8015612ab35760006129d5826001615892565b6040805142602080830191909152448284015260608083018790528351808403909101815260809092019092528051910120612a1191906158e4565b90506000848381518110612a2757612a27615653565b60200260200101519050848281518110612a4357612a43615653565b6020026020010151858481518110612a5d57612a5d615653565b60200260200101906001600160a01b031690816001600160a01b03168152505080858381518110612a9057612a90615653565b6001600160a01b03909216602092830291909101909101525050600019016129c2565b5060005b82518110156127a957612ae4838281518110612ad557612ad5615653565b60200260200101516001614243565b600101612ab7565b612af4614205565b612b0f71721c310194ccfc01e523fc93c9cccfa2a0ac61368b565b604051630368065360e61b815271721c310194ccfc01e523fc93c9cccfa2a0ac9063da0194c090612b479030906001906004016158a5565b600060405180830381600087803b158015612b9f5760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1158015612bb3573d6000803e3d6000fd5b5050604051631182550160e11b815271721c310194ccfc01e523fc93c9cccfa2a0ac9250632304aa029150612bef9030906001906004016158c2565b600060405180830381600087803b158015612c475760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1158015612c5b573d6000803e3d6000fd5b50505050565b60006001600160a01b038216612c8157612c816323d3ad8160e21b613fc1565b506001600160a01b03166000908152600560205260409020546001600160401b031690565b612cae6140c7565b612cb86000614277565b565b612cc26140c7565b7f00000000000000000000000000000000000000000000000000000000678c4a39421080612cf85750601954610100900460ff16155b15612d165760405163d8b4a23360e01b815260040160405180910390fd5b60175480612d5c5760405162461bcd60e51b81526020600482015260136024820152724e6f206665657320746f20776974686472617760681b6044820152606401611ba9565b6000601781905560405133908390611fb7565b612d7882613f7c565b612d945760405162461bcd60e51b8152600401611ba990615864565b33612d9e836127b3565b6001600160a01b031614612de65760405162461bcd60e51b815260206004820152600f60248201526e2737ba103a37b5b2b71037bbb732b960891b6044820152606401611ba9565b7f00000000000000000000000000000000000000000000000000000000678c4a394210612e26576040516308426a3f60e11b815260040160405180910390fd5b6011543414612e775760405162461bcd60e51b815260206004820152601860248201527f496e636f7272656374207061796d656e7420616d6f756e7400000000000000006044820152606401611ba9565b8060ff16600114158015612e8f57508060ff16600214155b15612ead5760405163878814d760e01b815260040160405180910390fd5b6000828152600e60205260409020805460ff83811660021491168015612ee05750815460ff610100909104161515811515145b15612efe57604051633c9588ab60e21b815260040160405180910390fd5b815460ff16612f165760148054600019019055612f3f565b8154610100900460ff1615612f345760168054600019019055612f3f565b601580546000190190555b8015612f5357601680546001019055612f5d565b6015805460010190555b6017805434019055815461ffff191661010082151502176001178255612f816142c9565b6040518481527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a150505050565b612fc261406e565b6000546108ae811061300b5760405162461bcd60e51b815260206004820152601260248201527113585e081cdd5c1c1b1e481c995858da195960721b6044820152606401611ba9565b6000613019826108ae61578e565b33600090815260186020526040812054601054929350909161303b919061578e565b9050600081116130825760405162461bcd60e51b81526020600482015260126024820152714e6f206d696e74732072656d61696e696e6760701b6044820152606401611ba9565b858181111561308e5750805b828111156130995750815b601b5460ff16156131da57604080517f0bbb78faec1ba872c3f2bca4b11ae7050bb6600ff726df7975aa912ad6f29d50602080830191909152338284015282518083038401815260608301845280519082012061190160f01b60808401527f2d7582b363582efc4f1c51a4c73da034d59a891e6471534d85519576dd40af36608284015260a28084018290528451808503909101815260c2840180865281519184019190912060e2601f8c018590049094028501840190955289815290939260009261318292859290918d918d918291018382808284376000920191909152506143b292505050565b6012549091506001600160a01b038083169116146131d65760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401611ba9565b5050505b600081600f546131ea91906156b7565b9050803410156132335760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b6044820152606401611ba9565b600061323f823461578e565b905080156132d157604051600090339083908381818185875af1925050503d8060008114613289576040519150601f19603f3d011682016040523d82523d6000602084013e61328e565b606091505b50509050806132cf5760405162461bcd60e51b815260206004820152600d60248201526c1499599d5b990819985a5b1959609a1b6044820152606401611ba9565b505b33600090815260186020526040812080548592906132f0908490615892565b9091555061330090508a84614243565b505050505050612c5b6001600d55565b6060600380546118be90615619565b6133276140c7565b601b805460ff1916911515919091179055565b600a546000906001600160a01b031615611f3d57600a54604051635caaa2a960e11b81523060048201526001600160a01b0390911690639445f53090829063b95545529060240160606040518083038186803b1580156133d75760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa1580156133eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061340f91906156f8565b60409081015190516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b0385166024820152604401611eaf565b3360008181526007602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516134bc911515815260200190565b60405180910390a35050565b6134d2600161420d565b336000908152601a602052604090205460ff161561352b5760405162461bcd60e51b8152602060048201526016602482015275119c9959481b5a5b9d08185b1c9958591e481d5cd95960521b6044820152606401611ba9565b604080517f710c958037951d9b50974f16f0afd8492e1900938da9bbae1edb078e83a257b7602080830191909152338284015282518083038401815260608301845280519082012061190160f01b60808401527f2d7582b363582efc4f1c51a4c73da034d59a891e6471534d85519576dd40af36608284015260a28084018290528451808503909101815260c2840180865281519184019190912060e2601f8801859004909402850184019095528581529093926000926136099285929091899189918291018382808284376000920191909152506143b292505050565b6012549091506001600160a01b0380831691161461365d5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401611ba9565b336000818152601a60205260409020805460ff191660019081179091556136849190614243565b5050505050565b613693614205565b60006001600160a01b0382163b1561375b576040516301ffc9a760e01b8152600060048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b1580156137235760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa925050508015613753575060408051601f3d908101601f191682019092526137509181019061576e565b60015b1561375b5790505b6001600160a01b03821615801590613771575080155b1561378f576040516332483afb60e01b815260040160405180910390fd5b600a54604080516001600160a01b03928316815291841660208301527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a150600a80546001600160a01b0319166001600160a01b0392909216919091179055565b613804848484611bc3565b6001600160a01b0383163b15612c5b57613820848484846143d6565b612c5b57612c5b6368d2bf6b60e11b613fc1565b6040805160608101825260008082526020820181905291810191909152600a546001600160a01b03161561391b57600a54604051635caaa2a960e11b81523060048201526001600160a01b039091169063b95545529060240160606040518083038186803b1580156138e35760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa1580156138f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228e91906156f8565b50604080516060810182526000808252602082018190529181019190915290565b606061394782613f7c565b6139635760405162461bcd60e51b8152600401611ba990615864565b601354604051639d1facc360e01b8152600481018490526000916001600160a01b031690639d1facc39060240160006040518083038186803b1580156139e65760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa1580156139fa573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613a2291908101906158f8565b60135460405163e1dc076160e01b8152600481018690529192506000916001600160a01b039091169063e1dc07619060240160006040518083038186803b158015613aaa5760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015613abe573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613ae691908101906158f8565b90506000613af38561205c565b905060008184604051602001613b0a92919061597a565b60405160208183030381529060405290506000613b2687614505565b613b2f83614597565b85604051602001613b4293929190615a50565b6040516020818303038152906040529050613b5c81614597565b604051602001613b6c9190615b1e565b60405160208183030381529060405295505050505050919050565b600a546060906001600160a01b03161561229357600a54604051635caaa2a960e11b81523060048201526001600160a01b03909116906317e94a6c90829063b95545529060240160606040518083038186803b158015613c245760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015613c38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c5c91906156f8565b60409081015190516001600160e01b031960e084901b1681526001600160781b0390911660048201526024016121fc565b613c956140c7565b601b54610100900460ff1615613cbe57604051631dbdb68760e11b815260040160405180910390fd5b6001600160a01b038116613d145760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206d6574616461746120636f6e7472616374000000000000006044820152606401611ba9565b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6060604051806060016040528060228152602001615c3860229139905090565b613d5e6140c7565b6001600160a01b038116613dc35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611ba9565b611a7381614277565b613dd4614205565b613ddd8461368b565b604051630368065360e61b81526001600160a01b0385169063da0194c090613e0b90309087906004016158a5565b600060405180830381600087803b158015613e635760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1158015613e77573d6000803e3d6000fd5b5050604051631182550160e11b81526001600160a01b0387169250632304aa029150613ea990309086906004016158c2565b600060405180830381600087803b158015613f015760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1158015613f15573d6000803e3d6000fd5b505060405163235d10c560e21b81526001600160a01b0387169250638d744314915061273d90309085906004016158c2565b60006001600160e01b0319821663152a902d60e11b14806118a957506301ffc9a760e01b6001600160e01b03198316146118a9565b60008054821015613fbc5760005b5060008281526004602052604081205490819003613fb257613fab83615b63565b9250613f8a565b600160e01b161590505b919050565b8060005260046000fd5b6000613fd6836127b3565b9050818015613fee5750336001600160a01b03821614155b1561401157613ffd813361174b565b614011576140116367d9dca160e11b613fc1565b60008381526006602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b6002600d54036140c05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611ba9565b6002600d55565b6009546001600160a01b03163314612cb85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611ba9565b6000818152600460205260409020548060000361419457600054821061415157614151636f96cda160e11b613fc1565b5b5060001901600081815260046020526040902054801561415257600160e01b811660000361417f57919050565b61418f636f96cda160e11b613fc1565b614152565b600160e01b81166000036141a757919050565b613fbc636f96cda160e11b613fc1565b60005b81811015613684576141d685856141d18487615892565b6146f6565b6001016141ba565b60005b81811015613684576141fd85856141f88487615892565b61474c565b6001016141e1565b612cb86140c7565b6108ae8161421a60005490565b6142249190615892565b1115611a7357604051638a164f6360e01b815260040160405180910390fd5b60008054905b8281101561426c576142648461425f8385615892565b614793565b600101614249565b50612057838361481e565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000601454905060008082601554106142fa578260155411156142f65750506015549050600160006142fa565b5060015b826016541061431d57826016541115614319575060029050600061431d565b5060015b60195460ff8381169116141580614343575060195460ff61010090910416151581151514155b156120575760408051808201825260ff841680825283151560209283018190526019805461ffff1916831761010083021790558351918252918101919091527f6a7acb65b222fc6586e5de0c0c03792192c5db534b62071e40e8df664b265e90910160405180910390a1505050565b60008060006143c185856148f3565b915091506143ce81614935565b509392505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061440b903390899088908890600401615b7a565b602060405180830381600087803b1580156144635760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505af1925050508015614493575060408051601f3d908101601f1916820190925261449091810190615bb7565b60015b6144e8573d8080156144c1576040519150601f19603f3d011682016040523d82523d6000602084013e6144c6565b606091505b5080516000036144e0576144e06368d2bf6b60e11b613fc1565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060600061451283614a7f565b60010190506000816001600160401b0381111561453157614531615423565b6040519080825280601f01601f19166020018201604052801561455b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461456557509392505050565b606081516000036145b657505060408051602081019091526000815290565b6000604051806060016040528060408152602001615bf860409139905060006003845160026145e59190615892565b6145ef91906156e4565b6145fa9060046156b7565b6001600160401b0381111561461157614611615423565b6040519080825280601f01601f19166020018201604052801561463b576020820181803683370190505b50905060018201602082018586518701602081018051600082525b828410156146b1576003840193508351603f8160121c168701518653600186019550603f81600c1c168701518653600186019550603f8160061c168701518653600186019550603f8116870151865350600185019450614656565b90525050855160039006600181146146d057600281146146e3576146eb565b603d6001830353603d60028303536146eb565b603d60018303535b509195945050505050565b6001600160a01b0383811615908316158180156147105750805b1561472e57604051635cbd944160e01b815260040160405180910390fd5b811561473a575b613684565b80614735576136843386868634614b57565b6001600160a01b0383811615908316158180156147665750805b1561478457604051635cbd944160e01b815260040160405180910390fd5b81614735578061473557613684565b6001600160a01b0382166147ba57604051632a485cc960e21b815260040160405180910390fd5b6000818152600c60205260409020546001600160a01b0316156147f057604051633343309b60e01b815260040160405180910390fd5b6000908152600c6020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080549082900361483a5761483a63b562e8dd60e01b613fc1565b61484760008483856141b7565b60008181526004602090815260408083206001600160a01b0387164260a01b6001881460e11b178117909155808452600590925282208054680100000000000000018602019055908190036148a5576148a5622e076360e81b613fc1565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a48181600101915081036148aa5750600090815561205791508483856141de565b60008082516041036149295760208301516040840151606085015160001a61491d87828585614c1a565b94509450505050611d98565b50600090506002611d98565b600081600481111561494957614949614ec5565b036149515750565b600181600481111561496557614965614ec5565b036149b25760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401611ba9565b60028160048111156149c6576149c6614ec5565b03614a135760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401611ba9565b6003816004811115614a2757614a27614ec5565b03611a735760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401611ba9565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310614abe5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614aea576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310614b0857662386f26fc10000830492506010015b6305f5e1008310614b20576305f5e100830492506008015b6127108310614b3457612710830492506004015b60648310614b46576064830492506002015b600a83106118a95760010192915050565b600a546001600160a01b03161561368457600a5460405163050bf71960e31b81526001600160a01b038781166004830152868116602483015285811660448301529091169063285fb8c89060640160006040518083038186803b158015614bfb5760405162461bcd60e51b81526020600482015260256024820152600080516020615c5a833981519152604482019081526420636f646560d81b6064830152608482fd5b505afa158015614c0f573d6000803e3d6000fd5b505050505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614c515750600090506003614cd5565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614ca5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614cce57600060019250925050614cd5565b9150600090505b94509492505050565b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f6044820152611c9d60f21b6064820152608481fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a20696e76616c6964207475706c65206f666673604482015261195d60f21b6064820152608481fd5b6001600160e01b031981168114611a7357600080fd5b600060208284031215614da957614da9614cde565b8135611b4681614d7e565b60005b83811015614dcf578181015183820152602001614db7565b50506000910152565b60008151808452614df0816020860160208601614db4565b601f01601f19169290920160200192915050565b602081526000611b466020830184614dd8565b600060208284031215614e2c57614e2c614cde565b5035919050565b6001600160a01b0381168114611a7357600080fd5b60008060408385031215614e5e57614e5e614cde565b8235614e6981614e33565b946020939093013593505050565b600080600060608486031215614e8f57614e8f614cde565b8335614e9a81614e33565b92506020840135614eaa81614e33565b91506040840135614eba81614e33565b809150509250925092565b634e487b7160e01b600052602160045260246000fd5b60078110614ef957634e487b7160e01b600052602160045260246000fd5b9052565b602081016118a98284614edb565b600080600060608486031215614f2357614f23614cde565b8335614f2e81614e33565b92506020840135614f3e81614e33565b929592945050506040919091013590565b60008060408385031215614f6557614f65614cde565b50508035926020909101359150565b600060208284031215614f8957614f89614cde565b8135611b4681614e33565b602080825282518282018190526000918401906040840190835b81811015614fd55783516001600160a01b0316835260209384019390920191600101614fae565b509095945050505050565b60405162461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201526a1c9c985e481bd9999cd95d60aa1b6064820152608481fd5b60405162461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201526a0e4e4c2f240d8cadccee8d60ab1b6064820152608481fd5b60405162461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201526a727261792073747269646560a81b6064820152608481fd5b60008083601f84011261510057615100614fe0565b5081356001600160401b0381111561511a5761511a615039565b6020830191508360208260051b8501011115611d9857611d98615092565b6000806020838503121561514e5761514e614cde565b82356001600160401b0381111561516757615167614d2e565b615173858286016150eb565b90969095509350505050565b60078110611a7357600080fd5b6001600160781b0381168114611a7357600080fd5b6000806000606084860312156151b9576151b9614cde565b83356151c48161517f565b925060208401356151d48161518c565b91506040840135614eba8161518c565b600080600080604085870312156151fd576151fd614cde565b84356001600160401b0381111561521657615216614d2e565b615222878288016150eb565b90955093505060208501356001600160401b0381111561524457615244614d2e565b615250878288016150eb565b95989497509550505050565b6000806040838503121561527257615272614cde565b82359150602083013560ff8116811461528a57600080fd5b809150509250929050565b60008083601f8401126152aa576152aa614fe0565b5081356001600160401b038111156152c4576152c4615039565b602083019150836020828501011115611d9857611d98615092565b600080600080606085870312156152f8576152f8614cde565b843561530381614e33565b93506020850135925060408501356001600160401b0381111561532857615328614d2e565b61525087828801615295565b8015158114611a7357600080fd5b60006020828403121561535757615357614cde565b8135611b4681615334565b6000806040838503121561537857615378614cde565b823561538381614e33565b9150602083013561528a81615334565b600080602083850312156153a9576153a9614cde565b82356001600160401b038111156153c2576153c2614d2e565b61517385828601615295565b60405162461bcd60e51b815260206004820152602760248201527f414249206465636f64696e673a20696e76616c69642062797465206172726179604482015266040d8cadccee8d60cb1b6064820152608481fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561546157615461615423565b604052919050565b60006001600160401b0382111561548257615482615423565b50601f01601f191660200190565b600080600080608085870312156154a9576154a9614cde565b84356154b481614e33565b935060208501356154c481614e33565b92506040850135915060608501356001600160401b038111156154e9576154e9614d2e565b8501601f810187136154fd576154fd614fe0565b803561551061550b82615469565b615439565b818152886020838501011115615528576155286153ce565b8160208401602083013760006020838301015280935050505092959194509250565b600060608201905061555d828451614edb565b6001600160781b0360208401511660208301526001600160781b03604084015116604083015292915050565b6000806040838503121561559f5761559f614cde565b82356155aa81614e33565b9150602083013561528a81614e33565b600080600080608085870312156155d3576155d3614cde565b84356155de81614e33565b935060208501356155ee8161517f565b925060408501356155fe8161518c565b9150606085013561560e8161518c565b939692955090935050565b600181811c9082168061562d57607f821691505b60208210810361564d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b602080825282518282018190526000918401906040840190835b81811015614fd5578351835260209384019390920191600101615683565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176118a9576118a96156a1565b634e487b7160e01b600052601260045260246000fd5b6000826156f3576156f36156ce565b500490565b6000606082840312801561570e5761570e614cde565b50604051606081016001600160401b038111828210171561573157615731615423565b604052825161573f8161517f565b8152602083015161574f8161518c565b602082015260408301516157628161518c565b60408201529392505050565b60006020828403121561578357615783614cde565b8151611b4681615334565b818103818111156118a9576118a96156a1565b6000602082840312156157b6576157b6614cde565b81516001600160401b038111156157cf576157cf614d2e565b8201601f810184136157e3576157e3614fe0565b80516001600160401b038111156157fc576157fc615423565b8060051b61580c60208201615439565b9182526020818401810192908101908784111561582b5761582b615092565b6020850194505b83851015615859578451925061584783614e33565b82825260209485019490910190615832565b979650505050505050565b602080825260149082015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b808201808211156118a9576118a96156a1565b6001600160a01b038316815260408101611b466020830184614edb565b6001600160a01b039290921682526001600160781b0316602082015260400190565b6000826158f3576158f36156ce565b500690565b60006020828403121561590d5761590d614cde565b81516001600160401b0381111561592657615926614d2e565b8201601f8101841361593a5761593a614fe0565b805161594861550b82615469565b818152856020838501011115615960576159606153ce565b615971826020830160208601614db4565b95945050505050565b7f3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323081527f30302f737667222076696577426f783d2230203020323034382032303438223e60208201527f3c726563742077696474683d223130302522206865696768743d223130302522604082015266103334b6361e9160c91b606082015260008351615a0e816067850160208801614db4565b6211179f60e91b6067918401918201528351615a3181606a840160208801614db4565b651e17b9bb339f60d11b606a9290910191820152607001949350505050565b737b226e616d65223a2022476f6f62616c6f6f202360601b81528351600090615a80816014850160208901614db4565b7f222c2022696d616765223a2022646174613a696d6167652f7376672b786d6c3b6014918401918201526618985cd94d8d0b60ca1b60348201528451615acd81603b840160208901614db4565b6014818301019150507001116101130ba3a3934b13aba32b9911d1607d1b60278201528351615b03816038840160208801614db4565b607d60f81b6038929091019182015260390195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251615b5681601d850160208701614db4565b91909101601d0192915050565b600081615b7257615b726156a1565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615bad90830184614dd8565b9695505050505050565b600060208284031215615bcc57615bcc614cde565b8151611b4681614d7e56fe45746865722073656e7420746f206e6f6e2d70617961626c652066756e6374694142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f68747470733a2f2f676f6f62616c6f6f2e78797a2f676f6f62616c6f6f2e6a736f6e54617267657420636f6e747261637420646f6573206e6f7420636f6e7461696ea2646970667358221220b3ff3af5b318932d3208b5c30e4d503c68045f1a19a474046e9f9d09bed0bdfc64736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000004563918244f400000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000721c00d4fb075b22a5469e9cf2440697f729aa130000000000000000000000000000000000000000000000000000000000000008476f6f62616c6f6f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004474f4f4200000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : royaltyFeeNumerator_ (uint256): 500
Arg [1] : name_ (string): Goobaloo
Arg [2] : symbol_ (string): GOOB
Arg [3] : mintPrice_ (uint256): 5000000000000000000
Arg [4] : maxMintsPerWallet_ (uint256): 5
Arg [5] : colorChangePrice_ (uint256): 100000000000000000
Arg [6] : transferValidator_ (address): 0x721C00D4FB075b22a5469e9CF2440697F729aA13
-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [3] : 0000000000000000000000000000000000000000000000004563918244f40000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [5] : 000000000000000000000000000000000000000000000000016345785d8a0000
Arg [6] : 000000000000000000000000721c00d4fb075b22a5469e9cf2440697f729aa13
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [8] : 476f6f62616c6f6f000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [10] : 474f4f4200000000000000000000000000000000000000000000000000000000
[ 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.