ERC-721
Overview
Max Total Supply
4,472 DUCK
Holders
430
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 DUCKLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
alpha
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT //╭━━━┳╮╱╱╱╱╱╱╱╱╱╭━━━╮╱╱╱╱╱╭╮╱╱╭╮╱╱╭╮╱╱╱╱╭╮╱╭╮╱╭━━━┳╮╱╱╱╭╮ //┃╭━╮┃┃╱╱╱╱╱╱╱╱╱╰╮╭╮┃╱╱╱╱╱┃┃╱╱┃╰╮╭╯┃╱╱╱╱┃┃╭╯╰╮┃╭━╮┃┃╱╱╱┃┃ //┃┃╱┃┃┃╭┳━━┳╮╱╭╮╱┃┃┃┣╮╭┳━━┫┃╭╮╰╮╰╯╭┻━┳━━┫╰┻╮╭╯┃┃╱╰┫┃╭╮╭┫╰━╮ //┃┃╱┃┃╰╯┫╭╮┃┃╱┃┃╱┃┃┃┃┃┃┃╭━┫╰╯╯╱╰╮╭┫╭╮┃╭━┫╭╮┃┃╱┃┃╱╭┫┃┃┃┃┃╭╮┃ //┃╰━╯┃╭╮┫╭╮┃╰━╯┃╭╯╰╯┃╰╯┃╰━┫╭╮╮╱╱┃┃┃╭╮┃╰━┫┃┃┃╰╮┃╰━╯┃╰┫╰╯┃╰╯┃ //╰━━━┻╯╰┻╯╰┻━╮╭╯╰━━━┻━━┻━━┻╯╰╯╱╱╰╯╰╯╰┻━━┻╯╰┻━╯╰━━━┻━┻━━┻━━╯ //╱╱╱╱╱╱╱╱╱╱╭━╯┃/////////////////////////////////////////// //╱╱╱╱╱╱╱╱╱╱╰━━╯/////////////////////////////////////////// // File: @openzeppelin/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); } // File: https://github.com/ProjectOpenSea/operator-filter-registry/blob/main/src/IOperatorFilterRegistry.sol pragma solidity ^0.8.13; interface IOperatorFilterRegistry { function isOperatorAllowed(address registrant, address operator) external view returns (bool); function register(address registrant) external; function registerAndSubscribe(address registrant, address subscription) external; function registerAndCopyEntries(address registrant, address registrantToCopy) external; function unregister(address addr) external; function updateOperator(address registrant, address operator, bool filtered) external; function updateOperators(address registrant, address[] calldata operators, bool filtered) external; function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; function subscribe(address registrant, address registrantToSubscribe) external; function unsubscribe(address registrant, bool copyExistingEntries) external; function subscriptionOf(address addr) external returns (address registrant); function subscribers(address registrant) external returns (address[] memory); function subscriberAt(address registrant, uint256 index) external returns (address); function copyEntriesOf(address registrant, address registrantToCopy) external; function isOperatorFiltered(address registrant, address operator) external returns (bool); function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); function filteredOperators(address addr) external returns (address[] memory); function filteredCodeHashes(address addr) external returns (bytes32[] memory); function filteredOperatorAt(address registrant, uint256 index) external returns (address); function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); function isRegistered(address addr) external returns (bool); function codeHashOf(address addr) external returns (bytes32); } // File: https://github.com/ProjectOpenSea/operator-filter-registry/blob/main/src/OperatorFilterer.sol pragma solidity ^0.8.13; /** * @title OperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. */ abstract contract OperatorFilterer { error OperatorNotAllowed(address operator); IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (subscribe) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { OPERATOR_FILTER_REGISTRY.register(address(this)); } } } } modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } function _checkFilterOperator(address operator) internal view virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } } // File: https://github.com/ProjectOpenSea/operator-filter-registry/blob/main/src/DefaultOperatorFilterer.sol pragma solidity ^0.8.13; /** * @title DefaultOperatorFilterer * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription. */ abstract contract DefaultOperatorFilterer is OperatorFilterer { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {} } // File: @openzeppelin/contracts/security/ReentrancyGuard.sol // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } // File: contracts/alpha.sol // File: https://github.com/chiru-labs/ERC721A/blob/main/contracts/IERC721A.sol // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of an ERC721A compliant contract. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * The caller cannot approve to their own address. */ error ApproveToCaller(); /** * The caller cannot approve to the current owner. */ error ApprovalToCurrentOwner(); /** * 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(); struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } /** * @dev Returns the total amount of tokens stored by the contract. * * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens. */ function totalSupply() external view returns (uint256); // ============================== // IERC165 // ============================== /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================== // 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`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must 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 ) external; /** * @dev Transfers `tokenId` token 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; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================== // 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); } // File: https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev ERC721 token receiver interface. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // 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 tokenId of the next token 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` 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 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 1; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view 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 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 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 returns (uint256) { return _burnCounter; } /** * @dev See {IERC165-supportsInterface}. */ 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: 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. } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view 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 auxillary 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 auxillary 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 { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; assembly { // Cast aux without masking. auxCasted := aux } packed = (packed & BITMASK_AUX_COMPLEMENT) | (auxCasted << BITPOS_AUX); _packedAddressData[owner] = packed; } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & BITMASK_BURNED == 0) { // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. // // We can directly compare the packed value. // If the address is zero, packed is zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * 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; } /** * Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ 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, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev Casts the address to uint256 without masking. */ function _addressToUint256(address value) private pure returns (uint256 result) { assembly { result := value } } /** * @dev Casts the boolean to uint256 without branching. */ function _boolToUint256(bool value) private pure returns (uint256 result) { assembly { result := value } } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = address(uint160(_packedOwnershipOf(tokenId))); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSenderERC721A()) revert ApproveToCaller(); _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { _transfer(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @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 (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & BITMASK_BURNED == 0; // and not burned. } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal { _safeMint(to, 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. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the balance and number minted. _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] = _addressToUint256(to) | (block.timestamp << BITPOS_START_TIMESTAMP) | (_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; if (to.code.length != 0) { do { emit Transfer(address(0), to, updatedIndex); if ( !_checkContractOnERC721Received( address(0), to, updatedIndex++, _data ) ) { revert TransferToNonERC721ReceiverImplementer(); } } while (updatedIndex < end); // Reentrancy protection if (_currentIndex != startTokenId) revert(); } else { do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex < end); } _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @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. */ function _mint(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the balance and number minted. _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] = _addressToUint256(to) | (block.timestamp << BITPOS_START_TIMESTAMP) | (_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex < end); _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); bool isApprovedOrOwner = (_msgSenderERC721A() == from || isApprovedForAll(from, _msgSenderERC721A()) || getApproved(tokenId) == _msgSenderERC721A()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. delete _tokenApprovals[tokenId]; // 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] = _addressToUint256(to) | (block.timestamp << BITPOS_START_TIMESTAMP) | BITMASK_NEXT_INITIALIZED; // 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 `_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)); if (approvalCheck) { bool isApprovedOrOwner = (_msgSenderERC721A() == from || isApprovedForAll(from, _msgSenderERC721A()) || getApproved(tokenId) == _msgSenderERC721A()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. delete _tokenApprovals[tokenId]; // 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] = _addressToUint256(from) | (block.timestamp << BITPOS_START_TIMESTAMP) | BITMASK_BURNED | BITMASK_NEXT_INITIALIZED; // 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++; } } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool 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)) } } } } /** * @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 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 returns (string memory ptr) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), // but we allocate 128 bytes to keep the free memory pointer 32-byte word aliged. // We will need 1 32-byte word to store the length, // and 3 32-byte words to store a maximum of 78 digits. Total: 32 + 3 * 32 = 128. ptr := add(mload(0x40), 128) // Update the free memory pointer to allocate. mstore(0x40, ptr) // Cache the end of the memory to calculate the length later. let end := ptr // We write the string from the rightmost digit to the leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // Costs a bit more than early returning for the zero case, // but cheaper in terms of deployment and overall runtime costs. for { // Initialize and perform the first pass without check. let temp := value // Move the pointer 1 byte leftwards to point to an empty character slot. ptr := sub(ptr, 1) // Write the character to the pointer. 48 is the ASCII index of '0'. mstore8(ptr, add(48, mod(temp, 10))) temp := div(temp, 10) } temp { // Keep dividing `temp` until zero. temp := div(temp, 10) } { // Body of the for loop. ptr := sub(ptr, 1) mstore8(ptr, add(48, mod(temp, 10))) } let length := sub(end, ptr) // Move the pointer 32 bytes leftwards to make room for the length. ptr := sub(ptr, 32) // Store the length. mstore(ptr, length) } } } // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } } // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require( address(this).balance >= amount, "Address: insufficient balance" ); (bool success, ) = recipient.call{value: amount}(""); require( success, "Address: unable to send value, recipient may have reverted" ); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue( target, data, value, "Address: low-level call with value failed" ); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require( address(this).balance >= value, "Address: insufficient balance for call" ); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}( data ); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall( target, data, "Address: low-level static call failed" ); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall( target, data, "Address: low-level delegate call failed" ); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/IERC721Receiver.sol // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/IERC165.sol // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165.sol // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/IERC721.sol // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer( address indexed from, address indexed to, uint256 indexed tokenId ); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval( address indexed owner, address indexed approved, uint256 indexed tokenId ); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll( address indexed owner, address indexed operator, bool approved ); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: 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; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); } // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/IERC721Metadata.sol // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); } // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require( owner != address(0), "ERC721: address zero is not a valid owner" ); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require( owner != address(0), "ERC721: owner query for nonexistent token" ); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require( _exists(tokenId), "ERC721Metadata: URI query for nonexistent token" ); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require( _exists(tokenId), "ERC721: approved query for nonexistent token" ); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved" ); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved" ); _safeTransfer(from, to, tokenId, data); } /** * @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. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require( _checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @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 (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require( _exists(tokenId), "ERC721: operator query for nonexistent token" ); address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require( ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner" ); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received( _msgSender(), from, tokenId, data ) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert( "ERC721: transfer to non ERC721Receiver implementer" ); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * 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, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} } // File: contracts/ODYC.sol pragma solidity ^0.8.0; interface DuckNFT { function transferFrom( address _from, address _to, uint256 _tokenId ) external; } interface DucklingNFT { function transferFrom( address _from, address _to, uint256 _tokenId ) external; } contract alpha is ERC721A, Ownable, ReentrancyGuard, DefaultOperatorFilterer { using Strings for uint256; string private baseURI; uint256 public price = 210*10**18; uint256 public mintPrice = 42500000000000000; uint256 public multiPrice = 25000000000000000; uint256 public GrapesEthPrice = 15000000000000000; uint256 public maxSupply = 8888; uint256 public goosecount = 0; uint256 public duckcount = 0; uint256 public maxPerTx = 10; uint256 public grapeOnlyPrice = 630*10**18; address public DUCK_ADDRESS = 0x36D7b711390D34e8fe26ad8f2bB14E7C8f0c56e9; address public DUCKLING_ADDRESS = 0xeB4A28587503d84dc29DE8e4Fc8bF0A57A7Ddb0d; bool public mintEnabled = false; bool public grapeOnly = false; DuckNFT private _duckContract = DuckNFT(DUCK_ADDRESS); DucklingNFT private _ducklingContract = DucklingNFT(DUCKLING_ADDRESS); IERC20 public GrapesAddress; constructor(address _GrapesAddress) ERC721A("Alpha Duck", "DUCK") { GrapesAddress = IERC20(_GrapesAddress); _mint(msg.sender, 1); setBaseURI("https://odyc.s3.amazonaws.com/public/metadata/"); } function duckduck( uint256 count, uint256[] calldata DuckIds, uint256[] calldata DucklingIds ) external payable { uint256 cost = price; GrapesAddress.transferFrom(msg.sender, address(this), count * cost); for (uint256 i = 0; i < DuckIds.length; i++) { uint256 id = DuckIds[i]; _duckContract.transferFrom( msg.sender, address(0x000000000000000000000000000000000000dEaD), id ); duckcount++; } for (uint256 i = 0; i < DucklingIds.length; i++) { uint256 id = DucklingIds[i]; _ducklingContract.transferFrom( msg.sender, address(0x000000000000000000000000000000000000dEaD), id ); goosecount++; } require(mintEnabled, "Minting is not live yet"); require(_totalMinted() + count <= maxSupply, "No more"); require(DuckIds.length & DucklingIds.length == count, "Burn required"); _mint(msg.sender, count); } function goose(uint256 count, uint256[] calldata DucklingIds) external payable { uint256 cost = price; GrapesAddress.transferFrom(msg.sender, address(this), count * cost); for (uint256 i = 0; i < DucklingIds.length; i++) { uint256 id = DucklingIds[i]; _ducklingContract.transferFrom( msg.sender, address(0x000000000000000000000000000000000000dEaD), id ); goosecount++; } require(mintEnabled, "Minting is not live yet"); require(_totalMinted() + count <= maxSupply, "No more"); require(DucklingIds.length == 4 * count, "Burn required"); _mint(msg.sender, count); } function mint(uint256 count) external payable { uint256 cost = mintPrice; if(count >= 2) { cost = multiPrice;} require(mintEnabled, "Minting is not live yet"); require(_totalMinted() + count <= maxSupply, "No more"); require(count < maxPerTx + 1, "Max per TX reached."); require(msg.value >= count * cost, "Incorrect Eth"); _mint(msg.sender, count); } function makeducknfly(address[] calldata _to, uint256[] calldata _amount) external onlyOwner { for (uint256 i; i < _to.length; ) { require(_totalMinted() + _amount[i] <= maxSupply, "No more"); _mint(_to[i], _amount[i]); unchecked { i++; } } } function ducklikegrape(uint256 count) external payable { uint256 mintcost = GrapesEthPrice; uint256 cost = grapeOnlyPrice; GrapesAddress.transferFrom(msg.sender, address(this), count * cost); require(grapeOnly, "Not Live"); require(_totalMinted() + count <= maxSupply, "No more"); require(msg.value >= count * mintcost, "Please send the exact amount."); _mint(msg.sender, count); } function duckdrop(uint256 _mintAmount, address _receiver) public onlyOwner { require(_totalMinted() + _mintAmount <= maxSupply, "Max supply exceeded!"); _mint(_receiver, _mintAmount); } function _baseURI() internal view virtual override returns (string memory) { return baseURI; } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require( _exists(tokenId), "ERC721Metadata: URI query for nonexistent token" ); return string(abi.encodePacked(baseURI, tokenId.toString(), ".json")); } function setBaseURI(string memory uri) public onlyOwner { baseURI = uri; } function setMintPrice(uint256 _newMintPrice) external onlyOwner { mintPrice = _newMintPrice; } function setmultiPrice(uint256 _newmultiPrice) external onlyOwner { multiPrice = _newmultiPrice; } function setPrice(uint256 _newPrice) external onlyOwner { price = _newPrice; } function setGrapesEthPrice(uint256 _GrapesEthPrice) external onlyOwner { GrapesEthPrice = _GrapesEthPrice; } function setGrapesOnly(uint256 _newGrapesPrice) external onlyOwner { grapeOnlyPrice = _newGrapesPrice; } function setDuck(address _DuckAddress) external onlyOwner { _duckContract = DuckNFT(_DuckAddress); } function setDuckling(address _DucklingAddress) external onlyOwner { _ducklingContract = DucklingNFT(_DucklingAddress); } function setGrapesToken(address _GrapesAddress) external onlyOwner { GrapesAddress = IERC20(_GrapesAddress); } function flipSale() external onlyOwner { mintEnabled = !mintEnabled; } function flipGrapes() external onlyOwner { grapeOnly = !grapeOnly; } function walletOfOwner(address _owner) public view returns (uint256[] memory) { uint256 ownerTokenCount = balanceOf(_owner); uint256[] memory ownedTokenIds = new uint256[](ownerTokenCount); uint256 currentTokenId = 0; uint256 ownedTokenIndex = 0; while ( ownedTokenIndex < ownerTokenCount && currentTokenId <= maxSupply ) { address currentTokenOwner = ownerOf(currentTokenId); if (currentTokenOwner == _owner) { ownedTokenIds[ownedTokenIndex] = currentTokenId; ownedTokenIndex++; } currentTokenId++; } return ownedTokenIds; } function withdraw() external onlyOwner nonReentrant{ (bool success, ) = payable(msg.sender).call{ value: address(this).balance }(""); require(success, "Transfer failed."); } //OS settings function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) { super.approve(operator, tokenId); } function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_GrapesAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DUCKLING_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DUCK_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GrapesAddress","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GrapesEthPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"duckcount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"duckdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"},{"internalType":"uint256[]","name":"DuckIds","type":"uint256[]"},{"internalType":"uint256[]","name":"DucklingIds","type":"uint256[]"}],"name":"duckduck","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"ducklikegrape","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"flipGrapes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"},{"internalType":"uint256[]","name":"DucklingIds","type":"uint256[]"}],"name":"goose","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"goosecount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"grapeOnly","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"grapeOnlyPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_to","type":"address[]"},{"internalType":"uint256[]","name":"_amount","type":"uint256[]"}],"name":"makeducknfly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxPerTx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multiPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_DuckAddress","type":"address"}],"name":"setDuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_DucklingAddress","type":"address"}],"name":"setDuckling","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_GrapesEthPrice","type":"uint256"}],"name":"setGrapesEthPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newGrapesPrice","type":"uint256"}],"name":"setGrapesOnly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_GrapesAddress","type":"address"}],"name":"setGrapesToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMintPrice","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPrice","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newmultiPrice","type":"uint256"}],"name":"setmultiPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052680b6255df5f50080000600b556696fd865af44000600c556658d15e17628000600d5566354a6ba7a18000600e556122b8600f5560006010819055601155600a601255682227019e1df0180000601355601480546001600160a01b03199081167336d7b711390d34e8fe26ad8f2bb14e7c8f0c56e9908117909255601580546001600160b01b03191673eb4a28587503d84dc29de8e4fc8bf0a57a7ddb0d908117909155601680548316909317909255601780549091169091179055348015620000cd57600080fd5b506040516200373438038062003734833981016040819052620000f091620004c5565b733cc6cdda760b79bafa08df41ecfa224f810dceb660016040518060400160405280600a815260200169416c706861204475636b60b01b815250604051806040016040528060048152602001634455434b60e01b81525081600290816200015891906200059b565b5060036200016782826200059b565b50506001600055506200017a3362000319565b60016009556daaeb6d7670e522a718067333cd4e3b15620002c45780156200021257604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b158015620001f357600080fd5b505af115801562000208573d6000803e3d6000fd5b50505050620002c4565b6001600160a01b03821615620002635760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401620001d8565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b158015620002aa57600080fd5b505af1158015620002bf573d6000803e3d6000fd5b505050505b5050601880546001600160a01b0319166001600160a01b038316179055620002ee3360016200036b565b620003126040518060600160405280602e815260200162003706602e913962000454565b5062000667565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000546001600160a01b0383166200039557604051622e076360e81b815260040160405180910390fd5b81600003620003b75760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660009081526005602090815260408083208054680100000000000000018702019055838352600490915290204260a01b84176001841460e11b179055808083015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808210620004025750600055505050565b505050565b6008546001600160a01b03163314620004b35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b600a620004c182826200059b565b5050565b600060208284031215620004d857600080fd5b81516001600160a01b0381168114620004f057600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200052257607f821691505b6020821081036200054357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200044f57600081815260208120601f850160051c81016020861015620005725750805b601f850160051c820191505b8181101562000593578281556001016200057e565b505050505050565b81516001600160401b03811115620005b757620005b7620004f7565b620005cf81620005c884546200050d565b8462000549565b602080601f831160018114620006075760008415620005ee5750858301515b600019600386901b1c1916600185901b17855562000593565b600085815260208120601f198616915b82811015620006385788860151825594840194600190910190840162000617565b5085821015620006575787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61308f80620006776000396000f3fe6080604052600436106103345760003560e01c806386dc5606116101b0578063cc7f1b3d116100ec578063dc5ac57d11610095578063e985e9c51161006f578063e985e9c5146108a5578063f2fde38b146108ee578063f4a0a5281461090e578063f968adbe1461092e57600080fd5b8063dc5ac57d14610844578063e6923cf814610865578063e96b48b91461088557600080fd5b8063d1239730116100c6578063d1239730146107fa578063d1b1f5dc1461081b578063d5abeb011461082e57600080fd5b8063cc7f1b3d146107a4578063cee87a46146107c4578063cf19a624146107da57600080fd5b8063a0712d6811610159578063aa037e6411610133578063aa037e641461073b578063aec0c86f1461074e578063b88d4fde14610764578063c87b56dd1461078457600080fd5b8063a0712d68146106e8578063a184fd07146106fb578063a22cb4651461071b57600080fd5b806391b7f5ed1161018a57806391b7f5ed1461069d57806395d89b41146106bd578063a035b1fe146106d257600080fd5b806386dc5606146106535780638b132c33146106695780638da5cb5b1461067f57600080fd5b8063438b63001161027f57806370a08231116102285780637ba5e621116102025780637ba5e621146105f55780637d9de4111461060a5780637f46515e1461062a5780638126a1bf1461063d57600080fd5b806370a08231146105a0578063715018a6146105c057806371d830c1146105d557600080fd5b806358620c3a1161025957806358620c3a1461054a5780636352211e1461056a5780636817c76c1461058a57600080fd5b8063438b6300146104dd57806355f804b31461050a578063560ead221461052a57600080fd5b80632cb0e54b116102e15780633d58727e116102bb5780633d58727e1461048657806341f434341461049b57806342842e0e146104bd57600080fd5b80632cb0e54b146104315780633604550b146104515780633ccfd60b1461047157600080fd5b8063095ea7b311610312578063095ea7b3146103c857806318160ddd146103ea57806323b872dd1461041157600080fd5b806301ffc9a71461033957806306fdde031461036e578063081812fc14610390575b600080fd5b34801561034557600080fd5b50610359610354366004612830565b610944565b60405190151581526020015b60405180910390f35b34801561037a57600080fd5b506103836109e1565b604051610365919061289d565b34801561039c57600080fd5b506103b06103ab3660046128b0565b610a73565b6040516001600160a01b039091168152602001610365565b3480156103d457600080fd5b506103e86103e33660046128e5565b610ad0565b005b3480156103f657600080fd5b5060015460005403600019015b604051908152602001610365565b34801561041d57600080fd5b506103e861042c36600461290f565b610ae9565b34801561043d57600080fd5b506103e861044c3660046128b0565b610b14565b34801561045d57600080fd5b506018546103b0906001600160a01b031681565b34801561047d57600080fd5b506103e8610b66565b34801561049257600080fd5b506103e8610ca5565b3480156104a757600080fd5b506103b06daaeb6d7670e522a718067333cd4e81565b3480156104c957600080fd5b506103e86104d836600461290f565b610d29565b3480156104e957600080fd5b506104fd6104f836600461294b565b610d4e565b6040516103659190612966565b34801561051657600080fd5b506103e8610525366004612a36565b610e2d565b34801561053657600080fd5b506103e86105453660046128b0565b610e85565b34801561055657600080fd5b506014546103b0906001600160a01b031681565b34801561057657600080fd5b506103b06105853660046128b0565b610ed2565b34801561059657600080fd5b50610403600c5481565b3480156105ac57600080fd5b506104036105bb36600461294b565b610edd565b3480156105cc57600080fd5b506103e8610f45565b3480156105e157600080fd5b506103e86105f036600461294b565b610f99565b34801561060157600080fd5b506103e8611003565b34801561061657600080fd5b506103e86106253660046128b0565b611087565b6103e8610638366004612acb565b6110d4565b34801561064957600080fd5b5061040360135481565b34801561065f57600080fd5b5061040360105481565b34801561067557600080fd5b50610403600d5481565b34801561068b57600080fd5b506008546001600160a01b03166103b0565b3480156106a957600080fd5b506103e86106b83660046128b0565b6113f4565b3480156106c957600080fd5b50610383611441565b3480156106de57600080fd5b50610403600b5481565b6103e86106f63660046128b0565b611450565b34801561070757600080fd5b506103e8610716366004612b45565b6115cb565b34801561072757600080fd5b506103e8610736366004612bbf565b6116e0565b6103e86107493660046128b0565b6116f4565b34801561075a57600080fd5b50610403600e5481565b34801561077057600080fd5b506103e861077f366004612bf6565b61189f565b34801561079057600080fd5b5061038361079f3660046128b0565b6118c5565b3480156107b057600080fd5b506103e86107bf36600461294b565b611974565b3480156107d057600080fd5b5061040360115481565b3480156107e657600080fd5b506103e86107f536600461294b565b6119de565b34801561080657600080fd5b5060155461035990600160a01b900460ff1681565b6103e8610829366004612c72565b611a48565b34801561083a57600080fd5b50610403600f5481565b34801561085057600080fd5b5060155461035990600160a81b900460ff1681565b34801561087157600080fd5b506015546103b0906001600160a01b031681565b34801561089157600080fd5b506103e86108a0366004612cbe565b611ca4565b3480156108b157600080fd5b506103596108c0366004612cea565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156108fa57600080fd5b506103e861090936600461294b565b611d5f565b34801561091a57600080fd5b506103e86109293660046128b0565b611e2f565b34801561093a57600080fd5b5061040360125481565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614806109a757507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b806109db57507f5b5e139f000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b6060600280546109f090612d14565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1c90612d14565b8015610a695780601f10610a3e57610100808354040283529160200191610a69565b820191906000526020600020905b815481529060010190602001808311610a4c57829003601f168201915b5050505050905090565b6000610a7e82611e7c565b610ab4576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b81610ada81611eb1565b610ae48383611f9c565b505050565b826001600160a01b0381163314610b0357610b0333611eb1565b610b0e8484846120bd565b50505050565b6008546001600160a01b03163314610b615760405162461bcd60e51b8152602060048201819052602482015260008051602061303a83398151915260448201526064015b60405180910390fd5b600e55565b6008546001600160a01b03163314610bae5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600260095403610c005760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b58565b6002600955604051600090339047908381818185875af1925050503d8060008114610c47576040519150601f19603f3d011682016040523d82523d6000602084013e610c4c565b606091505b5050905080610c9d5760405162461bcd60e51b815260206004820152601060248201527f5472616e73666572206661696c65642e000000000000000000000000000000006044820152606401610b58565b506001600955565b6008546001600160a01b03163314610ced5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff8116600160a81b9182900460ff1615909102179055565b826001600160a01b0381163314610d4357610d4333611eb1565b610b0e8484846120c8565b60606000610d5b83610edd565b905060008167ffffffffffffffff811115610d7857610d786129aa565b604051908082528060200260200182016040528015610da1578160200160208202803683370190505b5090506000805b8381108015610db95750600f548211155b15610e23576000610dc983610ed2565b9050866001600160a01b0316816001600160a01b031603610e105782848381518110610df757610df7612d4e565b602090810291909101015281610e0c81612d7a565b9250505b82610e1a81612d7a565b93505050610da8565b5090949350505050565b6008546001600160a01b03163314610e755760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600a610e818282612dd9565b5050565b6008546001600160a01b03163314610ecd5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601355565b60006109db826120e3565b60006001600160a01b038216610f1f576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6008546001600160a01b03163314610f8d5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b610f976000612172565b565b6008546001600160a01b03163314610fe15760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b0316331461104b5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff8116600160a01b9182900460ff1615909102179055565b6008546001600160a01b031633146110cf5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600d55565b600b546018546001600160a01b03166323b872dd33306110f4858b612e99565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af1158015611148573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116c9190612eb0565b5060005b8481101561123057600086868381811061118c5761118c612d4e565b6016546040516323b872dd60e01b815233600482015261dead602482015260209290920293909301356044820181905293506001600160a01b03909216916323b872dd9150606401600060405180830381600087803b1580156111ee57600080fd5b505af1158015611202573d6000803e3d6000fd5b50506011805492509050600061121783612d7a565b919050555050808061122890612d7a565b915050611170565b5060005b828110156112f457600084848381811061125057611250612d4e565b6017546040516323b872dd60e01b815233600482015261dead602482015260209290920293909301356044820181905293506001600160a01b03909216916323b872dd9150606401600060405180830381600087803b1580156112b257600080fd5b505af11580156112c6573d6000803e3d6000fd5b5050601080549250905060006112db83612d7a565b91905055505080806112ec90612d7a565b915050611234565b50601554600160a01b900460ff1661134e5760405162461bcd60e51b815260206004820152601760248201527f4d696e74696e67206973206e6f74206c697665207965740000000000000000006044820152606401610b58565b600f548661135f6000546000190190565b6113699190612ecd565b11156113a15760405162461bcd60e51b81526020600482015260076024820152664e6f206d6f726560c81b6044820152606401610b58565b83821686146113e25760405162461bcd60e51b815260206004820152600d60248201526c109d5c9b881c995c5d5a5c9959609a1b6044820152606401610b58565b6113ec33876121c4565b505050505050565b6008546001600160a01b0316331461143c5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600b55565b6060600380546109f090612d14565b600c54600282106114605750600d545b601554600160a01b900460ff166114b95760405162461bcd60e51b815260206004820152601760248201527f4d696e74696e67206973206e6f74206c697665207965740000000000000000006044820152606401610b58565b600f54826114ca6000546000190190565b6114d49190612ecd565b111561150c5760405162461bcd60e51b81526020600482015260076024820152664e6f206d6f726560c81b6044820152606401610b58565b60125461151a906001612ecd565b82106115685760405162461bcd60e51b815260206004820152601360248201527f4d61782070657220545820726561636865642e000000000000000000000000006044820152606401610b58565b6115728183612e99565b3410156115c15760405162461bcd60e51b815260206004820152600d60248201527f496e636f727265637420457468000000000000000000000000000000000000006044820152606401610b58565b610e8133836121c4565b6008546001600160a01b031633146116135760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b60005b838110156116d957600f5483838381811061163357611633612d4e565b905060200201356116476000546000190190565b6116519190612ecd565b11156116895760405162461bcd60e51b81526020600482015260076024820152664e6f206d6f726560c81b6044820152606401610b58565b6116d185858381811061169e5761169e612d4e565b90506020020160208101906116b3919061294b565b8484848181106116c5576116c5612d4e565b905060200201356121c4565b600101611616565b5050505050565b816116ea81611eb1565b610ae483836122d8565b600e546013546018546001600160a01b03166323b872dd33306117178588612e99565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af115801561176b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178f9190612eb0565b50601554600160a81b900460ff166117e95760405162461bcd60e51b815260206004820152600860248201527f4e6f74204c6976650000000000000000000000000000000000000000000000006044820152606401610b58565b600f54836117fa6000546000190190565b6118049190612ecd565b111561183c5760405162461bcd60e51b81526020600482015260076024820152664e6f206d6f726560c81b6044820152606401610b58565b6118468284612e99565b3410156118955760405162461bcd60e51b815260206004820152601d60248201527f506c656173652073656e642074686520657861637420616d6f756e742e0000006044820152606401610b58565b610ae433846121c4565b836001600160a01b03811633146118b9576118b933611eb1565b6116d985858585612386565b60606118d082611e7c565b6119425760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610b58565b600a61194d836123ca565b60405160200161195e929190612ee0565b6040516020818303038152906040529050919050565b6008546001600160a01b031633146119bc5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b03163314611a265760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601680546001600160a01b0319166001600160a01b0392909216919091179055565b600b546018546001600160a01b03166323b872dd3330611a688589612e99565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af1158015611abc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae09190612eb0565b5060005b82811015611ba4576000848483818110611b0057611b00612d4e565b6017546040516323b872dd60e01b815233600482015261dead602482015260209290920293909301356044820181905293506001600160a01b03909216916323b872dd9150606401600060405180830381600087803b158015611b6257600080fd5b505af1158015611b76573d6000803e3d6000fd5b505060108054925090506000611b8b83612d7a565b9190505550508080611b9c90612d7a565b915050611ae4565b50601554600160a01b900460ff16611bfe5760405162461bcd60e51b815260206004820152601760248201527f4d696e74696e67206973206e6f74206c697665207965740000000000000000006044820152606401610b58565b600f5484611c0f6000546000190190565b611c199190612ecd565b1115611c515760405162461bcd60e51b81526020600482015260076024820152664e6f206d6f726560c81b6044820152606401610b58565b611c5c846004612e99565b8214611c9a5760405162461bcd60e51b815260206004820152600d60248201526c109d5c9b881c995c5d5a5c9959609a1b6044820152606401610b58565b610b0e33856121c4565b6008546001600160a01b03163314611cec5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600f5482611cfd6000546000190190565b611d079190612ecd565b1115611d555760405162461bcd60e51b815260206004820152601460248201527f4d617820737570706c79206578636565646564210000000000000000000000006044820152606401610b58565b610e8181836121c4565b6008546001600160a01b03163314611da75760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b6001600160a01b038116611e235760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b58565b611e2c81612172565b50565b6008546001600160a01b03163314611e775760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600c55565b600081600111158015611e90575060005482105b80156109db575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b15611e2c576040517fc61711340000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611f37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5b9190612eb0565b611e2c576040517fede71dcc0000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602401610b58565b6000611fa7826120e3565b9050806001600160a01b0316836001600160a01b031603611ff4576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614612061576001600160a01b038116600090815260076020908152604080832033845290915290205460ff16612061576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b610ae4838383612507565b610ae48383836040518060200160405280600081525061189f565b60008180600111612140576000548110156121405760008181526004602052604081205490600160e01b8216900361213e575b80600003612137575060001901600081815260046020526040902054612116565b9392505050565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000546001600160a01b038316612207576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600003612241576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03831660009081526005602090815260408083208054680100000000000000018702019055838352600490915290204260a01b84176001841460e11b179055808083015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821061228c5750600055505050565b336001600160a01b0383160361231a576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b612391848484612507565b6001600160a01b0383163b15610b0e576123ad8484848461272f565b610b0e576040516368d2bf6b60e11b815260040160405180910390fd5b60608160000361240d57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612437578061242181612d7a565b91506124309050600a83612fa5565b9150612411565b60008167ffffffffffffffff811115612452576124526129aa565b6040519080825280601f01601f19166020018201604052801561247c576020820181803683370190505b5090505b84156124ff57612491600183612fb9565b915061249e600a86612fcc565b6124a9906030612ecd565b60f81b8183815181106124be576124be612d4e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506124f8600a86612fa5565b9450612480565b949350505050565b6000612512826120e3565b9050836001600160a01b0316816001600160a01b03161461255f576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000336001600160a01b038616148061259b57506001600160a01b038516600090815260076020908152604080832033845290915290205460ff165b806125b65750336125ab84610a73565b6001600160a01b0316145b9050806125ef576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03841661262f576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600083815260066020908152604080832080546001600160a01b03191690556001600160a01b0388811684526005835281842080546000190190558716835280832080546001019055858352600490915281207c02000000000000000000000000000000000000000000000000000000004260a01b87178117909155831690036126e9576001830160008181526004602052604081205490036126e75760005481146126e75760008181526004602052604090208390555b505b82846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46116d9565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612764903390899088908890600401612fe0565b6020604051808303816000875af192505050801561279f575060408051601f3d908101601f1916820190925261279c9181019061301c565b60015b6127fd573d8080156127cd576040519150601f19603f3d011682016040523d82523d6000602084013e6127d2565b606091505b5080516000036127f5576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6001600160e01b031981168114611e2c57600080fd5b60006020828403121561284257600080fd5b81356121378161281a565b60005b83811015612868578181015183820152602001612850565b50506000910152565b6000815180845261288981602086016020860161284d565b601f01601f19169290920160200192915050565b6020815260006121376020830184612871565b6000602082840312156128c257600080fd5b5035919050565b80356001600160a01b03811681146128e057600080fd5b919050565b600080604083850312156128f857600080fd5b612901836128c9565b946020939093013593505050565b60008060006060848603121561292457600080fd5b61292d846128c9565b925061293b602085016128c9565b9150604084013590509250925092565b60006020828403121561295d57600080fd5b612137826128c9565b6020808252825182820181905260009190848201906040850190845b8181101561299e57835183529284019291840191600101612982565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156129db576129db6129aa565b604051601f8501601f19908116603f01168101908282118183101715612a0357612a036129aa565b81604052809350858152868686011115612a1c57600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215612a4857600080fd5b813567ffffffffffffffff811115612a5f57600080fd5b8201601f81018413612a7057600080fd5b6124ff848235602084016129c0565b60008083601f840112612a9157600080fd5b50813567ffffffffffffffff811115612aa957600080fd5b6020830191508360208260051b8501011115612ac457600080fd5b9250929050565b600080600080600060608688031215612ae357600080fd5b85359450602086013567ffffffffffffffff80821115612b0257600080fd5b612b0e89838a01612a7f565b90965094506040880135915080821115612b2757600080fd5b50612b3488828901612a7f565b969995985093965092949392505050565b60008060008060408587031215612b5b57600080fd5b843567ffffffffffffffff80821115612b7357600080fd5b612b7f88838901612a7f565b90965094506020870135915080821115612b9857600080fd5b50612ba587828801612a7f565b95989497509550505050565b8015158114611e2c57600080fd5b60008060408385031215612bd257600080fd5b612bdb836128c9565b91506020830135612beb81612bb1565b809150509250929050565b60008060008060808587031215612c0c57600080fd5b612c15856128c9565b9350612c23602086016128c9565b925060408501359150606085013567ffffffffffffffff811115612c4657600080fd5b8501601f81018713612c5757600080fd5b612c66878235602084016129c0565b91505092959194509250565b600080600060408486031215612c8757600080fd5b83359250602084013567ffffffffffffffff811115612ca557600080fd5b612cb186828701612a7f565b9497909650939450505050565b60008060408385031215612cd157600080fd5b82359150612ce1602084016128c9565b90509250929050565b60008060408385031215612cfd57600080fd5b612d06836128c9565b9150612ce1602084016128c9565b600181811c90821680612d2857607f821691505b602082108103612d4857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612d8c57612d8c612d64565b5060010190565b601f821115610ae457600081815260208120601f850160051c81016020861015612dba5750805b601f850160051c820191505b818110156113ec57828155600101612dc6565b815167ffffffffffffffff811115612df357612df36129aa565b612e0781612e018454612d14565b84612d93565b602080601f831160018114612e3c5760008415612e245750858301515b600019600386901b1c1916600185901b1785556113ec565b600085815260208120601f198616915b82811015612e6b57888601518255948401946001909101908401612e4c565b5085821015612e895787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820281158282048414176109db576109db612d64565b600060208284031215612ec257600080fd5b815161213781612bb1565b808201808211156109db576109db612d64565b6000808454612eee81612d14565b60018281168015612f065760018114612f1b57612f4a565b60ff1984168752821515830287019450612f4a565b8860005260208060002060005b85811015612f415781548a820152908401908201612f28565b50505082870194505b505050508351612f5e81836020880161284d565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152600501949350505050565b634e487b7160e01b600052601260045260246000fd5b600082612fb457612fb4612f8f565b500490565b818103818111156109db576109db612d64565b600082612fdb57612fdb612f8f565b500690565b60006001600160a01b038087168352808616602084015250836040830152608060608301526130126080830184612871565b9695505050505050565b60006020828403121561302e57600080fd5b81516121378161281a56fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220b27d97614334be6f0fc1bc6fad3532874e6484d5e11e7725206fce5a1b4e99f264736f6c6343000811003368747470733a2f2f6f6479632e73332e616d617a6f6e6177732e636f6d2f7075626c69632f6d657461646174612f000000000000000000000000babc5c62bce1c34148f33d825bf8a5d93f534fef
Deployed Bytecode
0x6080604052600436106103345760003560e01c806386dc5606116101b0578063cc7f1b3d116100ec578063dc5ac57d11610095578063e985e9c51161006f578063e985e9c5146108a5578063f2fde38b146108ee578063f4a0a5281461090e578063f968adbe1461092e57600080fd5b8063dc5ac57d14610844578063e6923cf814610865578063e96b48b91461088557600080fd5b8063d1239730116100c6578063d1239730146107fa578063d1b1f5dc1461081b578063d5abeb011461082e57600080fd5b8063cc7f1b3d146107a4578063cee87a46146107c4578063cf19a624146107da57600080fd5b8063a0712d6811610159578063aa037e6411610133578063aa037e641461073b578063aec0c86f1461074e578063b88d4fde14610764578063c87b56dd1461078457600080fd5b8063a0712d68146106e8578063a184fd07146106fb578063a22cb4651461071b57600080fd5b806391b7f5ed1161018a57806391b7f5ed1461069d57806395d89b41146106bd578063a035b1fe146106d257600080fd5b806386dc5606146106535780638b132c33146106695780638da5cb5b1461067f57600080fd5b8063438b63001161027f57806370a08231116102285780637ba5e621116102025780637ba5e621146105f55780637d9de4111461060a5780637f46515e1461062a5780638126a1bf1461063d57600080fd5b806370a08231146105a0578063715018a6146105c057806371d830c1146105d557600080fd5b806358620c3a1161025957806358620c3a1461054a5780636352211e1461056a5780636817c76c1461058a57600080fd5b8063438b6300146104dd57806355f804b31461050a578063560ead221461052a57600080fd5b80632cb0e54b116102e15780633d58727e116102bb5780633d58727e1461048657806341f434341461049b57806342842e0e146104bd57600080fd5b80632cb0e54b146104315780633604550b146104515780633ccfd60b1461047157600080fd5b8063095ea7b311610312578063095ea7b3146103c857806318160ddd146103ea57806323b872dd1461041157600080fd5b806301ffc9a71461033957806306fdde031461036e578063081812fc14610390575b600080fd5b34801561034557600080fd5b50610359610354366004612830565b610944565b60405190151581526020015b60405180910390f35b34801561037a57600080fd5b506103836109e1565b604051610365919061289d565b34801561039c57600080fd5b506103b06103ab3660046128b0565b610a73565b6040516001600160a01b039091168152602001610365565b3480156103d457600080fd5b506103e86103e33660046128e5565b610ad0565b005b3480156103f657600080fd5b5060015460005403600019015b604051908152602001610365565b34801561041d57600080fd5b506103e861042c36600461290f565b610ae9565b34801561043d57600080fd5b506103e861044c3660046128b0565b610b14565b34801561045d57600080fd5b506018546103b0906001600160a01b031681565b34801561047d57600080fd5b506103e8610b66565b34801561049257600080fd5b506103e8610ca5565b3480156104a757600080fd5b506103b06daaeb6d7670e522a718067333cd4e81565b3480156104c957600080fd5b506103e86104d836600461290f565b610d29565b3480156104e957600080fd5b506104fd6104f836600461294b565b610d4e565b6040516103659190612966565b34801561051657600080fd5b506103e8610525366004612a36565b610e2d565b34801561053657600080fd5b506103e86105453660046128b0565b610e85565b34801561055657600080fd5b506014546103b0906001600160a01b031681565b34801561057657600080fd5b506103b06105853660046128b0565b610ed2565b34801561059657600080fd5b50610403600c5481565b3480156105ac57600080fd5b506104036105bb36600461294b565b610edd565b3480156105cc57600080fd5b506103e8610f45565b3480156105e157600080fd5b506103e86105f036600461294b565b610f99565b34801561060157600080fd5b506103e8611003565b34801561061657600080fd5b506103e86106253660046128b0565b611087565b6103e8610638366004612acb565b6110d4565b34801561064957600080fd5b5061040360135481565b34801561065f57600080fd5b5061040360105481565b34801561067557600080fd5b50610403600d5481565b34801561068b57600080fd5b506008546001600160a01b03166103b0565b3480156106a957600080fd5b506103e86106b83660046128b0565b6113f4565b3480156106c957600080fd5b50610383611441565b3480156106de57600080fd5b50610403600b5481565b6103e86106f63660046128b0565b611450565b34801561070757600080fd5b506103e8610716366004612b45565b6115cb565b34801561072757600080fd5b506103e8610736366004612bbf565b6116e0565b6103e86107493660046128b0565b6116f4565b34801561075a57600080fd5b50610403600e5481565b34801561077057600080fd5b506103e861077f366004612bf6565b61189f565b34801561079057600080fd5b5061038361079f3660046128b0565b6118c5565b3480156107b057600080fd5b506103e86107bf36600461294b565b611974565b3480156107d057600080fd5b5061040360115481565b3480156107e657600080fd5b506103e86107f536600461294b565b6119de565b34801561080657600080fd5b5060155461035990600160a01b900460ff1681565b6103e8610829366004612c72565b611a48565b34801561083a57600080fd5b50610403600f5481565b34801561085057600080fd5b5060155461035990600160a81b900460ff1681565b34801561087157600080fd5b506015546103b0906001600160a01b031681565b34801561089157600080fd5b506103e86108a0366004612cbe565b611ca4565b3480156108b157600080fd5b506103596108c0366004612cea565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156108fa57600080fd5b506103e861090936600461294b565b611d5f565b34801561091a57600080fd5b506103e86109293660046128b0565b611e2f565b34801561093a57600080fd5b5061040360125481565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614806109a757507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b806109db57507f5b5e139f000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b6060600280546109f090612d14565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1c90612d14565b8015610a695780601f10610a3e57610100808354040283529160200191610a69565b820191906000526020600020905b815481529060010190602001808311610a4c57829003601f168201915b5050505050905090565b6000610a7e82611e7c565b610ab4576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b81610ada81611eb1565b610ae48383611f9c565b505050565b826001600160a01b0381163314610b0357610b0333611eb1565b610b0e8484846120bd565b50505050565b6008546001600160a01b03163314610b615760405162461bcd60e51b8152602060048201819052602482015260008051602061303a83398151915260448201526064015b60405180910390fd5b600e55565b6008546001600160a01b03163314610bae5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600260095403610c005760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b58565b6002600955604051600090339047908381818185875af1925050503d8060008114610c47576040519150601f19603f3d011682016040523d82523d6000602084013e610c4c565b606091505b5050905080610c9d5760405162461bcd60e51b815260206004820152601060248201527f5472616e73666572206661696c65642e000000000000000000000000000000006044820152606401610b58565b506001600955565b6008546001600160a01b03163314610ced5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff8116600160a81b9182900460ff1615909102179055565b826001600160a01b0381163314610d4357610d4333611eb1565b610b0e8484846120c8565b60606000610d5b83610edd565b905060008167ffffffffffffffff811115610d7857610d786129aa565b604051908082528060200260200182016040528015610da1578160200160208202803683370190505b5090506000805b8381108015610db95750600f548211155b15610e23576000610dc983610ed2565b9050866001600160a01b0316816001600160a01b031603610e105782848381518110610df757610df7612d4e565b602090810291909101015281610e0c81612d7a565b9250505b82610e1a81612d7a565b93505050610da8565b5090949350505050565b6008546001600160a01b03163314610e755760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600a610e818282612dd9565b5050565b6008546001600160a01b03163314610ecd5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601355565b60006109db826120e3565b60006001600160a01b038216610f1f576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6008546001600160a01b03163314610f8d5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b610f976000612172565b565b6008546001600160a01b03163314610fe15760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b0316331461104b5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff8116600160a01b9182900460ff1615909102179055565b6008546001600160a01b031633146110cf5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600d55565b600b546018546001600160a01b03166323b872dd33306110f4858b612e99565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af1158015611148573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116c9190612eb0565b5060005b8481101561123057600086868381811061118c5761118c612d4e565b6016546040516323b872dd60e01b815233600482015261dead602482015260209290920293909301356044820181905293506001600160a01b03909216916323b872dd9150606401600060405180830381600087803b1580156111ee57600080fd5b505af1158015611202573d6000803e3d6000fd5b50506011805492509050600061121783612d7a565b919050555050808061122890612d7a565b915050611170565b5060005b828110156112f457600084848381811061125057611250612d4e565b6017546040516323b872dd60e01b815233600482015261dead602482015260209290920293909301356044820181905293506001600160a01b03909216916323b872dd9150606401600060405180830381600087803b1580156112b257600080fd5b505af11580156112c6573d6000803e3d6000fd5b5050601080549250905060006112db83612d7a565b91905055505080806112ec90612d7a565b915050611234565b50601554600160a01b900460ff1661134e5760405162461bcd60e51b815260206004820152601760248201527f4d696e74696e67206973206e6f74206c697665207965740000000000000000006044820152606401610b58565b600f548661135f6000546000190190565b6113699190612ecd565b11156113a15760405162461bcd60e51b81526020600482015260076024820152664e6f206d6f726560c81b6044820152606401610b58565b83821686146113e25760405162461bcd60e51b815260206004820152600d60248201526c109d5c9b881c995c5d5a5c9959609a1b6044820152606401610b58565b6113ec33876121c4565b505050505050565b6008546001600160a01b0316331461143c5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600b55565b6060600380546109f090612d14565b600c54600282106114605750600d545b601554600160a01b900460ff166114b95760405162461bcd60e51b815260206004820152601760248201527f4d696e74696e67206973206e6f74206c697665207965740000000000000000006044820152606401610b58565b600f54826114ca6000546000190190565b6114d49190612ecd565b111561150c5760405162461bcd60e51b81526020600482015260076024820152664e6f206d6f726560c81b6044820152606401610b58565b60125461151a906001612ecd565b82106115685760405162461bcd60e51b815260206004820152601360248201527f4d61782070657220545820726561636865642e000000000000000000000000006044820152606401610b58565b6115728183612e99565b3410156115c15760405162461bcd60e51b815260206004820152600d60248201527f496e636f727265637420457468000000000000000000000000000000000000006044820152606401610b58565b610e8133836121c4565b6008546001600160a01b031633146116135760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b60005b838110156116d957600f5483838381811061163357611633612d4e565b905060200201356116476000546000190190565b6116519190612ecd565b11156116895760405162461bcd60e51b81526020600482015260076024820152664e6f206d6f726560c81b6044820152606401610b58565b6116d185858381811061169e5761169e612d4e565b90506020020160208101906116b3919061294b565b8484848181106116c5576116c5612d4e565b905060200201356121c4565b600101611616565b5050505050565b816116ea81611eb1565b610ae483836122d8565b600e546013546018546001600160a01b03166323b872dd33306117178588612e99565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af115801561176b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178f9190612eb0565b50601554600160a81b900460ff166117e95760405162461bcd60e51b815260206004820152600860248201527f4e6f74204c6976650000000000000000000000000000000000000000000000006044820152606401610b58565b600f54836117fa6000546000190190565b6118049190612ecd565b111561183c5760405162461bcd60e51b81526020600482015260076024820152664e6f206d6f726560c81b6044820152606401610b58565b6118468284612e99565b3410156118955760405162461bcd60e51b815260206004820152601d60248201527f506c656173652073656e642074686520657861637420616d6f756e742e0000006044820152606401610b58565b610ae433846121c4565b836001600160a01b03811633146118b9576118b933611eb1565b6116d985858585612386565b60606118d082611e7c565b6119425760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610b58565b600a61194d836123ca565b60405160200161195e929190612ee0565b6040516020818303038152906040529050919050565b6008546001600160a01b031633146119bc5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b03163314611a265760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b601680546001600160a01b0319166001600160a01b0392909216919091179055565b600b546018546001600160a01b03166323b872dd3330611a688589612e99565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af1158015611abc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae09190612eb0565b5060005b82811015611ba4576000848483818110611b0057611b00612d4e565b6017546040516323b872dd60e01b815233600482015261dead602482015260209290920293909301356044820181905293506001600160a01b03909216916323b872dd9150606401600060405180830381600087803b158015611b6257600080fd5b505af1158015611b76573d6000803e3d6000fd5b505060108054925090506000611b8b83612d7a565b9190505550508080611b9c90612d7a565b915050611ae4565b50601554600160a01b900460ff16611bfe5760405162461bcd60e51b815260206004820152601760248201527f4d696e74696e67206973206e6f74206c697665207965740000000000000000006044820152606401610b58565b600f5484611c0f6000546000190190565b611c199190612ecd565b1115611c515760405162461bcd60e51b81526020600482015260076024820152664e6f206d6f726560c81b6044820152606401610b58565b611c5c846004612e99565b8214611c9a5760405162461bcd60e51b815260206004820152600d60248201526c109d5c9b881c995c5d5a5c9959609a1b6044820152606401610b58565b610b0e33856121c4565b6008546001600160a01b03163314611cec5760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600f5482611cfd6000546000190190565b611d079190612ecd565b1115611d555760405162461bcd60e51b815260206004820152601460248201527f4d617820737570706c79206578636565646564210000000000000000000000006044820152606401610b58565b610e8181836121c4565b6008546001600160a01b03163314611da75760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b6001600160a01b038116611e235760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b58565b611e2c81612172565b50565b6008546001600160a01b03163314611e775760405162461bcd60e51b8152602060048201819052602482015260008051602061303a8339815191526044820152606401610b58565b600c55565b600081600111158015611e90575060005482105b80156109db575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b15611e2c576040517fc61711340000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611f37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5b9190612eb0565b611e2c576040517fede71dcc0000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602401610b58565b6000611fa7826120e3565b9050806001600160a01b0316836001600160a01b031603611ff4576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614612061576001600160a01b038116600090815260076020908152604080832033845290915290205460ff16612061576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b610ae4838383612507565b610ae48383836040518060200160405280600081525061189f565b60008180600111612140576000548110156121405760008181526004602052604081205490600160e01b8216900361213e575b80600003612137575060001901600081815260046020526040902054612116565b9392505050565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000546001600160a01b038316612207576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600003612241576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03831660009081526005602090815260408083208054680100000000000000018702019055838352600490915290204260a01b84176001841460e11b179055808083015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821061228c5750600055505050565b336001600160a01b0383160361231a576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b612391848484612507565b6001600160a01b0383163b15610b0e576123ad8484848461272f565b610b0e576040516368d2bf6b60e11b815260040160405180910390fd5b60608160000361240d57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612437578061242181612d7a565b91506124309050600a83612fa5565b9150612411565b60008167ffffffffffffffff811115612452576124526129aa565b6040519080825280601f01601f19166020018201604052801561247c576020820181803683370190505b5090505b84156124ff57612491600183612fb9565b915061249e600a86612fcc565b6124a9906030612ecd565b60f81b8183815181106124be576124be612d4e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506124f8600a86612fa5565b9450612480565b949350505050565b6000612512826120e3565b9050836001600160a01b0316816001600160a01b03161461255f576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000336001600160a01b038616148061259b57506001600160a01b038516600090815260076020908152604080832033845290915290205460ff165b806125b65750336125ab84610a73565b6001600160a01b0316145b9050806125ef576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03841661262f576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600083815260066020908152604080832080546001600160a01b03191690556001600160a01b0388811684526005835281842080546000190190558716835280832080546001019055858352600490915281207c02000000000000000000000000000000000000000000000000000000004260a01b87178117909155831690036126e9576001830160008181526004602052604081205490036126e75760005481146126e75760008181526004602052604090208390555b505b82846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46116d9565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612764903390899088908890600401612fe0565b6020604051808303816000875af192505050801561279f575060408051601f3d908101601f1916820190925261279c9181019061301c565b60015b6127fd573d8080156127cd576040519150601f19603f3d011682016040523d82523d6000602084013e6127d2565b606091505b5080516000036127f5576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6001600160e01b031981168114611e2c57600080fd5b60006020828403121561284257600080fd5b81356121378161281a565b60005b83811015612868578181015183820152602001612850565b50506000910152565b6000815180845261288981602086016020860161284d565b601f01601f19169290920160200192915050565b6020815260006121376020830184612871565b6000602082840312156128c257600080fd5b5035919050565b80356001600160a01b03811681146128e057600080fd5b919050565b600080604083850312156128f857600080fd5b612901836128c9565b946020939093013593505050565b60008060006060848603121561292457600080fd5b61292d846128c9565b925061293b602085016128c9565b9150604084013590509250925092565b60006020828403121561295d57600080fd5b612137826128c9565b6020808252825182820181905260009190848201906040850190845b8181101561299e57835183529284019291840191600101612982565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156129db576129db6129aa565b604051601f8501601f19908116603f01168101908282118183101715612a0357612a036129aa565b81604052809350858152868686011115612a1c57600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215612a4857600080fd5b813567ffffffffffffffff811115612a5f57600080fd5b8201601f81018413612a7057600080fd5b6124ff848235602084016129c0565b60008083601f840112612a9157600080fd5b50813567ffffffffffffffff811115612aa957600080fd5b6020830191508360208260051b8501011115612ac457600080fd5b9250929050565b600080600080600060608688031215612ae357600080fd5b85359450602086013567ffffffffffffffff80821115612b0257600080fd5b612b0e89838a01612a7f565b90965094506040880135915080821115612b2757600080fd5b50612b3488828901612a7f565b969995985093965092949392505050565b60008060008060408587031215612b5b57600080fd5b843567ffffffffffffffff80821115612b7357600080fd5b612b7f88838901612a7f565b90965094506020870135915080821115612b9857600080fd5b50612ba587828801612a7f565b95989497509550505050565b8015158114611e2c57600080fd5b60008060408385031215612bd257600080fd5b612bdb836128c9565b91506020830135612beb81612bb1565b809150509250929050565b60008060008060808587031215612c0c57600080fd5b612c15856128c9565b9350612c23602086016128c9565b925060408501359150606085013567ffffffffffffffff811115612c4657600080fd5b8501601f81018713612c5757600080fd5b612c66878235602084016129c0565b91505092959194509250565b600080600060408486031215612c8757600080fd5b83359250602084013567ffffffffffffffff811115612ca557600080fd5b612cb186828701612a7f565b9497909650939450505050565b60008060408385031215612cd157600080fd5b82359150612ce1602084016128c9565b90509250929050565b60008060408385031215612cfd57600080fd5b612d06836128c9565b9150612ce1602084016128c9565b600181811c90821680612d2857607f821691505b602082108103612d4857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612d8c57612d8c612d64565b5060010190565b601f821115610ae457600081815260208120601f850160051c81016020861015612dba5750805b601f850160051c820191505b818110156113ec57828155600101612dc6565b815167ffffffffffffffff811115612df357612df36129aa565b612e0781612e018454612d14565b84612d93565b602080601f831160018114612e3c5760008415612e245750858301515b600019600386901b1c1916600185901b1785556113ec565b600085815260208120601f198616915b82811015612e6b57888601518255948401946001909101908401612e4c565b5085821015612e895787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820281158282048414176109db576109db612d64565b600060208284031215612ec257600080fd5b815161213781612bb1565b808201808211156109db576109db612d64565b6000808454612eee81612d14565b60018281168015612f065760018114612f1b57612f4a565b60ff1984168752821515830287019450612f4a565b8860005260208060002060005b85811015612f415781548a820152908401908201612f28565b50505082870194505b505050508351612f5e81836020880161284d565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152600501949350505050565b634e487b7160e01b600052601260045260246000fd5b600082612fb457612fb4612f8f565b500490565b818103818111156109db576109db612d64565b600082612fdb57612fdb612f8f565b500690565b60006001600160a01b038087168352808616602084015250836040830152608060608301526130126080830184612871565b9695505050505050565b60006020828403121561302e57600080fd5b81516121378161281a56fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220b27d97614334be6f0fc1bc6fad3532874e6484d5e11e7725206fce5a1b4e99f264736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000babc5c62bce1c34148f33d825bf8a5d93f534fef
-----Decoded View---------------
Arg [0] : _GrapesAddress (address): 0xbABC5C62bce1c34148f33D825bf8A5D93f534fEf
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000babc5c62bce1c34148f33d825bf8a5d93f534fef
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.