Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
NFT
Overview
Max Total Supply
5,000 KS
Holders
1,417
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
0 KSLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Kingship
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 500 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /***********************************************************************************\ | ___ __ ___ ________ ________ ________ ___ ___ ___ ________ | | |\ \|\ \ |\ \ |\ ___ \ |\ ____\ |\ ____\ |\ \|\ \ |\ \ |\ __ \ | | \ \ \/ /|_\ \ \\ \ \\ \ \\ \ \___| \ \ \___|_\ \ \\\ \\ \ \\ \ \|\ \ | | \ \ ___ \\ \ \\ \ \\ \ \\ \ \ ___\ \_____ \\ \ __ \\ \ \\ \ ____\ | | \ \ \\ \ \\ \ \\ \ \\ \ \\ \ \|\ \\|____|\ \\ \ \ \ \\ \ \\ \ \___| | | \ \__\\ \__\\ \__\\ \__\\ \__\\ \_______\ ____\_\ \\ \__\ \__\\ \__\\ \__\ | | \|__| \|__| \|__| \|__| \|__| \|_______||\_________\\|__|\|__| \|__| \|__| | | \|_________| | \***********************************************************************************/ /** * @title Kingship Contract * @author Ben Yu, rminla.eth and Itzik Lerner AKA the NFTDevz * @notice This contract handles minting Kingship Genesis NFT project. */ contract Kingship is ERC721A, Ownable, ReentrancyGuard, Pausable, ERC2981 { using ECDSA for bytes32; using Strings for uint256; using SafeMath for uint256; using SafeERC20 for IERC20; uint256[] public priceList = [ 0.00409372 ether, // ApeCoin price in ETH 0.19 ether, // Allowlist wave 1 price 0.19 ether, // Allowlist wave 2 price 0.19 ether, // Allowlist wave 3 price 0.19 ether // Public Sale price ]; // States Wave1, Wave2, Wave3 and PublicSale double as indexes of priceList array enum States { Premint, Wave1, Wave2, Wave3, PublicSale, SaleEnded, Redeem } //events event Redeem(address owner, uint256 redemptionBatchId, uint256[] redeemedTokenIds); //constants uint256 public constant MAX_SUPPLY = 5000; address internal APECOIN_CONTRACT = 0x4d224452801ACEd8B2F0aebE155379bb5D594381; //token properties string public baseTokenURI; string public contractURI; //commercial properties address public royaltyAddress = 0x59705Eb15a3965c75F871977976A8f053BC4B752; address public partner1Address = 0x59705Eb15a3965c75F871977976A8f053BC4B752; address public partner2Address = 0x59705Eb15a3965c75F871977976A8f053BC4B752; address public alternateSigner = 0x8a973CA0A9093768cF9F142b2443dfc1dbE7F5eD; uint256 public mintsAllowedPerAddress = 4; uint96 public royaltyFee = 650; //fairness properties uint256 public startingIndex; uint256 public startingIndexTimestamp; string public provenance = '3ce42f696559f86cca6a32ec60bed95153ffd66085db1d142a4e3f0c1a850663'; uint256 public provenanceTimestamp; //state properties bool[] public states = new bool[](7); uint256[] public waveAllocations = [0,2000,1000]; bytes32 public merkleRoot; //redemption mapping(uint256 => uint256) public redeemed; uint256 public redemptionBatchIndex; bool sendOnRedeem = false; address public redeemAddress; /** * @param name Token name * @param symbol Token symbol * @param baseTokenURI_ Base URI for all tokens */ constructor( string memory name, string memory symbol, string memory baseTokenURI_ ) ERC721A(name, symbol) { baseTokenURI = baseTokenURI_; _setDefaultRoyalty(royaltyAddress, royaltyFee); } /** * @notice Prevent contract-to-contract calls */ modifier originalUser() { require( msg.sender == tx.origin, "Must invoke directly from your wallet" ); _; } /** * @notice Ensure that required state is enabled */ modifier stateEnabled(States _state) { require( states[uint256(_state)], "Invalid state" ); _; } /** * @notice Ensure that number of mints per address has not been exceeded */ modifier userCanStillMint(uint256 _numTokens) { require( _numberMinted(msg.sender) + _numTokens <= mintsAllowedPerAddress, "Max Mints Per Address Exceeded" ); _; } /** * @notice Ensure that total supply has not been exceeded */ modifier supplyNotExceeded(uint256 _numTokens) { require(totalSupply() + _numTokens <= MAX_SUPPLY, "Max Supply Exceeded"); _; } /** * @notice Change the ApeCoin contract address */ function setApeCoinAddress(address _apeCoinContractAddress) external onlyOwner { APECOIN_CONTRACT = _apeCoinContractAddress; } /** * @notice Change starting tokenId to 1 (from erc721A) */ function _startTokenId() internal view virtual override returns (uint256) { return 1; } /** * @notice Change the royalty fee for the collection */ function setRoyaltyFee(uint96 _feeNumerator) external onlyOwner { royaltyFee = _feeNumerator; _setDefaultRoyalty(royaltyAddress, royaltyFee); } /** * @notice update wave allocations */ function setWaveAllocations(uint256[] calldata _waveAllocations) external onlyOwner { require( _waveAllocations.length == waveAllocations.length, "Must provide array of all allocations" ); waveAllocations = _waveAllocations; } /** * @notice update priceList */ function setPriceList(uint256[] calldata _priceList) external onlyOwner { require( _priceList.length == priceList.length, "Must provide array of all prices" ); require(_priceList[0] > 0, "ApeCoin to ETH rate must be greater than 0"); priceList = _priceList; } /** * @notice update apeCoinToEth rate */ function setApeCoinPrice(uint256 _apeCoinToEthRate) external onlyOwner { require(_apeCoinToEthRate > 0, "ApeCoin to ETH rate must be greater than 0"); priceList[0] = _apeCoinToEthRate; } /** * @notice set alternate signer (used for "reserve" functionality) */ function setAlternateSignerAddress(address _alternateSigner) external onlyOwner { alternateSigner = _alternateSigner; } /** * @notice Set partner addresses */ function setPartnerAddresses(address _partner1Address, address _partner2Address) external onlyOwner { require(_partner1Address != address(0), "Partner addresses must be valid"); require(_partner2Address != address(0), "Partner addresses must be valid"); partner1Address = _partner1Address; partner2Address = _partner2Address; } /** * @notice Change the redemption settings */ function changeRedemptionSettings(address _redeemAddress, bool _sendOnRedeem) external onlyOwner { redeemAddress = _redeemAddress; sendOnRedeem = _sendOnRedeem; } /** * @notice Change the royalty address where royalty payouts are sent */ function setRoyaltyAddress(address _royaltyAddress) external onlyOwner { royaltyAddress = _royaltyAddress; _setDefaultRoyalty(royaltyAddress, royaltyFee); } /** * @notice Change the number of mints allowed per address */ function setNumberOfMintsPerAddress(uint256 _mintsAllowedPerAddress) external onlyOwner { mintsAllowedPerAddress = _mintsAllowedPerAddress; } /** * @notice Sets a provenance hash of pregenerated tokens for fairness. Should be set before first token mints */ function setProvenanceHash(string memory _provenanceHash) public onlyOwner { provenance = _provenanceHash; provenanceTimestamp = block.timestamp; } /** * @notice toggles the state */ function toggleState(uint256 _state) public onlyOwner { require( _state >= uint256(type(States).min) && _state <= uint256(type(States).max), "Invalid state transition: State does not exist" ); states[_state] = !states[_state]; } function pause() public onlyOwner { _pause(); } function unpause() public onlyOwner { _unpause(); } /** * @notice Turn off all sales */ function setSaleEnded() public onlyOwner { setSaleEndedState(); } /** * @notice Turn off all sales when Max Supply reached */ function setSaleEndedState() private { states[uint256(States.PublicSale)] = false; states[uint256(States.Wave1)] = false; states[uint256(States.Wave2)] = false; states[uint256(States.Wave3)] = false; } /** * @notice public sale mint function */ function publicSaleMint(uint256 _numTokens, bool _payWithApeCoin) external payable nonReentrant originalUser whenNotPaused stateEnabled(States.PublicSale) userCanStillMint(_numTokens) supplyNotExceeded(_numTokens) { handlePayment( priceList[uint256(States.PublicSale)] * _numTokens, _payWithApeCoin ); _safeMint(msg.sender, _numTokens); if (totalSupply() == MAX_SUPPLY) { setSaleEndedState(); } } /** * @notice Allow List Verify */ function allowListVerify( uint256 _wave, address _address, bytes32[] calldata _merkleProof ) public view returns (bool) { bytes32 leaf = keccak256(abi.encodePacked(_wave, _address)); return MerkleProof.verify(_merkleProof, merkleRoot, leaf); } /** * @notice Allow List mint function */ function allowListMint( uint256 _wave, uint256 _numTokens, bool _payWithApeCoin, bytes32[] calldata _merkleProof ) external payable nonReentrant originalUser whenNotPaused stateEnabled(States(_wave)) userCanStillMint(_numTokens) supplyNotExceeded(_numTokens) { require( allowListVerify(_wave, msg.sender, _merkleProof), "This address is not elegible for the provided allowlist wave" ); // support for allocations if (_wave < uint256(States.Wave3) && !states[uint256(States.Wave3)]) { require(waveAllocations[_wave] > 0, "Allocation for your community has been filled. Please try again in the next wave"); waveAllocations[_wave] = waveAllocations[_wave] < _numTokens ? 0 : waveAllocations[_wave] - _numTokens; } handlePayment(priceList[_wave] * _numTokens, _payWithApeCoin); _safeMint(msg.sender, _numTokens); if (totalSupply() == MAX_SUPPLY) { setSaleEndedState(); } } /** * @notice common charge function to use on all mint types */ function handlePayment(uint256 _amount, bool _payWithApeCoin) private { if (_payWithApeCoin) { uint256 apeCoinToEthRate = priceList[0]; require(apeCoinToEthRate > 0, "ApeCoin to ETH rate must be greater than 0"); IERC20(APECOIN_CONTRACT).safeTransferFrom( msg.sender, address(this), _amount.mul(100000).div(apeCoinToEthRate).mul(10000000000000) //10 ** 13 ); } else { require(msg.value >= _amount, "Insufficient Payment"); } } /** * @notice Allow owner to reserve tokens without cost to a specific addresses */ function reserve(uint256 _numTokens, address _recipient) external supplyNotExceeded(_numTokens) { require(msg.sender == alternateSigner); _safeMint(_recipient, _numTokens); } /** * @notice Set the starting index for the public and allow list mints */ function setStartingIndex() external onlyOwner { require(startingIndex == 0, "STARTING_INDEX_ALREADY_SET"); startingIndex = generateRandomStartingIndex(MAX_SUPPLY); startingIndexTimestamp = block.timestamp; } /** * @notice Creates a random starting index to offset pregenerated tokens by for fairness */ function generateRandomStartingIndex(uint256 _range) private view returns (uint256) { uint256 index; // Blockhash only works for the most 256 recent blocks. uint256 _block_shift = uint256( keccak256(abi.encodePacked(block.difficulty, block.timestamp)) ); _block_shift = 1 + (_block_shift % 255); // This shouldn't happen, but just in case the blockchain gets a reboot? if (block.number < _block_shift) { _block_shift = 1; } uint256 _block_ref = block.number - _block_shift; index = uint256(blockhash(_block_ref)) % _range; // Prevent default sequence // or same last digit if (index % 10 == 0) { index++; } return index; } /** * @notice Allow contract owner to withdraw ETH funds * split between partners. */ function withdraw() public onlyOwner { require(partner1Address != address(0), "Must have valid partner1 withdraw address"); uint256 _balance = address(this).balance; require(_balance > 0, 'No ETH to withdraw'); if (partner1Address == partner2Address) { require(payable(partner1Address).send(_balance)); } else { require(partner2Address != address(0), "Must have valid partner2 withdraw address"); uint256 _split = _balance.mul(90).div(100); require(payable(partner1Address).send(_split)); require(payable(partner2Address).send(_balance.sub(_split))); } } /** * @notice Allow contract owner to withdraw APECOIN funds * splitted between partners. */ function withdrawApe() public onlyOwner { require(partner1Address != address(0), "Must have valid partner1 withdraw address"); uint256 _apecoinBalance = IERC20(APECOIN_CONTRACT).balanceOf(address(this)); require(_apecoinBalance > 0, 'No APECOIN to withdraw'); if (partner1Address == partner2Address) { IERC20(APECOIN_CONTRACT).safeTransfer( partner1Address, _apecoinBalance ); } else { require(partner2Address != address(0), "Must have valid partner2 withdraw address"); uint256 _split = _apecoinBalance.mul(90).div(100); IERC20(APECOIN_CONTRACT).safeTransfer( partner1Address, _split ); IERC20(APECOIN_CONTRACT).safeTransfer( partner2Address, _apecoinBalance.sub(_split) ); } } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "URI query for nonexistent token"); return string(abi.encodePacked(_baseURI(), tokenId.toString(), ".json")); } function _baseURI() internal view virtual override returns (string memory) { return baseTokenURI; } /** * @notice Update the base token URI */ function setBaseURI(string calldata _newBaseURI) external onlyOwner { baseTokenURI = _newBaseURI; } /** * @notice Update the contractURI for OpenSea * Update for collection-specific metadata * https://docs.opensea.io/docs/contract-level-metadata */ function setContractURI(string calldata _newContractURI) external onlyOwner { contractURI = _newContractURI; } /** * @notice Set the merkle root for the allow list mint */ function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner { merkleRoot = _merkleRoot; } /** * @notice ADD DESCRIPTION */ function supportsInterface(bytes4 _interfaceId) public view override(ERC721A, ERC2981) returns (bool) { return super.supportsInterface(_interfaceId); } /** * @notice Check which tower/band member is represented by the tokenId */ function towerOf(uint256 _tokenId) public view returns (uint8) { require(startingIndex > 0, "Must first set startingIndex"); uint8[10] memory towerOrder = [4, 2, 4, 3, 3, 1, 4, 4, 2, 3]; // 10 groups out of 1000 will have a chance to mint tokens of 4 different towers uint8[10] memory rareTowerOrder = [4, 2, 4, 2, 3, 1, 3, 3, 4, 4]; uint256 originalIndex = (_tokenId + MAX_SUPPLY - startingIndex - 1) % MAX_SUPPLY; if (originalIndex % 1000 - originalIndex % 10 == 770) { return rareTowerOrder[originalIndex % 10]; } else { return towerOrder[originalIndex % 10]; } } /** * @notice Check if the set of tokens passed in is valid for redemption */ function isTokenSetRedeemable(uint256[] memory _tokenIDs) public view returns (bool) { return isTokenSetRedeemable(msg.sender, _tokenIDs); } /** * @notice Check if the set of tokens passed in is valid for redemption by the given address */ function isTokenSetRedeemable(address _address, uint256[] memory _tokenIDs) public view returns (bool) { require(_tokenIDs.length == 4, "Redeemable set must have 4 tokens"); bool[4] memory towersFound; for (uint256 i = 0; i < 4; i++) { uint256 tokenId = _tokenIDs[i]; uint256 currentTower = towerOf(tokenId); require( redeemed[tokenId] == 0, "Token has been redeemed already" ); require( !towersFound[currentTower-1], "Set must consist of 4 unique tokens" ); require( ownerOf(tokenId) == _address, "Only the owner of a token can redeem it" ); towersFound[currentTower-1] = true; } return true; } /** * @notice Allows a user to redeem a set of tokens for a surprise. Stay tuned!!!! */ function redeem(uint256[] memory _tokenIDs) external stateEnabled(States.Redeem) { require(isTokenSetRedeemable(_tokenIDs), "The set is not redeemable"); redemptionBatchIndex++; for (uint256 i = 0; i < 4; i++) { redeemed[_tokenIDs[i]] = redemptionBatchIndex; //if required, transfer the redeemed token if (sendOnRedeem) { transferFrom(msg.sender, redeemAddress, _tokenIDs[i]); } } emit Redeem(msg.sender, redemptionBatchIndex, _tokenIDs); } receive() external payable {} }
// SPDX-License-Identifier: MIT // Creator: Chiru Labs pragma solidity ^0.8.4; 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/utils/Address.sol'; import '@openzeppelin/contracts/utils/Context.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/utils/introspection/ERC165.sol'; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerQueryForNonexistentToken(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error URIQueryForNonexistentToken(); /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; // For miscellaneous variable(s) pertaining to the address // (e.g. number of whitelist mint slots used). // If there are multiple variables, please pack them into a uint64. uint64 aux; } // The tokenId of the next token to be minted. uint256 internal _currentIndex; // The number of tokens burned. uint256 internal _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * To change the starting tokenId, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens. */ function totalSupply() public view returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex - _startTokenId() times unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view returns (uint256) { // Counter underflow is impossible as _currentIndex does not decrement, // and it is initialized to _startTokenId() unchecked { return _currentIndex - _startTokenId(); } } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberMinted); } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberBurned); } /** * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return _addressData[owner].aux; } /** * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal { _addressData[owner].aux = aux; } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr && curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; if (!ownership.burned) { if (ownership.addr != address(0)) { return ownership; } // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. while (true) { curr--; ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return _ownershipOf(tokenId).addr; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ERC721A.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSender()) revert ApproveToCaller(); _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 { _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { _transfer(from, to, tokenId); if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; } function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ''); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { _mint(to, quantity, _data, true); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; if (safe && to.isContract()) { do { emit Transfer(address(0), to, updatedIndex); if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (updatedIndex != end); // Reentrancy protection if (_currentIndex != startTokenId) revert(); } else { do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex != end); } _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { _addressData[from].balance -= 1; _addressData[to].balance += 1; TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = to; currSlot.startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev This is equivalent to _burn(tokenId, false) */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); address from = prevOwnership.addr; if (approvalCheck) { bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { AddressData storage addressData = _addressData[from]; addressData.balance -= 1; addressData.numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = from; currSlot.startTimestamp = uint64(block.timestamp); currSlot.burned = true; // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * And also called before burning one token. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * And also called after one token has been burned. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.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. 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. 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)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `tokenId` must be already minted. * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = _efficientHash(computedHash, proofElement); } else { // Hash(current element of the proof + current computed hash) computedHash = _efficientHash(proofElement, computedHash); } } return computedHash; } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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 be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// 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) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
{ "optimizer": { "enabled": true, "runs": 500 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"baseTokenURI_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","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":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"redemptionBatchId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"redeemedTokenIds","type":"uint256[]"}],"name":"Redeem","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_wave","type":"uint256"},{"internalType":"uint256","name":"_numTokens","type":"uint256"},{"internalType":"bool","name":"_payWithApeCoin","type":"bool"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"allowListMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_wave","type":"uint256"},{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"allowListVerify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"alternateSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_redeemAddress","type":"address"},{"internalType":"bool","name":"_sendOnRedeem","type":"bool"}],"name":"changeRedemptionSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIDs","type":"uint256[]"}],"name":"isTokenSetRedeemable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256[]","name":"_tokenIDs","type":"uint256[]"}],"name":"isTokenSetRedeemable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintsAllowedPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"partner1Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"partner2Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"priceList","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provenance","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provenanceTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_numTokens","type":"uint256"},{"internalType":"bool","name":"_payWithApeCoin","type":"bool"}],"name":"publicSaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIDs","type":"uint256[]"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"redeemed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"redemptionBatchIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_numTokens","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"reserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyFee","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_alternateSigner","type":"address"}],"name":"setAlternateSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_apeCoinContractAddress","type":"address"}],"name":"setApeCoinAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_apeCoinToEthRate","type":"uint256"}],"name":"setApeCoinPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newContractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintsAllowedPerAddress","type":"uint256"}],"name":"setNumberOfMintsPerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_partner1Address","type":"address"},{"internalType":"address","name":"_partner2Address","type":"address"}],"name":"setPartnerAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_priceList","type":"uint256[]"}],"name":"setPriceList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_provenanceHash","type":"string"}],"name":"setProvenanceHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyAddress","type":"address"}],"name":"setRoyaltyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"_feeNumerator","type":"uint96"}],"name":"setRoyaltyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setSaleEnded","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setStartingIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_waveAllocations","type":"uint256[]"}],"name":"setWaveAllocations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startingIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startingIndexTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"states","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"_state","type":"uint256"}],"name":"toggleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"towerOf","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"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":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"waveAllocations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawApe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
610120604052660e8b377668f00060809081526702a303fe4b53000060a081905260c081905260e0819052610100526200003e90600d9060056200038e565b50600e80546001600160a01b0319908116734d224452801aced8b2f0aebe155379bb5d594381179091556011805482167359705eb15a3965c75f871977976a8f053bc4b75290811790915560128054831682179055601380548316909117905560148054909116738a973ca0a9093768cf9f142b2443dfc1dbe7f5ed1790556004601555601680546001600160601b03191661028a179055604080516060810182528181529062005245602083013980516200010391601991602090910190620003e9565b506040805160078082526101008201909252906020820160e080368337505081516200013792601b92506020019062000466565b5060408051606081018252600081526107d060208201526103e8918101919091526200016890601c9060036200050d565b506020805460ff191690553480156200018057600080fd5b506040516200528538038062005285833981016040819052620001a39162000635565b825183908390620001bc906002906020850190620003e9565b508051620001d2906003906020840190620003e9565b5050600160005550620001e53362000237565b6001600955600a805460ff1916905580516200020990600f906020840190620003e9565b506011546016546200022e916001600160a01b0316906001600160601b031662000289565b50505062000702565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6127106001600160601b0382161115620002fd5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620003555760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620002f4565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600b55565b828054828255906000526020600020908101928215620003d7579160200282015b82811115620003d757825182906001600160401b0316905591602001919060010190620003af565b50620003e592915062000551565b5090565b828054620003f790620006c6565b90600052602060002090601f0160209004810192826200041b5760008555620003d7565b82601f106200043657805160ff1916838001178555620003d7565b82800160010185558215620003d7579182015b82811115620003d757825182559160200191906001019062000449565b82805482825590600052602060002090601f01602090048101928215620003d75791602002820160005b83821115620004cf57835183826101000a81548160ff021916908315150217905550926020019260010160208160000104928301926001030262000490565b8015620004fe5782816101000a81549060ff0219169055600101602081600001049283019260010302620004cf565b5050620003e592915062000551565b828054828255906000526020600020908101928215620003d7579160200282015b82811115620003d7578251829061ffff169055916020019190600101906200052e565b5b80821115620003e5576000815560010162000552565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200059057600080fd5b81516001600160401b0380821115620005ad57620005ad62000568565b604051601f8301601f19908116603f01168101908282118183101715620005d857620005d862000568565b81604052838152602092508683858801011115620005f557600080fd5b600091505b83821015620006195785820183015181830184015290820190620005fa565b838211156200062b5760008385830101525b9695505050505050565b6000806000606084860312156200064b57600080fd5b83516001600160401b03808211156200066357600080fd5b62000671878388016200057e565b945060208601519150808211156200068857600080fd5b62000696878388016200057e565b93506040860151915080821115620006ad57600080fd5b50620006bc868287016200057e565b9150509250925092565b600181811c90821680620006db57607f821691505b602082108103620006fc57634e487b7160e01b600052602260045260246000fd5b50919050565b614b3380620007126000396000f3fe6080604052600436106103f35760003560e01c80637ed0f1c111610208578063b88d4fde11610118578063d547cfb7116100ab578063e8a9b8da1161007a578063e8a9b8da14610b9e578063e985e9c514610bbe578063e986655014610c07578063f2fde38b14610c1c578063f9afb26a14610c3c57600080fd5b8063d547cfb714610b3e578063e6afcd1314610b53578063e8a3d48514610b69578063e8a58f0314610b7e57600080fd5b8063c3ded9c6116100e7578063c3ded9c614610ad3578063c87b56dd14610ae8578063cb774d4714610b08578063d08f3a0214610b1e57600080fd5b8063b88d4fde14610a52578063b8997a9714610a72578063b93a6d2114610aaa578063bf669ed514610abd57600080fd5b80639bf212131161019b578063a78ea5b61161016a578063a78ea5b6146109b2578063aa97b057146109d2578063ad2f852a146109f2578063b4ad6fee14610a12578063b66c6c8e14610a3257600080fd5b80639bf212131461092a578063a22cb4651461094a578063a57c76ad1461096a578063a66388991461098057600080fd5b806390780f02116101d757806390780f02146108c0578063938e3d7b146108d557806395d89b41146108f55780639ba6ca991461090a57600080fd5b80637ed0f1c114610840578063826fbc831461086d5780638456cb591461088d5780638da5cb5b146108a257600080fd5b80632eb4a7ab1161030357806355f804b3116102965780636dd90596116102655780636dd90596146107b557806370a08231146107cb578063715018a6146107eb57806378dd9371146108005780637cb647591461082057600080fd5b806355f804b31461073d57806359fc94731461075d5780635c975abb1461077d5780636352211e1461079557600080fd5b80633ccfd60b116102d25780633ccfd60b146106e05780633f4ba83a146106f557806342842e0e1461070a57806348d74e451461072a57600080fd5b80632eb4a7ab1461067457806331faafb41461068a57806332cb6b0c146106aa57806335bf6df0146106c057600080fd5b80630ec5a208116103865780631bd36ea7116103555780631bd36ea7146105b05780631f2ace5e146105d057806323b872dd146105f0578063265b5150146106105780632a55205a1461063557600080fd5b80630ec5a2081461053e5780630f7309e81461055e578063109695231461057357806318160ddd1461059357600080fd5b806306d254da116103c257806306d254da146104a457806306fdde03146104c4578063081812fc146104e6578063095ea7b31461051e57600080fd5b8063017a9105146103ff57806301ffc9a71461043457806303339bcb14610454578063045585a41461047657600080fd5b366103fa57005b600080fd5b34801561040b57600080fd5b5061041f61041a3660046141fc565b610c5c565b60405190151581526020015b60405180910390f35b34801561044057600080fd5b5061041f61044f36600461422b565b610c90565b34801561046057600080fd5b5061047461046f366004614264565b610ca1565b005b34801561048257600080fd5b506104966104913660046141fc565b610d32565b60405190815260200161042b565b3480156104b057600080fd5b506104746104bf366004614290565b610d53565b3480156104d057600080fd5b506104d9610dd2565b60405161042b9190614303565b3480156104f257600080fd5b506105066105013660046141fc565b610e64565b6040516001600160a01b03909116815260200161042b565b34801561052a57600080fd5b50610474610539366004614316565b610ea8565b34801561054a57600080fd5b50601354610506906001600160a01b031681565b34801561056a57600080fd5b506104d9610f30565b34801561057f57600080fd5b5061047461058e3660046143df565b610fbe565b34801561059f57600080fd5b506001546000540360001901610496565b3480156105bc57600080fd5b50601254610506906001600160a01b031681565b3480156105dc57600080fd5b5061041f6105eb36600461446d565b611021565b3480156105fc57600080fd5b5061047461060b3660046144c7565b6110b7565b34801561061c57600080fd5b506020546105069061010090046001600160a01b031681565b34801561064157600080fd5b50610655610650366004614503565b6110c2565b604080516001600160a01b03909316835260208301919091520161042b565b34801561068057600080fd5b50610496601d5481565b34801561069657600080fd5b506104746106a5366004614525565b611170565b3480156106b657600080fd5b5061049661138881565b3480156106cc57600080fd5b506104746106db36600461455c565b6111f3565b3480156106ec57600080fd5b5061047461127a565b34801561070157600080fd5b506104746114b6565b34801561071657600080fd5b506104746107253660046144c7565b611508565b610474610738366004614593565b611523565b34801561074957600080fd5b506104746107583660046145fd565b6119f0565b34801561076957600080fd5b5061047461077836600461466f565b611a44565b34801561078957600080fd5b50600a5460ff1661041f565b3480156107a157600080fd5b506105066107b03660046141fc565b611b66565b3480156107c157600080fd5b50610496601f5481565b3480156107d757600080fd5b506104966107e6366004614290565b611b78565b3480156107f757600080fd5b50610474611bc7565b34801561080c57600080fd5b5061041f61081b36600461470e565b611c19565b34801561082c57600080fd5b5061047461083b3660046141fc565b611c25565b34801561084c57600080fd5b5061049661085b3660046141fc565b601e6020526000908152604090205481565b34801561087957600080fd5b50610474610888366004614290565b611c72565b34801561089957600080fd5b50610474611cdc565b3480156108ae57600080fd5b506008546001600160a01b0316610506565b3480156108cc57600080fd5b50610474611d2c565b3480156108e157600080fd5b506104746108f03660046145fd565b611f9b565b34801561090157600080fd5b506104d9611fef565b34801561091657600080fd5b5061041f610925366004614743565b611ffe565b34801561093657600080fd5b50610474610945366004614791565b612236565b34801561095657600080fd5b5061047461096536600461455c565b612357565b34801561097657600080fd5b5061049660185481565b34801561098c57600080fd5b506109a061099b3660046141fc565b6123ec565b60405160ff909116815260200161042b565b3480156109be57600080fd5b506104746109cd366004614290565b612571565b3480156109de57600080fd5b506104746109ed3660046141fc565b6125db565b3480156109fe57600080fd5b50601154610506906001600160a01b031681565b348015610a1e57600080fd5b50610474610a2d366004614791565b6126aa565b348015610a3e57600080fd5b50610496610a4d3660046141fc565b61275d565b348015610a5e57600080fd5b50610474610a6d3660046147d3565b61276d565b348015610a7e57600080fd5b50601654610a92906001600160601b031681565b6040516001600160601b03909116815260200161042b565b610474610ab836600461484f565b6127be565b348015610ac957600080fd5b50610496601a5481565b348015610adf57600080fd5b50610474612a76565b348015610af457600080fd5b506104d9610b033660046141fc565b612ac6565b348015610b1457600080fd5b5061049660175481565b348015610b2a57600080fd5b50601454610506906001600160a01b031681565b348015610b4a57600080fd5b506104d9612b55565b348015610b5f57600080fd5b5061049660155481565b348015610b7557600080fd5b506104d9612b62565b348015610b8a57600080fd5b50610474610b993660046141fc565b612b6f565b348015610baa57600080fd5b50610474610bb93660046141fc565b612ca1565b348015610bca57600080fd5b5061041f610bd936600461466f565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610c1357600080fd5b50610474612cee565b348015610c2857600080fd5b50610474610c37366004614290565b612d9a565b348015610c4857600080fd5b50610474610c5736600461470e565b612e50565b601b8181548110610c6c57600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6000610c9b82613005565b92915050565b8161138881610cb96001546000546000199190030190565b610cc3919061488a565b1115610d0c5760405162461bcd60e51b815260206004820152601360248201527213585e0814dd5c1c1b1e48115e18d959591959606a1b60448201526064015b60405180910390fd5b6014546001600160a01b03163314610d2357600080fd5b610d2d828461302a565b505050565b600d8181548110610d4257600080fd5b600091825260209091200154905081565b6008546001600160a01b03163314610d9b5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601180546001600160a01b0319166001600160a01b038316908117909155601654610dcf91906001600160601b0316613044565b50565b606060028054610de1906148a2565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0d906148a2565b8015610e5a5780601f10610e2f57610100808354040283529160200191610e5a565b820191906000526020600020905b815481529060010190602001808311610e3d57829003601f168201915b5050505050905090565b6000610e6f82613141565b610e8c576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610eb382611b66565b9050806001600160a01b0316836001600160a01b031603610ee75760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610f075750610f058133610bd9565b155b15610f25576040516367d9dca160e11b815260040160405180910390fd5b610d2d83838361317a565b60198054610f3d906148a2565b80601f0160208091040260200160405190810160405280929190818152602001828054610f69906148a2565b8015610fb65780601f10610f8b57610100808354040283529160200191610fb6565b820191906000526020600020905b815481529060010190602001808311610f9957829003601f168201915b505050505081565b6008546001600160a01b031633146110065760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b8051611019906019906020840190614097565b505042601a55565b600080858560405160200161105292919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6040516020818303038152906040528051906020012090506110ab84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050601d5491508490506131d6565b9150505b949350505050565b610d2d8383836131ee565b6000828152600c602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291611137575060408051808201909152600b546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090611156906001600160601b0316876148dc565b6111609190614911565b91519350909150505b9250929050565b6008546001600160a01b031633146111b85760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601680546bffffffffffffffffffffffff19166001600160601b038316908117909155601154610dcf916001600160a01b0390911690613044565b6008546001600160a01b0316331461123b5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6020805474ffffffffffffffffffffffffffffffffffffffffff19166101006001600160a01b03949094169390930260ff191692909217901515179055565b6008546001600160a01b031633146112c25760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6012546001600160a01b031661132c5760405162461bcd60e51b815260206004820152602960248201527f4d75737420686176652076616c696420706172746e657231207769746864726160448201526877206164647265737360b81b6064820152608401610d03565b478061137a5760405162461bcd60e51b815260206004820152601260248201527f4e6f2045544820746f20776974686472617700000000000000000000000000006044820152606401610d03565b6013546012546001600160a01b039182169116036113c4576012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050610dcf57600080fd5b6013546001600160a01b031661142e5760405162461bcd60e51b815260206004820152602960248201527f4d75737420686176652076616c696420706172746e657232207769746864726160448201526877206164647265737360b81b6064820152608401610d03565b6000611446606461144084605a6133de565b906133ea565b6012546040519192506001600160a01b03169082156108fc029083906000818181858888f1935050505061147957600080fd5b6013546001600160a01b03166108fc61149284846133f6565b6040518115909202916000818181858888f193505050506114b257600080fd5b5050565b6008546001600160a01b031633146114fe5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b611506613402565b565b610d2d8383836040518060200160405280600081525061276d565b6002600954036115755760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d03565b60026009553332146115d75760405162461bcd60e51b815260206004820152602560248201527f4d75737420696e766f6b65206469726563746c792066726f6d20796f75722077604482015264185b1b195d60da1b6064820152608401610d03565b600a5460ff161561161d5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610d03565b84600681111561162f5761162f614925565b601b81600681111561164357611643614925565b815481106116535761165361493b565b90600052602060002090602091828204019190069054906101000a900460ff166116af5760405162461bcd60e51b815260206004820152600d60248201526c496e76616c696420737461746560981b6044820152606401610d03565b60155433600090815260056020526040902054869190829068010000000000000000900467ffffffffffffffff166116e7919061488a565b11156117355760405162461bcd60e51b815260206004820152601e60248201527f4d6178204d696e747320506572204164647265737320457863656564656400006044820152606401610d03565b856113888161174d6001546000546000199190030190565b611757919061488a565b111561179b5760405162461bcd60e51b815260206004820152601360248201527213585e0814dd5c1c1b1e48115e18d959591959606a1b6044820152606401610d03565b6117a788338787611021565b6118195760405162461bcd60e51b815260206004820152603c60248201527f546869732061646472657373206973206e6f7420656c656769626c6520666f7260448201527f207468652070726f766964656420616c6c6f776c6973742077617665000000006064820152608401610d03565b60038810801561185a5750601b6003815481106118385761183861493b565b90600052602060002090602091828204019190069054906101000a900460ff16155b1561198d576000601c89815481106118745761187461493b565b9060005260206000200154116119185760405162461bcd60e51b815260206004820152605060248201527f416c6c6f636174696f6e20666f7220796f757220636f6d6d756e69747920686160448201527f73206265656e2066696c6c65642e20506c656173652074727920616761696e2060648201527f696e20746865206e657874207761766500000000000000000000000000000000608482015260a401610d03565b86601c898154811061192c5761192c61493b565b90600052602060002001541061196a5786601c89815481106119505761195061493b565b90600052602060002001546119659190614951565b61196d565b60005b601c89815481106119805761198061493b565b6000918252602090912001555b6119bf87600d8a815481106119a4576119a461493b565b90600052602060002001546119b991906148dc565b8761349e565b6119c9338861302a565b6001546000540361138819016119e1576119e16135b4565b50506001600955505050505050565b6008546001600160a01b03163314611a385760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b610d2d600f838361411b565b6008546001600160a01b03163314611a8c5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6001600160a01b038216611ae25760405162461bcd60e51b815260206004820152601f60248201527f506172746e657220616464726573736573206d7573742062652076616c6964006044820152606401610d03565b6001600160a01b038116611b385760405162461bcd60e51b815260206004820152601f60248201527f506172746e657220616464726573736573206d7573742062652076616c6964006044820152606401610d03565b601280546001600160a01b039384166001600160a01b03199182161790915560138054929093169116179055565b6000611b71826136b5565b5192915050565b60006001600160a01b038216611ba1576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6008546001600160a01b03163314611c0f5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b61150660006137de565b6000610c9b3383611ffe565b6008546001600160a01b03163314611c6d5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601d55565b6008546001600160a01b03163314611cba5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b03163314611d245760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b611506613830565b6008546001600160a01b03163314611d745760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6012546001600160a01b0316611dde5760405162461bcd60e51b815260206004820152602960248201527f4d75737420686176652076616c696420706172746e657231207769746864726160448201526877206164647265737360b81b6064820152608401610d03565b600e546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4b9190614968565b905060008111611e9d5760405162461bcd60e51b815260206004820152601660248201527f4e6f20415045434f494e20746f207769746864726177000000000000000000006044820152606401610d03565b6013546012546001600160a01b03918216911603611ed257601254600e54610dcf916001600160a01b039182169116836138ab565b6013546001600160a01b0316611f3c5760405162461bcd60e51b815260206004820152602960248201527f4d75737420686176652076616c696420706172746e657232207769746864726160448201526877206164647265737360b81b6064820152608401610d03565b6000611f4e606461144084605a6133de565b601254600e54919250611f6e916001600160a01b039081169116836138ab565b6013546114b2906001600160a01b0316611f8884846133f6565b600e546001600160a01b031691906138ab565b6008546001600160a01b03163314611fe35760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b610d2d6010838361411b565b606060038054610de1906148a2565b6000815160041461205b5760405162461bcd60e51b815260206004820152602160248201527f52656465656d61626c6520736574206d7573742068617665203420746f6b656e6044820152607360f81b6064820152608401610d03565b61206361418f565b60005b600481101561222b5760008482815181106120835761208361493b565b602002602001015190506000612098826123ec565b6000838152601e602052604090205460ff919091169150156120fc5760405162461bcd60e51b815260206004820152601f60248201527f546f6b656e20686173206265656e2072656465656d656420616c7265616479006044820152606401610d03565b83612108600183614951565b600481106121185761211861493b565b6020020151156121765760405162461bcd60e51b815260206004820152602360248201527f536574206d75737420636f6e73697374206f66203420756e6971756520746f6b604482015262656e7360e81b6064820152608401610d03565b866001600160a01b031661218983611b66565b6001600160a01b0316146121ef5760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920746865206f776e6572206f66206120746f6b656e2063616e2072656044820152661919595b481a5d60ca1b6064820152608401610d03565b6001846121fc8284614951565b6004811061220c5761220c61493b565b911515602090920201525081905061222381614981565b915050612066565b506001949350505050565b6008546001600160a01b0316331461227e5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b600d5481146122cf5760405162461bcd60e51b815260206004820181905260248201527f4d7573742070726f76696465206172726179206f6620616c6c207072696365736044820152606401610d03565b6000828260008181106122e4576122e461493b565b905060200201351161234b5760405162461bcd60e51b815260206004820152602a60248201527f417065436f696e20746f204554482072617465206d75737420626520677265616044820152690746572207468616e20360b41b6064820152608401610d03565b610d2d600d83836141ad565b336001600160a01b038316036123805760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000806017541161243f5760405162461bcd60e51b815260206004820152601c60248201527f4d75737420666972737420736574207374617274696e67496e646578000000006044820152606401610d03565b604080516101408082018352600480835260026020808501829052848601839052600360608087018290526080808801839052600160a0808a0182905260c0808b0189905260e0808c018a9052610100808d018a9052610120808e018990528e519c8d018f528b8d52988c018a90529c8b018a9052948a01979097529188018490529087018190529386018290528501529483018290529382015260175491929091600091611388916124f2838961488a565b6124fc9190614951565b6125069190614951565b612510919061499a565b905061251d600a8261499a565b6125296103e88361499a565b6125339190614951565b610302036125655781612547600a8361499a565b600a81106125575761255761493b565b602002015195945050505050565b82612547600a8361499a565b6008546001600160a01b031633146125b95760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b031633146126235760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b600081116126865760405162461bcd60e51b815260206004820152602a60248201527f417065436f696e20746f204554482072617465206d75737420626520677265616044820152690746572207468616e20360b41b6064820152608401610d03565b80600d60008154811061269b5761269b61493b565b60009182526020909120015550565b6008546001600160a01b031633146126f25760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601c5481146127515760405162461bcd60e51b815260206004820152602560248201527f4d7573742070726f76696465206172726179206f6620616c6c20616c6c6f636160448201526474696f6e7360d81b6064820152608401610d03565b610d2d601c83836141ad565b601c8181548110610d4257600080fd5b6127788484846131ee565b6001600160a01b0383163b1515801561279a575061279884848484613923565b155b156127b8576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6002600954036128105760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d03565b60026009553332146128725760405162461bcd60e51b815260206004820152602560248201527f4d75737420696e766f6b65206469726563746c792066726f6d20796f75722077604482015264185b1b195d60da1b6064820152608401610d03565b600a5460ff16156128b85760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610d03565b6004601b81815481106128cd576128cd61493b565b90600052602060002090602091828204019190069054906101000a900460ff166129295760405162461bcd60e51b815260206004820152600d60248201526c496e76616c696420737461746560981b6044820152606401610d03565b60155433600090815260056020526040902054849190829068010000000000000000900467ffffffffffffffff16612961919061488a565b11156129af5760405162461bcd60e51b815260206004820152601e60248201527f4d6178204d696e747320506572204164647265737320457863656564656400006044820152606401610d03565b83611388816129c76001546000546000199190030190565b6129d1919061488a565b1115612a155760405162461bcd60e51b815260206004820152601360248201527213585e0814dd5c1c1b1e48115e18d959591959606a1b6044820152606401610d03565b612a4885600d600481548110612a2d57612a2d61493b565b9060005260206000200154612a4291906148dc565b8561349e565b612a52338661302a565b600154600054036113881901612a6a57612a6a6135b4565b50506001600955505050565b6008546001600160a01b03163314612abe5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6115066135b4565b6060612ad182613141565b612b1d5760405162461bcd60e51b815260206004820152601f60248201527f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e006044820152606401610d03565b612b25613a0b565b612b2e83613a1a565b604051602001612b3f9291906149ae565b6040516020818303038152906040529050919050565b600f8054610f3d906148a2565b60108054610f3d906148a2565b6008546001600160a01b03163314612bb75760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6006811115612c2e5760405162461bcd60e51b815260206004820152602e60248201527f496e76616c6964207374617465207472616e736974696f6e3a2053746174652060448201527f646f6573206e6f742065786973740000000000000000000000000000000000006064820152608401610d03565b601b8181548110612c4157612c4161493b565b90600052602060002090602091828204019190069054906101000a900460ff1615601b8281548110612c7557612c7561493b565b90600052602060002090602091828204019190066101000a81548160ff02191690831515021790555050565b6008546001600160a01b03163314612ce95760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601555565b6008546001600160a01b03163314612d365760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b60175415612d865760405162461bcd60e51b815260206004820152601a60248201527f5354415254494e475f494e4445585f414c52454144595f5345540000000000006044820152606401610d03565b612d91611388613b33565b60175542601855565b6008546001600160a01b03163314612de25760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6001600160a01b038116612e475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610d03565b610dcf816137de565b6006601b8181548110612e6557612e6561493b565b90600052602060002090602091828204019190069054906101000a900460ff16612ec15760405162461bcd60e51b815260206004820152600d60248201526c496e76616c696420737461746560981b6044820152606401610d03565b612eca82611c19565b612f165760405162461bcd60e51b815260206004820152601960248201527f54686520736574206973206e6f742072656465656d61626c65000000000000006044820152606401610d03565b601f8054906000612f2683614981565b919050555060005b6004811015612fc357601f54601e6000858481518110612f5057612f5061493b565b602090810291909101810151825281810192909252604001600020919091555460ff1615612fb157612fb133602060019054906101000a90046001600160a01b0316858481518110612fa457612fa461493b565b60200260200101516110b7565b80612fbb81614981565b915050612f2e565b507f960a2b11be69b13b341c09ebff9ea8e90839cadf60d098c565c9c6e9afb2672e33601f5484604051612ff9939291906149ed565b60405180910390a15050565b60006001600160e01b0319821663152a902d60e11b1480610c9b5750610c9b82613bd6565b6114b2828260405180602001604052806000815250613c26565b6127106001600160601b03821611156130b25760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610d03565b6001600160a01b0382166131085760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610d03565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600b55565b600081600111158015613155575060005482105b8015610c9b575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000826131e38584613c33565b1490505b9392505050565b60006131f9826136b5565b9050836001600160a01b031681600001516001600160a01b0316146132305760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b038616148061324e575061324e8533610bd9565b8061326957503361325e84610e64565b6001600160a01b0316145b90508061328957604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0384166132b057604051633a954ecd60e21b815260040160405180910390fd5b6132bc6000848761317a565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116613392576000548214613392578054602086015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60006131e782846148dc565b60006131e78284614911565b60006131e78284614951565b600a5460ff166134545760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610d03565b600a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b8015613564576000600d6000815481106134ba576134ba61493b565b906000526020600020015490506000811161352a5760405162461bcd60e51b815260206004820152602a60248201527f417065436f696e20746f204554482072617465206d75737420626520677265616044820152690746572207468616e20360b41b6064820152608401610d03565b610d2d33306135506509184e72a00061354a866114408a620186a06133de565b906133de565b600e546001600160a01b0316929190613ca7565b813410156114b25760405162461bcd60e51b815260206004820152601460248201527f496e73756666696369656e74205061796d656e740000000000000000000000006044820152606401610d03565b6000601b6004815481106135ca576135ca61493b565b60009182526020808320908204018054931515601f9092166101000a91820260ff9092021990931617909155601b60018154811061360a5761360a61493b565b60009182526020808320908204018054931515601f9092166101000a91820260ff9092021990931617909155601b60028154811061364a5761364a61493b565b60009182526020808320908204018054931515601f9092166101000a91820260ff9092021990931617909155601b60038154811061368a5761368a61493b565b90600052602060002090602091828204019190066101000a81548160ff021916908315150217905550565b604080516060810182526000808252602082018190529181019190915281806001111580156136e5575060005481105b156137c557600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161515918101829052906137c35780516001600160a01b031615613759579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff16151592810192909252156137be579392505050565b613759565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600a5460ff16156138765760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610d03565b600a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586134813390565b6040516001600160a01b038316602482015260448101829052610d2d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152613cdf565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613958903390899088908890600401614a4b565b6020604051808303816000875af1925050508015613993575060408051601f3d908101601f1916820190925261399091810190614a87565b60015b6139f1573d8080156139c1576040519150601f19603f3d011682016040523d82523d6000602084013e6139c6565b606091505b5080516000036139e9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506110af565b6060600f8054610de1906148a2565b606081600003613a415750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613a6b5780613a5581614981565b9150613a649050600a83614911565b9150613a45565b60008167ffffffffffffffff811115613a8657613a86614340565b6040519080825280601f01601f191660200182016040528015613ab0576020820181803683370190505b5090505b84156110af57613ac5600183614951565b9150613ad2600a8661499a565b613add90603061488a565b60f81b818381518110613af257613af261493b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613b2c600a86614911565b9450613ab4565b60008060004442604051602001613b54929190918252602082015260400190565b60408051601f1981840301815291905280516020909101209050613b7960ff8261499a565b613b8490600161488a565b905080431015613b92575060015b6000613b9e8243614951565b9050613bab85824061499a565b9250613bb8600a8461499a565b600003613bcd5782613bc981614981565b9350505b50909392505050565b60006001600160e01b031982166380ac58cd60e01b1480613c0757506001600160e01b03198216635b5e139f60e01b145b80610c9b57506301ffc9a760e01b6001600160e01b0319831614610c9b565b610d2d8383836001613db1565b600081815b8451811015613c9f576000858281518110613c5557613c5561493b565b60200260200101519050808311613c7b5760008381526020829052604090209250613c8c565b600081815260208490526040902092505b5080613c9781614981565b915050613c38565b509392505050565b6040516001600160a01b03808516602483015283166044820152606481018290526127b89085906323b872dd60e01b906084016138d7565b6000613d34826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613f839092919063ffffffff16565b805190915015610d2d5780806020019051810190613d529190614aa4565b610d2d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610d03565b6000546001600160a01b038516613dda57604051622e076360e81b815260040160405180910390fd5b83600003613dfb5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff19811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b429092169190910217905580808501838015613ead57506001600160a01b0387163b15155b15613f35575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4613efe6000888480600101955088613923565b613f1b576040516368d2bf6b60e11b815260040160405180910390fd5b808203613eb3578260005414613f3057600080fd5b613f7a565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808203613f36575b506000556133d7565b60606110af8484600085856001600160a01b0385163b613fe55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d03565b600080866001600160a01b031685876040516140019190614ac1565b60006040518083038185875af1925050503d806000811461403e576040519150601f19603f3d011682016040523d82523d6000602084013e614043565b606091505b509150915061405382828661405e565b979650505050505050565b6060831561406d5750816131e7565b82511561407d5782518084602001fd5b8160405162461bcd60e51b8152600401610d039190614303565b8280546140a3906148a2565b90600052602060002090601f0160209004810192826140c5576000855561410b565b82601f106140de57805160ff191683800117855561410b565b8280016001018555821561410b579182015b8281111561410b5782518255916020019190600101906140f0565b506141179291506141e7565b5090565b828054614127906148a2565b90600052602060002090601f016020900481019282614149576000855561410b565b82601f106141625782800160ff1982351617855561410b565b8280016001018555821561410b579182015b8281111561410b578235825591602001919060010190614174565b60405180608001604052806004906020820280368337509192915050565b82805482825590600052602060002090810192821561410b579160200282018281111561410b578235825591602001919060010190614174565b5b8082111561411757600081556001016141e8565b60006020828403121561420e57600080fd5b5035919050565b6001600160e01b031981168114610dcf57600080fd5b60006020828403121561423d57600080fd5b81356131e781614215565b80356001600160a01b038116811461425f57600080fd5b919050565b6000806040838503121561427757600080fd5b8235915061428760208401614248565b90509250929050565b6000602082840312156142a257600080fd5b6131e782614248565b60005b838110156142c65781810151838201526020016142ae565b838111156127b85750506000910152565b600081518084526142ef8160208601602086016142ab565b601f01601f19169290920160200192915050565b6020815260006131e760208301846142d7565b6000806040838503121561432957600080fd5b61433283614248565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561437f5761437f614340565b604052919050565b600067ffffffffffffffff8311156143a1576143a1614340565b6143b4601f8401601f1916602001614356565b90508281528383830111156143c857600080fd5b828260208301376000602084830101529392505050565b6000602082840312156143f157600080fd5b813567ffffffffffffffff81111561440857600080fd5b8201601f8101841361441957600080fd5b6110af84823560208401614387565b60008083601f84011261443a57600080fd5b50813567ffffffffffffffff81111561445257600080fd5b6020830191508360208260051b850101111561116957600080fd5b6000806000806060858703121561448357600080fd5b8435935061449360208601614248565b9250604085013567ffffffffffffffff8111156144af57600080fd5b6144bb87828801614428565b95989497509550505050565b6000806000606084860312156144dc57600080fd5b6144e584614248565b92506144f360208501614248565b9150604084013590509250925092565b6000806040838503121561451657600080fd5b50508035926020909101359150565b60006020828403121561453757600080fd5b81356001600160601b03811681146131e757600080fd5b8015158114610dcf57600080fd5b6000806040838503121561456f57600080fd5b61457883614248565b915060208301356145888161454e565b809150509250929050565b6000806000806000608086880312156145ab57600080fd5b853594506020860135935060408601356145c48161454e565b9250606086013567ffffffffffffffff8111156145e057600080fd5b6145ec88828901614428565b969995985093965092949392505050565b6000806020838503121561461057600080fd5b823567ffffffffffffffff8082111561462857600080fd5b818501915085601f83011261463c57600080fd5b81358181111561464b57600080fd5b86602082850101111561465d57600080fd5b60209290920196919550909350505050565b6000806040838503121561468257600080fd5b61468b83614248565b915061428760208401614248565b600082601f8301126146aa57600080fd5b8135602067ffffffffffffffff8211156146c6576146c6614340565b8160051b6146d5828201614356565b92835284810182019282810190878511156146ef57600080fd5b83870192505b84831015614053578235825291830191908301906146f5565b60006020828403121561472057600080fd5b813567ffffffffffffffff81111561473757600080fd5b6110af84828501614699565b6000806040838503121561475657600080fd5b61475f83614248565b9150602083013567ffffffffffffffff81111561477b57600080fd5b61478785828601614699565b9150509250929050565b600080602083850312156147a457600080fd5b823567ffffffffffffffff8111156147bb57600080fd5b6147c785828601614428565b90969095509350505050565b600080600080608085870312156147e957600080fd5b6147f285614248565b935061480060208601614248565b925060408501359150606085013567ffffffffffffffff81111561482357600080fd5b8501601f8101871361483457600080fd5b61484387823560208401614387565b91505092959194509250565b6000806040838503121561486257600080fd5b8235915060208301356145888161454e565b634e487b7160e01b600052601160045260246000fd5b6000821982111561489d5761489d614874565b500190565b600181811c908216806148b657607f821691505b6020821081036148d657634e487b7160e01b600052602260045260246000fd5b50919050565b60008160001904831182151516156148f6576148f6614874565b500290565b634e487b7160e01b600052601260045260246000fd5b600082614920576149206148fb565b500490565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008282101561496357614963614874565b500390565b60006020828403121561497a57600080fd5b5051919050565b60006001820161499357614993614874565b5060010190565b6000826149a9576149a96148fb565b500690565b600083516149c08184602088016142ab565b8351908301906149d48183602088016142ab565b64173539b7b760d91b9101908152600501949350505050565b6000606082016001600160a01b03861683526020858185015260606040850152818551808452608086019150828701935060005b81811015614a3d57845183529383019391830191600101614a21565b509098975050505050505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152614a7d60808301846142d7565b9695505050505050565b600060208284031215614a9957600080fd5b81516131e781614215565b600060208284031215614ab657600080fd5b81516131e78161454e565b60008251614ad38184602087016142ab565b919091019291505056fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212203e61a4cc7fbe46a1c0ca893f2819e2b2204e50fd6e0d9925f39fa579da028d6164736f6c634300080d003333636534326636393635353966383663636136613332656336306265643935313533666664363630383564623164313432613465336630633161383530363633000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000084b494e475348495000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024b53000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003268747470733a2f2f6b732d67656e657369732d64726f702e73332e616d617a6f6e6177732e636f6d2f6d657461646174612f0000000000000000000000000000
Deployed Bytecode
0x6080604052600436106103f35760003560e01c80637ed0f1c111610208578063b88d4fde11610118578063d547cfb7116100ab578063e8a9b8da1161007a578063e8a9b8da14610b9e578063e985e9c514610bbe578063e986655014610c07578063f2fde38b14610c1c578063f9afb26a14610c3c57600080fd5b8063d547cfb714610b3e578063e6afcd1314610b53578063e8a3d48514610b69578063e8a58f0314610b7e57600080fd5b8063c3ded9c6116100e7578063c3ded9c614610ad3578063c87b56dd14610ae8578063cb774d4714610b08578063d08f3a0214610b1e57600080fd5b8063b88d4fde14610a52578063b8997a9714610a72578063b93a6d2114610aaa578063bf669ed514610abd57600080fd5b80639bf212131161019b578063a78ea5b61161016a578063a78ea5b6146109b2578063aa97b057146109d2578063ad2f852a146109f2578063b4ad6fee14610a12578063b66c6c8e14610a3257600080fd5b80639bf212131461092a578063a22cb4651461094a578063a57c76ad1461096a578063a66388991461098057600080fd5b806390780f02116101d757806390780f02146108c0578063938e3d7b146108d557806395d89b41146108f55780639ba6ca991461090a57600080fd5b80637ed0f1c114610840578063826fbc831461086d5780638456cb591461088d5780638da5cb5b146108a257600080fd5b80632eb4a7ab1161030357806355f804b3116102965780636dd90596116102655780636dd90596146107b557806370a08231146107cb578063715018a6146107eb57806378dd9371146108005780637cb647591461082057600080fd5b806355f804b31461073d57806359fc94731461075d5780635c975abb1461077d5780636352211e1461079557600080fd5b80633ccfd60b116102d25780633ccfd60b146106e05780633f4ba83a146106f557806342842e0e1461070a57806348d74e451461072a57600080fd5b80632eb4a7ab1461067457806331faafb41461068a57806332cb6b0c146106aa57806335bf6df0146106c057600080fd5b80630ec5a208116103865780631bd36ea7116103555780631bd36ea7146105b05780631f2ace5e146105d057806323b872dd146105f0578063265b5150146106105780632a55205a1461063557600080fd5b80630ec5a2081461053e5780630f7309e81461055e578063109695231461057357806318160ddd1461059357600080fd5b806306d254da116103c257806306d254da146104a457806306fdde03146104c4578063081812fc146104e6578063095ea7b31461051e57600080fd5b8063017a9105146103ff57806301ffc9a71461043457806303339bcb14610454578063045585a41461047657600080fd5b366103fa57005b600080fd5b34801561040b57600080fd5b5061041f61041a3660046141fc565b610c5c565b60405190151581526020015b60405180910390f35b34801561044057600080fd5b5061041f61044f36600461422b565b610c90565b34801561046057600080fd5b5061047461046f366004614264565b610ca1565b005b34801561048257600080fd5b506104966104913660046141fc565b610d32565b60405190815260200161042b565b3480156104b057600080fd5b506104746104bf366004614290565b610d53565b3480156104d057600080fd5b506104d9610dd2565b60405161042b9190614303565b3480156104f257600080fd5b506105066105013660046141fc565b610e64565b6040516001600160a01b03909116815260200161042b565b34801561052a57600080fd5b50610474610539366004614316565b610ea8565b34801561054a57600080fd5b50601354610506906001600160a01b031681565b34801561056a57600080fd5b506104d9610f30565b34801561057f57600080fd5b5061047461058e3660046143df565b610fbe565b34801561059f57600080fd5b506001546000540360001901610496565b3480156105bc57600080fd5b50601254610506906001600160a01b031681565b3480156105dc57600080fd5b5061041f6105eb36600461446d565b611021565b3480156105fc57600080fd5b5061047461060b3660046144c7565b6110b7565b34801561061c57600080fd5b506020546105069061010090046001600160a01b031681565b34801561064157600080fd5b50610655610650366004614503565b6110c2565b604080516001600160a01b03909316835260208301919091520161042b565b34801561068057600080fd5b50610496601d5481565b34801561069657600080fd5b506104746106a5366004614525565b611170565b3480156106b657600080fd5b5061049661138881565b3480156106cc57600080fd5b506104746106db36600461455c565b6111f3565b3480156106ec57600080fd5b5061047461127a565b34801561070157600080fd5b506104746114b6565b34801561071657600080fd5b506104746107253660046144c7565b611508565b610474610738366004614593565b611523565b34801561074957600080fd5b506104746107583660046145fd565b6119f0565b34801561076957600080fd5b5061047461077836600461466f565b611a44565b34801561078957600080fd5b50600a5460ff1661041f565b3480156107a157600080fd5b506105066107b03660046141fc565b611b66565b3480156107c157600080fd5b50610496601f5481565b3480156107d757600080fd5b506104966107e6366004614290565b611b78565b3480156107f757600080fd5b50610474611bc7565b34801561080c57600080fd5b5061041f61081b36600461470e565b611c19565b34801561082c57600080fd5b5061047461083b3660046141fc565b611c25565b34801561084c57600080fd5b5061049661085b3660046141fc565b601e6020526000908152604090205481565b34801561087957600080fd5b50610474610888366004614290565b611c72565b34801561089957600080fd5b50610474611cdc565b3480156108ae57600080fd5b506008546001600160a01b0316610506565b3480156108cc57600080fd5b50610474611d2c565b3480156108e157600080fd5b506104746108f03660046145fd565b611f9b565b34801561090157600080fd5b506104d9611fef565b34801561091657600080fd5b5061041f610925366004614743565b611ffe565b34801561093657600080fd5b50610474610945366004614791565b612236565b34801561095657600080fd5b5061047461096536600461455c565b612357565b34801561097657600080fd5b5061049660185481565b34801561098c57600080fd5b506109a061099b3660046141fc565b6123ec565b60405160ff909116815260200161042b565b3480156109be57600080fd5b506104746109cd366004614290565b612571565b3480156109de57600080fd5b506104746109ed3660046141fc565b6125db565b3480156109fe57600080fd5b50601154610506906001600160a01b031681565b348015610a1e57600080fd5b50610474610a2d366004614791565b6126aa565b348015610a3e57600080fd5b50610496610a4d3660046141fc565b61275d565b348015610a5e57600080fd5b50610474610a6d3660046147d3565b61276d565b348015610a7e57600080fd5b50601654610a92906001600160601b031681565b6040516001600160601b03909116815260200161042b565b610474610ab836600461484f565b6127be565b348015610ac957600080fd5b50610496601a5481565b348015610adf57600080fd5b50610474612a76565b348015610af457600080fd5b506104d9610b033660046141fc565b612ac6565b348015610b1457600080fd5b5061049660175481565b348015610b2a57600080fd5b50601454610506906001600160a01b031681565b348015610b4a57600080fd5b506104d9612b55565b348015610b5f57600080fd5b5061049660155481565b348015610b7557600080fd5b506104d9612b62565b348015610b8a57600080fd5b50610474610b993660046141fc565b612b6f565b348015610baa57600080fd5b50610474610bb93660046141fc565b612ca1565b348015610bca57600080fd5b5061041f610bd936600461466f565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610c1357600080fd5b50610474612cee565b348015610c2857600080fd5b50610474610c37366004614290565b612d9a565b348015610c4857600080fd5b50610474610c5736600461470e565b612e50565b601b8181548110610c6c57600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6000610c9b82613005565b92915050565b8161138881610cb96001546000546000199190030190565b610cc3919061488a565b1115610d0c5760405162461bcd60e51b815260206004820152601360248201527213585e0814dd5c1c1b1e48115e18d959591959606a1b60448201526064015b60405180910390fd5b6014546001600160a01b03163314610d2357600080fd5b610d2d828461302a565b505050565b600d8181548110610d4257600080fd5b600091825260209091200154905081565b6008546001600160a01b03163314610d9b5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601180546001600160a01b0319166001600160a01b038316908117909155601654610dcf91906001600160601b0316613044565b50565b606060028054610de1906148a2565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0d906148a2565b8015610e5a5780601f10610e2f57610100808354040283529160200191610e5a565b820191906000526020600020905b815481529060010190602001808311610e3d57829003601f168201915b5050505050905090565b6000610e6f82613141565b610e8c576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610eb382611b66565b9050806001600160a01b0316836001600160a01b031603610ee75760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610f075750610f058133610bd9565b155b15610f25576040516367d9dca160e11b815260040160405180910390fd5b610d2d83838361317a565b60198054610f3d906148a2565b80601f0160208091040260200160405190810160405280929190818152602001828054610f69906148a2565b8015610fb65780601f10610f8b57610100808354040283529160200191610fb6565b820191906000526020600020905b815481529060010190602001808311610f9957829003601f168201915b505050505081565b6008546001600160a01b031633146110065760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b8051611019906019906020840190614097565b505042601a55565b600080858560405160200161105292919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6040516020818303038152906040528051906020012090506110ab84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050601d5491508490506131d6565b9150505b949350505050565b610d2d8383836131ee565b6000828152600c602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291611137575060408051808201909152600b546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090611156906001600160601b0316876148dc565b6111609190614911565b91519350909150505b9250929050565b6008546001600160a01b031633146111b85760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601680546bffffffffffffffffffffffff19166001600160601b038316908117909155601154610dcf916001600160a01b0390911690613044565b6008546001600160a01b0316331461123b5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6020805474ffffffffffffffffffffffffffffffffffffffffff19166101006001600160a01b03949094169390930260ff191692909217901515179055565b6008546001600160a01b031633146112c25760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6012546001600160a01b031661132c5760405162461bcd60e51b815260206004820152602960248201527f4d75737420686176652076616c696420706172746e657231207769746864726160448201526877206164647265737360b81b6064820152608401610d03565b478061137a5760405162461bcd60e51b815260206004820152601260248201527f4e6f2045544820746f20776974686472617700000000000000000000000000006044820152606401610d03565b6013546012546001600160a01b039182169116036113c4576012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050610dcf57600080fd5b6013546001600160a01b031661142e5760405162461bcd60e51b815260206004820152602960248201527f4d75737420686176652076616c696420706172746e657232207769746864726160448201526877206164647265737360b81b6064820152608401610d03565b6000611446606461144084605a6133de565b906133ea565b6012546040519192506001600160a01b03169082156108fc029083906000818181858888f1935050505061147957600080fd5b6013546001600160a01b03166108fc61149284846133f6565b6040518115909202916000818181858888f193505050506114b257600080fd5b5050565b6008546001600160a01b031633146114fe5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b611506613402565b565b610d2d8383836040518060200160405280600081525061276d565b6002600954036115755760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d03565b60026009553332146115d75760405162461bcd60e51b815260206004820152602560248201527f4d75737420696e766f6b65206469726563746c792066726f6d20796f75722077604482015264185b1b195d60da1b6064820152608401610d03565b600a5460ff161561161d5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610d03565b84600681111561162f5761162f614925565b601b81600681111561164357611643614925565b815481106116535761165361493b565b90600052602060002090602091828204019190069054906101000a900460ff166116af5760405162461bcd60e51b815260206004820152600d60248201526c496e76616c696420737461746560981b6044820152606401610d03565b60155433600090815260056020526040902054869190829068010000000000000000900467ffffffffffffffff166116e7919061488a565b11156117355760405162461bcd60e51b815260206004820152601e60248201527f4d6178204d696e747320506572204164647265737320457863656564656400006044820152606401610d03565b856113888161174d6001546000546000199190030190565b611757919061488a565b111561179b5760405162461bcd60e51b815260206004820152601360248201527213585e0814dd5c1c1b1e48115e18d959591959606a1b6044820152606401610d03565b6117a788338787611021565b6118195760405162461bcd60e51b815260206004820152603c60248201527f546869732061646472657373206973206e6f7420656c656769626c6520666f7260448201527f207468652070726f766964656420616c6c6f776c6973742077617665000000006064820152608401610d03565b60038810801561185a5750601b6003815481106118385761183861493b565b90600052602060002090602091828204019190069054906101000a900460ff16155b1561198d576000601c89815481106118745761187461493b565b9060005260206000200154116119185760405162461bcd60e51b815260206004820152605060248201527f416c6c6f636174696f6e20666f7220796f757220636f6d6d756e69747920686160448201527f73206265656e2066696c6c65642e20506c656173652074727920616761696e2060648201527f696e20746865206e657874207761766500000000000000000000000000000000608482015260a401610d03565b86601c898154811061192c5761192c61493b565b90600052602060002001541061196a5786601c89815481106119505761195061493b565b90600052602060002001546119659190614951565b61196d565b60005b601c89815481106119805761198061493b565b6000918252602090912001555b6119bf87600d8a815481106119a4576119a461493b565b90600052602060002001546119b991906148dc565b8761349e565b6119c9338861302a565b6001546000540361138819016119e1576119e16135b4565b50506001600955505050505050565b6008546001600160a01b03163314611a385760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b610d2d600f838361411b565b6008546001600160a01b03163314611a8c5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6001600160a01b038216611ae25760405162461bcd60e51b815260206004820152601f60248201527f506172746e657220616464726573736573206d7573742062652076616c6964006044820152606401610d03565b6001600160a01b038116611b385760405162461bcd60e51b815260206004820152601f60248201527f506172746e657220616464726573736573206d7573742062652076616c6964006044820152606401610d03565b601280546001600160a01b039384166001600160a01b03199182161790915560138054929093169116179055565b6000611b71826136b5565b5192915050565b60006001600160a01b038216611ba1576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6008546001600160a01b03163314611c0f5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b61150660006137de565b6000610c9b3383611ffe565b6008546001600160a01b03163314611c6d5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601d55565b6008546001600160a01b03163314611cba5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b03163314611d245760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b611506613830565b6008546001600160a01b03163314611d745760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6012546001600160a01b0316611dde5760405162461bcd60e51b815260206004820152602960248201527f4d75737420686176652076616c696420706172746e657231207769746864726160448201526877206164647265737360b81b6064820152608401610d03565b600e546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4b9190614968565b905060008111611e9d5760405162461bcd60e51b815260206004820152601660248201527f4e6f20415045434f494e20746f207769746864726177000000000000000000006044820152606401610d03565b6013546012546001600160a01b03918216911603611ed257601254600e54610dcf916001600160a01b039182169116836138ab565b6013546001600160a01b0316611f3c5760405162461bcd60e51b815260206004820152602960248201527f4d75737420686176652076616c696420706172746e657232207769746864726160448201526877206164647265737360b81b6064820152608401610d03565b6000611f4e606461144084605a6133de565b601254600e54919250611f6e916001600160a01b039081169116836138ab565b6013546114b2906001600160a01b0316611f8884846133f6565b600e546001600160a01b031691906138ab565b6008546001600160a01b03163314611fe35760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b610d2d6010838361411b565b606060038054610de1906148a2565b6000815160041461205b5760405162461bcd60e51b815260206004820152602160248201527f52656465656d61626c6520736574206d7573742068617665203420746f6b656e6044820152607360f81b6064820152608401610d03565b61206361418f565b60005b600481101561222b5760008482815181106120835761208361493b565b602002602001015190506000612098826123ec565b6000838152601e602052604090205460ff919091169150156120fc5760405162461bcd60e51b815260206004820152601f60248201527f546f6b656e20686173206265656e2072656465656d656420616c7265616479006044820152606401610d03565b83612108600183614951565b600481106121185761211861493b565b6020020151156121765760405162461bcd60e51b815260206004820152602360248201527f536574206d75737420636f6e73697374206f66203420756e6971756520746f6b604482015262656e7360e81b6064820152608401610d03565b866001600160a01b031661218983611b66565b6001600160a01b0316146121ef5760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920746865206f776e6572206f66206120746f6b656e2063616e2072656044820152661919595b481a5d60ca1b6064820152608401610d03565b6001846121fc8284614951565b6004811061220c5761220c61493b565b911515602090920201525081905061222381614981565b915050612066565b506001949350505050565b6008546001600160a01b0316331461227e5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b600d5481146122cf5760405162461bcd60e51b815260206004820181905260248201527f4d7573742070726f76696465206172726179206f6620616c6c207072696365736044820152606401610d03565b6000828260008181106122e4576122e461493b565b905060200201351161234b5760405162461bcd60e51b815260206004820152602a60248201527f417065436f696e20746f204554482072617465206d75737420626520677265616044820152690746572207468616e20360b41b6064820152608401610d03565b610d2d600d83836141ad565b336001600160a01b038316036123805760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000806017541161243f5760405162461bcd60e51b815260206004820152601c60248201527f4d75737420666972737420736574207374617274696e67496e646578000000006044820152606401610d03565b604080516101408082018352600480835260026020808501829052848601839052600360608087018290526080808801839052600160a0808a0182905260c0808b0189905260e0808c018a9052610100808d018a9052610120808e018990528e519c8d018f528b8d52988c018a90529c8b018a9052948a01979097529188018490529087018190529386018290528501529483018290529382015260175491929091600091611388916124f2838961488a565b6124fc9190614951565b6125069190614951565b612510919061499a565b905061251d600a8261499a565b6125296103e88361499a565b6125339190614951565b610302036125655781612547600a8361499a565b600a81106125575761255761493b565b602002015195945050505050565b82612547600a8361499a565b6008546001600160a01b031633146125b95760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b031633146126235760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b600081116126865760405162461bcd60e51b815260206004820152602a60248201527f417065436f696e20746f204554482072617465206d75737420626520677265616044820152690746572207468616e20360b41b6064820152608401610d03565b80600d60008154811061269b5761269b61493b565b60009182526020909120015550565b6008546001600160a01b031633146126f25760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601c5481146127515760405162461bcd60e51b815260206004820152602560248201527f4d7573742070726f76696465206172726179206f6620616c6c20616c6c6f636160448201526474696f6e7360d81b6064820152608401610d03565b610d2d601c83836141ad565b601c8181548110610d4257600080fd5b6127788484846131ee565b6001600160a01b0383163b1515801561279a575061279884848484613923565b155b156127b8576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6002600954036128105760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d03565b60026009553332146128725760405162461bcd60e51b815260206004820152602560248201527f4d75737420696e766f6b65206469726563746c792066726f6d20796f75722077604482015264185b1b195d60da1b6064820152608401610d03565b600a5460ff16156128b85760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610d03565b6004601b81815481106128cd576128cd61493b565b90600052602060002090602091828204019190069054906101000a900460ff166129295760405162461bcd60e51b815260206004820152600d60248201526c496e76616c696420737461746560981b6044820152606401610d03565b60155433600090815260056020526040902054849190829068010000000000000000900467ffffffffffffffff16612961919061488a565b11156129af5760405162461bcd60e51b815260206004820152601e60248201527f4d6178204d696e747320506572204164647265737320457863656564656400006044820152606401610d03565b83611388816129c76001546000546000199190030190565b6129d1919061488a565b1115612a155760405162461bcd60e51b815260206004820152601360248201527213585e0814dd5c1c1b1e48115e18d959591959606a1b6044820152606401610d03565b612a4885600d600481548110612a2d57612a2d61493b565b9060005260206000200154612a4291906148dc565b8561349e565b612a52338661302a565b600154600054036113881901612a6a57612a6a6135b4565b50506001600955505050565b6008546001600160a01b03163314612abe5760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6115066135b4565b6060612ad182613141565b612b1d5760405162461bcd60e51b815260206004820152601f60248201527f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e006044820152606401610d03565b612b25613a0b565b612b2e83613a1a565b604051602001612b3f9291906149ae565b6040516020818303038152906040529050919050565b600f8054610f3d906148a2565b60108054610f3d906148a2565b6008546001600160a01b03163314612bb75760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6006811115612c2e5760405162461bcd60e51b815260206004820152602e60248201527f496e76616c6964207374617465207472616e736974696f6e3a2053746174652060448201527f646f6573206e6f742065786973740000000000000000000000000000000000006064820152608401610d03565b601b8181548110612c4157612c4161493b565b90600052602060002090602091828204019190069054906101000a900460ff1615601b8281548110612c7557612c7561493b565b90600052602060002090602091828204019190066101000a81548160ff02191690831515021790555050565b6008546001600160a01b03163314612ce95760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b601555565b6008546001600160a01b03163314612d365760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b60175415612d865760405162461bcd60e51b815260206004820152601a60248201527f5354415254494e475f494e4445585f414c52454144595f5345540000000000006044820152606401610d03565b612d91611388613b33565b60175542601855565b6008546001600160a01b03163314612de25760405162461bcd60e51b81526020600482018190526024820152600080516020614ade8339815191526044820152606401610d03565b6001600160a01b038116612e475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610d03565b610dcf816137de565b6006601b8181548110612e6557612e6561493b565b90600052602060002090602091828204019190069054906101000a900460ff16612ec15760405162461bcd60e51b815260206004820152600d60248201526c496e76616c696420737461746560981b6044820152606401610d03565b612eca82611c19565b612f165760405162461bcd60e51b815260206004820152601960248201527f54686520736574206973206e6f742072656465656d61626c65000000000000006044820152606401610d03565b601f8054906000612f2683614981565b919050555060005b6004811015612fc357601f54601e6000858481518110612f5057612f5061493b565b602090810291909101810151825281810192909252604001600020919091555460ff1615612fb157612fb133602060019054906101000a90046001600160a01b0316858481518110612fa457612fa461493b565b60200260200101516110b7565b80612fbb81614981565b915050612f2e565b507f960a2b11be69b13b341c09ebff9ea8e90839cadf60d098c565c9c6e9afb2672e33601f5484604051612ff9939291906149ed565b60405180910390a15050565b60006001600160e01b0319821663152a902d60e11b1480610c9b5750610c9b82613bd6565b6114b2828260405180602001604052806000815250613c26565b6127106001600160601b03821611156130b25760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610d03565b6001600160a01b0382166131085760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610d03565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600b55565b600081600111158015613155575060005482105b8015610c9b575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000826131e38584613c33565b1490505b9392505050565b60006131f9826136b5565b9050836001600160a01b031681600001516001600160a01b0316146132305760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b038616148061324e575061324e8533610bd9565b8061326957503361325e84610e64565b6001600160a01b0316145b90508061328957604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0384166132b057604051633a954ecd60e21b815260040160405180910390fd5b6132bc6000848761317a565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116613392576000548214613392578054602086015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60006131e782846148dc565b60006131e78284614911565b60006131e78284614951565b600a5460ff166134545760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610d03565b600a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b8015613564576000600d6000815481106134ba576134ba61493b565b906000526020600020015490506000811161352a5760405162461bcd60e51b815260206004820152602a60248201527f417065436f696e20746f204554482072617465206d75737420626520677265616044820152690746572207468616e20360b41b6064820152608401610d03565b610d2d33306135506509184e72a00061354a866114408a620186a06133de565b906133de565b600e546001600160a01b0316929190613ca7565b813410156114b25760405162461bcd60e51b815260206004820152601460248201527f496e73756666696369656e74205061796d656e740000000000000000000000006044820152606401610d03565b6000601b6004815481106135ca576135ca61493b565b60009182526020808320908204018054931515601f9092166101000a91820260ff9092021990931617909155601b60018154811061360a5761360a61493b565b60009182526020808320908204018054931515601f9092166101000a91820260ff9092021990931617909155601b60028154811061364a5761364a61493b565b60009182526020808320908204018054931515601f9092166101000a91820260ff9092021990931617909155601b60038154811061368a5761368a61493b565b90600052602060002090602091828204019190066101000a81548160ff021916908315150217905550565b604080516060810182526000808252602082018190529181019190915281806001111580156136e5575060005481105b156137c557600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161515918101829052906137c35780516001600160a01b031615613759579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff16151592810192909252156137be579392505050565b613759565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600a5460ff16156138765760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610d03565b600a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586134813390565b6040516001600160a01b038316602482015260448101829052610d2d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152613cdf565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613958903390899088908890600401614a4b565b6020604051808303816000875af1925050508015613993575060408051601f3d908101601f1916820190925261399091810190614a87565b60015b6139f1573d8080156139c1576040519150601f19603f3d011682016040523d82523d6000602084013e6139c6565b606091505b5080516000036139e9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506110af565b6060600f8054610de1906148a2565b606081600003613a415750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613a6b5780613a5581614981565b9150613a649050600a83614911565b9150613a45565b60008167ffffffffffffffff811115613a8657613a86614340565b6040519080825280601f01601f191660200182016040528015613ab0576020820181803683370190505b5090505b84156110af57613ac5600183614951565b9150613ad2600a8661499a565b613add90603061488a565b60f81b818381518110613af257613af261493b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613b2c600a86614911565b9450613ab4565b60008060004442604051602001613b54929190918252602082015260400190565b60408051601f1981840301815291905280516020909101209050613b7960ff8261499a565b613b8490600161488a565b905080431015613b92575060015b6000613b9e8243614951565b9050613bab85824061499a565b9250613bb8600a8461499a565b600003613bcd5782613bc981614981565b9350505b50909392505050565b60006001600160e01b031982166380ac58cd60e01b1480613c0757506001600160e01b03198216635b5e139f60e01b145b80610c9b57506301ffc9a760e01b6001600160e01b0319831614610c9b565b610d2d8383836001613db1565b600081815b8451811015613c9f576000858281518110613c5557613c5561493b565b60200260200101519050808311613c7b5760008381526020829052604090209250613c8c565b600081815260208490526040902092505b5080613c9781614981565b915050613c38565b509392505050565b6040516001600160a01b03808516602483015283166044820152606481018290526127b89085906323b872dd60e01b906084016138d7565b6000613d34826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613f839092919063ffffffff16565b805190915015610d2d5780806020019051810190613d529190614aa4565b610d2d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610d03565b6000546001600160a01b038516613dda57604051622e076360e81b815260040160405180910390fd5b83600003613dfb5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff19811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b429092169190910217905580808501838015613ead57506001600160a01b0387163b15155b15613f35575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4613efe6000888480600101955088613923565b613f1b576040516368d2bf6b60e11b815260040160405180910390fd5b808203613eb3578260005414613f3057600080fd5b613f7a565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808203613f36575b506000556133d7565b60606110af8484600085856001600160a01b0385163b613fe55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d03565b600080866001600160a01b031685876040516140019190614ac1565b60006040518083038185875af1925050503d806000811461403e576040519150601f19603f3d011682016040523d82523d6000602084013e614043565b606091505b509150915061405382828661405e565b979650505050505050565b6060831561406d5750816131e7565b82511561407d5782518084602001fd5b8160405162461bcd60e51b8152600401610d039190614303565b8280546140a3906148a2565b90600052602060002090601f0160209004810192826140c5576000855561410b565b82601f106140de57805160ff191683800117855561410b565b8280016001018555821561410b579182015b8281111561410b5782518255916020019190600101906140f0565b506141179291506141e7565b5090565b828054614127906148a2565b90600052602060002090601f016020900481019282614149576000855561410b565b82601f106141625782800160ff1982351617855561410b565b8280016001018555821561410b579182015b8281111561410b578235825591602001919060010190614174565b60405180608001604052806004906020820280368337509192915050565b82805482825590600052602060002090810192821561410b579160200282018281111561410b578235825591602001919060010190614174565b5b8082111561411757600081556001016141e8565b60006020828403121561420e57600080fd5b5035919050565b6001600160e01b031981168114610dcf57600080fd5b60006020828403121561423d57600080fd5b81356131e781614215565b80356001600160a01b038116811461425f57600080fd5b919050565b6000806040838503121561427757600080fd5b8235915061428760208401614248565b90509250929050565b6000602082840312156142a257600080fd5b6131e782614248565b60005b838110156142c65781810151838201526020016142ae565b838111156127b85750506000910152565b600081518084526142ef8160208601602086016142ab565b601f01601f19169290920160200192915050565b6020815260006131e760208301846142d7565b6000806040838503121561432957600080fd5b61433283614248565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561437f5761437f614340565b604052919050565b600067ffffffffffffffff8311156143a1576143a1614340565b6143b4601f8401601f1916602001614356565b90508281528383830111156143c857600080fd5b828260208301376000602084830101529392505050565b6000602082840312156143f157600080fd5b813567ffffffffffffffff81111561440857600080fd5b8201601f8101841361441957600080fd5b6110af84823560208401614387565b60008083601f84011261443a57600080fd5b50813567ffffffffffffffff81111561445257600080fd5b6020830191508360208260051b850101111561116957600080fd5b6000806000806060858703121561448357600080fd5b8435935061449360208601614248565b9250604085013567ffffffffffffffff8111156144af57600080fd5b6144bb87828801614428565b95989497509550505050565b6000806000606084860312156144dc57600080fd5b6144e584614248565b92506144f360208501614248565b9150604084013590509250925092565b6000806040838503121561451657600080fd5b50508035926020909101359150565b60006020828403121561453757600080fd5b81356001600160601b03811681146131e757600080fd5b8015158114610dcf57600080fd5b6000806040838503121561456f57600080fd5b61457883614248565b915060208301356145888161454e565b809150509250929050565b6000806000806000608086880312156145ab57600080fd5b853594506020860135935060408601356145c48161454e565b9250606086013567ffffffffffffffff8111156145e057600080fd5b6145ec88828901614428565b969995985093965092949392505050565b6000806020838503121561461057600080fd5b823567ffffffffffffffff8082111561462857600080fd5b818501915085601f83011261463c57600080fd5b81358181111561464b57600080fd5b86602082850101111561465d57600080fd5b60209290920196919550909350505050565b6000806040838503121561468257600080fd5b61468b83614248565b915061428760208401614248565b600082601f8301126146aa57600080fd5b8135602067ffffffffffffffff8211156146c6576146c6614340565b8160051b6146d5828201614356565b92835284810182019282810190878511156146ef57600080fd5b83870192505b84831015614053578235825291830191908301906146f5565b60006020828403121561472057600080fd5b813567ffffffffffffffff81111561473757600080fd5b6110af84828501614699565b6000806040838503121561475657600080fd5b61475f83614248565b9150602083013567ffffffffffffffff81111561477b57600080fd5b61478785828601614699565b9150509250929050565b600080602083850312156147a457600080fd5b823567ffffffffffffffff8111156147bb57600080fd5b6147c785828601614428565b90969095509350505050565b600080600080608085870312156147e957600080fd5b6147f285614248565b935061480060208601614248565b925060408501359150606085013567ffffffffffffffff81111561482357600080fd5b8501601f8101871361483457600080fd5b61484387823560208401614387565b91505092959194509250565b6000806040838503121561486257600080fd5b8235915060208301356145888161454e565b634e487b7160e01b600052601160045260246000fd5b6000821982111561489d5761489d614874565b500190565b600181811c908216806148b657607f821691505b6020821081036148d657634e487b7160e01b600052602260045260246000fd5b50919050565b60008160001904831182151516156148f6576148f6614874565b500290565b634e487b7160e01b600052601260045260246000fd5b600082614920576149206148fb565b500490565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008282101561496357614963614874565b500390565b60006020828403121561497a57600080fd5b5051919050565b60006001820161499357614993614874565b5060010190565b6000826149a9576149a96148fb565b500690565b600083516149c08184602088016142ab565b8351908301906149d48183602088016142ab565b64173539b7b760d91b9101908152600501949350505050565b6000606082016001600160a01b03861683526020858185015260606040850152818551808452608086019150828701935060005b81811015614a3d57845183529383019391830191600101614a21565b509098975050505050505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152614a7d60808301846142d7565b9695505050505050565b600060208284031215614a9957600080fd5b81516131e781614215565b600060208284031215614ab657600080fd5b81516131e78161454e565b60008251614ad38184602087016142ab565b919091019291505056fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212203e61a4cc7fbe46a1c0ca893f2819e2b2204e50fd6e0d9925f39fa579da028d6164736f6c634300080d0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000084b494e475348495000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024b53000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003268747470733a2f2f6b732d67656e657369732d64726f702e73332e616d617a6f6e6177732e636f6d2f6d657461646174612f0000000000000000000000000000
-----Decoded View---------------
Arg [0] : name (string): KINGSHIP
Arg [1] : symbol (string): KS
Arg [2] : baseTokenURI_ (string): https://ks-genesis-drop.s3.amazonaws.com/metadata/
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [4] : 4b494e4753484950000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [6] : 4b53000000000000000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [8] : 68747470733a2f2f6b732d67656e657369732d64726f702e73332e616d617a6f
Arg [9] : 6e6177732e636f6d2f6d657461646174612f0000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.