ERC-1155
Overview
Max Total Supply
1,000 FLORA
Holders
228
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
VenusianFloraTheFirstGeneration
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // // . // ▌╝╨╨╨╨╙╙╩╙¬╙╙╙╙╙╙"""""^¬╙╙╙╨╙╨╜▀▀▀▀╝╝╝╝╝╝╝▀▀▀▀▀╩▀ΓΓΣÑÑÑÑÑ▀▀▀▀▀▀▀▀▀▀▀▀▀▀╟ // ▌▌ ^. j▐ // ▌▌ ╔▒ ≈╖ ,@⌐ j▐ // ▌b « ,▓╠ ;,"▌-, ╔╬" "▐⌐ // .▌▌ ╚╦ -╔,`, ╓▄"╬╬▒╠▀▓╫▓Æ╣▓, " -▐⌐ // ▌Γ ╙╣▓ ╓╗ ╙╬▓▌' ^╨∩╬╬╫ ║▓ ∩≈¬.,▄,▐▒ ▄, ▐ . . // ╫Γ ╙ ╙▒╙▓▓ⁿQφ╟╬╟▓╝╬▌ ▓▌]░∩,ⁿ"│@╬▀╔▓▀m ╗▄ . ▒░. ' // ╫▌ ╠▀½╠╣▀╩\╚▒╠▒╔▄╙╬▓▓▓║░▒^ ╔▓"╙@▓▓╩ ~ ▒▒` // ╫▌ . `ⁿ, ╣╬ε╠Ç╬╬╬╠╬╟▐▓╬▀▀╬╩╢╬╬╬▓"Σ▀╬ ▓⌐[ ▒▒ // ╫▌ --╚╝╬╦▓▓▄╣▒╢▓╣╚╙╙""~╝▓╢╠≥"╚║╩╬╩ ╓╣▓▌/ ,▄[ '▒⌐ // ~∩~╫▌ ,-~~╫╙╝╣╣∩╚╣▄╙╫╣╠╠╬▒ , ╒╠ ╠╩ ╓@╬▒,,[ ╗▄╩ ▒⌐ // ╫▌ ╣▓╝╬╬╗╬▌║▒▄, `╙` `.Γ╙]µε╩░>/«δ╬ ╬╬▓╬φ░▄▓▓Θ╟▀ ⁿ ▒⌐ // ╠Γ »╓▌▓╠▄ç"╙╚▒░╙╙╠╜╔▒g╖╖æ\┐φφφQ╔`δ░ φ╠▒╬▓╬▀` ,╠╝╬⌐ , ▒ // ╡Γ ▓╬╬╠╫▒▒▒▒▒╬╬╬╙⌠╨╙.~░"└≥▒╠╫▓▒"-φ-,δ╬Γ▓▓╩ ,Γ▐▓▓▌▄▓▓ j⌐ // ▌Γ '╙▓▓▓▓▓▓▓▓╬▒╢╩", ╓M.>╚╝╩╩w=░"╙│╩,╢╩╠▄▄▄▄╠╚╝▌¬" ▐ // ▌▌ ╓╬▒╢╩╜╙╙╝╬φ ▒╠▒"≤∩ε\7]▒≥\≥╔φ╗╣╣▓╬╬╙"""²,▀╜ , ▐ // ▌▌ ┌╣╩╠╩╔▒╠╬▓▓▒▒µ╬╩▒ ▒ { ╠╦»╬╝╢▓╬▓╬╩╚╫▄½╗▄'-`│▄▓ "- ]▐ // ^ ▌▌ *╠[ .»╚╙╝╩╠╬▓╨▒╝╓╚╬#Åδ╗▄╗╗▄▒╙╬╬╣▓╣▄╣▓▄▀╘ ╣╬▌╟▓,,▄ j▐ // ▌▌ . «φ╠╢╩«`.-╔▄#░φ¼██╬╩ "╬╗║╠╠║╬▓╬█▓▓▓▄╚╬▒╗╦░╙▀▓▓▌╠▒Å╩╬╣╣▓ j╫ // .▌▌' ╓▒╬╝╩│ -,ⁿ╗▓╬╙;╙▀╠╠╬╙ ║╣╦╟▓▓╬╠╬▌╚╬╬╫▓╬ ╠╝╙║╣╩░▐╟██▌ ;╠╬▓▀ ▐╫ ⌐ // '▌▌ `≈╝▓▓▓εφ▓╬▄▓▓╩ ;╠╬╠j╝[╠╩╬╙▒└╬╠╬▓ ░]║▓▒╣╣╙╙ ▄▄▄╣╝╨ ▐╫ { // . ▌▒. ' å▓▀╙▀▄╙,'▐╬▓Γ""[ ╙╠ : ╓╬▒▓▓▒╟▒Γ║▒╠▒▒▒╬╙▄▓▄▄▄╫╬▒╥ ▐╫ ` ' // '▌▒ - ▀` ╨Γ└ ⌐┘ ╫▓ "▓N╝▓▓╣╬▓▓ε╬▌ ⌐╚▀ "▀░╙▒╫▒░║╣⌐ ▐╫ // ' ▌▒ ░. ' Γ,▒╣▓▓▓⌐ ╫▓▓╬▓▌ Lⁿ- ║▌▌░║░╣ ▐╟ // ]▌▒ .' ⁿ└╙╒╬ ≡▄▓╫▓╬▌ \ j╣╜ ▐╫ // ' '"▌⌐~.. [ ╙M▓▓╬╣ ' ▐╫ // "` j▒░ ` ╙╬╠╠╬▌ ╞╫ // .▒░,-. └"╫█╬╠▓ ╞╫ // j▒"░'"'. ▄╬▓▓▒▓ ╞▌ // .jj. ' ~ ╚╝╬╬╦ │▌ // ▐▒' `╙╬ │▌ // .-▐╣¡ ~. ..╓--. å╠▒,` Θ= ╡▌' // ;~-▐╣.` .MG▄æ╩≈"V" ,φ▒φ╠▒▒Å╙Q"ªΣ=,.≡`¬ⁿ«¬ ╡▌ // ~ ▐▐~ ,.-ⁿ ╓∩^,-"-^-"╓∩╠▒]▒╠▒▒╚ε`/Ç->,"`≈▒╙Θ--¬ ╠▌ // . ▐▀ ¬ⁿε╙╙A¬,"╓∩,~δφ▒φ"╬Γ▐▒╠║Ç╠▒Θ╙▒≥╓"≈`╙WΣ,╖, ╠▌ // . j▒" !,▒Φ░╩^╚╛^▒╬╠╠╠µ╣▐ ╠╬╠╠╠╠▒╚╠╦▒ç`╦╠╦îJ⌐ ╞▌ // '' j▒ "'╙░≈╔Θ/3╠╬╠7▒╩▒╠╝╩╠╢d╬╠║╬░╠▒╚"▒╬╙ⁿ ╞▓ // ..j▒ ¬╙▒╠░╙φ▒║▒▐╙░@╠╢╗╬╬╬╬╠▒╠╠δ▒▒╠⌐¬ ╞╫ // ▒⌐ `≈"╠▒M╬▒╠╫░#╠╣╠╬╬╚╙φε╘╙░%╝╙╚` ▐╫ // "▌ ┌Γ,δ ╩╠▒╠½╠M▒░│δ└`φε`░ ▐╟ // ' ▌⌐ , '` `' ^⌐╙ ╙¬╜² '= ▐╟ // ▌▄▄Jw-w-w--══╖═══╖≈---------▄▄▄▄▄▄▄▄▄▄▄,,,,,,,,, (, ,,,,,,,,,▐╟ // └╙ ╙ └ └╙╙╙╙╙╙╙╙╙````````````╙"╙▀``▀``╙`╙`╙ ╙╙ ` // . // // ▄═╗▄m╗╕▓█▌ ═▄▄══▄▀█▌ ▄▄ÆW▄ j█▌ ▐█▌ // ╙ ╫█▌ └╟█▌Æ█▄ ▄▓▀█µ ██ ▄└▐█▌ ▄█▀▄,%█▌'██ ¥∩▄█▀▓,▄▓▄▓█ ██─ ╙ ▄▄▌a▄█▄█▐█▌,▄▀%▄ // ╫█▌ ╟█▌j██▐██▀▀▀ ██¬▀ ▐█▌╟█▌ ██ ██▄╙█▄▌▐██▀▀▀╞█▌ ██⌐╙██▀▐█▌ ██ ▐█▌╙████ // *╝▀▀⌐ ╝▀▀ª▀▀ ╙▀▀▀└ ═▀▀═ ╝▀▀ ▀▀4▀└ ▀┘ ╚▀ ╙▀▀▀─╧▀▀⌐ ╙▀W╝▀ ╝▀▀∞▀▀═ ╝▀▀╜▀═╝▀ // // Venusian Flora created by Ryan Meyers @sreyeMnayR for The Flower Girls // Twitter: @FlowerGirlsNFT Web: https://flowergirlsnft.com // // // Generosity attracts generosity. // // The world will be saved by beauty. // // // ERC-1155 Venusian Flora: The First Generation // pragma solidity ^0.8.17; import "ERC1155_VF.sol"; /** * @dev ERC1155 token representing plantable flora for * Venusian Gardens which may be claimed, purchased, * or airdropped */ contract VenusianFloraTheFirstGeneration is ERC1155VF { // Claim keys include single-use uint claimIds mapping(uint => bool) private _claimed; // Flora info in a nice packed struct mapping(uint => FloraData) private _flora; // Mapping determining the date a given flora was planted by a gardener. mapping(address => mapping(uint=>uint)) private _planted; // Auto-increment tokenIds when new Flora are created uint public nextTokenId = 0; constructor( string memory uri_, string memory name_, string memory version_, address signer_, address bank_, address garden_ ) ERC1155VF(uri_, name_, version_, signer_, bank_, garden_) {} /** * @dev Creates a new Flora species * @param maxSupply The maximum number of this species available (0=Unlimited) * @param price If being sold for ETH, the ETH price in wei. * @param forSale Boolean indicating whether the Flora may be purchased for ETH * @param soulbound Boolean indicating whether a particular Flora is soulbound. * @notice A new Flora with tokenId `nextTokenId` will be created. */ function createFlora( string calldata uri, uint16 maxSupply, uint64 price, bool forSale, bool soulbound ) public onlyOwner { _flora[nextTokenId] = FloraData( maxSupply, 0, 0, price, forSale, soulbound, 0 ); _setURI(nextTokenId, uri); nextTokenId += 1; } /** * @dev Sets the maxSupply of Flora to its current minted number. * @param tokenId The tokenId of the Flora to retire * @notice The Flora #`tokenId` will be retired. */ function makeFloraUnavailable( uint tokenId ) public onlyOwner { _flora[tokenId].maxSupply = _flora[tokenId].minted; } /** * @dev Sets the price of a Flora * @param tokenId The tokenId of the Flora to adjust * @param price The new price of the Flora. * @notice The Flora #`tokenId` will be set to price `price`. */ function setFloraPrice( uint tokenId, uint64 price ) public onlyOwner { FloraData storage flora = _flora[tokenId]; flora.price = price; if (flora.price > 0){ flora.forSale = true; } else { flora.forSale = false; } } /** * @dev Claim a Flora with a signed key. (typically via seed store purchase) * @param signature The signed message provided by FGs web interface * @param key The struct of data representing the {ClaimKey} * @notice The Flora #`key.tokenId` claimed by `key.wallet`. */ function claim( bytes calldata signature, ClaimKey calldata key ) public { if (msg.sender != key.wallet) revert WalletNotSender(); if (!checkClaim(signature, key)) revert InvalidClaimKey(); if (_claimed[key.claimId]) revert AlreadyClaimed(); if (_flora[key.tokenId].maxSupply > 0) { if (!((_flora[key.tokenId].minted + key.amount) <= _flora[key.tokenId].maxSupply )) revert NotEnoughTokens(); } _mint(msg.sender, key.tokenId, key.amount, bytes("")); } /** * @dev Purchase a Flora for ETH. * @param tokenId The tokenId of the Flora being purchased * @param amount The number of Flora to purchase * @notice `amount` of Flora #`tokenId` will be purchased for ETH. */ function purchase( uint tokenId, uint amount ) public payable { if (!_flora[tokenId].forSale) revert NotForSale(); if (!(msg.value >= (uint256(_flora[tokenId].price) * amount))) revert NotEnoughEth(); if (_flora[tokenId].maxSupply > 0) { if (!((_flora[tokenId].minted + amount) <= _flora[tokenId].maxSupply )) revert NotEnoughTokens(); } _mint(msg.sender, tokenId, amount, bytes("")); } function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal override { uint howMany = ids.length; for(uint i = 0; i < howMany; i++){ FloraData storage flora = _flora[ids[i]]; if (from == address(0)){ flora.minted+=uint16(amounts[i]); flora.supply+=uint16(amounts[i]); } else { uint planted = _planted[from][ids[i]]; if (to == address(0)){ // We're burning... if (balanceOf(from, ids[i]) == 1) { if (uintToBool(planted)) { // If only own one and it's planted, remove it from planted and decrement flora data. emit PlantedFloraBurned(from, ids[i]); delete _planted[from][ids[i]]; flora.planted -= 1; } } flora.supply-=uint16(amounts[i]); } else { /* Can't transfer planted flora */ if ((balanceOf(from, ids[i]) - uintToZeroOrOne(planted)) < amounts[i]) revert NotEnoughAvailable(); /* Can't transfer soulbound flora */ if(flora.soulbound) revert CannotTransferSoulbound(); } } } // Call the super method, which importantly includes a call to the Venusian Garden contract (if it exists) super._beforeTokenTransfer(operator, to, from, ids, amounts, data); } /*************************************************************** * For flora to display in the dynamic Venusian garden, * it must be planted. Planted flora cannot be transferred. * This is a one-way ticket - the only way to "unplant" is to burn! ***************************************************************/ /** * @dev Plant Flora in your Venusian Garden * @param tokenId The tokenId of the Flora being planted * @notice Flora #`tokenId` will be planted and become soulbound. */ function plantFlora( uint256 tokenId ) public { if ((balanceOf(msg.sender, tokenId) - uintToZeroOrOne(_planted[msg.sender][tokenId])) < 1) revert NotEnoughAvailable(); _planted[msg.sender][tokenId] = block.timestamp; _flora[tokenId].planted += 1; emit FloraPlanted(msg.sender, tokenId, block.timestamp); } /* * THESE ARE ALL UTILITY FUNCTIONS TO BE * USED OFF-CHAIN * DO NOT USE ON-CHAIN - it will be hella expensive */ /** * @dev Retrieve a given gardener's planted Flora * @param gardener The address of a gardener planting the Flora */ function plantedFloraByGardener( address gardener ) public view returns(uint[] memory, FloraData[] memory) { uint[] memory planted = new uint[](nextTokenId); FloraData[] memory plantedFlora = new FloraData[](nextTokenId); for(uint i = 0; i < nextTokenId; i++){ planted[i] = _planted[gardener][i]; plantedFlora[i] = _flora[i]; } return (planted, plantedFlora); } /** * @dev Retrieve all data for a given Flora * @param tokenId The address of a gardener planting the Flora */ function floraData( uint tokenId ) public view returns(FloraData memory) { return _flora[tokenId]; } /** * @dev Retrieve data for all Flora */ function floraDataAll() public view returns(FloraData[] memory) { FloraData[] memory allFlora = new FloraData[](nextTokenId); for(uint i = 0; i < nextTokenId; i++){ allFlora[i] = _flora[i]; } return allFlora; } }
// SPDX-License-Identifier: MIT // // , // ,▓ ,╓╗#▓▓▓╬╬╗@╦ , // ██⌐ ,╔▓▓╣╬▓▓╬╬╬╬╣╬╬▓▒ ▄██ // ▐██▌ ╔╬@╬╣▓▓╬╣▓▓▓╬╣╬╬╣▓▓╬▌ ▓███ // ▐███ ╔╬╬╬╬╬╣▓▓╣▓▓▓╬▓▓▓▓╣▓▓▓╬╬ ▄████ // ███▓ ╒╣╣╬╬╬╬╬╣█╣▓▓▓╬▓▓╣▓╣▓▓▓▓▓▌ █████ // ╙████ @╣╬╬╬╬╬╬╣▓▓▓▓▓▓▓▓╣█▓▓▓▓▓▓▌ ▄▓████▀ // ╟████▄ "╗, ▓╬╬╬╬╬╬╬╣▓█▓█▓▓▓▓▓█▓▓▓▓▓▓▀ ▄██████` // ▀████▓ ╙▀▄ ,▓▓▓▓▓▓▓╬╬█▓█▓█▓▓▓██▓▓▓█▓╙ ,▄▓██████▀ // ╙█████▓, ╙█▓╬╬╣▓╬▓█▓╬███▓█▓██▓▓██▀ ,▄████████╨ // ,╔εσφφφφφMεε╦▓▓█████▄ ╫▓╬╬╬╣╣█▓█▓▓▓▓███████▀ ▄▓█████████▀ // @╬╬▓φφφφφφφ░░░░░░╙╙╚╚╩╬╬╬▀╗, ╣▓╬╣╣╬▓▓▓╬╬╬╬╬╬╬▀▀▀╬╔≡▀▓▓███████▀▀ // └╫╬╬▒φφφφφ╦φφφ░░▒▒▒╠╬▓▒╚φ▒▒▒╠▓▓╣╬╬╬╣╣▓▓╨╚╬▒░░φ╣╬▌φ╦╦▒░░╙╙╚╙╚╩▒▒▒δφφ≥╔╓, // ╘╬╬╬▒░░░φφφφφφ╗╣╬▒▒╩╠▒╣▒▒╬╬▓▓╬╬╠╠╬╣▓▓▓▒φδ▓▓▒φ░░░░▒╗▄φ░╙╙╚╚#φφφ░;░░░░╙╚╬╬▓ε // ║╬╬▄φφφφ5░╙╫╬▒▄╗▒φ░▒▒▒▓▓╬╬╠╠╠╬╣╬▓▓▌5φ╙╚▒╙╚▒▒╩╢╩╚φφ░░╙╙êφφφ░░╙╚╚▒▒╣╬▀╨ // └╣╬╬"`"╚▒▒φ▒╙╙╠╫╬╦φê░╫▓╬╬╬╬╠╬╬╬╬▓▓▌╚φ╣▓▒░░╙╣▒φ╦▒5φ╥░╙Σφ╦░░░░▒▒╣▒╣╬╝ // ║╬╣▌▒▒░░φφδ░▒▓▓╬╬╬╬╬╬╬╣╬▓▓▌░φ░╙φ░╙δφ░╚╚╠▒▒╦▒╙Σ╦▄▒╚╣▓╣╝╝╨ // ╝╬╣╣╬╣▒╩╣╣▓╣╬╬╬╬╣╣╬╬╣▓▓▓▓▄╬▒▒▄░▒▒░╟╣▒╚╚╣╬╬"╣╬╣ ╙ // ╙ ╟▓╬╬╬╬╬╣╣╬▓▓████╜ ╙╝⌐└╙ ╙▀▀ └▀╜ // ▀███▓▓▓███████╨└ // ╙██████████ // m▓▓ └ └ ╙▄ // `Å▐ j█▀≈ // // ▄═╗▄m╗╕▓█▌ ═▄▄══▄▀█▌ ▄▄ÆW▄ j█▌ ▐█▌ // ╙ ╫█▌ └╟█▌Æ█▄ ▄▓▀█µ ██ ▄└▐█▌ ▄█▀▄,%█▌'██ ¥∩▄█▀▓,▄▓▄▓█ ██─ ╙ ▄▄▌a▄█▄█▐█▌,▄▀%▄ // ╫█▌ ╟█▌j██▐██▀▀▀ ██¬▀ ▐█▌╟█▌ ██ ██▄╙█▄▌▐██▀▀▀╞█▌ ██⌐╙██▀▐█▌ ██ ▐█▌╙████ // *╝▀▀⌐ ╝▀▀ª▀▀ ╙▀▀▀└ ═▀▀═ ╝▀▀ ▀▀4▀└ ▀┘ ╚▀ ╙▀▀▀─╧▀▀⌐ ╙▀W╝▀ ╝▀▀∞▀▀═ ╝▀▀╜▀═╝▀ // // Venusian Flora created by Ryan Meyers @sreyeMnayR for The Flower Girls // Twitter: @FlowerGirlsNFT Web: https://flowergirlsnft.com // // // Generosity attracts generosity. // // The world will be saved by beauty. // // // ERC-1155 v2022.6.7 // pragma solidity ^0.8.17; pragma abicoder v2; import "IERC1155Receiver.sol"; import "ERC1155URIStorage.sol"; import "Address.sol"; import "Context.sol"; import "Ownable.sol"; import "ERC2981.sol"; import "ERC165.sol"; import "EIP712.sol"; import "ECDSA.sol"; import "DateTime.sol"; import "RevokableDefaultOperatorFilterer.sol"; import "UpdatableOperatorFilterer.sol"; import "IERC1155_VF.sol"; import "IVenusianGarden_v0.sol"; contract ERC1155VF is IERC1155VF, Context, Ownable, EIP712, ERC2981, ERC1155URIStorage, RevokableDefaultOperatorFilterer { error InvalidClaimKey(); error WalletNotSender(); error NotForSale(); error NotEnoughEth(); error NotEnoughTokens(); error LengthMismatch(); error CannotTransferSoulbound(); error NotEnoughAvailable(); error AlreadyClaimed(); struct FloraData { uint16 maxSupply; // 0 + 16 = 16 uint16 minted; // 16 + 16 = 32 uint16 supply; // 32 + 16 = 48 uint64 price; // 48 + 64 = 112 bool forSale; // 112 + 8 = 120 bool soulbound; // 120 + 8 = 128 uint16 planted; // 128 + 16 = 144 } struct ClaimKey { address wallet; uint tokenId; uint amount; uint claimId; } bytes32 private constant CLAIMKEY_TYPE_HASH = keccak256("ClaimKey(address wallet,uint tokenId,uint amount,uint claimId)"); address private _signer; address private _bank; string public name = "Flower Girls Venusian Flora"; string public symbol = "FLORA"; address public venusianGardenContract; constructor( string memory uri_, string memory name_, string memory version_, address signer_, address bank_, address garden_ ) ERC1155(uri_) EIP712(name_, version_) { _signer = signer_; _bank = bank_; venusianGardenContract = garden_; _setDefaultRoyalty(bank_, 1000); } // Check claim signature/key function checkClaim(bytes calldata signature, ClaimKey calldata key) public view returns (bool) { bytes32 digest = _hashTypedDataV4( keccak256( abi.encode( CLAIMKEY_TYPE_HASH, msg.sender, key.tokenId, key.amount, key.claimId ) ) ); return ECDSA.recover(digest, signature) == _signer; } // Implement burnable methods function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not token owner or approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not token owner or approved" ); _burnBatch(account, ids, values); } function setSigner( address signer_ ) public onlyOwner { _signer = signer_; } function setURI( uint256 tokenId, string memory tokenURI ) public onlyOwner { _setURI(tokenId, tokenURI); } function setBaseURI( string memory baseURI ) public onlyOwner { _setBaseURI(baseURI); } // /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC2981, ERC1155) returns (bool) { return ERC2981.supportsInterface(interfaceId) || ERC1155.supportsInterface(interfaceId) || super.supportsInterface(interfaceId); } // OpenSea bully clause function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function safeTransferFrom(address from, address to, uint256 tokenId, uint256 amount, bytes memory data) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, amount, data); } function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override onlyAllowedOperator(from) { super.safeBatchTransferFrom(from, to, ids, amounts, data); } function owner() public view virtual override (Ownable, UpdatableOperatorFilterer) returns (address) { return Ownable.owner(); } function setDefaultRoyalty(address receiver, uint96 feeNumerator) public onlyOwner { _setDefaultRoyalty(receiver, feeNumerator); } function setBank(address bank_) public onlyOwner { _bank = bank_; } function withdraw() public payable { require(payable(_bank).send(address(this).balance)); } function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal override virtual { if(venusianGardenContract != address(0)){ IVenusianGarden(venusianGardenContract).respondToPlantTransfers(address(this), operator, from, to, ids, amounts, data); } } function boolToUint(bool x) public pure returns (uint r) { assembly { r := x } } function uintToBool(uint x) public pure returns (bool r) { assembly { r := gt(x,0) } } function uintToZeroOrOne(uint x) public pure returns (uint r) { r = boolToUint(uintToBool(x)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155URIStorage.sol) pragma solidity ^0.8.0; import "Strings.sol"; import "ERC1155.sol"; /** * @dev ERC1155 token with storage based token URI management. * Inspired by the ERC721URIStorage extension * * _Available since v4.6._ */ abstract contract ERC1155URIStorage is ERC1155 { using Strings for uint256; // Optional base URI string private _baseURI = ""; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the concatenation of the `_baseURI` * and the token-specific uri if the latter is set * * This enables the following behaviors: * * - if `_tokenURIs[tokenId]` is set, then the result is the concatenation * of `_baseURI` and `_tokenURIs[tokenId]` (keep in mind that `_baseURI` * is empty per default); * * - if `_tokenURIs[tokenId]` is NOT set then we fallback to `super.uri()` * which in most cases will contain `ERC1155._uri`; * * - if `_tokenURIs[tokenId]` is NOT set, and if the parents do not have a * uri value set, then the result is empty. */ function uri(uint256 tokenId) public view virtual override returns (string memory) { string memory tokenURI = _tokenURIs[tokenId]; // If token URI is set, concatenate base URI and tokenURI (via abi.encodePacked). return bytes(tokenURI).length > 0 ? string(abi.encodePacked(_baseURI, tokenURI)) : super.uri(tokenId); } /** * @dev Sets `tokenURI` as the tokenURI of `tokenId`. */ function _setURI(uint256 tokenId, string memory tokenURI) internal virtual { _tokenURIs[tokenId] = tokenURI; emit URI(uri(tokenId), tokenId); } /** * @dev Sets `baseURI` as the `_baseURI` for all tokens */ function _setBaseURI(string memory baseURI) internal virtual { _baseURI = baseURI; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "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.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "IERC1155.sol"; import "IERC1155Receiver.sol"; import "IERC1155MetadataURI.sol"; import "Address.sol"; import "Context.sol"; import "ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @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, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// 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 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "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.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "IERC2981.sol"; import "ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol) pragma solidity ^0.8.0; import "ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // ---------------------------------------------------------------------------- // DateTime Library v2.0 // // A gas-efficient Solidity date and time library // // https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary // // Tested date range 1970/01/01 to 2345/12/31 // // Conventions: // Unit | Range | Notes // :-------- |:-------------:|:----- // timestamp | >= 0 | Unix timestamp, number of seconds since 1970/01/01 00:00:00 UTC // year | 1970 ... 2345 | // month | 1 ... 12 | // day | 1 ... 31 | // hour | 0 ... 23 | // minute | 0 ... 59 | // second | 0 ... 59 | // dayOfWeek | 1 ... 7 | 1 = Monday, ..., 7 = Sunday // // // Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd 2018-2019. The MIT Licence. // ---------------------------------------------------------------------------- library DateTime { uint256 constant SECONDS_PER_DAY = 24 * 60 * 60; uint256 constant SECONDS_PER_HOUR = 60 * 60; uint256 constant SECONDS_PER_MINUTE = 60; int256 constant OFFSET19700101 = 2440588; uint256 constant DOW_MON = 1; uint256 constant DOW_TUE = 2; uint256 constant DOW_WED = 3; uint256 constant DOW_THU = 4; uint256 constant DOW_FRI = 5; uint256 constant DOW_SAT = 6; uint256 constant DOW_SUN = 7; // ------------------------------------------------------------------------ // Calculate the number of days from 1970/01/01 to year/month/day using // the date conversion algorithm from // http://aa.usno.navy.mil/faq/docs/JD_Formula.php // and subtracting the offset 2440588 so that 1970/01/01 is day 0 // // days = day // - 32075 // + 1461 * (year + 4800 + (month - 14) / 12) / 4 // + 367 * (month - 2 - (month - 14) / 12 * 12) / 12 // - 3 * ((year + 4900 + (month - 14) / 12) / 100) / 4 // - offset // ------------------------------------------------------------------------ function _daysFromDate(uint256 year, uint256 month, uint256 day) internal pure returns (uint256 _days) { require(year >= 1970); int256 _year = int256(year); int256 _month = int256(month); int256 _day = int256(day); int256 __days = _day - 32075 + (1461 * (_year + 4800 + (_month - 14) / 12)) / 4 + (367 * (_month - 2 - ((_month - 14) / 12) * 12)) / 12 - (3 * ((_year + 4900 + (_month - 14) / 12) / 100)) / 4 - OFFSET19700101; _days = uint256(__days); } // ------------------------------------------------------------------------ // Calculate year/month/day from the number of days since 1970/01/01 using // the date conversion algorithm from // http://aa.usno.navy.mil/faq/docs/JD_Formula.php // and adding the offset 2440588 so that 1970/01/01 is day 0 // // int L = days + 68569 + offset // int N = 4 * L / 146097 // L = L - (146097 * N + 3) / 4 // year = 4000 * (L + 1) / 1461001 // L = L - 1461 * year / 4 + 31 // month = 80 * L / 2447 // dd = L - 2447 * month / 80 // L = month / 11 // month = month + 2 - 12 * L // year = 100 * (N - 49) + year + L // ------------------------------------------------------------------------ function _daysToDate(uint256 _days) internal pure returns (uint256 year, uint256 month, uint256 day) { unchecked { int256 __days = int256(_days); int256 L = __days + 68569 + OFFSET19700101; int256 N = (4 * L) / 146097; L = L - (146097 * N + 3) / 4; int256 _year = (4000 * (L + 1)) / 1461001; L = L - (1461 * _year) / 4 + 31; int256 _month = (80 * L) / 2447; int256 _day = L - (2447 * _month) / 80; L = _month / 11; _month = _month + 2 - 12 * L; _year = 100 * (N - 49) + _year + L; year = uint256(_year); month = uint256(_month); day = uint256(_day); } } function timestampFromDate(uint256 year, uint256 month, uint256 day) internal pure returns (uint256 timestamp) { timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY; } function timestampFromDateTime( uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second ) internal pure returns (uint256 timestamp) { timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + hour * SECONDS_PER_HOUR + minute * SECONDS_PER_MINUTE + second; } function timestampToDate(uint256 timestamp) internal pure returns (uint256 year, uint256 month, uint256 day) { unchecked { (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); } } function timestampToDateTime(uint256 timestamp) internal pure returns (uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second) { unchecked { (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); uint256 secs = timestamp % SECONDS_PER_DAY; hour = secs / SECONDS_PER_HOUR; secs = secs % SECONDS_PER_HOUR; minute = secs / SECONDS_PER_MINUTE; second = secs % SECONDS_PER_MINUTE; } } function isValidDate(uint256 year, uint256 month, uint256 day) internal pure returns (bool valid) { if (year >= 1970 && month > 0 && month <= 12) { uint256 daysInMonth = _getDaysInMonth(year, month); if (day > 0 && day <= daysInMonth) { valid = true; } } } function isValidDateTime(uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second) internal pure returns (bool valid) { if (isValidDate(year, month, day)) { if (hour < 24 && minute < 60 && second < 60) { valid = true; } } } function isLeapYear(uint256 timestamp) internal pure returns (bool leapYear) { (uint256 year,,) = _daysToDate(timestamp / SECONDS_PER_DAY); leapYear = _isLeapYear(year); } function _isLeapYear(uint256 year) internal pure returns (bool leapYear) { leapYear = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); } function isWeekDay(uint256 timestamp) internal pure returns (bool weekDay) { weekDay = getDayOfWeek(timestamp) <= DOW_FRI; } function isWeekEnd(uint256 timestamp) internal pure returns (bool weekEnd) { weekEnd = getDayOfWeek(timestamp) >= DOW_SAT; } function getDaysInMonth(uint256 timestamp) internal pure returns (uint256 daysInMonth) { (uint256 year, uint256 month,) = _daysToDate(timestamp / SECONDS_PER_DAY); daysInMonth = _getDaysInMonth(year, month); } function _getDaysInMonth(uint256 year, uint256 month) internal pure returns (uint256 daysInMonth) { if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) { daysInMonth = 31; } else if (month != 2) { daysInMonth = 30; } else { daysInMonth = _isLeapYear(year) ? 29 : 28; } } // 1 = Monday, 7 = Sunday function getDayOfWeek(uint256 timestamp) internal pure returns (uint256 dayOfWeek) { uint256 _days = timestamp / SECONDS_PER_DAY; dayOfWeek = ((_days + 3) % 7) + 1; } function getYear(uint256 timestamp) internal pure returns (uint256 year) { (year,,) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getMonth(uint256 timestamp) internal pure returns (uint256 month) { (, month,) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getDay(uint256 timestamp) internal pure returns (uint256 day) { (,, day) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getHour(uint256 timestamp) internal pure returns (uint256 hour) { uint256 secs = timestamp % SECONDS_PER_DAY; hour = secs / SECONDS_PER_HOUR; } function getMinute(uint256 timestamp) internal pure returns (uint256 minute) { uint256 secs = timestamp % SECONDS_PER_HOUR; minute = secs / SECONDS_PER_MINUTE; } function getSecond(uint256 timestamp) internal pure returns (uint256 second) { second = timestamp % SECONDS_PER_MINUTE; } function addYears(uint256 timestamp, uint256 _years) internal pure returns (uint256 newTimestamp) { (uint256 year, uint256 month, uint256 day) = _daysToDate(timestamp / SECONDS_PER_DAY); year += _years; uint256 daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp >= timestamp); } function addMonths(uint256 timestamp, uint256 _months) internal pure returns (uint256 newTimestamp) { (uint256 year, uint256 month, uint256 day) = _daysToDate(timestamp / SECONDS_PER_DAY); month += _months; year += (month - 1) / 12; month = ((month - 1) % 12) + 1; uint256 daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp >= timestamp); } function addDays(uint256 timestamp, uint256 _days) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp + _days * SECONDS_PER_DAY; require(newTimestamp >= timestamp); } function addHours(uint256 timestamp, uint256 _hours) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp + _hours * SECONDS_PER_HOUR; require(newTimestamp >= timestamp); } function addMinutes(uint256 timestamp, uint256 _minutes) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp + _minutes * SECONDS_PER_MINUTE; require(newTimestamp >= timestamp); } function addSeconds(uint256 timestamp, uint256 _seconds) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp + _seconds; require(newTimestamp >= timestamp); } function subYears(uint256 timestamp, uint256 _years) internal pure returns (uint256 newTimestamp) { (uint256 year, uint256 month, uint256 day) = _daysToDate(timestamp / SECONDS_PER_DAY); year -= _years; uint256 daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp <= timestamp); } function subMonths(uint256 timestamp, uint256 _months) internal pure returns (uint256 newTimestamp) { (uint256 year, uint256 month, uint256 day) = _daysToDate(timestamp / SECONDS_PER_DAY); uint256 yearMonth = year * 12 + (month - 1) - _months; year = yearMonth / 12; month = (yearMonth % 12) + 1; uint256 daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp <= timestamp); } function subDays(uint256 timestamp, uint256 _days) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp - _days * SECONDS_PER_DAY; require(newTimestamp <= timestamp); } function subHours(uint256 timestamp, uint256 _hours) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp - _hours * SECONDS_PER_HOUR; require(newTimestamp <= timestamp); } function subMinutes(uint256 timestamp, uint256 _minutes) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp - _minutes * SECONDS_PER_MINUTE; require(newTimestamp <= timestamp); } function subSeconds(uint256 timestamp, uint256 _seconds) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp - _seconds; require(newTimestamp <= timestamp); } function diffYears(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _years) { require(fromTimestamp <= toTimestamp); (uint256 fromYear,,) = _daysToDate(fromTimestamp / SECONDS_PER_DAY); (uint256 toYear,,) = _daysToDate(toTimestamp / SECONDS_PER_DAY); _years = toYear - fromYear; } function diffMonths(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _months) { require(fromTimestamp <= toTimestamp); (uint256 fromYear, uint256 fromMonth,) = _daysToDate(fromTimestamp / SECONDS_PER_DAY); (uint256 toYear, uint256 toMonth,) = _daysToDate(toTimestamp / SECONDS_PER_DAY); _months = toYear * 12 + toMonth - fromYear * 12 - fromMonth; } function diffDays(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _days) { require(fromTimestamp <= toTimestamp); _days = (toTimestamp - fromTimestamp) / SECONDS_PER_DAY; } function diffHours(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _hours) { require(fromTimestamp <= toTimestamp); _hours = (toTimestamp - fromTimestamp) / SECONDS_PER_HOUR; } function diffMinutes(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _minutes) { require(fromTimestamp <= toTimestamp); _minutes = (toTimestamp - fromTimestamp) / SECONDS_PER_MINUTE; } function diffSeconds(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _seconds) { require(fromTimestamp <= toTimestamp); _seconds = toTimestamp - fromTimestamp; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {RevokableOperatorFilterer} from "RevokableOperatorFilterer.sol"; /** * @title RevokableDefaultOperatorFilterer * @notice Inherits from RevokableOperatorFilterer and automatically subscribes to the default OpenSea subscription. * Note that OpenSea will disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. */ abstract contract RevokableDefaultOperatorFilterer is RevokableOperatorFilterer { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); constructor() RevokableOperatorFilterer(0x000000000000AAeB6D7670E522A718067333cd4E, DEFAULT_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {UpdatableOperatorFilterer} from "UpdatableOperatorFilterer.sol"; import {IOperatorFilterRegistry} from "IOperatorFilterRegistry.sol"; /** * @title RevokableOperatorFilterer * @notice This contract is meant to allow contracts to permanently skip OperatorFilterRegistry checks if desired. The * Registry itself has an "unregister" function, but if the contract is ownable, the owner can re-register at * any point. As implemented, this abstract contract allows the contract owner to permanently skip the * OperatorFilterRegistry checks by calling revokeOperatorFilterRegistry. Once done, the registry * address cannot be further updated. * Note that OpenSea will still disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. */ abstract contract RevokableOperatorFilterer is UpdatableOperatorFilterer { error RegistryHasBeenRevoked(); error InitialRegistryAddressCannotBeZeroAddress(); bool public isOperatorFilterRegistryRevoked; constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) UpdatableOperatorFilterer(_registry, subscriptionOrRegistrantToCopy, subscribe) { // don't allow creating a contract with a permanently revoked registry if (_registry == address(0)) { revert InitialRegistryAddressCannotBeZeroAddress(); } } function _checkFilterOperator(address operator) internal view virtual override { if (address(operatorFilterRegistry) != address(0)) { super._checkFilterOperator(operator); } } /** * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero * address, checks will be permanently bypassed, and the address cannot be updated again. OnlyOwner. */ function updateOperatorFilterRegistryAddress(address newRegistry) public override { if (msg.sender != owner()) { revert OnlyOwner(); } // if registry has been revoked, do not allow further updates if (isOperatorFilterRegistryRevoked) { revert RegistryHasBeenRevoked(); } operatorFilterRegistry = IOperatorFilterRegistry(newRegistry); } /** * @notice Revoke the OperatorFilterRegistry address, permanently bypassing checks. OnlyOwner. */ function revokeOperatorFilterRegistry() public { if (msg.sender != owner()) { revert OnlyOwner(); } // if registry has been revoked, do not allow further updates if (isOperatorFilterRegistryRevoked) { revert RegistryHasBeenRevoked(); } // set to zero address to bypass checks operatorFilterRegistry = IOperatorFilterRegistry(address(0)); isOperatorFilterRegistryRevoked = true; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "IOperatorFilterRegistry.sol"; /** * @title UpdatableOperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. This contract allows the Owner to update the * OperatorFilterRegistry address via updateOperatorFilterRegistryAddress, including to the zero address, * which will bypass registry checks. * Note that OpenSea will still disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. */ abstract contract UpdatableOperatorFilterer { error OperatorNotAllowed(address operator); error OnlyOwner(); IOperatorFilterRegistry public operatorFilterRegistry; constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) { IOperatorFilterRegistry registry = IOperatorFilterRegistry(_registry); operatorFilterRegistry = registry; // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(registry).code.length > 0) { if (subscribe) { registry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { registry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { registry.register(address(this)); } } } } modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } /** * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero * address, checks will be bypassed. OnlyOwner. */ function updateOperatorFilterRegistryAddress(address newRegistry) public virtual { if (msg.sender != owner()) { revert OnlyOwner(); } operatorFilterRegistry = IOperatorFilterRegistry(newRegistry); } /** * @dev assume the contract has an owner, but leave specific Ownable implementation up to inheriting contract */ function owner() public view virtual returns (address); function _checkFilterOperator(address operator) internal view virtual { IOperatorFilterRegistry registry = operatorFilterRegistry; // Check registry code length to facilitate testing in environments without a deployed registry. if (address(registry) != address(0) && address(registry).code.length > 0) { if (!registry.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { function isOperatorAllowed(address registrant, address operator) external view returns (bool); function register(address registrant) external; function registerAndSubscribe(address registrant, address subscription) external; function registerAndCopyEntries(address registrant, address registrantToCopy) external; function unregister(address addr) external; function updateOperator(address registrant, address operator, bool filtered) external; function updateOperators(address registrant, address[] calldata operators, bool filtered) external; function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; function subscribe(address registrant, address registrantToSubscribe) external; function unsubscribe(address registrant, bool copyExistingEntries) external; function subscriptionOf(address addr) external returns (address registrant); function subscribers(address registrant) external returns (address[] memory); function subscriberAt(address registrant, uint256 index) external returns (address); function copyEntriesOf(address registrant, address registrantToCopy) external; function isOperatorFiltered(address registrant, address operator) external returns (bool); function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); function filteredOperators(address addr) external returns (address[] memory); function filteredCodeHashes(address addr) external returns (bytes32[] memory); function filteredOperatorAt(address registrant, uint256 index) external returns (address); function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); function isRegistered(address addr) external returns (bool); function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface IERC1155VF { event FloraPlanted(address indexed who, uint256 id, uint256 date); event PlantedFloraBurned(address indexed who, uint256 id); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface IVenusianGarden { function respondToPlantTransfers( address origin, address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) external; }
{ "evmVersion": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "libraries": { "VenusianFlora.sol": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"uri_","type":"string"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"version_","type":"string"},{"internalType":"address","name":"signer_","type":"address"},{"internalType":"address","name":"bank_","type":"address"},{"internalType":"address","name":"garden_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"CannotTransferSoulbound","type":"error"},{"inputs":[],"name":"InitialRegistryAddressCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"InvalidClaimKey","type":"error"},{"inputs":[],"name":"LengthMismatch","type":"error"},{"inputs":[],"name":"NotEnoughAvailable","type":"error"},{"inputs":[],"name":"NotEnoughEth","type":"error"},{"inputs":[],"name":"NotEnoughTokens","type":"error"},{"inputs":[],"name":"NotForSale","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"RegistryHasBeenRevoked","type":"error"},{"inputs":[],"name":"WalletNotSender","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","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":"who","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"date","type":"uint256"}],"name":"FloraPlanted","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":"who","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"PlantedFloraBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"x","type":"bool"}],"name":"boolToUint","outputs":[{"internalType":"uint256","name":"r","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"},{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"claimId","type":"uint256"}],"internalType":"struct ERC1155VF.ClaimKey","name":"key","type":"tuple"}],"name":"checkClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"},{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"claimId","type":"uint256"}],"internalType":"struct ERC1155VF.ClaimKey","name":"key","type":"tuple"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint16","name":"maxSupply","type":"uint16"},{"internalType":"uint64","name":"price","type":"uint64"},{"internalType":"bool","name":"forSale","type":"bool"},{"internalType":"bool","name":"soulbound","type":"bool"}],"name":"createFlora","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"floraData","outputs":[{"components":[{"internalType":"uint16","name":"maxSupply","type":"uint16"},{"internalType":"uint16","name":"minted","type":"uint16"},{"internalType":"uint16","name":"supply","type":"uint16"},{"internalType":"uint64","name":"price","type":"uint64"},{"internalType":"bool","name":"forSale","type":"bool"},{"internalType":"bool","name":"soulbound","type":"bool"},{"internalType":"uint16","name":"planted","type":"uint16"}],"internalType":"struct ERC1155VF.FloraData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"floraDataAll","outputs":[{"components":[{"internalType":"uint16","name":"maxSupply","type":"uint16"},{"internalType":"uint16","name":"minted","type":"uint16"},{"internalType":"uint16","name":"supply","type":"uint16"},{"internalType":"uint64","name":"price","type":"uint64"},{"internalType":"bool","name":"forSale","type":"bool"},{"internalType":"bool","name":"soulbound","type":"bool"},{"internalType":"uint16","name":"planted","type":"uint16"}],"internalType":"struct ERC1155VF.FloraData[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOperatorFilterRegistryRevoked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"makeFloraUnavailable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorFilterRegistry","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"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":"plantFlora","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"gardener","type":"address"}],"name":"plantedFloraByGardener","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"components":[{"internalType":"uint16","name":"maxSupply","type":"uint16"},{"internalType":"uint16","name":"minted","type":"uint16"},{"internalType":"uint16","name":"supply","type":"uint16"},{"internalType":"uint64","name":"price","type":"uint64"},{"internalType":"bool","name":"forSale","type":"bool"},{"internalType":"bool","name":"soulbound","type":"bool"},{"internalType":"uint16","name":"planted","type":"uint16"}],"internalType":"struct ERC1155VF.FloraData[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"purchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revokeOperatorFilterRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"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":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","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":"uint256","name":"amount","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":"address","name":"bank_","type":"address"}],"name":"setBank","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint64","name":"price","type":"uint64"}],"name":"setFloraPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer_","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"tokenURI","type":"string"}],"name":"setURI","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":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"x","type":"uint256"}],"name":"uintToBool","outputs":[{"internalType":"bool","name":"r","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"x","type":"uint256"}],"name":"uintToZeroOrOne","outputs":[{"internalType":"uint256","name":"r","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"newRegistry","type":"address"}],"name":"updateOperatorFilterRegistryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"venusianGardenContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"}]
Contract Creation Code
61016060405260006101409081526006906200001c90826200056c565b5060408051808201909152601b81527f466c6f776572204769726c732056656e757369616e20466c6f726100000000006020820152600b906200006090826200056c565b50604080518082019091526005815264464c4f524160d81b6020820152600c906200008c90826200056c565b5060006011553480156200009f57600080fd5b506040516200473738038062004737833981016040819052620000c29162000704565b8585858585856daaeb6d7670e522a718067333cd4e733cc6cdda760b79bafa08df41ecfa224f810dceb660018282828b8b8b620000ff3362000360565b815160209283012081519183019190912060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818801819052818301969096526060810194909452608080850193909352308483018190528151808603909301835260c094850190915281519190950120905291909152610120526200019981620003b0565b50600880546001600160a01b0319166001600160a01b03851690811790915583903b15620002d35781156200023257604051633e9f1edf60e11b81523060048201526001600160a01b038481166024830152821690637d3e3dbe906044015b600060405180830381600087803b1580156200021357600080fd5b505af115801562000228573d6000803e3d6000fd5b50505050620002d3565b6001600160a01b03831615620002775760405163a0af290360e01b81523060048201526001600160a01b03848116602483015282169063a0af290390604401620001f8565b604051632210724360e11b81523060048201526001600160a01b03821690634420e48690602401600060405180830381600087803b158015620002b957600080fd5b505af1158015620002ce573d6000803e3d6000fd5b505050505b5050506001600160a01b0384169050620003005760405163c49d17ad60e01b815260040160405180910390fd5b5050600980546001600160a01b038087166001600160a01b031992831617909255600a8054868416908316179055600d805492851692909116919091179055506200034e826103e8620003c2565b505050505050505050505050620007cc565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6005620003be82826200056c565b5050565b6127106001600160601b0382161115620004365760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b0382166200048e5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016200042d565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600155565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620004f257607f821691505b6020821081036200051357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200056757600081815260208120601f850160051c81016020861015620005425750805b601f850160051c820191505b8181101562000563578281556001016200054e565b5050505b505050565b81516001600160401b03811115620005885762000588620004c7565b620005a081620005998454620004dd565b8462000519565b602080601f831160018114620005d85760008415620005bf5750858301515b600019600386901b1c1916600185901b17855562000563565b600085815260208120601f198616915b828110156200060957888601518255948401946001909101908401620005e8565b5085821015620006285787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082601f8301126200064a57600080fd5b81516001600160401b0380821115620006675762000667620004c7565b604051601f8301601f19908116603f01168101908282118183101715620006925762000692620004c7565b81604052838152602092508683858801011115620006af57600080fd5b600091505b83821015620006d35785820183015181830184015290820190620006b4565b600093810190920192909252949350505050565b80516001600160a01b0381168114620006ff57600080fd5b919050565b60008060008060008060c087890312156200071e57600080fd5b86516001600160401b03808211156200073657600080fd5b620007448a838b0162000638565b975060208901519150808211156200075b57600080fd5b620007698a838b0162000638565b965060408901519150808211156200078057600080fd5b506200078f89828a0162000638565b945050620007a060608801620006e7565b9250620007b060808801620006e7565b9150620007c060a08801620006e7565b90509295509295509295565b60805160a05160c05160e0516101005161012051613f1b6200081c60003960006129a1015260006129f0015260006129cb015260006129240152600061294e015260006129780152613f1b6000f3fe6080604052600436106102445760003560e01c806375794a3c11610139578063b82d36b6116100b6578063e985e9c51161007a578063e985e9c5146106dd578063ecba222a14610726578063f242432a14610747578063f2fde38b14610767578063f5298aca14610787578063f9b3ba9b146107a757600080fd5b8063b82d36b61461062e578063b8d1e5321461064e578063bf16d6c81461066e578063ce9266eb1461069b578063e42be049146106bb57600080fd5b806395d89b41116100fd57806395d89b411461059957806398ffaffc146105ae578063a22cb465146105ce578063b0ccc31e146105ee578063b4678b881461060e57600080fd5b806375794a3c146104f7578063787478861461050d578063862440e21461053b5780638da5cb5b1461055b57806393aebfee1461057957600080fd5b80632eb2c2d6116101c7578063612eb5cc1161018b578063612eb5cc1461046f5780636b20c4541461048f5780636c19e783146104af57806370876c98146104cf578063715018a6146104e257600080fd5b80632eb2c2d6146103e55780633ccfd60b146104055780634e1273f41461040d57806355f804b31461043a5780635ef9432a1461045a57600080fd5b8063090d23b91161020e578063090d23b9146103105780630e89341c1461033057806322009642146103505780632a55205a1461036e5780632bd07c9b146103ad57600080fd5b80622cd76614610249578062fdd58e1461026b57806301ffc9a71461029e57806304634d8d146102ce57806306fdde03146102ee575b600080fd5b34801561025557600080fd5b50610269610264366004612f48565b6107c7565b005b34801561027757600080fd5b5061028b610286366004612f7d565b6108cb565b6040519081526020015b60405180910390f35b3480156102aa57600080fd5b506102be6102b9366004612fbd565b610966565b6040519015158152602001610295565b3480156102da57600080fd5b506102696102e9366004612fda565b61098f565b3480156102fa57600080fd5b506103036109a5565b604051610295919061306d565b34801561031c57600080fd5b5061026961032b366004613080565b610a33565b34801561033c57600080fd5b5061030361034b366004612f48565b610a5d565b34801561035c57600080fd5b5061028b61036b3660046130a9565b90565b34801561037a57600080fd5b5061038e6103893660046130c6565b610b3d565b604080516001600160a01b039093168352602083019190915201610295565b3480156103b957600080fd5b50600d546103cd906001600160a01b031681565b6040516001600160a01b039091168152602001610295565b3480156103f157600080fd5b50610269610400366004613231565b610beb565b610269610c1a565b34801561041957600080fd5b5061042d6104283660046132da565b610c4d565b60405161029591906133df565b34801561044657600080fd5b506102696104553660046133f2565b610d76565b34801561046657600080fd5b50610269610d8a565b34801561047b57600080fd5b506102be61048a366004612f48565b151590565b34801561049b57600080fd5b506102696104aa36600461342e565b610df8565b3480156104bb57600080fd5b506102696104ca366004613080565b610e40565b6102696104dd3660046130c6565b610e6a565b3480156104ee57600080fd5b50610269610f64565b34801561050357600080fd5b5061028b60115481565b34801561051957600080fd5b5061052d610528366004613080565b610f76565b604051610295929190613538565b34801561054757600080fd5b50610269610556366004613566565b611131565b34801561056757600080fd5b506000546001600160a01b03166103cd565b34801561058557600080fd5b506102696105943660046135fa565b611143565b3480156105a557600080fd5b506103036112b7565b3480156105ba57600080fd5b506102696105c936600461368c565b6112c4565b3480156105da57600080fd5b506102696105e93660046136b8565b611332565b3480156105fa57600080fd5b506008546103cd906001600160a01b031681565b34801561061a57600080fd5b5061028b610629366004612f48565b611346565b34801561063a57600080fd5b506102696106493660046136e4565b611350565b34801561065a57600080fd5b50610269610669366004613080565b61147f565b34801561067a57600080fd5b5061068e610689366004612f48565b6114f7565b6040516102959190613742565b3480156106a757600080fd5b506102be6106b63660046136e4565b61158b565b3480156106c757600080fd5b506106d0611668565b6040516102959190613750565b3480156106e957600080fd5b506102be6106f8366004613763565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b34801561073257600080fd5b506008546102be90600160a01b900460ff1681565b34801561075357600080fd5b5061026961076236600461378d565b61178f565b34801561077357600080fd5b50610269610782366004613080565b6117b6565b34801561079357600080fd5b506102696107a23660046137f1565b61182c565b3480156107b357600080fd5b506102696107c2366004612f48565b61186f565b3360009081526010602090815260408083208484529091529020546001906107ee90611346565b6107f833846108cb565b610802919061383a565b101561082157604051632b7f942160e01b815260040160405180910390fd5b3360009081526010602081815260408084208585528252808420429055600f909152909120805460019290610862908490600160801b900461ffff1661384d565b92506101000a81548161ffff021916908361ffff160217905550336001600160a01b03167f0a11a3d743fa42e14ffe8c5bb96a01fa1ce2858244ddea269862a64aef01c98282426040516108c0929190918252602082015260400190565b60405180910390a250565b60006001600160a01b03831661093b5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526003602090815260408083206001600160a01b03861684529091529020545b92915050565b60006109718261189d565b806109805750610980826118d2565b806109605750610960826118d2565b610997611912565b6109a1828261196c565b5050565b600b80546109b29061386f565b80601f01602080910402602001604051908101604052809291908181526020018280546109de9061386f565b8015610a2b5780601f10610a0057610100808354040283529160200191610a2b565b820191906000526020600020905b815481529060010190602001808311610a0e57829003601f168201915b505050505081565b610a3b611912565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b600081815260076020526040812080546060929190610a7b9061386f565b80601f0160208091040260200160405190810160405280929190818152602001828054610aa79061386f565b8015610af45780601f10610ac957610100808354040283529160200191610af4565b820191906000526020600020905b815481529060010190602001808311610ad757829003601f168201915b505050505090506000815111610b1257610b0d83611a69565b610b36565b600681604051602001610b269291906138a3565b6040516020818303038152906040525b9392505050565b60008281526002602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610bb25750604080518082019091526001546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610bd1906001600160601b03168761392a565b610bdb9190613941565b91519350909150505b9250929050565b846001600160a01b0381163314610c0557610c0533611afd565b610c128686868686611b17565b505050505050565b600a546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050610c4b57600080fd5b565b60608151835114610cb25760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610932565b600083516001600160401b03811115610ccd57610ccd6130e8565b604051908082528060200260200182016040528015610cf6578160200160208202803683370190505b50905060005b8451811015610d6e57610d41858281518110610d1a57610d1a613963565b6020026020010151858381518110610d3457610d34613963565b60200260200101516108cb565b828281518110610d5357610d53613963565b6020908102919091010152610d6781613979565b9050610cfc565b509392505050565b610d7e611912565b610d8781611b63565b50565b6000546001600160a01b03163314610db557604051635fc483c560e01b815260040160405180910390fd5b600854600160a01b900460ff1615610de057604051631551a48f60e11b815260040160405180910390fd5b600880546001600160a81b031916600160a01b179055565b6001600160a01b038316331480610e145750610e1483336106f8565b610e305760405162461bcd60e51b815260040161093290613992565b610e3b838383611b6f565b505050565b610e48611912565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152600f6020526040902054600160701b900460ff16610ea057604051631d99ddbf60e01b815260040160405180910390fd5b6000828152600f6020526040902054610eca908290600160301b90046001600160401b031661392a565b341015610eea5760405163f14a42b760e01b815260040160405180910390fd5b6000828152600f602052604090205461ffff1615610f49576000828152600f602052604090205461ffff80821691610f2a918491620100009004166139e0565b1115610f49576040516308aeed0f60e21b815260040160405180910390fd5b6109a133838360405180602001604052806000815250611d0f565b610f6c611912565b610c4b6000611e34565b60608060006011546001600160401b03811115610f9557610f956130e8565b604051908082528060200260200182016040528015610fbe578160200160208202803683370190505b50905060006011546001600160401b03811115610fdd57610fdd6130e8565b60405190808252806020026020018201604052801561101657816020015b611003612f0c565b815260200190600190039081610ffb5790505b50905060005b601154811015611126576001600160a01b0386166000908152601060209081526040808320848452909152902054835184908390811061105e5761105e613963565b6020908102919091018101919091526000828152600f8252604090819020815160e081018352905461ffff808216835262010000820481169483019490945264010000000081048416928201929092526001600160401b03600160301b830416606082015260ff600160701b8304811615156080830152600160781b830416151560a0820152600160801b90910490911660c0820152825183908390811061110857611108613963565b6020026020010181905250808061111e90613979565b91505061101c565b509094909350915050565b611139611912565b6109a18282611e84565b61114b611912565b6040805160e08101825261ffff8681168252600060208084018281528486018381526001600160401b038a8116606088019081528a1515608089019081528a151560a08a0190815260c08a01888152601180548a52600f8952988c90209a518b54975196519451935192519151908b1663ffffffff199098169790971762010000968b1696909602959095176dffffffffffffffffffff000000001916640100000000938a16939093026dffffffffffffffff000000000000191692909217600160301b91909316029190911761ffff60701b1916600160701b9115159190910260ff60781b191617600160781b911515919091021761ffff60801b1916600160801b91909416029290921790925590548251601f89018390048302810183019093528783526112979290918990899081908401838280828437600092019190915250611e8492505050565b6001601160008282546112aa91906139e0565b9091555050505050505050565b600c80546109b29061386f565b6112cc611912565b6000828152600f6020526040902080546dffffffffffffffff0000000000001916600160301b6001600160401b0384811682029290921780845504161561132357805460ff60701b1916600160701b178155505050565b805460ff60701b191690555050565b8161133c81611afd565b610e3b8383611ee1565b6000811515610960565b61135d6020820182613080565b6001600160a01b0316336001600160a01b03161461138e57604051634b25f43560e11b815260040160405180910390fd5b61139983838361158b565b6113b6576040516333cc058960e01b815260040160405180910390fd5b60608101356000908152600e602052604090205460ff16156113eb57604051630c8d9eab60e31b815260040160405180910390fd5b6020808201356000908152600f909152604090205461ffff161561145c576020808201356000908152600f9091526040908190205461ffff8082169261143d92908501359162010000909104166139e0565b111561145c576040516308aeed0f60e21b815260040160405180910390fd5b610e3b338260200135836040013560405180602001604052806000815250611d0f565b6000546001600160a01b031633146114aa57604051635fc483c560e01b815260040160405180910390fd5b600854600160a01b900460ff16156114d557604051631551a48f60e11b815260040160405180910390fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6114ff612f0c565b506000908152600f6020908152604091829020825160e081018452905461ffff808216835262010000820481169383019390935264010000000081048316938201939093526001600160401b03600160301b840416606082015260ff600160701b8404811615156080830152600160781b840416151560a0820152600160801b9092041660c082015290565b604080517f09048a7247c0a139c4ddec2c2b9b49a6bfa0078cf1bf639074dbb1d16be1840960208281019190915233828401528301356060828101919091529183013560808201529082013560a082015260009081906116039060c00160405160208183030381529060405280519060200120611eec565b600954604080516020601f89018190048102820181019092528781529293506001600160a01b0390911691611655918491908990899081908401838280828437600092019190915250611f3a92505050565b6001600160a01b03161495945050505050565b606060006011546001600160401b03811115611686576116866130e8565b6040519080825280602002602001820160405280156116bf57816020015b6116ac612f0c565b8152602001906001900390816116a45790505b50905060005b601154811015611789576000818152600f6020908152604091829020825160e081018452905461ffff808216835262010000820481169383019390935264010000000081048316938201939093526001600160401b03600160301b840416606082015260ff600160701b8404811615156080830152600160781b840416151560a0820152600160801b9092041660c0820152825183908390811061176b5761176b613963565b6020026020010181905250808061178190613979565b9150506116c5565b50919050565b846001600160a01b03811633146117a9576117a933611afd565b610c128686868686611f56565b6117be611912565b6001600160a01b0381166118235760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610932565b610d8781611e34565b6001600160a01b038316331480611848575061184883336106f8565b6118645760405162461bcd60e51b815260040161093290613992565b610e3b838383611f9b565b611877611912565b6000908152600f60205260409020805462010000810461ffff1661ffff19909116179055565b60006001600160e01b0319821663152a902d60e11b148061096057506301ffc9a760e01b6001600160e01b0319831614610960565b60006001600160e01b03198216636cdb3d1360e11b148061190357506001600160e01b031982166303a24d0760e21b145b8061096057506109608261189d565b6000546001600160a01b03163314610c4b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b6127106001600160601b03821611156119da5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610932565b6001600160a01b038216611a305760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610932565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600155565b606060058054611a789061386f565b80601f0160208091040260200160405190810160405280929190818152602001828054611aa49061386f565b8015611af15780601f10611ac657610100808354040283529160200191611af1565b820191906000526020600020905b815481529060010190602001808311611ad457829003601f168201915b50505050509050919050565b6008546001600160a01b031615610d8757610d87816120b7565b6001600160a01b038516331480611b335750611b3385336106f8565b611b4f5760405162461bcd60e51b815260040161093290613992565b611b5c8585858585612179565b5050505050565b60066109a18282613a39565b6001600160a01b038316611b955760405162461bcd60e51b815260040161093290613af8565b8051825114611bb65760405162461bcd60e51b815260040161093290613b3b565b6000339050611bd98185600086866040518060200160405280600081525061231e565b60005b8351811015611ca1576000848281518110611bf957611bf9613963565b602002602001015190506000848381518110611c1757611c17613963565b60209081029190910181015160008481526003835260408082206001600160a01b038c168352909352919091205490915081811015611c685760405162461bcd60e51b815260040161093290613b83565b60009283526003602090815260408085206001600160a01b038b1686529091529092209103905580611c9981613979565b915050611bdc565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611cf2929190613bc7565b60405180910390a460408051602081019091526000905250505050565b6001600160a01b038416611d6f5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610932565b336000611d7b85612691565b90506000611d8885612691565b9050611d998360008985858961231e565b60008681526003602090815260408083206001600160a01b038b16845290915281208054879290611dcb9084906139e0565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611e2b836000898989896126dc565b50505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000828152600760205260409020611e9c8282613a39565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b611ec884610a5d565b604051611ed5919061306d565b60405180910390a25050565b6109a1338383612837565b6000610960611ef9612917565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000611f498585612a3e565b91509150610d6e81612a80565b6001600160a01b038516331480611f725750611f7285336106f8565b611f8e5760405162461bcd60e51b815260040161093290613992565b611b5c8585858585612bca565b6001600160a01b038316611fc15760405162461bcd60e51b815260040161093290613af8565b336000611fcd84612691565b90506000611fda84612691565b9050611ffa8387600085856040518060200160405280600081525061231e565b60008581526003602090815260408083206001600160a01b038a1684529091529020548481101561203d5760405162461bcd60e51b815260040161093290613b83565b60008681526003602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052611e2b565b6008546001600160a01b031680158015906120dc57506000816001600160a01b03163b115b156109a157604051633185c44d60e21b81523060048201526001600160a01b03838116602483015282169063c617113490604401602060405180830381865afa15801561212d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121519190613bec565b6109a157604051633b79c77360e21b81526001600160a01b0383166004820152602401610932565b815183511461219a5760405162461bcd60e51b815260040161093290613b3b565b6001600160a01b0384166121c05760405162461bcd60e51b815260040161093290613c09565b336121cf81878787878761231e565b60005b84518110156122b85760008582815181106121ef576121ef613963565b60200260200101519050600085838151811061220d5761220d613963565b60209081029190910181015160008481526003835260408082206001600160a01b038e16835290935291909120549091508181101561225e5760405162461bcd60e51b815260040161093290613c4e565b60008381526003602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061229d9084906139e0565b92505081905550505050806122b190613979565b90506121d2565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612308929190613bc7565b60405180910390a4610c12818787878787612d06565b825160005b81811015612682576000600f600087848151811061234357612343613963565b60200260200101518152602001908152602001600020905060006001600160a01b0316886001600160a01b0316036124225784828151811061238757612387613963565b60200260200101518160000160028282829054906101000a900461ffff166123af919061384d565b92506101000a81548161ffff021916908361ffff1602179055508482815181106123db576123db613963565b60200260200101518160000160048282829054906101000a900461ffff16612403919061384d565b92506101000a81548161ffff021916908361ffff16021790555061266f565b6001600160a01b03881660009081526010602052604081208751829089908690811061245057612450613963565b6020026020010151815260200190815260200160002054905060006001600160a01b0316886001600160a01b0316036125e15761249989888581518110610d3457610d34613963565b60010361258857801561258857886001600160a01b03167f88cfb56357159c8f5336916136e8a19651dc8f0ecde0ad4b85f243bf439ddd538885815181106124e3576124e3613963565b60200260200101516040516124fa91815260200190565b60405180910390a26001600160a01b0389166000908152601060205260408120885190919089908690811061253157612531613963565b602002602001015181526020019081526020016000206000905560018260000160108282829054906101000a900461ffff1661256d9190613c98565b92506101000a81548161ffff021916908361ffff1602179055505b85838151811061259a5761259a613963565b60200260200101518260000160048282829054906101000a900461ffff166125c29190613c98565b92506101000a81548161ffff021916908361ffff16021790555061266d565b8583815181106125f3576125f3613963565b602002602001015161260482611346565b61261a8b8a8781518110610d3457610d34613963565b612624919061383a565b101561264357604051632b7f942160e01b815260040160405180910390fd5b8154600160781b900460ff161561266d5760405163c9e36d3f60e01b815260040160405180910390fd5b505b508061267a81613979565b915050612323565b50611e2b878688878787612dc1565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106126cb576126cb613963565b602090810291909101015292915050565b6001600160a01b0384163b15610c125760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906127209089908990889088908890600401613cb3565b6020604051808303816000875af192505050801561275b575060408051601f3d908101601f1916820190925261275891810190613cf8565b60015b61280757612767613d15565b806308c379a0036127a0575061277b613d30565b8061278657506127a2565b8060405162461bcd60e51b8152600401610932919061306d565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610932565b6001600160e01b0319811663f23a6e6160e01b14611e2b5760405162461bcd60e51b815260040161093290613db9565b816001600160a01b0316836001600160a01b0316036128aa5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610932565b6001600160a01b03838116600081815260046020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561297057507f000000000000000000000000000000000000000000000000000000000000000046145b1561299a57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604103612a745760208301516040840151606085015160001a612a6887828585612e48565b94509450505050610be4565b50600090506002610be4565b6000816004811115612a9457612a94613e01565b03612a9c5750565b6001816004811115612ab057612ab0613e01565b03612afd5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610932565b6002816004811115612b1157612b11613e01565b03612b5e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610932565b6003816004811115612b7257612b72613e01565b03610d875760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610932565b6001600160a01b038416612bf05760405162461bcd60e51b815260040161093290613c09565b336000612bfc85612691565b90506000612c0985612691565b9050612c1983898985858961231e565b60008681526003602090815260408083206001600160a01b038c16845290915290205485811015612c5c5760405162461bcd60e51b815260040161093290613c4e565b60008781526003602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612c9b9084906139e0565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612cfb848a8a8a8a8a6126dc565b505050505050505050565b6001600160a01b0384163b15610c125760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612d4a9089908990889088908890600401613e17565b6020604051808303816000875af1925050508015612d85575060408051601f3d908101601f19168201909252612d8291810190613cf8565b60015b612d9157612767613d15565b6001600160e01b0319811663bc197c8160e01b14611e2b5760405162461bcd60e51b815260040161093290613db9565b600d546001600160a01b031615610c1257600d5460405163bc8420a760e01b81526001600160a01b039091169063bc8420a790612e0e9030908a908a908a908a908a908a90600401613e75565b600060405180830381600087803b158015612e2857600080fd5b505af1158015612e3c573d6000803e3d6000fd5b50505050505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612e7f5750600090506003612f03565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612ed3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612efc57600060019250925050612f03565b9150600090505b94509492505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b600060208284031215612f5a57600080fd5b5035919050565b80356001600160a01b0381168114612f7857600080fd5b919050565b60008060408385031215612f9057600080fd5b612f9983612f61565b946020939093013593505050565b6001600160e01b031981168114610d8757600080fd5b600060208284031215612fcf57600080fd5b8135610b3681612fa7565b60008060408385031215612fed57600080fd5b612ff683612f61565b915060208301356001600160601b038116811461301257600080fd5b809150509250929050565b60005b83811015613038578181015183820152602001613020565b50506000910152565b6000815180845261305981602086016020860161301d565b601f01601f19169290920160200192915050565b602081526000610b366020830184613041565b60006020828403121561309257600080fd5b610b3682612f61565b8015158114610d8757600080fd5b6000602082840312156130bb57600080fd5b8135610b368161309b565b600080604083850312156130d957600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715613123576131236130e8565b6040525050565b60006001600160401b03821115613143576131436130e8565b5060051b60200190565b600082601f83011261315e57600080fd5b8135602061316b8261312a565b60405161317882826130fe565b83815260059390931b850182019282810191508684111561319857600080fd5b8286015b848110156131b3578035835291830191830161319c565b509695505050505050565b600082601f8301126131cf57600080fd5b81356001600160401b038111156131e8576131e86130e8565b6040516131ff601f8301601f1916602001826130fe565b81815284602083860101111561321457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561324957600080fd5b61325286612f61565b945061326060208701612f61565b935060408601356001600160401b038082111561327c57600080fd5b61328889838a0161314d565b9450606088013591508082111561329e57600080fd5b6132aa89838a0161314d565b935060808801359150808211156132c057600080fd5b506132cd888289016131be565b9150509295509295909350565b600080604083850312156132ed57600080fd5b82356001600160401b038082111561330457600080fd5b818501915085601f83011261331857600080fd5b813560206133258261312a565b60405161333282826130fe565b83815260059390931b850182019282810191508984111561335257600080fd5b948201945b838610156133775761336886612f61565b82529482019490820190613357565b9650508601359250508082111561338d57600080fd5b5061339a8582860161314d565b9150509250929050565b600081518084526020808501945080840160005b838110156133d4578151875295820195908201906001016133b8565b509495945050505050565b602081526000610b3660208301846133a4565b60006020828403121561340457600080fd5b81356001600160401b0381111561341a57600080fd5b613426848285016131be565b949350505050565b60008060006060848603121561344357600080fd5b61344c84612f61565b925060208401356001600160401b038082111561346857600080fd5b6134748783880161314d565b9350604086013591508082111561348a57600080fd5b506134978682870161314d565b9150509250925092565b61ffff8082511683528060208301511660208401528060408301511660408401526001600160401b03606083015116606084015260808201511515608084015260a0820151151560a08401528060c08301511660c0840152505050565b600081518084526020808501945080840160005b838110156133d4576135258783516134a1565b60e0969096019590820190600101613512565b60408152600061354b60408301856133a4565b828103602084015261355d81856134fe565b95945050505050565b6000806040838503121561357957600080fd5b8235915060208301356001600160401b0381111561359657600080fd5b61339a858286016131be565b60008083601f8401126135b457600080fd5b5081356001600160401b038111156135cb57600080fd5b602083019150836020828501011115610be457600080fd5b80356001600160401b0381168114612f7857600080fd5b60008060008060008060a0878903121561361357600080fd5b86356001600160401b0381111561362957600080fd5b61363589828a016135a2565b909750955050602087013561ffff8116811461365057600080fd5b935061365e604088016135e3565b9250606087013561366e8161309b565b9150608087013561367e8161309b565b809150509295509295509295565b6000806040838503121561369f57600080fd5b823591506136af602084016135e3565b90509250929050565b600080604083850312156136cb57600080fd5b6136d483612f61565b915060208301356130128161309b565b600080600083850360a08112156136fa57600080fd5b84356001600160401b0381111561371057600080fd5b61371c878288016135a2565b9095509350506080601f198201121561373457600080fd5b506020840190509250925092565b60e0810161096082846134a1565b602081526000610b3660208301846134fe565b6000806040838503121561377657600080fd5b61377f83612f61565b91506136af60208401612f61565b600080600080600060a086880312156137a557600080fd5b6137ae86612f61565b94506137bc60208701612f61565b9350604086013592506060860135915060808601356001600160401b038111156137e557600080fd5b6132cd888289016131be565b60008060006060848603121561380657600080fd5b61380f84612f61565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561096057610960613824565b61ffff81811683821601908082111561386857613868613824565b5092915050565b600181811c9082168061388357607f821691505b60208210810361178957634e487b7160e01b600052602260045260246000fd5b60008084546138b18161386f565b600182811680156138c957600181146138de5761390d565b60ff198416875282151583028701945061390d565b8860005260208060002060005b858110156139045781548a8201529084019082016138eb565b50505082870194505b50505050835161392181836020880161301d565b01949350505050565b808202811582820484141761096057610960613824565b60008261395e57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b60006001820161398b5761398b613824565b5060010190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b8082018082111561096057610960613824565b601f821115610e3b57600081815260208120601f850160051c81016020861015613a1a5750805b601f850160051c820191505b81811015610c1257828155600101613a26565b81516001600160401b03811115613a5257613a526130e8565b613a6681613a60845461386f565b846139f3565b602080601f831160018114613a9b5760008415613a835750858301515b600019600386901b1c1916600185901b178555610c12565b600085815260208120601f198616915b82811015613aca57888601518255948401946001909101908401613aab565b5085821015613ae85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b604081526000613bda60408301856133a4565b828103602084015261355d81856133a4565b600060208284031215613bfe57600080fd5b8151610b368161309b565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b61ffff82811682821603908082111561386857613868613824565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613ced90830184613041565b979650505050505050565b600060208284031215613d0a57600080fd5b8151610b3681612fa7565b600060033d111561036b5760046000803e5060005160e01c90565b600060443d1015613d3e5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715613d6d57505050505090565b8285019150815181811115613d855750505050505090565b843d8701016020828501011115613d9f5750505050505090565b613dae602082860101876130fe565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b0386811682528516602082015260a060408201819052600090613e43908301866133a4565b8281036060840152613e5581866133a4565b90508281036080840152613e698185613041565b98975050505050505050565b6001600160a01b038881168252878116602083015286811660408301528516606082015260e060808201819052600090613eb1908301866133a4565b82810360a0840152613ec381866133a4565b905082810360c0840152613ed78185613041565b9a995050505050505050505056fea26469706673582212206bc3802c39c1f8cb9f5227295f8062dd8e9351591118acfae8f219a5966f5c6e64736f6c6343000811003300000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001600000000000000000000000005c863ba28f926d235550426f0b3e2b27786b66a500000000000000000000000071ddd9b4c03cbb1104eeea5a0167a2eb05afbce30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002668747470733a2f2f666f726b68756e6765722e6172742f666c6f72612f7b69647d2e6a736f6e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d56656e757369616e466c6f72610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013100000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106102445760003560e01c806375794a3c11610139578063b82d36b6116100b6578063e985e9c51161007a578063e985e9c5146106dd578063ecba222a14610726578063f242432a14610747578063f2fde38b14610767578063f5298aca14610787578063f9b3ba9b146107a757600080fd5b8063b82d36b61461062e578063b8d1e5321461064e578063bf16d6c81461066e578063ce9266eb1461069b578063e42be049146106bb57600080fd5b806395d89b41116100fd57806395d89b411461059957806398ffaffc146105ae578063a22cb465146105ce578063b0ccc31e146105ee578063b4678b881461060e57600080fd5b806375794a3c146104f7578063787478861461050d578063862440e21461053b5780638da5cb5b1461055b57806393aebfee1461057957600080fd5b80632eb2c2d6116101c7578063612eb5cc1161018b578063612eb5cc1461046f5780636b20c4541461048f5780636c19e783146104af57806370876c98146104cf578063715018a6146104e257600080fd5b80632eb2c2d6146103e55780633ccfd60b146104055780634e1273f41461040d57806355f804b31461043a5780635ef9432a1461045a57600080fd5b8063090d23b91161020e578063090d23b9146103105780630e89341c1461033057806322009642146103505780632a55205a1461036e5780632bd07c9b146103ad57600080fd5b80622cd76614610249578062fdd58e1461026b57806301ffc9a71461029e57806304634d8d146102ce57806306fdde03146102ee575b600080fd5b34801561025557600080fd5b50610269610264366004612f48565b6107c7565b005b34801561027757600080fd5b5061028b610286366004612f7d565b6108cb565b6040519081526020015b60405180910390f35b3480156102aa57600080fd5b506102be6102b9366004612fbd565b610966565b6040519015158152602001610295565b3480156102da57600080fd5b506102696102e9366004612fda565b61098f565b3480156102fa57600080fd5b506103036109a5565b604051610295919061306d565b34801561031c57600080fd5b5061026961032b366004613080565b610a33565b34801561033c57600080fd5b5061030361034b366004612f48565b610a5d565b34801561035c57600080fd5b5061028b61036b3660046130a9565b90565b34801561037a57600080fd5b5061038e6103893660046130c6565b610b3d565b604080516001600160a01b039093168352602083019190915201610295565b3480156103b957600080fd5b50600d546103cd906001600160a01b031681565b6040516001600160a01b039091168152602001610295565b3480156103f157600080fd5b50610269610400366004613231565b610beb565b610269610c1a565b34801561041957600080fd5b5061042d6104283660046132da565b610c4d565b60405161029591906133df565b34801561044657600080fd5b506102696104553660046133f2565b610d76565b34801561046657600080fd5b50610269610d8a565b34801561047b57600080fd5b506102be61048a366004612f48565b151590565b34801561049b57600080fd5b506102696104aa36600461342e565b610df8565b3480156104bb57600080fd5b506102696104ca366004613080565b610e40565b6102696104dd3660046130c6565b610e6a565b3480156104ee57600080fd5b50610269610f64565b34801561050357600080fd5b5061028b60115481565b34801561051957600080fd5b5061052d610528366004613080565b610f76565b604051610295929190613538565b34801561054757600080fd5b50610269610556366004613566565b611131565b34801561056757600080fd5b506000546001600160a01b03166103cd565b34801561058557600080fd5b506102696105943660046135fa565b611143565b3480156105a557600080fd5b506103036112b7565b3480156105ba57600080fd5b506102696105c936600461368c565b6112c4565b3480156105da57600080fd5b506102696105e93660046136b8565b611332565b3480156105fa57600080fd5b506008546103cd906001600160a01b031681565b34801561061a57600080fd5b5061028b610629366004612f48565b611346565b34801561063a57600080fd5b506102696106493660046136e4565b611350565b34801561065a57600080fd5b50610269610669366004613080565b61147f565b34801561067a57600080fd5b5061068e610689366004612f48565b6114f7565b6040516102959190613742565b3480156106a757600080fd5b506102be6106b63660046136e4565b61158b565b3480156106c757600080fd5b506106d0611668565b6040516102959190613750565b3480156106e957600080fd5b506102be6106f8366004613763565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b34801561073257600080fd5b506008546102be90600160a01b900460ff1681565b34801561075357600080fd5b5061026961076236600461378d565b61178f565b34801561077357600080fd5b50610269610782366004613080565b6117b6565b34801561079357600080fd5b506102696107a23660046137f1565b61182c565b3480156107b357600080fd5b506102696107c2366004612f48565b61186f565b3360009081526010602090815260408083208484529091529020546001906107ee90611346565b6107f833846108cb565b610802919061383a565b101561082157604051632b7f942160e01b815260040160405180910390fd5b3360009081526010602081815260408084208585528252808420429055600f909152909120805460019290610862908490600160801b900461ffff1661384d565b92506101000a81548161ffff021916908361ffff160217905550336001600160a01b03167f0a11a3d743fa42e14ffe8c5bb96a01fa1ce2858244ddea269862a64aef01c98282426040516108c0929190918252602082015260400190565b60405180910390a250565b60006001600160a01b03831661093b5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526003602090815260408083206001600160a01b03861684529091529020545b92915050565b60006109718261189d565b806109805750610980826118d2565b806109605750610960826118d2565b610997611912565b6109a1828261196c565b5050565b600b80546109b29061386f565b80601f01602080910402602001604051908101604052809291908181526020018280546109de9061386f565b8015610a2b5780601f10610a0057610100808354040283529160200191610a2b565b820191906000526020600020905b815481529060010190602001808311610a0e57829003601f168201915b505050505081565b610a3b611912565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b600081815260076020526040812080546060929190610a7b9061386f565b80601f0160208091040260200160405190810160405280929190818152602001828054610aa79061386f565b8015610af45780601f10610ac957610100808354040283529160200191610af4565b820191906000526020600020905b815481529060010190602001808311610ad757829003601f168201915b505050505090506000815111610b1257610b0d83611a69565b610b36565b600681604051602001610b269291906138a3565b6040516020818303038152906040525b9392505050565b60008281526002602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610bb25750604080518082019091526001546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610bd1906001600160601b03168761392a565b610bdb9190613941565b91519350909150505b9250929050565b846001600160a01b0381163314610c0557610c0533611afd565b610c128686868686611b17565b505050505050565b600a546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050610c4b57600080fd5b565b60608151835114610cb25760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610932565b600083516001600160401b03811115610ccd57610ccd6130e8565b604051908082528060200260200182016040528015610cf6578160200160208202803683370190505b50905060005b8451811015610d6e57610d41858281518110610d1a57610d1a613963565b6020026020010151858381518110610d3457610d34613963565b60200260200101516108cb565b828281518110610d5357610d53613963565b6020908102919091010152610d6781613979565b9050610cfc565b509392505050565b610d7e611912565b610d8781611b63565b50565b6000546001600160a01b03163314610db557604051635fc483c560e01b815260040160405180910390fd5b600854600160a01b900460ff1615610de057604051631551a48f60e11b815260040160405180910390fd5b600880546001600160a81b031916600160a01b179055565b6001600160a01b038316331480610e145750610e1483336106f8565b610e305760405162461bcd60e51b815260040161093290613992565b610e3b838383611b6f565b505050565b610e48611912565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152600f6020526040902054600160701b900460ff16610ea057604051631d99ddbf60e01b815260040160405180910390fd5b6000828152600f6020526040902054610eca908290600160301b90046001600160401b031661392a565b341015610eea5760405163f14a42b760e01b815260040160405180910390fd5b6000828152600f602052604090205461ffff1615610f49576000828152600f602052604090205461ffff80821691610f2a918491620100009004166139e0565b1115610f49576040516308aeed0f60e21b815260040160405180910390fd5b6109a133838360405180602001604052806000815250611d0f565b610f6c611912565b610c4b6000611e34565b60608060006011546001600160401b03811115610f9557610f956130e8565b604051908082528060200260200182016040528015610fbe578160200160208202803683370190505b50905060006011546001600160401b03811115610fdd57610fdd6130e8565b60405190808252806020026020018201604052801561101657816020015b611003612f0c565b815260200190600190039081610ffb5790505b50905060005b601154811015611126576001600160a01b0386166000908152601060209081526040808320848452909152902054835184908390811061105e5761105e613963565b6020908102919091018101919091526000828152600f8252604090819020815160e081018352905461ffff808216835262010000820481169483019490945264010000000081048416928201929092526001600160401b03600160301b830416606082015260ff600160701b8304811615156080830152600160781b830416151560a0820152600160801b90910490911660c0820152825183908390811061110857611108613963565b6020026020010181905250808061111e90613979565b91505061101c565b509094909350915050565b611139611912565b6109a18282611e84565b61114b611912565b6040805160e08101825261ffff8681168252600060208084018281528486018381526001600160401b038a8116606088019081528a1515608089019081528a151560a08a0190815260c08a01888152601180548a52600f8952988c90209a518b54975196519451935192519151908b1663ffffffff199098169790971762010000968b1696909602959095176dffffffffffffffffffff000000001916640100000000938a16939093026dffffffffffffffff000000000000191692909217600160301b91909316029190911761ffff60701b1916600160701b9115159190910260ff60781b191617600160781b911515919091021761ffff60801b1916600160801b91909416029290921790925590548251601f89018390048302810183019093528783526112979290918990899081908401838280828437600092019190915250611e8492505050565b6001601160008282546112aa91906139e0565b9091555050505050505050565b600c80546109b29061386f565b6112cc611912565b6000828152600f6020526040902080546dffffffffffffffff0000000000001916600160301b6001600160401b0384811682029290921780845504161561132357805460ff60701b1916600160701b178155505050565b805460ff60701b191690555050565b8161133c81611afd565b610e3b8383611ee1565b6000811515610960565b61135d6020820182613080565b6001600160a01b0316336001600160a01b03161461138e57604051634b25f43560e11b815260040160405180910390fd5b61139983838361158b565b6113b6576040516333cc058960e01b815260040160405180910390fd5b60608101356000908152600e602052604090205460ff16156113eb57604051630c8d9eab60e31b815260040160405180910390fd5b6020808201356000908152600f909152604090205461ffff161561145c576020808201356000908152600f9091526040908190205461ffff8082169261143d92908501359162010000909104166139e0565b111561145c576040516308aeed0f60e21b815260040160405180910390fd5b610e3b338260200135836040013560405180602001604052806000815250611d0f565b6000546001600160a01b031633146114aa57604051635fc483c560e01b815260040160405180910390fd5b600854600160a01b900460ff16156114d557604051631551a48f60e11b815260040160405180910390fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6114ff612f0c565b506000908152600f6020908152604091829020825160e081018452905461ffff808216835262010000820481169383019390935264010000000081048316938201939093526001600160401b03600160301b840416606082015260ff600160701b8404811615156080830152600160781b840416151560a0820152600160801b9092041660c082015290565b604080517f09048a7247c0a139c4ddec2c2b9b49a6bfa0078cf1bf639074dbb1d16be1840960208281019190915233828401528301356060828101919091529183013560808201529082013560a082015260009081906116039060c00160405160208183030381529060405280519060200120611eec565b600954604080516020601f89018190048102820181019092528781529293506001600160a01b0390911691611655918491908990899081908401838280828437600092019190915250611f3a92505050565b6001600160a01b03161495945050505050565b606060006011546001600160401b03811115611686576116866130e8565b6040519080825280602002602001820160405280156116bf57816020015b6116ac612f0c565b8152602001906001900390816116a45790505b50905060005b601154811015611789576000818152600f6020908152604091829020825160e081018452905461ffff808216835262010000820481169383019390935264010000000081048316938201939093526001600160401b03600160301b840416606082015260ff600160701b8404811615156080830152600160781b840416151560a0820152600160801b9092041660c0820152825183908390811061176b5761176b613963565b6020026020010181905250808061178190613979565b9150506116c5565b50919050565b846001600160a01b03811633146117a9576117a933611afd565b610c128686868686611f56565b6117be611912565b6001600160a01b0381166118235760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610932565b610d8781611e34565b6001600160a01b038316331480611848575061184883336106f8565b6118645760405162461bcd60e51b815260040161093290613992565b610e3b838383611f9b565b611877611912565b6000908152600f60205260409020805462010000810461ffff1661ffff19909116179055565b60006001600160e01b0319821663152a902d60e11b148061096057506301ffc9a760e01b6001600160e01b0319831614610960565b60006001600160e01b03198216636cdb3d1360e11b148061190357506001600160e01b031982166303a24d0760e21b145b8061096057506109608261189d565b6000546001600160a01b03163314610c4b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b6127106001600160601b03821611156119da5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610932565b6001600160a01b038216611a305760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610932565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600155565b606060058054611a789061386f565b80601f0160208091040260200160405190810160405280929190818152602001828054611aa49061386f565b8015611af15780601f10611ac657610100808354040283529160200191611af1565b820191906000526020600020905b815481529060010190602001808311611ad457829003601f168201915b50505050509050919050565b6008546001600160a01b031615610d8757610d87816120b7565b6001600160a01b038516331480611b335750611b3385336106f8565b611b4f5760405162461bcd60e51b815260040161093290613992565b611b5c8585858585612179565b5050505050565b60066109a18282613a39565b6001600160a01b038316611b955760405162461bcd60e51b815260040161093290613af8565b8051825114611bb65760405162461bcd60e51b815260040161093290613b3b565b6000339050611bd98185600086866040518060200160405280600081525061231e565b60005b8351811015611ca1576000848281518110611bf957611bf9613963565b602002602001015190506000848381518110611c1757611c17613963565b60209081029190910181015160008481526003835260408082206001600160a01b038c168352909352919091205490915081811015611c685760405162461bcd60e51b815260040161093290613b83565b60009283526003602090815260408085206001600160a01b038b1686529091529092209103905580611c9981613979565b915050611bdc565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611cf2929190613bc7565b60405180910390a460408051602081019091526000905250505050565b6001600160a01b038416611d6f5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610932565b336000611d7b85612691565b90506000611d8885612691565b9050611d998360008985858961231e565b60008681526003602090815260408083206001600160a01b038b16845290915281208054879290611dcb9084906139e0565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611e2b836000898989896126dc565b50505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000828152600760205260409020611e9c8282613a39565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b611ec884610a5d565b604051611ed5919061306d565b60405180910390a25050565b6109a1338383612837565b6000610960611ef9612917565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000611f498585612a3e565b91509150610d6e81612a80565b6001600160a01b038516331480611f725750611f7285336106f8565b611f8e5760405162461bcd60e51b815260040161093290613992565b611b5c8585858585612bca565b6001600160a01b038316611fc15760405162461bcd60e51b815260040161093290613af8565b336000611fcd84612691565b90506000611fda84612691565b9050611ffa8387600085856040518060200160405280600081525061231e565b60008581526003602090815260408083206001600160a01b038a1684529091529020548481101561203d5760405162461bcd60e51b815260040161093290613b83565b60008681526003602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052611e2b565b6008546001600160a01b031680158015906120dc57506000816001600160a01b03163b115b156109a157604051633185c44d60e21b81523060048201526001600160a01b03838116602483015282169063c617113490604401602060405180830381865afa15801561212d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121519190613bec565b6109a157604051633b79c77360e21b81526001600160a01b0383166004820152602401610932565b815183511461219a5760405162461bcd60e51b815260040161093290613b3b565b6001600160a01b0384166121c05760405162461bcd60e51b815260040161093290613c09565b336121cf81878787878761231e565b60005b84518110156122b85760008582815181106121ef576121ef613963565b60200260200101519050600085838151811061220d5761220d613963565b60209081029190910181015160008481526003835260408082206001600160a01b038e16835290935291909120549091508181101561225e5760405162461bcd60e51b815260040161093290613c4e565b60008381526003602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061229d9084906139e0565b92505081905550505050806122b190613979565b90506121d2565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612308929190613bc7565b60405180910390a4610c12818787878787612d06565b825160005b81811015612682576000600f600087848151811061234357612343613963565b60200260200101518152602001908152602001600020905060006001600160a01b0316886001600160a01b0316036124225784828151811061238757612387613963565b60200260200101518160000160028282829054906101000a900461ffff166123af919061384d565b92506101000a81548161ffff021916908361ffff1602179055508482815181106123db576123db613963565b60200260200101518160000160048282829054906101000a900461ffff16612403919061384d565b92506101000a81548161ffff021916908361ffff16021790555061266f565b6001600160a01b03881660009081526010602052604081208751829089908690811061245057612450613963565b6020026020010151815260200190815260200160002054905060006001600160a01b0316886001600160a01b0316036125e15761249989888581518110610d3457610d34613963565b60010361258857801561258857886001600160a01b03167f88cfb56357159c8f5336916136e8a19651dc8f0ecde0ad4b85f243bf439ddd538885815181106124e3576124e3613963565b60200260200101516040516124fa91815260200190565b60405180910390a26001600160a01b0389166000908152601060205260408120885190919089908690811061253157612531613963565b602002602001015181526020019081526020016000206000905560018260000160108282829054906101000a900461ffff1661256d9190613c98565b92506101000a81548161ffff021916908361ffff1602179055505b85838151811061259a5761259a613963565b60200260200101518260000160048282829054906101000a900461ffff166125c29190613c98565b92506101000a81548161ffff021916908361ffff16021790555061266d565b8583815181106125f3576125f3613963565b602002602001015161260482611346565b61261a8b8a8781518110610d3457610d34613963565b612624919061383a565b101561264357604051632b7f942160e01b815260040160405180910390fd5b8154600160781b900460ff161561266d5760405163c9e36d3f60e01b815260040160405180910390fd5b505b508061267a81613979565b915050612323565b50611e2b878688878787612dc1565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106126cb576126cb613963565b602090810291909101015292915050565b6001600160a01b0384163b15610c125760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906127209089908990889088908890600401613cb3565b6020604051808303816000875af192505050801561275b575060408051601f3d908101601f1916820190925261275891810190613cf8565b60015b61280757612767613d15565b806308c379a0036127a0575061277b613d30565b8061278657506127a2565b8060405162461bcd60e51b8152600401610932919061306d565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610932565b6001600160e01b0319811663f23a6e6160e01b14611e2b5760405162461bcd60e51b815260040161093290613db9565b816001600160a01b0316836001600160a01b0316036128aa5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610932565b6001600160a01b03838116600081815260046020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000306001600160a01b037f000000000000000000000000480ce18ef20e6dcaa807f3df1773615b268edcc11614801561297057507f000000000000000000000000000000000000000000000000000000000000000146145b1561299a57507f97844048d9d2a8568c61965e19786c7dab30d30ecec9dcf51aadb6bfef3db5bd90565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f2128b4d7b100f8f82f742bba9a4e01c6503cca495efdeefa0c857b13652e2da6828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604103612a745760208301516040840151606085015160001a612a6887828585612e48565b94509450505050610be4565b50600090506002610be4565b6000816004811115612a9457612a94613e01565b03612a9c5750565b6001816004811115612ab057612ab0613e01565b03612afd5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610932565b6002816004811115612b1157612b11613e01565b03612b5e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610932565b6003816004811115612b7257612b72613e01565b03610d875760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610932565b6001600160a01b038416612bf05760405162461bcd60e51b815260040161093290613c09565b336000612bfc85612691565b90506000612c0985612691565b9050612c1983898985858961231e565b60008681526003602090815260408083206001600160a01b038c16845290915290205485811015612c5c5760405162461bcd60e51b815260040161093290613c4e565b60008781526003602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612c9b9084906139e0565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612cfb848a8a8a8a8a6126dc565b505050505050505050565b6001600160a01b0384163b15610c125760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612d4a9089908990889088908890600401613e17565b6020604051808303816000875af1925050508015612d85575060408051601f3d908101601f19168201909252612d8291810190613cf8565b60015b612d9157612767613d15565b6001600160e01b0319811663bc197c8160e01b14611e2b5760405162461bcd60e51b815260040161093290613db9565b600d546001600160a01b031615610c1257600d5460405163bc8420a760e01b81526001600160a01b039091169063bc8420a790612e0e9030908a908a908a908a908a908a90600401613e75565b600060405180830381600087803b158015612e2857600080fd5b505af1158015612e3c573d6000803e3d6000fd5b50505050505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612e7f5750600090506003612f03565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612ed3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612efc57600060019250925050612f03565b9150600090505b94509492505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b600060208284031215612f5a57600080fd5b5035919050565b80356001600160a01b0381168114612f7857600080fd5b919050565b60008060408385031215612f9057600080fd5b612f9983612f61565b946020939093013593505050565b6001600160e01b031981168114610d8757600080fd5b600060208284031215612fcf57600080fd5b8135610b3681612fa7565b60008060408385031215612fed57600080fd5b612ff683612f61565b915060208301356001600160601b038116811461301257600080fd5b809150509250929050565b60005b83811015613038578181015183820152602001613020565b50506000910152565b6000815180845261305981602086016020860161301d565b601f01601f19169290920160200192915050565b602081526000610b366020830184613041565b60006020828403121561309257600080fd5b610b3682612f61565b8015158114610d8757600080fd5b6000602082840312156130bb57600080fd5b8135610b368161309b565b600080604083850312156130d957600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715613123576131236130e8565b6040525050565b60006001600160401b03821115613143576131436130e8565b5060051b60200190565b600082601f83011261315e57600080fd5b8135602061316b8261312a565b60405161317882826130fe565b83815260059390931b850182019282810191508684111561319857600080fd5b8286015b848110156131b3578035835291830191830161319c565b509695505050505050565b600082601f8301126131cf57600080fd5b81356001600160401b038111156131e8576131e86130e8565b6040516131ff601f8301601f1916602001826130fe565b81815284602083860101111561321457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561324957600080fd5b61325286612f61565b945061326060208701612f61565b935060408601356001600160401b038082111561327c57600080fd5b61328889838a0161314d565b9450606088013591508082111561329e57600080fd5b6132aa89838a0161314d565b935060808801359150808211156132c057600080fd5b506132cd888289016131be565b9150509295509295909350565b600080604083850312156132ed57600080fd5b82356001600160401b038082111561330457600080fd5b818501915085601f83011261331857600080fd5b813560206133258261312a565b60405161333282826130fe565b83815260059390931b850182019282810191508984111561335257600080fd5b948201945b838610156133775761336886612f61565b82529482019490820190613357565b9650508601359250508082111561338d57600080fd5b5061339a8582860161314d565b9150509250929050565b600081518084526020808501945080840160005b838110156133d4578151875295820195908201906001016133b8565b509495945050505050565b602081526000610b3660208301846133a4565b60006020828403121561340457600080fd5b81356001600160401b0381111561341a57600080fd5b613426848285016131be565b949350505050565b60008060006060848603121561344357600080fd5b61344c84612f61565b925060208401356001600160401b038082111561346857600080fd5b6134748783880161314d565b9350604086013591508082111561348a57600080fd5b506134978682870161314d565b9150509250925092565b61ffff8082511683528060208301511660208401528060408301511660408401526001600160401b03606083015116606084015260808201511515608084015260a0820151151560a08401528060c08301511660c0840152505050565b600081518084526020808501945080840160005b838110156133d4576135258783516134a1565b60e0969096019590820190600101613512565b60408152600061354b60408301856133a4565b828103602084015261355d81856134fe565b95945050505050565b6000806040838503121561357957600080fd5b8235915060208301356001600160401b0381111561359657600080fd5b61339a858286016131be565b60008083601f8401126135b457600080fd5b5081356001600160401b038111156135cb57600080fd5b602083019150836020828501011115610be457600080fd5b80356001600160401b0381168114612f7857600080fd5b60008060008060008060a0878903121561361357600080fd5b86356001600160401b0381111561362957600080fd5b61363589828a016135a2565b909750955050602087013561ffff8116811461365057600080fd5b935061365e604088016135e3565b9250606087013561366e8161309b565b9150608087013561367e8161309b565b809150509295509295509295565b6000806040838503121561369f57600080fd5b823591506136af602084016135e3565b90509250929050565b600080604083850312156136cb57600080fd5b6136d483612f61565b915060208301356130128161309b565b600080600083850360a08112156136fa57600080fd5b84356001600160401b0381111561371057600080fd5b61371c878288016135a2565b9095509350506080601f198201121561373457600080fd5b506020840190509250925092565b60e0810161096082846134a1565b602081526000610b3660208301846134fe565b6000806040838503121561377657600080fd5b61377f83612f61565b91506136af60208401612f61565b600080600080600060a086880312156137a557600080fd5b6137ae86612f61565b94506137bc60208701612f61565b9350604086013592506060860135915060808601356001600160401b038111156137e557600080fd5b6132cd888289016131be565b60008060006060848603121561380657600080fd5b61380f84612f61565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561096057610960613824565b61ffff81811683821601908082111561386857613868613824565b5092915050565b600181811c9082168061388357607f821691505b60208210810361178957634e487b7160e01b600052602260045260246000fd5b60008084546138b18161386f565b600182811680156138c957600181146138de5761390d565b60ff198416875282151583028701945061390d565b8860005260208060002060005b858110156139045781548a8201529084019082016138eb565b50505082870194505b50505050835161392181836020880161301d565b01949350505050565b808202811582820484141761096057610960613824565b60008261395e57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b60006001820161398b5761398b613824565b5060010190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b8082018082111561096057610960613824565b601f821115610e3b57600081815260208120601f850160051c81016020861015613a1a5750805b601f850160051c820191505b81811015610c1257828155600101613a26565b81516001600160401b03811115613a5257613a526130e8565b613a6681613a60845461386f565b846139f3565b602080601f831160018114613a9b5760008415613a835750858301515b600019600386901b1c1916600185901b178555610c12565b600085815260208120601f198616915b82811015613aca57888601518255948401946001909101908401613aab565b5085821015613ae85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b604081526000613bda60408301856133a4565b828103602084015261355d81856133a4565b600060208284031215613bfe57600080fd5b8151610b368161309b565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b61ffff82811682821603908082111561386857613868613824565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613ced90830184613041565b979650505050505050565b600060208284031215613d0a57600080fd5b8151610b3681612fa7565b600060033d111561036b5760046000803e5060005160e01c90565b600060443d1015613d3e5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715613d6d57505050505090565b8285019150815181811115613d855750505050505090565b843d8701016020828501011115613d9f5750505050505090565b613dae602082860101876130fe565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b0386811682528516602082015260a060408201819052600090613e43908301866133a4565b8281036060840152613e5581866133a4565b90508281036080840152613e698185613041565b98975050505050505050565b6001600160a01b038881168252878116602083015286811660408301528516606082015260e060808201819052600090613eb1908301866133a4565b82810360a0840152613ec381866133a4565b905082810360c0840152613ed78185613041565b9a995050505050505050505056fea26469706673582212206bc3802c39c1f8cb9f5227295f8062dd8e9351591118acfae8f219a5966f5c6e64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001600000000000000000000000005c863ba28f926d235550426f0b3e2b27786b66a500000000000000000000000071ddd9b4c03cbb1104eeea5a0167a2eb05afbce30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002668747470733a2f2f666f726b68756e6765722e6172742f666c6f72612f7b69647d2e6a736f6e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d56656e757369616e466c6f72610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013100000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : uri_ (string): https://forkhunger.art/flora/{id}.json
Arg [1] : name_ (string): VenusianFlora
Arg [2] : version_ (string): 1
Arg [3] : signer_ (address): 0x5c863Ba28f926d235550426f0B3e2B27786b66a5
Arg [4] : bank_ (address): 0x71DDD9B4c03cBb1104EeeA5a0167A2EB05AFbce3
Arg [5] : garden_ (address): 0x0000000000000000000000000000000000000000
-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [3] : 0000000000000000000000005c863ba28f926d235550426f0b3e2b27786b66a5
Arg [4] : 00000000000000000000000071ddd9b4c03cbb1104eeea5a0167a2eb05afbce3
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000026
Arg [7] : 68747470733a2f2f666f726b68756e6765722e6172742f666c6f72612f7b6964
Arg [8] : 7d2e6a736f6e0000000000000000000000000000000000000000000000000000
Arg [9] : 000000000000000000000000000000000000000000000000000000000000000d
Arg [10] : 56656e757369616e466c6f726100000000000000000000000000000000000000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [12] : 3100000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.