Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 24 from a total of 24 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Approval For... | 17346987 | 623 days ago | IN | 0 ETH | 0.00099089 | ||||
Set Approval For... | 17023664 | 669 days ago | IN | 0 ETH | 0.00097217 | ||||
Reveal | 17023424 | 669 days ago | IN | 0 ETH | 0.00168339 | ||||
Reveal | 17023250 | 669 days ago | IN | 0 ETH | 0.00153177 | ||||
Reveal | 17023242 | 669 days ago | IN | 0 ETH | 0.00142456 | ||||
Reveal | 17023214 | 669 days ago | IN | 0 ETH | 0.00160593 | ||||
Reveal | 17023213 | 669 days ago | IN | 0 ETH | 0.00167852 | ||||
Rollup Mint | 16202633 | 784 days ago | IN | 0 ETH | 0.01430936 | ||||
Rollup Mint | 16202349 | 784 days ago | IN | 0 ETH | 0.01346899 | ||||
Set Approval For... | 16201816 | 784 days ago | IN | 0 ETH | 0.00070522 | ||||
Reveal | 16201807 | 784 days ago | IN | 0 ETH | 0.00096476 | ||||
Reveal | 16201572 | 784 days ago | IN | 0 ETH | 0.00098793 | ||||
Reveal | 16201569 | 784 days ago | IN | 0 ETH | 0.00098793 | ||||
Reveal | 16201567 | 784 days ago | IN | 0 ETH | 0.00102254 | ||||
Reveal | 16201565 | 784 days ago | IN | 0 ETH | 0.00102254 | ||||
Reveal | 16201560 | 784 days ago | IN | 0 ETH | 0.00097508 | ||||
Reveal | 16201556 | 784 days ago | IN | 0 ETH | 0.00104386 | ||||
Set Key Hash | 16201540 | 784 days ago | IN | 0 ETH | 0.00038336 | ||||
Team Reserve Min... | 16201537 | 784 days ago | IN | 0 ETH | 0.0022231 | ||||
Reveal | 16201529 | 784 days ago | IN | 0 ETH | 0.00105037 | ||||
Reveal | 16201529 | 784 days ago | IN | 0 ETH | 0.00105037 | ||||
Reveal | 16201520 | 784 days ago | IN | 0 ETH | 0.00106258 | ||||
Reveal | 16201517 | 784 days ago | IN | 0 ETH | 0.00110447 | ||||
Set Subscription... | 16201515 | 784 days ago | IN | 0 ETH | 0.00038681 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
ArjaverseNFT
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.0 <0.9.0; import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol"; import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./Base64.sol"; import "./ArjaverseNFTLibrary.sol"; interface IGroth16Verifier { function verifyProof( uint[2] memory a, uint[2][2] memory b, uint[2] memory c, uint[16] memory input ) external view returns (bool); } contract ArjaverseNFT is ERC721Enumerable, VRFConsumerBaseV2, Ownable { using Strings for uint256; using Strings for uint16; using Strings for uint8; event AnswerResult(address indexed user, bool result); uint256 constant MAX_SUPPLY = 64; uint256 constant TEAM_RESERVE = 8; uint256 constant BATCH_SZIE = 8; // Metadata Traits string constant BACKGROUND = "Background"; string constant SPECIAL_EFFECT = "SpecialEffect"; string constant BODY = "Body"; string constant DECORATION = "Decoration"; string constant EYES = "Eyes"; string constant BALL = "Ball"; string[8] private backgroundTraits = [ "9A9FA8", "FFEF5B", "D2BFDC", "D9EEA9", "D8D2CA", "FFE3ED", "00589A", "CAFCFB" ]; string[6] private specialEffectTraits = [ "RedWave", "ColorSpot", "Spotlight", "Ripple", "RingStars", "Stars" ]; string[5] private bodyTraits = [ "RibbonSeal", "BeardedSeal", "HarpSeal", "Arja", "JimmyTheSeal" ]; string[17] private decorationTraits = [ "Cowboy", "Seaweed", "PearlMilk", "BowTieHead", "Scarf02", "FriedG", "TailRing", "Splash", "Dress", "Scarf01", "BowTieNeck", "Fries", "MultiGoldenRings", "BowTieTail", "GoldenNacklace", "Scarf03", "Crown" ]; string[6] private eyesTraits = [ "DollarBills", "Sad", "LineShape", "Watery", "Lightening", "Dot" ]; string[6] private ballTraits = [ "VolleyBall", "Octopus", "Penguin", "Coin", "Flower", "StarRing" ]; uint64[] private allPagination = [ 0x000000000000, 0x010101000001, 0x020102010102, 0x030203010203, 0x020104000000, 0x030304020302, 0x030305000004, 0x000306020005, 0x010106010402, 0x040207030201, 0x010308040205, 0x040409040306, 0x04050a000102, 0x00010a000502, 0x00000a020407, 0x04000a030306, 0x04020a000206, 0x02050a020304, 0x01020a030404, 0x04030a010502, 0x03000a040000, 0x04050a000204, 0x02020b000000, 0x04010c020406, 0x05050d030501, 0x00000d030205, 0x02030d020104, 0x00010e000202, 0x04010e010404, 0x02050e000002, 0x03010e000401, 0x05030e030300, 0x04020f010504, 0x02020f040403, 0x04040f000203, 0x05020f010106, 0x020010010403, 0x050410010004, 0x010310040201, 0x010310040301, 0x020410030003, 0x040310040304, 0x030210020007, 0x010210040006, 0x050410000404, 0x050010020106, 0x030110010202, 0x030010000306, 0x030110040201, 0x000510000303, 0x010310030505, 0x010010030204, 0x030410020002, 0x020510010504, 0x030310030402, 0x030110040100, 0x000010020200, 0x010510020001, 0x020510040304, 0x050310040402, 0x050410010003, 0x010410040405, 0x030210010402, 0x030410000003 ]; uint256 currentTeamReserve = 0; uint256 currentRevealId = 1; mapping(uint256 => ArjaverseNFTLibrary.Metadata) public tokenIdToMetadata; string BASE_URI = "ipfs://QmfGCmsdebybNBWhqor2cxnJYUU89LgJ3KWLsj9veuhADZ/"; string baseAnimationURI = "ipfs://QmSkahSGA9fe6AGkjvB4cbKeeiE8XJxh4hgxqaCp7UeGBr/"; IGroth16Verifier verifier; // VRF VRFCoordinatorV2Interface COORDINATOR; LinkTokenInterface LINKTOKEN; uint64 s_subscriptionId; bytes32 keyHash = 0xff8dedfbfa60af186cf3c830acbc32c05aae823045ae5ea7da1e45fbfaba4f92; // 500 gwei uint32 callbackGasLimit = 2500000; uint16 requestConfirmations = 3; constructor( address _vrfCoordinator, address _link, address _verifier ) ERC721("Arjaverse NFT", "ARJA") VRFConsumerBaseV2(_vrfCoordinator) { COORDINATOR = VRFCoordinatorV2Interface(_vrfCoordinator); LINKTOKEN = LinkTokenInterface(_link); verifier = IGroth16Verifier(_verifier); } function teamReserveMint(address _to, uint32 _num) external onlyOwner { require(totalSupply() + _num <= MAX_SUPPLY, "Exceeds max supply"); require(currentTeamReserve + _num <= TEAM_RESERVE, "Exceeds team reserve"); for(uint256 i = 0; i < _num; i++) { _mint(_to); } currentTeamReserve += _num; } function randomDistinctItemFromAllPagination(uint256 rand) private returns (uint64) { uint256 index = rand % allPagination.length; uint64 key = allPagination[index]; allPagination[index] = allPagination[allPagination.length - 1]; allPagination.pop(); return key; } function getRandomWorkFromPagination(uint256 rand) private returns (ArjaverseNFTLibrary.Metadata memory) { uint64 key = randomDistinctItemFromAllPagination(rand); ArjaverseNFTLibrary.Metadata memory currentWord; currentWord.background = uint8(key & 0xFF); key = key >> 8; currentWord.effect = uint8(key & 0xFF); key = key >> 8; currentWord.body = uint8(key & 0xFF); key = key >> 8; currentWord.decoration = uint8(key & 0xFF); key = key >> 8; currentWord.eyes = uint8(key & 0xFF); key = key >> 8; currentWord.ball = uint8(key & 0xFF); currentWord.isRevealed = true; return currentWord; } function concatHref( string memory _baseURI, string memory _trait, string memory _traitArr ) internal pure returns (string memory) { return string(abi.encodePacked(_baseURI, _trait, "/", _traitArr, ".png")); } function _mint(address to) internal { _safeMint(to, totalSupply() + 1); } function rollupMint( uint[2] memory a, uint[2][2] memory b, uint[2] memory c, uint[16] memory input ) external onlyOwner { require( verifier.verifyProof(a, b, c, input), "Proof verification failed" ); require(totalSupply() + BATCH_SZIE <= MAX_SUPPLY, "Exceeds max supply"); for(uint256 i = 0; i < BATCH_SZIE; i++) { address to = address(uint160(input[BATCH_SZIE + i])); bool result = (input[i] == 1); emit AnswerResult(to, result); if(result) { _mint(to); } } } function updateAnimationURI(string memory _newAnimationURI) external onlyOwner { baseAnimationURI = _newAnimationURI; } function setWord(uint256 tokenId, uint256 rand) internal { require(!tokenIdToMetadata[tokenId].isRevealed, "Already revealed"); tokenIdToMetadata[tokenId] = getRandomWorkFromPagination(rand); } function getAttributesTopHalf(uint256 _tokenId) private view returns (string memory) { ArjaverseNFTLibrary.Metadata memory currentWord = tokenIdToMetadata[_tokenId]; return ArjaverseNFTLibrary.getAttributesLeft( backgroundTraits[currentWord.background], specialEffectTraits[currentWord.effect], bodyTraits[currentWord.body] ); } function getAttributesBottomHalf(uint256 _tokenId) private view returns (string memory) { ArjaverseNFTLibrary.Metadata memory currentWord = tokenIdToMetadata[_tokenId]; return ArjaverseNFTLibrary.getAttributesRight( decorationTraits[currentWord.decoration], eyesTraits[currentWord.eyes], ballTraits[currentWord.ball] ); } function getAnimationUrl(uint256 _tokenId) private view returns (bytes memory) { string memory token = Strings.toString(_tokenId); ArjaverseNFTLibrary.Metadata memory currentWord = tokenIdToMetadata[_tokenId]; return abi.encodePacked( baseAnimationURI, '?bg=', backgroundTraits[currentWord.background], '&ball=', ballTraits[currentWord.ball], '&id=', token ); } function buildMetadata(uint256 _tokenId) private view returns (string memory) { string memory token = Strings.toString(_tokenId); ArjaverseNFTLibrary.Metadata memory currentWord = tokenIdToMetadata[_tokenId]; bytes memory imageHash = abi.encodePacked( currentWord.background.toString(), '-', currentWord.effect.toString(), '-', currentWord.body.toString(), '-', currentWord.decoration.toString(), '-', currentWord.eyes.toString(), '-', currentWord.ball.toString() ); return string( abi.encodePacked( "data:application/json;base64,", Base64.encode( bytes( abi.encodePacked( '{ "name": "',"Arjaverse #", token, '","image": "',BASE_URI, imageHash, '.png', '","attributes": [', getAttributesTopHalf(_tokenId), getAttributesBottomHalf(_tokenId), ']', ',"animation_url":"',getAnimationUrl(_tokenId),'"' ',"description": "A mysterious creature of immense size appears in the galaxy, floating out of nowhere and slowly approaching Earth.\\nSuddenly! A mouth opened, and the Earth was unexpectedly swallowed up in an instant, emitting an unknown light - BANG! The Seal explodes!\\nFrom then on, a planet full of sea otters was born - the Arjaverse!\\nThe planet is 75% water, ice, and gems, and its exterior retains the appearance of Earth and the unknown creature, becoming a fantastical illusion.\\nThis gave rise to the incredibly cute and unique adventurers - the seal citizens from Arjaverse."', "}" ) ) ) ) ); } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { require( _exists(_tokenId), "ERC721Metadata: URI query for nonexistent token" ); return buildMetadata(_tokenId); } // VRF function setSubscriptionId(uint64 subscriptionId) public onlyOwner { s_subscriptionId = subscriptionId; } function setKeyHash(bytes32 _keyHash) public onlyOwner { keyHash = _keyHash; } function setVrfCallbackGasLimit(uint32 _callbackGasLimit) public onlyOwner { callbackGasLimit = _callbackGasLimit; } function requestRandomWords(uint32 numWords) internal { COORDINATOR.requestRandomWords( keyHash, s_subscriptionId, requestConfirmations, callbackGasLimit, numWords ); } function fulfillRandomWords( uint256, uint256[] memory randomWords ) internal override { for(uint256 index = 0; index < randomWords.length; index++) { uint256 rand = randomWords[index]; setWord(currentRevealId + index, rand); } currentRevealId += randomWords.length; } function reveal(uint32 _num) external onlyOwner { require(currentRevealId <= MAX_SUPPLY, "All NFT revealed"); requestRandomWords(_num); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.0 <0.9.0; import "./Base64.sol"; library ArjaverseNFTLibrary { struct Metadata { uint16 score; uint8 background; uint8 effect; uint8 body; uint8 decoration; uint8 eyes; uint8 ball; bool isRevealed; } string constant BACKGROUND = "Background"; string constant SPECIAL_EFFECT = "SpecialEffect"; string constant BODY = "Body"; string constant DECORATION = "Decoration"; string constant EYES = "Eyes"; string constant BALL = "Ball"; function concatHref( string memory _baseURI, string memory _trait, string memory _traitArr ) internal pure returns (string memory) { return string(abi.encodePacked(_baseURI, _trait, "/", _traitArr, ".png")); } function buildImagePart1() internal pure returns (string memory) { return string(abi.encodePacked( '<svg width="800" height="800" xmlns="http://www.w3.org/2000/svg">', '<rect height="800" width="800" y="0" x="0" />' )); } function buildImagePart2( string memory background, string memory effect, string memory body ) internal pure returns (string memory) { return string(abi.encodePacked( '<image href="', background, '" height="800" width="800" />', '<image href="', effect, '" height="800" width="800" />', '<image href="', body, '" height="800" width="800" />' )); } function buildImagePart3( string memory decoration, string memory eyes, string memory ball ) internal pure returns (string memory) { return string(abi.encodePacked( '<image href="', decoration, '" height="800" width="800" />', '<image href="', eyes, '" height="800" width="800" />', '<image href="', ball, '" height="800" width="800" />', '</svg>' )); } function getAttributesLeft( string memory background, string memory effect, string memory body ) internal pure returns (string memory) { return string( abi.encodePacked( '{"trait_type": "Background","value":"', background, '"}', ',{"trait_type": "Effect","value":"', effect, '"}', ',{"trait_type": "Body","value":"', body, '"}' ) ); } function getAttributesRight( string memory decoration, string memory eyes, string memory ball ) internal pure returns (string memory) { return string( abi.encodePacked( ',{"trait_type": "Decoration","value":"', decoration, '"}', ',{"trait_type": "Eyes","value":"', eyes, '"}', ',{"trait_type": "Ball","value":"', ball, '"}' ) ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title Base64 /// @author Brecht Devos - <[email protected]> /// @notice Provides a function for encoding some bytes in base64 library Base64 { string internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; function encode(bytes memory data) internal pure returns (string memory) { if (data.length == 0) return ""; // load the table into memory string memory table = TABLE; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((data.length + 2) / 3); // add some extra buffer at the end required for the writing string memory result = new string(encodedLen + 32); assembly { // set the actual output length mstore(result, encodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 3 bytes at a time for { } lt(dataPtr, endPtr) { } { dataPtr := add(dataPtr, 3) // read 3 bytes let input := mload(dataPtr) // write 4 characters mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(18, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(12, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(6, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, mload(add(tablePtr, and(input, 0x3F)))) ) resultPtr := add(resultPtr, 1) } // padding with '=' switch mod(mload(data), 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev See {ERC721-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual override { super._beforeTokenTransfer(from, to, firstTokenId, batchSize); if (batchSize > 1) { // Will only trigger during construction. Batch transferring (minting) is not available afterwards. revert("ERC721Enumerable: consecutive transfers not supported"); } uint256 tokenId = firstTokenId; if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /** **************************************************************************** * @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. It ensures 2 things: * @dev 1. The fulfillment came from the VRFCoordinator * @dev 2. The consumer contract implements fulfillRandomWords. * ***************************************************************************** * @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 constructor(<other arguments>, address _vrfCoordinator, address _link) * @dev VRFConsumerBase(_vrfCoordinator) 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). Create subscription, fund it * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface * @dev subscription management functions). * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations, * @dev callbackGasLimit, numWords), * @dev see (VRFCoordinatorInterface for a description of the arguments). * * @dev Once the VRFCoordinator has received and validated the oracle's response * @dev to your request, it will call your contract's fulfillRandomWords method. * * @dev The randomness argument to fulfillRandomWords is a set of random words * @dev generated from your requestId and the blockHash of the request. * * @dev If your contract could have concurrent requests open, you can use the * @dev requestId returned from requestRandomWords to track which response is associated * @dev with which randomness request. * @dev 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. * * ***************************************************************************** * @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 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. It is for this reason that * @dev that you can signal to an oracle you'd like them to wait longer before * @dev responding to the request (however this is not enforced in the contract * @dev and so remains effective only in the case of unmodified oracle software). */ abstract contract VRFConsumerBaseV2 { error OnlyCoordinatorCanFulfill(address have, address want); address private immutable vrfCoordinator; /** * @param _vrfCoordinator address of VRFCoordinator contract */ constructor(address _vrfCoordinator) { vrfCoordinator = _vrfCoordinator; } /** * @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 VRFConsumerBaseV2 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 randomWords the VRF output expanded to the requested number of words */ function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual; // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF // proof. rawFulfillRandomness then calls fulfillRandomness, after validating // the origin of the call function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external { if (msg.sender != vrfCoordinator) { revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator); } fulfillRandomWords(requestId, randomWords); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface VRFCoordinatorV2Interface { /** * @notice Get configuration relevant for making requests * @return minimumRequestConfirmations global min for request confirmations * @return maxGasLimit global max for request gas limit * @return s_provingKeyHashes list of registered key hashes */ function getRequestConfig() external view returns ( uint16, uint32, bytes32[] memory ); /** * @notice Request a set of random words. * @param keyHash - Corresponds to a particular oracle job which uses * that key for generating the VRF proof. Different keyHash's have different gas price * ceilings, so you can select a specific one to bound your maximum per request cost. * @param subId - The ID of the VRF subscription. Must be funded * with the minimum subscription balance required for the selected keyHash. * @param minimumRequestConfirmations - How many blocks you'd like the * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS * for why you may want to request more. The acceptable range is * [minimumRequestBlockConfirmations, 200]. * @param callbackGasLimit - How much gas you'd like to receive in your * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords * may be slightly less than this amount because of gas used calling the function * (argument decoding etc.), so you may need to request slightly more than you expect * to have inside fulfillRandomWords. The acceptable range is * [0, maxGasLimit] * @param numWords - The number of uint256 random values you'd like to receive * in your fulfillRandomWords callback. Note these numbers are expanded in a * secure way by the VRFCoordinator from a single random value supplied by the oracle. * @return requestId - A unique identifier of the request. Can be used to match * a request to a response in fulfillRandomWords. */ function requestRandomWords( bytes32 keyHash, uint64 subId, uint16 minimumRequestConfirmations, uint32 callbackGasLimit, uint32 numWords ) external returns (uint256 requestId); /** * @notice Create a VRF subscription. * @return subId - A unique subscription id. * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer. * @dev Note to fund the subscription, use transferAndCall. For example * @dev LINKTOKEN.transferAndCall( * @dev address(COORDINATOR), * @dev amount, * @dev abi.encode(subId)); */ function createSubscription() external returns (uint64 subId); /** * @notice Get a VRF subscription. * @param subId - ID of the subscription * @return balance - LINK balance of the subscription in juels. * @return reqCount - number of requests for this subscription, determines fee tier. * @return owner - owner of the subscription. * @return consumers - list of consumer address which are able to use this subscription. */ function getSubscription(uint64 subId) external view returns ( uint96 balance, uint64 reqCount, address owner, address[] memory consumers ); /** * @notice Request subscription owner transfer. * @param subId - ID of the subscription * @param newOwner - proposed new owner of the subscription */ function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external; /** * @notice Request subscription owner transfer. * @param subId - ID of the subscription * @dev will revert if original owner of subId has * not requested that msg.sender become the new owner. */ function acceptSubscriptionOwnerTransfer(uint64 subId) external; /** * @notice Add a consumer to a VRF subscription. * @param subId - ID of the subscription * @param consumer - New consumer which can use the subscription */ function addConsumer(uint64 subId, address consumer) external; /** * @notice Remove a consumer from a VRF subscription. * @param subId - ID of the subscription * @param consumer - Consumer to remove from the subscription */ function removeConsumer(uint64 subId, address consumer) external; /** * @notice Cancel a subscription * @param subId - ID of the subscription * @param to - Where to send the remaining LINK to */ function cancelSubscription(uint64 subId, address to) external; /* * @notice Check to see if there exists a request commitment consumers * for all consumers and keyhashes for a given sub. * @param subId - ID of the subscription * @return true if there exists at least one unfulfilled request for the subscription, false * otherwise. */ function pendingRequestExists(uint64 subId) external view returns (bool); }
// 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 (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (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); /** * @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 // OpenZeppelin Contracts (last updated v4.8.0) (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: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); 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) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); 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: caller is not token owner or 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: caller is not token owner or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @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 _ownerOf(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) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @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 { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256, /* firstTokenId */ uint256 batchSize ) internal virtual { if (batchSize > 1) { if (from != address(0)) { _balances[from] -= batchSize; } if (to != address(0)) { _balances[to] += batchSize; } } } /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (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`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// 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 (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-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 (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 (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// 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": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"address","name":"_link","type":"address"},{"internalType":"address","name":"_verifier","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"result","type":"bool"}],"name":"AnswerResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_num","type":"uint32"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[2]","name":"a","type":"uint256[2]"},{"internalType":"uint256[2][2]","name":"b","type":"uint256[2][2]"},{"internalType":"uint256[2]","name":"c","type":"uint256[2]"},{"internalType":"uint256[16]","name":"input","type":"uint256[16]"}],"name":"rollupMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"name":"setKeyHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"subscriptionId","type":"uint64"}],"name":"setSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_callbackGasLimit","type":"uint32"}],"name":"setVrfCallbackGasLimit","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":"address","name":"_to","type":"address"},{"internalType":"uint32","name":"_num","type":"uint32"}],"name":"teamReserveMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToMetadata","outputs":[{"internalType":"uint16","name":"score","type":"uint16"},{"internalType":"uint8","name":"background","type":"uint8"},{"internalType":"uint8","name":"effect","type":"uint8"},{"internalType":"uint8","name":"body","type":"uint8"},{"internalType":"uint8","name":"decoration","type":"uint8"},{"internalType":"uint8","name":"eyes","type":"uint8"},{"internalType":"uint8","name":"ball","type":"uint8"},{"internalType":"bool","name":"isRevealed","type":"bool"}],"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":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newAnimationURI","type":"string"}],"name":"updateAnimationURI","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60066101a08181526507282728c82760d31b6101c05260a09081526101e082815265232322a31aa160d11b6102005260c0526102208281526544324246444360d01b6102405260e0526102608281526544394545413960d01b61028052610100526102a08281526544384432434160d01b6102c052610120526102e0828152651191914cd15160d21b61030052610140526103208281526530303538394160d01b61034052610160526103a06040526103609182526521a0a321a32160d11b6103805261018091909152620000d990600b90600862000c01565b506040518060c00160405280604051806040016040528060078152602001665265645761766560c81b81525081526020016040518060400160405280600981526020016810dbdb1bdc94dc1bdd60ba1b81525081526020016040518060400160405280600981526020016814dc1bdd1b1a59da1d60ba1b815250815260200160405180604001604052806006815260200165526970706c6560d01b81525081526020016040518060400160405280600981526020016852696e67537461727360b81b815250815260200160405180604001604052806005815260200164537461727360d81b8152508152506013906006620001d692919062000c51565b506040805160e081018252600a60a0820190815269149a58989bdb94d9585b60b21b60c0830152815281518083018352600b81526a1099585c99195914d9585b60aa1b6020828101919091528083019190915282518084018452600881526712185c9c14d9585b60c21b818301528284015282518084018452600481526341726a6160e01b8183015260608301528251808401909352600c83526b129a5b5b5e551a1954d9585b60a21b9083015260808101919091526200029c90601990600562000c8f565b5060408051610260810182526006610220820181815265436f77626f7960d01b61024084015282528251808401845260078082526614d9585dd9595960ca1b60208381019190915280850192909252845180860186526009815268506561726c4d696c6b60b81b818401528486015284518086018652600a80825269109bddd51a595219585960b21b828501526060860191909152855180870187528281526629b1b0b933181960c91b818501526080860152855180870187528481526546726965644760d01b8185015260a08601528551808701875260088152675461696c52696e6760c01b8185015260c086015285518087018752938452650a6e0d8c2e6d60d31b8484015260e085019390935284518086018652600580825264447265737360d81b8285015261010086019190915285518087018752828152665363617266303160c81b818501526101208601528551808701875284815269426f775469654e65636b60b01b818501526101408601528551808701875281815264467269657360d81b8185015261016086015285518087018752601081526f4d756c7469476f6c64656e52696e677360801b818501526101808601528551808701875293845269109bddd51a5955185a5b60b21b848401526101a085019390935284518086018652600e81526d476f6c64656e4e61636b6c61636560901b818401526101c085015284518086018652908152665363617266303360c81b818301526101e084015283518085019094529083526421b937bbb760d91b90830152610200810191909152620004f190601e90601162000ccd565b506040518060c001604052806040518060400160405280600b81526020016a446f6c6c617242696c6c7360a81b81525081526020016040518060400160405280600381526020016214d85960ea1b8152508152602001604051806040016040528060098152602001684c696e65536861706560b81b81525081526020016040518060400160405280600681526020016557617465727960d01b81525081526020016040518060400160405280600a8152602001694c69676874656e696e6760b01b815250815260200160405180604001604052806003815260200162111bdd60ea1b815250815250602f906006620005eb92919062000c51565b506040518060c001604052806040518060400160405280600a815260200169159bdb1b195e50985b1b60b21b8152508152602001604051806040016040528060078152602001664f63746f70757360c81b8152508152602001604051806040016040528060078152602001662832b733bab4b760c91b81525081526020016040518060400160405280600481526020016321b7b4b760e11b815250815260200160405180604001604052806006815260200165233637bbb2b960d11b8152508152602001604051806040016040528060088152602001675374617252696e6760c01b8152508152506035906006620006e592919062000c51565b5060408051610800810182526000815265010101000001602082015265020102010102818301526503020301020360608201526502010400000060808201526503030402030260a08201526503030500000460c082015264030602000560e0820152650101060104026101008201526504020703020161012082015265010308040205610140820152650404090403066101608201526504050a00010261018082015264010a0005026101a0820152630a0204076101c08201526504000a0303066101e08201526504020a0002066102008201526502050a0203046102208201526501020a0304046102408201526504030a0105026102608201526503000a0400006102808201526504050a0002046102a08201526502020b0000006102c08201526504010c0204066102e08201526505050d030501610300820152630d0302056103208201526502030d02010461034082015264010e0002026103608201526504010e0104046103808201526502050e0000026103a08201526503010e0004016103c08201526505030e0303006103e08201526504020f0105046104008201526502020f0404036104208201526504040f0002036104408201526505020f01010661046082015265020010010403610480820152650504100100046104a0820152650103100402016104c0820152650103100403016104e08201526502041003000361050082015265040310040304610520820152650302100200076105408201526501021004000661056082015265050410000404610580820152650500100201066105a0820152650301100102026105c0820152650300100003066105e082015265030110040201610600820152640510000303610620820152650103100305056106408201526501001003020461066082015265030410020002610680820152650205100105046106a0820152650303100304026106c0820152650301100401006106e0820152631002020061070082015265010510020001610720820152650205100403046107408201526505031004040261076082015265050410010003610780820152650104100404056107a0820152650302100104026107c0820152650304100000036107e082015262000a2591603b919062000d0b565b506000603c556001603d5560405180606001604052806036815260200162004b5c60369139603f9062000a59908262000ee4565b5060405180606001604052806036815260200162004b926036913960409062000a83908262000ee4565b507fff8dedfbfa60af186cf3c830acbc32c05aae823045ae5ea7da1e45fbfaba4f926044556045805465ffffffffffff19166403002625a017905534801562000acb57600080fd5b5060405162004bc838038062004bc883398101604081905262000aee9162000fcd565b826040518060400160405280600d81526020016c105c9a985d995c9cd948139195609a1b8152506040518060400160405280600481526020016341524a4160e01b815250816000908162000b43919062000ee4565b50600162000b52828262000ee4565b5050506001600160a01b031660805262000b6c3362000baf565b604280546001600160a01b039485166001600160a01b03199182161790915560438054938516938216939093179092556041805491909316911617905562001017565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b826008810192821562000c3f579160200282015b8281111562000c3f578251829062000c2e908262000ee4565b509160200191906001019062000c15565b5062000c4d92915062000dc5565b5090565b826006810192821562000c3f579160200282015b8281111562000c3f578251829062000c7e908262000ee4565b509160200191906001019062000c65565b826005810192821562000c3f579160200282015b8281111562000c3f578251829062000cbc908262000ee4565b509160200191906001019062000ca3565b826011810192821562000c3f579160200282015b8281111562000c3f578251829062000cfa908262000ee4565b509160200191906001019062000ce1565b8280548282559060005260206000209060030160049004810192821562000db75791602002820160005b8382111562000d8057835183826101000a8154816001600160401b03021916908365ffffffffffff160217905550926020019260080160208160070104928301926001030262000d35565b801562000db55782816101000a8154906001600160401b03021916905560080160208160070104928301926001030262000d80565b505b5062000c4d92915062000de6565b8082111562000c4d57600062000ddc828262000dfd565b5060010162000dc5565b5b8082111562000c4d576000815560010162000de7565b50805462000e0b9062000e55565b6000825580601f1062000e1c575050565b601f01602090049060005260206000209081019062000e3c919062000de6565b50565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168062000e6a57607f821691505b60208210810362000e8b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000edf57600081815260208120601f850160051c8101602086101562000eba5750805b601f850160051c820191505b8181101562000edb5782815560010162000ec6565b5050505b505050565b81516001600160401b0381111562000f005762000f0062000e3f565b62000f188162000f11845462000e55565b8462000e91565b602080601f83116001811462000f50576000841562000f375750858301515b600019600386901b1c1916600185901b17855562000edb565b600085815260208120601f198616915b8281101562000f815788860151825594840194600190910190840162000f60565b508582101562000fa05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80516001600160a01b038116811462000fc857600080fd5b919050565b60008060006060848603121562000fe357600080fd5b62000fee8462000fb0565b925062000ffe6020850162000fb0565b91506200100e6040850162000fb0565b90509250925092565b608051613b226200103a600039600081816107e001526108220152613b226000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063b88d4fde11610097578063c87b56dd11610071578063c87b56dd14610452578063e985e9c514610465578063ea7b4f77146104a1578063f2fde38b146104b457600080fd5b8063b88d4fde14610370578063bf64db1d14610383578063c72efcf71461043f57600080fd5b80638da5cb5b116100d35780638da5cb5b1461033157806395d89b4114610342578063985447101461034a578063a22cb4651461035d57600080fd5b806370a0823114610303578063715018a6146103165780637ddb75e61461031e57600080fd5b8063218e616c1161016657806342842e0e1161014057806342842e0e146102b75780634f6ccce7146102ca5780635a405c87146102dd5780636352211e146102f057600080fd5b8063218e616c1461027e57806323b872dd146102915780632f745c59146102a457600080fd5b8063095ea7b3116101a2578063095ea7b31461023157806318160ddd146102465780631d05054e146102585780631fe543e31461026b57600080fd5b806301ffc9a7146101c957806306fdde03146101f1578063081812fc14610206575b600080fd5b6101dc6101d73660046128f9565b6104c7565b60405190151581526020015b60405180910390f35b6101f96104f2565b6040516101e89190612966565b610219610214366004612979565b610584565b6040516001600160a01b0390911681526020016101e8565b61024461023f3660046129ae565b6105ab565b005b6008545b6040519081526020016101e8565b6102446102663660046129ec565b6106c5565b610244610279366004612ab0565b6107d5565b61024461028c366004612bb1565b61085d565b61024461029f366004612c8f565b610a41565b61024a6102b23660046129ae565b610a72565b6102446102c5366004612c8f565b610b08565b61024a6102d8366004612979565b610b23565b6102446102eb366004612ccb565b610bb6565b6102196102fe366004612979565b610bda565b61024a610311366004612ce6565b610c3a565b610244610cc0565b61024461032c366004612d58565b610cd4565b600a546001600160a01b0316610219565b6101f9610ce8565b610244610358366004612979565b610cf7565b61024461036b366004612dae565b610d04565b61024461037e366004612de5565b610d0f565b6103ef610391366004612979565b603e6020526000908152604090205461ffff81169060ff62010000820481169163010000008104821691600160201b8204811691600160281b8104821691600160301b8204811691600160381b8104821691600160401b9091041688565b6040805161ffff909916895260ff97881660208a01529587169588019590955292851660608701529084166080860152831660a08501529190911660c0830152151560e0820152610100016101e8565b61024461044d366004612ccb565b610d47565b6101f9610460366004612979565b610da1565b6101dc610473366004612e60565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102446104af366004612e8a565b610e29565b6102446104c2366004612ce6565b610e5e565b60006001600160e01b0319821663780e9d6360e01b14806104ec57506104ec82610ed4565b92915050565b60606000805461050190612eb3565b80601f016020809104026020016040519081016040528092919081815260200182805461052d90612eb3565b801561057a5780601f1061054f5761010080835404028352916020019161057a565b820191906000526020600020905b81548152906001019060200180831161055d57829003601f168201915b5050505050905090565b600061058f82610f24565b506000908152600460205260409020546001600160a01b031690565b60006105b682610bda565b9050806001600160a01b0316836001600160a01b0316036106285760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061064457506106448133610473565b6106b65760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840161061f565b6106c08383610f83565b505050565b6106cd610ff1565b60408163ffffffff166106df60085490565b6106e99190612f03565b111561072c5760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b604482015260640161061f565b60088163ffffffff16603c546107429190612f03565b11156107875760405162461bcd60e51b815260206004820152601460248201527345786365656473207465616d207265736572766560601b604482015260640161061f565b60005b8163ffffffff168110156107b3576107a18361104b565b806107ab81612f16565b91505061078a565b508063ffffffff16603c60008282546107cc9190612f03565b90915550505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461084f5760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016602482015260440161061f565b6108598282611068565b5050565b610865610ff1565b60415460405163c82febf560e01b81526001600160a01b039091169063c82febf59061089b908790879087908790600401612f52565b602060405180830381865afa1580156108b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dc9190612fd6565b6109285760405162461bcd60e51b815260206004820152601960248201527f50726f6f6620766572696669636174696f6e206661696c656400000000000000604482015260640161061f565b6040600861093560085490565b61093f9190612f03565b11156109825760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b604482015260640161061f565b60005b6008811015610a3a5760008261099c836008612f03565b601081106109ac576109ac612ff3565b6020020151905060008383601081106109c7576109c7612ff3565b60200201516001149050816001600160a01b03167fb3843110b05abf70f640607b97e75a326bb84ab9e77f0ed0b2d1e540ffe674c782604051610a0e911515815260200190565b60405180910390a28015610a2557610a258261104b565b50508080610a3290612f16565b915050610985565b5050505050565b610a4b33826110d0565b610a675760405162461bcd60e51b815260040161061f90613009565b6106c083838361114f565b6000610a7d83610c3a565b8210610adf5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161061f565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6106c083838360405180602001604052806000815250610d0f565b6000610b2e60085490565b8210610b915760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161061f565b60088281548110610ba457610ba4612ff3565b90600052602060002001549050919050565b610bbe610ff1565b6045805463ffffffff191663ffffffff92909216919091179055565b6000818152600260205260408120546001600160a01b0316806104ec5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161061f565b60006001600160a01b038216610ca45760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161061f565b506001600160a01b031660009081526003602052604090205490565b610cc8610ff1565b610cd260006112c0565b565b610cdc610ff1565b604061085982826130a4565b60606001805461050190612eb3565b610cff610ff1565b604455565b610859338383611312565b610d1933836110d0565b610d355760405162461bcd60e51b815260040161061f90613009565b610d41848484846113e0565b50505050565b610d4f610ff1565b6040603d541115610d955760405162461bcd60e51b815260206004820152601060248201526f105b1b08139195081c995d99585b195960821b604482015260640161061f565b610d9e81611413565b50565b6000818152600260205260409020546060906001600160a01b0316610e205760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161061f565b6104ec826114ca565b610e31610ff1565b604380546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610e66610ff1565b6001600160a01b038116610ecb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061f565b610d9e816112c0565b60006001600160e01b031982166380ac58cd60e01b1480610f0557506001600160e01b03198216635b5e139f60e01b145b806104ec57506301ffc9a760e01b6001600160e01b03198316146104ec565b6000818152600260205260409020546001600160a01b0316610d9e5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161061f565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610fb882610bda565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600a546001600160a01b03163314610cd25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161061f565b610d9e8161105860085490565b611063906001612f03565b611659565b60005b81518110156110bc57600082828151811061108857611088612ff3565b602002602001015190506110a982603d546110a39190612f03565b82611673565b50806110b481612f16565b91505061106b565b508051603d60008282546107cc9190612f03565b6000806110dc83610bda565b9050806001600160a01b0316846001600160a01b0316148061112357506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806111475750836001600160a01b031661113c84610584565b6001600160a01b0316145b949350505050565b826001600160a01b031661116282610bda565b6001600160a01b0316146111885760405162461bcd60e51b815260040161061f90613163565b6001600160a01b0382166111ea5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161061f565b6111f783838360016117c0565b826001600160a01b031661120a82610bda565b6001600160a01b0316146112305760405162461bcd60e51b815260040161061f90613163565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036113735760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161061f565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6113eb84848461114f565b6113f7848484846118f9565b610d415760405162461bcd60e51b815260040161061f906131a8565b604254604480546043546045546040516305d3b1d360e41b81526004810193909352600160a01b9091046001600160401b03166024830152600160201b810461ffff169282019290925263ffffffff918216606482015290831660848201526001600160a01b0390911690635d3b1d309060a4016020604051808303816000875af11580156114a6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085991906131fa565b606060006114d7836119fa565b6000848152603e60209081526040808320815161010081018352905461ffff8116825260ff620100008204811694830185905263010000008204811693830193909352600160201b810483166060830152600160281b810483166080830152600160301b8104831660a0830152600160381b8104831660c0830152600160401b9004909116151560e082015292935061156f906119fa565b61157f836040015160ff166119fa565b61158f846060015160ff166119fa565b61159f856080015160ff166119fa565b6115af8660a0015160ff166119fa565b6115bf8760c0015160ff166119fa565b6040516020016115d49695949392919061322f565b604051602081830303815290604052905061163083603f836115f589611a8c565b6115fe8a611d14565b6116078b611f99565b60405160200161161c96959493929190613356565b60405160208183030381529060405261208d565b604051602001611640919061374a565b6040516020818303038152906040529350505050919050565b6108598282604051806020016040528060008152506121f3565b6000828152603e6020526040902054600160401b900460ff16156116cc5760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481c995d99585b195960821b604482015260640161061f565b6116d581612226565b6000928352603e60209081526040938490208251815492840151958401516060850151608086015160a087015160c088015160e0909801511515600160401b0268ff00000000000000001960ff998a16600160381b021668ffff0000000000000019928a16600160301b0266ff00000000000019948b16600160281b029490941666ffff000000000019958b16600160201b0264ff0000000019978c166301000000029790971664ffff000000199b909d16620100000262ffffff19909a1661ffff909816979097179890981798909816999099179290921716919091171794909416171790915550565b6117cc8484848461229a565b600181111561183b5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b606482015260840161061f565b816001600160a01b0385166118975761189281600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6118ba565b836001600160a01b0316856001600160a01b0316146118ba576118ba8582612322565b6001600160a01b0384166118d6576118d1816123bf565b610a3a565b846001600160a01b0316846001600160a01b031614610a3a57610a3a848261246e565b60006001600160a01b0384163b156119ef57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061193d90339089908890889060040161378f565b6020604051808303816000875af1925050508015611978575060408051601f3d908101601f19168201909252611975918101906137cc565b60015b6119d5573d8080156119a6576040519150601f19603f3d011682016040523d82523d6000602084013e6119ab565b606091505b5080516000036119cd5760405162461bcd60e51b815260040161061f906131a8565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611147565b506001949350505050565b60606000611a07836124b2565b60010190506000816001600160401b03811115611a2657611a26612a1f565b6040519080825280601f01601f191660200182016040528015611a50576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611a5a57509392505050565b6000818152603e6020908152604091829020825161010081018452905461ffff8116825260ff620100008204811693830184905263010000008204811694830194909452600160201b81048416606083810191909152600160281b820485166080840152600160301b8204851660a0840152600160381b8204851660c0840152600160401b909104909316151560e082015290611d0d90600b9060088110611b3657611b36612ff3565b018054611b4290612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611b6e90612eb3565b8015611bbb5780601f10611b9057610100808354040283529160200191611bbb565b820191906000526020600020905b815481529060010190602001808311611b9e57829003601f168201915b50505050506013836040015160ff1660068110611bda57611bda612ff3565b018054611be690612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611c1290612eb3565b8015611c5f5780601f10611c3457610100808354040283529160200191611c5f565b820191906000526020600020905b815481529060010190602001808311611c4257829003601f168201915b50505050506019846060015160ff1660058110611c7e57611c7e612ff3565b018054611c8a90612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611cb690612eb3565b8015611d035780601f10611cd857610100808354040283529160200191611d03565b820191906000526020600020905b815481529060010190602001808311611ce657829003601f168201915b505050505061258a565b9392505050565b6000818152603e6020908152604091829020825161010081018452905461ffff8116825260ff62010000820481169383019390935263010000008104831693820193909352600160201b83048216606082810191909152600160281b8404831660808301819052600160301b8504841660a0840152600160381b8504841660c0840152600160401b909404909216151560e08201529091611d0d90601e9060118110611dc257611dc2612ff3565b018054611dce90612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611dfa90612eb3565b8015611e475780601f10611e1c57610100808354040283529160200191611e47565b820191906000526020600020905b815481529060010190602001808311611e2a57829003601f168201915b5050505050602f8360a0015160ff1660068110611e6657611e66612ff3565b018054611e7290612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611e9e90612eb3565b8015611eeb5780601f10611ec057610100808354040283529160200191611eeb565b820191906000526020600020905b815481529060010190602001808311611ece57829003601f168201915b505050505060358460c0015160ff1660068110611f0a57611f0a612ff3565b018054611f1690612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611f4290612eb3565b8015611f8f5780601f10611f6457610100808354040283529160200191611f8f565b820191906000526020600020905b815481529060010190602001808311611f7257829003601f168201915b50505050506125b9565b60606000611fa6836119fa565b6000848152603e6020908152604091829020825161010081018452905461ffff8116825260ff620100008204811693830184905263010000008204811683860152600160201b820481166060840152600160281b820481166080840152600160301b8204811660a0840152600160381b8204811660c0840152600160401b90910416151560e0820152929350600b906008811061204557612045612ff3565b0160358360c0015160ff166006811061206057612060612ff3565b018460405160200161207594939291906137ff565b60405160208183030381529060405292505050919050565b606081516000036120ac57505060408051602081019091526000815290565b6000604051806060016040528060408152602001613aad60409139905060006003845160026120db9190612f03565b6120e5919061386a565b6120f090600461387e565b905060006120ff826020612f03565b6001600160401b0381111561211657612116612a1f565b6040519080825280601f01601f191660200182016040528015612140576020820181803683370190505b509050818152600183018586518101602084015b818310156121ae5760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b93820193909352600401612154565b6003895106600181146121c857600281146121d9576121e5565b613d3d60f01b6001198301526121e5565b603d60f81b6000198301525b509398975050505050505050565b6121fd83836125d0565b61220a60008484846118f9565b6106c05760405162461bcd60e51b815260040161061f906131a8565b61222e61289f565b600061223983612769565b905061224361289f565b60ff808316602080840191909152600884901c82166040840152601084901c82166060840152601884901c8216608084015283901c811660a083015260289290921c90911660c0820152600160e082015292915050565b6001811115610d41576001600160a01b038416156122e0576001600160a01b038416600090815260036020526040812080548392906122da908490613895565b90915550505b6001600160a01b03831615610d41576001600160a01b03831660009081526003602052604081208054839290612317908490612f03565b909155505050505050565b6000600161232f84610c3a565b6123399190613895565b60008381526007602052604090205490915080821461238c576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906123d190600190613895565b600083815260096020526040812054600880549394509092849081106123f9576123f9612ff3565b90600052602060002001549050806008838154811061241a5761241a612ff3565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612452576124526138a8565b6001900381819060005260206000200160009055905550505050565b600061247983610c3a565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106124f15772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061251d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061253b57662386f26fc10000830492506010015b6305f5e1008310612553576305f5e100830492506008015b612710831061256757612710830492506004015b60648310612579576064830492506002015b600a83106104ec5760010192915050565b60608383836040516020016125a1939291906138be565b60405160208183030381529060405290509392505050565b60608383836040516020016125a1939291906139b0565b6001600160a01b0382166126265760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161061f565b6000818152600260205260409020546001600160a01b03161561268b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161061f565b6126996000838360016117c0565b6000818152600260205260409020546001600160a01b0316156126fe5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161061f565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b603b54600090819061277b9084613a98565b90506000603b828154811061279257612792612ff3565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03169050603b6001603b805490506127d19190613895565b815481106127e1576127e1612ff3565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b0316603b838154811061281d5761281d612ff3565b90600052602060002090600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b03160217905550603b805480612867576128676138a8565b60008281526020902060046000199092019182040180546001600160401b03600860038516026101000a021916905590559392505050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915290565b6001600160e01b031981168114610d9e57600080fd5b60006020828403121561290b57600080fd5b8135611d0d816128e3565b60005b83811015612931578181015183820152602001612919565b50506000910152565b60008151808452612952816020860160208601612916565b601f01601f19169290920160200192915050565b602081526000611d0d602083018461293a565b60006020828403121561298b57600080fd5b5035919050565b80356001600160a01b03811681146129a957600080fd5b919050565b600080604083850312156129c157600080fd5b6129ca83612992565b946020939093013593505050565b803563ffffffff811681146129a957600080fd5b600080604083850312156129ff57600080fd5b612a0883612992565b9150612a16602084016129d8565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715612a5757612a57612a1f565b60405290565b60405161020081016001600160401b0381118282101715612a5757612a57612a1f565b604051601f8201601f191681016001600160401b0381118282101715612aa857612aa8612a1f565b604052919050565b60008060408385031215612ac357600080fd5b823591506020808401356001600160401b0380821115612ae257600080fd5b818601915086601f830112612af657600080fd5b813581811115612b0857612b08612a1f565b8060051b9150612b19848301612a80565b8181529183018401918481019089841115612b3357600080fd5b938501935b83851015612b5157843582529385019390850190612b38565b8096505050505050509250929050565b600082601f830112612b7257600080fd5b612b7a612a35565b806040840185811115612b8c57600080fd5b845b81811015612ba6578035845260209384019301612b8e565b509095945050505050565b600080600080610300808688031215612bc957600080fd5b612bd38787612b61565b9450604087605f880112612be657600080fd5b612bee612a35565b8060c089018a811115612c0057600080fd5b838a015b81811015612c2557612c168c82612b61565b84526020909301928401612c04565b50819750612c338b82612b61565b9650505050508661011f870112612c4957600080fd5b612c51612a5d565b908601908088831115612c6357600080fd5b61010088015b83811015612c81578035835260209283019201612c69565b509598949750929550505050565b600080600060608486031215612ca457600080fd5b612cad84612992565b9250612cbb60208501612992565b9150604084013590509250925092565b600060208284031215612cdd57600080fd5b611d0d826129d8565b600060208284031215612cf857600080fd5b611d0d82612992565b60006001600160401b03831115612d1a57612d1a612a1f565b612d2d601f8401601f1916602001612a80565b9050828152838383011115612d4157600080fd5b828260208301376000602084830101529392505050565b600060208284031215612d6a57600080fd5b81356001600160401b03811115612d8057600080fd5b8201601f81018413612d9157600080fd5b61114784823560208401612d01565b8015158114610d9e57600080fd5b60008060408385031215612dc157600080fd5b612dca83612992565b91506020830135612dda81612da0565b809150509250929050565b60008060008060808587031215612dfb57600080fd5b612e0485612992565b9350612e1260208601612992565b92506040850135915060608501356001600160401b03811115612e3457600080fd5b8501601f81018713612e4557600080fd5b612e5487823560208401612d01565b91505092959194509250565b60008060408385031215612e7357600080fd5b612e7c83612992565b9150612a1660208401612992565b600060208284031215612e9c57600080fd5b81356001600160401b0381168114611d0d57600080fd5b600181811c90821680612ec757607f821691505b602082108103612ee757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104ec576104ec612eed565b600060018201612f2857612f28612eed565b5060010190565b8060005b6002811015610d41578151845260209384019390910190600101612f33565b6103008101612f618287612f2f565b60408083018660005b6002811015612f9157612f7e838351612f2f565b9183019160209190910190600101612f6a565b50505050612fa260c0830185612f2f565b61010082018360005b6010811015612fca578151835260209283019290910190600101612fab565b50505095945050505050565b600060208284031215612fe857600080fd5b8151611d0d81612da0565b634e487b7160e01b600052603260045260246000fd5b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b601f8211156106c057600081815260208120601f850160051c8101602086101561307d5750805b601f850160051c820191505b8181101561309c57828155600101613089565b505050505050565b81516001600160401b038111156130bd576130bd612a1f565b6130d1816130cb8454612eb3565b84613056565b602080601f83116001811461310657600084156130ee5750858301515b600019600386901b1c1916600185901b17855561309c565b600085815260208120601f198616915b8281101561313557888601518255948401946001909101908401613116565b50858210156131535787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60006020828403121561320c57600080fd5b5051919050565b60008151613225818560208601612916565b9290920192915050565b6000875160206132428285838d01612916565b8184019150602d60f81b80835289516132618160018601858e01612916565b60019301928301819052885161327d8160028601858d01612916565b6002930192830181905287516132998160038601858c01612916565b6003930192830181905286516132b58160048601858b01612916565b600493019283015284516132cf8160058501848901612916565b919091016005019998505050505050505050565b600081546132f081612eb3565b60018281168015613308576001811461331d5761334c565b60ff198416875282151583028701945061334c565b8560005260208060002060005b858110156133435781548a82015290840190820161332a565b50505082870194505b5050505092915050565b6a3d90113730b6b2911d101160a91b81526a41726a617665727365202360a81b600b8201528651600090613391816016850160208c01612916565b6b11161134b6b0b3b2911d101160a11b6016918401918201526133b760228201896132e3565b905086516133c9818360208b01612916565b632e706e6760e01b910190815270222c2261747472696275746573223a205b60781b60048201528551613403816015840160208a01612916565b8551910190613419816015840160208901612916565b61373c61372f61345f61345961343b601586880101605d60f81b815260010190565b71161130b734b6b0ba34b7b72fbab936111d1160711b815260120190565b88613213565b7f222c226465736372697074696f6e223a202241206d7973746572696f7573206381527f72656174757265206f6620696d6d656e73652073697a6520617070656172732060208201527f696e207468652067616c6178792c20666c6f6174696e67206f7574206f66206e60408201527f6f776865726520616e6420736c6f776c7920617070726f616368696e6720456160608201527f7274682e5c6e53756464656e6c79212041206d6f757468206f70656e65642c2060808201527f616e64207468652045617274682077617320756e65787065637465646c79207360a08201527f77616c6c6f77656420757020696e20616e20696e7374616e742c20656d69747460c08201527f696e6720616e20756e6b6e6f776e206c69676874202d2042414e47212054686560e08201527f205365616c206578706c6f646573215c6e46726f6d207468656e206f6e2c20616101008201527f20706c616e65742066756c6c206f6620736561206f74746572732077617320626101208201527f6f726e202d207468652041726a617665727365215c6e54686520706c616e65746101408201527f206973203735252077617465722c206963652c20616e642067656d732c20616e6101608201527f6420697473206578746572696f722072657461696e73207468652061707065616101808201527f72616e6365206f6620456172746820616e642074686520756e6b6e6f776e20636101a08201527f726561747572652c206265636f6d696e6720612066616e746173746963616c206101c08201527f696c6c7573696f6e2e5c6e546869732067617665207269736520746f207468656101e08201527f20696e6372656469626c79206375746520616e6420756e6971756520616476656102008201527f6e747572657273202d20746865207365616c20636974697a656e732066726f6d6102208201526b1020b93530bb32b939b2971160a11b61024082015261024c0190565b607d60f81b815260010190565b9a9950505050505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161378281601d850160208701612916565b91909101601d0192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906137c29083018461293a565b9695505050505050565b6000602082840312156137de57600080fd5b8151611d0d816128e3565b634e487b7160e01b600052601260045260246000fd5b600061380b82876132e3565b633f62673d60e01b815261382260048201876132e3565b9050652662616c6c3d60d01b815261383d60068201866132e3565b9050632669643d60e01b8152835161385c816004840160208801612916565b016004019695505050505050565b600082613879576138796137e9565b500490565b80820281158282048414176104ec576104ec612eed565b818103818111156104ec576104ec612eed565b634e487b7160e01b600052603160045260246000fd5b7f7b2274726169745f74797065223a20224261636b67726f756e64222c2276616c8152643ab2911d1160d91b602082015260008451613904816025850160208901612916565b61227d60f01b60259184019182018190527f2c7b2274726169745f74797065223a2022456666656374222c2276616c7565226027830152611d1160f11b60478301528551613959816049850160208a01612916565b604992019182018190527f2c7b2274726169745f74797065223a2022426f6479222c2276616c7565223a22604b830152845161399c81606b850160208901612916565b606b920191820152606d0195945050505050565b7f2c7b2274726169745f74797065223a20224465636f726174696f6e222c227661815265363ab2911d1160d11b6020820152600084516139f7816026850160208901612916565b61227d60f01b60269184019182018190527f2c7b2274726169745f74797065223a202245796573222c2276616c7565223a2260288301528551613a41816048850160208a01612916565b604892019182018190527f2c7b2274726169745f74797065223a202242616c6c222c2276616c7565223a22604a8301528451613a8481606a850160208901612916565b606a920191820152606c0195945050505050565b600082613aa757613aa76137e9565b50069056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122015574526dfdf320e514cd11177f49885470c1bc0fc3d8d579e8e75dec95bfa7464736f6c63430008110033697066733a2f2f516d6647436d7364656279624e425768716f723263786e4a59555538394c674a334b574c736a397665756841445a2f697066733a2f2f516d536b61685347413966653641476b6a76423463624b6565694538584a786834686778716143703755654742722f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca00000000000000000000000029d95c0cf0ee4546e369eddc62df23df449ee9f8
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063b88d4fde11610097578063c87b56dd11610071578063c87b56dd14610452578063e985e9c514610465578063ea7b4f77146104a1578063f2fde38b146104b457600080fd5b8063b88d4fde14610370578063bf64db1d14610383578063c72efcf71461043f57600080fd5b80638da5cb5b116100d35780638da5cb5b1461033157806395d89b4114610342578063985447101461034a578063a22cb4651461035d57600080fd5b806370a0823114610303578063715018a6146103165780637ddb75e61461031e57600080fd5b8063218e616c1161016657806342842e0e1161014057806342842e0e146102b75780634f6ccce7146102ca5780635a405c87146102dd5780636352211e146102f057600080fd5b8063218e616c1461027e57806323b872dd146102915780632f745c59146102a457600080fd5b8063095ea7b3116101a2578063095ea7b31461023157806318160ddd146102465780631d05054e146102585780631fe543e31461026b57600080fd5b806301ffc9a7146101c957806306fdde03146101f1578063081812fc14610206575b600080fd5b6101dc6101d73660046128f9565b6104c7565b60405190151581526020015b60405180910390f35b6101f96104f2565b6040516101e89190612966565b610219610214366004612979565b610584565b6040516001600160a01b0390911681526020016101e8565b61024461023f3660046129ae565b6105ab565b005b6008545b6040519081526020016101e8565b6102446102663660046129ec565b6106c5565b610244610279366004612ab0565b6107d5565b61024461028c366004612bb1565b61085d565b61024461029f366004612c8f565b610a41565b61024a6102b23660046129ae565b610a72565b6102446102c5366004612c8f565b610b08565b61024a6102d8366004612979565b610b23565b6102446102eb366004612ccb565b610bb6565b6102196102fe366004612979565b610bda565b61024a610311366004612ce6565b610c3a565b610244610cc0565b61024461032c366004612d58565b610cd4565b600a546001600160a01b0316610219565b6101f9610ce8565b610244610358366004612979565b610cf7565b61024461036b366004612dae565b610d04565b61024461037e366004612de5565b610d0f565b6103ef610391366004612979565b603e6020526000908152604090205461ffff81169060ff62010000820481169163010000008104821691600160201b8204811691600160281b8104821691600160301b8204811691600160381b8104821691600160401b9091041688565b6040805161ffff909916895260ff97881660208a01529587169588019590955292851660608701529084166080860152831660a08501529190911660c0830152151560e0820152610100016101e8565b61024461044d366004612ccb565b610d47565b6101f9610460366004612979565b610da1565b6101dc610473366004612e60565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102446104af366004612e8a565b610e29565b6102446104c2366004612ce6565b610e5e565b60006001600160e01b0319821663780e9d6360e01b14806104ec57506104ec82610ed4565b92915050565b60606000805461050190612eb3565b80601f016020809104026020016040519081016040528092919081815260200182805461052d90612eb3565b801561057a5780601f1061054f5761010080835404028352916020019161057a565b820191906000526020600020905b81548152906001019060200180831161055d57829003601f168201915b5050505050905090565b600061058f82610f24565b506000908152600460205260409020546001600160a01b031690565b60006105b682610bda565b9050806001600160a01b0316836001600160a01b0316036106285760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061064457506106448133610473565b6106b65760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840161061f565b6106c08383610f83565b505050565b6106cd610ff1565b60408163ffffffff166106df60085490565b6106e99190612f03565b111561072c5760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b604482015260640161061f565b60088163ffffffff16603c546107429190612f03565b11156107875760405162461bcd60e51b815260206004820152601460248201527345786365656473207465616d207265736572766560601b604482015260640161061f565b60005b8163ffffffff168110156107b3576107a18361104b565b806107ab81612f16565b91505061078a565b508063ffffffff16603c60008282546107cc9190612f03565b90915550505050565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909161461084f5760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990916602482015260440161061f565b6108598282611068565b5050565b610865610ff1565b60415460405163c82febf560e01b81526001600160a01b039091169063c82febf59061089b908790879087908790600401612f52565b602060405180830381865afa1580156108b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dc9190612fd6565b6109285760405162461bcd60e51b815260206004820152601960248201527f50726f6f6620766572696669636174696f6e206661696c656400000000000000604482015260640161061f565b6040600861093560085490565b61093f9190612f03565b11156109825760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b604482015260640161061f565b60005b6008811015610a3a5760008261099c836008612f03565b601081106109ac576109ac612ff3565b6020020151905060008383601081106109c7576109c7612ff3565b60200201516001149050816001600160a01b03167fb3843110b05abf70f640607b97e75a326bb84ab9e77f0ed0b2d1e540ffe674c782604051610a0e911515815260200190565b60405180910390a28015610a2557610a258261104b565b50508080610a3290612f16565b915050610985565b5050505050565b610a4b33826110d0565b610a675760405162461bcd60e51b815260040161061f90613009565b6106c083838361114f565b6000610a7d83610c3a565b8210610adf5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161061f565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6106c083838360405180602001604052806000815250610d0f565b6000610b2e60085490565b8210610b915760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161061f565b60088281548110610ba457610ba4612ff3565b90600052602060002001549050919050565b610bbe610ff1565b6045805463ffffffff191663ffffffff92909216919091179055565b6000818152600260205260408120546001600160a01b0316806104ec5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161061f565b60006001600160a01b038216610ca45760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161061f565b506001600160a01b031660009081526003602052604090205490565b610cc8610ff1565b610cd260006112c0565b565b610cdc610ff1565b604061085982826130a4565b60606001805461050190612eb3565b610cff610ff1565b604455565b610859338383611312565b610d1933836110d0565b610d355760405162461bcd60e51b815260040161061f90613009565b610d41848484846113e0565b50505050565b610d4f610ff1565b6040603d541115610d955760405162461bcd60e51b815260206004820152601060248201526f105b1b08139195081c995d99585b195960821b604482015260640161061f565b610d9e81611413565b50565b6000818152600260205260409020546060906001600160a01b0316610e205760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161061f565b6104ec826114ca565b610e31610ff1565b604380546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610e66610ff1565b6001600160a01b038116610ecb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061f565b610d9e816112c0565b60006001600160e01b031982166380ac58cd60e01b1480610f0557506001600160e01b03198216635b5e139f60e01b145b806104ec57506301ffc9a760e01b6001600160e01b03198316146104ec565b6000818152600260205260409020546001600160a01b0316610d9e5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161061f565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610fb882610bda565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600a546001600160a01b03163314610cd25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161061f565b610d9e8161105860085490565b611063906001612f03565b611659565b60005b81518110156110bc57600082828151811061108857611088612ff3565b602002602001015190506110a982603d546110a39190612f03565b82611673565b50806110b481612f16565b91505061106b565b508051603d60008282546107cc9190612f03565b6000806110dc83610bda565b9050806001600160a01b0316846001600160a01b0316148061112357506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806111475750836001600160a01b031661113c84610584565b6001600160a01b0316145b949350505050565b826001600160a01b031661116282610bda565b6001600160a01b0316146111885760405162461bcd60e51b815260040161061f90613163565b6001600160a01b0382166111ea5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161061f565b6111f783838360016117c0565b826001600160a01b031661120a82610bda565b6001600160a01b0316146112305760405162461bcd60e51b815260040161061f90613163565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036113735760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161061f565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6113eb84848461114f565b6113f7848484846118f9565b610d415760405162461bcd60e51b815260040161061f906131a8565b604254604480546043546045546040516305d3b1d360e41b81526004810193909352600160a01b9091046001600160401b03166024830152600160201b810461ffff169282019290925263ffffffff918216606482015290831660848201526001600160a01b0390911690635d3b1d309060a4016020604051808303816000875af11580156114a6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085991906131fa565b606060006114d7836119fa565b6000848152603e60209081526040808320815161010081018352905461ffff8116825260ff620100008204811694830185905263010000008204811693830193909352600160201b810483166060830152600160281b810483166080830152600160301b8104831660a0830152600160381b8104831660c0830152600160401b9004909116151560e082015292935061156f906119fa565b61157f836040015160ff166119fa565b61158f846060015160ff166119fa565b61159f856080015160ff166119fa565b6115af8660a0015160ff166119fa565b6115bf8760c0015160ff166119fa565b6040516020016115d49695949392919061322f565b604051602081830303815290604052905061163083603f836115f589611a8c565b6115fe8a611d14565b6116078b611f99565b60405160200161161c96959493929190613356565b60405160208183030381529060405261208d565b604051602001611640919061374a565b6040516020818303038152906040529350505050919050565b6108598282604051806020016040528060008152506121f3565b6000828152603e6020526040902054600160401b900460ff16156116cc5760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481c995d99585b195960821b604482015260640161061f565b6116d581612226565b6000928352603e60209081526040938490208251815492840151958401516060850151608086015160a087015160c088015160e0909801511515600160401b0268ff00000000000000001960ff998a16600160381b021668ffff0000000000000019928a16600160301b0266ff00000000000019948b16600160281b029490941666ffff000000000019958b16600160201b0264ff0000000019978c166301000000029790971664ffff000000199b909d16620100000262ffffff19909a1661ffff909816979097179890981798909816999099179290921716919091171794909416171790915550565b6117cc8484848461229a565b600181111561183b5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b606482015260840161061f565b816001600160a01b0385166118975761189281600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6118ba565b836001600160a01b0316856001600160a01b0316146118ba576118ba8582612322565b6001600160a01b0384166118d6576118d1816123bf565b610a3a565b846001600160a01b0316846001600160a01b031614610a3a57610a3a848261246e565b60006001600160a01b0384163b156119ef57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061193d90339089908890889060040161378f565b6020604051808303816000875af1925050508015611978575060408051601f3d908101601f19168201909252611975918101906137cc565b60015b6119d5573d8080156119a6576040519150601f19603f3d011682016040523d82523d6000602084013e6119ab565b606091505b5080516000036119cd5760405162461bcd60e51b815260040161061f906131a8565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611147565b506001949350505050565b60606000611a07836124b2565b60010190506000816001600160401b03811115611a2657611a26612a1f565b6040519080825280601f01601f191660200182016040528015611a50576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611a5a57509392505050565b6000818152603e6020908152604091829020825161010081018452905461ffff8116825260ff620100008204811693830184905263010000008204811694830194909452600160201b81048416606083810191909152600160281b820485166080840152600160301b8204851660a0840152600160381b8204851660c0840152600160401b909104909316151560e082015290611d0d90600b9060088110611b3657611b36612ff3565b018054611b4290612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611b6e90612eb3565b8015611bbb5780601f10611b9057610100808354040283529160200191611bbb565b820191906000526020600020905b815481529060010190602001808311611b9e57829003601f168201915b50505050506013836040015160ff1660068110611bda57611bda612ff3565b018054611be690612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611c1290612eb3565b8015611c5f5780601f10611c3457610100808354040283529160200191611c5f565b820191906000526020600020905b815481529060010190602001808311611c4257829003601f168201915b50505050506019846060015160ff1660058110611c7e57611c7e612ff3565b018054611c8a90612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611cb690612eb3565b8015611d035780601f10611cd857610100808354040283529160200191611d03565b820191906000526020600020905b815481529060010190602001808311611ce657829003601f168201915b505050505061258a565b9392505050565b6000818152603e6020908152604091829020825161010081018452905461ffff8116825260ff62010000820481169383019390935263010000008104831693820193909352600160201b83048216606082810191909152600160281b8404831660808301819052600160301b8504841660a0840152600160381b8504841660c0840152600160401b909404909216151560e08201529091611d0d90601e9060118110611dc257611dc2612ff3565b018054611dce90612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611dfa90612eb3565b8015611e475780601f10611e1c57610100808354040283529160200191611e47565b820191906000526020600020905b815481529060010190602001808311611e2a57829003601f168201915b5050505050602f8360a0015160ff1660068110611e6657611e66612ff3565b018054611e7290612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611e9e90612eb3565b8015611eeb5780601f10611ec057610100808354040283529160200191611eeb565b820191906000526020600020905b815481529060010190602001808311611ece57829003601f168201915b505050505060358460c0015160ff1660068110611f0a57611f0a612ff3565b018054611f1690612eb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611f4290612eb3565b8015611f8f5780601f10611f6457610100808354040283529160200191611f8f565b820191906000526020600020905b815481529060010190602001808311611f7257829003601f168201915b50505050506125b9565b60606000611fa6836119fa565b6000848152603e6020908152604091829020825161010081018452905461ffff8116825260ff620100008204811693830184905263010000008204811683860152600160201b820481166060840152600160281b820481166080840152600160301b8204811660a0840152600160381b8204811660c0840152600160401b90910416151560e0820152929350600b906008811061204557612045612ff3565b0160358360c0015160ff166006811061206057612060612ff3565b018460405160200161207594939291906137ff565b60405160208183030381529060405292505050919050565b606081516000036120ac57505060408051602081019091526000815290565b6000604051806060016040528060408152602001613aad60409139905060006003845160026120db9190612f03565b6120e5919061386a565b6120f090600461387e565b905060006120ff826020612f03565b6001600160401b0381111561211657612116612a1f565b6040519080825280601f01601f191660200182016040528015612140576020820181803683370190505b509050818152600183018586518101602084015b818310156121ae5760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b93820193909352600401612154565b6003895106600181146121c857600281146121d9576121e5565b613d3d60f01b6001198301526121e5565b603d60f81b6000198301525b509398975050505050505050565b6121fd83836125d0565b61220a60008484846118f9565b6106c05760405162461bcd60e51b815260040161061f906131a8565b61222e61289f565b600061223983612769565b905061224361289f565b60ff808316602080840191909152600884901c82166040840152601084901c82166060840152601884901c8216608084015283901c811660a083015260289290921c90911660c0820152600160e082015292915050565b6001811115610d41576001600160a01b038416156122e0576001600160a01b038416600090815260036020526040812080548392906122da908490613895565b90915550505b6001600160a01b03831615610d41576001600160a01b03831660009081526003602052604081208054839290612317908490612f03565b909155505050505050565b6000600161232f84610c3a565b6123399190613895565b60008381526007602052604090205490915080821461238c576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906123d190600190613895565b600083815260096020526040812054600880549394509092849081106123f9576123f9612ff3565b90600052602060002001549050806008838154811061241a5761241a612ff3565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612452576124526138a8565b6001900381819060005260206000200160009055905550505050565b600061247983610c3a565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106124f15772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061251d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061253b57662386f26fc10000830492506010015b6305f5e1008310612553576305f5e100830492506008015b612710831061256757612710830492506004015b60648310612579576064830492506002015b600a83106104ec5760010192915050565b60608383836040516020016125a1939291906138be565b60405160208183030381529060405290509392505050565b60608383836040516020016125a1939291906139b0565b6001600160a01b0382166126265760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161061f565b6000818152600260205260409020546001600160a01b03161561268b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161061f565b6126996000838360016117c0565b6000818152600260205260409020546001600160a01b0316156126fe5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161061f565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b603b54600090819061277b9084613a98565b90506000603b828154811061279257612792612ff3565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03169050603b6001603b805490506127d19190613895565b815481106127e1576127e1612ff3565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b0316603b838154811061281d5761281d612ff3565b90600052602060002090600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b03160217905550603b805480612867576128676138a8565b60008281526020902060046000199092019182040180546001600160401b03600860038516026101000a021916905590559392505050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915290565b6001600160e01b031981168114610d9e57600080fd5b60006020828403121561290b57600080fd5b8135611d0d816128e3565b60005b83811015612931578181015183820152602001612919565b50506000910152565b60008151808452612952816020860160208601612916565b601f01601f19169290920160200192915050565b602081526000611d0d602083018461293a565b60006020828403121561298b57600080fd5b5035919050565b80356001600160a01b03811681146129a957600080fd5b919050565b600080604083850312156129c157600080fd5b6129ca83612992565b946020939093013593505050565b803563ffffffff811681146129a957600080fd5b600080604083850312156129ff57600080fd5b612a0883612992565b9150612a16602084016129d8565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715612a5757612a57612a1f565b60405290565b60405161020081016001600160401b0381118282101715612a5757612a57612a1f565b604051601f8201601f191681016001600160401b0381118282101715612aa857612aa8612a1f565b604052919050565b60008060408385031215612ac357600080fd5b823591506020808401356001600160401b0380821115612ae257600080fd5b818601915086601f830112612af657600080fd5b813581811115612b0857612b08612a1f565b8060051b9150612b19848301612a80565b8181529183018401918481019089841115612b3357600080fd5b938501935b83851015612b5157843582529385019390850190612b38565b8096505050505050509250929050565b600082601f830112612b7257600080fd5b612b7a612a35565b806040840185811115612b8c57600080fd5b845b81811015612ba6578035845260209384019301612b8e565b509095945050505050565b600080600080610300808688031215612bc957600080fd5b612bd38787612b61565b9450604087605f880112612be657600080fd5b612bee612a35565b8060c089018a811115612c0057600080fd5b838a015b81811015612c2557612c168c82612b61565b84526020909301928401612c04565b50819750612c338b82612b61565b9650505050508661011f870112612c4957600080fd5b612c51612a5d565b908601908088831115612c6357600080fd5b61010088015b83811015612c81578035835260209283019201612c69565b509598949750929550505050565b600080600060608486031215612ca457600080fd5b612cad84612992565b9250612cbb60208501612992565b9150604084013590509250925092565b600060208284031215612cdd57600080fd5b611d0d826129d8565b600060208284031215612cf857600080fd5b611d0d82612992565b60006001600160401b03831115612d1a57612d1a612a1f565b612d2d601f8401601f1916602001612a80565b9050828152838383011115612d4157600080fd5b828260208301376000602084830101529392505050565b600060208284031215612d6a57600080fd5b81356001600160401b03811115612d8057600080fd5b8201601f81018413612d9157600080fd5b61114784823560208401612d01565b8015158114610d9e57600080fd5b60008060408385031215612dc157600080fd5b612dca83612992565b91506020830135612dda81612da0565b809150509250929050565b60008060008060808587031215612dfb57600080fd5b612e0485612992565b9350612e1260208601612992565b92506040850135915060608501356001600160401b03811115612e3457600080fd5b8501601f81018713612e4557600080fd5b612e5487823560208401612d01565b91505092959194509250565b60008060408385031215612e7357600080fd5b612e7c83612992565b9150612a1660208401612992565b600060208284031215612e9c57600080fd5b81356001600160401b0381168114611d0d57600080fd5b600181811c90821680612ec757607f821691505b602082108103612ee757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104ec576104ec612eed565b600060018201612f2857612f28612eed565b5060010190565b8060005b6002811015610d41578151845260209384019390910190600101612f33565b6103008101612f618287612f2f565b60408083018660005b6002811015612f9157612f7e838351612f2f565b9183019160209190910190600101612f6a565b50505050612fa260c0830185612f2f565b61010082018360005b6010811015612fca578151835260209283019290910190600101612fab565b50505095945050505050565b600060208284031215612fe857600080fd5b8151611d0d81612da0565b634e487b7160e01b600052603260045260246000fd5b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b601f8211156106c057600081815260208120601f850160051c8101602086101561307d5750805b601f850160051c820191505b8181101561309c57828155600101613089565b505050505050565b81516001600160401b038111156130bd576130bd612a1f565b6130d1816130cb8454612eb3565b84613056565b602080601f83116001811461310657600084156130ee5750858301515b600019600386901b1c1916600185901b17855561309c565b600085815260208120601f198616915b8281101561313557888601518255948401946001909101908401613116565b50858210156131535787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60006020828403121561320c57600080fd5b5051919050565b60008151613225818560208601612916565b9290920192915050565b6000875160206132428285838d01612916565b8184019150602d60f81b80835289516132618160018601858e01612916565b60019301928301819052885161327d8160028601858d01612916565b6002930192830181905287516132998160038601858c01612916565b6003930192830181905286516132b58160048601858b01612916565b600493019283015284516132cf8160058501848901612916565b919091016005019998505050505050505050565b600081546132f081612eb3565b60018281168015613308576001811461331d5761334c565b60ff198416875282151583028701945061334c565b8560005260208060002060005b858110156133435781548a82015290840190820161332a565b50505082870194505b5050505092915050565b6a3d90113730b6b2911d101160a91b81526a41726a617665727365202360a81b600b8201528651600090613391816016850160208c01612916565b6b11161134b6b0b3b2911d101160a11b6016918401918201526133b760228201896132e3565b905086516133c9818360208b01612916565b632e706e6760e01b910190815270222c2261747472696275746573223a205b60781b60048201528551613403816015840160208a01612916565b8551910190613419816015840160208901612916565b61373c61372f61345f61345961343b601586880101605d60f81b815260010190565b71161130b734b6b0ba34b7b72fbab936111d1160711b815260120190565b88613213565b7f222c226465736372697074696f6e223a202241206d7973746572696f7573206381527f72656174757265206f6620696d6d656e73652073697a6520617070656172732060208201527f696e207468652067616c6178792c20666c6f6174696e67206f7574206f66206e60408201527f6f776865726520616e6420736c6f776c7920617070726f616368696e6720456160608201527f7274682e5c6e53756464656e6c79212041206d6f757468206f70656e65642c2060808201527f616e64207468652045617274682077617320756e65787065637465646c79207360a08201527f77616c6c6f77656420757020696e20616e20696e7374616e742c20656d69747460c08201527f696e6720616e20756e6b6e6f776e206c69676874202d2042414e47212054686560e08201527f205365616c206578706c6f646573215c6e46726f6d207468656e206f6e2c20616101008201527f20706c616e65742066756c6c206f6620736561206f74746572732077617320626101208201527f6f726e202d207468652041726a617665727365215c6e54686520706c616e65746101408201527f206973203735252077617465722c206963652c20616e642067656d732c20616e6101608201527f6420697473206578746572696f722072657461696e73207468652061707065616101808201527f72616e6365206f6620456172746820616e642074686520756e6b6e6f776e20636101a08201527f726561747572652c206265636f6d696e6720612066616e746173746963616c206101c08201527f696c6c7573696f6e2e5c6e546869732067617665207269736520746f207468656101e08201527f20696e6372656469626c79206375746520616e6420756e6971756520616476656102008201527f6e747572657273202d20746865207365616c20636974697a656e732066726f6d6102208201526b1020b93530bb32b939b2971160a11b61024082015261024c0190565b607d60f81b815260010190565b9a9950505050505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161378281601d850160208701612916565b91909101601d0192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906137c29083018461293a565b9695505050505050565b6000602082840312156137de57600080fd5b8151611d0d816128e3565b634e487b7160e01b600052601260045260246000fd5b600061380b82876132e3565b633f62673d60e01b815261382260048201876132e3565b9050652662616c6c3d60d01b815261383d60068201866132e3565b9050632669643d60e01b8152835161385c816004840160208801612916565b016004019695505050505050565b600082613879576138796137e9565b500490565b80820281158282048414176104ec576104ec612eed565b818103818111156104ec576104ec612eed565b634e487b7160e01b600052603160045260246000fd5b7f7b2274726169745f74797065223a20224261636b67726f756e64222c2276616c8152643ab2911d1160d91b602082015260008451613904816025850160208901612916565b61227d60f01b60259184019182018190527f2c7b2274726169745f74797065223a2022456666656374222c2276616c7565226027830152611d1160f11b60478301528551613959816049850160208a01612916565b604992019182018190527f2c7b2274726169745f74797065223a2022426f6479222c2276616c7565223a22604b830152845161399c81606b850160208901612916565b606b920191820152606d0195945050505050565b7f2c7b2274726169745f74797065223a20224465636f726174696f6e222c227661815265363ab2911d1160d11b6020820152600084516139f7816026850160208901612916565b61227d60f01b60269184019182018190527f2c7b2274726169745f74797065223a202245796573222c2276616c7565223a2260288301528551613a41816048850160208a01612916565b604892019182018190527f2c7b2274726169745f74797065223a202242616c6c222c2276616c7565223a22604a8301528451613a8481606a850160208901612916565b606a920191820152606c0195945050505050565b600082613aa757613aa76137e9565b50069056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122015574526dfdf320e514cd11177f49885470c1bc0fc3d8d579e8e75dec95bfa7464736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca00000000000000000000000029d95c0cf0ee4546e369eddc62df23df449ee9f8
-----Decoded View---------------
Arg [0] : _vrfCoordinator (address): 0x271682DEB8C4E0901D1a1550aD2e64D568E69909
Arg [1] : _link (address): 0x514910771AF9Ca656af840dff83E8264EcF986CA
Arg [2] : _verifier (address): 0x29d95c0cF0eE4546E369eDdC62DF23Df449ee9F8
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Arg [1] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [2] : 00000000000000000000000029d95c0cf0ee4546e369eddc62df23df449ee9f8
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.