NFT
Overview
TokenID
5697
Total Transfers
-
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Pepemigos
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Unlicensed pragma solidity >=0.8.0 < 0.9.0; /************************************************* ⠀⠀⢀⣠⠤⠶⠖⠒⠒⠶⠦⠤⣄⠀⠀⠀⣀⡤⠤⠤⠤⠤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⣴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⣦⠞⠁⠀⠀⠀⠀⠀⠀⠉⠳⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⡾⠁⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⣀⣘⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⢀⡴⠚⠉⠁⠀⠀⠀⠀⠈⠉⠙⠲⣄⣤⠤⠶⠒⠒⠲⠦⢤⣜⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⡄⠀⠀⠀⠀⠀⠀⠀⠉⠳⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⠹⣆⠀⠀⠀⠀⠀⠀⣀⣀⣀⣹⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⣠⠞⣉⣡⠤⠴⠿⠗⠳⠶⣬⣙⠓⢦⡈⠙⢿⡀⠀⠀⢀⣼⣿⣿⣿⣿⣿⡿⣷⣤⡀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⣾⣡⠞⣁⣀⣀⣀⣠⣤⣤⣤⣄⣭⣷⣦⣽⣦⡀⢻⡄⠰⢟⣥⣾⣿⣏⣉⡙⠓⢦⣻⠃⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠉⠉⠙⠻⢤⣄⣼⣿⣽⣿⠟⠻⣿⠄⠀⠀⢻⡝⢿⡇⣠⣿⣿⣻⣿⠿⣿⡉⠓⠮⣿⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠙⢦⡈⠛⠿⣾⣿⣶⣾⡿⠀⠀⠀⢀⣳⣘⢻⣇⣿⣿⣽⣿⣶⣾⠃⣀⡴⣿⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠙⠲⠤⢄⣈⣉⣙⣓⣒⣒⣚⣉⣥⠟⠀⢯⣉⡉⠉⠉⠛⢉⣉⣡⡾⠁⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⣠⣤⡤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢈⡿⠋⠀⠀⠀⠀⠈⠻⣍⠉⠀⠺⠿⠋⠙⣦⠀⠀⠀⠀⠀⠀⠀ ⠀⣀⣥⣤⠴⠆⠀⠀⠀⠀⠀⠀⠀⣀⣠⠤⠖⠋⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⠀⠀⠀⠀⠀⢸⣧⠀⠀⠀⠀⠀⠀ ⠸⢫⡟⠙⣛⠲⠤⣄⣀⣀⠀⠈⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠏⣨⠇⠀⠀⠀⠀⠀ ⠀⠀⠻⢦⣈⠓⠶⠤⣄⣉⠉⠉⠛⠒⠲⠦⠤⠤⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣠⠴⢋⡴⠋⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠉⠓⠦⣄⡀⠈⠙⠓⠒⠶⠶⠶⠶⠤⣤⣀⣀⣀⣀⣀⣉⣉⣉⣉⣉⣀⣠⠴⠋⣿⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠉⠓⠦⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡼⠁⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠙⠛⠒⠒⠒⠒⠒⠤⠤⠤⠒⠒⠒⠒⠒⠒⠚⢉⡇⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠴⠚⠛⠳⣤⠞⠁⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⠚⠁⠀⠀⠀⠀⠘⠲⣄⡀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⠋⠙⢷⡋⢙⡇⢀⡴⢒⡿⢶⣄⡴⠀⠙⠳⣄⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠈⠛⢻⠛⢉⡴⣋⡴⠟⠁⠀⠀⠀⠀⠈⢧⡀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡄⠀⠘⣶⢋⡞⠁⠀⠀⢀⡴⠂⠀⠀⠀⠀⠹⣄⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠈⠻⢦⡀⠀⣰⠏⠀⠀⢀⡴⠃⢀⡄⠙⣆⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⡾⢷⡄⠀⠀⠀⠀⠉⠙⠯⠀⠀⡴⠋⠀⢠⠟⠀⠀⢹⡄ ____ ____ ____ ____ ______ ____ _____ ____ /\ _`\ /\ _`\ /\ _`\ /\ _`\ /'\_/`\/\__ _\/\ _`\ /\ __`\/\ _`\ \ \ \L\ \ \ \L\_\ \ \L\ \ \ \L\_\/\ \/_/\ \/\ \ \L\_\ \ \/\ \ \,\L\_\ \ \ ,__/\ \ _\L\ \ ,__/\ \ _\L\ \ \__\ \ \ \ \ \ \ \L_L\ \ \ \ \/_\__ \ \ \ \/ \ \ \L\ \ \ \/ \ \ \L\ \ \ \_/\ \ \_\ \_\ \ \/, \ \ \_\ \/\ \L\ \ \ \_\ \ \____/\ \_\ \ \____/\ \_\\ \_\/\_____\ \____/\ \_____\ `\____\ \/_/ \/___/ \/_/ \/___/ \/_/ \/_/\/_____/\/___/ \/_____/\/_____/ **************************************************/ import "operator-filter-registry/src/DefaultOperatorFilterer.sol"; import "erc721a/contracts/extensions/ERC721AQueryable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import '@openzeppelin/contracts/utils/Strings.sol'; /** * @notice error declaration */ error decreaseNotAllowed(uint256 quantity, uint256 maxSupply); error notEnoughFunds(uint256 payableValue, uint256 required); error maxSupplyExceeded(uint256 quantity, uint256 maxSupply); error notWhitelisted(address minter, bytes32 root); error whitelistSupplyExceeded(uint256 quantity, uint256 maxWhitelistSupply); error transferFailed(address from, address to, uint256 quantity); error maxPerTxExceeded(uint256 quantity, uint256 maxPerTx); error maxPerWalletExceeded(uint256 quantity, uint256 maxPerWallet); error nonExistentToken(uint256 tokenId); error mintNotStartedYet(); error notTokenOwner(); error noTokensFound(address sender); error notEnoughPepesBurned(address sender, uint256 currentCount, uint256 requiredCount); error burnIsDisabled(); contract Pepemigos is DefaultOperatorFilterer, ERC721AQueryable, Ownable, ReentrancyGuard { event BurnedSingle(address burner, uint256 tokenId, uint256 timestamp); event BurnedMultiple(address burner, uint256[] tokenIds, uint256 timestamp); event BtcAddressSet(address setter, string btcAddr, uint256 timestamp); using Strings for uint256; /** * @notice Token and sale related variables. */ uint256 public maxSupply = 6969; uint256 public maxWhitelistSupply = 2000; uint256 public whitelistSupply; uint256 public publicPrice = 0.0036 ether; uint256 public whitelistPrice = 0 ether; bool public publicSaleActive = false; bool public whitelistSaleActive = false; bytes32 public merkleRoot; string public baseURI = ""; string public hiddenURI = "ipfs://QmQ2XMRdxNDFZMUtChmp6oCDLfcU1tE4GioC1fbMMYoN5R/"; string public uriSuffix = ".json"; bool public revealed = false; bool public burnActive = true; uint256 public publicMaxPerTx = 3; uint256 public whitelistMaxPerTx = 1; uint256 public publicMaxPerWallet = 3; uint256 public whitelistMaxPerWallet = 1; uint256 public pepesForBTCRequired = 4; struct userToken { uint256 id; string uri; } struct HolderClaim { uint256 publicClaimed; uint256 whitelistClaimed; } struct holderBTC { uint256 recordedIndex; string BTCAddress; } struct burnEntry { address burner; uint256 count; string btcAddress; } struct btcEntry { address claimedBy; string btcAddress; } uint256 public burnerAddressCount; uint256 public btcAddressCount; mapping(address => holderBTC) public holderBTCAddress; mapping(uint256 => address) public btcClaimedIndex; mapping(address => HolderClaim) public holderClaimed; mapping(uint256 => address) public getBurnerAddress; /** * @notice Validates the minting process by ensuring that the buyer has enough funds, * the max supply is not exceeded, and the user's maximum per-transaction and * per-wallet limits are not exceeded. * @param maxPerTx The maximum quantity of tokens that can be purchased in a single transaction. * @param maxPerWallet The maximum quantity of tokens that a user can hold. * @param quantity The quantity of tokens being purchased. * @param price The price of a single token. * @param userClaimed The total quantity of tokens that the user has already claimed. */ modifier validateMint(uint256 maxPerTx, uint256 maxPerWallet, uint256 quantity, uint256 price, uint256 userClaimed) { uint256 priceCalculated = price * quantity; uint256 userSupplyCalculated = totalSupply() + balanceOf(msg.sender) + quantity; uint256 userWalletCalculated = userClaimed + quantity; if (msg.value < priceCalculated) { revert notEnoughFunds(msg.value, priceCalculated); } if (userSupplyCalculated > maxSupply) { revert maxSupplyExceeded(userSupplyCalculated, maxSupply); } if (quantity > maxPerTx) { revert maxPerTxExceeded(quantity, maxPerTx); } if (userWalletCalculated > maxPerWallet) { revert maxPerWalletExceeded(userWalletCalculated, maxPerWallet); } _; } constructor() ERC721A("Pepemigos", "PPMGS") { /** @dev Team mint 69 tokens */ mintOwner(msg.sender, 69); } /** * @notice Mint new tokens to the caller's address. * @param quantity The amount of tokens to mint. */ function mintPublic(uint256 quantity) public payable validateMint( publicMaxPerTx, publicMaxPerWallet, quantity, publicPrice, holderClaimed[msg.sender].publicClaimed ) { if (!publicSaleActive) { revert mintNotStartedYet(); } _mint(msg.sender, quantity); unchecked { holderClaimed[msg.sender].publicClaimed += quantity; } } /** * @notice Mint new tokens to the caller's address, but only if they are whitelisted. * @param quantity The amount of tokens to mint. * @param proof The Merkle proof that verifies the caller's address is whitelisted. */ function mintWhitelist(uint256 quantity, bytes32[] calldata proof) public payable validateMint( whitelistMaxPerTx, whitelistMaxPerWallet, quantity, whitelistPrice, holderClaimed[msg.sender].whitelistClaimed ) { if (!whitelistSaleActive) { revert mintNotStartedYet(); } uint256 whitelistCalculated = whitelistSupply + quantity; if (whitelistCalculated > maxWhitelistSupply) { revert whitelistSupplyExceeded(whitelistCalculated, maxWhitelistSupply); } (bool verify) = MerkleProof.verify(proof, merkleRoot, keccak256(abi.encodePacked(msg.sender))); if (!verify) { revert notWhitelisted(msg.sender, merkleRoot); } _mint(msg.sender, quantity); unchecked { whitelistSupply += quantity; holderClaimed[msg.sender].whitelistClaimed += quantity; } } /** * @notice Mint new tokens to the specified address, but only the contract owner can call this function. * @param to The address to mint the tokens to. * @param quantity The amount of tokens to mint. */ function mintOwner(address to, uint256 quantity) public onlyOwner { _mint(to, quantity); } function burn(uint256 tokenId) public { if (!burnActive) { revert burnIsDisabled(); } if (ownerOf(tokenId) != msg.sender) { revert notTokenOwner(); } if (getBurnedCount(msg.sender) == 0) { burnerAddressCount++; getBurnerAddress[burnerAddressCount] = msg.sender; } _burn(tokenId, true); emit BurnedSingle(msg.sender, tokenId, block.timestamp); } function burnMultiple(uint256[] memory tokenIds) public { if (!burnActive) { revert burnIsDisabled(); } if (getBurnedCount(msg.sender) == 0) { burnerAddressCount++; getBurnerAddress[burnerAddressCount] = msg.sender; } for (uint256 index = 0; index < tokenIds.length; index++) { if (ownerOf(tokenIds[index]) != msg.sender) { revert notTokenOwner(); } _burn(tokenIds[index], true); } emit BurnedMultiple(msg.sender, tokenIds, block.timestamp); } function burnedSupply() public view returns (uint256) { return _totalBurned(); } function getBurnedCount(address ownerAddress) public view returns (uint256) { return _numberBurned(ownerAddress); } function setBTCAddress(string memory btcAddr) public { uint256 count = getBurnedCount(msg.sender); if (count >= pepesForBTCRequired) { lockInAddress(msg.sender, btcAddr); emit BtcAddressSet(msg.sender, btcAddr, block.timestamp); } else { revert notEnoughPepesBurned(msg.sender, count, pepesForBTCRequired); } } function lockInAddress(address to, string memory addr) internal { if (holderBTCAddress[to].recordedIndex > 0) { btcClaimedIndex[holderBTCAddress[to].recordedIndex] = to; holderBTCAddress[to].BTCAddress = addr; } else { btcAddressCount++; btcClaimedIndex[btcAddressCount] = to; holderBTCAddress[to] = holderBTC({ recordedIndex: btcAddressCount, BTCAddress: addr }); } } /** * @notice Returns the URI for a given token. This function is an override of the tokenURI function in ERC721A. * @param tokenId The token ID to retrieve the URI for. * @return string A string representing the URI for the given token. */ function tokenURI(uint256 tokenId) public view override(IERC721A, ERC721A) returns (string memory) { if (!_exists(tokenId)) { revert nonExistentToken(tokenId); } return revealed ? bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString(), uriSuffix)) : '' : hiddenURI; } /** * @notice Gets an array of all the tokens and tokenURIs owned by a given address. Suitable for off chain calls. * @param ownerAddress The address of the owner to query * @return tokens An array of userToken structs representing each token owned by the given address * Each userToken struct contains the following fields: * id: The unique identifier of the token * uri: The URI for the token metadata */ function getUserTokens(address ownerAddress) external view virtual returns (userToken[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(ownerAddress); userToken[] memory tokens = new userToken[](tokenIdsLength); TokenOwnership memory ownership; for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == ownerAddress) { tokens[tokenIdsIdx] = userToken({ id: i, uri: tokenURI(i) }); tokenIdsIdx++; } } return tokens; } } function getBurners() external view virtual returns (burnEntry[] memory) { unchecked { uint256 burnAddrId; burnEntry[] memory burnBoard = new burnEntry[](burnerAddressCount); for (uint256 i = 1; i <= burnerAddressCount; ++i) { address burnerAddress = getBurnerAddress[i]; burnBoard[burnAddrId] = burnEntry({ burner: burnerAddress, count: getBurnedCount(burnerAddress), btcAddress: holderBTCAddress[burnerAddress].BTCAddress }); burnAddrId++; } return burnBoard; } } function getBTCAddresses() external view virtual returns (btcEntry[] memory) { unchecked { uint256 burnAddrId; btcEntry[] memory btcBoard = new btcEntry[](btcAddressCount); for (uint256 i = 1; i <= btcAddressCount; ++i) { address btcAddressOwner = btcClaimedIndex[i]; btcBoard[burnAddrId] = btcEntry({ claimedBy: btcAddressOwner, btcAddress: holderBTCAddress[btcAddressOwner].BTCAddress }); burnAddrId++; } return btcBoard; } } /** * @notice Set the maximum supply of tokens that can be minted. * The function can only increase max supply. * @param supply The new maximum supply. */ function setMaxSupply(uint256 supply) public onlyOwner { if (supply < maxSupply) { revert decreaseNotAllowed(supply, maxSupply); } maxSupply = supply; } /** * @notice Set the maximum supply of tokens that can be minted through the whitelist. * @param supply The new maximum whitelist supply. */ function setMaxWhitelistSupply(uint256 supply) public onlyOwner { maxWhitelistSupply = supply; } /** * @notice Enable or disable the public sale of tokens. * @param status true to enable the public sale, false to disable it. */ function setPublicSale(bool status) public onlyOwner { publicSaleActive = status; } /** * @notice Enable or disable the whitelist sale of tokens. * @param status true to enable the whitelist sale, false to disable it. */ function setWhitelistSale(bool status) public onlyOwner { whitelistSaleActive = status; } function setBothSales(bool _whitelist, bool _public) public onlyOwner { whitelistSaleActive = _whitelist; publicSaleActive = _public; } /** * @notice Set the Merkle root used to verify if an address is whitelisted. * @param root The new Merkle root. */ function setMerkleRoot(bytes32 root) public onlyOwner { merkleRoot = root; } /** * @notice Set whether or not the token's metadata has been revealed. * @param isRevealed True if the metadata has been revealed, false otherwise. */ function setRevealed(bool isRevealed) public onlyOwner { revealed = isRevealed; } /** * @notice Set the base URI used to construct the token's URI. * @param uri The new base metadata URI. Should end with slash at the end ( e.g. ipfs://some_cid/ ) */ function setBaseURI(string memory uri) public onlyOwner { baseURI = uri; } /** * @notice Set the hidden URI used to point at unrevealed token's metadata json. * @param uri The new hidden metadata URI. */ function setHiddenURI(string memory uri) public onlyOwner { hiddenURI = uri; } /** * @notice Set the suffix used to construct the token's URI. * @param suffix The new suffix. */ function setURISuffix(string memory suffix) public onlyOwner { uriSuffix = suffix; } /** * @notice Sets the public price for the contract. * @param price The new public price to be set (in WEI format). */ function setPublicPrice(uint256 price) public onlyOwner { publicPrice = price; } /** * @notice Sets the whitelist price for the contract. * @param price The new whitelist price to be set (in WEI format). */ function setWhitelistPrice(uint256 price) public onlyOwner { whitelistPrice = price; } /** * @notice Sets the maximum number of tokens that can be minted per transaction for the public sale * @param maxPerTx The maximum number of tokens that can be minted per transaction for the public sale */ function setPublicPerTx(uint256 maxPerTx) public onlyOwner { publicMaxPerTx = maxPerTx; } /** * @notice Sets the maximum number of tokens that can be minted per transaction for the whitelist sale * @param maxPerTx The maximum number of tokens that can be minted per transaction for the whitelist sale */ function setWhitelistPerTx(uint256 maxPerTx) public onlyOwner { whitelistMaxPerTx = maxPerTx; } /** * @notice Sets the maximum number of tokens that can be minted per wallet for the public sale * @param maxPerWallet The maximum number of tokens that can be minted per wallet for the public sale */ function setPublicPerWallet(uint256 maxPerWallet) public onlyOwner { publicMaxPerWallet = maxPerWallet; } /** * @notice Sets the maximum number of tokens that can be minted per wallet for the whitelist sale * @param maxPerWallet The maximum number of tokens that can be minted per wallet for the whitelist sale */ function setWhitelistPerWallet(uint256 maxPerWallet) public onlyOwner { whitelistMaxPerWallet = maxPerWallet; } function setPepesRequiredForBTC(uint256 amount) public onlyOwner { pepesForBTCRequired = amount; } function setBurnState(bool state) public onlyOwner { burnActive = state; } function revealCollection(string memory _uri) public onlyOwner { baseURI = _uri; revealed = true; } /** * @notice Allows the contract owner to withdraw all the ether held in the contract. * The function can only be called by the contract owner and is protected against reentrancy attacks. */ function withdraw() public onlyOwner nonReentrant { address ownerAddress = owner(); (bool transfer, ) = payable(ownerAddress).call{ value: address(this).balance }(''); if (!transfer) { revert transferFailed(address(this), ownerAddress, address(this).balance); } } /** * @notice Returns the starting token ID for this contract, which is always 1. * This function overrides the _startTokenId function in the ERC721A contract. * @return uint256 The starting token ID. */ function _startTokenId() internal pure override returns (uint256) { return 1; } /** * @notice OpenSea enforced overrides for the ERC721A transfer and approval methods * start */ function setApprovalForAll(address operator, bool approved) public override(IERC721A, ERC721A) onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve(address operator, uint256 tokenId) public payable override(IERC721A, ERC721A) onlyAllowedOperatorApproval(operator) { super.approve(operator, tokenId); } function transferFrom(address from, address to, uint256 tokenId) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } /** * @notice OpenSea enforced overrides for the ERC721A transfer and approval methods * end */ }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // 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; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) public payable virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].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); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public 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(); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 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) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AQueryable.sol'; import '../ERC721A.sol'; /** * @title ERC721AQueryable. * * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable { /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) { return ownership; } ownership = _ownershipAt(tokenId); if (ownership.burned) { return ownership; } return _ownershipOf(tokenId); } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] calldata tokenIds) external view virtual override returns (TokenOwnership[] memory) { unchecked { uint256 tokenIdsLength = tokenIds.length; TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength); for (uint256 i; i != tokenIdsLength; ++i) { ownerships[i] = explicitOwnershipOf(tokenIds[i]); } return ownerships; } } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view virtual override returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _nextTokenId(); // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, stopLimit)`. if (stop > stopLimit) { stop = stopLimit; } uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (start < stop) { uint256 rangeLength = stop - start; if (rangeLength < tokenIdsMaxLength) { tokenIdsMaxLength = rangeLength; } } else { tokenIdsMaxLength = 0; } uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength); if (tokenIdsMaxLength == 0) { return tokenIds; } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`. // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range. if (!ownership.burned) { currOwnershipAddr = ownership.addr; } for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } // Downsize the array to fit. assembly { mstore(tokenIds, tokenIdsIdx) } return tokenIds; } } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); TokenOwnership memory ownership; for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../IERC721A.sol'; /** * @dev Interface of ERC721AQueryable. */ interface IERC721AQueryable is IERC721A { /** * Invalid query range (`start` >= `stop`). */ error InvalidQueryRange(); /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory); /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory); /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory); /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view returns (uint256[] memory); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // 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(); // ============================================================= // 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); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {OperatorFilterer} from "./OperatorFilterer.sol"; import {CANONICAL_CORI_SUBSCRIPTION} from "./lib/Constants.sol"; /** * @title DefaultOperatorFilterer * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription. * @dev Please note that if your token contract does not provide an owner with EIP-173, it must provide * administration methods on the contract itself to interact with the registry otherwise the subscription * will be locked to the options set during construction. */ abstract contract DefaultOperatorFilterer is OperatorFilterer { /// @dev The constructor that is called when the contract is being deployed. constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { /** * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns * true if supplied registrant address is not registered. */ function isOperatorAllowed(address registrant, address operator) external view returns (bool); /** * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner. */ function register(address registrant) external; /** * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes. */ function registerAndSubscribe(address registrant, address subscription) external; /** * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another * address without subscribing. */ function registerAndCopyEntries(address registrant, address registrantToCopy) external; /** * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner. * Note that this does not remove any filtered addresses or codeHashes. * Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes. */ function unregister(address addr) external; /** * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered. */ function updateOperator(address registrant, address operator, bool filtered) external; /** * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates. */ function updateOperators(address registrant, address[] calldata operators, bool filtered) external; /** * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered. */ function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; /** * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates. */ function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; /** * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous * subscription if present. * Note that accounts with subscriptions may go on to subscribe to other accounts - in this case, * subscriptions will not be forwarded. Instead the former subscription's existing entries will still be * used. */ function subscribe(address registrant, address registrantToSubscribe) external; /** * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes. */ function unsubscribe(address registrant, bool copyExistingEntries) external; /** * @notice Get the subscription address of a given registrant, if any. */ function subscriptionOf(address addr) external returns (address registrant); /** * @notice Get the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscribers(address registrant) external returns (address[] memory); /** * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscriberAt(address registrant, uint256 index) external returns (address); /** * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr. */ function copyEntriesOf(address registrant, address registrantToCopy) external; /** * @notice Returns true if operator is filtered by a given address or its subscription. */ function isOperatorFiltered(address registrant, address operator) external returns (bool); /** * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription. */ function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); /** * @notice Returns true if a codeHash is filtered by a given address or its subscription. */ function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); /** * @notice Returns a list of filtered operators for a given address or its subscription. */ function filteredOperators(address addr) external returns (address[] memory); /** * @notice Returns the set of filtered codeHashes for a given address or its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashes(address addr) external returns (bytes32[] memory); /** * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredOperatorAt(address registrant, uint256 index) external returns (address); /** * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); /** * @notice Returns true if an address has registered */ function isRegistered(address addr) external returns (bool); /** * @dev Convenience method to compute the code hash of an arbitrary contract */ function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E; address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol"; import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol"; /** * @title OperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. * Please note that if your token contract does not provide an owner with EIP-173, it must provide * administration methods on the contract itself to interact with the registry otherwise the subscription * will be locked to the options set during construction. */ abstract contract OperatorFilterer { /// @dev Emitted when an operator is not allowed. error OperatorNotAllowed(address operator); IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS); /// @dev The constructor that is called when the contract is being deployed. constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (subscribe) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { OPERATOR_FILTER_REGISTRY.register(address(this)); } } } } /** * @dev A helper function to check if an operator is allowed. */ modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } /** * @dev A helper function to check if an operator approval is allowed. */ modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } /** * @dev A helper function to check if an operator is allowed. */ function _checkFilterOperator(address operator) internal view virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { // under normal circumstances, this function will revert rather than return false, but inheriting contracts // may specify their own OperatorFilterRegistry implementations, which may behave differently if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
{ "optimizer": { "enabled": true, "runs": 200, "details": { "yul": false } }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"burnIsDisabled","type":"error"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"decreaseNotAllowed","type":"error"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"maxPerTx","type":"uint256"}],"name":"maxPerTxExceeded","type":"error"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"maxPerWallet","type":"uint256"}],"name":"maxPerWalletExceeded","type":"error"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"maxSupplyExceeded","type":"error"},{"inputs":[],"name":"mintNotStartedYet","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"nonExistentToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"payableValue","type":"uint256"},{"internalType":"uint256","name":"required","type":"uint256"}],"name":"notEnoughFunds","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"currentCount","type":"uint256"},{"internalType":"uint256","name":"requiredCount","type":"uint256"}],"name":"notEnoughPepesBurned","type":"error"},{"inputs":[],"name":"notTokenOwner","type":"error"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"bytes32","name":"root","type":"bytes32"}],"name":"notWhitelisted","type":"error"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"transferFailed","type":"error"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"maxWhitelistSupply","type":"uint256"}],"name":"whitelistSupplyExceeded","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"setter","type":"address"},{"indexed":false,"internalType":"string","name":"btcAddr","type":"string"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"BtcAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"burner","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"BurnedMultiple","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"burner","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"BurnedSingle","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":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"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"btcAddressCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"btcClaimedIndex","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burnActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"burnMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burnedSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burnerAddressCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBTCAddresses","outputs":[{"components":[{"internalType":"address","name":"claimedBy","type":"address"},{"internalType":"string","name":"btcAddress","type":"string"}],"internalType":"struct Pepemigos.btcEntry[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"ownerAddress","type":"address"}],"name":"getBurnedCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getBurnerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBurners","outputs":[{"components":[{"internalType":"address","name":"burner","type":"address"},{"internalType":"uint256","name":"count","type":"uint256"},{"internalType":"string","name":"btcAddress","type":"string"}],"internalType":"struct Pepemigos.burnEntry[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"ownerAddress","type":"address"}],"name":"getUserTokens","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"uri","type":"string"}],"internalType":"struct Pepemigos.userToken[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hiddenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"holderBTCAddress","outputs":[{"internalType":"uint256","name":"recordedIndex","type":"uint256"},{"internalType":"string","name":"BTCAddress","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"holderClaimed","outputs":[{"internalType":"uint256","name":"publicClaimed","type":"uint256"},{"internalType":"uint256","name":"whitelistClaimed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWhitelistSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintWhitelist","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pepesForBTCRequired","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMaxPerTx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMaxPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"revealCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"string","name":"btcAddr","type":"string"}],"name":"setBTCAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_whitelist","type":"bool"},{"internalType":"bool","name":"_public","type":"bool"}],"name":"setBothSales","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"state","type":"bool"}],"name":"setBurnState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setHiddenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"supply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"supply","type":"uint256"}],"name":"setMaxWhitelistSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"root","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setPepesRequiredForBTC","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxPerTx","type":"uint256"}],"name":"setPublicPerTx","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxPerWallet","type":"uint256"}],"name":"setPublicPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPublicPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setPublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isRevealed","type":"bool"}],"name":"setRevealed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"suffix","type":"string"}],"name":"setURISuffix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxPerTx","type":"uint256"}],"name":"setWhitelistPerTx","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxPerWallet","type":"uint256"}],"name":"setWhitelistPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setWhitelistPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setWhitelistSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uriSuffix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistMaxPerTx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistMaxPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
611b39600a556107d0600b55660cca2e51310000600d556000600e819055600f805461ffff1916905560a0604052608090815260119062000041908262000578565b5060405180606001604052806036815260200162004518603691396012906200006b908262000578565b50604080518082019091526005815264173539b7b760d91b602082015260139062000097908262000578565b506014805461ffff191661010017905560036015819055600160168190556017919091556018556004601955348015620000d057600080fd5b506040805180820182526009815268506570656d69676f7360b81b6020808301919091528251808401909352600583526450504d475360d81b9083015290733cc6cdda760b79bafa08df41ecfa224f810dceb660016daaeb6d7670e522a718067333cd4e3b156200025e578015620001b157604051633e9f1edf60e11b81526daaeb6d7670e522a718067333cd4e90637d3e3dbe906200017790309086906004016200066b565b600060405180830381600087803b1580156200019257600080fd5b505af1158015620001a7573d6000803e3d6000fd5b505050506200025e565b6001600160a01b03821615620001f65760405163a0af290360e01b81526daaeb6d7670e522a718067333cd4e9063a0af2903906200017790309086906004016200066b565b604051632210724360e11b81526daaeb6d7670e522a718067333cd4e90634420e48690620002299030906004016200068a565b600060405180830381600087803b1580156200024457600080fd5b505af115801562000259573d6000803e3d6000fd5b505050505b50600290506200026f838262000578565b5060036200027e828262000578565b50506001600055506200029133620002a9565b6001600955620002a3336045620002fb565b620006d5565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6200030562000315565b6200031182826200034d565b5050565b6008546001600160a01b031633146200034b5760405162461bcd60e51b815260040162000342906200069a565b60405180910390fd5b565b6000805490829003620003735760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660009081526005602052604081208054680100000000000000018502019055620003cd908490620003b090828162000463565b6001851460e11b174260a01b176001600160a01b03919091161790565b6000828152600460205260408120919091556001600160a01b038416908383019083908390600080516020620044f88339815191528180a4600183015b818114620004335780836000600080516020620044f8833981519152600080a46001016200040a565b50816000036200045557604051622e076360e81b815260040160405180910390fd5b60005550505050565b505050565b60005b9392505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052602260045260246000fd5b600281046001821680620004ae57607f821691505b602082108103620004c357620004c362000483565b50919050565b6000620004da620004d78381565b90565b92915050565b620004eb83620004c9565b815460001960089490940293841b1916921b91909117905550565b60006200045e818484620004e0565b8181101562000311576200052b60008262000506565b60010162000515565b601f8211156200045e576000818152602090206020601f850104810160208510156200055d5750805b620005716020601f86010483018262000515565b5050505050565b81516001600160401b038111156200059457620005946200046d565b620005a0825462000499565b620005ad82828562000534565b6020601f831160018114620005e45760008415620005cb5750858201515b600019600886021c198116600286021786555062000640565b600085815260208120601f198616915b82811015620006165788850151825560209485019460019092019101620005f4565b86831015620006335784890151600019601f89166008021c191682555b6001600288020188555050505b505050505050565b60006001600160a01b038216620004da565b620006658162000648565b82525050565b604081016200067b82856200065a565b6200046660208301846200065a565b60208101620004da82846200065a565b60208082528181019081527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604083015260608201620004da565b613e1380620006e56000396000f3fe6080604052600436106104525760003560e01c806370a082311161023f578063b459965a11610139578063d0c6fc84116100b6578063efd0cbf91161007a578063efd0cbf914610d4e578063efe8c4ac14610d61578063f2fde38b14610d77578063f6000c7a14610d97578063fc1a1c3614610dad57600080fd5b8063d0c6fc8414610c77578063d5abeb0114610c8d578063dd6f5c5314610ca3578063e0a8085314610ce5578063e985e9c514610d0557600080fd5b8063c23dc68f116100fd578063c23dc68f14610bb4578063c627525514610be1578063c87b56dd14610c01578063ca34ee6514610c21578063ca7ce3ec14610c5757600080fd5b8063b459965a14610b31578063b88d4fde14610b51578063bb2e63b314610b64578063bbaac02f14610b7a578063bc8893b414610b9a57600080fd5b80638da5cb5b116101c7578063a22cb4651161018b578063a22cb46514610aad578063a945bf8014610acd578063b0895f6414610ae3578063b0cac01314610af9578063b2fe662e14610b0f57600080fd5b80638da5cb5b14610a24578063953f049d14610a4257806395d89b4114610a5857806399a2557a14610a6d57806399d90cf514610a8d57600080fd5b806381b3e5751161020e57806381b3e575146109815780638462151c146109a1578063864ef3e5146109ce57806386fe8b43146109ed5780638cc54e7f14610a0f57600080fd5b806370a082311461090c578063715018a61461092c578063717d57d3146109415780637cb647591461096157600080fd5b806350179bae116103505780635aca1bb6116102d85780636352211e1161029c5780636352211e1461088157806363b7ee93146108a15780636ab49a5b146108b75780636c0360eb146108d75780636f8b44b0146108ec57600080fd5b80635aca1bb6146107d45780635bbb2177146107f45780635ce289ba146108215780635fe37ffa146108415780636219de391461086157600080fd5b806354e5c18c1161031f57806354e5c18c146107345780635503a0e81461075457806355d0a1d01461076957806355f804b31461077e578063594a002f1461079e57600080fd5b806350179bae1461069f57806351830227146106bf578063519dc8d2146106d9578063546217eb1461070657600080fd5b80632eb4a7ab116103de578063408cbf94116103a2578063408cbf94146105fd57806341c4a71b1461061d57806341f434341461063d57806342842e0e1461066c57806342966c681461067f57600080fd5b80632eb4a7ab1461057d57806333e61413146105935780633ad7f56c146105a95780633ccfd60b146105c85780633f017da1146105dd57600080fd5b8063095ea7b311610425578063095ea7b3146104f1578063152d13bc1461050457806318160ddd146105245780631d30fa161461054a57806323b872dd1461056a57600080fd5b806301ffc9a714610457578063061431a81461048d57806306fdde03146104a2578063081812fc146104c4575b600080fd5b34801561046357600080fd5b50610477610472366004612e8f565b610dc3565b6040516104849190612eba565b60405180910390f35b6104a061049b366004612f2a565b610e15565b005b3480156104ae57600080fd5b506104b7611045565b6040516104849190612fdb565b3480156104d057600080fd5b506104e46104df366004612fec565b6110d7565b6040516104849190613027565b6104a06104ff366004613049565b61111b565b34801561051057600080fd5b506104a061051f366004612fec565b611134565b34801561053057600080fd5b5060015460005403600019015b604051610484919061308c565b34801561055657600080fd5b5061053d61056536600461309a565b611141565b6104a06105783660046130bb565b61116e565b34801561058957600080fd5b5061053d60105481565b34801561059f57600080fd5b5061053d600c5481565b3480156105b557600080fd5b50600f5461047790610100900460ff1681565b3480156105d457600080fd5b506104a0611199565b3480156105e957600080fd5b506104a06105f8366004612fec565b611250565b34801561060957600080fd5b506104a0610618366004613049565b61125d565b34801561062957600080fd5b506104a06106383660046131fc565b611273565b34801561064957600080fd5b5061065f6daaeb6d7670e522a718067333cd4e81565b6040516104849190613278565b6104a061067a3660046130bb565b6112f3565b34801561068b57600080fd5b506104a061069a366004612fec565b611318565b3480156106ab57600080fd5b506104a06106ba3660046131fc565b611401565b3480156106cb57600080fd5b506014546104779060ff1681565b3480156106e557600080fd5b506106f96106f436600461309a565b611426565b604051610484919061332d565b34801561071257600080fd5b5061072661072136600461309a565b611544565b60405161048492919061333e565b34801561074057600080fd5b506104a061074f366004612fec565b6115e9565b34801561076057600080fd5b506104b76115f6565b34801561077557600080fd5b5061053d611684565b34801561078a57600080fd5b506104a06107993660046131fc565b611694565b3480156107aa57600080fd5b506104e46107b9366004612fec565b601f602052600090815260409020546001600160a01b031681565b3480156107e057600080fd5b506104a06107ef366004613371565b6116a8565b34801561080057600080fd5b5061081461080f366004613392565b6116c3565b604051610484919061349a565b34801561082d57600080fd5b506104a061083c366004613371565b611775565b34801561084d57600080fd5b506104a061085c366004612fec565b611797565b34801561086d57600080fd5b506104a061087c366004612fec565b6117a4565b34801561088d57600080fd5b506104e461089c366004612fec565b6117b1565b3480156108ad57600080fd5b5061053d60195481565b3480156108c357600080fd5b506104a06108d236600461354d565b6117bc565b3480156108e357600080fd5b506104b76118f4565b3480156108f857600080fd5b506104a0610907366004612fec565b611901565b34801561091857600080fd5b5061053d61092736600461309a565b611936565b34801561093857600080fd5b506104a0611984565b34801561094d57600080fd5b506104a061095c366004612fec565b611996565b34801561096d57600080fd5b506104a061097c366004612fec565b6119a3565b34801561098d57600080fd5b506104a061099c3660046131fc565b6119b0565b3480156109ad57600080fd5b506109c16109bc36600461309a565b6119c4565b60405161048491906135d9565b3480156109da57600080fd5b5060145461047790610100900460ff1681565b3480156109f957600080fd5b50610a02611a9e565b604051610484919061368e565b348015610a1b57600080fd5b506104b7611c38565b348015610a3057600080fd5b506008546001600160a01b03166104e4565b348015610a4e57600080fd5b5061053d600b5481565b348015610a6457600080fd5b506104b7611c45565b348015610a7957600080fd5b506109c1610a8836600461369f565b611c54565b348015610a9957600080fd5b506104a0610aa83660046136d4565b611ddb565b348015610ab957600080fd5b506104a0610ac8366004613707565b611e06565b348015610ad957600080fd5b5061053d600d5481565b348015610aef57600080fd5b5061053d60175481565b348015610b0557600080fd5b5061053d601b5481565b348015610b1b57600080fd5b50610b24611e1a565b60405161048491906137a2565b348015610b3d57600080fd5b506104a0610b4c366004612fec565b611f7f565b6104a0610b5f3660046137b3565b611f8c565b348015610b7057600080fd5b5061053d601a5481565b348015610b8657600080fd5b506104a0610b953660046131fc565b611fb9565b348015610ba657600080fd5b50600f546104779060ff1681565b348015610bc057600080fd5b50610bd4610bcf366004612fec565b611fcd565b6040516104849190613831565b348015610bed57600080fd5b506104a0610bfc366004612fec565b61201d565b348015610c0d57600080fd5b506104b7610c1c366004612fec565b61202a565b348015610c2d57600080fd5b506104e4610c3c366004612fec565b601d602052600090815260409020546001600160a01b031681565b348015610c6357600080fd5b506104a0610c72366004613371565b61214d565b348015610c8357600080fd5b5061053d60165481565b348015610c9957600080fd5b5061053d600a5481565b348015610caf57600080fd5b50610cd7610cbe36600461309a565b601e602052600090815260409020805460019091015482565b60405161048492919061383f565b348015610cf157600080fd5b506104a0610d00366004613371565b61216f565b348015610d1157600080fd5b50610477610d2036600461385a565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b6104a0610d5c366004612fec565b61218a565b348015610d6d57600080fd5b5061053d60155481565b348015610d8357600080fd5b506104a0610d9236600461309a565b6122d2565b348015610da357600080fd5b5061053d60185481565b348015610db957600080fd5b5061053d600e5481565b60006301ffc9a760e01b6001600160e01b031983161480610df457506380ac58cd60e01b6001600160e01b03198316145b80610e0f5750635b5e139f60e01b6001600160e01b03198316145b92915050565b601654601854600e54336000908152601e6020526040812060010154879291610e3e84846138a3565b9050600084610e4c33611936565b6001546000540360001901610e6191906138bb565b610e6b91906138bb565b90506000610e7986856138bb565b905082341015610ea9573483604051639224270f60e01b8152600401610ea092919061383f565b60405180910390fd5b600a54821115610ed157600a5460405163243acc1d60e11b8152610ea091849160040161383f565b87861115610ef6578588604051631716f01560e11b8152600401610ea092919061383f565b86811115610f1b5780876040516327d4050360e01b8152600401610ea092919061383f565b600f54610100900460ff16610f4357604051630224f08b60e11b815260040160405180910390fd5b60008b600c54610f5391906138bb565b9050600b54811115610f7d57600b5460405163b529598760e01b8152610ea091839160040161383f565b6000610fe68c8c8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050601054604051909250610fcb915033906020016138f6565b6040516020818303038152906040528051906020012061230c565b90508061100b5760105460405163febe25a760e01b8152610ea091339160040161390b565b611015338e612322565b5050600c80548c0190555050336000908152601e6020526040902060010180549099019098555050505050505050565b6060600280546110549061392f565b80601f01602080910402602001604051908101604052809291908181526020018280546110809061392f565b80156110cd5780601f106110a2576101008083540402835291602001916110cd565b820191906000526020600020905b8154815290600101906020018083116110b057829003601f168201915b5050505050905090565b60006110e2826123fc565b6110ff576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b8161112581612431565b61112f83836124d9565b505050565b61113c612579565b601855565b6000610e0f826001600160a01b031660009081526005602052604090205460801c6001600160401b031690565b826001600160a01b03811633146111885761118833612431565b6111938484846125a3565b50505050565b6111a1612579565b6111a9612734565b60006111bd6008546001600160a01b031690565b90506000816001600160a01b0316476040516111d89061395b565b60006040518083038185875af1925050503d8060008114611215576040519150601f19603f3d011682016040523d82523d6000602084013e61121a565b606091505b50509050806112425730824760405163115a367160e11b8152600401610ea093929190613966565b505061124e6001600955565b565b611258612579565b601755565b611265612579565b61126f8282612322565b5050565b600061127e33611141565b905060195481106112d257611293338361275d565b7faa678838083be12d8a90754ae429b95a24d8ec229b94d5497096be9803e4e9943383426040516112c69392919061398e565b60405180910390a15050565b33816019546040516358222aed60e11b8152600401610ea0939291906139bd565b826001600160a01b038116331461130d5761130d33612431565b61119384848461283b565b601454610100900460ff166113405760405163669ef6d360e01b815260040160405180910390fd5b3361134a826117b1565b6001600160a01b031614611371576040516348f2abcb60e11b815260040160405180910390fd5b61137a33611141565b6000036113b857601a8054906000611391836139d8565b9091555050601a546000908152601f6020526040902080546001600160a01b031916331790555b6113c3816001612856565b7f104a9c7e5a9e8a8e555117b5c576dfbd29c290f1d5b0515a5043356789e8fd083382426040516113f6939291906139bd565b60405180910390a150565b611409612579565b60116114158282613a83565b50506014805460ff19166001179055565b6060600080600061143685611936565b90506000816001600160401b038111156114525761145261310b565b60405190808252806020026020018201604052801561149857816020015b6040805180820190915260008152606060208201528152602001906001900390816114705790505b5090506114a3612e46565b60015b838614611538576114b68161298e565b915081604001516115305781516001600160a01b0316156114d657815194505b876001600160a01b0316856001600160a01b0316036115305760405180604001604052808281526020016115098361202a565b81525083878151811061151e5761151e613b45565b60209081029190910101526001909501945b6001016114a6565b50909695505050505050565b601c60205260009081526040902080546001820180549192916115669061392f565b80601f01602080910402602001604051908101604052809291908181526020018280546115929061392f565b80156115df5780601f106115b4576101008083540402835291602001916115df565b820191906000526020600020905b8154815290600101906020018083116115c257829003601f168201915b5050505050905082565b6115f1612579565b600b55565b601380546116039061392f565b80601f016020809104026020016040519081016040528092919081815260200182805461162f9061392f565b801561167c5780601f106116515761010080835404028352916020019161167c565b820191906000526020600020905b81548152906001019060200180831161165f57829003601f168201915b505050505081565b600061168f60015490565b905090565b61169c612579565b601161126f8282613a83565b6116b0612579565b600f805460ff1916911515919091179055565b6060816000816001600160401b038111156116e0576116e061310b565b60405190808252806020026020018201604052801561171957816020015b611706612e46565b8152602001906001900390816116fe5790505b50905060005b82811461176c5761174786868381811061173b5761173b613b45565b90506020020135611fcd565b82828151811061175957611759613b45565b602090810291909101015260010161171f565b50949350505050565b61177d612579565b601480549115156101000261ff0019909216919091179055565b61179f612579565b601955565b6117ac612579565b601555565b6000610e0f826129ae565b601454610100900460ff166117e45760405163669ef6d360e01b815260040160405180910390fd5b6117ed33611141565b60000361182b57601a8054906000611804836139d8565b9091555050601a546000908152601f6020526040902080546001600160a01b031916331790555b60005b81518110156118c057336001600160a01b031661186383838151811061185657611856613b45565b60200260200101516117b1565b6001600160a01b03161461188a576040516348f2abcb60e11b815260040160405180910390fd5b6118ae82828151811061189f5761189f613b45565b60200260200101516001612856565b806118b8816139d8565b91505061182e565b507f470eaebf05e5f65cb827476745560563945cbd237d5798d503b351692e819f0d3382426040516113f693929190613b5b565b601180546116039061392f565b611909612579565b600a5481101561193157600a5460405163f828250360e01b8152610ea091839160040161383f565b600a55565b60006001600160a01b03821661195f576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b61198c612579565b61124e6000612a1d565b61199e612579565b600e55565b6119ab612579565b601055565b6119b8612579565b601361126f8282613a83565b606060008060006119d485611936565b90506000816001600160401b038111156119f0576119f061310b565b604051908082528060200260200182016040528015611a19578160200160208202803683370190505b509050611a24612e46565b60015b83861461153857611a378161298e565b91508160400151611a965781516001600160a01b031615611a5757815194505b876001600160a01b0316856001600160a01b031603611a965780838780600101985081518110611a8957611a89613b45565b6020026020010181815250505b600101611a27565b6060600080601a546001600160401b03811115611abd57611abd61310b565b604051908082528060200260200182016040528015611b0a57816020015b60408051606080820183526000808352602083015291810191909152815260200190600190039081611adb5790505b50905060015b601a548111611c31576000818152601f6020908152604091829020548251606081019093526001600160a01b031680835291908101611b4e83611141565b8152602001601c6000846001600160a01b03166001600160a01b031681526020019081526020016000206001018054611b869061392f565b80601f0160208091040260200160405190810160405280929190818152602001828054611bb29061392f565b8015611bff5780601f10611bd457610100808354040283529160200191611bff565b820191906000526020600020905b815481529060010190602001808311611be257829003601f168201915b5050505050815250838581518110611c1957611c19613b45565b60209081029190910101525060019283019201611b10565b5092915050565b601280546116039061392f565b6060600380546110549061392f565b6060818310611c7657604051631960ccad60e11b815260040160405180910390fd5b600080611c8260005490565b90506001851015611c9257600194505b80841115611c9e578093505b6000611ca987611936565b905084861015611cc85785850381811015611cc2578091505b50611ccc565b5060005b6000816001600160401b03811115611ce657611ce661310b565b604051908082528060200260200182016040528015611d0f578160200160208202803683370190505b50905081600003611d25579350611dd492505050565b6000611d3088611fcd565b905060008160400151611d41575080515b885b888114158015611d535750848714155b15611dc857611d618161298e565b92508260400151611dc05782516001600160a01b031615611d8157825191505b8a6001600160a01b0316826001600160a01b031603611dc05780848880600101995081518110611db357611db3613b45565b6020026020010181815250505b600101611d43565b50505092835250909150505b9392505050565b611de3612579565b600f805461ffff19166101009315159390930260ff191692909217901515179055565b81611e1081612431565b61112f8383612a6f565b6060600080601b546001600160401b03811115611e3957611e3961310b565b604051908082528060200260200182016040528015611e7f57816020015b604080518082019091526000815260606020820152815260200190600190039081611e575790505b50905060015b601b548111611c31576000818152601d6020908152604080832054815180830183526001600160a01b03909116808252808552601c8452919093206001018054919392830191611ed49061392f565b80601f0160208091040260200160405190810160405280929190818152602001828054611f009061392f565b8015611f4d5780601f10611f2257610100808354040283529160200191611f4d565b820191906000526020600020905b815481529060010190602001808311611f3057829003601f168201915b5050505050815250838581518110611f6757611f67613b45565b60209081029190910101525060019283019201611e85565b611f87612579565b601655565b836001600160a01b0381163314611fa657611fa633612431565b611fb285858585612ade565b5050505050565b611fc1612579565b601261126f8282613a83565b611fd5612e46565b611fdd612e46565b6001831080611fee57506000548310155b15611ff95792915050565b6120028361298e565b90508060400151156120145792915050565b611dd483612b22565b612025612579565b600d55565b6060612035826123fc565b61205457816040516376f74dcb60e11b8152600401610ea0919061308c565b60145460ff166120ee576012805461206b9061392f565b80601f01602080910402602001604051908101604052809291908181526020018280546120979061392f565b80156120e45780601f106120b9576101008083540402835291602001916120e4565b820191906000526020600020905b8154815290600101906020018083116120c757829003601f168201915b5050505050610e0f565b6000601180546120fd9061392f565b9050116121195760405180602001604052806000815250610e0f565b601161212483612b3b565b601360405160200161213893929190613c0f565b60405160208183030381529060405292915050565b612155612579565b600f80549115156101000261ff0019909216919091179055565b612177612579565b6014805460ff1916911515919091179055565b601554601754600d54336000908152601e60205260408120548592916121b084846138a3565b90506000846121be33611936565b60015460005403600019016121d391906138bb565b6121dd91906138bb565b905060006121eb86856138bb565b905082341015612212573483604051639224270f60e01b8152600401610ea092919061383f565b600a5482111561223a57600a5460405163243acc1d60e11b8152610ea091849160040161383f565b8786111561225f578588604051631716f01560e11b8152600401610ea092919061383f565b868111156122845780876040516327d4050360e01b8152600401610ea092919061383f565b600f5460ff166122a757604051630224f08b60e11b815260040160405180910390fd5b6122b1338a612322565b5050336000908152601e602052604090208054909701909655505050505050565b6122da612579565b6001600160a01b0381166123005760405162461bcd60e51b8152600401610ea090613c33565b61230981612a1d565b50565b6000826123198584612bce565b14949350505050565b60008054908290036123475760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b17831790558284019083908390600080516020613dbe8339815191528180a4600183015b8181146123d25780836000600080516020613dbe833981519152600080a46001016123ac565b50816000036123f357604051622e076360e81b815260040160405180910390fd5b60005550505050565b600081600111158015612410575060005482105b8015610e0f575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b1561230957604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906124799030908590600401613c7d565b602060405180830381865afa158015612496573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ba9190613ca3565b6123095780604051633b79c77360e21b8152600401610ea09190613027565b60006124e4826117b1565b9050336001600160a01b0382161461251d576125008133610d20565b61251d576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6008546001600160a01b0316331461124e5760405162461bcd60e51b8152600401610ea090613cf9565b60006125ae826129ae565b9050836001600160a01b0316816001600160a01b0316146125e15760405162a1148160e81b815260040160405180910390fd5b6000828152600660205260409020805461260d8187335b6001600160a01b039081169116811491141790565b6126385761261b8633610d20565b61263857604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661265f57604051633a954ecd60e21b815260040160405180910390fd5b801561266a57600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b841690036126fc576001840160008181526004602052604081205490036126fa5760005481146126fa5760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b0316600080516020613dbe83398151915260405160405180910390a45b505050505050565b6002600954036127565760405162461bcd60e51b8152600401610ea090613d3d565b6002600955565b6001600160a01b0382166000908152601c6020526040902054156127c4576001600160a01b0382166000818152601c6020818152604080842080548552601d835290842080546001600160a01b0319168617905593909252905260010161112f8282613a83565b601b80549060006127d4836139d8565b9091555050601b80546000908152601d6020908152604080832080546001600160a01b0319166001600160a01b0388169081179091558151808301835294548552848301868152908452601c9092529091208251815590516001820190611fb29082613a83565b61112f83838360405180602001604052806000815250611f8c565b6000612861836129ae565b90508060008061287f86600090815260066020526040902080549091565b9150915084156128bf576128948184336125f8565b6128bf576128a28333610d20565b6128bf57604051632ce44b5f60e11b815260040160405180910390fd5b80156128ca57600082555b6001600160a01b038316600081815260056020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260046020526040812091909155600160e11b85169003612958576001860160008181526004602052604081205490036129565760005481146129565760008181526004602052604090208590555b505b60405186906000906001600160a01b03861690600080516020613dbe833981519152908390a45050600180548101905550505050565b612996612e46565b600082815260046020526040902054610e0f90612c13565b60008180600111612a0457600054811015612a045760008181526004602052604081205490600160e01b82169003612a02575b80600003611dd45750600019016000818152600460205260409020546129e1565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b3360008181526007602090815260408083206001600160a01b038716808552925291829020805460ff191685151517905590519091907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190612ad2908590612eba565b60405180910390a35050565b612ae984848461116e565b6001600160a01b0383163b1561119357612b0584848484612c56565b611193576040516368d2bf6b60e11b815260040160405180910390fd5b612b2a612e46565b610e0f612b36836129ae565b612c13565b60606000612b4883612d42565b60010190506000816001600160401b03811115612b6757612b6761310b565b6040519080825280601f01601f191660200182016040528015612b91576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612b9b575b509392505050565b600081815b8451811015612bc657612bff82868381518110612bf257612bf2613b45565b6020026020010151612e1a565b915080612c0b816139d8565b915050612bd3565b612c1b612e46565b6001600160a01b03821681526001600160401b0360a083901c166020820152600160e01b82161515604082015260e89190911c606082015290565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612c8b903390899088908890600401613d4d565b6020604051808303816000875af1925050508015612cc6575060408051601f3d908101601f19168201909252612cc391810190613d9c565b60015b612d24573d808015612cf4576040519150601f19603f3d011682016040523d82523d6000602084013e612cf9565b606091505b508051600003612d1c576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612d815772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612dad576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612dcb57662386f26fc10000830492506010015b6305f5e1008310612de3576305f5e100830492506008015b6127108310612df757612710830492506004015b60648310612e09576064830492506002015b600a8310610e0f5760010192915050565b6000818310612e36576000828152602084905260409020611dd4565b5060009182526020526040902090565b60408051608081018252600080825260208201819052918101829052606081019190915290565b6001600160e01b031981165b811461230957600080fd5b8035610e0f81612e6d565b600060208284031215612ea457612ea4600080fd5b6000612d3a8484612e84565b8015155b82525050565b60208101610e0f8284612eb0565b80612e79565b8035610e0f81612ec8565b60008083601f840112612eee57612eee600080fd5b5081356001600160401b03811115612f0857612f08600080fd5b602083019150836020820283011115612f2357612f23600080fd5b9250929050565b600080600060408486031215612f4257612f42600080fd5b6000612f4e8686612ece565b93505060208401356001600160401b03811115612f6d57612f6d600080fd5b612f7986828701612ed9565b92509250509250925092565b60005b83811015612fa0578181015183820152602001612f88565b50506000910152565b6000612fb3825190565b808452602084019350612fca818560208601612f85565b601f01601f19169290920192915050565b60208082528101611dd48184612fa9565b60006020828403121561300157613001600080fd5b6000612d3a8484612ece565b60006001600160a01b038216610e0f565b612eb48161300d565b60208101610e0f828461301e565b612e798161300d565b8035610e0f81613035565b6000806040838503121561305f5761305f600080fd5b600061306b858561303e565b925050602061307c85828601612ece565b9150509250929050565b80612eb4565b60208101610e0f8284613086565b6000602082840312156130af576130af600080fd5b6000612d3a848461303e565b6000806000606084860312156130d3576130d3600080fd5b60006130df868661303e565b93505060206130f08682870161303e565b925050604061310186828701612ece565b9150509250925092565b634e487b7160e01b600052604160045260246000fd5b601f19601f83011681018181106001600160401b03821117156131465761314661310b565b6040525050565b600061315860405190565b90506131648282613121565b919050565b60006001600160401b038211156131825761318261310b565b601f19601f83011660200192915050565b82818337506000910152565b60006131b26131ad84613169565b61314d565b9050828152602081018484840111156131cd576131cd600080fd5b612bc6848285613193565b600082601f8301126131ec576131ec600080fd5b8135612d3a84826020860161319f565b60006020828403121561321157613211600080fd5b81356001600160401b0381111561322a5761322a600080fd5b612d3a848285016131d8565b6000610e0f6001600160a01b03831661324d565b90565b6001600160a01b031690565b6000610e0f82613236565b6000610e0f82613259565b612eb481613264565b60208101610e0f828461326f565b8051600090604084019061329a8582613086565b50602083015184820360208601526132b28282612fa9565b95945050505050565b6000611dd48383613286565b60006132d1825190565b808452602084019350836020820285016132eb8560200190565b8060005b85811015613320578484038952815161330885826132bb565b94506020830160209a909a01999250506001016132ef565b5091979650505050505050565b60208082528101611dd481846132c7565b6040810161334c8285613086565b8181036020830152612d3a8184612fa9565b801515612e79565b8035610e0f8161335e565b60006020828403121561338657613386600080fd5b6000612d3a8484613366565b600080602083850312156133a8576133a8600080fd5b82356001600160401b038111156133c1576133c1600080fd5b6133cd85828601612ed9565b92509250509250929050565b6001600160401b038116612eb4565b62ffffff8116612eb4565b80516080830190613404848261301e565b50602082015161341760208501826133d9565b50604082015161342a6040850182612eb0565b50606082015161119360608501826133e8565b600061344983836133f3565b505060800190565b600061345b825190565b80845260209384019383018060005b8381101561348f57815161347e888261343d565b97506020830192505060010161346a565b509495945050505050565b60208082528101611dd48184613451565b60006001600160401b038211156134c4576134c461310b565b5060209081020190565b60006134dc6131ad846134ab565b838152905060208082019084028301858111156134fb576134fb600080fd5b835b8181101561351f57806135108882612ece565b845250602092830192016134fd565b5050509392505050565b600082601f83011261353d5761353d600080fd5b8135612d3a8482602086016134ce565b60006020828403121561356257613562600080fd5b81356001600160401b0381111561357b5761357b600080fd5b612d3a84828501613529565b60006135938383613086565b505060200190565b60006135a5825190565b80845260209384019383018060005b8381101561348f5781516135c88882613587565b9750602083019250506001016135b4565b60208082528101611dd4818461359b565b805160009060608401906135fe858261301e565b5060208301516136116020860182613086565b50604083015184820360408601526132b28282612fa9565b6000611dd483836135ea565b600061363f825190565b808452602084019350836020820285016136598560200190565b8060005b8581101561332057848403895281516136768582613629565b94506020830160209a909a019992505060010161365d565b60208082528101611dd48184613635565b6000806000606084860312156136b7576136b7600080fd5b60006136c3868661303e565b93505060206130f086828701612ece565b600080604083850312156136ea576136ea600080fd5b60006136f68585613366565b925050602061307c85828601613366565b6000806040838503121561371d5761371d600080fd5b60006136f6858561303e565b8051600090604084019061329a858261301e565b6000611dd48383613729565b6000613753825190565b8084526020840193508360208202850161376d8560200190565b8060005b85811015613320578484038952815161378a858261373d565b94506020830160209a909a0199925050600101613771565b60208082528101611dd48184613749565b600080600080608085870312156137cc576137cc600080fd5b60006137d8878761303e565b94505060206137e98782880161303e565b93505060406137fa87828801612ece565b92505060608501356001600160401b0381111561381957613819600080fd5b613825878288016131d8565b91505092959194509250565b60808101610e0f82846133f3565b6040810161384d8285613086565b611dd46020830184613086565b6000806040838503121561387057613870600080fd5b600061387c858561303e565b925050602061307c8582860161303e565b634e487b7160e01b600052601160045260246000fd5b818102808215838204851417611c3157611c3161388d565b80820180821115610e0f57610e0f61388d565b6000610e0f8260601b90565b6000610e0f826138ce565b612eb46138f18261300d565b6138da565b600061390282846138e5565b50601401919050565b6040810161384d828561301e565b634e487b7160e01b600052602260045260246000fd5b60028104600182168061394357607f821691505b60208210810361395557613955613919565b50919050565b6000610e0f8261324a565b60608101613974828661301e565b613981602083018561301e565b612d3a6040830184613086565b6060810161399c828661301e565b81810360208301526139ae8185612fa9565b9050612d3a6040830184613086565b606081016139cb828661301e565b6139816020830185613086565b600060001982036139eb576139eb61388d565b5060010190565b6000610e0f61324a8381565b613a07836139f2565b815460001960089490940293841b1916921b91909117905550565b600061112f8184846139fe565b8181101561126f57613a42600082613a22565b600101613a2f565b601f82111561112f576000818152602090206020601f85010481016020851015613a715750805b611fb26020601f860104830182613a2f565b81516001600160401b03811115613a9c57613a9c61310b565b613aa6825461392f565b613ab1828285613a4a565b6020601f831160018114613ae55760008415613acd5750858201515b600019600886021c198116600286021786555061272c565b600085815260208120601f198616915b82811015613b155788850151825560209485019460019092019101613af5565b86831015613b315784890151600019601f89166008021c191682555b600160028802018855505050505050505050565b634e487b7160e01b600052603260045260246000fd5b60608101613b69828661301e565b81810360208301526139ae818561359b565b60008154613b888161392f565b600182168015613b9f5760018114613bb457613be4565b60ff1983168652811515820286019350613be4565b60008581526020902060005b83811015613bdc57815488820152600190910190602001613bc0565b838801955050505b50505092915050565b6000613bf7825190565b613c05818560208601612f85565b9290920192915050565b6000613c1b8286613b7b565b9150613c278285613bed565b91506132b28284613b7b565b60208082528101610e0f81602681527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160208201526564647265737360d01b604082015260600190565b60408101613c8b828561301e565b611dd4602083018461301e565b8051610e0f8161335e565b600060208284031215613cb857613cb8600080fd5b6000612d3a8484613c98565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910190815260005b5060200190565b60208082528101610e0f81613cc4565b601f81526000602082017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081529150613cf2565b60208082528101610e0f81613d09565b60808101613d5b828761301e565b613d68602083018661301e565b613d756040830185613086565b8181036060830152613d878184612fa9565b9695505050505050565b8051610e0f81612e6d565b600060208284031215613db157613db1600080fd5b6000612d3a8484613d9156feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212202f738bf41087032a48833d2510cd32b3c95675821ff5185200308cc6c624d8fe64736f6c63430008130033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef697066733a2f2f516d5132584d5264784e44465a4d557443686d70366f43444c6663553174453447696f433166624d4d596f4e35522f
Deployed Bytecode
0x6080604052600436106104525760003560e01c806370a082311161023f578063b459965a11610139578063d0c6fc84116100b6578063efd0cbf91161007a578063efd0cbf914610d4e578063efe8c4ac14610d61578063f2fde38b14610d77578063f6000c7a14610d97578063fc1a1c3614610dad57600080fd5b8063d0c6fc8414610c77578063d5abeb0114610c8d578063dd6f5c5314610ca3578063e0a8085314610ce5578063e985e9c514610d0557600080fd5b8063c23dc68f116100fd578063c23dc68f14610bb4578063c627525514610be1578063c87b56dd14610c01578063ca34ee6514610c21578063ca7ce3ec14610c5757600080fd5b8063b459965a14610b31578063b88d4fde14610b51578063bb2e63b314610b64578063bbaac02f14610b7a578063bc8893b414610b9a57600080fd5b80638da5cb5b116101c7578063a22cb4651161018b578063a22cb46514610aad578063a945bf8014610acd578063b0895f6414610ae3578063b0cac01314610af9578063b2fe662e14610b0f57600080fd5b80638da5cb5b14610a24578063953f049d14610a4257806395d89b4114610a5857806399a2557a14610a6d57806399d90cf514610a8d57600080fd5b806381b3e5751161020e57806381b3e575146109815780638462151c146109a1578063864ef3e5146109ce57806386fe8b43146109ed5780638cc54e7f14610a0f57600080fd5b806370a082311461090c578063715018a61461092c578063717d57d3146109415780637cb647591461096157600080fd5b806350179bae116103505780635aca1bb6116102d85780636352211e1161029c5780636352211e1461088157806363b7ee93146108a15780636ab49a5b146108b75780636c0360eb146108d75780636f8b44b0146108ec57600080fd5b80635aca1bb6146107d45780635bbb2177146107f45780635ce289ba146108215780635fe37ffa146108415780636219de391461086157600080fd5b806354e5c18c1161031f57806354e5c18c146107345780635503a0e81461075457806355d0a1d01461076957806355f804b31461077e578063594a002f1461079e57600080fd5b806350179bae1461069f57806351830227146106bf578063519dc8d2146106d9578063546217eb1461070657600080fd5b80632eb4a7ab116103de578063408cbf94116103a2578063408cbf94146105fd57806341c4a71b1461061d57806341f434341461063d57806342842e0e1461066c57806342966c681461067f57600080fd5b80632eb4a7ab1461057d57806333e61413146105935780633ad7f56c146105a95780633ccfd60b146105c85780633f017da1146105dd57600080fd5b8063095ea7b311610425578063095ea7b3146104f1578063152d13bc1461050457806318160ddd146105245780631d30fa161461054a57806323b872dd1461056a57600080fd5b806301ffc9a714610457578063061431a81461048d57806306fdde03146104a2578063081812fc146104c4575b600080fd5b34801561046357600080fd5b50610477610472366004612e8f565b610dc3565b6040516104849190612eba565b60405180910390f35b6104a061049b366004612f2a565b610e15565b005b3480156104ae57600080fd5b506104b7611045565b6040516104849190612fdb565b3480156104d057600080fd5b506104e46104df366004612fec565b6110d7565b6040516104849190613027565b6104a06104ff366004613049565b61111b565b34801561051057600080fd5b506104a061051f366004612fec565b611134565b34801561053057600080fd5b5060015460005403600019015b604051610484919061308c565b34801561055657600080fd5b5061053d61056536600461309a565b611141565b6104a06105783660046130bb565b61116e565b34801561058957600080fd5b5061053d60105481565b34801561059f57600080fd5b5061053d600c5481565b3480156105b557600080fd5b50600f5461047790610100900460ff1681565b3480156105d457600080fd5b506104a0611199565b3480156105e957600080fd5b506104a06105f8366004612fec565b611250565b34801561060957600080fd5b506104a0610618366004613049565b61125d565b34801561062957600080fd5b506104a06106383660046131fc565b611273565b34801561064957600080fd5b5061065f6daaeb6d7670e522a718067333cd4e81565b6040516104849190613278565b6104a061067a3660046130bb565b6112f3565b34801561068b57600080fd5b506104a061069a366004612fec565b611318565b3480156106ab57600080fd5b506104a06106ba3660046131fc565b611401565b3480156106cb57600080fd5b506014546104779060ff1681565b3480156106e557600080fd5b506106f96106f436600461309a565b611426565b604051610484919061332d565b34801561071257600080fd5b5061072661072136600461309a565b611544565b60405161048492919061333e565b34801561074057600080fd5b506104a061074f366004612fec565b6115e9565b34801561076057600080fd5b506104b76115f6565b34801561077557600080fd5b5061053d611684565b34801561078a57600080fd5b506104a06107993660046131fc565b611694565b3480156107aa57600080fd5b506104e46107b9366004612fec565b601f602052600090815260409020546001600160a01b031681565b3480156107e057600080fd5b506104a06107ef366004613371565b6116a8565b34801561080057600080fd5b5061081461080f366004613392565b6116c3565b604051610484919061349a565b34801561082d57600080fd5b506104a061083c366004613371565b611775565b34801561084d57600080fd5b506104a061085c366004612fec565b611797565b34801561086d57600080fd5b506104a061087c366004612fec565b6117a4565b34801561088d57600080fd5b506104e461089c366004612fec565b6117b1565b3480156108ad57600080fd5b5061053d60195481565b3480156108c357600080fd5b506104a06108d236600461354d565b6117bc565b3480156108e357600080fd5b506104b76118f4565b3480156108f857600080fd5b506104a0610907366004612fec565b611901565b34801561091857600080fd5b5061053d61092736600461309a565b611936565b34801561093857600080fd5b506104a0611984565b34801561094d57600080fd5b506104a061095c366004612fec565b611996565b34801561096d57600080fd5b506104a061097c366004612fec565b6119a3565b34801561098d57600080fd5b506104a061099c3660046131fc565b6119b0565b3480156109ad57600080fd5b506109c16109bc36600461309a565b6119c4565b60405161048491906135d9565b3480156109da57600080fd5b5060145461047790610100900460ff1681565b3480156109f957600080fd5b50610a02611a9e565b604051610484919061368e565b348015610a1b57600080fd5b506104b7611c38565b348015610a3057600080fd5b506008546001600160a01b03166104e4565b348015610a4e57600080fd5b5061053d600b5481565b348015610a6457600080fd5b506104b7611c45565b348015610a7957600080fd5b506109c1610a8836600461369f565b611c54565b348015610a9957600080fd5b506104a0610aa83660046136d4565b611ddb565b348015610ab957600080fd5b506104a0610ac8366004613707565b611e06565b348015610ad957600080fd5b5061053d600d5481565b348015610aef57600080fd5b5061053d60175481565b348015610b0557600080fd5b5061053d601b5481565b348015610b1b57600080fd5b50610b24611e1a565b60405161048491906137a2565b348015610b3d57600080fd5b506104a0610b4c366004612fec565b611f7f565b6104a0610b5f3660046137b3565b611f8c565b348015610b7057600080fd5b5061053d601a5481565b348015610b8657600080fd5b506104a0610b953660046131fc565b611fb9565b348015610ba657600080fd5b50600f546104779060ff1681565b348015610bc057600080fd5b50610bd4610bcf366004612fec565b611fcd565b6040516104849190613831565b348015610bed57600080fd5b506104a0610bfc366004612fec565b61201d565b348015610c0d57600080fd5b506104b7610c1c366004612fec565b61202a565b348015610c2d57600080fd5b506104e4610c3c366004612fec565b601d602052600090815260409020546001600160a01b031681565b348015610c6357600080fd5b506104a0610c72366004613371565b61214d565b348015610c8357600080fd5b5061053d60165481565b348015610c9957600080fd5b5061053d600a5481565b348015610caf57600080fd5b50610cd7610cbe36600461309a565b601e602052600090815260409020805460019091015482565b60405161048492919061383f565b348015610cf157600080fd5b506104a0610d00366004613371565b61216f565b348015610d1157600080fd5b50610477610d2036600461385a565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b6104a0610d5c366004612fec565b61218a565b348015610d6d57600080fd5b5061053d60155481565b348015610d8357600080fd5b506104a0610d9236600461309a565b6122d2565b348015610da357600080fd5b5061053d60185481565b348015610db957600080fd5b5061053d600e5481565b60006301ffc9a760e01b6001600160e01b031983161480610df457506380ac58cd60e01b6001600160e01b03198316145b80610e0f5750635b5e139f60e01b6001600160e01b03198316145b92915050565b601654601854600e54336000908152601e6020526040812060010154879291610e3e84846138a3565b9050600084610e4c33611936565b6001546000540360001901610e6191906138bb565b610e6b91906138bb565b90506000610e7986856138bb565b905082341015610ea9573483604051639224270f60e01b8152600401610ea092919061383f565b60405180910390fd5b600a54821115610ed157600a5460405163243acc1d60e11b8152610ea091849160040161383f565b87861115610ef6578588604051631716f01560e11b8152600401610ea092919061383f565b86811115610f1b5780876040516327d4050360e01b8152600401610ea092919061383f565b600f54610100900460ff16610f4357604051630224f08b60e11b815260040160405180910390fd5b60008b600c54610f5391906138bb565b9050600b54811115610f7d57600b5460405163b529598760e01b8152610ea091839160040161383f565b6000610fe68c8c8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050601054604051909250610fcb915033906020016138f6565b6040516020818303038152906040528051906020012061230c565b90508061100b5760105460405163febe25a760e01b8152610ea091339160040161390b565b611015338e612322565b5050600c80548c0190555050336000908152601e6020526040902060010180549099019098555050505050505050565b6060600280546110549061392f565b80601f01602080910402602001604051908101604052809291908181526020018280546110809061392f565b80156110cd5780601f106110a2576101008083540402835291602001916110cd565b820191906000526020600020905b8154815290600101906020018083116110b057829003601f168201915b5050505050905090565b60006110e2826123fc565b6110ff576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b8161112581612431565b61112f83836124d9565b505050565b61113c612579565b601855565b6000610e0f826001600160a01b031660009081526005602052604090205460801c6001600160401b031690565b826001600160a01b03811633146111885761118833612431565b6111938484846125a3565b50505050565b6111a1612579565b6111a9612734565b60006111bd6008546001600160a01b031690565b90506000816001600160a01b0316476040516111d89061395b565b60006040518083038185875af1925050503d8060008114611215576040519150601f19603f3d011682016040523d82523d6000602084013e61121a565b606091505b50509050806112425730824760405163115a367160e11b8152600401610ea093929190613966565b505061124e6001600955565b565b611258612579565b601755565b611265612579565b61126f8282612322565b5050565b600061127e33611141565b905060195481106112d257611293338361275d565b7faa678838083be12d8a90754ae429b95a24d8ec229b94d5497096be9803e4e9943383426040516112c69392919061398e565b60405180910390a15050565b33816019546040516358222aed60e11b8152600401610ea0939291906139bd565b826001600160a01b038116331461130d5761130d33612431565b61119384848461283b565b601454610100900460ff166113405760405163669ef6d360e01b815260040160405180910390fd5b3361134a826117b1565b6001600160a01b031614611371576040516348f2abcb60e11b815260040160405180910390fd5b61137a33611141565b6000036113b857601a8054906000611391836139d8565b9091555050601a546000908152601f6020526040902080546001600160a01b031916331790555b6113c3816001612856565b7f104a9c7e5a9e8a8e555117b5c576dfbd29c290f1d5b0515a5043356789e8fd083382426040516113f6939291906139bd565b60405180910390a150565b611409612579565b60116114158282613a83565b50506014805460ff19166001179055565b6060600080600061143685611936565b90506000816001600160401b038111156114525761145261310b565b60405190808252806020026020018201604052801561149857816020015b6040805180820190915260008152606060208201528152602001906001900390816114705790505b5090506114a3612e46565b60015b838614611538576114b68161298e565b915081604001516115305781516001600160a01b0316156114d657815194505b876001600160a01b0316856001600160a01b0316036115305760405180604001604052808281526020016115098361202a565b81525083878151811061151e5761151e613b45565b60209081029190910101526001909501945b6001016114a6565b50909695505050505050565b601c60205260009081526040902080546001820180549192916115669061392f565b80601f01602080910402602001604051908101604052809291908181526020018280546115929061392f565b80156115df5780601f106115b4576101008083540402835291602001916115df565b820191906000526020600020905b8154815290600101906020018083116115c257829003601f168201915b5050505050905082565b6115f1612579565b600b55565b601380546116039061392f565b80601f016020809104026020016040519081016040528092919081815260200182805461162f9061392f565b801561167c5780601f106116515761010080835404028352916020019161167c565b820191906000526020600020905b81548152906001019060200180831161165f57829003601f168201915b505050505081565b600061168f60015490565b905090565b61169c612579565b601161126f8282613a83565b6116b0612579565b600f805460ff1916911515919091179055565b6060816000816001600160401b038111156116e0576116e061310b565b60405190808252806020026020018201604052801561171957816020015b611706612e46565b8152602001906001900390816116fe5790505b50905060005b82811461176c5761174786868381811061173b5761173b613b45565b90506020020135611fcd565b82828151811061175957611759613b45565b602090810291909101015260010161171f565b50949350505050565b61177d612579565b601480549115156101000261ff0019909216919091179055565b61179f612579565b601955565b6117ac612579565b601555565b6000610e0f826129ae565b601454610100900460ff166117e45760405163669ef6d360e01b815260040160405180910390fd5b6117ed33611141565b60000361182b57601a8054906000611804836139d8565b9091555050601a546000908152601f6020526040902080546001600160a01b031916331790555b60005b81518110156118c057336001600160a01b031661186383838151811061185657611856613b45565b60200260200101516117b1565b6001600160a01b03161461188a576040516348f2abcb60e11b815260040160405180910390fd5b6118ae82828151811061189f5761189f613b45565b60200260200101516001612856565b806118b8816139d8565b91505061182e565b507f470eaebf05e5f65cb827476745560563945cbd237d5798d503b351692e819f0d3382426040516113f693929190613b5b565b601180546116039061392f565b611909612579565b600a5481101561193157600a5460405163f828250360e01b8152610ea091839160040161383f565b600a55565b60006001600160a01b03821661195f576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b61198c612579565b61124e6000612a1d565b61199e612579565b600e55565b6119ab612579565b601055565b6119b8612579565b601361126f8282613a83565b606060008060006119d485611936565b90506000816001600160401b038111156119f0576119f061310b565b604051908082528060200260200182016040528015611a19578160200160208202803683370190505b509050611a24612e46565b60015b83861461153857611a378161298e565b91508160400151611a965781516001600160a01b031615611a5757815194505b876001600160a01b0316856001600160a01b031603611a965780838780600101985081518110611a8957611a89613b45565b6020026020010181815250505b600101611a27565b6060600080601a546001600160401b03811115611abd57611abd61310b565b604051908082528060200260200182016040528015611b0a57816020015b60408051606080820183526000808352602083015291810191909152815260200190600190039081611adb5790505b50905060015b601a548111611c31576000818152601f6020908152604091829020548251606081019093526001600160a01b031680835291908101611b4e83611141565b8152602001601c6000846001600160a01b03166001600160a01b031681526020019081526020016000206001018054611b869061392f565b80601f0160208091040260200160405190810160405280929190818152602001828054611bb29061392f565b8015611bff5780601f10611bd457610100808354040283529160200191611bff565b820191906000526020600020905b815481529060010190602001808311611be257829003601f168201915b5050505050815250838581518110611c1957611c19613b45565b60209081029190910101525060019283019201611b10565b5092915050565b601280546116039061392f565b6060600380546110549061392f565b6060818310611c7657604051631960ccad60e11b815260040160405180910390fd5b600080611c8260005490565b90506001851015611c9257600194505b80841115611c9e578093505b6000611ca987611936565b905084861015611cc85785850381811015611cc2578091505b50611ccc565b5060005b6000816001600160401b03811115611ce657611ce661310b565b604051908082528060200260200182016040528015611d0f578160200160208202803683370190505b50905081600003611d25579350611dd492505050565b6000611d3088611fcd565b905060008160400151611d41575080515b885b888114158015611d535750848714155b15611dc857611d618161298e565b92508260400151611dc05782516001600160a01b031615611d8157825191505b8a6001600160a01b0316826001600160a01b031603611dc05780848880600101995081518110611db357611db3613b45565b6020026020010181815250505b600101611d43565b50505092835250909150505b9392505050565b611de3612579565b600f805461ffff19166101009315159390930260ff191692909217901515179055565b81611e1081612431565b61112f8383612a6f565b6060600080601b546001600160401b03811115611e3957611e3961310b565b604051908082528060200260200182016040528015611e7f57816020015b604080518082019091526000815260606020820152815260200190600190039081611e575790505b50905060015b601b548111611c31576000818152601d6020908152604080832054815180830183526001600160a01b03909116808252808552601c8452919093206001018054919392830191611ed49061392f565b80601f0160208091040260200160405190810160405280929190818152602001828054611f009061392f565b8015611f4d5780601f10611f2257610100808354040283529160200191611f4d565b820191906000526020600020905b815481529060010190602001808311611f3057829003601f168201915b5050505050815250838581518110611f6757611f67613b45565b60209081029190910101525060019283019201611e85565b611f87612579565b601655565b836001600160a01b0381163314611fa657611fa633612431565b611fb285858585612ade565b5050505050565b611fc1612579565b601261126f8282613a83565b611fd5612e46565b611fdd612e46565b6001831080611fee57506000548310155b15611ff95792915050565b6120028361298e565b90508060400151156120145792915050565b611dd483612b22565b612025612579565b600d55565b6060612035826123fc565b61205457816040516376f74dcb60e11b8152600401610ea0919061308c565b60145460ff166120ee576012805461206b9061392f565b80601f01602080910402602001604051908101604052809291908181526020018280546120979061392f565b80156120e45780601f106120b9576101008083540402835291602001916120e4565b820191906000526020600020905b8154815290600101906020018083116120c757829003601f168201915b5050505050610e0f565b6000601180546120fd9061392f565b9050116121195760405180602001604052806000815250610e0f565b601161212483612b3b565b601360405160200161213893929190613c0f565b60405160208183030381529060405292915050565b612155612579565b600f80549115156101000261ff0019909216919091179055565b612177612579565b6014805460ff1916911515919091179055565b601554601754600d54336000908152601e60205260408120548592916121b084846138a3565b90506000846121be33611936565b60015460005403600019016121d391906138bb565b6121dd91906138bb565b905060006121eb86856138bb565b905082341015612212573483604051639224270f60e01b8152600401610ea092919061383f565b600a5482111561223a57600a5460405163243acc1d60e11b8152610ea091849160040161383f565b8786111561225f578588604051631716f01560e11b8152600401610ea092919061383f565b868111156122845780876040516327d4050360e01b8152600401610ea092919061383f565b600f5460ff166122a757604051630224f08b60e11b815260040160405180910390fd5b6122b1338a612322565b5050336000908152601e602052604090208054909701909655505050505050565b6122da612579565b6001600160a01b0381166123005760405162461bcd60e51b8152600401610ea090613c33565b61230981612a1d565b50565b6000826123198584612bce565b14949350505050565b60008054908290036123475760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b17831790558284019083908390600080516020613dbe8339815191528180a4600183015b8181146123d25780836000600080516020613dbe833981519152600080a46001016123ac565b50816000036123f357604051622e076360e81b815260040160405180910390fd5b60005550505050565b600081600111158015612410575060005482105b8015610e0f575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b1561230957604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906124799030908590600401613c7d565b602060405180830381865afa158015612496573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ba9190613ca3565b6123095780604051633b79c77360e21b8152600401610ea09190613027565b60006124e4826117b1565b9050336001600160a01b0382161461251d576125008133610d20565b61251d576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6008546001600160a01b0316331461124e5760405162461bcd60e51b8152600401610ea090613cf9565b60006125ae826129ae565b9050836001600160a01b0316816001600160a01b0316146125e15760405162a1148160e81b815260040160405180910390fd5b6000828152600660205260409020805461260d8187335b6001600160a01b039081169116811491141790565b6126385761261b8633610d20565b61263857604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661265f57604051633a954ecd60e21b815260040160405180910390fd5b801561266a57600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b841690036126fc576001840160008181526004602052604081205490036126fa5760005481146126fa5760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b0316600080516020613dbe83398151915260405160405180910390a45b505050505050565b6002600954036127565760405162461bcd60e51b8152600401610ea090613d3d565b6002600955565b6001600160a01b0382166000908152601c6020526040902054156127c4576001600160a01b0382166000818152601c6020818152604080842080548552601d835290842080546001600160a01b0319168617905593909252905260010161112f8282613a83565b601b80549060006127d4836139d8565b9091555050601b80546000908152601d6020908152604080832080546001600160a01b0319166001600160a01b0388169081179091558151808301835294548552848301868152908452601c9092529091208251815590516001820190611fb29082613a83565b61112f83838360405180602001604052806000815250611f8c565b6000612861836129ae565b90508060008061287f86600090815260066020526040902080549091565b9150915084156128bf576128948184336125f8565b6128bf576128a28333610d20565b6128bf57604051632ce44b5f60e11b815260040160405180910390fd5b80156128ca57600082555b6001600160a01b038316600081815260056020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260046020526040812091909155600160e11b85169003612958576001860160008181526004602052604081205490036129565760005481146129565760008181526004602052604090208590555b505b60405186906000906001600160a01b03861690600080516020613dbe833981519152908390a45050600180548101905550505050565b612996612e46565b600082815260046020526040902054610e0f90612c13565b60008180600111612a0457600054811015612a045760008181526004602052604081205490600160e01b82169003612a02575b80600003611dd45750600019016000818152600460205260409020546129e1565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b3360008181526007602090815260408083206001600160a01b038716808552925291829020805460ff191685151517905590519091907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190612ad2908590612eba565b60405180910390a35050565b612ae984848461116e565b6001600160a01b0383163b1561119357612b0584848484612c56565b611193576040516368d2bf6b60e11b815260040160405180910390fd5b612b2a612e46565b610e0f612b36836129ae565b612c13565b60606000612b4883612d42565b60010190506000816001600160401b03811115612b6757612b6761310b565b6040519080825280601f01601f191660200182016040528015612b91576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612b9b575b509392505050565b600081815b8451811015612bc657612bff82868381518110612bf257612bf2613b45565b6020026020010151612e1a565b915080612c0b816139d8565b915050612bd3565b612c1b612e46565b6001600160a01b03821681526001600160401b0360a083901c166020820152600160e01b82161515604082015260e89190911c606082015290565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612c8b903390899088908890600401613d4d565b6020604051808303816000875af1925050508015612cc6575060408051601f3d908101601f19168201909252612cc391810190613d9c565b60015b612d24573d808015612cf4576040519150601f19603f3d011682016040523d82523d6000602084013e612cf9565b606091505b508051600003612d1c576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612d815772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612dad576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612dcb57662386f26fc10000830492506010015b6305f5e1008310612de3576305f5e100830492506008015b6127108310612df757612710830492506004015b60648310612e09576064830492506002015b600a8310610e0f5760010192915050565b6000818310612e36576000828152602084905260409020611dd4565b5060009182526020526040902090565b60408051608081018252600080825260208201819052918101829052606081019190915290565b6001600160e01b031981165b811461230957600080fd5b8035610e0f81612e6d565b600060208284031215612ea457612ea4600080fd5b6000612d3a8484612e84565b8015155b82525050565b60208101610e0f8284612eb0565b80612e79565b8035610e0f81612ec8565b60008083601f840112612eee57612eee600080fd5b5081356001600160401b03811115612f0857612f08600080fd5b602083019150836020820283011115612f2357612f23600080fd5b9250929050565b600080600060408486031215612f4257612f42600080fd5b6000612f4e8686612ece565b93505060208401356001600160401b03811115612f6d57612f6d600080fd5b612f7986828701612ed9565b92509250509250925092565b60005b83811015612fa0578181015183820152602001612f88565b50506000910152565b6000612fb3825190565b808452602084019350612fca818560208601612f85565b601f01601f19169290920192915050565b60208082528101611dd48184612fa9565b60006020828403121561300157613001600080fd5b6000612d3a8484612ece565b60006001600160a01b038216610e0f565b612eb48161300d565b60208101610e0f828461301e565b612e798161300d565b8035610e0f81613035565b6000806040838503121561305f5761305f600080fd5b600061306b858561303e565b925050602061307c85828601612ece565b9150509250929050565b80612eb4565b60208101610e0f8284613086565b6000602082840312156130af576130af600080fd5b6000612d3a848461303e565b6000806000606084860312156130d3576130d3600080fd5b60006130df868661303e565b93505060206130f08682870161303e565b925050604061310186828701612ece565b9150509250925092565b634e487b7160e01b600052604160045260246000fd5b601f19601f83011681018181106001600160401b03821117156131465761314661310b565b6040525050565b600061315860405190565b90506131648282613121565b919050565b60006001600160401b038211156131825761318261310b565b601f19601f83011660200192915050565b82818337506000910152565b60006131b26131ad84613169565b61314d565b9050828152602081018484840111156131cd576131cd600080fd5b612bc6848285613193565b600082601f8301126131ec576131ec600080fd5b8135612d3a84826020860161319f565b60006020828403121561321157613211600080fd5b81356001600160401b0381111561322a5761322a600080fd5b612d3a848285016131d8565b6000610e0f6001600160a01b03831661324d565b90565b6001600160a01b031690565b6000610e0f82613236565b6000610e0f82613259565b612eb481613264565b60208101610e0f828461326f565b8051600090604084019061329a8582613086565b50602083015184820360208601526132b28282612fa9565b95945050505050565b6000611dd48383613286565b60006132d1825190565b808452602084019350836020820285016132eb8560200190565b8060005b85811015613320578484038952815161330885826132bb565b94506020830160209a909a01999250506001016132ef565b5091979650505050505050565b60208082528101611dd481846132c7565b6040810161334c8285613086565b8181036020830152612d3a8184612fa9565b801515612e79565b8035610e0f8161335e565b60006020828403121561338657613386600080fd5b6000612d3a8484613366565b600080602083850312156133a8576133a8600080fd5b82356001600160401b038111156133c1576133c1600080fd5b6133cd85828601612ed9565b92509250509250929050565b6001600160401b038116612eb4565b62ffffff8116612eb4565b80516080830190613404848261301e565b50602082015161341760208501826133d9565b50604082015161342a6040850182612eb0565b50606082015161119360608501826133e8565b600061344983836133f3565b505060800190565b600061345b825190565b80845260209384019383018060005b8381101561348f57815161347e888261343d565b97506020830192505060010161346a565b509495945050505050565b60208082528101611dd48184613451565b60006001600160401b038211156134c4576134c461310b565b5060209081020190565b60006134dc6131ad846134ab565b838152905060208082019084028301858111156134fb576134fb600080fd5b835b8181101561351f57806135108882612ece565b845250602092830192016134fd565b5050509392505050565b600082601f83011261353d5761353d600080fd5b8135612d3a8482602086016134ce565b60006020828403121561356257613562600080fd5b81356001600160401b0381111561357b5761357b600080fd5b612d3a84828501613529565b60006135938383613086565b505060200190565b60006135a5825190565b80845260209384019383018060005b8381101561348f5781516135c88882613587565b9750602083019250506001016135b4565b60208082528101611dd4818461359b565b805160009060608401906135fe858261301e565b5060208301516136116020860182613086565b50604083015184820360408601526132b28282612fa9565b6000611dd483836135ea565b600061363f825190565b808452602084019350836020820285016136598560200190565b8060005b8581101561332057848403895281516136768582613629565b94506020830160209a909a019992505060010161365d565b60208082528101611dd48184613635565b6000806000606084860312156136b7576136b7600080fd5b60006136c3868661303e565b93505060206130f086828701612ece565b600080604083850312156136ea576136ea600080fd5b60006136f68585613366565b925050602061307c85828601613366565b6000806040838503121561371d5761371d600080fd5b60006136f6858561303e565b8051600090604084019061329a858261301e565b6000611dd48383613729565b6000613753825190565b8084526020840193508360208202850161376d8560200190565b8060005b85811015613320578484038952815161378a858261373d565b94506020830160209a909a0199925050600101613771565b60208082528101611dd48184613749565b600080600080608085870312156137cc576137cc600080fd5b60006137d8878761303e565b94505060206137e98782880161303e565b93505060406137fa87828801612ece565b92505060608501356001600160401b0381111561381957613819600080fd5b613825878288016131d8565b91505092959194509250565b60808101610e0f82846133f3565b6040810161384d8285613086565b611dd46020830184613086565b6000806040838503121561387057613870600080fd5b600061387c858561303e565b925050602061307c8582860161303e565b634e487b7160e01b600052601160045260246000fd5b818102808215838204851417611c3157611c3161388d565b80820180821115610e0f57610e0f61388d565b6000610e0f8260601b90565b6000610e0f826138ce565b612eb46138f18261300d565b6138da565b600061390282846138e5565b50601401919050565b6040810161384d828561301e565b634e487b7160e01b600052602260045260246000fd5b60028104600182168061394357607f821691505b60208210810361395557613955613919565b50919050565b6000610e0f8261324a565b60608101613974828661301e565b613981602083018561301e565b612d3a6040830184613086565b6060810161399c828661301e565b81810360208301526139ae8185612fa9565b9050612d3a6040830184613086565b606081016139cb828661301e565b6139816020830185613086565b600060001982036139eb576139eb61388d565b5060010190565b6000610e0f61324a8381565b613a07836139f2565b815460001960089490940293841b1916921b91909117905550565b600061112f8184846139fe565b8181101561126f57613a42600082613a22565b600101613a2f565b601f82111561112f576000818152602090206020601f85010481016020851015613a715750805b611fb26020601f860104830182613a2f565b81516001600160401b03811115613a9c57613a9c61310b565b613aa6825461392f565b613ab1828285613a4a565b6020601f831160018114613ae55760008415613acd5750858201515b600019600886021c198116600286021786555061272c565b600085815260208120601f198616915b82811015613b155788850151825560209485019460019092019101613af5565b86831015613b315784890151600019601f89166008021c191682555b600160028802018855505050505050505050565b634e487b7160e01b600052603260045260246000fd5b60608101613b69828661301e565b81810360208301526139ae818561359b565b60008154613b888161392f565b600182168015613b9f5760018114613bb457613be4565b60ff1983168652811515820286019350613be4565b60008581526020902060005b83811015613bdc57815488820152600190910190602001613bc0565b838801955050505b50505092915050565b6000613bf7825190565b613c05818560208601612f85565b9290920192915050565b6000613c1b8286613b7b565b9150613c278285613bed565b91506132b28284613b7b565b60208082528101610e0f81602681527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160208201526564647265737360d01b604082015260600190565b60408101613c8b828561301e565b611dd4602083018461301e565b8051610e0f8161335e565b600060208284031215613cb857613cb8600080fd5b6000612d3a8484613c98565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910190815260005b5060200190565b60208082528101610e0f81613cc4565b601f81526000602082017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081529150613cf2565b60208082528101610e0f81613d09565b60808101613d5b828761301e565b613d68602083018661301e565b613d756040830185613086565b8181036060830152613d878184612fa9565b9695505050505050565b8051610e0f81612e6d565b600060208284031215613db157613db1600080fd5b6000612d3a8484613d9156feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212202f738bf41087032a48833d2510cd32b3c95675821ff5185200308cc6c624d8fe64736f6c63430008130033
Loading...
Loading
Loading...
Loading
[ 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.