ERC-721
NFT
Overview
Max Total Supply
10,000 CZPG
Holders
2,888
Market
Volume (24H)
0.0145 ETH
Min Price (24H)
$48.54 @ 0.014500 ETH
Max Price (24H)
$48.54 @ 0.014500 ETH
Other Info
Token Contract
Balance
15 CZPGLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
CozyPenguin
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; /** * The CozyPenguin NFT contract. * * This contract is designed to operate in phases. We store a merkle tree * containing hashed tuples of (address, phase, max tokens). This tree ensures * that during the phased launch only folks allowed to mint during the current * phase can mint. * * After the phased launch the contract enters an on sale period where anyone * is allowed to mint. * * When we release the NFT, we leverage one Chainlink VRF call to generate a * random offset. We then will internally modify our NFT metadata files to * incorporate this random offset before storing it on chain. * * This means that after release we ensure that token #1 maps to an NFT named * #1 despite the image it links to being set to (1 + randomOffset % 10000). * The image base URI is not modifiable after release so it serves as our * provenance. We cannot reorder the images to benefit ourselves. * * That being said, we acknowledge that this does pose the risk of us * maliciously modifying the metadata files post release and before we lock * down the contract. We accept this risk because doing so is transparent and * anyone can verify that we performed the mapping correctly. * * Once the NFT is released and appropriately mapped, the contract will be * locked to prevent any and all tampering forever. */ contract CozyPenguin is ERC721, IERC721Enumerable, VRFConsumerBase, Ownable { using Strings for uint; string private constant NAME = "Cozy Penguin"; string private constant SYMBOL = "CZPG"; string public imageBaseUri; string public metadataBaseUri; string public unknownTokenUri; uint public maxPhase; uint public immutable maxTokens; uint public maxTokensPerUser; bytes32 public merkleRoot; mapping(address => uint) public numClaimedByUser; // A safety net to confirm addresses set properly address public immutable linkAddress; address public immutable vrfCoordinatorAddress; bytes32 public vrfKeyHash; uint public vrfFee; uint public totalTokenSupply; uint public randomOffset; uint public phase; bool public randomized; bool public revealed; bool public locked; event PhaseUpdated(uint phase); constructor( uint _maxPhase, uint _maxTokens, uint _maxTokensPerUser, address _vrfCoordinator, address _link, bytes32 _vrfKeyHash, uint _vrfFee ) ERC721(NAME, SYMBOL) VRFConsumerBase(_vrfCoordinator, _link) { maxPhase = _maxPhase; maxTokens = _maxTokens; maxTokensPerUser = _maxTokensPerUser; vrfCoordinatorAddress = _vrfCoordinator; linkAddress = _link; vrfKeyHash = _vrfKeyHash; vrfFee = _vrfFee; } // ----------- Setters ----------- function setVrfSettings(bytes32 _vrfKeyHash, uint _vrfFee) external onlyOwner { vrfKeyHash = _vrfKeyHash; vrfFee = _vrfFee; } function setImageBaseUri(string calldata uri) external onlyOwner notLocked { require(!randomized, "Cannot set new image URI after random offset determined"); imageBaseUri = uri; } function setMetadataBaseUri(string calldata uri) external onlyOwner notLocked { metadataBaseUri = uri; } function setUnknownTokenUri(string calldata uri) external onlyOwner notLocked { unknownTokenUri = uri; } function setPhase(uint _phase) external onlyOwner notLocked { require(_phase <= maxPhase, "Cannot set phase greater than max phase"); phase = _phase; emit PhaseUpdated(_phase); } function setMaxPhase(uint _maxPhase) external onlyOwner notLocked { maxPhase = _maxPhase; } function setMaxTokensPerUser(uint _maxTokensPerUser) external onlyOwner notLocked { require(_maxTokensPerUser <= maxTokens, "Max tokens per user too large"); maxTokensPerUser = _maxTokensPerUser; } function setMerkleRoot(bytes32 root) external onlyOwner notLocked { merkleRoot = root; } function setRevealed(bool _revealed) external onlyOwner notLocked { bytes memory testMetadataBaseUri = bytes(metadataBaseUri); require(testMetadataBaseUri.length != 0, "Cannot reveal when Metadata Base URI is empty"); require(phase == maxPhase, "Cannot reveal when contract is not at max phase"); require(randomized, "Cannot reveal when a random offset has not been generated"); revealed = _revealed; } // ----------- Getters ----------- function isValidProof( bytes32[] calldata _proof, uint _userPhase, uint _userMaxTokens ) public view returns (bool) { bytes32 leaf = keccak256(abi.encode(msg.sender, _userPhase, _userMaxTokens)); return MerkleProof.verify(_proof, merkleRoot, leaf); } function getNumClaimedByUser(address user) external view returns (uint) { return numClaimedByUser[user]; } // ----------- ERC721 --------------- function tokenURI(uint tokenId) public view override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); if (!revealed) { return unknownTokenUri; } return string(abi.encodePacked(metadataBaseUri, tokenId.toString(), ".json")); } function _mintMultiple(uint numberOfTokens, address recipient) private { for (uint i = 0; i < numberOfTokens; i += 1) { uint index = totalTokenSupply; if (index < maxTokens) { totalTokenSupply += 1; numClaimedByUser[recipient] += 1; _safeMint(recipient, index + 1); } } } function mintPresale( uint numberOfTokens, uint userPhase, uint userMaxTokens, bytes32[] calldata proof ) external { require(totalTokenSupply + numberOfTokens <= maxTokens, "Not enough tokens"); require(phase != maxPhase, "Presale is over"); require(userPhase <= phase, "Phase is not open"); require(isValidProof(proof, userPhase, userMaxTokens), "Proof was invalid"); uint claimed = numClaimedByUser[msg.sender]; require(claimed + numberOfTokens <= userMaxTokens, "Minting more than allowed"); _mintMultiple(numberOfTokens, msg.sender); } function mint(uint numberOfTokens) external { require(totalTokenSupply + numberOfTokens <= maxTokens, "Not enough tokens"); require(phase == maxPhase, "Sale has not begun"); uint claimed = numClaimedByUser[msg.sender]; require(claimed + numberOfTokens <= maxTokensPerUser, "Minting more than allowed"); _mintMultiple(numberOfTokens, msg.sender); } // -------- IERC721Enumerable ----------- function totalSupply() external view override returns (uint) { return totalTokenSupply; } function tokenOfOwnerByIndex(address owner, uint index) external view override returns (uint) { require(index < ERC721.balanceOf(owner), "Index out of range"); uint foundTokens = 0; uint batchSize = 100; uint start = 1; uint tokenIdUpperBound = totalTokenSupply + 1; uint end = (start + batchSize) > tokenIdUpperBound ? tokenIdUpperBound : (start + batchSize); do { TokenEnumerationResult memory result = tokensOfOwnerInRange(owner, start, end); if (index - foundTokens < result.foundCount) { return result.tokenIds[index - foundTokens]; } foundTokens += result.foundCount; start = result.lastIndex; end = (start + batchSize) > tokenIdUpperBound ? tokenIdUpperBound : (start + batchSize); } while (end <= tokenIdUpperBound); require(false, "Not enough owned tokens were found to reach index"); return 0; } struct TokenEnumerationResult { uint lastIndex; uint foundCount; uint[100] tokenIds; } function tokensOfOwnerInRange( address owner, uint start, uint end ) public view returns (TokenEnumerationResult memory result) { require(start < end && end <= totalTokenSupply + 1, "Invalid range"); for (uint tokenId = start; tokenId < end; tokenId += 1) { if (owner == ERC721.ownerOf(tokenId)) { result.tokenIds[result.foundCount] = tokenId; result.foundCount += 1; if (result.foundCount == 100) { result.lastIndex = tokenId + 1; return result; } } } result.lastIndex = end; } function tokenByIndex(uint index) external view override returns (uint) { require(index < totalTokenSupply, "Invalid index"); return index + 1; } // -------- Random Offset ----------- function generateRandomOffset() external onlyOwner { require(!randomized, "Random offset already set"); requestRandomness(vrfKeyHash, vrfFee); } function fulfillRandomness(bytes32, uint randomness) internal override { require(!randomized, "Random offset already set"); randomOffset = randomness % maxTokens; randomized = true; } // ------------ Locking ------------- function lock() external onlyOwner { require(revealed, "Project not yet revealed"); locked = true; } modifier notLocked() { require(!locked, "Contract is locked"); _; } // ------------ Withdraw ------------- function withdrawLink(address _link) external onlyOwner { LinkTokenInterface link = LinkTokenInterface(_link); bool succeed = link.transfer(msg.sender, link.balanceOf(address(this))); require(succeed, "Transfer failed"); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/LinkTokenInterface.sol"; import "./VRFRequestIDBase.sol"; /** **************************************************************************** * @notice Interface for contracts using VRF randomness * ***************************************************************************** * @dev PURPOSE * * @dev Reggie the Random Oracle (not his real job) wants to provide randomness * @dev to Vera the verifier in such a way that Vera can be sure he's not * @dev making his output up to suit himself. Reggie provides Vera a public key * @dev to which he knows the secret key. Each time Vera provides a seed to * @dev Reggie, he gives back a value which is computed completely * @dev deterministically from the seed and the secret key. * * @dev Reggie provides a proof by which Vera can verify that the output was * @dev correctly computed once Reggie tells it to her, but without that proof, * @dev the output is indistinguishable to her from a uniform random sample * @dev from the output space. * * @dev The purpose of this contract is to make it easy for unrelated contracts * @dev to talk to Vera the verifier about the work Reggie is doing, to provide * @dev simple access to a verifiable source of randomness. * ***************************************************************************** * @dev USAGE * * @dev Calling contracts must inherit from VRFConsumerBase, and can * @dev initialize VRFConsumerBase's attributes in their constructor as * @dev shown: * * @dev contract VRFConsumer { * @dev constuctor(<other arguments>, address _vrfCoordinator, address _link) * @dev VRFConsumerBase(_vrfCoordinator, _link) public { * @dev <initialization with other arguments goes here> * @dev } * @dev } * * @dev The oracle will have given you an ID for the VRF keypair they have * @dev committed to (let's call it keyHash), and have told you the minimum LINK * @dev price for VRF service. Make sure your contract has sufficient LINK, and * @dev call requestRandomness(keyHash, fee, seed), where seed is the input you * @dev want to generate randomness from. * * @dev Once the VRFCoordinator has received and validated the oracle's response * @dev to your request, it will call your contract's fulfillRandomness method. * * @dev The randomness argument to fulfillRandomness is the actual random value * @dev generated from your seed. * * @dev The requestId argument is generated from the keyHash and the seed by * @dev makeRequestId(keyHash, seed). If your contract could have concurrent * @dev requests open, you can use the requestId to track which seed is * @dev associated with which randomness. See VRFRequestIDBase.sol for more * @dev details. (See "SECURITY CONSIDERATIONS" for principles to keep in mind, * @dev if your contract could have multiple requests in flight simultaneously.) * * @dev Colliding `requestId`s are cryptographically impossible as long as seeds * @dev differ. (Which is critical to making unpredictable randomness! See the * @dev next section.) * * ***************************************************************************** * @dev SECURITY CONSIDERATIONS * * @dev A method with the ability to call your fulfillRandomness method directly * @dev could spoof a VRF response with any random value, so it's critical that * @dev it cannot be directly called by anything other than this base contract * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method). * * @dev For your users to trust that your contract's random behavior is free * @dev from malicious interference, it's best if you can write it so that all * @dev behaviors implied by a VRF response are executed *during* your * @dev fulfillRandomness method. If your contract must store the response (or * @dev anything derived from it) and use it later, you must ensure that any * @dev user-significant behavior which depends on that stored value cannot be * @dev manipulated by a subsequent VRF request. * * @dev Similarly, both miners and the VRF oracle itself have some influence * @dev over the order in which VRF responses appear on the blockchain, so if * @dev your contract could have multiple VRF requests in flight simultaneously, * @dev you must ensure that the order in which the VRF responses arrive cannot * @dev be used to manipulate your contract's user-significant behavior. * * @dev Since the ultimate input to the VRF is mixed with the block hash of the * @dev block in which the request is made, user-provided seeds have no impact * @dev on its economic security properties. They are only included for API * @dev compatability with previous versions of this contract. * * @dev Since the block hash of the block which contains the requestRandomness * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful * @dev miner could, in principle, fork the blockchain to evict the block * @dev containing the request, forcing the request to be included in a * @dev different block with a different hash, and therefore a different input * @dev to the VRF. However, such an attack would incur a substantial economic * @dev cost. This cost scales with the number of blocks the VRF oracle waits * @dev until it calls responds to a request. */ abstract contract VRFConsumerBase is VRFRequestIDBase { /** * @notice fulfillRandomness handles the VRF response. Your contract must * @notice implement it. See "SECURITY CONSIDERATIONS" above for important * @notice principles to keep in mind when implementing your fulfillRandomness * @notice method. * * @dev VRFConsumerBase expects its subcontracts to have a method with this * @dev signature, and will call it once it has verified the proof * @dev associated with the randomness. (It is triggered via a call to * @dev rawFulfillRandomness, below.) * * @param requestId The Id initially returned by requestRandomness * @param randomness the VRF output */ function fulfillRandomness( bytes32 requestId, uint256 randomness ) internal virtual; /** * @dev In order to keep backwards compatibility we have kept the user * seed field around. We remove the use of it because given that the blockhash * enters later, it overrides whatever randomness the used seed provides. * Given that it adds no security, and can easily lead to misunderstandings, * we have removed it from usage and can now provide a simpler API. */ uint256 constant private USER_SEED_PLACEHOLDER = 0; /** * @notice requestRandomness initiates a request for VRF output given _seed * * @dev The fulfillRandomness method receives the output, once it's provided * @dev by the Oracle, and verified by the vrfCoordinator. * * @dev The _keyHash must already be registered with the VRFCoordinator, and * @dev the _fee must exceed the fee specified during registration of the * @dev _keyHash. * * @dev The _seed parameter is vestigial, and is kept only for API * @dev compatibility with older versions. It can't *hurt* to mix in some of * @dev your own randomness, here, but it's not necessary because the VRF * @dev oracle will mix the hash of the block containing your request into the * @dev VRF seed it ultimately uses. * * @param _keyHash ID of public key against which randomness is generated * @param _fee The amount of LINK to send with the request * * @return requestId unique ID for this request * * @dev The returned requestId can be used to distinguish responses to * @dev concurrent requests. It is passed as the first argument to * @dev fulfillRandomness. */ function requestRandomness( bytes32 _keyHash, uint256 _fee ) internal returns ( bytes32 requestId ) { LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER)); // This is the seed passed to VRFCoordinator. The oracle will mix this with // the hash of the block containing this request to obtain the seed/input // which is finally passed to the VRF cryptographic machinery. uint256 vRFSeed = makeVRFInputSeed(_keyHash, USER_SEED_PLACEHOLDER, address(this), nonces[_keyHash]); // nonces[_keyHash] must stay in sync with // VRFCoordinator.nonces[_keyHash][this], which was incremented by the above // successful LINK.transferAndCall (in VRFCoordinator.randomnessRequest). // This provides protection against the user repeating their input seed, // which would result in a predictable/duplicate output, if multiple such // requests appeared in the same block. nonces[_keyHash] = nonces[_keyHash] + 1; return makeRequestId(_keyHash, vRFSeed); } LinkTokenInterface immutable internal LINK; address immutable private vrfCoordinator; // Nonces for each VRF key from which randomness has been requested. // // Must stay in sync with VRFCoordinator[_keyHash][this] mapping(bytes32 /* keyHash */ => uint256 /* nonce */) private nonces; /** * @param _vrfCoordinator address of VRFCoordinator contract * @param _link address of LINK token contract * * @dev https://docs.chain.link/docs/link-token-contracts */ constructor( address _vrfCoordinator, address _link ) { vrfCoordinator = _vrfCoordinator; LINK = LinkTokenInterface(_link); } // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF // proof. rawFulfillRandomness then calls fulfillRandomness, after validating // the origin of the call function rawFulfillRandomness( bytes32 requestId, uint256 randomness ) external { require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill"); fulfillRandomness(requestId, randomness); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface LinkTokenInterface { function allowance( address owner, address spender ) external view returns ( uint256 remaining ); function approve( address spender, uint256 value ) external returns ( bool success ); function balanceOf( address owner ) external view returns ( uint256 balance ); function decimals() external view returns ( uint8 decimalPlaces ); function decreaseApproval( address spender, uint256 addedValue ) external returns ( bool success ); function increaseApproval( address spender, uint256 subtractedValue ) external; function name() external view returns ( string memory tokenName ); function symbol() external view returns ( string memory tokenSymbol ); function totalSupply() external view returns ( uint256 totalTokensIssued ); function transfer( address to, uint256 value ) external returns ( bool success ); function transferAndCall( address to, uint256 value, bytes calldata data ) external returns ( bool success ); function transferFrom( address from, address to, uint256 value ) external returns ( bool success ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev 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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); } } return computedHash; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ 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: balance query for the zero address"); 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 overriden 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 || getApproved(tokenId) == spender || isApprovedForAll(owner, 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); } /** * @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); } /** * @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 of token that is not own"); 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); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {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 a {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 {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract VRFRequestIDBase { /** * @notice returns the seed which is actually input to the VRF coordinator * * @dev To prevent repetition of VRF output due to repetition of the * @dev user-supplied seed, that seed is combined in a hash with the * @dev user-specific nonce, and the address of the consuming contract. The * @dev risk of repetition is mostly mitigated by inclusion of a blockhash in * @dev the final seed, but the nonce does protect against repetition in * @dev requests which are included in a single block. * * @param _userSeed VRF seed input provided by user * @param _requester Address of the requesting contract * @param _nonce User-specific nonce at the time of the request */ function makeVRFInputSeed( bytes32 _keyHash, uint256 _userSeed, address _requester, uint256 _nonce ) internal pure returns ( uint256 ) { return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce))); } /** * @notice Returns the id for this request * @param _keyHash The serviceAgreement ID to be used for this request * @param _vRFInputSeed The seed to be passed directly to the VRF * @return The id for this request * * @dev Note that _vRFInputSeed is not the seed passed by the consuming * @dev contract, but the one generated by makeVRFInputSeed */ function makeRequestId( bytes32 _keyHash, uint256 _vRFInputSeed ) internal pure returns ( bytes32 ) { return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, 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 Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 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); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 1 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"_maxPhase","type":"uint256"},{"internalType":"uint256","name":"_maxTokens","type":"uint256"},{"internalType":"uint256","name":"_maxTokensPerUser","type":"uint256"},{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"address","name":"_link","type":"address"},{"internalType":"bytes32","name":"_vrfKeyHash","type":"bytes32"},{"internalType":"uint256","name":"_vrfFee","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"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":false,"internalType":"uint256","name":"phase","type":"uint256"}],"name":"PhaseUpdated","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":[{"internalType":"address","name":"to","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":"generateRandomOffset","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":"address","name":"user","type":"address"}],"name":"getNumClaimedByUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"imageBaseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"},{"internalType":"uint256","name":"_userPhase","type":"uint256"},{"internalType":"uint256","name":"_userMaxTokens","type":"uint256"}],"name":"isValidProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"linkAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTokensPerUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadataBaseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfTokens","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfTokens","type":"uint256"},{"internalType":"uint256","name":"userPhase","type":"uint256"},{"internalType":"uint256","name":"userMaxTokens","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintPresale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numClaimedByUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"phase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomOffset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":"setImageBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxPhase","type":"uint256"}],"name":"setMaxPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxTokensPerUser","type":"uint256"}],"name":"setMaxTokensPerUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"root","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setMetadataBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_phase","type":"uint256"}],"name":"setPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_revealed","type":"bool"}],"name":"setRevealed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setUnknownTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_vrfKeyHash","type":"bytes32"},{"internalType":"uint256","name":"_vrfFee","type":"uint256"}],"name":"setVrfSettings","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":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"tokensOfOwnerInRange","outputs":[{"components":[{"internalType":"uint256","name":"lastIndex","type":"uint256"},{"internalType":"uint256","name":"foundCount","type":"uint256"},{"internalType":"uint256[100]","name":"tokenIds","type":"uint256[100]"}],"internalType":"struct CozyPenguin.TokenEnumerationResult","name":"result","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTokenSupply","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":[],"name":"unknownTokenUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfCoordinatorAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_link","type":"address"}],"name":"withdrawLink","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101206040523480156200001257600080fd5b506040516200354d3803806200354d83398101604081905262000035916200021b565b604080518082018252600c81526b21b7bd3c902832b733bab4b760a11b602080830191825283518085019094526004845263435a504760e01b90840152815187938793929091620000899160009162000158565b5080516200009f90600190602084019062000158565b5050506001600160601b0319606092831b811660a052911b16608052620000cd620000c73390565b62000106565b600b9690965560c094909452600c929092556001600160601b0319606091821b81166101005291901b1660e052600f55601055620002bf565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001669062000282565b90600052602060002090601f0160209004810192826200018a5760008555620001d5565b82601f10620001a557805160ff1916838001178555620001d5565b82800160010185558215620001d5579182015b82811115620001d5578251825591602001919060010190620001b8565b50620001e3929150620001e7565b5090565b5b80821115620001e35760008155600101620001e8565b80516001600160a01b03811681146200021657600080fd5b919050565b600080600080600080600060e0888a03121562000236578283fd5b8751965060208801519550604088015194506200025660608901620001fe565b93506200026660808901620001fe565b925060a0880151915060c0880151905092959891949750929550565b600181811c908216806200029757607f821691505b60208210811415620002b957634e487b7160e01b600052602260045260246000fd5b50919050565b60805160601c60a05160601c60c05160e05160601c6101005160601c6132136200033a60003960006104500152600061032a0152600081816105f101528181610fcc01528181611200015281816115950152818161202f01526120eb0152600081816113f7015261236e0152600061233f01526132136000f3fe608060405234801561001057600080fd5b506004361061027d5760003560e01c806301ffc9a714610282578063041d443e146102aa57806306fdde03146102c1578063081812fc146102d6578063095ea7b3146102f65780631017507d1461030b57806318160ddd146103145780631ca8b6cb1461031c578063235cea981461032557806323b872dd1461034c57806328901e351461035f5780632c9ea2421461036c5780632cc30587146103745780632cc82655146103875780632eb4a7ab1461039a5780632f745c59146103a357806336864adb146103b65780633697a679146103be57806339b92bbb146103d15780633b238f56146103e457806342842e0e146103ed5780634f6ccce714610400578063510aef051461041357806351830227146104265780636352211e1461043857806367f16bcf1461044b57806370a0823114610472578063715018a614610485578063727a612e1461048d5780637cb64759146104a05780638da5cb5b146104b35780638df5e630146104bb578063900bba41146104c457806390e9ca7f146104d757806394985ddd146104ea57806395d89b41146104fd5780639c59ce5914610505578063a0712d6814610525578063a22cb46514610538578063a2a07c2e1461054b578063a556203214610553578063ab9c6dbb1461057c578063b1c9fe6e1461058f578063b88d4fde14610598578063c87b56dd146105ab578063cc7a856c146105be578063cf309012146105c6578063e0a80853146105d9578063e8315742146105ec578063e985e9c514610613578063ee43d43e14610626578063f0679e5c1461062f578063f2fde38b1461064f578063f83d08ba14610662578063febfeaf71461066a575b600080fd5b610295610290366004612bfb565b61067d565b60405190151581526020015b60405180910390f35b6102b3600f5481565b6040519081526020016102a1565b6102c96106cf565b6040516102a19190612e8f565b6102e96102e4366004612bc2565b610761565b6040516102a19190612e17565b610309610304366004612ae1565b6107ee565b005b6102b360105481565b6011546102b3565b6102b360115481565b6102e97f000000000000000000000000000000000000000000000000000000000000000081565b61030961035a36600461299c565b6108ff565b6014546102959060ff1681565b6102c9610930565b610309610382366004612bc2565b6109be565b610309610395366004612bc2565b610a1b565b6102b3600d5481565b6102b36103b1366004612ae1565b610b10565b6102c9610ca6565b6103096103cc366004612c33565b610cb3565b6103096103df366004612c33565b610d17565b6102b360125481565b6103096103fb36600461299c565b610dee565b6102b361040e366004612bc2565b610e09565b610309610421366004612bda565b610e57565b60145461029590610100900460ff1681565b6102e9610446366004612bc2565b610e91565b6102e97f000000000000000000000000000000000000000000000000000000000000000081565b6102b3610480366004612950565b610f08565b610309610f8f565b61030961049b366004612cb7565b610fca565b6103096104ae366004612bc2565b61113a565b6102e9611197565b6102b3600b5481565b6103096104d2366004612bc2565b6111a6565b6103096104e5366004612950565b611273565b6103096104f8366004612bda565b6113ec565b6102c9611472565b610518610513366004612b0a565b611481565b6040516102a19190613037565b610309610533366004612bc2565b611593565b610309610546366004612aab565b61166d565b6102c9611678565b6102b3610561366004612950565b6001600160a01b03166000908152600e602052604090205490565b61030961058a366004612c33565b611685565b6102b360135481565b6103096105a63660046129d7565b6116e9565b6102c96105b9366004612bc2565b611721565b610309611863565b6014546102959062010000900460ff1681565b6103096105e7366004612b8a565b6118c6565b6102b37f000000000000000000000000000000000000000000000000000000000000000081565b61029561062136600461296a565b611b0f565b6102b3600c5481565b6102b361063d366004612950565b600e6020526000908152604090205481565b61030961065d366004612950565b611b3d565b610309611bda565b610295610678366004612b3c565b611c6e565b60006001600160e01b031982166380ac58cd60e01b14806106ae57506001600160e01b03198216635b5e139f60e01b145b806106c957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546106de906130ed565b80601f016020809104026020016040519081016040528092919081815260200182805461070a906130ed565b80156107575780601f1061072c57610100808354040283529160200191610757565b820191906000526020600020905b81548152906001019060200180831161073a57829003601f168201915b5050505050905090565b600061076c82611cf2565b6107d25760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006107f982610e91565b9050806001600160a01b0316836001600160a01b031614156108675760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016107c9565b336001600160a01b038216148061088357506108838133611b0f565b6108f05760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b60648201526084016107c9565b6108fa8383611d0f565b505050565b6109093382611d7d565b6109255760405162461bcd60e51b81526004016107c990612f5c565b6108fa838383611e3f565b6008805461093d906130ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610969906130ed565b80156109b65780601f1061098b576101008083540402835291602001916109b6565b820191906000526020600020905b81548152906001019060200180831161099957829003601f168201915b505050505081565b336109c7611197565b6001600160a01b0316146109ed5760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff1615610a165760405162461bcd60e51b81526004016107c99061300b565b600b55565b33610a24611197565b6001600160a01b031614610a4a5760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff1615610a735760405162461bcd60e51b81526004016107c99061300b565b600b54811115610ad55760405162461bcd60e51b815260206004820152602760248201527f43616e6e6f74207365742070686173652067726561746572207468616e206d616044820152667820706861736560c81b60648201526084016107c9565b60138190556040518181527f855e5a969a8d11a3df1ccb47fea5fcb92a4b8000338df0d5b344e1e97100a85b9060200160405180910390a150565b6000610b1b83610f08565b8210610b5e5760405162461bcd60e51b8152602060048201526012602482015271496e646578206f7574206f662072616e676560701b60448201526064016107c9565b6011546000906064906001908390610b76908361307e565b9050600081610b85858561307e565b11610b9957610b94848461307e565b610b9b565b815b90505b6000610bab898584611481565b6020810151909150610bbd878a6130aa565b1015610c02576040810151610bd2878a6130aa565b60648110610bf057634e487b7160e01b600052603260045260246000fd5b602002015196505050505050506106c9565b6020810151610c11908761307e565b8151909650935082610c23868661307e565b11610c3757610c32858561307e565b610c39565b825b91505081811115610b9e5760405162461bcd60e51b815260206004820152603160248201527f4e6f7420656e6f756768206f776e656420746f6b656e73207765726520666f756044820152700dcc840e8de40e4cac2c6d040d2dcc8caf607b1b60648201526084016107c9565b6009805461093d906130ed565b33610cbc611197565b6001600160a01b031614610ce25760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff1615610d0b5760405162461bcd60e51b81526004016107c99061300b565b6108fa6009838361280d565b33610d20611197565b6001600160a01b031614610d465760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff1615610d6f5760405162461bcd60e51b81526004016107c99061300b565b60145460ff1615610de25760405162461bcd60e51b815260206004820152603760248201527f43616e6e6f7420736574206e657720696d616765205552492061667465722072604482015276185b991bdb481bd9999cd95d0819195d195c9b5a5b9959604a1b60648201526084016107c9565b6108fa6008838361280d565b6108fa838383604051806020016040528060008152506116e9565b60006011548210610e4c5760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b60448201526064016107c9565b6106c982600161307e565b33610e60611197565b6001600160a01b031614610e865760405162461bcd60e51b81526004016107c990612f27565b600f91909155601055565b6000818152600260205260408120546001600160a01b0316806106c95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016107c9565b60006001600160a01b038216610f735760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016107c9565b506001600160a01b031660009081526003602052604090205490565b33610f98611197565b6001600160a01b031614610fbe5760405162461bcd60e51b81526004016107c990612f27565b610fc86000611fcd565b565b7f000000000000000000000000000000000000000000000000000000000000000085601154610ff9919061307e565b11156110175760405162461bcd60e51b81526004016107c990612fe0565b600b54601354141561105d5760405162461bcd60e51b815260206004820152600f60248201526e283932b9b0b6329034b99037bb32b960891b60448201526064016107c9565b6013548411156110a35760405162461bcd60e51b8152602060048201526011602482015270283430b9b29034b9903737ba1037b832b760791b60448201526064016107c9565b6110af82828686611c6e565b6110ef5760405162461bcd60e51b8152602060048201526011602482015270141c9bdbd9881dd85cc81a5b9d985b1a59607a1b60448201526064016107c9565b336000908152600e60205260409020548361110a878361307e565b11156111285760405162461bcd60e51b81526004016107c990612fad565b611132863361201f565b505050505050565b33611143611197565b6001600160a01b0316146111695760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff16156111925760405162461bcd60e51b81526004016107c99061300b565b600d55565b6007546001600160a01b031690565b336111af611197565b6001600160a01b0316146111d55760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff16156111fe5760405162461bcd60e51b81526004016107c99061300b565b7f000000000000000000000000000000000000000000000000000000000000000081111561126e5760405162461bcd60e51b815260206004820152601d60248201527f4d617820746f6b656e7320706572207573657220746f6f206c6172676500000060448201526064016107c9565b600c55565b3361127c611197565b6001600160a01b0316146112a25760405162461bcd60e51b81526004016107c990612f27565b6040516370a0823160e01b815281906000906001600160a01b0383169063a9059cbb90339083906370a08231906112dd903090600401612e17565b60206040518083038186803b1580156112f557600080fd5b505afa158015611309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132d9190612c9f565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561137357600080fd5b505af1158015611387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ab9190612ba6565b9050806108fa5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016107c9565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114645760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0060448201526064016107c9565b61146e82826120c3565b5050565b6060600180546106de906130ed565b611489612891565b81831080156114a557506011546114a190600161307e565b8211155b6114e15760405162461bcd60e51b815260206004820152600d60248201526c496e76616c69642072616e676560981b60448201526064016107c9565b825b82811015611587576114f481610e91565b6001600160a01b0316856001600160a01b031614156115755780826040015183602001516064811061153657634e487b7160e01b600052603260045260246000fd5b602002018181525050600182602001818151611552919061307e565b9052506020820151606414156115755761156d81600161307e565b82525061158c565b61158060018261307e565b90506114e3565b508181525b9392505050565b7f0000000000000000000000000000000000000000000000000000000000000000816011546115c2919061307e565b11156115e05760405162461bcd60e51b81526004016107c990612fe0565b600b54601354146116285760405162461bcd60e51b815260206004820152601260248201527129b0b632903430b9903737ba103132b3bab760711b60448201526064016107c9565b336000908152600e6020526040902054600c54611645838361307e565b11156116635760405162461bcd60e51b81526004016107c990612fad565b61146e823361201f565b61146e338383612124565b600a805461093d906130ed565b3361168e611197565b6001600160a01b0316146116b45760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff16156116dd5760405162461bcd60e51b81526004016107c99061300b565b6108fa600a838361280d565b6116f33383611d7d565b61170f5760405162461bcd60e51b81526004016107c990612f5c565b61171b848484846121ef565b50505050565b606061172c82611cf2565b6117905760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016107c9565b601454610100900460ff1661183157600a80546117ac906130ed565b80601f01602080910402602001604051908101604052809291908181526020018280546117d8906130ed565b80156118255780601f106117fa57610100808354040283529160200191611825565b820191906000526020600020905b81548152906001019060200180831161180857829003601f168201915b50505050509050919050565b600961183c83612222565b60405160200161184d929190612d5d565b6040516020818303038152906040529050919050565b3361186c611197565b6001600160a01b0316146118925760405162461bcd60e51b81526004016107c990612f27565b60145460ff16156118b55760405162461bcd60e51b81526004016107c990612ef4565b6118c3600f5460105461233b565b50565b336118cf611197565b6001600160a01b0316146118f55760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff161561191e5760405162461bcd60e51b81526004016107c99061300b565b60006009805461192d906130ed565b80601f0160208091040260200160405190810160405280929190818152602001828054611959906130ed565b80156119a65780601f1061197b576101008083540402835291602001916119a6565b820191906000526020600020905b81548152906001019060200180831161198957829003601f168201915b50505050509050805160001415611a155760405162461bcd60e51b815260206004820152602d60248201527f43616e6e6f742072657665616c207768656e204d65746164617461204261736560448201526c2055524920697320656d70747960981b60648201526084016107c9565b600b5460135414611a805760405162461bcd60e51b815260206004820152602f60248201527f43616e6e6f742072657665616c207768656e20636f6e7472616374206973206e60448201526e6f74206174206d617820706861736560881b60648201526084016107c9565b60145460ff16611af45760405162461bcd60e51b815260206004820152603960248201527f43616e6e6f742072657665616c207768656e20612072616e646f6d206f666673604482015278195d081a185cc81b9bdd081899595b8819d95b995c985d1959603a1b60648201526084016107c9565b50601480549115156101000261ff0019909216919091179055565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b33611b46611197565b6001600160a01b031614611b6c5760405162461bcd60e51b81526004016107c990612f27565b6001600160a01b038116611bd15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107c9565b6118c381611fcd565b33611be3611197565b6001600160a01b031614611c095760405162461bcd60e51b81526004016107c990612f27565b601454610100900460ff16611c5b5760405162461bcd60e51b8152602060048201526018602482015277141c9bda9958dd081b9bdd081e595d081c995d99585b195960421b60448201526064016107c9565b6014805462ff0000191662010000179055565b60408051336020820152908101839052606081018290526000908190608001604051602081830303815290604052805190602001209050611ce686868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600d5491508490506124c6565b9150505b949350505050565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611d4482610e91565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611d8882611cf2565b611de95760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107c9565b6000611df483610e91565b9050806001600160a01b0316846001600160a01b03161480611e2f5750836001600160a01b0316611e2484610761565b6001600160a01b0316145b80611cea5750611cea8185611b0f565b826001600160a01b0316611e5282610e91565b6001600160a01b031614611eba5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016107c9565b6001600160a01b038216611f1c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107c9565b611f27600082611d0f565b6001600160a01b0383166000908152600360205260408120805460019290611f509084906130aa565b90915550506001600160a01b0382166000908152600360205260408120805460019290611f7e90849061307e565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716916000805160206131be83398151915291a4505050565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b828110156108fa576011547f00000000000000000000000000000000000000000000000000000000000000008110156120b057600160116000828254612068919061307e565b90915550506001600160a01b0383166000908152600e6020526040812080546001929061209690849061307e565b909155506120b09050836120ab83600161307e565b6124dc565b506120bc60018261307e565b9050612022565b60145460ff16156120e65760405162461bcd60e51b81526004016107c990612ef4565b6121107f000000000000000000000000000000000000000000000000000000000000000082613143565b60125550506014805460ff19166001179055565b816001600160a01b0316836001600160a01b031614156121825760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b60448201526064016107c9565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6121fa848484611e3f565b612206848484846124f6565b61171b5760405162461bcd60e51b81526004016107c990612ea2565b6060816122465750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612270578061225a81613128565b91506122699050600a83613096565b915061224a565b6000816001600160401b0381111561229857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156122c2576020820181803683370190505b5090505b8415611cea576122d76001836130aa565b91506122e4600a86613143565b6122ef90603061307e565b60f81b81838151811061231257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612334600a86613096565b94506122c6565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f0000000000000000000000000000000000000000000000000000000000000000848660006040516020016123ab929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016123d893929190612e68565b602060405180830381600087803b1580156123f257600080fd5b505af1158015612406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061242a9190612ba6565b50600083815260066020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a09091019092528151918301919091209387905291905261248690600161307e565b600085815260066020526040902055611cea8482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6000826124d38584612600565b14949350505050565b61146e8282604051806020016040528060008152506126ba565b60006001600160a01b0384163b156125f857604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061253a903390899088908890600401612e2b565b602060405180830381600087803b15801561255457600080fd5b505af1925050508015612584575060408051601f3d908101601f1916820190925261258191810190612c17565b60015b6125de573d8080156125b2576040519150601f19603f3d011682016040523d82523d6000602084013e6125b7565b606091505b5080516125d65760405162461bcd60e51b81526004016107c990612ea2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611cea565b506001611cea565b600081815b84518110156126b257600085828151811061263057634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161267257604080516020810185905290810182905260600160405160208183030381529060405280519060200120925061269f565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b50806126aa81613128565b915050612605565b509392505050565b6126c483836126ed565b6126d160008484846124f6565b6108fa5760405162461bcd60e51b81526004016107c990612ea2565b6001600160a01b0382166127435760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107c9565b61274c81611cf2565b156127985760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b60448201526064016107c9565b6001600160a01b03821660009081526003602052604081208054600192906127c190849061307e565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392906000805160206131be833981519152908290a45050565b828054612819906130ed565b90600052602060002090601f01602090048101928261283b5760008555612881565b82601f106128545782800160ff19823516178555612881565b82800160010185558215612881579182015b82811115612881578235825591602001919060010190612866565b5061288d9291506128b7565b5090565b604051806060016040528060008152602001600081526020016128b26128cc565b905290565b5b8082111561288d57600081556001016128b8565b60405180610c8001604052806064906020820280368337509192915050565b80356001600160a01b038116811461290257600080fd5b919050565b60008083601f840112612918578081fd5b5081356001600160401b0381111561292e578182fd5b6020830191508360208260051b850101111561294957600080fd5b9250929050565b600060208284031215612961578081fd5b61158c826128eb565b6000806040838503121561297c578081fd5b612985836128eb565b9150612993602084016128eb565b90509250929050565b6000806000606084860312156129b0578081fd5b6129b9846128eb565b92506129c7602085016128eb565b9150604084013590509250925092565b600080600080608085870312156129ec578081fd5b6129f5856128eb565b9350612a03602086016128eb565b92506040850135915060608501356001600160401b0380821115612a25578283fd5b818701915087601f830112612a38578283fd5b813581811115612a4a57612a4a613183565b604051601f8201601f19908116603f01168101908382118183101715612a7257612a72613183565b816040528281528a6020848701011115612a8a578586fd5b82602086016020830137918201602001949094529598949750929550505050565b60008060408385031215612abd578182fd5b612ac6836128eb565b91506020830135612ad681613199565b809150509250929050565b60008060408385031215612af3578182fd5b612afc836128eb565b946020939093013593505050565b600080600060608486031215612b1e578283fd5b612b27846128eb565b95602085013595506040909401359392505050565b60008060008060608587031215612b51578384fd5b84356001600160401b03811115612b66578485fd5b612b7287828801612907565b90989097506020870135966040013595509350505050565b600060208284031215612b9b578081fd5b813561158c81613199565b600060208284031215612bb7578081fd5b815161158c81613199565b600060208284031215612bd3578081fd5b5035919050565b60008060408385031215612bec578081fd5b50508035926020909101359150565b600060208284031215612c0c578081fd5b813561158c816131a7565b600060208284031215612c28578081fd5b815161158c816131a7565b60008060208385031215612c45578182fd5b82356001600160401b0380821115612c5b578384fd5b818501915085601f830112612c6e578384fd5b813581811115612c7c578485fd5b866020828501011115612c8d578485fd5b60209290920196919550909350505050565b600060208284031215612cb0578081fd5b5051919050565b600080600080600060808688031215612cce578283fd5b85359450602086013593506040860135925060608601356001600160401b03811115612cf8578182fd5b612d0488828901612907565b969995985093965092949392505050565b60008151808452612d2d8160208601602086016130c1565b601f01601f19169290920160200192915050565b60008151612d538185602086016130c1565b9290920192915050565b600080845482600182811c915080831680612d7957607f831692505b6020808410821415612d9957634e487b7160e01b87526022600452602487fd5b818015612dad5760018114612dbe57612dea565b60ff19861689528489019650612dea565b60008b815260209020885b86811015612de25781548b820152908501908301612dc9565b505084890196505b505050505050612e0e612dfd8286612d41565b64173539b7b760d91b815260050190565b95945050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612e5e90830184612d15565b9695505050505050565b60018060a01b0384168152826020820152606060408201526000612e0e6060830184612d15565b60208152600061158c6020830184612d15565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526019908201527814985b991bdb481bd9999cd95d08185b1c9958591e481cd95d603a1b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b602080825260199082015278135a5b9d1a5b99c81b5bdc99481d1a185b88185b1b1bddd959603a1b604082015260600190565b6020808252601190820152704e6f7420656e6f75676820746f6b656e7360781b604082015260600190565b60208082526012908201527110dbdb9d1c9858dd081a5cc81b1bd8dad95960721b604082015260600190565b8151815260208083015181830152604080840151610cc084019291840160005b606481101561307457825182529183019190830190600101613057565b5050505092915050565b6000821982111561309157613091613157565b500190565b6000826130a5576130a561316d565b500490565b6000828210156130bc576130bc613157565b500390565b60005b838110156130dc5781810151838201526020016130c4565b8381111561171b5750506000910152565b600181811c9082168061310157607f821691505b6020821081141561312257634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561313c5761313c613157565b5060010190565b6000826131525761315261316d565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146118c357600080fd5b6001600160e01b0319811681146118c357600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212202a39d17655d4831dc8ce9148282c4899165735ef3522239e2493dc0d0151ec1964736f6c63430008040033000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000005000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061027d5760003560e01c806301ffc9a714610282578063041d443e146102aa57806306fdde03146102c1578063081812fc146102d6578063095ea7b3146102f65780631017507d1461030b57806318160ddd146103145780631ca8b6cb1461031c578063235cea981461032557806323b872dd1461034c57806328901e351461035f5780632c9ea2421461036c5780632cc30587146103745780632cc82655146103875780632eb4a7ab1461039a5780632f745c59146103a357806336864adb146103b65780633697a679146103be57806339b92bbb146103d15780633b238f56146103e457806342842e0e146103ed5780634f6ccce714610400578063510aef051461041357806351830227146104265780636352211e1461043857806367f16bcf1461044b57806370a0823114610472578063715018a614610485578063727a612e1461048d5780637cb64759146104a05780638da5cb5b146104b35780638df5e630146104bb578063900bba41146104c457806390e9ca7f146104d757806394985ddd146104ea57806395d89b41146104fd5780639c59ce5914610505578063a0712d6814610525578063a22cb46514610538578063a2a07c2e1461054b578063a556203214610553578063ab9c6dbb1461057c578063b1c9fe6e1461058f578063b88d4fde14610598578063c87b56dd146105ab578063cc7a856c146105be578063cf309012146105c6578063e0a80853146105d9578063e8315742146105ec578063e985e9c514610613578063ee43d43e14610626578063f0679e5c1461062f578063f2fde38b1461064f578063f83d08ba14610662578063febfeaf71461066a575b600080fd5b610295610290366004612bfb565b61067d565b60405190151581526020015b60405180910390f35b6102b3600f5481565b6040519081526020016102a1565b6102c96106cf565b6040516102a19190612e8f565b6102e96102e4366004612bc2565b610761565b6040516102a19190612e17565b610309610304366004612ae1565b6107ee565b005b6102b360105481565b6011546102b3565b6102b360115481565b6102e97f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca81565b61030961035a36600461299c565b6108ff565b6014546102959060ff1681565b6102c9610930565b610309610382366004612bc2565b6109be565b610309610395366004612bc2565b610a1b565b6102b3600d5481565b6102b36103b1366004612ae1565b610b10565b6102c9610ca6565b6103096103cc366004612c33565b610cb3565b6103096103df366004612c33565b610d17565b6102b360125481565b6103096103fb36600461299c565b610dee565b6102b361040e366004612bc2565b610e09565b610309610421366004612bda565b610e57565b60145461029590610100900460ff1681565b6102e9610446366004612bc2565b610e91565b6102e97f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795281565b6102b3610480366004612950565b610f08565b610309610f8f565b61030961049b366004612cb7565b610fca565b6103096104ae366004612bc2565b61113a565b6102e9611197565b6102b3600b5481565b6103096104d2366004612bc2565b6111a6565b6103096104e5366004612950565b611273565b6103096104f8366004612bda565b6113ec565b6102c9611472565b610518610513366004612b0a565b611481565b6040516102a19190613037565b610309610533366004612bc2565b611593565b610309610546366004612aab565b61166d565b6102c9611678565b6102b3610561366004612950565b6001600160a01b03166000908152600e602052604090205490565b61030961058a366004612c33565b611685565b6102b360135481565b6103096105a63660046129d7565b6116e9565b6102c96105b9366004612bc2565b611721565b610309611863565b6014546102959062010000900460ff1681565b6103096105e7366004612b8a565b6118c6565b6102b37f000000000000000000000000000000000000000000000000000000000000271081565b61029561062136600461296a565b611b0f565b6102b3600c5481565b6102b361063d366004612950565b600e6020526000908152604090205481565b61030961065d366004612950565b611b3d565b610309611bda565b610295610678366004612b3c565b611c6e565b60006001600160e01b031982166380ac58cd60e01b14806106ae57506001600160e01b03198216635b5e139f60e01b145b806106c957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546106de906130ed565b80601f016020809104026020016040519081016040528092919081815260200182805461070a906130ed565b80156107575780601f1061072c57610100808354040283529160200191610757565b820191906000526020600020905b81548152906001019060200180831161073a57829003601f168201915b5050505050905090565b600061076c82611cf2565b6107d25760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006107f982610e91565b9050806001600160a01b0316836001600160a01b031614156108675760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016107c9565b336001600160a01b038216148061088357506108838133611b0f565b6108f05760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b60648201526084016107c9565b6108fa8383611d0f565b505050565b6109093382611d7d565b6109255760405162461bcd60e51b81526004016107c990612f5c565b6108fa838383611e3f565b6008805461093d906130ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610969906130ed565b80156109b65780601f1061098b576101008083540402835291602001916109b6565b820191906000526020600020905b81548152906001019060200180831161099957829003601f168201915b505050505081565b336109c7611197565b6001600160a01b0316146109ed5760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff1615610a165760405162461bcd60e51b81526004016107c99061300b565b600b55565b33610a24611197565b6001600160a01b031614610a4a5760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff1615610a735760405162461bcd60e51b81526004016107c99061300b565b600b54811115610ad55760405162461bcd60e51b815260206004820152602760248201527f43616e6e6f74207365742070686173652067726561746572207468616e206d616044820152667820706861736560c81b60648201526084016107c9565b60138190556040518181527f855e5a969a8d11a3df1ccb47fea5fcb92a4b8000338df0d5b344e1e97100a85b9060200160405180910390a150565b6000610b1b83610f08565b8210610b5e5760405162461bcd60e51b8152602060048201526012602482015271496e646578206f7574206f662072616e676560701b60448201526064016107c9565b6011546000906064906001908390610b76908361307e565b9050600081610b85858561307e565b11610b9957610b94848461307e565b610b9b565b815b90505b6000610bab898584611481565b6020810151909150610bbd878a6130aa565b1015610c02576040810151610bd2878a6130aa565b60648110610bf057634e487b7160e01b600052603260045260246000fd5b602002015196505050505050506106c9565b6020810151610c11908761307e565b8151909650935082610c23868661307e565b11610c3757610c32858561307e565b610c39565b825b91505081811115610b9e5760405162461bcd60e51b815260206004820152603160248201527f4e6f7420656e6f756768206f776e656420746f6b656e73207765726520666f756044820152700dcc840e8de40e4cac2c6d040d2dcc8caf607b1b60648201526084016107c9565b6009805461093d906130ed565b33610cbc611197565b6001600160a01b031614610ce25760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff1615610d0b5760405162461bcd60e51b81526004016107c99061300b565b6108fa6009838361280d565b33610d20611197565b6001600160a01b031614610d465760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff1615610d6f5760405162461bcd60e51b81526004016107c99061300b565b60145460ff1615610de25760405162461bcd60e51b815260206004820152603760248201527f43616e6e6f7420736574206e657720696d616765205552492061667465722072604482015276185b991bdb481bd9999cd95d0819195d195c9b5a5b9959604a1b60648201526084016107c9565b6108fa6008838361280d565b6108fa838383604051806020016040528060008152506116e9565b60006011548210610e4c5760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b60448201526064016107c9565b6106c982600161307e565b33610e60611197565b6001600160a01b031614610e865760405162461bcd60e51b81526004016107c990612f27565b600f91909155601055565b6000818152600260205260408120546001600160a01b0316806106c95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016107c9565b60006001600160a01b038216610f735760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016107c9565b506001600160a01b031660009081526003602052604090205490565b33610f98611197565b6001600160a01b031614610fbe5760405162461bcd60e51b81526004016107c990612f27565b610fc86000611fcd565b565b7f000000000000000000000000000000000000000000000000000000000000271085601154610ff9919061307e565b11156110175760405162461bcd60e51b81526004016107c990612fe0565b600b54601354141561105d5760405162461bcd60e51b815260206004820152600f60248201526e283932b9b0b6329034b99037bb32b960891b60448201526064016107c9565b6013548411156110a35760405162461bcd60e51b8152602060048201526011602482015270283430b9b29034b9903737ba1037b832b760791b60448201526064016107c9565b6110af82828686611c6e565b6110ef5760405162461bcd60e51b8152602060048201526011602482015270141c9bdbd9881dd85cc81a5b9d985b1a59607a1b60448201526064016107c9565b336000908152600e60205260409020548361110a878361307e565b11156111285760405162461bcd60e51b81526004016107c990612fad565b611132863361201f565b505050505050565b33611143611197565b6001600160a01b0316146111695760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff16156111925760405162461bcd60e51b81526004016107c99061300b565b600d55565b6007546001600160a01b031690565b336111af611197565b6001600160a01b0316146111d55760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff16156111fe5760405162461bcd60e51b81526004016107c99061300b565b7f000000000000000000000000000000000000000000000000000000000000271081111561126e5760405162461bcd60e51b815260206004820152601d60248201527f4d617820746f6b656e7320706572207573657220746f6f206c6172676500000060448201526064016107c9565b600c55565b3361127c611197565b6001600160a01b0316146112a25760405162461bcd60e51b81526004016107c990612f27565b6040516370a0823160e01b815281906000906001600160a01b0383169063a9059cbb90339083906370a08231906112dd903090600401612e17565b60206040518083038186803b1580156112f557600080fd5b505afa158015611309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132d9190612c9f565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561137357600080fd5b505af1158015611387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ab9190612ba6565b9050806108fa5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016107c9565b336001600160a01b037f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795216146114645760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0060448201526064016107c9565b61146e82826120c3565b5050565b6060600180546106de906130ed565b611489612891565b81831080156114a557506011546114a190600161307e565b8211155b6114e15760405162461bcd60e51b815260206004820152600d60248201526c496e76616c69642072616e676560981b60448201526064016107c9565b825b82811015611587576114f481610e91565b6001600160a01b0316856001600160a01b031614156115755780826040015183602001516064811061153657634e487b7160e01b600052603260045260246000fd5b602002018181525050600182602001818151611552919061307e565b9052506020820151606414156115755761156d81600161307e565b82525061158c565b61158060018261307e565b90506114e3565b508181525b9392505050565b7f0000000000000000000000000000000000000000000000000000000000002710816011546115c2919061307e565b11156115e05760405162461bcd60e51b81526004016107c990612fe0565b600b54601354146116285760405162461bcd60e51b815260206004820152601260248201527129b0b632903430b9903737ba103132b3bab760711b60448201526064016107c9565b336000908152600e6020526040902054600c54611645838361307e565b11156116635760405162461bcd60e51b81526004016107c990612fad565b61146e823361201f565b61146e338383612124565b600a805461093d906130ed565b3361168e611197565b6001600160a01b0316146116b45760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff16156116dd5760405162461bcd60e51b81526004016107c99061300b565b6108fa600a838361280d565b6116f33383611d7d565b61170f5760405162461bcd60e51b81526004016107c990612f5c565b61171b848484846121ef565b50505050565b606061172c82611cf2565b6117905760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016107c9565b601454610100900460ff1661183157600a80546117ac906130ed565b80601f01602080910402602001604051908101604052809291908181526020018280546117d8906130ed565b80156118255780601f106117fa57610100808354040283529160200191611825565b820191906000526020600020905b81548152906001019060200180831161180857829003601f168201915b50505050509050919050565b600961183c83612222565b60405160200161184d929190612d5d565b6040516020818303038152906040529050919050565b3361186c611197565b6001600160a01b0316146118925760405162461bcd60e51b81526004016107c990612f27565b60145460ff16156118b55760405162461bcd60e51b81526004016107c990612ef4565b6118c3600f5460105461233b565b50565b336118cf611197565b6001600160a01b0316146118f55760405162461bcd60e51b81526004016107c990612f27565b60145462010000900460ff161561191e5760405162461bcd60e51b81526004016107c99061300b565b60006009805461192d906130ed565b80601f0160208091040260200160405190810160405280929190818152602001828054611959906130ed565b80156119a65780601f1061197b576101008083540402835291602001916119a6565b820191906000526020600020905b81548152906001019060200180831161198957829003601f168201915b50505050509050805160001415611a155760405162461bcd60e51b815260206004820152602d60248201527f43616e6e6f742072657665616c207768656e204d65746164617461204261736560448201526c2055524920697320656d70747960981b60648201526084016107c9565b600b5460135414611a805760405162461bcd60e51b815260206004820152602f60248201527f43616e6e6f742072657665616c207768656e20636f6e7472616374206973206e60448201526e6f74206174206d617820706861736560881b60648201526084016107c9565b60145460ff16611af45760405162461bcd60e51b815260206004820152603960248201527f43616e6e6f742072657665616c207768656e20612072616e646f6d206f666673604482015278195d081a185cc81b9bdd081899595b8819d95b995c985d1959603a1b60648201526084016107c9565b50601480549115156101000261ff0019909216919091179055565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b33611b46611197565b6001600160a01b031614611b6c5760405162461bcd60e51b81526004016107c990612f27565b6001600160a01b038116611bd15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107c9565b6118c381611fcd565b33611be3611197565b6001600160a01b031614611c095760405162461bcd60e51b81526004016107c990612f27565b601454610100900460ff16611c5b5760405162461bcd60e51b8152602060048201526018602482015277141c9bda9958dd081b9bdd081e595d081c995d99585b195960421b60448201526064016107c9565b6014805462ff0000191662010000179055565b60408051336020820152908101839052606081018290526000908190608001604051602081830303815290604052805190602001209050611ce686868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600d5491508490506124c6565b9150505b949350505050565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611d4482610e91565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611d8882611cf2565b611de95760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107c9565b6000611df483610e91565b9050806001600160a01b0316846001600160a01b03161480611e2f5750836001600160a01b0316611e2484610761565b6001600160a01b0316145b80611cea5750611cea8185611b0f565b826001600160a01b0316611e5282610e91565b6001600160a01b031614611eba5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016107c9565b6001600160a01b038216611f1c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107c9565b611f27600082611d0f565b6001600160a01b0383166000908152600360205260408120805460019290611f509084906130aa565b90915550506001600160a01b0382166000908152600360205260408120805460019290611f7e90849061307e565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716916000805160206131be83398151915291a4505050565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b828110156108fa576011547f00000000000000000000000000000000000000000000000000000000000027108110156120b057600160116000828254612068919061307e565b90915550506001600160a01b0383166000908152600e6020526040812080546001929061209690849061307e565b909155506120b09050836120ab83600161307e565b6124dc565b506120bc60018261307e565b9050612022565b60145460ff16156120e65760405162461bcd60e51b81526004016107c990612ef4565b6121107f000000000000000000000000000000000000000000000000000000000000271082613143565b60125550506014805460ff19166001179055565b816001600160a01b0316836001600160a01b031614156121825760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b60448201526064016107c9565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6121fa848484611e3f565b612206848484846124f6565b61171b5760405162461bcd60e51b81526004016107c990612ea2565b6060816122465750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612270578061225a81613128565b91506122699050600a83613096565b915061224a565b6000816001600160401b0381111561229857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156122c2576020820181803683370190505b5090505b8415611cea576122d76001836130aa565b91506122e4600a86613143565b6122ef90603061307e565b60f81b81838151811061231257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612334600a86613096565b94506122c6565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952848660006040516020016123ab929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016123d893929190612e68565b602060405180830381600087803b1580156123f257600080fd5b505af1158015612406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061242a9190612ba6565b50600083815260066020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a09091019092528151918301919091209387905291905261248690600161307e565b600085815260066020526040902055611cea8482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6000826124d38584612600565b14949350505050565b61146e8282604051806020016040528060008152506126ba565b60006001600160a01b0384163b156125f857604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061253a903390899088908890600401612e2b565b602060405180830381600087803b15801561255457600080fd5b505af1925050508015612584575060408051601f3d908101601f1916820190925261258191810190612c17565b60015b6125de573d8080156125b2576040519150601f19603f3d011682016040523d82523d6000602084013e6125b7565b606091505b5080516125d65760405162461bcd60e51b81526004016107c990612ea2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611cea565b506001611cea565b600081815b84518110156126b257600085828151811061263057634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161267257604080516020810185905290810182905260600160405160208183030381529060405280519060200120925061269f565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b50806126aa81613128565b915050612605565b509392505050565b6126c483836126ed565b6126d160008484846124f6565b6108fa5760405162461bcd60e51b81526004016107c990612ea2565b6001600160a01b0382166127435760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107c9565b61274c81611cf2565b156127985760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b60448201526064016107c9565b6001600160a01b03821660009081526003602052604081208054600192906127c190849061307e565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392906000805160206131be833981519152908290a45050565b828054612819906130ed565b90600052602060002090601f01602090048101928261283b5760008555612881565b82601f106128545782800160ff19823516178555612881565b82800160010185558215612881579182015b82811115612881578235825591602001919060010190612866565b5061288d9291506128b7565b5090565b604051806060016040528060008152602001600081526020016128b26128cc565b905290565b5b8082111561288d57600081556001016128b8565b60405180610c8001604052806064906020820280368337509192915050565b80356001600160a01b038116811461290257600080fd5b919050565b60008083601f840112612918578081fd5b5081356001600160401b0381111561292e578182fd5b6020830191508360208260051b850101111561294957600080fd5b9250929050565b600060208284031215612961578081fd5b61158c826128eb565b6000806040838503121561297c578081fd5b612985836128eb565b9150612993602084016128eb565b90509250929050565b6000806000606084860312156129b0578081fd5b6129b9846128eb565b92506129c7602085016128eb565b9150604084013590509250925092565b600080600080608085870312156129ec578081fd5b6129f5856128eb565b9350612a03602086016128eb565b92506040850135915060608501356001600160401b0380821115612a25578283fd5b818701915087601f830112612a38578283fd5b813581811115612a4a57612a4a613183565b604051601f8201601f19908116603f01168101908382118183101715612a7257612a72613183565b816040528281528a6020848701011115612a8a578586fd5b82602086016020830137918201602001949094529598949750929550505050565b60008060408385031215612abd578182fd5b612ac6836128eb565b91506020830135612ad681613199565b809150509250929050565b60008060408385031215612af3578182fd5b612afc836128eb565b946020939093013593505050565b600080600060608486031215612b1e578283fd5b612b27846128eb565b95602085013595506040909401359392505050565b60008060008060608587031215612b51578384fd5b84356001600160401b03811115612b66578485fd5b612b7287828801612907565b90989097506020870135966040013595509350505050565b600060208284031215612b9b578081fd5b813561158c81613199565b600060208284031215612bb7578081fd5b815161158c81613199565b600060208284031215612bd3578081fd5b5035919050565b60008060408385031215612bec578081fd5b50508035926020909101359150565b600060208284031215612c0c578081fd5b813561158c816131a7565b600060208284031215612c28578081fd5b815161158c816131a7565b60008060208385031215612c45578182fd5b82356001600160401b0380821115612c5b578384fd5b818501915085601f830112612c6e578384fd5b813581811115612c7c578485fd5b866020828501011115612c8d578485fd5b60209290920196919550909350505050565b600060208284031215612cb0578081fd5b5051919050565b600080600080600060808688031215612cce578283fd5b85359450602086013593506040860135925060608601356001600160401b03811115612cf8578182fd5b612d0488828901612907565b969995985093965092949392505050565b60008151808452612d2d8160208601602086016130c1565b601f01601f19169290920160200192915050565b60008151612d538185602086016130c1565b9290920192915050565b600080845482600182811c915080831680612d7957607f831692505b6020808410821415612d9957634e487b7160e01b87526022600452602487fd5b818015612dad5760018114612dbe57612dea565b60ff19861689528489019650612dea565b60008b815260209020885b86811015612de25781548b820152908501908301612dc9565b505084890196505b505050505050612e0e612dfd8286612d41565b64173539b7b760d91b815260050190565b95945050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612e5e90830184612d15565b9695505050505050565b60018060a01b0384168152826020820152606060408201526000612e0e6060830184612d15565b60208152600061158c6020830184612d15565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526019908201527814985b991bdb481bd9999cd95d08185b1c9958591e481cd95d603a1b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b602080825260199082015278135a5b9d1a5b99c81b5bdc99481d1a185b88185b1b1bddd959603a1b604082015260600190565b6020808252601190820152704e6f7420656e6f75676820746f6b656e7360781b604082015260600190565b60208082526012908201527110dbdb9d1c9858dd081a5cc81b1bd8dad95960721b604082015260600190565b8151815260208083015181830152604080840151610cc084019291840160005b606481101561307457825182529183019190830190600101613057565b5050505092915050565b6000821982111561309157613091613157565b500190565b6000826130a5576130a561316d565b500490565b6000828210156130bc576130bc613157565b500390565b60005b838110156130dc5781810151838201526020016130c4565b8381111561171b5750506000910152565b600181811c9082168061310157607f821691505b6020821081141561312257634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561313c5761313c613157565b5060010190565b6000826131525761315261316d565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146118c357600080fd5b6001600160e01b0319811681146118c357600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212202a39d17655d4831dc8ce9148282c4899165735ef3522239e2493dc0d0151ec1964736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000005000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000
-----Decoded View---------------
Arg [0] : _maxPhase (uint256): 4
Arg [1] : _maxTokens (uint256): 10000
Arg [2] : _maxTokensPerUser (uint256): 5
Arg [3] : _vrfCoordinator (address): 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
Arg [4] : _link (address): 0x514910771AF9Ca656af840dff83E8264EcF986CA
Arg [5] : _vrfKeyHash (bytes32): 0xaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [6] : _vrfFee (uint256): 2000000000000000000
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [1] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [3] : 000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952
Arg [4] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [5] : aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [6] : 0000000000000000000000000000000000000000000000001bc16d674ec80000
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.