Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 165 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Approval For... | 18884318 | 419 days ago | IN | 0 ETH | 0.00132171 | ||||
Set Approval For... | 17338851 | 636 days ago | IN | 0 ETH | 0.00119368 | ||||
Set Approval For... | 15980457 | 826 days ago | IN | 0 ETH | 0.00062318 | ||||
Withdraw | 15835143 | 847 days ago | IN | 0 ETH | 0.00059517 | ||||
Safe Transfer Fr... | 15835067 | 847 days ago | IN | 0 ETH | 0.0006921 | ||||
Set Approval For... | 15814432 | 850 days ago | IN | 0 ETH | 0.00061779 | ||||
Set Approval For... | 15804505 | 851 days ago | IN | 0 ETH | 0.00104872 | ||||
Set Approval For... | 15774416 | 855 days ago | IN | 0 ETH | 0.00068132 | ||||
Set Sale Period | 15703790 | 865 days ago | IN | 0 ETH | 0.00020527 | ||||
Safe Transfer Fr... | 15678524 | 869 days ago | IN | 0 ETH | 0.00067587 | ||||
Safe Transfer Fr... | 15678492 | 869 days ago | IN | 0 ETH | 0.00087062 | ||||
Safe Transfer Fr... | 15678470 | 869 days ago | IN | 0 ETH | 0.00063794 | ||||
Safe Transfer Fr... | 15678454 | 869 days ago | IN | 0 ETH | 0.00093265 | ||||
Mint | 15672687 | 869 days ago | IN | 0.0088 ETH | 0.00084634 | ||||
Set Base URI | 15669285 | 870 days ago | IN | 0 ETH | 0.00131858 | ||||
Set Base URI | 15669040 | 870 days ago | IN | 0 ETH | 0.0028354 | ||||
Mint Legendaries | 15668948 | 870 days ago | IN | 0 ETH | 0.00452462 | ||||
Request Reveal | 15668907 | 870 days ago | IN | 0 ETH | 0.00320581 | ||||
Mint | 15663340 | 871 days ago | IN | 0.0088 ETH | 0.00064152 | ||||
Mint | 15663292 | 871 days ago | IN | 0.0088 ETH | 0.00055887 | ||||
Set Sale Period | 15662752 | 871 days ago | IN | 0 ETH | 0.0001469 | ||||
Mint | 15654758 | 872 days ago | IN | 0.0088 ETH | 0.00096078 | ||||
Mint | 15654547 | 872 days ago | IN | 0.0088 ETH | 0.00108561 | ||||
Mint | 15654500 | 872 days ago | IN | 0.0088 ETH | 0.00120502 | ||||
Mint | 15654415 | 872 days ago | IN | 0.0088 ETH | 0.00038312 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
15835143 | 847 days ago | 0.5016 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
TrashPile
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./TrashBase.sol"; import "./EIP712Whitelisting.sol"; contract TrashPile is TrashBase, EIP712Whitelisting { // Number of common variations for each trait uint8[8] private ntraits = [7, 7, 5, 8, 7, 8, 5, 7]; uint256 public constant maxMinted = 7995; // Max supply is 7999, 7995 minted plus 4 legendaries airdropped uint256 public constant maxLegendaries = 4; // 4 unique legendaries airdropped to random holders after mint uint256 public presaleStartTime; uint256 public presaleEndTime; uint256 public constant maxPresale = 1200; // Whitelist presale max number, these are "taken" from maxMinted constructor( address _proxyRegistryAddress, uint256 _saleStartTime, uint256 _saleEndTime, address coordinator, uint32 _callbackGasLimit, uint16 _requestConfirmations, bytes32 _defaultKeyHash, uint64 _vrfsubid ) TrashBase( "Piles of Trash", "PILES", _proxyRegistryAddress, _saleStartTime, _saleEndTime, coordinator, _callbackGasLimit, _requestConfirmations, _defaultKeyHash, _vrfsubid ) EIP712Whitelisting() { setWhitelistSigningAddress(msg.sender); } function mintPresale(bytes calldata signature) external requiresWhitelist(signature) { require(msg.sender == tx.origin, "Contract mint not allowed"); require(_minted < maxPresale, "Sold out"); require(!hasMinted[msg.sender], "Already minted"); require(block.timestamp > presaleStartTime, "Sale has not started"); require(block.timestamp < presaleEndTime, "Sale has ended"); hasMinted[msg.sender] = true; // Always mint 3 _mint(msg.sender, 3); } function setPreSalePeriod(uint256 _startTime, uint256 _endTime) external onlyOwner { presaleStartTime = _startTime; presaleEndTime = _endTime; } function mint() public payable { require(msg.sender == tx.origin, "Contract mint not allowed"); require(msg.value == 8800000000000000, "Include payment"); // Number of NFTs minted until now must be less than 7995 require(_minted < maxMinted, "Sold out"); require(!hasMinted[msg.sender], "Already minted"); require(block.timestamp > saleStartTime, "Sale has not started"); require(block.timestamp < saleEndTime, "Sale has ended"); hasMinted[msg.sender] = true; // Always mint 3 _mint(msg.sender, 3); } function burn(uint256 tokenId, address redeemTo) external { require(block.timestamp > saleEndTime + 86400, "Cannot burn until one day after sale"); require( _isApprovedOrOwner(_msgSender(), tokenId), "Trash: transfer caller is not owner nor approved" ); uint256 nftrarity = rarity(tokenId); require(tokenId < nextCountId, "Cannot burn as token is not in vault"); _burn(tokenId); if (redeemTo == address(0)) { ITrashCan(feeVault).emptyBurn(nftrarity); } else { ITrashCan(feeVault).redeemBurn(nftrarity, redeemTo); } } function redeemValue(uint256 tokenId) external view returns (uint256) { return (feeVault.balance * rarity(tokenId)) / ITrashCan(feeVault).totalPoints(); } function traits(uint256 tokenId) external view returns(uint256[9] memory _traits) { // Check if this is a legendary if (firstLegendaryId > 0 && firstLegendaryId <= tokenId && tokenId < firstLegendaryId + maxLegendaries) { // Set the correct legendary trait, from 1 to maxLegendaries _traits[8] = tokenId - firstLegendaryId + 1; // Every other trait is 0 for legendaries return _traits; } // Not legendary, _traits[8] remains 0. uint256 tokenSeed = seed(tokenId); uint256 rareTraits = 500 / ((tokenSeed % 10000) + 90); // number of rare traits, 0 to 5 // Roll random trait to make rare uint8 nextRareTrait = uint8(accessByte(tokenSeed, uint8(rareTraits) + 10) % ntraits.length); // Continue until no more rare traits to assign while(rareTraits > 0) { // Trait already assigned if (_traits[nextRareTrait] != 0) { // If it's greater than zero, go back one trait // And try again if (nextRareTrait > 0) { --nextRareTrait; continue; } else { // If we're at 0, jump to the last trait // And try again nextRareTrait = uint8(ntraits.length) - 1; continue; } } // Trait not assigned // ntraits[i] + 1 is the ID for the rare variation of that trait _traits[nextRareTrait] = ntraits[nextRareTrait] + 1; --rareTraits; nextRareTrait = uint8(accessByte(tokenSeed, uint8(ntraits.length + rareTraits)) % ntraits.length); } // Roll 8 common traits, 0 to ntraits.length for (uint8 i = 0; i < ntraits.length; i++) { // Trait must be rare, skip it if (_traits[i] != 0) { continue; } // Select number between 1 and ntraits // By rolling between 0 and (ntraits - 1) and adding 1 // This is our (common) trait ID // 0 would indicate absence _traits[i] = (accessByte(tokenSeed, i) % ntraits[i]) + 1; } // Cannot show cat twice if (_traits[6] == 6 && _traits[7] == 8) { _traits[7] = 9; } return _traits; } /* * `10000 / (seed(tokenId) % 10000)` represents the rarity of the NFT. * For example, a result of 20 would mean this NFT is 1 in 20, so among the 5% most rare, * meaning only 5 out of 100 NFTs (500 out of 10000) are as good or better than this one. * Notice that the actual rarity has a bias added (+190 on the denominator) * This is to reduce the extremes, bringing the maximum rarity value down to ~55 from 10000 (!) * Otherwise the top 1% of NFTs would all have over 100 times the value of an "average" one, * the top 0.1% would all have over 1000 times the average value, etc. up to 10k. * In practice this is now always between 1 and ~55, and determines the NFT's share of the vault. * * A function that is proportional to this one but with a different bias is used to determine * the number of rare traits an NFT has. Any NFT with a rarity() score of over 18 here is guaranted to be * assigned one or more rare traits by the corresponding function. Higher scores result in more rare traits. */ function _rarity(uint256 tokenId) internal view returns(uint256) { return (10000 / ((seed(tokenId) % 10000) + 190)) + 1; } function rarity(uint256 tokenId) public view returns(uint256) { // Check if it's a legendary if (firstLegendaryId > 0 && firstLegendaryId <= tokenId && tokenId < firstLegendaryId + maxLegendaries) { // Legendaries have fixed rarity return 100; } // Use regular algorithm return _rarity(tokenId); } function rareTraits(uint256 tokenId) public view returns(uint256) { // Check if it's a legendary if (firstLegendaryId > 0 && firstLegendaryId <= tokenId && tokenId < firstLegendaryId + maxLegendaries) { // Legendaries have fixed rarity return 1; } return 500 / ((seed(tokenId) % 10000) + 90); // number of rare traits, 0 to 5 } // Add total rarity points to vault on-chain uint256 public nextCountId; function addToVault(uint256 amount) external onlyOwner { require(nextCountId < _minted, "Count is complete"); uint256 max = nextCountId + amount < _minted ? nextCountId + amount : _minted; uint256 i; uint256 total = 0; for (i = nextCountId; i < max; ++i) { if (!_exists(i)) continue; total += rarity(i); } nextCountId = i; ITrashCan(feeVault).addPoints(total); } function totalRarityPoints() external view returns (uint256) { uint256 total; for (uint256 i = 0; i < _minted; ++i) { if (!_exists(i)) continue; total += rarity(i); } return total; } // First id of legendary uint256 public firstLegendaryId = 0; // Mint maxLegendaries number of legendaries and airdrop them to random NFT holders function mintLegendaries() external onlyOwner { require(firstLegendaryId == 0, "Legendaries already minted"); // Get random seed uint256 legendarySeed = seed(0); firstLegendaryId = _minted; for (uint256 i = 0; i < maxLegendaries; ++i) { // Pick a random tokenId between 0 and last tokenId minted uint256 tokenId = uint256(keccak256(abi.encode(legendarySeed, keccak256("legendary"), i))) % _minted; // If token does not exist (burned), skip this legendary if (!_exists(tokenId)) continue; // Mint an NFT to the owner of that tokenId _mint(ownerOf(tokenId), 1); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "erc721psi/contracts/extension/ERC721PsiBurnable.sol"; import "./ERC721PsiRandomSeedReveal.sol"; contract OwnableDelegateProxy {} contract OpenSeaProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } interface ITrashCan { function emptyBurn(uint256 rarity) external; function redeemBurn(uint256 rarity, address redeemTo) external; function totalPoints() external view returns (uint256); function addPoints(uint256 amount) external; } abstract contract TrashBase is ERC721PsiRandomSeedReveal, ERC721PsiBurnable, Ownable { using Strings for uint256; bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; string public baseURI = ''; string public contractURI = ''; address public feeVault; bytes32 public defaultKeyHash; uint64 public VRFSubId; uint256 public saleStartTime; uint256 public saleEndTime; address public proxyRegistryAddress; // For gasless listings mapping(address => bool) public isOperator; // Has approval to transfer contract NFTs; Universal operators for this contract mapping(address => bool) public hasOptedOutFromOperators; // Universal operators disabled for this account mapping(address => bool) public hasMinted; // If an account has minted constructor( string memory name_, string memory symbol_, address _proxyRegistryAddress, uint256 _saleStartTime, uint256 _saleEndTime, address coordinator, uint32 _callbackGasLimit, uint16 _requestConfirmations, bytes32 _defaultKeyHash, uint64 _vrfsubid ) ERC721Psi(name_, symbol_) ERC721PsiRandomSeedReveal( coordinator, _callbackGasLimit, _requestConfirmations ) { proxyRegistryAddress = _proxyRegistryAddress; saleStartTime = _saleStartTime; defaultKeyHash = _defaultKeyHash; VRFSubId = _vrfsubid; saleEndTime = _saleEndTime; } function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns ( address receiver, uint256 royaltyAmount ) { return (address(feeVault), (_salePrice * 75) / 1000); } function supportsInterface(bytes4 interfaceId) public view override(ERC721Psi) returns (bool) { return interfaceId == _INTERFACE_ID_ERC2981 || super.supportsInterface(interfaceId); } function accessByte(uint256 _number, uint8 _index) public pure returns (uint8) { return uint8(bytes32(_number)[_index]); } function setOperatorOptOut(bool _optOut) external { hasOptedOutFromOperators[msg.sender] = _optOut; } function isApprovedForAll(address _owner, address operator) public view override returns (bool) { // If the owner has not opted out from operators if (!hasOptedOutFromOperators[_owner]) { // This is an operator, give them approval if (isOperator[operator]) return true; // Automatically consider opensea proxies approved, allows gasless listing OpenSeaProxyRegistry proxyRegistry = OpenSeaProxyRegistry(proxyRegistryAddress); if (address(proxyRegistry.proxies(_owner)) == operator) return true; } // Fallback to regular logic return super.isApprovedForAll(_owner, operator); } function withdraw() public onlyOwner { payable(owner()).transfer(payable(address(this)).balance); } function _baseURI() internal view override returns (string memory) { return baseURI; } function setBaseURI(string memory _newBaseURI) public onlyOwner { baseURI = _newBaseURI; } function setContractURI(string calldata _uri) external onlyOwner { contractURI = _uri; } function setSalePeriod(uint256 _startTime, uint256 _endTime) external onlyOwner { saleStartTime = _startTime; saleEndTime = _endTime; } function setOpenSeaProxyRegistry(address _proxyRegistryAddress) external onlyOwner { proxyRegistryAddress = _proxyRegistryAddress; } function setOperator(address _operator, bool _enabled) external onlyOwner { isOperator[_operator] = _enabled; } function setVault(address _vault) external onlyOwner { feeVault = _vault; } function setKeyHash(bytes32 _newkeyhash) external onlyOwner { defaultKeyHash = _newkeyhash; } function setSubId(uint64 _newSubId) external onlyOwner { VRFSubId = _newSubId; } function _keyHash() internal override returns (bytes32) { return defaultKeyHash; } function _subscriptionId() internal override returns (uint64) { return VRFSubId; } function requestReveal() external onlyOwner { _reveal(); } function totalSupply() public view override(ERC721Psi, ERC721PsiBurnable) returns (uint256) { return super.totalSupply(); } function _exists(uint256 tokenId) internal view override(ERC721Psi, ERC721PsiBurnable) returns (bool) { return super._exists(tokenId); } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Psi: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString(), ".json")) : ""; } }
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract EIP712Whitelisting is Ownable { using ECDSA for bytes32; // The key used to sign whitelist signatures. // We will check to ensure that the key that signed the signature // is this one that we expect. address whitelistSigningKey = address(0); // Domain Separator is the EIP-712 defined structure that defines what contract // and chain these signatures can be used for. This ensures people can't take // a signature used to mint on one contract and use it for another, or a signature // from testnet to replay on mainnet. // It has to be created in the constructor so we can dynamically grab the chainId. // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#definition-of-domainseparator bytes32 public DOMAIN_SEPARATOR; // The typehash for the data type specified in the structured data // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#rationale-for-typehash // This should match whats in the client side whitelist signing code // https://github.com/msfeldstein/EIP712-whitelisting/blob/main/test/signWhitelist.ts#L22 bytes32 public constant MINTER_TYPEHASH = keccak256("Minter(address wallet)"); constructor() { // This should match whats in the client side whitelist signing code // https://github.com/msfeldstein/EIP712-whitelisting/blob/main/test/signWhitelist.ts#L12 DOMAIN_SEPARATOR = keccak256( abi.encode( keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ), // This should match the domain you set in your client side signing. keccak256(bytes("TrashPiles")), keccak256(bytes("1")), block.chainid, address(this) ) ); } function setWhitelistSigningAddress(address newSigningKey) public onlyOwner { whitelistSigningKey = newSigningKey; } modifier requiresWhitelist(bytes calldata signature) { require(whitelistSigningKey != address(0), "whitelist not enabled"); // Verify EIP-712 signature by recreating the data structure // that we signed on the client side, and then using that to recover // the address that signed the signature for this data. bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, keccak256(abi.encode(MINTER_TYPEHASH, msg.sender)) ) ); // Use the recover method to see what address was used to create // the signature on this data. // Note that if the digest doesn't exactly match what was signed we'll // get a random recovered address. address recoveredAddress = digest.recover(signature); require(recoveredAddress == whitelistSigningKey, "Invalid Signature"); _; } function checkWhitelist(bytes calldata signature, address account) external view returns (bool) { require(whitelistSigningKey != address(0), "whitelist not enabled"); // Verify EIP-712 signature by recreating the data structure // that we signed on the client side, and then using that to recover // the address that signed the signature for this data. bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, keccak256(abi.encode(MINTER_TYPEHASH, account)) ) ); // Use the recover method to see what address was used to create // the signature on this data. // Note that if the digest doesn't exactly match what was signed we'll // get a random recovered address. address recoveredAddress = digest.recover(signature); if (recoveredAddress == whitelistSigningKey){ return true; } return false; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT /** ______ _____ _____ ______ ___ __ _ _ _ | ____| __ \ / ____|____ |__ \/_ | || || | | |__ | |__) | | / / ) || | \| |/ | | __| | _ /| | / / / / | |\_ _/ | |____| | \ \| |____ / / / /_ | | | | |______|_| \_\\_____|/_/ |____||_| |_| */ pragma solidity ^0.8.0; import "solidity-bits/contracts/BitMaps.sol"; import "../ERC721Psi.sol"; abstract contract ERC721PsiBurnable is ERC721Psi { using BitMaps for BitMaps.BitMap; BitMaps.BitMap private _burnedToken; /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address from = ownerOf(tokenId); _beforeTokenTransfers(from, address(0), tokenId, 1); _burnedToken.set(tokenId); emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view override virtual returns (bool){ if(_burnedToken.get(tokenId)) { return false; } return super._exists(tokenId); } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _minted - _burned(); } /** * @dev Returns number of token burned. */ function _burned() internal view returns (uint256 burned){ uint256 totalBucket = (_minted >> 8) + 1; for(uint256 i=0; i < totalBucket; i++) { uint256 bucket = _burnedToken.getBucket(i); burned += _popcount(bucket); } } /** * @dev Returns number of set bits. */ function _popcount(uint256 x) private pure returns (uint256 count) { unchecked{ for (count=0; x!=0; count++) x &= x - 1; } } }
// SPDX-License-Identifier: MIT /** ______ _____ _____ ______ ___ __ _ _ _ | ____| __ \ / ____|____ |__ \/_ | || || | | |__ | |__) | | / / ) || | \| |/ | | __| | _ /| | / / / / | |\_ _/ | |____| | \ \| |____ / / / /_ | | | | |______|_| \_\\_____|/_/ |____||_| |_| */ pragma solidity ^0.8.0; import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; import "erc721psi/contracts/ERC721Psi.sol"; import "erc721psi/contracts/interface/IERC721RandomSeed.sol"; abstract contract ERC721PsiRandomSeedReveal is ERC721Psi, IERC721RandomSeed, VRFConsumerBaseV2 { // Chainklink VRF V2 VRFCoordinatorV2Interface immutable COORDINATOR; uint32 immutable callbackGasLimit; uint16 immutable requestConfirmations; uint16 constant numWords = 1; // requestId => genId mapping(uint256 => uint256) private requestIdToGenId; // genId => seed mapping(uint256 => uint256) private genSeed; // genId => tokenId threshold mapping(uint256 => uint256) private genThreshold; // current genId for minting uint256 private currentGen; event RandomnessRequest(uint256 requestId); constructor( address coordinator, uint32 _callbackGasLimit, uint16 _requestConfirmations ) VRFConsumerBaseV2(coordinator) { COORDINATOR = VRFCoordinatorV2Interface(coordinator); callbackGasLimit = _callbackGasLimit; requestConfirmations = _requestConfirmations; } /** * Callback function used by VRF Coordinator */ function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { uint256 randomness = randomWords[0]; uint256 genId = requestIdToGenId[requestId]; delete requestIdToGenId[genId]; genSeed[genId] = randomness; _processRandomnessFulfillment(requestId, genId, randomness); } /** @dev Request the randomess for the tokens of the current generation. */ function _reveal() internal virtual { uint256 requestId = COORDINATOR.requestRandomWords( _keyHash(), _subscriptionId(), requestConfirmations, callbackGasLimit, numWords ); emit RandomnessRequest(requestId); requestIdToGenId[requestId] = currentGen; _processRandomnessRequest(requestId, currentGen); genThreshold[currentGen] = _minted; currentGen++; } /** @dev Query the generation of `tokenId`. */ function _tokenGen(uint256 tokenId) internal view returns (uint256) { // Find the generation the tokenId belongs to by checking it against genThreshold for (uint256 i = 0; i < currentGen; ++i) { if (tokenId < genThreshold[i]) { return i; } } return currentGen; } /** @dev Return the random seed of `tokenId`. Revert when the randomness hasn't been fulfilled. */ function seed(uint256 tokenId) public virtual override view returns (uint256){ require(_exists(tokenId), "ERC721PsiRandomSeedReveal: seed query for nonexistent token"); unchecked { uint256 _genSeed = genSeed[_tokenGen(tokenId)]; require(_genSeed != 0, "ERC721PsiRandomSeedReveal: Randomness hasn't been fullfilled"); return uint256(keccak256( abi.encode(_genSeed, tokenId) )); } } /** @dev Return the random seed of `tokenId` with extra nonce. Revert when the randomness hasn't been fulfilled. */ function seedWithNonce(uint256 tokenId, uint256 nonce) public virtual view returns (uint256){ require(_exists(tokenId), "ERC721PsiRandomSeedReveal: seed query for nonexistent token"); unchecked { uint256 _genSeed = genSeed[_tokenGen(tokenId)]; require(_genSeed != 0, "ERC721PsiRandomSeedReveal: Randomness hasn't been fullfilled"); return uint256(keccak256( abi.encode(_genSeed, tokenId, nonce) )); } } /** @dev Override the function to provide the corrosponding keyHash for the Chainlink VRF V2. see also: https://docs.chain.link/docs/vrf-contracts/ */ function _keyHash() internal virtual returns (bytes32); /** @dev Override the function to provide the corrosponding subscription id for the Chainlink VRF V2. see also: https://docs.chain.link/docs/get-a-random-number/#create-and-fund-a-subscription */ function _subscriptionId() internal virtual returns (uint64); function _processRandomnessRequest(uint256 requestId, uint256 genId) internal { } function _processRandomnessFulfillment(uint256 requestId, uint256 genId, uint256 randomness) internal { } }
// 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 /** _____ ___ ___ __ ____ _ __ / ___/____ / (_)___/ (_) /___ __ / __ )(_) /______ \__ \/ __ \/ / / __ / / __/ / / / / __ / / __/ ___/ ___/ / /_/ / / / /_/ / / /_/ /_/ / / /_/ / / /_(__ ) /____/\____/_/_/\__,_/_/\__/\__, / /_____/_/\__/____/ /____/ - npm: https://www.npmjs.com/package/solidity-bits - github: https://github.com/estarriolvetch/solidity-bits */ pragma solidity ^0.8.0; import "./BitScan.sol"; /** * @dev This Library is a modified version of Openzeppelin's BitMaps library. * Functions of finding the index of the closest set bit from a given index are added. * The indexing of each bucket is modifed to count from the MSB to the LSB instead of from the LSB to the MSB. * The modification of indexing makes finding the closest previous set bit more efficient in gas usage. */ /** * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential. * Largelly inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor]. */ library BitMaps { using BitScan for uint256; uint256 private constant MASK_INDEX_ZERO = (1 << 255); struct BitMap { mapping(uint256 => uint256) _data; } /** * @dev Returns whether the bit at `index` is set. */ function get(BitMap storage bitmap, uint256 index) internal view returns (bool) { uint256 bucket = index >> 8; uint256 mask = MASK_INDEX_ZERO >> (index & 0xff); return bitmap._data[bucket] & mask != 0; } /** * @dev Sets the bit at `index` to the boolean `value`. */ function setTo( BitMap storage bitmap, uint256 index, bool value ) internal { if (value) { set(bitmap, index); } else { unset(bitmap, index); } } /** * @dev Sets the bit at `index`. */ function set(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = MASK_INDEX_ZERO >> (index & 0xff); bitmap._data[bucket] |= mask; } /** * @dev Unsets the bit at `index`. */ function unset(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = MASK_INDEX_ZERO >> (index & 0xff); bitmap._data[bucket] &= ~mask; } /** * @dev Find the closest index of the set bit before `index`. */ function scanForward(BitMap storage bitmap, uint256 index) internal view returns (uint256) { uint256 bucket = index >> 8; // index within the bucket uint256 bucketIndex = (index & 0xff); // load a bitboard from the bitmap. uint256 bb = bitmap._data[bucket]; // offset the bitboard to scan from `bucketIndex`. bb = bb >> (0xff ^ bucketIndex); // bb >> (255 - bucketIndex) if(bb > 0) { unchecked { return (bucket << 8) | (bucketIndex - bb.bitScanForward256()); } } else { while(true) { require(bucket > 0, "BitMaps: The set bit before the index doesn't exist."); unchecked { bucket--; } // No offset. Always scan from the least significiant bit now. bb = bitmap._data[bucket]; if(bb > 0) { unchecked { return (bucket << 8) | (255 - bb.bitScanForward256()); } } } } } function getBucket(BitMap storage bitmap, uint256 bucket) internal view returns (uint256) { return bitmap._data[bucket]; } }
// SPDX-License-Identifier: MIT /** ______ _____ _____ ______ ___ __ _ _ _ | ____| __ \ / ____|____ |__ \/_ | || || | | |__ | |__) | | / / ) || | \| |/ | | __| | _ /| | / / / / | |\_ _/ | |____| | \ \| |____ / / / /_ | | | | |______|_| \_\\_____|/_/ |____||_| |_| */ pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/StorageSlot.sol"; import "solidity-bits/contracts/BitMaps.sol"; contract ERC721Psi is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; using BitMaps for BitMaps.BitMap; BitMaps.BitMap private _batchHead; string private _name; string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) internal _owners; uint256 internal _minted; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint) { require(owner != address(0), "ERC721Psi: balance query for the zero address"); uint count; for( uint i; i < _minted; ++i ){ if(_exists(i)){ if( owner == ownerOf(i)){ ++count; } } } return count; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { (address owner, uint256 tokenIdBatchHead) = _ownerAndBatchHeadOf(tokenId); return owner; } function _ownerAndBatchHeadOf(uint256 tokenId) internal view returns (address owner, uint256 tokenIdBatchHead){ require(_exists(tokenId), "ERC721Psi: owner query for nonexistent token"); tokenIdBatchHead = _getBatchHead(tokenId); owner = _owners[tokenIdBatchHead]; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Psi: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString(), ".json")) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); require(to != owner, "ERC721Psi: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721Psi: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require( _exists(tokenId), "ERC721Psi: approved query for nonexistent token" ); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721Psi: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721Psi: transfer caller is not owner nor approved" ); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721Psi: transfer caller is not owner nor approved" ); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require( _checkOnERC721Received(from, to, tokenId, 1,_data), "ERC721Psi: transfer to non ERC721Receiver implementer" ); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return tokenId < _minted; } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require( _exists(tokenId), "ERC721Psi: operator query for nonexistent token" ); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ""); } function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { uint256 startTokenId = _minted; _mint(to, quantity); require( _checkOnERC721Received(address(0), to, startTokenId, quantity, _data), "ERC721Psi: transfer to non ERC721Receiver implementer" ); } function _mint( address to, uint256 quantity ) internal virtual { uint256 tokenIdBatchHead = _minted; require(quantity > 0, "ERC721Psi: quantity must be greater 0"); require(to != address(0), "ERC721Psi: mint to the zero address"); _beforeTokenTransfers(address(0), to, tokenIdBatchHead, quantity); _minted += quantity; _owners[tokenIdBatchHead] = to; _batchHead.set(tokenIdBatchHead); _afterTokenTransfers(address(0), to, tokenIdBatchHead, quantity); // Emit events for(uint256 tokenId=tokenIdBatchHead;tokenId < tokenIdBatchHead + quantity; tokenId++){ emit Transfer(address(0), to, tokenId); } } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { (address owner, uint256 tokenIdBatchHead) = _ownerAndBatchHeadOf(tokenId); require( owner == from, "ERC721Psi: transfer of token that is not own" ); require(to != address(0), "ERC721Psi: transfer to the zero address"); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId); uint256 nextTokenId = tokenId + 1; if(!_batchHead.get(nextTokenId) && nextTokenId < _minted ) { _owners[nextTokenId] = from; _batchHead.set(nextTokenId); } _owners[tokenId] = to; if(tokenId != tokenIdBatchHead) { _batchHead.set(tokenId); } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param startTokenId uint256 the first ID of the tokens to be transferred * @param quantity uint256 amount of the tokens to be transfered. * @param _data bytes optional data to send along with the call * @return r bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 startTokenId, uint256 quantity, bytes memory _data ) private returns (bool r) { if (to.isContract()) { r = true; for(uint256 tokenId = startTokenId; tokenId < startTokenId + quantity; tokenId++){ try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { r = r && retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721Psi: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } return r; } else { return true; } } function _getBatchHead(uint256 tokenId) internal view returns (uint256 tokenIdBatchHead) { tokenIdBatchHead = _batchHead.scanForward(tokenId); } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _minted; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < totalSupply(), "ERC721Psi: global index out of bounds"); uint count; for(uint i; i < _minted; i++){ if(_exists(i)){ if(count == index) return i; else count++; } } } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256 tokenId) { uint count; for(uint i; i < _minted; i++){ if(_exists(i) && owner == ownerOf(i)){ if(count == index) return i; else count++; } } revert("ERC721Psi: owner index out of bounds"); } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} }
// SPDX-License-Identifier: MIT /** _____ ___ ___ __ ____ _ __ / ___/____ / (_)___/ (_) /___ __ / __ )(_) /______ \__ \/ __ \/ / / __ / / __/ / / / / __ / / __/ ___/ ___/ / /_/ / / / /_/ / / /_/ /_/ / / /_/ / / /_(__ ) /____/\____/_/_/\__,_/_/\__/\__, / /_____/_/\__/____/ /____/ - npm: https://www.npmjs.com/package/solidity-bits - github: https://github.com/estarriolvetch/solidity-bits */ pragma solidity ^0.8.0; library BitScan { uint256 constant private DEBRUIJN_256 = 0x818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff; bytes constant private LOOKUP_TABLE_256 = hex"0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8"; /** @dev Isolate the least significant set bit. */ function isolateLS1B256(uint256 bb) pure internal returns (uint256) { require(bb > 0); unchecked { return bb & (0 - bb); } } /** @dev Isolate the most significant set bit. */ function isolateMS1B256(uint256 bb) pure internal returns (uint256) { require(bb > 0); unchecked { bb |= bb >> 256; bb |= bb >> 128; bb |= bb >> 64; bb |= bb >> 32; bb |= bb >> 16; bb |= bb >> 8; bb |= bb >> 4; bb |= bb >> 2; bb |= bb >> 1; return (bb >> 1) + 1; } } /** @dev Find the index of the lest significant set bit. (trailing zero count) */ function bitScanForward256(uint256 bb) pure internal returns (uint8) { unchecked { return uint8(LOOKUP_TABLE_256[(isolateLS1B256(bb) * DEBRUIJN_256) >> 248]); } } /** @dev Find the index of the most significant set bit. */ function bitScanReverse256(uint256 bb) pure internal returns (uint8) { unchecked { return 255 - uint8(LOOKUP_TABLE_256[((isolateMS1B256(bb) * DEBRUIJN_256) >> 248)]); } } function log2(uint256 bb) pure internal returns (uint8) { unchecked { return uint8(LOOKUP_TABLE_256[(isolateMS1B256(bb) * DEBRUIJN_256) >> 248]); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// 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) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @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 (last updated v4.7.0) (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } }
// 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 pragma solidity ^0.8.0; interface VRFCoordinatorV2Interface { /** * @notice Get configuration relevant for making requests * @return minimumRequestConfirmations global min for request confirmations * @return maxGasLimit global max for request gas limit * @return s_provingKeyHashes list of registered key hashes */ function getRequestConfig() external view returns ( uint16, uint32, bytes32[] memory ); /** * @notice Request a set of random words. * @param keyHash - Corresponds to a particular oracle job which uses * that key for generating the VRF proof. Different keyHash's have different gas price * ceilings, so you can select a specific one to bound your maximum per request cost. * @param subId - The ID of the VRF subscription. Must be funded * with the minimum subscription balance required for the selected keyHash. * @param minimumRequestConfirmations - How many blocks you'd like the * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS * for why you may want to request more. The acceptable range is * [minimumRequestBlockConfirmations, 200]. * @param callbackGasLimit - How much gas you'd like to receive in your * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords * may be slightly less than this amount because of gas used calling the function * (argument decoding etc.), so you may need to request slightly more than you expect * to have inside fulfillRandomWords. The acceptable range is * [0, maxGasLimit] * @param numWords - The number of uint256 random values you'd like to receive * in your fulfillRandomWords callback. Note these numbers are expanded in a * secure way by the VRFCoordinator from a single random value supplied by the oracle. * @return requestId - A unique identifier of the request. Can be used to match * a request to a response in fulfillRandomWords. */ function requestRandomWords( bytes32 keyHash, uint64 subId, uint16 minimumRequestConfirmations, uint32 callbackGasLimit, uint32 numWords ) external returns (uint256 requestId); /** * @notice Create a VRF subscription. * @return subId - A unique subscription id. * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer. * @dev Note to fund the subscription, use transferAndCall. For example * @dev LINKTOKEN.transferAndCall( * @dev address(COORDINATOR), * @dev amount, * @dev abi.encode(subId)); */ function createSubscription() external returns (uint64 subId); /** * @notice Get a VRF subscription. * @param subId - ID of the subscription * @return balance - LINK balance of the subscription in juels. * @return reqCount - number of requests for this subscription, determines fee tier. * @return owner - owner of the subscription. * @return consumers - list of consumer address which are able to use this subscription. */ function getSubscription(uint64 subId) external view returns ( uint96 balance, uint64 reqCount, address owner, address[] memory consumers ); /** * @notice Request subscription owner transfer. * @param subId - ID of the subscription * @param newOwner - proposed new owner of the subscription */ function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external; /** * @notice Request subscription owner transfer. * @param subId - ID of the subscription * @dev will revert if original owner of subId has * not requested that msg.sender become the new owner. */ function acceptSubscriptionOwnerTransfer(uint64 subId) external; /** * @notice Add a consumer to a VRF subscription. * @param subId - ID of the subscription * @param consumer - New consumer which can use the subscription */ function addConsumer(uint64 subId, address consumer) external; /** * @notice Remove a consumer from a VRF subscription. * @param subId - ID of the subscription * @param consumer - Consumer to remove from the subscription */ function removeConsumer(uint64 subId, address consumer) external; /** * @notice Cancel a subscription * @param subId - ID of the subscription * @param to - Where to send the remaining LINK to */ function cancelSubscription(uint64 subId, address to) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /** **************************************************************************** * @notice Interface for contracts using VRF randomness * ***************************************************************************** * @dev PURPOSE * * @dev Reggie the Random Oracle (not his real job) wants to provide randomness * @dev to Vera the verifier in such a way that Vera can be sure he's not * @dev making his output up to suit himself. Reggie provides Vera a public key * @dev to which he knows the secret key. Each time Vera provides a seed to * @dev Reggie, he gives back a value which is computed completely * @dev deterministically from the seed and the secret key. * * @dev Reggie provides a proof by which Vera can verify that the output was * @dev correctly computed once Reggie tells it to her, but without that proof, * @dev the output is indistinguishable to her from a uniform random sample * @dev from the output space. * * @dev The purpose of this contract is to make it easy for unrelated contracts * @dev to talk to Vera the verifier about the work Reggie is doing, to provide * @dev simple access to a verifiable source of randomness. It ensures 2 things: * @dev 1. The fulfillment came from the VRFCoordinator * @dev 2. The consumer contract implements fulfillRandomWords. * ***************************************************************************** * @dev USAGE * * @dev Calling contracts must inherit from VRFConsumerBase, and can * @dev initialize VRFConsumerBase's attributes in their constructor as * @dev shown: * * @dev contract VRFConsumer { * @dev constructor(<other arguments>, address _vrfCoordinator, address _link) * @dev VRFConsumerBase(_vrfCoordinator) public { * @dev <initialization with other arguments goes here> * @dev } * @dev } * * @dev The oracle will have given you an ID for the VRF keypair they have * @dev committed to (let's call it keyHash). Create subscription, fund it * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface * @dev subscription management functions). * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations, * @dev callbackGasLimit, numWords), * @dev see (VRFCoordinatorInterface for a description of the arguments). * * @dev Once the VRFCoordinator has received and validated the oracle's response * @dev to your request, it will call your contract's fulfillRandomWords method. * * @dev The randomness argument to fulfillRandomWords is a set of random words * @dev generated from your requestId and the blockHash of the request. * * @dev If your contract could have concurrent requests open, you can use the * @dev requestId returned from requestRandomWords to track which response is associated * @dev with which randomness request. * @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind, * @dev if your contract could have multiple requests in flight simultaneously. * * @dev Colliding `requestId`s are cryptographically impossible as long as seeds * @dev differ. * * ***************************************************************************** * @dev SECURITY CONSIDERATIONS * * @dev A method with the ability to call your fulfillRandomness method directly * @dev could spoof a VRF response with any random value, so it's critical that * @dev it cannot be directly called by anything other than this base contract * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method). * * @dev For your users to trust that your contract's random behavior is free * @dev from malicious interference, it's best if you can write it so that all * @dev behaviors implied by a VRF response are executed *during* your * @dev fulfillRandomness method. If your contract must store the response (or * @dev anything derived from it) and use it later, you must ensure that any * @dev user-significant behavior which depends on that stored value cannot be * @dev manipulated by a subsequent VRF request. * * @dev Similarly, both miners and the VRF oracle itself have some influence * @dev over the order in which VRF responses appear on the blockchain, so if * @dev your contract could have multiple VRF requests in flight simultaneously, * @dev you must ensure that the order in which the VRF responses arrive cannot * @dev be used to manipulate your contract's user-significant behavior. * * @dev Since the block hash of the block which contains the requestRandomness * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful * @dev miner could, in principle, fork the blockchain to evict the block * @dev containing the request, forcing the request to be included in a * @dev different block with a different hash, and therefore a different input * @dev to the VRF. However, such an attack would incur a substantial economic * @dev cost. This cost scales with the number of blocks the VRF oracle waits * @dev until it calls responds to a request. It is for this reason that * @dev that you can signal to an oracle you'd like them to wait longer before * @dev responding to the request (however this is not enforced in the contract * @dev and so remains effective only in the case of unmodified oracle software). */ abstract contract VRFConsumerBaseV2 { error OnlyCoordinatorCanFulfill(address have, address want); address private immutable vrfCoordinator; /** * @param _vrfCoordinator address of VRFCoordinator contract */ constructor(address _vrfCoordinator) { vrfCoordinator = _vrfCoordinator; } /** * @notice fulfillRandomness handles the VRF response. Your contract must * @notice implement it. See "SECURITY CONSIDERATIONS" above for important * @notice principles to keep in mind when implementing your fulfillRandomness * @notice method. * * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this * @dev signature, and will call it once it has verified the proof * @dev associated with the randomness. (It is triggered via a call to * @dev rawFulfillRandomness, below.) * * @param requestId The Id initially returned by requestRandomness * @param randomWords the VRF output expanded to the requested number of words */ function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual; // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF // proof. rawFulfillRandomness then calls fulfillRandomness, after validating // the origin of the call function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external { if (msg.sender != vrfCoordinator) { revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator); } fulfillRandomWords(requestId, randomWords); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC721RandomSeed { function seed(uint256 tokenId) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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 } 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"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' 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) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ 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 if (signature.length == 64) { bytes32 r; bytes32 vs; // 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)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } 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 (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // 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)); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_proxyRegistryAddress","type":"address"},{"internalType":"uint256","name":"_saleStartTime","type":"uint256"},{"internalType":"uint256","name":"_saleEndTime","type":"uint256"},{"internalType":"address","name":"coordinator","type":"address"},{"internalType":"uint32","name":"_callbackGasLimit","type":"uint32"},{"internalType":"uint16","name":"_requestConfirmations","type":"uint16"},{"internalType":"bytes32","name":"_defaultKeyHash","type":"bytes32"},{"internalType":"uint64","name":"_vrfsubid","type":"uint64"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"RandomnessRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VRFSubId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_number","type":"uint256"},{"internalType":"uint8","name":"_index","type":"uint8"}],"name":"accessByte","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addToVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"redeemTo","type":"address"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"account","type":"address"}],"name":"checkWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeVault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstLegendaryId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasOptedOutFromOperators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxLegendaries","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPresale","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintLegendaries","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mintPresale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextCountId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyRegistryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"rareTraits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"rarity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"redeemValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestReveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"seed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"seedWithNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_newkeyhash","type":"bytes32"}],"name":"setKeyHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_proxyRegistryAddress","type":"address"}],"name":"setOpenSeaProxyRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_optOut","type":"bool"}],"name":"setOperatorOptOut","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setPreSalePeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setSalePeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_newSubId","type":"uint64"}],"name":"setSubId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"setVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSigningKey","type":"address"}],"name":"setWhitelistSigningAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRarityPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"traits","outputs":[{"internalType":"uint256[9]","name":"_traits","type":"uint256[9]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
610120604081905260006101008190526200001d91600d91620003af565b506040805160208101918290526000908190526200003e91600e91620003af565b50601880546001600160a01b0319169055604080516101008101825260078082526020820181905260059282018390526008606083018190526080830182905260a0830181905260c083019390935260e0820152620000a191601a91906200043e565b506000601e55348015620000b457600080fd5b5060405162004b8d38038062004b8d833981016040819052620000d79162000502565b6040518060400160405280600e81526020016d0a0d2d8cae640decc40a8e4c2e6d60931b8152506040518060400160405280600581526020016450494c455360d81b8152508989898989898989848484828d8d816001908051906020019062000142929190620003af565b50805162000158906002906020840190620003af565b5050506001600160a01b039081166080529290921660a05263ffffffff1660c05261ffff1660e0526200018b33620002d0565b601480546001600160a01b0319166001600160a01b039990991698909817909755601295909555505050601091909155601180546001600160401b0319166001600160401b03909316929092179091556013555050604080518082018252600a815269547261736850696c657360b01b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f918101919091527fb5dc2445a77ea23d849b0e24056342f076e2c60e9ca70cec63cabe5376f0568c918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f198184030181529190528051602090910120601955620002c23362000322565b5050505050505050620005ef565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6200032c6200034e565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b600c546001600160a01b03163314620003ad5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b565b828054620003bd90620005b2565b90600052602060002090601f016020900481019282620003e157600085556200042c565b82601f10620003fc57805160ff19168380011785556200042c565b828001600101855582156200042c579182015b828111156200042c5782518255916020019190600101906200040f565b506200043a929150620004ce565b5090565b6001830191839082156200042c5791602002820160005b838211156200049557835183826101000a81548160ff021916908360ff160217905550926020019260010160208160000104928301926001030262000455565b8015620004c45782816101000a81549060ff021916905560010160208160000104928301926001030262000495565b50506200043a9291505b5b808211156200043a5760008155600101620004cf565b80516001600160a01b0381168114620004fd57600080fd5b919050565b600080600080600080600080610100898b0312156200052057600080fd5b6200052b89620004e5565b975060208901519650604089015195506200054960608a01620004e5565b9450608089015163ffffffff811681146200056357600080fd5b60a08a015190945061ffff811681146200057c57600080fd5b60c08a015160e08b015191945092506001600160401b0381168114620005a157600080fd5b809150509295985092959890939650565b600181811c90821680620005c757607f821691505b60208210811415620005e957634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e05161455d620006306000396000612f9201526000612fbe01526000612f210152600081816110ce0152611110015261455d6000f3fe6080604052600436106103ef5760003560e01c806370a0823111610208578063b88d4fde11610118578063d2d58daa116100ab578063ee9e9a2c1161007a578063ee9e9a2c14610bc2578063f2fde38b14610bd8578063f7c61fe214610bf8578063fa4d280c14610c28578063fcd3533c14610c5c57600080fd5b8063d2d58daa14610b61578063e8a3d48514610b77578063e985e9c514610b8c578063ed338ff114610bac57600080fd5b8063c87b56dd116100e7578063c87b56dd14610ae1578063c9b8b4e814610b01578063cd77083314610b21578063cd7c032614610b4157600080fd5b8063b88d4fde14610a6c578063ba1c3b9214610a8c578063ba9da85d14610aac578063c2b54d1a14610acc57600080fd5b8063938e3d7b1161019b578063a22cb4651161016a578063a22cb465146109e1578063a4d925f114610a01578063a4e0184814610a21578063a82524b214610a41578063b07870b514610a5757600080fd5b8063938e3d7b1461096c578063955648371461098c57806395d89b41146109ac57806398544710146109c157600080fd5b8063851c2f6c116101d7578063851c2f6c146108e75780638a01f0a0146109195780638b58c5691461092e5780638da5cb5b1461094e57600080fd5b806370a0823114610862578063715018a61461088257806376140b3a1461089757806378d9cd53146108d257600080fd5b80633644e51511610303578063478222c21161029657806360f6dd491161026557806360f6dd49146107bd5780636352211e146107dd5780636817031b146107fd5780636c0360eb1461081d5780636d70f7ae1461083257600080fd5b8063478222c21461073d5780634f6ccce71461075d578063558a72971461077d57806355f804b31461079d57600080fd5b80633e2831fe116102d25780633e2831fe146106bd5780633e491337146106dd57806342842e0e146106fd578063458b352e1461071d57600080fd5b80633644e515146106425780633691a9e21461065857806338e21cce146106785780633ccfd60b146106a857600080fd5b80631fe543e311610386578063263522581161035557806326352258146105685780632a55205a1461057e5780632d72225b146105bd5780632f745c59146105ea57806335698c8e1461060a57600080fd5b80631fe543e3146104fc5780632142ab291461051c57806323b872dd14610532578063249b7c191461055257600080fd5b8063095ea7b3116103c2578063095ea7b3146104a75780631249c58b146104c957806318160ddd146104d15780631cbaee2d146104e657600080fd5b806301ffc9a7146103f457806306fdde0314610429578063081008161461044b578063081812fc1461046f575b600080fd5b34801561040057600080fd5b5061041461040f366004613a8f565b610c7c565b60405190151581526020015b60405180910390f35b34801561043557600080fd5b5061043e610ca7565b6040516104209190613b04565b34801561045757600080fd5b50610461601e5481565b604051908152602001610420565b34801561047b57600080fd5b5061048f61048a366004613b17565b610d39565b6040516001600160a01b039091168152602001610420565b3480156104b357600080fd5b506104c76104c2366004613b45565b610dc9565b005b6104c7610ee1565b3480156104dd57600080fd5b506104616110b4565b3480156104f257600080fd5b5061046160125481565b34801561050857600080fd5b506104c7610517366004613bb7565b6110c3565b34801561052857600080fd5b506104616104b081565b34801561053e57600080fd5b506104c761054d366004613c68565b61114b565b34801561055e57600080fd5b50610461601c5481565b34801561057457600080fd5b50610461611f3b81565b34801561058a57600080fd5b5061059e610599366004613ca9565b61117c565b604080516001600160a01b039093168352602083019190915201610420565b3480156105c957600080fd5b506105dd6105d8366004613b17565b6111b1565b6040516104209190613ccb565b3480156105f657600080fd5b50610461610605366004613b45565b611406565b34801561061657600080fd5b5060115461062a906001600160401b031681565b6040516001600160401b039091168152602001610420565b34801561064e57600080fd5b5061046160195481565b34801561066457600080fd5b506104c7610673366004613b17565b6114cf565b34801561068457600080fd5b50610414610693366004613cf4565b60176020526000908152604090205460ff1681565b3480156106b457600080fd5b506104c76115fe565b3480156106c957600080fd5b506104c76106d8366004613d11565b61164d565b3480156106e957600080fd5b506104616106f8366004613b17565b611678565b34801561070957600080fd5b506104c7610718366004613c68565b6116e0565b34801561072957600080fd5b50610461610738366004613ca9565b6116fb565b34801561074957600080fd5b50600f5461048f906001600160a01b031681565b34801561076957600080fd5b50610461610778366004613b17565b61179e565b34801561078957600080fd5b506104c7610798366004613d4a565b611856565b3480156107a957600080fd5b506104c76107b8366004613dd6565b611889565b3480156107c957600080fd5b506104146107d8366004613e5f565b6118a4565b3480156107e957600080fd5b5061048f6107f8366004613b17565b611a0c565b34801561080957600080fd5b506104c7610818366004613cf4565b611a23565b34801561082957600080fd5b5061043e611a4d565b34801561083e57600080fd5b5061041461084d366004613cf4565b60156020526000908152604090205460ff1681565b34801561086e57600080fd5b5061046161087d366004613cf4565b611adb565b34801561088e57600080fd5b506104c7611baa565b3480156108a357600080fd5b506104c76108b2366004613eb5565b336000908152601660205260409020805460ff1916911515919091179055565b3480156108de57600080fd5b50610461600481565b3480156108f357600080fd5b50610907610902366004613ed0565b611bbc565b60405160ff9091168152602001610420565b34801561092557600080fd5b506104c7611bdb565b34801561093a57600080fd5b50610461610949366004613b17565b611cec565b34801561095a57600080fd5b50600c546001600160a01b031661048f565b34801561097857600080fd5b506104c7610987366004613f06565b611d30565b34801561099857600080fd5b506104616109a7366004613b17565b611d44565b3480156109b857600080fd5b5061043e611ddf565b3480156109cd57600080fd5b506104c76109dc366004613b17565b611dee565b3480156109ed57600080fd5b506104c76109fc366004613d4a565b611dfb565b348015610a0d57600080fd5b506104c7610a1c366004613cf4565b611ec0565b348015610a2d57600080fd5b506104c7610a3c366004613ca9565b611eea565b348015610a4d57600080fd5b50610461601b5481565b348015610a6357600080fd5b506104c7611efd565b348015610a7857600080fd5b506104c7610a87366004613f47565b611f0d565b348015610a9857600080fd5b506104c7610aa7366004613ca9565b611f46565b348015610ab857600080fd5b506104c7610ac7366004613f06565b611f59565b348015610ad857600080fd5b50610461612267565b348015610aed57600080fd5b5061043e610afc366004613b17565b6122b5565b348015610b0d57600080fd5b50610461610b1c366004613b17565b61237a565b348015610b2d57600080fd5b506104c7610b3c366004613cf4565b612421565b348015610b4d57600080fd5b5060145461048f906001600160a01b031681565b348015610b6d57600080fd5b5061046160105481565b348015610b8357600080fd5b5061043e61244b565b348015610b9857600080fd5b50610414610ba7366004613fc6565b612458565b348015610bb857600080fd5b5061046160135481565b348015610bce57600080fd5b50610461601d5481565b348015610be457600080fd5b506104c7610bf3366004613cf4565b61256c565b348015610c0457600080fd5b50610414610c13366004613cf4565b60166020526000908152604090205460ff1681565b348015610c3457600080fd5b506104617f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c981565b348015610c6857600080fd5b506104c7610c77366004613ff4565b6125e2565b60006001600160e01b0319821663152a902d60e11b1480610ca15750610ca1826127d8565b92915050565b606060018054610cb690614019565b80601f0160208091040260200160405190810160405280929190818152602001828054610ce290614019565b8015610d2f5780601f10610d0457610100808354040283529160200191610d2f565b820191906000526020600020905b815481529060010190602001808311610d1257829003601f168201915b5050505050905090565b6000610d4482612843565b610dad5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084015b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b6000610dd482611a0c565b9050806001600160a01b0316836001600160a01b03161415610e445760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610da4565b336001600160a01b0382161480610e605750610e608133612458565b610ed25760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610da4565b610edc838361284e565b505050565b333214610f2c5760405162461bcd60e51b815260206004820152601960248201527810dbdb9d1c9858dd081b5a5b9d081b9bdd08185b1b1bddd959603a1b6044820152606401610da4565b34661f438daa06000014610f745760405162461bcd60e51b815260206004820152600f60248201526e125b98db1d5919481c185e5b595b9d608a1b6044820152606401610da4565b611f3b60045410610fb25760405162461bcd60e51b815260206004820152600860248201526714dbdb19081bdd5d60c21b6044820152606401610da4565b3360009081526017602052604090205460ff16156110035760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b6044820152606401610da4565b601254421161104b5760405162461bcd60e51b815260206004820152601460248201527314d85b19481a185cc81b9bdd081cdd185c9d195960621b6044820152606401610da4565b601354421061108d5760405162461bcd60e51b815260206004820152600e60248201526d14d85b19481a185cc8195b99195960921b6044820152606401610da4565b336000818152601760205260409020805460ff191660011790556110b29060036128bc565b565b60006110be612a21565b905090565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461113d5760405163073e64fd60e21b81523360048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166024820152604401610da4565b6111478282612a38565b5050565b6111553382612a82565b6111715760405162461bcd60e51b8152600401610da49061404e565b610edc838383612b4f565b600f5460009081906001600160a01b03166103e861119b85604b6140b8565b6111a591906140ed565b915091505b9250929050565b6111b961394d565b6000601e541180156111cd575081601e5411155b80156111e657506004601e546111e39190614101565b82105b1561120e57601e546111f89083614119565b611203906001614101565b610100820152919050565b600061121983611d44565b9050600061122961271083614146565b61123490605a614101565b611240906101f46140ed565b9050600060086112558461090285600a61415a565b60ff166112629190614146565b90505b811561132a57838160ff166009811061128057611280614130565b6020020151156112af5760ff8116156112a35761129c8161417f565b9050611265565b61129c6001600861419c565b601a8160ff16600881106112c5576112c5614130565b6020810491909101546112e591601f166101000a900460ff16600161415a565b60ff16848260ff16600981106112fd576112fd614130565b602002015261130b826141bf565b9150600861131d846109028584614101565b60ff1661129c9190614146565b60005b60088160ff1610156113d857848160ff166009811061134e5761134e614130565b60200201511561135d576113c6565b601a8160ff166008811061137357611373614130565b602081049091015460ff601f9092166101000a9004166113938583611bbc565b61139d91906141d6565b6113a890600161415a565b60ff16858260ff16600981106113c0576113c0614130565b60200201525b806113d0816141f8565b91505061132d565b5060c084015160061480156113f1575060e08401516008145b156113fe57600960e08501525b505050919050565b60008060005b60045481101561147a5761141f81612843565b8015611444575061142f81611a0c565b6001600160a01b0316856001600160a01b0316145b15611468578382141561145a579150610ca19050565b8161146481614218565b9250505b8061147281614218565b91505061140c565b5060405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a206f776e657220696e646578206f7574206f6620626f604482015263756e647360e01b6064820152608401610da4565b6114d7612d38565b600454601d541061151e5760405162461bcd60e51b8152602060048201526011602482015270436f756e7420697320636f6d706c65746560781b6044820152606401610da4565b600060045482601d546115319190614101565b1061153e5760045461154c565b81601d5461154c9190614101565b601d5490915060005b828210156115955761156682612843565b61156f57611585565b61157882611cec565b6115829082614101565b90505b61158e82614218565b9150611555565b601d829055600f546040516312fb1cbd60e01b8152600481018390526001600160a01b03909116906312fb1cbd90602401600060405180830381600087803b1580156115e057600080fd5b505af11580156115f4573d6000803e3d6000fd5b5050505050505050565b611606612d38565b600c546001600160a01b03166040516001600160a01b039190911690303180156108fc02916000818181858888f1935050505015801561164a573d6000803e3d6000fd5b50565b611655612d38565b6011805467ffffffffffffffff19166001600160401b0392909216919091179055565b600080601e5411801561168d575081601e5411155b80156116a657506004601e546116a39190614101565b82105b156116b357506001919050565b6127106116bf83611d44565b6116c99190614146565b6116d490605a614101565b610ca1906101f46140ed565b610edc83838360405180602001604052806000815250611f0d565b600061170683612843565b6117225760405162461bcd60e51b8152600401610da490614233565b60006008600061173186612d92565b815260200190815260200160002054905080600014156117635760405162461bcd60e51b8152600401610da490614290565b60408051602081018390529081018590526060810184905260800160408051601f198184030181529190528051602090910120949350505050565b60006117a86110b4565b82106118045760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a20676c6f62616c20696e646578206f7574206f6620626044820152646f756e647360d81b6064820152608401610da4565b6000805b60045481101561184f5761181b81612843565b1561183d578382141561182f579392505050565b8161183981614218565b9250505b8061184781614218565b915050611808565b5050919050565b61185e612d38565b6001600160a01b03919091166000908152601560205260409020805460ff1916911515919091179055565b611891612d38565b805161114790600d90602084019061396c565b6018546000906001600160a01b03166118f75760405162461bcd60e51b81526020600482015260156024820152741dda1a5d195b1a5cdd081b9bdd08195b98589b1959605a1b6044820152606401610da4565b60006019547f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c9846040516020016119419291909182526001600160a01b0316602082015260400190565b6040516020818303038152906040528051906020012060405160200161197e92919061190160f01b81526002810192909252602282015260420190565b60405160208183030381529060405280519060200120905060006119da86868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050612dd69050565b6018549091506001600160a01b03808316911614156119fe57600192505050611a05565b6000925050505b9392505050565b6000806000611a1a84612dfa565b50949350505050565b611a2b612d38565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b600d8054611a5a90614019565b80601f0160208091040260200160405190810160405280929190818152602001828054611a8690614019565b8015611ad35780601f10611aa857610100808354040283529160200191611ad3565b820191906000526020600020905b815481529060010190602001808311611ab657829003601f168201915b505050505081565b60006001600160a01b038216611b495760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610da4565b6000805b600454811015611ba357611b6081612843565b15611b9357611b6e81611a0c565b6001600160a01b0316846001600160a01b03161415611b9357611b9082614218565b91505b611b9c81614218565b9050611b4d565b5092915050565b611bb2612d38565b6110b26000612e91565b60008260ff831660208110611bd357611bd3614130565b1a9392505050565b611be3612d38565b601e5415611c335760405162461bcd60e51b815260206004820152601a60248201527f4c6567656e64617269657320616c7265616479206d696e7465640000000000006044820152606401610da4565b6000611c3f6000611d44565b600454601e55905060005b6004811015611147576004546040805160208082018690527f5b62d0d589d39df21aaf5ecafa555f3f0c1bfcfe9655dbed3f07da10f5e398758284015260608083018690528351808403909101815260809092019092528051910120600091611cb291614146565b9050611cbd81612843565b611cc75750611cdc565b611cda611cd382611a0c565b60016128bc565b505b611ce581614218565b9050611c4a565b600080601e54118015611d01575081601e5411155b8015611d1a57506004601e54611d179190614101565b82105b15611d2757506064919050565b610ca182612ee3565b611d38612d38565b610edc600e83836139f0565b6000611d4f82612843565b611d6b5760405162461bcd60e51b8152600401610da490614233565b600060086000611d7a85612d92565b81526020019081526020016000205490508060001415611dac5760405162461bcd60e51b8152600401610da490614290565b604080516020810183905290810184905260600160408051601f1981840301815291905280516020909101209392505050565b606060028054610cb690614019565b611df6612d38565b601055565b6001600160a01b038216331415611e545760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c6572000000006044820152606401610da4565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611ec8612d38565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b611ef2612d38565b601b91909155601c55565b611f05612d38565b6110b2612f1d565b611f18335b83612a82565b611f345760405162461bcd60e51b8152600401610da49061404e565b611f40848484846130b9565b50505050565b611f4e612d38565b601291909155601355565b601854829082906001600160a01b0316611fad5760405162461bcd60e51b81526020600482015260156024820152741dda1a5d195b1a5cdd081b9bdd08195b98589b1959605a1b6044820152606401610da4565b601954604080517f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c960208201523391810191909152600091906060016040516020818303038152906040528051906020012060405160200161202692919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050600061208284848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050612dd69050565b6018549091506001600160a01b038083169116146120d65760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964205369676e617475726560781b6044820152606401610da4565b3332146121215760405162461bcd60e51b815260206004820152601960248201527810dbdb9d1c9858dd081b5a5b9d081b9bdd08185b1b1bddd959603a1b6044820152606401610da4565b6104b06004541061215f5760405162461bcd60e51b815260206004820152600860248201526714dbdb19081bdd5d60c21b6044820152606401610da4565b3360009081526017602052604090205460ff16156121b05760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b6044820152606401610da4565b601b5442116121f85760405162461bcd60e51b815260206004820152601460248201527314d85b19481a185cc81b9bdd081cdd185c9d195960621b6044820152606401610da4565b601c54421061223a5760405162461bcd60e51b815260206004820152600e60248201526d14d85b19481a185cc8195b99195960921b6044820152606401610da4565b336000818152601760205260409020805460ff1916600117905561225f9060036128bc565b505050505050565b60008060005b6004548110156122af5761228081612843565b6122895761229f565b61229281611cec565b61229c9083614101565b91505b6122a881614218565b905061226d565b50919050565b60606122c082612843565b61231f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732315073693a2055524920717565727920666f72206e6f6e657869736044820152693a32b73a103a37b5b2b760b11b6064820152608401610da4565b60006123296130ee565b905060008151116123495760405180602001604052806000815250611a05565b80612353846130fd565b6040516020016123649291906142ed565b6040516020818303038152906040529392505050565b600f5460408051632b38a15f60e11b815290516000926001600160a01b03169163567142be916004808301926020929190829003018186803b1580156123bf57600080fd5b505afa1580156123d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123f7919061432c565b61240083611cec565b600f5461241791906001600160a01b0316316140b8565b610ca191906140ed565b612429612d38565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b600e8054611a5a90614019565b6001600160a01b03821660009081526016602052604081205460ff1661253e576001600160a01b03821660009081526015602052604090205460ff16156124a157506001610ca1565b60145460405163c455279160e01b81526001600160a01b03858116600483015291821691841690829063c45527919060240160206040518083038186803b1580156124eb57600080fd5b505afa1580156124ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125239190614345565b6001600160a01b0316141561253c576001915050610ca1565b505b6001600160a01b0380841660009081526006602090815260408083209386168352929052205460ff16611a05565b612574612d38565b6001600160a01b0381166125d95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610da4565b61164a81612e91565b6013546125f29062015180614101565b421161264c5760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f74206275726e20756e74696c206f6e65206461792061667465722060448201526373616c6560e01b6064820152608401610da4565b61265533611f12565b6126ba5760405162461bcd60e51b815260206004820152603060248201527f54726173683a207472616e736665722063616c6c6572206973206e6f74206f7760448201526f1b995c881b9bdc88185c1c1c9bdd995960821b6064820152608401610da4565b60006126c583611cec565b9050601d5483106127245760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f74206275726e20617320746f6b656e206973206e6f7420696e2076604482015263185d5b1d60e21b6064820152608401610da4565b61272d836131fa565b6001600160a01b03821661279f57600f5460405163065e70cf60e51b8152600481018390526001600160a01b039091169063cbce19e0906024015b600060405180830381600087803b15801561278257600080fd5b505af1158015612796573d6000803e3d6000fd5b50505050505050565b600f54604051639015ce9f60e01b8152600481018390526001600160a01b03848116602483015290911690639015ce9f90604401612768565b60006001600160e01b031982166380ac58cd60e01b148061280957506001600160e01b03198216635b5e139f60e01b145b8061282457506001600160e01b0319821663780e9d6360e01b145b80610ca157506301ffc9a760e01b6001600160e01b0319831614610ca1565b6000610ca18261324e565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061288382611a0c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6004548161291a5760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610da4565b6001600160a01b03831661297c5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610da4565b816004600082825461298e9190614101565b9091555050600081815260036020526040812080546001600160a01b0319166001600160a01b0386161790556129c49082613285565b805b6129d08383614101565b811015611f405760405181906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480612a1981614218565b9150506129c6565b6000612a2b6132b1565b6004546110be9190614119565b600081600081518110612a4d57612a4d614130565b602090810291909101810151600085815260078352604080822054808352818320839055600890945290208190559150611f40565b6000612a8d82612843565b612af15760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610da4565b6000612afc83611a0c565b9050806001600160a01b0316846001600160a01b03161480612b375750836001600160a01b0316612b2c84610d39565b6001600160a01b0316145b80612b475750612b478185612458565b949350505050565b600080612b5b83612dfa565b91509150846001600160a01b0316826001600160a01b031614612bd55760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610da4565b6001600160a01b038416612c3b5760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610da4565b612c4660008461284e565b6000612c53846001614101565b600881901c600090815260208190526040902054909150600160ff1b60ff83161c16158015612c83575060045481105b15612cb957600081815260036020526040812080546001600160a01b0319166001600160a01b038916179055612cb99082613285565b600084815260036020526040902080546001600160a01b0319166001600160a01b038716179055818414612cf257612cf2600085613285565b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461225f565b600c546001600160a01b031633146110b25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610da4565b6000805b600a54811015612dcc57600081815260096020526040902054831015612dbc5792915050565b612dc581614218565b9050612d96565b5050600a54919050565b6000806000612de58585613311565b91509150612df28161337e565b509392505050565b600080612e0683612843565b612e675760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610da4565b612e7083613539565b6000818152600360205260409020546001600160a01b031694909350915050565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000612710612ef183611d44565b612efb9190614146565b612f069060be614101565b612f12906127106140ed565b610ca1906001614101565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635d3b1d30612f5760105490565b6011546001600160401b03166040516001600160e01b031960e085901b16815260048101929092526001600160401b0316602482015261ffff7f000000000000000000000000000000000000000000000000000000000000000016604482015263ffffffff7f00000000000000000000000000000000000000000000000000000000000000001660648201526001608482015260a401602060405180830381600087803b15801561300757600080fd5b505af115801561301b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061303f919061432c565b90507f76421cb080d40e8a03ba462b500012451ba59bdebc46694dc458807c1d754b628160405161307291815260200190565b60405180910390a1600a54600082815260076020526040902055600454600a80546000908152600960205260408120929092558054916130b183614218565b919050555050565b6130c4848484612b4f565b6130d2848484600185613545565b611f405760405162461bcd60e51b8152600401610da490614362565b6060600d8054610cb690614019565b6060816131215750506040805180820190915260018152600360fc1b602082015290565b8160005b811561314b578061313581614218565b91506131449050600a836140ed565b9150613125565b6000816001600160401b0381111561316557613165613b71565b6040519080825280601f01601f19166020018201604052801561318f576020820181803683370190505b5090505b8415612b47576131a4600183614119565b91506131b1600a86614146565b6131bc906030614101565b60f81b8183815181106131d1576131d1614130565b60200101906001600160f81b031916908160001a9053506131f3600a866140ed565b9450613193565b600061320582611a0c565b9050613212600b83613285565b60405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600881901c6000908152600b6020526040812054600160ff1b60ff84161c161561327a57506000919050565b610ca1826004541190565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b6000806008600454901c60016132c79190614101565b905060005b8181101561330c576000818152600b60205260409020546132ec81613688565b6132f69085614101565b935050808061330490614218565b9150506132cc565b505090565b6000808251604114156133485760208301516040840151606085015160001a61333c878285856136a7565b945094505050506111aa565b8251604014156133725760208301516040840151613367868383613794565b9350935050506111aa565b506000905060026111aa565b6000816004811115613392576133926143b7565b141561339b5750565b60018160048111156133af576133af6143b7565b14156133fd5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610da4565b6002816004811115613411576134116143b7565b141561345f5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610da4565b6003816004811115613473576134736143b7565b14156134cc5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610da4565b60048160048111156134e0576134e06143b7565b141561164a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610da4565b6000610ca181836137cd565b60006001600160a01b0385163b1561367b57506001835b6135668486614101565b81101561367557604051630a85bd0160e11b81526001600160a01b0387169063150b7a029061359f9033908b90869089906004016143cd565b602060405180830381600087803b1580156135b957600080fd5b505af19250505080156135e9575060408051601f3d908101601f191682019092526135e69181019061440a565b60015b613643573d808015613617576040519150601f19603f3d011682016040523d82523d6000602084013e61361c565b606091505b50805161363b5760405162461bcd60e51b8152600401610da490614362565b805181602001fd5b82801561366057506001600160e01b03198116630a85bd0160e11b145b9250508061366d81614218565b91505061355c565b5061367f565b5060015b95945050505050565b60005b81156136a25760001982019091169060010161368b565b919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156136de575060009050600361378b565b8460ff16601b141580156136f657508460ff16601c14155b15613707575060009050600461378b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561375b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166137845760006001925092505061378b565b9150600090505b94509492505050565b6000806001600160ff1b038316816137b160ff86901c601b614101565b90506137bf878288856136a7565b935093505050935093915050565b600881901c60008181526020849052604081205490919060ff808516919082181c8015613812576137fd816138cb565b60ff168203600884901b179350505050610ca1565b6000831161387f5760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610da4565b5060001990910160008181526020869052604090205490919080156138bd576138a7816138cb565b60ff0360ff16600884901b179350505050610ca1565b613812565b50505092915050565b60006040518061012001604052806101008152602001614428610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff61391485613935565b02901c8151811061392757613927614130565b016020015160f81c92915050565b600080821161394357600080fd5b5060008190031690565b6040518061012001604052806009906020820280368337509192915050565b82805461397890614019565b90600052602060002090601f01602090048101928261399a57600085556139e0565b82601f106139b357805160ff19168380011785556139e0565b828001600101855582156139e0579182015b828111156139e05782518255916020019190600101906139c5565b506139ec929150613a64565b5090565b8280546139fc90614019565b90600052602060002090601f016020900481019282613a1e57600085556139e0565b82601f10613a375782800160ff198235161785556139e0565b828001600101855582156139e0579182015b828111156139e0578235825591602001919060010190613a49565b5b808211156139ec5760008155600101613a65565b6001600160e01b03198116811461164a57600080fd5b600060208284031215613aa157600080fd5b8135611a0581613a79565b60005b83811015613ac7578181015183820152602001613aaf565b83811115611f405750506000910152565b60008151808452613af0816020860160208601613aac565b601f01601f19169290920160200192915050565b602081526000611a056020830184613ad8565b600060208284031215613b2957600080fd5b5035919050565b6001600160a01b038116811461164a57600080fd5b60008060408385031215613b5857600080fd5b8235613b6381613b30565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613baf57613baf613b71565b604052919050565b60008060408385031215613bca57600080fd5b823591506020808401356001600160401b0380821115613be957600080fd5b818601915086601f830112613bfd57600080fd5b813581811115613c0f57613c0f613b71565b8060051b9150613c20848301613b87565b8181529183018401918481019089841115613c3a57600080fd5b938501935b83851015613c5857843582529385019390850190613c3f565b8096505050505050509250929050565b600080600060608486031215613c7d57600080fd5b8335613c8881613b30565b92506020840135613c9881613b30565b929592945050506040919091013590565b60008060408385031215613cbc57600080fd5b50508035926020909101359150565b6101208101818360005b60098110156138c2578151835260209283019290910190600101613cd5565b600060208284031215613d0657600080fd5b8135611a0581613b30565b600060208284031215613d2357600080fd5b81356001600160401b0381168114611a0557600080fd5b803580151581146136a257600080fd5b60008060408385031215613d5d57600080fd5b8235613d6881613b30565b9150613d7660208401613d3a565b90509250929050565b60006001600160401b03831115613d9857613d98613b71565b613dab601f8401601f1916602001613b87565b9050828152838383011115613dbf57600080fd5b828260208301376000602084830101529392505050565b600060208284031215613de857600080fd5b81356001600160401b03811115613dfe57600080fd5b8201601f81018413613e0f57600080fd5b612b4784823560208401613d7f565b60008083601f840112613e3057600080fd5b5081356001600160401b03811115613e4757600080fd5b6020830191508360208285010111156111aa57600080fd5b600080600060408486031215613e7457600080fd5b83356001600160401b03811115613e8a57600080fd5b613e9686828701613e1e565b9094509250506020840135613eaa81613b30565b809150509250925092565b600060208284031215613ec757600080fd5b611a0582613d3a565b60008060408385031215613ee357600080fd5b82359150602083013560ff81168114613efb57600080fd5b809150509250929050565b60008060208385031215613f1957600080fd5b82356001600160401b03811115613f2f57600080fd5b613f3b85828601613e1e565b90969095509350505050565b60008060008060808587031215613f5d57600080fd5b8435613f6881613b30565b93506020850135613f7881613b30565b92506040850135915060608501356001600160401b03811115613f9a57600080fd5b8501601f81018713613fab57600080fd5b613fba87823560208401613d7f565b91505092959194509250565b60008060408385031215613fd957600080fd5b8235613fe481613b30565b91506020830135613efb81613b30565b6000806040838503121561400757600080fd5b823591506020830135613efb81613b30565b600181811c9082168061402d57607f821691505b602082108114156122af57634e487b7160e01b600052602260045260246000fd5b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156140d2576140d26140a2565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826140fc576140fc6140d7565b500490565b60008219821115614114576141146140a2565b500190565b60008282101561412b5761412b6140a2565b500390565b634e487b7160e01b600052603260045260246000fd5b600082614155576141556140d7565b500690565b600060ff821660ff84168060ff03821115614177576141776140a2565b019392505050565b600060ff821680614192576141926140a2565b6000190192915050565b600060ff821660ff8416808210156141b6576141b66140a2565b90039392505050565b6000816141ce576141ce6140a2565b506000190190565b600060ff8316806141e9576141e96140d7565b8060ff84160691505092915050565b600060ff821660ff81141561420f5761420f6140a2565b60010192915050565b600060001982141561422c5761422c6140a2565b5060010190565b6020808252603b908201527f45524337323150736952616e646f6d5365656452657665616c3a20736565642060408201527f717565727920666f72206e6f6e6578697374656e7420746f6b656e0000000000606082015260800190565b6020808252603c908201527f45524337323150736952616e646f6d5365656452657665616c3a2052616e646f60408201527f6d6e657373206861736e2774206265656e2066756c6c66696c6c656400000000606082015260800190565b600083516142ff818460208801613aac565b835190830190614313818360208801613aac565b64173539b7b760d91b9101908152600501949350505050565b60006020828403121561433e57600080fd5b5051919050565b60006020828403121561435757600080fd5b8151611a0581613b30565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061440090830184613ad8565b9695505050505050565b60006020828403121561441c57600080fd5b8151611a0581613a7956fe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212204668f168a7dc9bfcebaee822708329a10d0d9cac7627ad0ceaf8e775ad3104b564736f6c63430008090033000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c100000000000000000000000000000000000000000000000000000000633855f0000000000000000000000000000000000000000000000000000000006229a1f0000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990900000000000000000000000000000000000000000000000000000000000111700000000000000000000000000000000000000000000000000000000000000003ff8dedfbfa60af186cf3c830acbc32c05aae823045ae5ea7da1e45fbfaba4f9200000000000000000000000000000000000000000000000000000000000001ad
Deployed Bytecode
0x6080604052600436106103ef5760003560e01c806370a0823111610208578063b88d4fde11610118578063d2d58daa116100ab578063ee9e9a2c1161007a578063ee9e9a2c14610bc2578063f2fde38b14610bd8578063f7c61fe214610bf8578063fa4d280c14610c28578063fcd3533c14610c5c57600080fd5b8063d2d58daa14610b61578063e8a3d48514610b77578063e985e9c514610b8c578063ed338ff114610bac57600080fd5b8063c87b56dd116100e7578063c87b56dd14610ae1578063c9b8b4e814610b01578063cd77083314610b21578063cd7c032614610b4157600080fd5b8063b88d4fde14610a6c578063ba1c3b9214610a8c578063ba9da85d14610aac578063c2b54d1a14610acc57600080fd5b8063938e3d7b1161019b578063a22cb4651161016a578063a22cb465146109e1578063a4d925f114610a01578063a4e0184814610a21578063a82524b214610a41578063b07870b514610a5757600080fd5b8063938e3d7b1461096c578063955648371461098c57806395d89b41146109ac57806398544710146109c157600080fd5b8063851c2f6c116101d7578063851c2f6c146108e75780638a01f0a0146109195780638b58c5691461092e5780638da5cb5b1461094e57600080fd5b806370a0823114610862578063715018a61461088257806376140b3a1461089757806378d9cd53146108d257600080fd5b80633644e51511610303578063478222c21161029657806360f6dd491161026557806360f6dd49146107bd5780636352211e146107dd5780636817031b146107fd5780636c0360eb1461081d5780636d70f7ae1461083257600080fd5b8063478222c21461073d5780634f6ccce71461075d578063558a72971461077d57806355f804b31461079d57600080fd5b80633e2831fe116102d25780633e2831fe146106bd5780633e491337146106dd57806342842e0e146106fd578063458b352e1461071d57600080fd5b80633644e515146106425780633691a9e21461065857806338e21cce146106785780633ccfd60b146106a857600080fd5b80631fe543e311610386578063263522581161035557806326352258146105685780632a55205a1461057e5780632d72225b146105bd5780632f745c59146105ea57806335698c8e1461060a57600080fd5b80631fe543e3146104fc5780632142ab291461051c57806323b872dd14610532578063249b7c191461055257600080fd5b8063095ea7b3116103c2578063095ea7b3146104a75780631249c58b146104c957806318160ddd146104d15780631cbaee2d146104e657600080fd5b806301ffc9a7146103f457806306fdde0314610429578063081008161461044b578063081812fc1461046f575b600080fd5b34801561040057600080fd5b5061041461040f366004613a8f565b610c7c565b60405190151581526020015b60405180910390f35b34801561043557600080fd5b5061043e610ca7565b6040516104209190613b04565b34801561045757600080fd5b50610461601e5481565b604051908152602001610420565b34801561047b57600080fd5b5061048f61048a366004613b17565b610d39565b6040516001600160a01b039091168152602001610420565b3480156104b357600080fd5b506104c76104c2366004613b45565b610dc9565b005b6104c7610ee1565b3480156104dd57600080fd5b506104616110b4565b3480156104f257600080fd5b5061046160125481565b34801561050857600080fd5b506104c7610517366004613bb7565b6110c3565b34801561052857600080fd5b506104616104b081565b34801561053e57600080fd5b506104c761054d366004613c68565b61114b565b34801561055e57600080fd5b50610461601c5481565b34801561057457600080fd5b50610461611f3b81565b34801561058a57600080fd5b5061059e610599366004613ca9565b61117c565b604080516001600160a01b039093168352602083019190915201610420565b3480156105c957600080fd5b506105dd6105d8366004613b17565b6111b1565b6040516104209190613ccb565b3480156105f657600080fd5b50610461610605366004613b45565b611406565b34801561061657600080fd5b5060115461062a906001600160401b031681565b6040516001600160401b039091168152602001610420565b34801561064e57600080fd5b5061046160195481565b34801561066457600080fd5b506104c7610673366004613b17565b6114cf565b34801561068457600080fd5b50610414610693366004613cf4565b60176020526000908152604090205460ff1681565b3480156106b457600080fd5b506104c76115fe565b3480156106c957600080fd5b506104c76106d8366004613d11565b61164d565b3480156106e957600080fd5b506104616106f8366004613b17565b611678565b34801561070957600080fd5b506104c7610718366004613c68565b6116e0565b34801561072957600080fd5b50610461610738366004613ca9565b6116fb565b34801561074957600080fd5b50600f5461048f906001600160a01b031681565b34801561076957600080fd5b50610461610778366004613b17565b61179e565b34801561078957600080fd5b506104c7610798366004613d4a565b611856565b3480156107a957600080fd5b506104c76107b8366004613dd6565b611889565b3480156107c957600080fd5b506104146107d8366004613e5f565b6118a4565b3480156107e957600080fd5b5061048f6107f8366004613b17565b611a0c565b34801561080957600080fd5b506104c7610818366004613cf4565b611a23565b34801561082957600080fd5b5061043e611a4d565b34801561083e57600080fd5b5061041461084d366004613cf4565b60156020526000908152604090205460ff1681565b34801561086e57600080fd5b5061046161087d366004613cf4565b611adb565b34801561088e57600080fd5b506104c7611baa565b3480156108a357600080fd5b506104c76108b2366004613eb5565b336000908152601660205260409020805460ff1916911515919091179055565b3480156108de57600080fd5b50610461600481565b3480156108f357600080fd5b50610907610902366004613ed0565b611bbc565b60405160ff9091168152602001610420565b34801561092557600080fd5b506104c7611bdb565b34801561093a57600080fd5b50610461610949366004613b17565b611cec565b34801561095a57600080fd5b50600c546001600160a01b031661048f565b34801561097857600080fd5b506104c7610987366004613f06565b611d30565b34801561099857600080fd5b506104616109a7366004613b17565b611d44565b3480156109b857600080fd5b5061043e611ddf565b3480156109cd57600080fd5b506104c76109dc366004613b17565b611dee565b3480156109ed57600080fd5b506104c76109fc366004613d4a565b611dfb565b348015610a0d57600080fd5b506104c7610a1c366004613cf4565b611ec0565b348015610a2d57600080fd5b506104c7610a3c366004613ca9565b611eea565b348015610a4d57600080fd5b50610461601b5481565b348015610a6357600080fd5b506104c7611efd565b348015610a7857600080fd5b506104c7610a87366004613f47565b611f0d565b348015610a9857600080fd5b506104c7610aa7366004613ca9565b611f46565b348015610ab857600080fd5b506104c7610ac7366004613f06565b611f59565b348015610ad857600080fd5b50610461612267565b348015610aed57600080fd5b5061043e610afc366004613b17565b6122b5565b348015610b0d57600080fd5b50610461610b1c366004613b17565b61237a565b348015610b2d57600080fd5b506104c7610b3c366004613cf4565b612421565b348015610b4d57600080fd5b5060145461048f906001600160a01b031681565b348015610b6d57600080fd5b5061046160105481565b348015610b8357600080fd5b5061043e61244b565b348015610b9857600080fd5b50610414610ba7366004613fc6565b612458565b348015610bb857600080fd5b5061046160135481565b348015610bce57600080fd5b50610461601d5481565b348015610be457600080fd5b506104c7610bf3366004613cf4565b61256c565b348015610c0457600080fd5b50610414610c13366004613cf4565b60166020526000908152604090205460ff1681565b348015610c3457600080fd5b506104617f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c981565b348015610c6857600080fd5b506104c7610c77366004613ff4565b6125e2565b60006001600160e01b0319821663152a902d60e11b1480610ca15750610ca1826127d8565b92915050565b606060018054610cb690614019565b80601f0160208091040260200160405190810160405280929190818152602001828054610ce290614019565b8015610d2f5780601f10610d0457610100808354040283529160200191610d2f565b820191906000526020600020905b815481529060010190602001808311610d1257829003601f168201915b5050505050905090565b6000610d4482612843565b610dad5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084015b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b6000610dd482611a0c565b9050806001600160a01b0316836001600160a01b03161415610e445760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610da4565b336001600160a01b0382161480610e605750610e608133612458565b610ed25760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610da4565b610edc838361284e565b505050565b333214610f2c5760405162461bcd60e51b815260206004820152601960248201527810dbdb9d1c9858dd081b5a5b9d081b9bdd08185b1b1bddd959603a1b6044820152606401610da4565b34661f438daa06000014610f745760405162461bcd60e51b815260206004820152600f60248201526e125b98db1d5919481c185e5b595b9d608a1b6044820152606401610da4565b611f3b60045410610fb25760405162461bcd60e51b815260206004820152600860248201526714dbdb19081bdd5d60c21b6044820152606401610da4565b3360009081526017602052604090205460ff16156110035760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b6044820152606401610da4565b601254421161104b5760405162461bcd60e51b815260206004820152601460248201527314d85b19481a185cc81b9bdd081cdd185c9d195960621b6044820152606401610da4565b601354421061108d5760405162461bcd60e51b815260206004820152600e60248201526d14d85b19481a185cc8195b99195960921b6044820152606401610da4565b336000818152601760205260409020805460ff191660011790556110b29060036128bc565b565b60006110be612a21565b905090565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909161461113d5760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909166024820152604401610da4565b6111478282612a38565b5050565b6111553382612a82565b6111715760405162461bcd60e51b8152600401610da49061404e565b610edc838383612b4f565b600f5460009081906001600160a01b03166103e861119b85604b6140b8565b6111a591906140ed565b915091505b9250929050565b6111b961394d565b6000601e541180156111cd575081601e5411155b80156111e657506004601e546111e39190614101565b82105b1561120e57601e546111f89083614119565b611203906001614101565b610100820152919050565b600061121983611d44565b9050600061122961271083614146565b61123490605a614101565b611240906101f46140ed565b9050600060086112558461090285600a61415a565b60ff166112629190614146565b90505b811561132a57838160ff166009811061128057611280614130565b6020020151156112af5760ff8116156112a35761129c8161417f565b9050611265565b61129c6001600861419c565b601a8160ff16600881106112c5576112c5614130565b6020810491909101546112e591601f166101000a900460ff16600161415a565b60ff16848260ff16600981106112fd576112fd614130565b602002015261130b826141bf565b9150600861131d846109028584614101565b60ff1661129c9190614146565b60005b60088160ff1610156113d857848160ff166009811061134e5761134e614130565b60200201511561135d576113c6565b601a8160ff166008811061137357611373614130565b602081049091015460ff601f9092166101000a9004166113938583611bbc565b61139d91906141d6565b6113a890600161415a565b60ff16858260ff16600981106113c0576113c0614130565b60200201525b806113d0816141f8565b91505061132d565b5060c084015160061480156113f1575060e08401516008145b156113fe57600960e08501525b505050919050565b60008060005b60045481101561147a5761141f81612843565b8015611444575061142f81611a0c565b6001600160a01b0316856001600160a01b0316145b15611468578382141561145a579150610ca19050565b8161146481614218565b9250505b8061147281614218565b91505061140c565b5060405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a206f776e657220696e646578206f7574206f6620626f604482015263756e647360e01b6064820152608401610da4565b6114d7612d38565b600454601d541061151e5760405162461bcd60e51b8152602060048201526011602482015270436f756e7420697320636f6d706c65746560781b6044820152606401610da4565b600060045482601d546115319190614101565b1061153e5760045461154c565b81601d5461154c9190614101565b601d5490915060005b828210156115955761156682612843565b61156f57611585565b61157882611cec565b6115829082614101565b90505b61158e82614218565b9150611555565b601d829055600f546040516312fb1cbd60e01b8152600481018390526001600160a01b03909116906312fb1cbd90602401600060405180830381600087803b1580156115e057600080fd5b505af11580156115f4573d6000803e3d6000fd5b5050505050505050565b611606612d38565b600c546001600160a01b03166040516001600160a01b039190911690303180156108fc02916000818181858888f1935050505015801561164a573d6000803e3d6000fd5b50565b611655612d38565b6011805467ffffffffffffffff19166001600160401b0392909216919091179055565b600080601e5411801561168d575081601e5411155b80156116a657506004601e546116a39190614101565b82105b156116b357506001919050565b6127106116bf83611d44565b6116c99190614146565b6116d490605a614101565b610ca1906101f46140ed565b610edc83838360405180602001604052806000815250611f0d565b600061170683612843565b6117225760405162461bcd60e51b8152600401610da490614233565b60006008600061173186612d92565b815260200190815260200160002054905080600014156117635760405162461bcd60e51b8152600401610da490614290565b60408051602081018390529081018590526060810184905260800160408051601f198184030181529190528051602090910120949350505050565b60006117a86110b4565b82106118045760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a20676c6f62616c20696e646578206f7574206f6620626044820152646f756e647360d81b6064820152608401610da4565b6000805b60045481101561184f5761181b81612843565b1561183d578382141561182f579392505050565b8161183981614218565b9250505b8061184781614218565b915050611808565b5050919050565b61185e612d38565b6001600160a01b03919091166000908152601560205260409020805460ff1916911515919091179055565b611891612d38565b805161114790600d90602084019061396c565b6018546000906001600160a01b03166118f75760405162461bcd60e51b81526020600482015260156024820152741dda1a5d195b1a5cdd081b9bdd08195b98589b1959605a1b6044820152606401610da4565b60006019547f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c9846040516020016119419291909182526001600160a01b0316602082015260400190565b6040516020818303038152906040528051906020012060405160200161197e92919061190160f01b81526002810192909252602282015260420190565b60405160208183030381529060405280519060200120905060006119da86868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050612dd69050565b6018549091506001600160a01b03808316911614156119fe57600192505050611a05565b6000925050505b9392505050565b6000806000611a1a84612dfa565b50949350505050565b611a2b612d38565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b600d8054611a5a90614019565b80601f0160208091040260200160405190810160405280929190818152602001828054611a8690614019565b8015611ad35780601f10611aa857610100808354040283529160200191611ad3565b820191906000526020600020905b815481529060010190602001808311611ab657829003601f168201915b505050505081565b60006001600160a01b038216611b495760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610da4565b6000805b600454811015611ba357611b6081612843565b15611b9357611b6e81611a0c565b6001600160a01b0316846001600160a01b03161415611b9357611b9082614218565b91505b611b9c81614218565b9050611b4d565b5092915050565b611bb2612d38565b6110b26000612e91565b60008260ff831660208110611bd357611bd3614130565b1a9392505050565b611be3612d38565b601e5415611c335760405162461bcd60e51b815260206004820152601a60248201527f4c6567656e64617269657320616c7265616479206d696e7465640000000000006044820152606401610da4565b6000611c3f6000611d44565b600454601e55905060005b6004811015611147576004546040805160208082018690527f5b62d0d589d39df21aaf5ecafa555f3f0c1bfcfe9655dbed3f07da10f5e398758284015260608083018690528351808403909101815260809092019092528051910120600091611cb291614146565b9050611cbd81612843565b611cc75750611cdc565b611cda611cd382611a0c565b60016128bc565b505b611ce581614218565b9050611c4a565b600080601e54118015611d01575081601e5411155b8015611d1a57506004601e54611d179190614101565b82105b15611d2757506064919050565b610ca182612ee3565b611d38612d38565b610edc600e83836139f0565b6000611d4f82612843565b611d6b5760405162461bcd60e51b8152600401610da490614233565b600060086000611d7a85612d92565b81526020019081526020016000205490508060001415611dac5760405162461bcd60e51b8152600401610da490614290565b604080516020810183905290810184905260600160408051601f1981840301815291905280516020909101209392505050565b606060028054610cb690614019565b611df6612d38565b601055565b6001600160a01b038216331415611e545760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c6572000000006044820152606401610da4565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611ec8612d38565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b611ef2612d38565b601b91909155601c55565b611f05612d38565b6110b2612f1d565b611f18335b83612a82565b611f345760405162461bcd60e51b8152600401610da49061404e565b611f40848484846130b9565b50505050565b611f4e612d38565b601291909155601355565b601854829082906001600160a01b0316611fad5760405162461bcd60e51b81526020600482015260156024820152741dda1a5d195b1a5cdd081b9bdd08195b98589b1959605a1b6044820152606401610da4565b601954604080517f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c960208201523391810191909152600091906060016040516020818303038152906040528051906020012060405160200161202692919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050600061208284848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050612dd69050565b6018549091506001600160a01b038083169116146120d65760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964205369676e617475726560781b6044820152606401610da4565b3332146121215760405162461bcd60e51b815260206004820152601960248201527810dbdb9d1c9858dd081b5a5b9d081b9bdd08185b1b1bddd959603a1b6044820152606401610da4565b6104b06004541061215f5760405162461bcd60e51b815260206004820152600860248201526714dbdb19081bdd5d60c21b6044820152606401610da4565b3360009081526017602052604090205460ff16156121b05760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b6044820152606401610da4565b601b5442116121f85760405162461bcd60e51b815260206004820152601460248201527314d85b19481a185cc81b9bdd081cdd185c9d195960621b6044820152606401610da4565b601c54421061223a5760405162461bcd60e51b815260206004820152600e60248201526d14d85b19481a185cc8195b99195960921b6044820152606401610da4565b336000818152601760205260409020805460ff1916600117905561225f9060036128bc565b505050505050565b60008060005b6004548110156122af5761228081612843565b6122895761229f565b61229281611cec565b61229c9083614101565b91505b6122a881614218565b905061226d565b50919050565b60606122c082612843565b61231f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732315073693a2055524920717565727920666f72206e6f6e657869736044820152693a32b73a103a37b5b2b760b11b6064820152608401610da4565b60006123296130ee565b905060008151116123495760405180602001604052806000815250611a05565b80612353846130fd565b6040516020016123649291906142ed565b6040516020818303038152906040529392505050565b600f5460408051632b38a15f60e11b815290516000926001600160a01b03169163567142be916004808301926020929190829003018186803b1580156123bf57600080fd5b505afa1580156123d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123f7919061432c565b61240083611cec565b600f5461241791906001600160a01b0316316140b8565b610ca191906140ed565b612429612d38565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b600e8054611a5a90614019565b6001600160a01b03821660009081526016602052604081205460ff1661253e576001600160a01b03821660009081526015602052604090205460ff16156124a157506001610ca1565b60145460405163c455279160e01b81526001600160a01b03858116600483015291821691841690829063c45527919060240160206040518083038186803b1580156124eb57600080fd5b505afa1580156124ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125239190614345565b6001600160a01b0316141561253c576001915050610ca1565b505b6001600160a01b0380841660009081526006602090815260408083209386168352929052205460ff16611a05565b612574612d38565b6001600160a01b0381166125d95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610da4565b61164a81612e91565b6013546125f29062015180614101565b421161264c5760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f74206275726e20756e74696c206f6e65206461792061667465722060448201526373616c6560e01b6064820152608401610da4565b61265533611f12565b6126ba5760405162461bcd60e51b815260206004820152603060248201527f54726173683a207472616e736665722063616c6c6572206973206e6f74206f7760448201526f1b995c881b9bdc88185c1c1c9bdd995960821b6064820152608401610da4565b60006126c583611cec565b9050601d5483106127245760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f74206275726e20617320746f6b656e206973206e6f7420696e2076604482015263185d5b1d60e21b6064820152608401610da4565b61272d836131fa565b6001600160a01b03821661279f57600f5460405163065e70cf60e51b8152600481018390526001600160a01b039091169063cbce19e0906024015b600060405180830381600087803b15801561278257600080fd5b505af1158015612796573d6000803e3d6000fd5b50505050505050565b600f54604051639015ce9f60e01b8152600481018390526001600160a01b03848116602483015290911690639015ce9f90604401612768565b60006001600160e01b031982166380ac58cd60e01b148061280957506001600160e01b03198216635b5e139f60e01b145b8061282457506001600160e01b0319821663780e9d6360e01b145b80610ca157506301ffc9a760e01b6001600160e01b0319831614610ca1565b6000610ca18261324e565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061288382611a0c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6004548161291a5760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610da4565b6001600160a01b03831661297c5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610da4565b816004600082825461298e9190614101565b9091555050600081815260036020526040812080546001600160a01b0319166001600160a01b0386161790556129c49082613285565b805b6129d08383614101565b811015611f405760405181906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480612a1981614218565b9150506129c6565b6000612a2b6132b1565b6004546110be9190614119565b600081600081518110612a4d57612a4d614130565b602090810291909101810151600085815260078352604080822054808352818320839055600890945290208190559150611f40565b6000612a8d82612843565b612af15760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610da4565b6000612afc83611a0c565b9050806001600160a01b0316846001600160a01b03161480612b375750836001600160a01b0316612b2c84610d39565b6001600160a01b0316145b80612b475750612b478185612458565b949350505050565b600080612b5b83612dfa565b91509150846001600160a01b0316826001600160a01b031614612bd55760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610da4565b6001600160a01b038416612c3b5760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610da4565b612c4660008461284e565b6000612c53846001614101565b600881901c600090815260208190526040902054909150600160ff1b60ff83161c16158015612c83575060045481105b15612cb957600081815260036020526040812080546001600160a01b0319166001600160a01b038916179055612cb99082613285565b600084815260036020526040902080546001600160a01b0319166001600160a01b038716179055818414612cf257612cf2600085613285565b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461225f565b600c546001600160a01b031633146110b25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610da4565b6000805b600a54811015612dcc57600081815260096020526040902054831015612dbc5792915050565b612dc581614218565b9050612d96565b5050600a54919050565b6000806000612de58585613311565b91509150612df28161337e565b509392505050565b600080612e0683612843565b612e675760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610da4565b612e7083613539565b6000818152600360205260409020546001600160a01b031694909350915050565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000612710612ef183611d44565b612efb9190614146565b612f069060be614101565b612f12906127106140ed565b610ca1906001614101565b60007f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699096001600160a01b0316635d3b1d30612f5760105490565b6011546001600160401b03166040516001600160e01b031960e085901b16815260048101929092526001600160401b0316602482015261ffff7f000000000000000000000000000000000000000000000000000000000000000316604482015263ffffffff7f00000000000000000000000000000000000000000000000000000000000111701660648201526001608482015260a401602060405180830381600087803b15801561300757600080fd5b505af115801561301b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061303f919061432c565b90507f76421cb080d40e8a03ba462b500012451ba59bdebc46694dc458807c1d754b628160405161307291815260200190565b60405180910390a1600a54600082815260076020526040902055600454600a80546000908152600960205260408120929092558054916130b183614218565b919050555050565b6130c4848484612b4f565b6130d2848484600185613545565b611f405760405162461bcd60e51b8152600401610da490614362565b6060600d8054610cb690614019565b6060816131215750506040805180820190915260018152600360fc1b602082015290565b8160005b811561314b578061313581614218565b91506131449050600a836140ed565b9150613125565b6000816001600160401b0381111561316557613165613b71565b6040519080825280601f01601f19166020018201604052801561318f576020820181803683370190505b5090505b8415612b47576131a4600183614119565b91506131b1600a86614146565b6131bc906030614101565b60f81b8183815181106131d1576131d1614130565b60200101906001600160f81b031916908160001a9053506131f3600a866140ed565b9450613193565b600061320582611a0c565b9050613212600b83613285565b60405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600881901c6000908152600b6020526040812054600160ff1b60ff84161c161561327a57506000919050565b610ca1826004541190565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b6000806008600454901c60016132c79190614101565b905060005b8181101561330c576000818152600b60205260409020546132ec81613688565b6132f69085614101565b935050808061330490614218565b9150506132cc565b505090565b6000808251604114156133485760208301516040840151606085015160001a61333c878285856136a7565b945094505050506111aa565b8251604014156133725760208301516040840151613367868383613794565b9350935050506111aa565b506000905060026111aa565b6000816004811115613392576133926143b7565b141561339b5750565b60018160048111156133af576133af6143b7565b14156133fd5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610da4565b6002816004811115613411576134116143b7565b141561345f5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610da4565b6003816004811115613473576134736143b7565b14156134cc5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610da4565b60048160048111156134e0576134e06143b7565b141561164a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610da4565b6000610ca181836137cd565b60006001600160a01b0385163b1561367b57506001835b6135668486614101565b81101561367557604051630a85bd0160e11b81526001600160a01b0387169063150b7a029061359f9033908b90869089906004016143cd565b602060405180830381600087803b1580156135b957600080fd5b505af19250505080156135e9575060408051601f3d908101601f191682019092526135e69181019061440a565b60015b613643573d808015613617576040519150601f19603f3d011682016040523d82523d6000602084013e61361c565b606091505b50805161363b5760405162461bcd60e51b8152600401610da490614362565b805181602001fd5b82801561366057506001600160e01b03198116630a85bd0160e11b145b9250508061366d81614218565b91505061355c565b5061367f565b5060015b95945050505050565b60005b81156136a25760001982019091169060010161368b565b919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156136de575060009050600361378b565b8460ff16601b141580156136f657508460ff16601c14155b15613707575060009050600461378b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561375b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166137845760006001925092505061378b565b9150600090505b94509492505050565b6000806001600160ff1b038316816137b160ff86901c601b614101565b90506137bf878288856136a7565b935093505050935093915050565b600881901c60008181526020849052604081205490919060ff808516919082181c8015613812576137fd816138cb565b60ff168203600884901b179350505050610ca1565b6000831161387f5760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610da4565b5060001990910160008181526020869052604090205490919080156138bd576138a7816138cb565b60ff0360ff16600884901b179350505050610ca1565b613812565b50505092915050565b60006040518061012001604052806101008152602001614428610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff61391485613935565b02901c8151811061392757613927614130565b016020015160f81c92915050565b600080821161394357600080fd5b5060008190031690565b6040518061012001604052806009906020820280368337509192915050565b82805461397890614019565b90600052602060002090601f01602090048101928261399a57600085556139e0565b82601f106139b357805160ff19168380011785556139e0565b828001600101855582156139e0579182015b828111156139e05782518255916020019190600101906139c5565b506139ec929150613a64565b5090565b8280546139fc90614019565b90600052602060002090601f016020900481019282613a1e57600085556139e0565b82601f10613a375782800160ff198235161785556139e0565b828001600101855582156139e0579182015b828111156139e0578235825591602001919060010190613a49565b5b808211156139ec5760008155600101613a65565b6001600160e01b03198116811461164a57600080fd5b600060208284031215613aa157600080fd5b8135611a0581613a79565b60005b83811015613ac7578181015183820152602001613aaf565b83811115611f405750506000910152565b60008151808452613af0816020860160208601613aac565b601f01601f19169290920160200192915050565b602081526000611a056020830184613ad8565b600060208284031215613b2957600080fd5b5035919050565b6001600160a01b038116811461164a57600080fd5b60008060408385031215613b5857600080fd5b8235613b6381613b30565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613baf57613baf613b71565b604052919050565b60008060408385031215613bca57600080fd5b823591506020808401356001600160401b0380821115613be957600080fd5b818601915086601f830112613bfd57600080fd5b813581811115613c0f57613c0f613b71565b8060051b9150613c20848301613b87565b8181529183018401918481019089841115613c3a57600080fd5b938501935b83851015613c5857843582529385019390850190613c3f565b8096505050505050509250929050565b600080600060608486031215613c7d57600080fd5b8335613c8881613b30565b92506020840135613c9881613b30565b929592945050506040919091013590565b60008060408385031215613cbc57600080fd5b50508035926020909101359150565b6101208101818360005b60098110156138c2578151835260209283019290910190600101613cd5565b600060208284031215613d0657600080fd5b8135611a0581613b30565b600060208284031215613d2357600080fd5b81356001600160401b0381168114611a0557600080fd5b803580151581146136a257600080fd5b60008060408385031215613d5d57600080fd5b8235613d6881613b30565b9150613d7660208401613d3a565b90509250929050565b60006001600160401b03831115613d9857613d98613b71565b613dab601f8401601f1916602001613b87565b9050828152838383011115613dbf57600080fd5b828260208301376000602084830101529392505050565b600060208284031215613de857600080fd5b81356001600160401b03811115613dfe57600080fd5b8201601f81018413613e0f57600080fd5b612b4784823560208401613d7f565b60008083601f840112613e3057600080fd5b5081356001600160401b03811115613e4757600080fd5b6020830191508360208285010111156111aa57600080fd5b600080600060408486031215613e7457600080fd5b83356001600160401b03811115613e8a57600080fd5b613e9686828701613e1e565b9094509250506020840135613eaa81613b30565b809150509250925092565b600060208284031215613ec757600080fd5b611a0582613d3a565b60008060408385031215613ee357600080fd5b82359150602083013560ff81168114613efb57600080fd5b809150509250929050565b60008060208385031215613f1957600080fd5b82356001600160401b03811115613f2f57600080fd5b613f3b85828601613e1e565b90969095509350505050565b60008060008060808587031215613f5d57600080fd5b8435613f6881613b30565b93506020850135613f7881613b30565b92506040850135915060608501356001600160401b03811115613f9a57600080fd5b8501601f81018713613fab57600080fd5b613fba87823560208401613d7f565b91505092959194509250565b60008060408385031215613fd957600080fd5b8235613fe481613b30565b91506020830135613efb81613b30565b6000806040838503121561400757600080fd5b823591506020830135613efb81613b30565b600181811c9082168061402d57607f821691505b602082108114156122af57634e487b7160e01b600052602260045260246000fd5b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156140d2576140d26140a2565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826140fc576140fc6140d7565b500490565b60008219821115614114576141146140a2565b500190565b60008282101561412b5761412b6140a2565b500390565b634e487b7160e01b600052603260045260246000fd5b600082614155576141556140d7565b500690565b600060ff821660ff84168060ff03821115614177576141776140a2565b019392505050565b600060ff821680614192576141926140a2565b6000190192915050565b600060ff821660ff8416808210156141b6576141b66140a2565b90039392505050565b6000816141ce576141ce6140a2565b506000190190565b600060ff8316806141e9576141e96140d7565b8060ff84160691505092915050565b600060ff821660ff81141561420f5761420f6140a2565b60010192915050565b600060001982141561422c5761422c6140a2565b5060010190565b6020808252603b908201527f45524337323150736952616e646f6d5365656452657665616c3a20736565642060408201527f717565727920666f72206e6f6e6578697374656e7420746f6b656e0000000000606082015260800190565b6020808252603c908201527f45524337323150736952616e646f6d5365656452657665616c3a2052616e646f60408201527f6d6e657373206861736e2774206265656e2066756c6c66696c6c656400000000606082015260800190565b600083516142ff818460208801613aac565b835190830190614313818360208801613aac565b64173539b7b760d91b9101908152600501949350505050565b60006020828403121561433e57600080fd5b5051919050565b60006020828403121561435757600080fd5b8151611a0581613b30565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061440090830184613ad8565b9695505050505050565b60006020828403121561441c57600080fd5b8151611a0581613a7956fe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212204668f168a7dc9bfcebaee822708329a10d0d9cac7627ad0ceaf8e775ad3104b564736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c100000000000000000000000000000000000000000000000000000000633855f0000000000000000000000000000000000000000000000000000000006229a1f0000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990900000000000000000000000000000000000000000000000000000000000111700000000000000000000000000000000000000000000000000000000000000003ff8dedfbfa60af186cf3c830acbc32c05aae823045ae5ea7da1e45fbfaba4f9200000000000000000000000000000000000000000000000000000000000001ad
-----Decoded View---------------
Arg [0] : _proxyRegistryAddress (address): 0xa5409ec958C83C3f309868babACA7c86DCB077c1
Arg [1] : _saleStartTime (uint256): 1664636400
Arg [2] : _saleEndTime (uint256): 1646895600
Arg [3] : coordinator (address): 0x271682DEB8C4E0901D1a1550aD2e64D568E69909
Arg [4] : _callbackGasLimit (uint32): 70000
Arg [5] : _requestConfirmations (uint16): 3
Arg [6] : _defaultKeyHash (bytes32): 0xff8dedfbfa60af186cf3c830acbc32c05aae823045ae5ea7da1e45fbfaba4f92
Arg [7] : _vrfsubid (uint64): 429
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1
Arg [1] : 00000000000000000000000000000000000000000000000000000000633855f0
Arg [2] : 000000000000000000000000000000000000000000000000000000006229a1f0
Arg [3] : 000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Arg [4] : 0000000000000000000000000000000000000000000000000000000000011170
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [6] : ff8dedfbfa60af186cf3c830acbc32c05aae823045ae5ea7da1e45fbfaba4f92
Arg [7] : 00000000000000000000000000000000000000000000000000000000000001ad
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.