ERC-721
Overview
Max Total Supply
6,257 HLKEYS
Holders
1,674
Market
Onchain Market Cap
-
Circulating Supply Market Cap
-
Other Info
Token Contract
Balance
1 HLKEYSLoading...
Loading
Loading...
Loading
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
HyperliquidKeys
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 1000 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; import {ERC721A} from "erc721a/contracts/ERC721A.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol"; import {BitMaps} from "@openzeppelin/contracts/utils/structs/BitMaps.sol"; import {OperatorFilterer} from "closedsea/src/OperatorFilterer.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; error MaxSupplyExceeded(); error PublicSaleClosed(); error TransfersLocked(); error NotAllowedByRegistry(); error RegistryNotSet(); error WrongWeiSent(); error MaxFeeExceeded(); error InputLengthsMismatch(); error InvalidMerkleProof(); error InvalidLaunchpadFee(); error InvalidLaunchpadFeeAddress(); error TransferFailed(); error PaymentTransferFailed(); error FeeTransferFailed(); error NotEnoughBalance(); error NotEnoughAllowance(); interface ICreatorToken { event TransferValidatorUpdated(address oldValidator, address newValidator); function getTransferValidator() external view returns (address validator); function getTransferValidationFunction() external view returns (bytes4 functionSignature, bool isViewFunction); function setTransferValidator(address validator) external; } interface ITransferValidator { function validateTransfer(address caller, address from, address to, uint256 tokenId) external view; } interface IRegistry { function isAllowedOperator(address operator) external view returns (bool); } interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function isApprovedForAll(address owner, address spender) external view returns (bool); function approve(address spender, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function balanceOf(address account) external view returns (uint256); } contract HyperliquidKeys is Ownable, OperatorFilterer, ERC2981, ERC721A, ICreatorToken { // Transfer validator for royalty enforcement address private _transferValidator; bytes4 private constant VALIDATE_TRANSFER_SELECTOR = 0xcaee23ea; // Launchpad Fee uint256 public launchpadFee = 26096033402922755; uint256 public launchpadCutBps = 0; address public launchpadFeeAddress = 0xbDb9e0b47a02C45E3b50973A18452DC23CE72697; event LaunchpadFeeSent(address indexed feeAddress, uint256 feeAmount); event TokenPaymentSent(address indexed recipient, uint256 amount); using BitMaps for BitMaps.BitMap; address public currency = 0x0000000000000000000000000000000000000000; uint256 public maxSupply = 10000; bool public operatorFilteringEnabled = true; bool public initialTransferLockOn = true; bool public isRegistryActive; address public registryAddress; string private _baseTokenURI = "https://genesis-metas.mintify.xyz/hyperevm"; string private _placeHolderTokenURI = ""; // Phase 1 variables uint256 public startTimePhase1 = 1750305600; uint256 public endTimePhase1 = 1750338000; uint256 public maxSupplyPhase1 = 5876; uint256 public totalSupplyPhase1; uint256 public pricePhase1 = 0; uint256 public maxPerWalletPhase1 = 0; bytes32 public merkleRootPhase1 = 0x3726914b51d4b60aaba722c284cb8648a15831f6316ca744407965e55d95be47; mapping(address => uint256) public walletMintsPhase1; // Phase 2 variables uint256 public startTimePhase2 = 1750338000; uint256 public endTimePhase2 = 1750343400; uint256 public maxSupplyPhase2 = 0; uint256 public totalSupplyPhase2; uint256 public pricePhase2 = 0; uint256 public maxPerWalletPhase2 = 2; bytes32 public merkleRootPhase2 = 0xe85971a0d5c3b9c1d33fe6b97cdbe510fd02ca438225658b065071d29b5d1661; mapping(address => uint256) public walletMintsPhase2; // Phase 3 variables uint256 public startTimePhase3 = 1750341600; uint256 public endTimePhase3 = 1750345200; uint256 public maxSupplyPhase3 = 0; uint256 public totalSupplyPhase3; uint256 public pricePhase3 = 0; uint256 public maxPerWalletPhase3 = 1; bytes32 public merkleRootPhase3 = 0xaf84bebcb9a378648f4e6717ae2881049ee392d65fdcb6d3201504737b631996; mapping(address => uint256) public walletMintsPhase3; constructor() ERC721A("HyperliquidKeys", "HLKEYS") Ownable(msg.sender) { // Register operator filtering _registerForOperatorFiltering(); // Set initial royalty _setDefaultRoyalty(0xB123AAA255A9388D5D4555A5ea7ef7CF524e04d3, 500); } // Phase 1 Mint function mintPhase1(bytes32[] calldata merkleProof, uint256 allowance, uint256 quantity) external payable { // Check if mint has started if (startTimePhase1 != 0 && block.timestamp < startTimePhase1) { revert PublicSaleClosed(); } // Check if mint has ended if (endTimePhase1 != 0 && block.timestamp > endTimePhase1) { revert PublicSaleClosed(); } // Check if the mint will exceed total max supply, if set. if (maxSupply != 0 && totalSupply() + quantity > maxSupply) { revert MaxSupplyExceeded(); } // If phase max supply is set, check if it's exceeded if (maxSupplyPhase1 != 0 && totalSupplyPhase1 + quantity > maxSupplyPhase1) { revert MaxSupplyExceeded(); } uint256 totalOrderPrice = (pricePhase1 + launchpadFee) * quantity; // Check if the price is correct if native currency if (currency == address(0)) { if (msg.value != totalOrderPrice) { revert WrongWeiSent(); } } else { // Check if the user has enough balance and allowance if ERC20 IERC20 token = IERC20(currency); if (token.balanceOf(msg.sender) < totalOrderPrice) { revert NotEnoughBalance(); } if (token.allowance(msg.sender, address(this)) < totalOrderPrice) { revert NotEnoughAllowance(); } } // Check if the allowance has been reached if (walletMintsPhase1[msg.sender] + quantity > allowance) { revert MaxSupplyExceeded(); } // Check if the quantity is within the allowance if (quantity > allowance) { revert MaxSupplyExceeded(); } // Check if the proof is set, and if it is valid if (merkleRootPhase1 != bytes32(0)) { // Using Merkle Tree bytes32 node = keccak256(abi.encodePacked(msg.sender, allowance)); if (!MerkleProof.verify(merkleProof, merkleRootPhase1, node)) { revert InvalidMerkleProof(); } } // Check if we have exceeded phase max per wallet if set. if (maxPerWalletPhase1 != 0 && walletMintsPhase1[msg.sender] + quantity > maxPerWalletPhase1) { revert MaxSupplyExceeded(); } uint256 flatFees = 0; // Get the Launchpad Flat Fee if set if (launchpadFee != 0 && launchpadFeeAddress != address(0)) { flatFees = launchpadFee * quantity; } // Get the Launchpad Percentage Fee if set uint256 percentageFees = 0; if (launchpadCutBps != 0 && launchpadFeeAddress != address(0)) { percentageFees = (launchpadCutBps * (totalOrderPrice - flatFees)) / 10000; } // Send the fees uint256 totalFees = flatFees + percentageFees; if (totalFees != 0) { _sendLaunchpadFee(totalFees); } // Transfer the payment if ERC20 if (currency != address(0) && totalOrderPrice > totalFees) { _sendTokenPayment(address(this), totalOrderPrice - totalFees); } // Mint the tokens walletMintsPhase1[msg.sender] += quantity; totalSupplyPhase1 += quantity; _mint(msg.sender, quantity); } // Phase 2 Mint function mintPhase2(bytes32[] calldata merkleProof, uint256 quantity) external payable { // Check if mint has started if (startTimePhase2 != 0 && block.timestamp < startTimePhase2) { revert PublicSaleClosed(); } // Check if mint has ended if (endTimePhase2 != 0 && block.timestamp > endTimePhase2) { revert PublicSaleClosed(); } // Check if the mint will exceed total max supply, if set. if (maxSupply != 0 && totalSupply() + quantity > maxSupply) { revert MaxSupplyExceeded(); } // If phase max supply is set, check if it's exceeded if (maxSupplyPhase2 != 0 && totalSupplyPhase2 + quantity > maxSupplyPhase2) { revert MaxSupplyExceeded(); } uint256 totalOrderPrice = (pricePhase2 + launchpadFee) * quantity; // Check if the price is correct if native currency if (currency == address(0)) { if (msg.value != totalOrderPrice) { revert WrongWeiSent(); } } else { // Check if the user has enough balance and allowance if ERC20 IERC20 token = IERC20(currency); if (token.balanceOf(msg.sender) < totalOrderPrice) { revert NotEnoughBalance(); } if (token.allowance(msg.sender, address(this)) < totalOrderPrice) { revert NotEnoughAllowance(); } } // Check if the proof is set, and if it is valid if (merkleRootPhase2 != bytes32(0)) { // Using Merkle Tree bytes32 node = keccak256(abi.encodePacked(msg.sender)); if (!MerkleProof.verify(merkleProof, merkleRootPhase2, node)) { revert InvalidMerkleProof(); } } // Check if we have exceeded phase max per wallet if set. if (maxPerWalletPhase2 != 0 && walletMintsPhase2[msg.sender] + quantity > maxPerWalletPhase2) { revert MaxSupplyExceeded(); } uint256 flatFees = 0; // Get the Launchpad Flat Fee if set if (launchpadFee != 0 && launchpadFeeAddress != address(0)) { flatFees = launchpadFee * quantity; } // Get the Launchpad Percentage Fee if set uint256 percentageFees = 0; if (launchpadCutBps != 0 && launchpadFeeAddress != address(0)) { percentageFees = (launchpadCutBps * (totalOrderPrice - flatFees)) / 10000; } // Send the fees uint256 totalFees = flatFees + percentageFees; if (totalFees != 0) { _sendLaunchpadFee(totalFees); } // Transfer the payment if ERC20 if (currency != address(0) && totalOrderPrice > totalFees) { _sendTokenPayment(address(this), totalOrderPrice - totalFees); } // Mint the tokens walletMintsPhase2[msg.sender] += quantity; totalSupplyPhase2 += quantity; _mint(msg.sender, quantity); } // Phase 3 Mint function mintPhase3(bytes32[] calldata merkleProof, uint256 quantity) external payable { // Check if mint has started if (startTimePhase3 != 0 && block.timestamp < startTimePhase3) { revert PublicSaleClosed(); } // Check if mint has ended if (endTimePhase3 != 0 && block.timestamp > endTimePhase3) { revert PublicSaleClosed(); } // Check if the mint will exceed total max supply, if set. if (maxSupply != 0 && totalSupply() + quantity > maxSupply) { revert MaxSupplyExceeded(); } // If phase max supply is set, check if it's exceeded if (maxSupplyPhase3 != 0 && totalSupplyPhase3 + quantity > maxSupplyPhase3) { revert MaxSupplyExceeded(); } uint256 totalOrderPrice = (pricePhase3 + launchpadFee) * quantity; // Check if the price is correct if native currency if (currency == address(0)) { if (msg.value != totalOrderPrice) { revert WrongWeiSent(); } } else { // Check if the user has enough balance and allowance if ERC20 IERC20 token = IERC20(currency); if (token.balanceOf(msg.sender) < totalOrderPrice) { revert NotEnoughBalance(); } if (token.allowance(msg.sender, address(this)) < totalOrderPrice) { revert NotEnoughAllowance(); } } // Check if the proof is set, and if it is valid if (merkleRootPhase3 != bytes32(0)) { // Using Merkle Tree bytes32 node = keccak256(abi.encodePacked(msg.sender)); if (!MerkleProof.verify(merkleProof, merkleRootPhase3, node)) { revert InvalidMerkleProof(); } } // Check if we have exceeded phase max per wallet if set. if (maxPerWalletPhase3 != 0 && walletMintsPhase3[msg.sender] + quantity > maxPerWalletPhase3) { revert MaxSupplyExceeded(); } uint256 flatFees = 0; // Get the Launchpad Flat Fee if set if (launchpadFee != 0 && launchpadFeeAddress != address(0)) { flatFees = launchpadFee * quantity; } // Get the Launchpad Percentage Fee if set uint256 percentageFees = 0; if (launchpadCutBps != 0 && launchpadFeeAddress != address(0)) { percentageFees = (launchpadCutBps * (totalOrderPrice - flatFees)) / 10000; } // Send the fees uint256 totalFees = flatFees + percentageFees; if (totalFees != 0) { _sendLaunchpadFee(totalFees); } // Transfer the payment if ERC20 if (currency != address(0) && totalOrderPrice > totalFees) { _sendTokenPayment(address(this), totalOrderPrice - totalFees); } // Mint the tokens walletMintsPhase3[msg.sender] += quantity; totalSupplyPhase3 += quantity; _mint(msg.sender, quantity); } // ========================================================================= // Owner Only Functions // ========================================================================= // Owner airdrop function airDrop(address[] memory users, uint256[] memory amounts) external onlyOwner { // iterate over users and amounts if (users.length != amounts.length) { revert InputLengthsMismatch(); } for (uint256 i; i < users.length;) { if (maxSupply != 0 && totalSupply() + amounts[i] > maxSupply) { revert MaxSupplyExceeded(); } _mint(users[i], amounts[i]); unchecked { ++i; } } } // Owner unrestricted mint function ownerMint(address to, uint256 quantity) external onlyOwner { if (maxSupply != 0 && totalSupply() + quantity > maxSupply) { revert MaxSupplyExceeded(); } _mint(to, quantity); } // Set max supply function setMaxSupply(uint256 newMaxSupply) external onlyOwner { maxSupply = newMaxSupply; } // Withdraw Balance to owner function withdraw() public onlyOwner { (bool success, ) = payable(owner()).call{value: address(this).balance}(""); if (!success) { revert TransferFailed(); } } // Withdraw Balance to Address function withdrawTo(address payable _to) public onlyOwner { (bool success, ) = payable(_to).call{value: address(this).balance}(""); if (!success) { revert TransferFailed(); } } // Withdraw ERC20 to owner function withdrawERC20(address tokenAddress) public onlyOwner { IERC20 token = IERC20(tokenAddress); uint256 balance = token.balanceOf(address(this)); if (balance == 0) { revert TransferFailed(); } bool success = token.transfer(owner(), balance); if (!success) { revert TransferFailed(); } } // Withdraw ERC20 to Address function withdrawERC20To(address tokenAddress, address to) public onlyOwner { IERC20 token = IERC20(tokenAddress); uint256 balance = token.balanceOf(address(this)); if (balance == 0) { revert TransferFailed(); } bool success = token.transfer(to, balance); if (!success) { revert TransferFailed(); } } // Send Launchpad Flat Fee function _sendLaunchpadFee(uint256 feeAmount) private { if (feeAmount == 0) { revert InvalidLaunchpadFee(); } if (launchpadFeeAddress == address(0)) { revert InvalidLaunchpadFeeAddress(); } if (currency == address(0)) { (bool success, ) = payable(launchpadFeeAddress).call{value: feeAmount}(""); if (!success) { revert FeeTransferFailed(); } } else { // Transfer the fee in the specified currency IERC20 token = IERC20(currency); try token.transferFrom(msg.sender, launchpadFeeAddress, feeAmount) { // Success } catch { revert FeeTransferFailed(); } } emit LaunchpadFeeSent(launchpadFeeAddress, feeAmount); } // Send ERC20 Payment function _sendTokenPayment(address recipient, uint256 amount) private { if (amount == 0) { revert PaymentTransferFailed(); } if (recipient == address(0)) { revert PaymentTransferFailed(); } // Transfer the fee in the specified currency IERC20 token = IERC20(currency); try token.transferFrom(msg.sender, address(this), amount) { // Success } catch { revert PaymentTransferFailed(); } emit TokenPaymentSent(recipient, amount); } // Break Transfer Lock function breakLock() external onlyOwner { initialTransferLockOn = false; } // Set the start time for the phase function setStartTimePhase1(uint256 newStartTime) external onlyOwner { startTimePhase1 = newStartTime; } // Set the end time for the phase function setEndTimePhase1(uint256 newEndTime) external onlyOwner { endTimePhase1 = newEndTime; } // Set the max supply for the phase function setMaxSupplyPhase1(uint256 newMaxSupply) external onlyOwner { maxSupplyPhase1 = newMaxSupply; } // Set max per wallet for the phase function setMaxPerWalletPhase1(uint256 newMaxPerWallet) external onlyOwner { maxPerWalletPhase1 = newMaxPerWallet; } // Set the price for the phase function setPricePhase1(uint256 newPrice) external onlyOwner { pricePhase1 = newPrice; } // Set the merkle root for the phase function setMerkleRootPhase1(bytes32 newMerkleRoot) external onlyOwner { merkleRootPhase1 = newMerkleRoot; }// Set the start time for the phase function setStartTimePhase2(uint256 newStartTime) external onlyOwner { startTimePhase2 = newStartTime; } // Set the end time for the phase function setEndTimePhase2(uint256 newEndTime) external onlyOwner { endTimePhase2 = newEndTime; } // Set the max supply for the phase function setMaxSupplyPhase2(uint256 newMaxSupply) external onlyOwner { maxSupplyPhase2 = newMaxSupply; } // Set max per wallet for the phase function setMaxPerWalletPhase2(uint256 newMaxPerWallet) external onlyOwner { maxPerWalletPhase2 = newMaxPerWallet; } // Set the price for the phase function setPricePhase2(uint256 newPrice) external onlyOwner { pricePhase2 = newPrice; } // Set the merkle root for the phase function setMerkleRootPhase2(bytes32 newMerkleRoot) external onlyOwner { merkleRootPhase2 = newMerkleRoot; }// Set the start time for the phase function setStartTimePhase3(uint256 newStartTime) external onlyOwner { startTimePhase3 = newStartTime; } // Set the end time for the phase function setEndTimePhase3(uint256 newEndTime) external onlyOwner { endTimePhase3 = newEndTime; } // Set the max supply for the phase function setMaxSupplyPhase3(uint256 newMaxSupply) external onlyOwner { maxSupplyPhase3 = newMaxSupply; } // Set max per wallet for the phase function setMaxPerWalletPhase3(uint256 newMaxPerWallet) external onlyOwner { maxPerWalletPhase3 = newMaxPerWallet; } // Set the price for the phase function setPricePhase3(uint256 newPrice) external onlyOwner { pricePhase3 = newPrice; } // Set the merkle root for the phase function setMerkleRootPhase3(bytes32 newMerkleRoot) external onlyOwner { merkleRootPhase3 = newMerkleRoot; } // ========================================================================= // ERC721A Misc // ========================================================================= function _startTokenId() internal pure override returns (uint256) { return 1; } // ========================================================================= // ICreatorToken Implementation // ========================================================================= function getTransferValidator() external view override returns (address validator) { return _transferValidator; } function getTransferValidationFunction() external pure override returns (bytes4 functionSignature, bool isViewFunction) { return (VALIDATE_TRANSFER_SELECTOR, true); } function setTransferValidator(address validator) external override onlyOwner { address oldValidator = _transferValidator; _transferValidator = validator; emit TransferValidatorUpdated(oldValidator, validator); } // ========================================================================= // Operator filtering // ========================================================================= function setApprovalForAll(address operator, bool approved) public override (ERC721A) onlyAllowedOperatorApproval(operator) { if (initialTransferLockOn) { revert TransfersLocked(); } super.setApprovalForAll(operator, approved); } function approve(address operator, uint256 tokenId) public payable override (ERC721A) onlyAllowedOperatorApproval(operator) { if (initialTransferLockOn) { revert TransfersLocked(); } super.approve(operator, tokenId); } function transferFrom(address from, address to, uint256 tokenId) public payable override (ERC721A) onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId) public payable override (ERC721A) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override (ERC721A) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } function setOperatorFilteringEnabled(bool value) public onlyOwner { operatorFilteringEnabled = value; } function _operatorFilteringEnabled() internal view override returns (bool) { return operatorFilteringEnabled; } // ========================================================================= // Registry Check // ========================================================================= function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal override { // Check transfer lock if (initialTransferLockOn && from != address(0) && to != address(0)) { revert TransfersLocked(); } // Check your custom registry if (!_isValidAgainstRegistry(msg.sender)) { revert NotAllowedByRegistry(); } // Add royalty enforcement validation (skip for minting) if (from != address(0) && _transferValidator != address(0)) { // For ERC721A batch transfers, validate each token for (uint256 i = 0; i < quantity; i++) { ITransferValidator(_transferValidator).validateTransfer( msg.sender, from, to, startTokenId + i ); } } super._beforeTokenTransfers(from, to, startTokenId, quantity); } function _isValidAgainstRegistry(address operator) internal view returns (bool) { if (isRegistryActive) { IRegistry registry = IRegistry(registryAddress); return registry.isAllowedOperator(operator); } return true; } function setIsRegistryActive(bool _isRegistryActive) external onlyOwner { if (registryAddress == address(0)) revert RegistryNotSet(); isRegistryActive = _isRegistryActive; } function setRegistryAddress(address _registryAddress) external onlyOwner { registryAddress = _registryAddress; } // ========================================================================= // ERC165 // ========================================================================= function supportsInterface(bytes4 interfaceId) public view override (ERC721A, ERC2981) returns (bool) { return interfaceId == type(ICreatorToken).interfaceId || ERC721A.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); } // ========================================================================= // ERC2891 // ========================================================================= function setDefaultRoyalty(address receiver, uint96 feeNumerator) public onlyOwner { if (feeNumerator > 1000) { revert MaxFeeExceeded(); } _setDefaultRoyalty(receiver, feeNumerator); } function setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) external onlyOwner { if (feeNumerator > 1000) { revert MaxFeeExceeded(); } _setTokenRoyalty(tokenId, receiver, feeNumerator); } // ========================================================================= // Metadata // ========================================================================= function setBaseURI(string calldata baseURI) external onlyOwner { _baseTokenURI = baseURI; } function setPlaceholderBaseURI(string calldata placeholderURI) external onlyOwner { _placeHolderTokenURI = placeholderURI; } function _baseURI() internal view override returns (string memory) { return _baseTokenURI; } function _placeHolderURI() internal view returns (string memory) { return _placeHolderTokenURI; } function tokenURI(uint256 tokenId) public view override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); string memory placeHolderURI = _placeHolderURI(); if (bytes(baseURI).length != 0) { return string(abi.encodePacked(baseURI, "/", _toString(tokenId), ".json")); } if (bytes(placeHolderURI).length != 0) { return placeHolderURI; } return ""; } }
// 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 packed) { if (_startTokenId() <= tokenId) { packed = _packedOwnerships[tokenId]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // If the data at the starting slot does not exist, start the scan. if (packed == 0) { if (tokenId >= _currentIndex) revert OwnerQueryForNonexistentToken(); // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `tokenId` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. for (;;) { unchecked { packed = _packedOwnerships[--tokenId]; } if (packed == 0) continue; return packed; } } // Otherwise, the data exists and is not burned. We can skip the scan. // This is possible because we have already achieved the target condition. // This saves 2143 gas on transfers of initialized tokens. 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. See {ERC721A-_approve}. * * Requirements: * * - The caller must own the token or be an approved operator. */ function approve(address to, uint256 tokenId) public payable virtual override { _approve(to, tokenId, true); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); 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, ''); } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Equivalent to `_approve(to, tokenId, false)`. */ function _approve(address to, uint256 tokenId) internal virtual { _approve(to, tokenId, false); } /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - `tokenId` must exist. * * Emits an {Approval} event. */ function _approve( address to, uint256 tokenId, bool approvalCheck ) internal virtual { address owner = ownerOf(tokenId); if (approvalCheck) if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _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; /** * @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.4; /// @notice Optimized and flexible operator filterer to abide to OpenSea's /// mandatory on-chain royalty enforcement in order for new collections to /// receive royalties. /// For more information, see: /// See: https://github.com/ProjectOpenSea/operator-filter-registry abstract contract OperatorFilterer { /// @dev The default OpenSea operator blocklist subscription. address internal constant _DEFAULT_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6; /// @dev The OpenSea operator filter registry. address internal constant _OPERATOR_FILTER_REGISTRY = 0x000000000000AAeB6D7670E522A718067333cd4E; /// @dev Registers the current contract to OpenSea's operator filter, /// and subscribe to the default OpenSea operator blocklist. /// Note: Will not revert nor update existing settings for repeated registration. function _registerForOperatorFiltering() internal virtual { _registerForOperatorFiltering(_DEFAULT_SUBSCRIPTION, true); } /// @dev Registers the current contract to OpenSea's operator filter. /// Note: Will not revert nor update existing settings for repeated registration. function _registerForOperatorFiltering(address subscriptionOrRegistrantToCopy, bool subscribe) internal virtual { /// @solidity memory-safe-assembly assembly { let functionSelector := 0x7d3e3dbe // `registerAndSubscribe(address,address)`. // Clean the upper 96 bits of `subscriptionOrRegistrantToCopy` in case they are dirty. subscriptionOrRegistrantToCopy := shr(96, shl(96, subscriptionOrRegistrantToCopy)) for {} iszero(subscribe) {} { if iszero(subscriptionOrRegistrantToCopy) { functionSelector := 0x4420e486 // `register(address)`. break } functionSelector := 0xa0af2903 // `registerAndCopyEntries(address,address)`. break } // Store the function selector. mstore(0x00, shl(224, functionSelector)) // Store the `address(this)`. mstore(0x04, address()) // Store the `subscriptionOrRegistrantToCopy`. mstore(0x24, subscriptionOrRegistrantToCopy) // Register into the registry. if iszero(call(gas(), _OPERATOR_FILTER_REGISTRY, 0, 0x00, 0x44, 0x00, 0x04)) { // If the function selector has not been overwritten, // it is an out-of-gas error. if eq(shr(224, mload(0x00)), functionSelector) { // To prevent gas under-estimation. revert(0, 0) } } // Restore the part of the free memory pointer that was overwritten, // which is guaranteed to be zero, because of Solidity's memory size limits. mstore(0x24, 0) } } /// @dev Modifier to guard a function and revert if the caller is a blocked operator. modifier onlyAllowedOperator(address from) virtual { if (from != msg.sender) { if (!_isPriorityOperator(msg.sender)) { if (_operatorFilteringEnabled()) _revertIfBlocked(msg.sender); } } _; } /// @dev Modifier to guard a function from approving a blocked operator.. modifier onlyAllowedOperatorApproval(address operator) virtual { if (!_isPriorityOperator(operator)) { if (_operatorFilteringEnabled()) _revertIfBlocked(operator); } _; } /// @dev Helper function that reverts if the `operator` is blocked by the registry. function _revertIfBlocked(address operator) private view { /// @solidity memory-safe-assembly assembly { // Store the function selector of `isOperatorAllowed(address,address)`, // shifted left by 6 bytes, which is enough for 8tb of memory. // We waste 6-3 = 3 bytes to save on 6 runtime gas (PUSH1 0x224 SHL). mstore(0x00, 0xc6171134001122334455) // Store the `address(this)`. mstore(0x1a, address()) // Store the `operator`. mstore(0x3a, operator) // `isOperatorAllowed` always returns true if it does not revert. if iszero(staticcall(gas(), _OPERATOR_FILTER_REGISTRY, 0x16, 0x44, 0x00, 0x00)) { // Bubble up the revert if the staticcall reverts. returndatacopy(0x00, 0x00, returndatasize()) revert(0x00, returndatasize()) } // We'll skip checking if `from` is inside the blacklist. // Even though that can block transferring out of wrapper contracts, // we don't want tokens to be stuck. // Restore the part of the free memory pointer that was overwritten, // which is guaranteed to be zero, if less than 8tb of memory is used. mstore(0x3a, 0) } } /// @dev For deriving contracts to override, so that operator filtering /// can be turned on / off. /// Returns true by default. function _operatorFilteringEnabled() internal view virtual returns (bool) { return true; } /// @dev For deriving contracts to override, so that preferred marketplaces can /// skip operator filtering, helping users save gas. /// Returns false for all inputs by default. function _isPriorityOperator(address) internal view virtual returns (bool) { return false; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../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. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. * * NOTE: ERC-2981 allows setting the royalty to 100% of the price. In that case all the price would be sent to the * royalty receiver and 0 tokens to the seller. Contracts dealing with royalty should consider empty transfers. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/common/ERC2981.sol) pragma solidity ^0.8.20; import {IERC2981} from "../../interfaces/IERC2981.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the ERC. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 tokenId => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator); /** * @dev The default royalty receiver is invalid. */ error ERC2981InvalidDefaultRoyaltyReceiver(address receiver); /** * @dev The royalty set for a specific `tokenId` is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator); /** * @dev The royalty receiver for `tokenId` is invalid. */ error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver); /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) public view virtual returns (address receiver, uint256 amount) { RoyaltyInfo storage _royaltyInfo = _tokenRoyaltyInfo[tokenId]; address royaltyReceiver = _royaltyInfo.receiver; uint96 royaltyFraction = _royaltyInfo.royaltyFraction; if (royaltyReceiver == address(0)) { royaltyReceiver = _defaultRoyaltyInfo.receiver; royaltyFraction = _defaultRoyaltyInfo.royaltyFraction; } uint256 royaltyAmount = (salePrice * royaltyFraction) / _feeDenominator(); return (royaltyReceiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidDefaultRoyaltyReceiver(address(0)); } _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0)); } _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/Hashes.sol) pragma solidity ^0.8.20; /** * @dev Library of standard hash functions. * * _Available since v5.1._ */ library Hashes { /** * @dev Commutative Keccak256 hash of a sorted pair of bytes32. Frequently used when working with merkle proofs. * * NOTE: Equivalent to the `standardNodeHash` in our https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. */ function commutativeKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32) { return a < b ? efficientKeccak256(a, b) : efficientKeccak256(b, a); } /** * @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory. */ function efficientKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32 value) { assembly ("memory-safe") { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MerkleProof.sol) // This file was procedurally generated from scripts/generate/templates/MerkleProof.js. pragma solidity ^0.8.20; import {Hashes} from "./Hashes.sol"; /** * @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. * * IMPORTANT: Consider memory side-effects when using custom hashing functions * that access memory in an unsafe way. * * NOTE: This library supports proof verification for merkle trees built using * custom _commutative_ hashing functions (i.e. `H(a, b) == H(b, a)`). Proving * leaf inclusion in trees built using non-commutative hashing functions requires * additional logic that is not supported by this library. */ library MerkleProof { /** *@dev The multiproof provided is not valid. */ error MerkleProofInvalidMultiproof(); /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. * * This version handles proofs in memory with the default hashing function. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProof(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 leaves & pre-images are assumed to be sorted. * * This version handles proofs in memory with the default hashing function. */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]); } return computedHash; } /** * @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. * * This version handles proofs in memory with a custom hashing function. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf, function(bytes32, bytes32) view returns (bytes32) hasher ) internal view returns (bool) { return processProof(proof, leaf, hasher) == 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 leaves & pre-images are assumed to be sorted. * * This version handles proofs in memory with a custom hashing function. */ function processProof( bytes32[] memory proof, bytes32 leaf, function(bytes32, bytes32) view returns (bytes32) hasher ) internal view returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = hasher(computedHash, proof[i]); } return computedHash; } /** * @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. * * This version handles proofs in calldata with the default hashing function. */ 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 leaves & pre-images are assumed to be sorted. * * This version handles proofs in calldata with the default hashing function. */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]); } return computedHash; } /** * @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. * * This version handles proofs in calldata with a custom hashing function. */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf, function(bytes32, bytes32) view returns (bytes32) hasher ) internal view returns (bool) { return processProofCalldata(proof, leaf, hasher) == 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 leaves & pre-images are assumed to be sorted. * * This version handles proofs in calldata with a custom hashing function. */ function processProofCalldata( bytes32[] calldata proof, bytes32 leaf, function(bytes32, bytes32) view returns (bytes32) hasher ) internal view returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = hasher(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}. * * This version handles multiproofs in memory with the default hashing function. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. * * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`. * The `leaves` must be validated independently. See {processMultiProof}. */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(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. * * This version handles multiproofs in memory with the default hashing function. * * 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). * * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op, * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not * validating the leaves elsewhere. */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofFlagsLen = proofFlags.length; // Check proof validity. if (leavesLen + proof.length != proofFlagsLen + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](proofFlagsLen); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < proofFlagsLen; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = Hashes.commutativeKeccak256(a, b); } if (proofFlagsLen > 0) { if (proofPos != proof.length) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[proofFlagsLen - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @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}. * * This version handles multiproofs in memory with a custom hashing function. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. * * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`. * The `leaves` must be validated independently. See {processMultiProof}. */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves, function(bytes32, bytes32) view returns (bytes32) hasher ) internal view returns (bool) { return processMultiProof(proof, proofFlags, leaves, hasher) == 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. * * This version handles multiproofs in memory with a custom hashing function. * * 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). * * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op, * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not * validating the leaves elsewhere. */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves, function(bytes32, bytes32) view returns (bytes32) hasher ) internal view returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofFlagsLen = proofFlags.length; // Check proof validity. if (leavesLen + proof.length != proofFlagsLen + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](proofFlagsLen); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < proofFlagsLen; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = hasher(a, b); } if (proofFlagsLen > 0) { if (proofPos != proof.length) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[proofFlagsLen - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @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}. * * This version handles multiproofs in calldata with the default hashing function. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. * * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`. * The `leaves` must be validated independently. See {processMultiProofCalldata}. */ 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. * * This version handles multiproofs in calldata with the default hashing function. * * 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). * * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op, * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not * validating the leaves elsewhere. */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofFlagsLen = proofFlags.length; // Check proof validity. if (leavesLen + proof.length != proofFlagsLen + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](proofFlagsLen); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < proofFlagsLen; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = Hashes.commutativeKeccak256(a, b); } if (proofFlagsLen > 0) { if (proofPos != proof.length) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[proofFlagsLen - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @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}. * * This version handles multiproofs in calldata with a custom hashing function. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. * * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`. * The `leaves` must be validated independently. See {processMultiProofCalldata}. */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves, function(bytes32, bytes32) view returns (bytes32) hasher ) internal view returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves, hasher) == 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. * * This version handles multiproofs in calldata with a custom hashing function. * * 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). * * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op, * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not * validating the leaves elsewhere. */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves, function(bytes32, bytes32) view returns (bytes32) hasher ) internal view returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofFlagsLen = proofFlags.length; // Check proof validity. if (leavesLen + proof.length != proofFlagsLen + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](proofFlagsLen); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < proofFlagsLen; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = hasher(a, b); } if (proofFlagsLen > 0) { if (proofPos != proof.length) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[proofFlagsLen - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/BitMaps.sol) pragma solidity ^0.8.20; /** * @dev Library for managing uint256 to bool mapping in a compact and efficient way, provided the keys are sequential. * Largely inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor]. * * BitMaps pack 256 booleans across each bit of a single 256-bit slot of `uint256` type. * Hence booleans corresponding to 256 _sequential_ indices would only consume a single slot, * unlike the regular `bool` which would consume an entire slot for a single value. * * This results in gas savings in two ways: * * - Setting a zero value to non-zero only once every 256 times * - Accessing the same warm slot for every 256 _sequential_ indices */ library BitMaps { struct BitMap { mapping(uint256 bucket => uint256) _data; } /** * @dev Returns whether the bit at `index` is set. */ function get(BitMap storage bitmap, uint256 index) internal view returns (bool) { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); return bitmap._data[bucket] & mask != 0; } /** * @dev Sets the bit at `index` to the boolean `value`. */ function setTo(BitMap storage bitmap, uint256 index, bool value) internal { if (value) { set(bitmap, index); } else { unset(bitmap, index); } } /** * @dev Sets the bit at `index`. */ function set(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] |= mask; } /** * @dev Unsets the bit at `index`. */ function unset(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] &= ~mask; } }
{ "evmVersion": "cancun", "libraries": {}, "metadata": { "appendCBOR": true, "bytecodeHash": "ipfs", "useLiteralContent": false }, "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "remappings": [ "@rari-capital/solmate/=lib/solmate/", "ds-test/=lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "murky/=lib/murky/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "solarray/=lib/solarray/src/", "solady/=lib/solady/", "seaport-sol/=lib/seaport-sol/", "seaport-types/=lib/seaport-types/", "seaport-core/=lib/seaport-core/", "seaport/=contracts/", "closedsea/=lib/closedsea/", "erc721a/=lib/closedsea/lib/erc721a/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "erc721a-upgradeable/=lib/closedsea/lib/erc721a-upgradeable/contracts/", "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts-upgradeable/=lib/closedsea/lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "operator-filter-registry/=lib/closedsea/lib/operator-filter-registry/", "solmate/=lib/solmate/src/" ], "viaIR": false }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidDefaultRoyalty","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidDefaultRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidTokenRoyalty","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidTokenRoyaltyReceiver","type":"error"},{"inputs":[],"name":"FeeTransferFailed","type":"error"},{"inputs":[],"name":"InputLengthsMismatch","type":"error"},{"inputs":[],"name":"InvalidLaunchpadFee","type":"error"},{"inputs":[],"name":"InvalidLaunchpadFeeAddress","type":"error"},{"inputs":[],"name":"InvalidMerkleProof","type":"error"},{"inputs":[],"name":"MaxFeeExceeded","type":"error"},{"inputs":[],"name":"MaxSupplyExceeded","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotAllowedByRegistry","type":"error"},{"inputs":[],"name":"NotEnoughAllowance","type":"error"},{"inputs":[],"name":"NotEnoughBalance","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"PaymentTransferFailed","type":"error"},{"inputs":[],"name":"PublicSaleClosed","type":"error"},{"inputs":[],"name":"RegistryNotSet","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"TransfersLocked","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"WrongWeiSent","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"feeAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"}],"name":"LaunchpadFeeSent","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":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenPaymentSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"airDrop","outputs":[],"stateMutability":"nonpayable","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":"breakLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currency","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endTimePhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endTimePhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endTimePhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidationFunction","outputs":[{"internalType":"bytes4","name":"functionSignature","type":"bytes4"},{"internalType":"bool","name":"isViewFunction","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"address","name":"validator","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialTransferLockOn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRegistryActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchpadCutBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchpadFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchpadFeeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWalletPhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWalletPhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWalletPhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyPhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyPhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyPhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootPhase1","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootPhase2","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootPhase3","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintPhase1","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintPhase2","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintPhase3","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorFilteringEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newEndTime","type":"uint256"}],"name":"setEndTimePhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newEndTime","type":"uint256"}],"name":"setEndTimePhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newEndTime","type":"uint256"}],"name":"setEndTimePhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isRegistryActive","type":"bool"}],"name":"setIsRegistryActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxPerWallet","type":"uint256"}],"name":"setMaxPerWalletPhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxPerWallet","type":"uint256"}],"name":"setMaxPerWalletPhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxPerWallet","type":"uint256"}],"name":"setMaxPerWalletPhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"setMaxSupplyPhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"setMaxSupplyPhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"setMaxSupplyPhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newMerkleRoot","type":"bytes32"}],"name":"setMerkleRootPhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newMerkleRoot","type":"bytes32"}],"name":"setMerkleRootPhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newMerkleRoot","type":"bytes32"}],"name":"setMerkleRootPhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setOperatorFilteringEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"placeholderURI","type":"string"}],"name":"setPlaceholderBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPricePhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPricePhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPricePhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registryAddress","type":"address"}],"name":"setRegistryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStartTime","type":"uint256"}],"name":"setStartTimePhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStartTime","type":"uint256"}],"name":"setStartTimePhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStartTime","type":"uint256"}],"name":"setStartTimePhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"}],"name":"setTransferValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTimePhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTimePhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTimePhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupplyPhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupplyPhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupplyPhase3","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":[{"internalType":"address","name":"","type":"address"}],"name":"walletMintsPhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"walletMintsPhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"walletMintsPhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawERC20To","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
665cb63441072703600c555f600d55600e805473bdb9e0b47a02c45e3b50973a18452dc23ce726976001600160a01b031991821617909155600f805490911690556127106010556011805461ffff191661010117905560e0604052602a6080818152906147b860a0396012906100759082610443565b5060408051602081019091525f81526013906100919082610443565b506368538b4060145563685409d06015556116f46016555f6018555f6019557f3726914b51d4b60aaba722c284cb8648a15831f6316ca744407965e55d95be475f1b601a5563685409d0601c556368541ee8601d555f601e555f60205560026021557fe85971a0d5c3b9c1d33fe6b97cdbe510fd02ca438225658b065071d29b5d16615f1b60225563685417e060245563685425f06025555f6026555f60285560016029557faf84bebcb9a378648f4e6717ae2881049ee392d65fdcb6d3201504737b6319965f1b602a55348015610167575f5ffd5b50604080518082018252600f81526e48797065726c69717569644b65797360881b60208083019190915282518084019093526006835265484c4b45595360d01b908301529033806101d257604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6101db8161022a565b5060056101e88382610443565b5060066101f58282610443565b5050600160035550610205610279565b61022573b123aaa255a9388d5d4555a5ea7ef7cf524e04d36101f461029a565b6104fd565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610298733cc6cdda760b79bafa08df41ecfa224f810dceb6600161033c565b565b6127106001600160601b0382168110156102d957604051636f483d0960e01b81526001600160601b0383166004820152602481018290526044016101c9565b6001600160a01b03831661030257604051635b6cc80560e11b81525f60048201526024016101c9565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600155565b6001600160a01b0390911690637d3e3dbe8161036957826103625750634420e486610369565b5063a0af29035b8060e01b5f52306004528260245260045f60445f5f6daaeb6d7670e522a718067333cd4e5af16103a257805f5160e01c036103a2575f5ffd5b505f6024525050565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806103d357607f821691505b6020821081036103f157634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561043e57805f5260205f20601f840160051c8101602085101561041c5750805b601f840160051c820191505b8181101561043b575f8155600101610428565b50505b505050565b81516001600160401b0381111561045c5761045c6103ab565b6104708161046a84546103bf565b846103f7565b6020601f8211600181146104a2575f831561048b5750848201515b5f19600385901b1c1916600184901b17845561043b565b5f84815260208120601f198516915b828110156104d157878501518255602094850194600190920191016104b1565b50848210156104ee57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b6142ae8061050a5f395ff3fe6080604052600436106105c1575f3560e01c806370a08231116102f0578063abd017ea11610191578063e1136b3d116100e7578063f2fde38b11610092578063f695963b1161006d578063f695963b14610fbe578063fa18eb5114610fd1578063fb796e6c14610fe4575f5ffd5b8063f2fde38b14610f6b578063f3f119f114610f8a578063f4f3b20014610f9f575f5ffd5b8063e5e2a0f6116100c2578063e5e2a0f614610ee9578063e985e9c514610efe578063ed9aab5114610f45575f5ffd5b8063e1136b3d14610e96578063e56e9ac014610eb5578063e5a6b10f14610eca575f5ffd5b8063c87b56dd11610147578063d2762b4611610122578063d2762b4614610e4d578063d5abeb0114610e62578063e079e46114610e77575f5ffd5b8063c87b56dd14610e04578063cafd705f14610e23578063d1c026c914610e38575f5ffd5b8063b7c0b8e811610177578063b7c0b8e814610db3578063b88d4fde14610dd2578063c3d923a614610de5575f5ffd5b8063abd017ea14610d75578063ac19701b14610d94575f5ffd5b806395d89b4111610246578063a42c05ba116101fc578063aa0678ff116101d7578063aa0678ff14610d22578063aa60bdd014610d37578063ab7b499314610d56575f5ffd5b8063a42c05ba14610cda578063a70138c114610cef578063a9fc664e14610d03575f5ffd5b806396db3e891161022c57806396db3e8914610c7d5780639e5f94a714610c9c578063a22cb46514610cbb575f5ffd5b806395d89b4114610c5657806396ce3bfa14610c6a575f5ffd5b806379544c86116102a6578063871215d411610281578063871215d414610c105780638da5cb5b14610c255780638e9a85f314610c41575f5ffd5b806379544c8614610bc75780637f371aa014610bdc578063858633f214610bf1575f5ffd5b806371be5e14116102d657806371be5e1414610b6a57806372b0d90c14610b8957806376ee015314610ba8575f5ffd5b806370a0823114610b37578063715018a614610b56575f5ffd5b80633ccfd60b11610465578063545b70b2116103bb5780635d99a0cf1161036657806365216a411161034157806365216a4114610ada578063691ce97014610af95780636f8b44b014610b18575f5ffd5b80635d99a0cf14610a915780636352211e14610aa657806364f52a1f14610ac5575f5ffd5b80635944c753116103965780635944c75314610a4857806359a2f3bd14610a675780635c1afecb14610a7c575f5ffd5b8063545b70b2146109f557806355f5f06614610a0a57806355f804b314610a29575f5ffd5b806346fff98d1161041b5780634ed69eaf116103f65780634ed69eaf146109ac5780634f115db1146109cb57806354389437146109e0575f5ffd5b806346fff98d1461094f578063484b973c1461096e5780634b21839e1461098d575f5ffd5b806341d94c981161044b57806341d94c981461090857806342842e0e1461091d578063462fed1414610930575f5ffd5b80633ccfd60b146108df578063406466a7146108f3575f5ffd5b806312b365101161051a578063251c21ec116104d057806330db1d5b116104ab57806330db1d5b146108805780633bf303941461089f5780633c6d5762146108b4575f5ffd5b8063251c21ec146108045780632a55205a1461082357806330a0896514610861575f5ffd5b8063189ce8b111610500578063189ce8b1146107b357806321b8acd7146107d257806323b872dd146107f1575f5ffd5b806312b365101461077a57806318160ddd14610798575f5ffd5b8063081812fc1161057a5780630c92b631116105555780630c92b631146106f05780630d4c18281461070f5780630d705df61461073a575f5ffd5b8063081812fc14610689578063095ea7b3146106c0578063098144d4146106d3575f5ffd5b806304634d8d116105aa57806304634d8d1461063257806306fdde03146106535780630759f2d814610674575f5ffd5b80630141a449146105c557806301ffc9a714610603575b5f5ffd5b3480156105d0575f5ffd5b506105f06105df3660046139d5565b602b6020525f908152604090205481565b6040519081526020015b60405180910390f35b34801561060e575f5ffd5b5061062261061d366004613a05565b610ffd565b60405190151581526020016105fa565b34801561063d575f5ffd5b5061065161064c366004613a3b565b61104f565b005b34801561065e575f5ffd5b50610667611096565b6040516105fa9190613a9c565b34801561067f575f5ffd5b506105f060165481565b348015610694575f5ffd5b506106a86106a3366004613aae565b611126565b6040516001600160a01b0390911681526020016105fa565b6106516106ce366004613ac5565b611181565b3480156106de575f5ffd5b50600b546001600160a01b03166106a8565b3480156106fb575f5ffd5b5061065161070a366004613aae565b6111ce565b34801561071a575f5ffd5b506105f06107293660046139d5565b60236020525f908152604090205481565b348015610745575f5ffd5b50604080517fcaee23ea00000000000000000000000000000000000000000000000000000000815260016020820152016105fa565b348015610785575f5ffd5b5060115461062290610100900460ff1681565b3480156107a3575f5ffd5b50600454600354035f19016105f0565b3480156107be575f5ffd5b506106516107cd366004613aef565b6111db565b3480156107dd575f5ffd5b506106516107ec366004613aae565b611322565b6106516107ff366004613b26565b61132f565b34801561080f575f5ffd5b5061065161081e366004613aae565b611365565b34801561082e575f5ffd5b5061084261083d366004613b64565b611372565b604080516001600160a01b0390931683526020830191909152016105fa565b34801561086c575f5ffd5b50600e546106a8906001600160a01b031681565b34801561088b575f5ffd5b5061065161089a366004613aae565b611406565b3480156108aa575f5ffd5b506105f0601e5481565b3480156108bf575f5ffd5b506105f06108ce3660046139d5565b601b6020525f908152604090205481565b3480156108ea575f5ffd5b50610651611413565b3480156108fe575f5ffd5b506105f060285481565b348015610913575f5ffd5b506105f060155481565b61065161092b366004613b26565b61148f565b34801561093b575f5ffd5b5061065161094a366004613aae565b6114bf565b34801561095a575f5ffd5b50610651610969366004613b91565b6114cc565b348015610979575f5ffd5b50610651610988366004613ac5565b611539565b348015610998575f5ffd5b506106516109a7366004613aae565b611591565b3480156109b7575f5ffd5b506106516109c6366004613bac565b61159e565b3480156109d6575f5ffd5b506105f0601c5481565b3480156109eb575f5ffd5b506105f060245481565b348015610a00575f5ffd5b506105f060175481565b348015610a15575f5ffd5b50610651610a24366004613aae565b6115b3565b348015610a34575f5ffd5b50610651610a43366004613bac565b6115c0565b348015610a53575f5ffd5b50610651610a62366004613c1a565b6115d5565b348015610a72575f5ffd5b506105f060215481565b348015610a87575f5ffd5b506105f0601f5481565b348015610a9c575f5ffd5b506105f060205481565b348015610ab1575f5ffd5b506106a8610ac0366004613aae565b611619565b348015610ad0575f5ffd5b506105f0601a5481565b348015610ae5575f5ffd5b50610651610af4366004613d27565b611623565b348015610b04575f5ffd5b50610651610b13366004613aae565b61171a565b348015610b23575f5ffd5b50610651610b32366004613aae565b611727565b348015610b42575f5ffd5b506105f0610b513660046139d5565b611734565b348015610b61575f5ffd5b5061065161179a565b348015610b75575f5ffd5b50610651610b84366004613aae565b6117ad565b348015610b94575f5ffd5b50610651610ba33660046139d5565b6117ba565b348015610bb3575f5ffd5b50610651610bc2366004613aae565b611832565b348015610bd2575f5ffd5b506105f0601d5481565b348015610be7575f5ffd5b506105f060265481565b348015610bfc575f5ffd5b50610651610c0b366004613aae565b61183f565b348015610c1b575f5ffd5b506105f0600c5481565b348015610c30575f5ffd5b505f546001600160a01b03166106a8565b348015610c4c575f5ffd5b506105f060275481565b348015610c61575f5ffd5b5061066761184c565b610651610c78366004613e2d565b61185b565b348015610c88575f5ffd5b50610651610c97366004613aae565b611cae565b348015610ca7575f5ffd5b50610651610cb6366004613aae565b611cbb565b348015610cc6575f5ffd5b50610651610cd5366004613e75565b611cc8565b348015610ce5575f5ffd5b506105f0602a5481565b348015610cfa575f5ffd5b50610651611d10565b348015610d0e575f5ffd5b50610651610d1d3660046139d5565b611d25565b348015610d2d575f5ffd5b506105f060145481565b348015610d42575f5ffd5b50610651610d51366004613aae565b611d9b565b348015610d61575f5ffd5b50610651610d703660046139d5565b611da8565b348015610d80575f5ffd5b506011546106229062010000900460ff1681565b348015610d9f575f5ffd5b50610651610dae366004613aae565b611df1565b348015610dbe575f5ffd5b50610651610dcd366004613b91565b611dfe565b610651610de0366004613ea1565b611e19565b348015610df0575f5ffd5b50610651610dff366004613aae565b611e4a565b348015610e0f575f5ffd5b50610667610e1e366004613aae565b611e57565b348015610e2e575f5ffd5b506105f060295481565b348015610e43575f5ffd5b506105f060255481565b348015610e58575f5ffd5b506105f0600d5481565b348015610e6d575f5ffd5b506105f060105481565b348015610e82575f5ffd5b50610651610e91366004613aae565b611f0d565b348015610ea1575f5ffd5b50610651610eb0366004613aae565b611f1a565b348015610ec0575f5ffd5b506105f060195481565b348015610ed5575f5ffd5b50600f546106a8906001600160a01b031681565b348015610ef4575f5ffd5b506105f060185481565b348015610f09575f5ffd5b50610622610f18366004613aef565b6001600160a01b039182165f908152600a6020908152604080832093909416825291909152205460ff1690565b348015610f50575f5ffd5b506011546106a890630100000090046001600160a01b031681565b348015610f76575f5ffd5b50610651610f853660046139d5565b611f27565b348015610f95575f5ffd5b506105f060225481565b348015610faa575f5ffd5b50610651610fb93660046139d5565b611f7f565b610651610fcc366004613e2d565b6120c2565b610651610fdf366004613f63565b6124f7565b348015610fef575f5ffd5b506011546106229060ff1681565b5f6001600160e01b031982167fad0d7f6c00000000000000000000000000000000000000000000000000000000148061103a575061103a826129a9565b80611049575061104982612a28565b92915050565b611057612a75565b6103e8816bffffffffffffffffffffffff1611156110885760405163f4df6ae560e01b815260040160405180910390fd5b6110928282612aba565b5050565b6060600580546110a590613fb0565b80601f01602080910402602001604051908101604052809291908181526020018280546110d190613fb0565b801561111c5780601f106110f35761010080835404028352916020019161111c565b820191905f5260205f20905b8154815290600101906020018083116110ff57829003601f168201915b5050505050905090565b5f61113082612b9d565b611166576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505f908152600960205260409020546001600160a01b031690565b8160115460ff16156111965761119681612bd0565b601154610100900460ff16156111bf576040516336e278fd60e21b815260040160405180910390fd5b6111c98383612c0f565b505050565b6111d6612a75565b602655565b6111e3612a75565b6040516370a0823160e01b815230600482015282905f906001600160a01b038316906370a0823190602401602060405180830381865afa158015611229573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061124d9190613fe8565b9050805f0361126f576040516312171d8360e31b815260040160405180910390fd5b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152602482018390525f919084169063a9059cbb906044016020604051808303815f875af11580156112d7573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112fb9190613fff565b90508061131b576040516312171d8360e31b815260040160405180910390fd5b5050505050565b61132a612a75565b602455565b826001600160a01b03811633146113545760115460ff16156113545761135433612bd0565b61135f848484612c1b565b50505050565b61136d612a75565b601455565b5f82815260026020526040812080548291906001600160a01b03811690600160a01b90046bffffffffffffffffffffffff16816113cf5750506001546001600160a01b03811690600160a01b90046bffffffffffffffffffffffff165b5f6127106113eb6bffffffffffffffffffffffff84168961402e565b6113f59190614045565b9295509193505050505b9250929050565b61140e612a75565b602055565b61141b612a75565b5f80546040516001600160a01b039091169047908381818185875af1925050503d805f8114611465576040519150601f19603f3d011682016040523d82523d5f602084013e61146a565b606091505b505090508061148c576040516312171d8360e31b815260040160405180910390fd5b50565b826001600160a01b03811633146114b45760115460ff16156114b4576114b433612bd0565b61135f848484612e20565b6114c7612a75565b602155565b6114d4612a75565b601154630100000090046001600160a01b031661151d576040517fe048e71000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60118054911515620100000262ff000019909216919091179055565b611541612a75565b601054158015906115695750601054600454600354839190035f19016115679190614064565b115b1561158757604051638a164f6360e01b815260040160405180910390fd5b6110928282612e3a565b611599612a75565b601955565b6115a6612a75565b60136111c98284836140bb565b6115bb612a75565b601a55565b6115c8612a75565b60126111c98284836140bb565b6115dd612a75565b6103e8816bffffffffffffffffffffffff16111561160e5760405163f4df6ae560e01b815260040160405180910390fd5b6111c9838383612f72565b5f61104982613073565b61162b612a75565b8051825114611666576040517ffc4c603600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b82518110156111c957601054158015906116b8575060105482828151811061169257611692614175565b60200260200101516116ac6004546003545f199190030190565b6116b69190614064565b115b156116d657604051638a164f6360e01b815260040160405180910390fd5b6117128382815181106116eb576116eb614175565b602002602001015183838151811061170557611705614175565b6020026020010151612e3a565b600101611668565b611722612a75565b602555565b61172f612a75565b601055565b5f6001600160a01b038216611775576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b03165f9081526008602052604090205467ffffffffffffffff1690565b6117a2612a75565b6117ab5f6130fa565b565b6117b5612a75565b602855565b6117c2612a75565b5f816001600160a01b0316476040515f6040518083038185875af1925050503d805f811461180b576040519150601f19603f3d011682016040523d82523d5f602084013e611810565b606091505b5050905080611092576040516312171d8360e31b815260040160405180910390fd5b61183a612a75565b602955565b611847612a75565b601655565b6060600680546110a590613fb0565b601c541580159061186d5750601c5442105b1561188b57604051636ea7008360e11b815260040160405180910390fd5b601d541580159061189d5750601d5442115b156118bb57604051636ea7008360e11b815260040160405180910390fd5b601054158015906118e35750601054600454600354839190035f19016118e19190614064565b115b1561190157604051638a164f6360e01b815260040160405180910390fd5b601e54158015906119205750601e5481601f5461191e9190614064565b115b1561193e57604051638a164f6360e01b815260040160405180910390fd5b5f81600c546020546119509190614064565b61195a919061402e565b600f549091506001600160a01b03166119925780341461198d5760405163193e352b60e11b815260040160405180910390fd5b611aae565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa1580156119dc573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a009190613fe8565b1015611a1f5760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015611a69573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a8d9190613fe8565b1015611aac57604051634fd3af0760e01b815260040160405180910390fd5b505b60225415611b4d576040516bffffffffffffffffffffffff193360601b1660208201525f90603401604051602081830303815290604052805190602001209050611b2e8585808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506022549150849050613156565b611b4b5760405163582f497d60e11b815260040160405180910390fd5b505b60215415801590611b785750602154335f90815260236020526040902054611b76908490614064565b115b15611b9657604051638a164f6360e01b815260040160405180910390fd5b600c545f9015801590611bb35750600e546001600160a01b031615155b15611bc95782600c54611bc6919061402e565b90505b600d545f9015801590611be65750600e546001600160a01b031615155b15611c1257612710611bf88385614189565b600d54611c05919061402e565b611c0f9190614045565b90505b5f611c1d8284614064565b90508015611c2e57611c2e8161316b565b600f546001600160a01b031615801590611c4757508084115b15611c5f57611c5f30611c5a8387614189565b61334a565b335f9081526023602052604081208054879290611c7d908490614064565b9250508190555084601f5f828254611c959190614064565b90915550611ca590503386612e3a565b50505050505050565b611cb6612a75565b602255565b611cc3612a75565b602a55565b8160115460ff1615611cdd57611cdd81612bd0565b601154610100900460ff1615611d06576040516336e278fd60e21b815260040160405180910390fd5b6111c9838361346b565b611d18612a75565b6011805461ff0019169055565b611d2d612a75565b600b80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff1983168117909355604080519190921680825260208201939093527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a15050565b611da3612a75565b601c55565b611db0612a75565b601180546001600160a01b039092166301000000027fffffffffffffffffff0000000000000000000000000000000000000000ffffff909216919091179055565b611df9612a75565b601555565b611e06612a75565b6011805460ff1916911515919091179055565b836001600160a01b0381163314611e3e5760115460ff1615611e3e57611e3e33612bd0565b61131b858585856134d6565b611e52612a75565b601e55565b6060611e6282612b9d565b611e98576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f611ea161351a565b90505f611eac613529565b905081515f14611ee95781611ec085613538565b604051602001611ed19291906141b3565b60405160208183030381529060405292505050919050565b805115611ef7579392505050565b505060408051602081019091525f815292915050565b611f15612a75565b601d55565b611f22612a75565b601855565b611f2f612a75565b6001600160a01b038116611f76576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081525f60048201526024015b60405180910390fd5b61148c816130fa565b611f87612a75565b6040516370a0823160e01b815230600482015281905f906001600160a01b038316906370a0823190602401602060405180830381865afa158015611fcd573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ff19190613fe8565b9050805f03612013576040516312171d8360e31b815260040160405180910390fd5b5f826001600160a01b031663a9059cbb6120345f546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303815f875af115801561207e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120a29190613fff565b90508061135f576040516312171d8360e31b815260040160405180910390fd5b602454158015906120d4575060245442105b156120f257604051636ea7008360e11b815260040160405180910390fd5b60255415801590612104575060255442115b1561212257604051636ea7008360e11b815260040160405180910390fd5b6010541580159061214a5750601054600454600354839190035f19016121489190614064565b115b1561216857604051638a164f6360e01b815260040160405180910390fd5b602654158015906121875750602654816027546121859190614064565b115b156121a557604051638a164f6360e01b815260040160405180910390fd5b5f81600c546028546121b79190614064565b6121c1919061402e565b600f549091506001600160a01b03166121f9578034146121f45760405163193e352b60e11b815260040160405180910390fd5b612315565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa158015612243573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122679190613fe8565b10156122865760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa1580156122d0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122f49190613fe8565b101561231357604051634fd3af0760e01b815260040160405180910390fd5b505b602a54156123b4576040516bffffffffffffffffffffffff193360601b1660208201525f906034016040516020818303038152906040528051906020012090506123958585808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050602a549150849050613156565b6123b25760405163582f497d60e11b815260040160405180910390fd5b505b602954158015906123df5750602954335f908152602b60205260409020546123dd908490614064565b115b156123fd57604051638a164f6360e01b815260040160405180910390fd5b600c545f901580159061241a5750600e546001600160a01b031615155b156124305782600c5461242d919061402e565b90505b600d545f901580159061244d5750600e546001600160a01b031615155b156124795761271061245f8385614189565b600d5461246c919061402e565b6124769190614045565b90505b5f6124848284614064565b90508015612495576124958161316b565b600f546001600160a01b0316158015906124ae57508084115b156124c1576124c130611c5a8387614189565b335f908152602b6020526040812080548792906124df908490614064565b925050819055508460275f828254611c959190614064565b60145415801590612509575060145442105b1561252757604051636ea7008360e11b815260040160405180910390fd5b60155415801590612539575060155442115b1561255757604051636ea7008360e11b815260040160405180910390fd5b6010541580159061257f5750601054600454600354839190035f190161257d9190614064565b115b1561259d57604051638a164f6360e01b815260040160405180910390fd5b601654158015906125bc5750601654816017546125ba9190614064565b115b156125da57604051638a164f6360e01b815260040160405180910390fd5b5f81600c546018546125ec9190614064565b6125f6919061402e565b600f549091506001600160a01b031661262e578034146126295760405163193e352b60e11b815260040160405180910390fd5b61274a565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa158015612678573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061269c9190613fe8565b10156126bb5760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015612705573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127299190613fe8565b101561274857604051634fd3af0760e01b815260040160405180910390fd5b505b335f908152601b60205260409020548390612766908490614064565b111561278557604051638a164f6360e01b815260040160405180910390fd5b828211156127a657604051638a164f6360e01b815260040160405180910390fd5b601a541561284c576040516bffffffffffffffffffffffff193360601b166020820152603481018490525f9060540160405160208183030381529060405280519060200120905061282d8686808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050601a549150849050613156565b61284a5760405163582f497d60e11b815260040160405180910390fd5b505b601954158015906128775750601954335f908152601b6020526040902054612875908490614064565b115b1561289557604051638a164f6360e01b815260040160405180910390fd5b600c545f90158015906128b25750600e546001600160a01b031615155b156128c85782600c546128c5919061402e565b90505b600d545f90158015906128e55750600e546001600160a01b031615155b15612911576127106128f78385614189565b600d54612904919061402e565b61290e9190614045565b90505b5f61291c8284614064565b9050801561292d5761292d8161316b565b600f546001600160a01b03161580159061294657508084115b156129595761295930611c5a8387614189565b335f908152601b602052604081208054879290612977908490614064565b925050819055508460175f82825461298f9190614064565b9091555061299f90503386612e3a565b5050505050505050565b5f6301ffc9a760e01b6001600160e01b0319831614806129f257507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b806110495750506001600160e01b0319167f5b5e139f000000000000000000000000000000000000000000000000000000001490565b5f6001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061104957506301ffc9a760e01b6001600160e01b0319831614611049565b5f546001600160a01b031633146117ab576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401611f6d565b6127106bffffffffffffffffffffffff8216811015612b1c576040517f6f483d090000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff8316600482015260248101829052604401611f6d565b6001600160a01b038316612b5e576040517fb6d9900a0000000000000000000000000000000000000000000000000000000081525f6004820152602401611f6d565b50604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600155565b5f81600111158015612bb0575060035482105b80156110495750505f90815260076020526040902054600160e01b161590565b69c61711340011223344555f5230601a5280603a525f5f604460166daaeb6d7670e522a718067333cd4e5afa612c08573d5f5f3e3d5ffd5b5f603a5250565b6110928282600161357b565b5f612c2582613073565b9050836001600160a01b0316816001600160a01b031614612c72576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8281526009602052604090208054338082146001600160a01b03881690911417612cf3576001600160a01b0386165f908152600a6020908152604080832033845290915290205460ff16612cf3576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516612d33576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d408686866001613662565b8015612d4a575f82555b6001600160a01b038681165f9081526008602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260076020526040812091909155600160e11b84169003612dd757600184015f818152600760205260408120549003612dd5576003548114612dd5575f8181526007602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6111c983838360405180602001604052805f815250611e19565b6003545f829003612e77576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612e835f848385613662565b6001600160a01b0383165f8181526008602090815260408083208054680100000000000000018802019055848352600790915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612f2f5780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f5fa4600101612ef9565b50815f03612f69576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035550505050565b6127106bffffffffffffffffffffffff8216811015612fdb576040517fdfd1fc1b000000000000000000000000000000000000000000000000000000008152600481018590526bffffffffffffffffffffffff8316602482015260448101829052606401611f6d565b6001600160a01b038316613024576040517f969f0852000000000000000000000000000000000000000000000000000000008152600481018590525f6024820152604401611f6d565b506040805180820182526001600160a01b0393841681526bffffffffffffffffffffffff92831660208083019182525f968752600290529190942093519051909116600160a01b029116179055565b5f816001116130e157505f8181526007602052604081205490600160e01b821690036130e157805f036130dc5760035482106130c257604051636f96cda160e11b815260040160405180910390fd5b5b505f19015f8181526007602052604090205480156130c3575b919050565b604051636f96cda160e11b815260040160405180910390fd5b5f80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f8261316285846137be565b14949350505050565b805f036131a4576040517f5e2a89dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e546001600160a01b03166131e6576040517fcd0081c200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f546001600160a01b031661326d57600e546040515f916001600160a01b03169083908381818185875af1925050503d805f8114613240576040519150601f19603f3d011682016040523d82523d5f602084013e613245565b606091505b505090508061326757604051634033e4e360e01b815260040160405180910390fd5b50613305565b600f54600e546040516323b872dd60e01b81523360048201526001600160a01b0391821660248201526044810184905291169081906323b872dd906064016020604051808303815f875af19250505080156132e5575060408051601f3d908101601f191682019092526132e291810190613fff565b60015b61330257604051634033e4e360e01b815260040160405180910390fd5b50505b600e546040518281526001600160a01b03909116907f2b5dffd9914ddb43acdb6963bacf053a87bf9354300844f6339f17741e25145a9060200160405180910390a250565b805f0361336a57604051632ee66eed60e01b815260040160405180910390fd5b6001600160a01b03821661339157604051632ee66eed60e01b815260040160405180910390fd5b600f546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b039091169081906323b872dd906064016020604051808303815f875af1925050508015613405575060408051601f3d908101601f1916820190925261340291810190613fff565b60015b61342257604051632ee66eed60e01b815260040160405180910390fd5b50826001600160a01b03167f5bfd86dd1dfba5846abf8c8ff49e529e997ac11be6a5ad81501ef4418f3596898360405161345e91815260200190565b60405180910390a2505050565b335f818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6134e184848461132f565b6001600160a01b0383163b1561135f576134fd84848484613800565b61135f576040516368d2bf6b60e11b815260040160405180910390fd5b6060601280546110a590613fb0565b6060601380546110a590613fb0565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806135515750819003601f19909101908152919050565b5f61358583611619565b905081156135f957336001600160a01b038216146135f9576001600160a01b0381165f908152600a6020908152604080832033845290915290205460ff166135f9576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f83815260096020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b601154610100900460ff16801561368157506001600160a01b03841615155b801561369557506001600160a01b03831615155b156136b3576040516336e278fd60e21b815260040160405180910390fd5b6136bc336138e7565b6136f2576040517f4c80d8be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416158015906137145750600b546001600160a01b031615155b156137b9575f5b818110156137b757600b546001600160a01b031663caee23ea3387876137418689614064565b6040516001600160e01b031960e087901b1681526001600160a01b03948516600482015292841660248401529216604482015260648101919091526084015f6040518083038186803b158015613795575f5ffd5b505afa1580156137a7573d5f5f3e3d5ffd5b50506001909201915061371b9050565b505b61135f565b5f81815b84518110156137f8576137ee828683815181106137e1576137e1614175565b6020026020010151613998565b91506001016137c2565b509392505050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a029061383490339089908890889060040161421d565b6020604051808303815f875af192505050801561386e575060408051601f3d908101601f1916820190925261386b9181019061425d565b60015b6138ca573d80801561389b576040519150601f19603f3d011682016040523d82523d5f602084013e6138a0565b606091505b5080515f036138c2576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6011545f9062010000900460ff1615613990576011546040517fe18bc08a0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152630100000090920490911690819063e18bc08a90602401602060405180830381865afa158015613965573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906139899190613fff565b9392505050565b506001919050565b5f8183106139b2575f828152602084905260409020613989565b505f9182526020526040902090565b6001600160a01b038116811461148c575f5ffd5b5f602082840312156139e5575f5ffd5b8135613989816139c1565b6001600160e01b03198116811461148c575f5ffd5b5f60208284031215613a15575f5ffd5b8135613989816139f0565b80356bffffffffffffffffffffffff811681146130dc575f5ffd5b5f5f60408385031215613a4c575f5ffd5b8235613a57816139c1565b9150613a6560208401613a20565b90509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f6139896020830184613a6e565b5f60208284031215613abe575f5ffd5b5035919050565b5f5f60408385031215613ad6575f5ffd5b8235613ae1816139c1565b946020939093013593505050565b5f5f60408385031215613b00575f5ffd5b8235613b0b816139c1565b91506020830135613b1b816139c1565b809150509250929050565b5f5f5f60608486031215613b38575f5ffd5b8335613b43816139c1565b92506020840135613b53816139c1565b929592945050506040919091013590565b5f5f60408385031215613b75575f5ffd5b50508035926020909101359150565b801515811461148c575f5ffd5b5f60208284031215613ba1575f5ffd5b813561398981613b84565b5f5f60208385031215613bbd575f5ffd5b823567ffffffffffffffff811115613bd3575f5ffd5b8301601f81018513613be3575f5ffd5b803567ffffffffffffffff811115613bf9575f5ffd5b856020828401011115613c0a575f5ffd5b6020919091019590945092505050565b5f5f5f60608486031215613c2c575f5ffd5b833592506020840135613c3e816139c1565b9150613c4c60408501613a20565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613c9257613c92613c55565b604052919050565b5f67ffffffffffffffff821115613cb357613cb3613c55565b5060051b60200190565b5f82601f830112613ccc575f5ffd5b8135613cdf613cda82613c9a565b613c69565b8082825260208201915060208360051b860101925085831115613d00575f5ffd5b602085015b83811015613d1d578035835260209283019201613d05565b5095945050505050565b5f5f60408385031215613d38575f5ffd5b823567ffffffffffffffff811115613d4e575f5ffd5b8301601f81018513613d5e575f5ffd5b8035613d6c613cda82613c9a565b8082825260208201915060208360051b850101925087831115613d8d575f5ffd5b6020840193505b82841015613db8578335613da7816139c1565b825260209384019390910190613d94565b9450505050602083013567ffffffffffffffff811115613dd6575f5ffd5b613de285828601613cbd565b9150509250929050565b5f5f83601f840112613dfc575f5ffd5b50813567ffffffffffffffff811115613e13575f5ffd5b6020830191508360208260051b85010111156113ff575f5ffd5b5f5f5f60408486031215613e3f575f5ffd5b833567ffffffffffffffff811115613e55575f5ffd5b613e6186828701613dec565b909790965060209590950135949350505050565b5f5f60408385031215613e86575f5ffd5b8235613e91816139c1565b91506020830135613b1b81613b84565b5f5f5f5f60808587031215613eb4575f5ffd5b8435613ebf816139c1565b93506020850135613ecf816139c1565b925060408501359150606085013567ffffffffffffffff811115613ef1575f5ffd5b8501601f81018713613f01575f5ffd5b803567ffffffffffffffff811115613f1b57613f1b613c55565b613f2e601f8201601f1916602001613c69565b818152886020838501011115613f42575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b5f5f5f5f60608587031215613f76575f5ffd5b843567ffffffffffffffff811115613f8c575f5ffd5b613f9887828801613dec565b90989097506020870135966040013595509350505050565b600181811c90821680613fc457607f821691505b602082108103613fe257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215613ff8575f5ffd5b5051919050565b5f6020828403121561400f575f5ffd5b815161398981613b84565b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176110495761104961401a565b5f8261405f57634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156110495761104961401a565b601f8211156111c957805f5260205f20601f840160051c8101602085101561409c5750805b601f840160051c820191505b8181101561131b575f81556001016140a8565b67ffffffffffffffff8311156140d3576140d3613c55565b6140e7836140e18354613fb0565b83614077565b5f601f841160018114614118575f85156141015750838201355b5f19600387901b1c1916600186901b17835561131b565b5f83815260208120601f198716915b828110156141475786850135825560209485019460019092019101614127565b5086821015614163575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b5f52603260045260245ffd5b818103818111156110495761104961401a565b5f81518060208401855e5f93019283525090919050565b5f6141be828561419c565b7f2f0000000000000000000000000000000000000000000000000000000000000081526141ee600182018561419c565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050195945050505050565b6001600160a01b03851681526001600160a01b0384166020820152826040820152608060608201525f6142536080830184613a6e565b9695505050505050565b5f6020828403121561426d575f5ffd5b8151613989816139f056fea264697066735822122084aa9a9fca5db9c12d3f08586f5d7a5938a8e55d0d202bbecbd65b166570068b64736f6c634300081c003368747470733a2f2f67656e657369732d6d657461732e6d696e746966792e78797a2f687970657265766d
Deployed Bytecode
0x6080604052600436106105c1575f3560e01c806370a08231116102f0578063abd017ea11610191578063e1136b3d116100e7578063f2fde38b11610092578063f695963b1161006d578063f695963b14610fbe578063fa18eb5114610fd1578063fb796e6c14610fe4575f5ffd5b8063f2fde38b14610f6b578063f3f119f114610f8a578063f4f3b20014610f9f575f5ffd5b8063e5e2a0f6116100c2578063e5e2a0f614610ee9578063e985e9c514610efe578063ed9aab5114610f45575f5ffd5b8063e1136b3d14610e96578063e56e9ac014610eb5578063e5a6b10f14610eca575f5ffd5b8063c87b56dd11610147578063d2762b4611610122578063d2762b4614610e4d578063d5abeb0114610e62578063e079e46114610e77575f5ffd5b8063c87b56dd14610e04578063cafd705f14610e23578063d1c026c914610e38575f5ffd5b8063b7c0b8e811610177578063b7c0b8e814610db3578063b88d4fde14610dd2578063c3d923a614610de5575f5ffd5b8063abd017ea14610d75578063ac19701b14610d94575f5ffd5b806395d89b4111610246578063a42c05ba116101fc578063aa0678ff116101d7578063aa0678ff14610d22578063aa60bdd014610d37578063ab7b499314610d56575f5ffd5b8063a42c05ba14610cda578063a70138c114610cef578063a9fc664e14610d03575f5ffd5b806396db3e891161022c57806396db3e8914610c7d5780639e5f94a714610c9c578063a22cb46514610cbb575f5ffd5b806395d89b4114610c5657806396ce3bfa14610c6a575f5ffd5b806379544c86116102a6578063871215d411610281578063871215d414610c105780638da5cb5b14610c255780638e9a85f314610c41575f5ffd5b806379544c8614610bc75780637f371aa014610bdc578063858633f214610bf1575f5ffd5b806371be5e14116102d657806371be5e1414610b6a57806372b0d90c14610b8957806376ee015314610ba8575f5ffd5b806370a0823114610b37578063715018a614610b56575f5ffd5b80633ccfd60b11610465578063545b70b2116103bb5780635d99a0cf1161036657806365216a411161034157806365216a4114610ada578063691ce97014610af95780636f8b44b014610b18575f5ffd5b80635d99a0cf14610a915780636352211e14610aa657806364f52a1f14610ac5575f5ffd5b80635944c753116103965780635944c75314610a4857806359a2f3bd14610a675780635c1afecb14610a7c575f5ffd5b8063545b70b2146109f557806355f5f06614610a0a57806355f804b314610a29575f5ffd5b806346fff98d1161041b5780634ed69eaf116103f65780634ed69eaf146109ac5780634f115db1146109cb57806354389437146109e0575f5ffd5b806346fff98d1461094f578063484b973c1461096e5780634b21839e1461098d575f5ffd5b806341d94c981161044b57806341d94c981461090857806342842e0e1461091d578063462fed1414610930575f5ffd5b80633ccfd60b146108df578063406466a7146108f3575f5ffd5b806312b365101161051a578063251c21ec116104d057806330db1d5b116104ab57806330db1d5b146108805780633bf303941461089f5780633c6d5762146108b4575f5ffd5b8063251c21ec146108045780632a55205a1461082357806330a0896514610861575f5ffd5b8063189ce8b111610500578063189ce8b1146107b357806321b8acd7146107d257806323b872dd146107f1575f5ffd5b806312b365101461077a57806318160ddd14610798575f5ffd5b8063081812fc1161057a5780630c92b631116105555780630c92b631146106f05780630d4c18281461070f5780630d705df61461073a575f5ffd5b8063081812fc14610689578063095ea7b3146106c0578063098144d4146106d3575f5ffd5b806304634d8d116105aa57806304634d8d1461063257806306fdde03146106535780630759f2d814610674575f5ffd5b80630141a449146105c557806301ffc9a714610603575b5f5ffd5b3480156105d0575f5ffd5b506105f06105df3660046139d5565b602b6020525f908152604090205481565b6040519081526020015b60405180910390f35b34801561060e575f5ffd5b5061062261061d366004613a05565b610ffd565b60405190151581526020016105fa565b34801561063d575f5ffd5b5061065161064c366004613a3b565b61104f565b005b34801561065e575f5ffd5b50610667611096565b6040516105fa9190613a9c565b34801561067f575f5ffd5b506105f060165481565b348015610694575f5ffd5b506106a86106a3366004613aae565b611126565b6040516001600160a01b0390911681526020016105fa565b6106516106ce366004613ac5565b611181565b3480156106de575f5ffd5b50600b546001600160a01b03166106a8565b3480156106fb575f5ffd5b5061065161070a366004613aae565b6111ce565b34801561071a575f5ffd5b506105f06107293660046139d5565b60236020525f908152604090205481565b348015610745575f5ffd5b50604080517fcaee23ea00000000000000000000000000000000000000000000000000000000815260016020820152016105fa565b348015610785575f5ffd5b5060115461062290610100900460ff1681565b3480156107a3575f5ffd5b50600454600354035f19016105f0565b3480156107be575f5ffd5b506106516107cd366004613aef565b6111db565b3480156107dd575f5ffd5b506106516107ec366004613aae565b611322565b6106516107ff366004613b26565b61132f565b34801561080f575f5ffd5b5061065161081e366004613aae565b611365565b34801561082e575f5ffd5b5061084261083d366004613b64565b611372565b604080516001600160a01b0390931683526020830191909152016105fa565b34801561086c575f5ffd5b50600e546106a8906001600160a01b031681565b34801561088b575f5ffd5b5061065161089a366004613aae565b611406565b3480156108aa575f5ffd5b506105f0601e5481565b3480156108bf575f5ffd5b506105f06108ce3660046139d5565b601b6020525f908152604090205481565b3480156108ea575f5ffd5b50610651611413565b3480156108fe575f5ffd5b506105f060285481565b348015610913575f5ffd5b506105f060155481565b61065161092b366004613b26565b61148f565b34801561093b575f5ffd5b5061065161094a366004613aae565b6114bf565b34801561095a575f5ffd5b50610651610969366004613b91565b6114cc565b348015610979575f5ffd5b50610651610988366004613ac5565b611539565b348015610998575f5ffd5b506106516109a7366004613aae565b611591565b3480156109b7575f5ffd5b506106516109c6366004613bac565b61159e565b3480156109d6575f5ffd5b506105f0601c5481565b3480156109eb575f5ffd5b506105f060245481565b348015610a00575f5ffd5b506105f060175481565b348015610a15575f5ffd5b50610651610a24366004613aae565b6115b3565b348015610a34575f5ffd5b50610651610a43366004613bac565b6115c0565b348015610a53575f5ffd5b50610651610a62366004613c1a565b6115d5565b348015610a72575f5ffd5b506105f060215481565b348015610a87575f5ffd5b506105f0601f5481565b348015610a9c575f5ffd5b506105f060205481565b348015610ab1575f5ffd5b506106a8610ac0366004613aae565b611619565b348015610ad0575f5ffd5b506105f0601a5481565b348015610ae5575f5ffd5b50610651610af4366004613d27565b611623565b348015610b04575f5ffd5b50610651610b13366004613aae565b61171a565b348015610b23575f5ffd5b50610651610b32366004613aae565b611727565b348015610b42575f5ffd5b506105f0610b513660046139d5565b611734565b348015610b61575f5ffd5b5061065161179a565b348015610b75575f5ffd5b50610651610b84366004613aae565b6117ad565b348015610b94575f5ffd5b50610651610ba33660046139d5565b6117ba565b348015610bb3575f5ffd5b50610651610bc2366004613aae565b611832565b348015610bd2575f5ffd5b506105f0601d5481565b348015610be7575f5ffd5b506105f060265481565b348015610bfc575f5ffd5b50610651610c0b366004613aae565b61183f565b348015610c1b575f5ffd5b506105f0600c5481565b348015610c30575f5ffd5b505f546001600160a01b03166106a8565b348015610c4c575f5ffd5b506105f060275481565b348015610c61575f5ffd5b5061066761184c565b610651610c78366004613e2d565b61185b565b348015610c88575f5ffd5b50610651610c97366004613aae565b611cae565b348015610ca7575f5ffd5b50610651610cb6366004613aae565b611cbb565b348015610cc6575f5ffd5b50610651610cd5366004613e75565b611cc8565b348015610ce5575f5ffd5b506105f0602a5481565b348015610cfa575f5ffd5b50610651611d10565b348015610d0e575f5ffd5b50610651610d1d3660046139d5565b611d25565b348015610d2d575f5ffd5b506105f060145481565b348015610d42575f5ffd5b50610651610d51366004613aae565b611d9b565b348015610d61575f5ffd5b50610651610d703660046139d5565b611da8565b348015610d80575f5ffd5b506011546106229062010000900460ff1681565b348015610d9f575f5ffd5b50610651610dae366004613aae565b611df1565b348015610dbe575f5ffd5b50610651610dcd366004613b91565b611dfe565b610651610de0366004613ea1565b611e19565b348015610df0575f5ffd5b50610651610dff366004613aae565b611e4a565b348015610e0f575f5ffd5b50610667610e1e366004613aae565b611e57565b348015610e2e575f5ffd5b506105f060295481565b348015610e43575f5ffd5b506105f060255481565b348015610e58575f5ffd5b506105f0600d5481565b348015610e6d575f5ffd5b506105f060105481565b348015610e82575f5ffd5b50610651610e91366004613aae565b611f0d565b348015610ea1575f5ffd5b50610651610eb0366004613aae565b611f1a565b348015610ec0575f5ffd5b506105f060195481565b348015610ed5575f5ffd5b50600f546106a8906001600160a01b031681565b348015610ef4575f5ffd5b506105f060185481565b348015610f09575f5ffd5b50610622610f18366004613aef565b6001600160a01b039182165f908152600a6020908152604080832093909416825291909152205460ff1690565b348015610f50575f5ffd5b506011546106a890630100000090046001600160a01b031681565b348015610f76575f5ffd5b50610651610f853660046139d5565b611f27565b348015610f95575f5ffd5b506105f060225481565b348015610faa575f5ffd5b50610651610fb93660046139d5565b611f7f565b610651610fcc366004613e2d565b6120c2565b610651610fdf366004613f63565b6124f7565b348015610fef575f5ffd5b506011546106229060ff1681565b5f6001600160e01b031982167fad0d7f6c00000000000000000000000000000000000000000000000000000000148061103a575061103a826129a9565b80611049575061104982612a28565b92915050565b611057612a75565b6103e8816bffffffffffffffffffffffff1611156110885760405163f4df6ae560e01b815260040160405180910390fd5b6110928282612aba565b5050565b6060600580546110a590613fb0565b80601f01602080910402602001604051908101604052809291908181526020018280546110d190613fb0565b801561111c5780601f106110f35761010080835404028352916020019161111c565b820191905f5260205f20905b8154815290600101906020018083116110ff57829003601f168201915b5050505050905090565b5f61113082612b9d565b611166576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505f908152600960205260409020546001600160a01b031690565b8160115460ff16156111965761119681612bd0565b601154610100900460ff16156111bf576040516336e278fd60e21b815260040160405180910390fd5b6111c98383612c0f565b505050565b6111d6612a75565b602655565b6111e3612a75565b6040516370a0823160e01b815230600482015282905f906001600160a01b038316906370a0823190602401602060405180830381865afa158015611229573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061124d9190613fe8565b9050805f0361126f576040516312171d8360e31b815260040160405180910390fd5b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152602482018390525f919084169063a9059cbb906044016020604051808303815f875af11580156112d7573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112fb9190613fff565b90508061131b576040516312171d8360e31b815260040160405180910390fd5b5050505050565b61132a612a75565b602455565b826001600160a01b03811633146113545760115460ff16156113545761135433612bd0565b61135f848484612c1b565b50505050565b61136d612a75565b601455565b5f82815260026020526040812080548291906001600160a01b03811690600160a01b90046bffffffffffffffffffffffff16816113cf5750506001546001600160a01b03811690600160a01b90046bffffffffffffffffffffffff165b5f6127106113eb6bffffffffffffffffffffffff84168961402e565b6113f59190614045565b9295509193505050505b9250929050565b61140e612a75565b602055565b61141b612a75565b5f80546040516001600160a01b039091169047908381818185875af1925050503d805f8114611465576040519150601f19603f3d011682016040523d82523d5f602084013e61146a565b606091505b505090508061148c576040516312171d8360e31b815260040160405180910390fd5b50565b826001600160a01b03811633146114b45760115460ff16156114b4576114b433612bd0565b61135f848484612e20565b6114c7612a75565b602155565b6114d4612a75565b601154630100000090046001600160a01b031661151d576040517fe048e71000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60118054911515620100000262ff000019909216919091179055565b611541612a75565b601054158015906115695750601054600454600354839190035f19016115679190614064565b115b1561158757604051638a164f6360e01b815260040160405180910390fd5b6110928282612e3a565b611599612a75565b601955565b6115a6612a75565b60136111c98284836140bb565b6115bb612a75565b601a55565b6115c8612a75565b60126111c98284836140bb565b6115dd612a75565b6103e8816bffffffffffffffffffffffff16111561160e5760405163f4df6ae560e01b815260040160405180910390fd5b6111c9838383612f72565b5f61104982613073565b61162b612a75565b8051825114611666576040517ffc4c603600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b82518110156111c957601054158015906116b8575060105482828151811061169257611692614175565b60200260200101516116ac6004546003545f199190030190565b6116b69190614064565b115b156116d657604051638a164f6360e01b815260040160405180910390fd5b6117128382815181106116eb576116eb614175565b602002602001015183838151811061170557611705614175565b6020026020010151612e3a565b600101611668565b611722612a75565b602555565b61172f612a75565b601055565b5f6001600160a01b038216611775576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b03165f9081526008602052604090205467ffffffffffffffff1690565b6117a2612a75565b6117ab5f6130fa565b565b6117b5612a75565b602855565b6117c2612a75565b5f816001600160a01b0316476040515f6040518083038185875af1925050503d805f811461180b576040519150601f19603f3d011682016040523d82523d5f602084013e611810565b606091505b5050905080611092576040516312171d8360e31b815260040160405180910390fd5b61183a612a75565b602955565b611847612a75565b601655565b6060600680546110a590613fb0565b601c541580159061186d5750601c5442105b1561188b57604051636ea7008360e11b815260040160405180910390fd5b601d541580159061189d5750601d5442115b156118bb57604051636ea7008360e11b815260040160405180910390fd5b601054158015906118e35750601054600454600354839190035f19016118e19190614064565b115b1561190157604051638a164f6360e01b815260040160405180910390fd5b601e54158015906119205750601e5481601f5461191e9190614064565b115b1561193e57604051638a164f6360e01b815260040160405180910390fd5b5f81600c546020546119509190614064565b61195a919061402e565b600f549091506001600160a01b03166119925780341461198d5760405163193e352b60e11b815260040160405180910390fd5b611aae565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa1580156119dc573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a009190613fe8565b1015611a1f5760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015611a69573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a8d9190613fe8565b1015611aac57604051634fd3af0760e01b815260040160405180910390fd5b505b60225415611b4d576040516bffffffffffffffffffffffff193360601b1660208201525f90603401604051602081830303815290604052805190602001209050611b2e8585808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506022549150849050613156565b611b4b5760405163582f497d60e11b815260040160405180910390fd5b505b60215415801590611b785750602154335f90815260236020526040902054611b76908490614064565b115b15611b9657604051638a164f6360e01b815260040160405180910390fd5b600c545f9015801590611bb35750600e546001600160a01b031615155b15611bc95782600c54611bc6919061402e565b90505b600d545f9015801590611be65750600e546001600160a01b031615155b15611c1257612710611bf88385614189565b600d54611c05919061402e565b611c0f9190614045565b90505b5f611c1d8284614064565b90508015611c2e57611c2e8161316b565b600f546001600160a01b031615801590611c4757508084115b15611c5f57611c5f30611c5a8387614189565b61334a565b335f9081526023602052604081208054879290611c7d908490614064565b9250508190555084601f5f828254611c959190614064565b90915550611ca590503386612e3a565b50505050505050565b611cb6612a75565b602255565b611cc3612a75565b602a55565b8160115460ff1615611cdd57611cdd81612bd0565b601154610100900460ff1615611d06576040516336e278fd60e21b815260040160405180910390fd5b6111c9838361346b565b611d18612a75565b6011805461ff0019169055565b611d2d612a75565b600b80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff1983168117909355604080519190921680825260208201939093527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a15050565b611da3612a75565b601c55565b611db0612a75565b601180546001600160a01b039092166301000000027fffffffffffffffffff0000000000000000000000000000000000000000ffffff909216919091179055565b611df9612a75565b601555565b611e06612a75565b6011805460ff1916911515919091179055565b836001600160a01b0381163314611e3e5760115460ff1615611e3e57611e3e33612bd0565b61131b858585856134d6565b611e52612a75565b601e55565b6060611e6282612b9d565b611e98576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f611ea161351a565b90505f611eac613529565b905081515f14611ee95781611ec085613538565b604051602001611ed19291906141b3565b60405160208183030381529060405292505050919050565b805115611ef7579392505050565b505060408051602081019091525f815292915050565b611f15612a75565b601d55565b611f22612a75565b601855565b611f2f612a75565b6001600160a01b038116611f76576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081525f60048201526024015b60405180910390fd5b61148c816130fa565b611f87612a75565b6040516370a0823160e01b815230600482015281905f906001600160a01b038316906370a0823190602401602060405180830381865afa158015611fcd573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ff19190613fe8565b9050805f03612013576040516312171d8360e31b815260040160405180910390fd5b5f826001600160a01b031663a9059cbb6120345f546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303815f875af115801561207e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120a29190613fff565b90508061135f576040516312171d8360e31b815260040160405180910390fd5b602454158015906120d4575060245442105b156120f257604051636ea7008360e11b815260040160405180910390fd5b60255415801590612104575060255442115b1561212257604051636ea7008360e11b815260040160405180910390fd5b6010541580159061214a5750601054600454600354839190035f19016121489190614064565b115b1561216857604051638a164f6360e01b815260040160405180910390fd5b602654158015906121875750602654816027546121859190614064565b115b156121a557604051638a164f6360e01b815260040160405180910390fd5b5f81600c546028546121b79190614064565b6121c1919061402e565b600f549091506001600160a01b03166121f9578034146121f45760405163193e352b60e11b815260040160405180910390fd5b612315565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa158015612243573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122679190613fe8565b10156122865760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa1580156122d0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122f49190613fe8565b101561231357604051634fd3af0760e01b815260040160405180910390fd5b505b602a54156123b4576040516bffffffffffffffffffffffff193360601b1660208201525f906034016040516020818303038152906040528051906020012090506123958585808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050602a549150849050613156565b6123b25760405163582f497d60e11b815260040160405180910390fd5b505b602954158015906123df5750602954335f908152602b60205260409020546123dd908490614064565b115b156123fd57604051638a164f6360e01b815260040160405180910390fd5b600c545f901580159061241a5750600e546001600160a01b031615155b156124305782600c5461242d919061402e565b90505b600d545f901580159061244d5750600e546001600160a01b031615155b156124795761271061245f8385614189565b600d5461246c919061402e565b6124769190614045565b90505b5f6124848284614064565b90508015612495576124958161316b565b600f546001600160a01b0316158015906124ae57508084115b156124c1576124c130611c5a8387614189565b335f908152602b6020526040812080548792906124df908490614064565b925050819055508460275f828254611c959190614064565b60145415801590612509575060145442105b1561252757604051636ea7008360e11b815260040160405180910390fd5b60155415801590612539575060155442115b1561255757604051636ea7008360e11b815260040160405180910390fd5b6010541580159061257f5750601054600454600354839190035f190161257d9190614064565b115b1561259d57604051638a164f6360e01b815260040160405180910390fd5b601654158015906125bc5750601654816017546125ba9190614064565b115b156125da57604051638a164f6360e01b815260040160405180910390fd5b5f81600c546018546125ec9190614064565b6125f6919061402e565b600f549091506001600160a01b031661262e578034146126295760405163193e352b60e11b815260040160405180910390fd5b61274a565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa158015612678573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061269c9190613fe8565b10156126bb5760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015612705573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127299190613fe8565b101561274857604051634fd3af0760e01b815260040160405180910390fd5b505b335f908152601b60205260409020548390612766908490614064565b111561278557604051638a164f6360e01b815260040160405180910390fd5b828211156127a657604051638a164f6360e01b815260040160405180910390fd5b601a541561284c576040516bffffffffffffffffffffffff193360601b166020820152603481018490525f9060540160405160208183030381529060405280519060200120905061282d8686808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050601a549150849050613156565b61284a5760405163582f497d60e11b815260040160405180910390fd5b505b601954158015906128775750601954335f908152601b6020526040902054612875908490614064565b115b1561289557604051638a164f6360e01b815260040160405180910390fd5b600c545f90158015906128b25750600e546001600160a01b031615155b156128c85782600c546128c5919061402e565b90505b600d545f90158015906128e55750600e546001600160a01b031615155b15612911576127106128f78385614189565b600d54612904919061402e565b61290e9190614045565b90505b5f61291c8284614064565b9050801561292d5761292d8161316b565b600f546001600160a01b03161580159061294657508084115b156129595761295930611c5a8387614189565b335f908152601b602052604081208054879290612977908490614064565b925050819055508460175f82825461298f9190614064565b9091555061299f90503386612e3a565b5050505050505050565b5f6301ffc9a760e01b6001600160e01b0319831614806129f257507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b806110495750506001600160e01b0319167f5b5e139f000000000000000000000000000000000000000000000000000000001490565b5f6001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061104957506301ffc9a760e01b6001600160e01b0319831614611049565b5f546001600160a01b031633146117ab576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401611f6d565b6127106bffffffffffffffffffffffff8216811015612b1c576040517f6f483d090000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff8316600482015260248101829052604401611f6d565b6001600160a01b038316612b5e576040517fb6d9900a0000000000000000000000000000000000000000000000000000000081525f6004820152602401611f6d565b50604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600155565b5f81600111158015612bb0575060035482105b80156110495750505f90815260076020526040902054600160e01b161590565b69c61711340011223344555f5230601a5280603a525f5f604460166daaeb6d7670e522a718067333cd4e5afa612c08573d5f5f3e3d5ffd5b5f603a5250565b6110928282600161357b565b5f612c2582613073565b9050836001600160a01b0316816001600160a01b031614612c72576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8281526009602052604090208054338082146001600160a01b03881690911417612cf3576001600160a01b0386165f908152600a6020908152604080832033845290915290205460ff16612cf3576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516612d33576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d408686866001613662565b8015612d4a575f82555b6001600160a01b038681165f9081526008602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260076020526040812091909155600160e11b84169003612dd757600184015f818152600760205260408120549003612dd5576003548114612dd5575f8181526007602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6111c983838360405180602001604052805f815250611e19565b6003545f829003612e77576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612e835f848385613662565b6001600160a01b0383165f8181526008602090815260408083208054680100000000000000018802019055848352600790915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612f2f5780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f5fa4600101612ef9565b50815f03612f69576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035550505050565b6127106bffffffffffffffffffffffff8216811015612fdb576040517fdfd1fc1b000000000000000000000000000000000000000000000000000000008152600481018590526bffffffffffffffffffffffff8316602482015260448101829052606401611f6d565b6001600160a01b038316613024576040517f969f0852000000000000000000000000000000000000000000000000000000008152600481018590525f6024820152604401611f6d565b506040805180820182526001600160a01b0393841681526bffffffffffffffffffffffff92831660208083019182525f968752600290529190942093519051909116600160a01b029116179055565b5f816001116130e157505f8181526007602052604081205490600160e01b821690036130e157805f036130dc5760035482106130c257604051636f96cda160e11b815260040160405180910390fd5b5b505f19015f8181526007602052604090205480156130c3575b919050565b604051636f96cda160e11b815260040160405180910390fd5b5f80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f8261316285846137be565b14949350505050565b805f036131a4576040517f5e2a89dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e546001600160a01b03166131e6576040517fcd0081c200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f546001600160a01b031661326d57600e546040515f916001600160a01b03169083908381818185875af1925050503d805f8114613240576040519150601f19603f3d011682016040523d82523d5f602084013e613245565b606091505b505090508061326757604051634033e4e360e01b815260040160405180910390fd5b50613305565b600f54600e546040516323b872dd60e01b81523360048201526001600160a01b0391821660248201526044810184905291169081906323b872dd906064016020604051808303815f875af19250505080156132e5575060408051601f3d908101601f191682019092526132e291810190613fff565b60015b61330257604051634033e4e360e01b815260040160405180910390fd5b50505b600e546040518281526001600160a01b03909116907f2b5dffd9914ddb43acdb6963bacf053a87bf9354300844f6339f17741e25145a9060200160405180910390a250565b805f0361336a57604051632ee66eed60e01b815260040160405180910390fd5b6001600160a01b03821661339157604051632ee66eed60e01b815260040160405180910390fd5b600f546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b039091169081906323b872dd906064016020604051808303815f875af1925050508015613405575060408051601f3d908101601f1916820190925261340291810190613fff565b60015b61342257604051632ee66eed60e01b815260040160405180910390fd5b50826001600160a01b03167f5bfd86dd1dfba5846abf8c8ff49e529e997ac11be6a5ad81501ef4418f3596898360405161345e91815260200190565b60405180910390a2505050565b335f818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6134e184848461132f565b6001600160a01b0383163b1561135f576134fd84848484613800565b61135f576040516368d2bf6b60e11b815260040160405180910390fd5b6060601280546110a590613fb0565b6060601380546110a590613fb0565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806135515750819003601f19909101908152919050565b5f61358583611619565b905081156135f957336001600160a01b038216146135f9576001600160a01b0381165f908152600a6020908152604080832033845290915290205460ff166135f9576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f83815260096020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b601154610100900460ff16801561368157506001600160a01b03841615155b801561369557506001600160a01b03831615155b156136b3576040516336e278fd60e21b815260040160405180910390fd5b6136bc336138e7565b6136f2576040517f4c80d8be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416158015906137145750600b546001600160a01b031615155b156137b9575f5b818110156137b757600b546001600160a01b031663caee23ea3387876137418689614064565b6040516001600160e01b031960e087901b1681526001600160a01b03948516600482015292841660248401529216604482015260648101919091526084015f6040518083038186803b158015613795575f5ffd5b505afa1580156137a7573d5f5f3e3d5ffd5b50506001909201915061371b9050565b505b61135f565b5f81815b84518110156137f8576137ee828683815181106137e1576137e1614175565b6020026020010151613998565b91506001016137c2565b509392505050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a029061383490339089908890889060040161421d565b6020604051808303815f875af192505050801561386e575060408051601f3d908101601f1916820190925261386b9181019061425d565b60015b6138ca573d80801561389b576040519150601f19603f3d011682016040523d82523d5f602084013e6138a0565b606091505b5080515f036138c2576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6011545f9062010000900460ff1615613990576011546040517fe18bc08a0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152630100000090920490911690819063e18bc08a90602401602060405180830381865afa158015613965573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906139899190613fff565b9392505050565b506001919050565b5f8183106139b2575f828152602084905260409020613989565b505f9182526020526040902090565b6001600160a01b038116811461148c575f5ffd5b5f602082840312156139e5575f5ffd5b8135613989816139c1565b6001600160e01b03198116811461148c575f5ffd5b5f60208284031215613a15575f5ffd5b8135613989816139f0565b80356bffffffffffffffffffffffff811681146130dc575f5ffd5b5f5f60408385031215613a4c575f5ffd5b8235613a57816139c1565b9150613a6560208401613a20565b90509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f6139896020830184613a6e565b5f60208284031215613abe575f5ffd5b5035919050565b5f5f60408385031215613ad6575f5ffd5b8235613ae1816139c1565b946020939093013593505050565b5f5f60408385031215613b00575f5ffd5b8235613b0b816139c1565b91506020830135613b1b816139c1565b809150509250929050565b5f5f5f60608486031215613b38575f5ffd5b8335613b43816139c1565b92506020840135613b53816139c1565b929592945050506040919091013590565b5f5f60408385031215613b75575f5ffd5b50508035926020909101359150565b801515811461148c575f5ffd5b5f60208284031215613ba1575f5ffd5b813561398981613b84565b5f5f60208385031215613bbd575f5ffd5b823567ffffffffffffffff811115613bd3575f5ffd5b8301601f81018513613be3575f5ffd5b803567ffffffffffffffff811115613bf9575f5ffd5b856020828401011115613c0a575f5ffd5b6020919091019590945092505050565b5f5f5f60608486031215613c2c575f5ffd5b833592506020840135613c3e816139c1565b9150613c4c60408501613a20565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613c9257613c92613c55565b604052919050565b5f67ffffffffffffffff821115613cb357613cb3613c55565b5060051b60200190565b5f82601f830112613ccc575f5ffd5b8135613cdf613cda82613c9a565b613c69565b8082825260208201915060208360051b860101925085831115613d00575f5ffd5b602085015b83811015613d1d578035835260209283019201613d05565b5095945050505050565b5f5f60408385031215613d38575f5ffd5b823567ffffffffffffffff811115613d4e575f5ffd5b8301601f81018513613d5e575f5ffd5b8035613d6c613cda82613c9a565b8082825260208201915060208360051b850101925087831115613d8d575f5ffd5b6020840193505b82841015613db8578335613da7816139c1565b825260209384019390910190613d94565b9450505050602083013567ffffffffffffffff811115613dd6575f5ffd5b613de285828601613cbd565b9150509250929050565b5f5f83601f840112613dfc575f5ffd5b50813567ffffffffffffffff811115613e13575f5ffd5b6020830191508360208260051b85010111156113ff575f5ffd5b5f5f5f60408486031215613e3f575f5ffd5b833567ffffffffffffffff811115613e55575f5ffd5b613e6186828701613dec565b909790965060209590950135949350505050565b5f5f60408385031215613e86575f5ffd5b8235613e91816139c1565b91506020830135613b1b81613b84565b5f5f5f5f60808587031215613eb4575f5ffd5b8435613ebf816139c1565b93506020850135613ecf816139c1565b925060408501359150606085013567ffffffffffffffff811115613ef1575f5ffd5b8501601f81018713613f01575f5ffd5b803567ffffffffffffffff811115613f1b57613f1b613c55565b613f2e601f8201601f1916602001613c69565b818152886020838501011115613f42575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b5f5f5f5f60608587031215613f76575f5ffd5b843567ffffffffffffffff811115613f8c575f5ffd5b613f9887828801613dec565b90989097506020870135966040013595509350505050565b600181811c90821680613fc457607f821691505b602082108103613fe257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215613ff8575f5ffd5b5051919050565b5f6020828403121561400f575f5ffd5b815161398981613b84565b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176110495761104961401a565b5f8261405f57634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156110495761104961401a565b601f8211156111c957805f5260205f20601f840160051c8101602085101561409c5750805b601f840160051c820191505b8181101561131b575f81556001016140a8565b67ffffffffffffffff8311156140d3576140d3613c55565b6140e7836140e18354613fb0565b83614077565b5f601f841160018114614118575f85156141015750838201355b5f19600387901b1c1916600186901b17835561131b565b5f83815260208120601f198716915b828110156141475786850135825560209485019460019092019101614127565b5086821015614163575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b5f52603260045260245ffd5b818103818111156110495761104961401a565b5f81518060208401855e5f93019283525090919050565b5f6141be828561419c565b7f2f0000000000000000000000000000000000000000000000000000000000000081526141ee600182018561419c565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050195945050505050565b6001600160a01b03851681526001600160a01b0384166020820152826040820152608060608201525f6142536080830184613a6e565b9695505050505050565b5f6020828403121561426d575f5ffd5b8151613989816139f056fea264697066735822122084aa9a9fca5db9c12d3f08586f5d7a5938a8e55d0d202bbecbd65b166570068b64736f6c634300081c0033
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.