ERC-721
Overview
Max Total Supply
777 PAA
Holders
285
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
16 PAALoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
PrimeApeAthletes
Compiler Version
v0.8.12+commit.f00d7308
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.12; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/finance/PaymentSplitter.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/utils/Counters.sol'; import '@openzeppelin/contracts/token/common/ERC2981.sol'; import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol'; import '@openzeppelin/contracts/token/common/ERC2981.sol'; import 'erc721a/contracts/ERC721A.sol'; // ██████╗ ██████╗ ██╗███╗ ███╗███████╗ // ██╔══██╗██╔══██╗██║████╗ ████║██╔════╝ // ██████╔╝██████╔╝██║██╔████╔██║█████╗ // ██╔═══╝ ██╔══██╗██║██║╚██╔╝██║██╔══╝ // ██║ ██║ ██║██║██║ ╚═╝ ██║███████╗ // ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚══════╝ // █████╗ ██████╗ ███████╗ // ██╔══██╗██╔══██╗██╔════╝ // ███████║██████╔╝█████╗ // ██╔══██║██╔═══╝ ██╔══╝ // ██║ ██║██║ ███████╗ // ╚═╝ ╚═╝╚═╝ ╚══════╝ // █████╗ ████████╗██╗ ██╗██╗ ███████╗████████╗███████╗███████╗ // ██╔══██╗╚══██╔══╝██║ ██║██║ ██╔════╝╚══██╔══╝██╔════╝██╔════╝ // ███████║ ██║ ███████║██║ █████╗ ██║ █████╗ ███████╗ // ██╔══██║ ██║ ██╔══██║██║ ██╔══╝ ██║ ██╔══╝ ╚════██║ // ██║ ██║ ██║ ██║ ██║███████╗███████╗ ██║ ███████╗███████║ // ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚══════╝╚══════╝ // // // contract PrimeApeAthletes is ERC721A, ERC2981, Ownable, PaymentSplitter { using Strings for uint256; using Counters for Counters.Counter; enum Sale { NoSale, PreSale, PublicSale } uint256 public immutable price = 70000000000000000; //0,07 ETH uint256 public maxMintSupply = 10_000; uint256 public limitPerWallet = 15; bytes32 public ogPresaleRoot; uint256 public ogPresaleMaxMint = 5; bytes32 public normalPresaleRoot; uint256 public normalPresaleMaxMint = 3; string public baseURI; Sale public state = Sale.NoSale; mapping(address => uint256) public claimed; event PAAMinted(uint256 balance, address owner); string public contractURI = 'https://ipfs.io/ipfs/QmRLwTPR1Le3Pi5kvgHmFTzSmiHomBSoybtnbTdqBvXi4Q'; uint256[] private _teamShares = [90, 10]; address[] private _team = [ 0x94D5459df3d5133E37B6F337584941469199d84c, 0xBD584cE590B7dcdbB93b11e095d9E1D5880B44d9 ]; constructor() ERC721A('PrimeApeAthletes', 'PAA') PaymentSplitter(_team, _teamShares) { _setDefaultRoyalty(_team[0], 600); _transferOwnership(_team[0]); _safeMint(_team[0], 200); baseURI = 'ipfs://QmPoA4W1NLbDB6ZHU2osHX3G5CD5VetzvrMG11SBKsqKDU/'; } function enablePresale(bytes32 _presaleNormalRoot, bytes32 _presaleOGRoot) public onlyOwner { state = Sale.PreSale; ogPresaleRoot = _presaleOGRoot; normalPresaleRoot = _presaleNormalRoot; } function enablePublic() public onlyOwner { state = Sale.PublicSale; } function disable() public onlyOwner { state = Sale.NoSale; } function setBaseURI(string calldata _tokenBaseURI) external onlyOwner { baseURI = _tokenBaseURI; } function _baseURI() internal view override returns (string memory) { return baseURI; } function saleIsActive() public view returns (bool) { return state == Sale.PublicSale; } function presaleIsActive() public view returns (bool) { return state == Sale.PreSale; } function exists(uint256 id) public view returns (bool) { return _exists(id); } function mint(uint64 _amount) external payable { require(state == Sale.PublicSale, 'Public sale not enabled.'); require(_amount > 0, 'Zero amount.'); require( msg.value >= (price * _amount), 'You need to send proper amount of eth.' ); require( totalSupply() + _amount <= maxMintSupply, 'Purchase would exceed max supply of tokens.' ); require( claimed[_msgSender()] + _amount <= limitPerWallet, 'Purchase exceeds max allowed.' ); _safeMint(_msgSender(), _amount); claimed[_msgSender()] += _amount; emit PAAMinted(_amount, _msgSender()); } function presale( uint64 _amount, bool og, bytes32[] calldata proof ) external payable { require(state == Sale.PreSale, 'Presale not enabled.'); require(_amount > 0, 'zero amount'); require( verify(_msgSender(), proof, og ? ogPresaleRoot : normalPresaleRoot), 'Not selected for the presale.' ); uint256 maxMintAmount = og ? ogPresaleMaxMint : normalPresaleMaxMint; require(_amount <= maxMintAmount, 'max mint amount'); require( msg.value >= (price * _amount), 'You need to send proper amount of eth.' ); require( totalSupply() + _amount <= maxMintSupply, 'Purchase would exceed max supply of tokens.' ); require( claimed[_msgSender()] + _amount <= maxMintAmount, 'Purchase exceeds max allowed' ); _safeMint(_msgSender(), _amount); claimed[_msgSender()] += _amount; emit PAAMinted(_amount, _msgSender()); } function burn() external onlyOwner { maxMintSupply = totalSupply(); } /** * @dev See {IERC165-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), 'nonexistent token'); string memory uri = _baseURI(); if (bytes(uri).length == 0) { return ''; } return string(abi.encodePacked(uri, tokenId.toString(), '.json')); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) { return super.supportsInterface(interfaceId); } /** * @dev will set default royalty info. */ function setDefaultRoyalty(address receiver, uint96 feeNumerator) public onlyOwner { _setDefaultRoyalty(receiver, feeNumerator); } /** * @dev will set token royalty. */ function setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) public onlyOwner { _setTokenRoyalty(tokenId, receiver, feeNumerator); } function setContractURI(string calldata _contractURI) public onlyOwner { contractURI = _contractURI; } function setLimitPerWallet(uint256 _limitPerWallet) public onlyOwner { limitPerWallet = _limitPerWallet; } function setPresaleMaxMint( uint256 _ogPresaleMaxMint, uint256 _normalPresaleMaxMint ) public onlyOwner { ogPresaleMaxMint = _ogPresaleMaxMint; normalPresaleMaxMint = _normalPresaleMaxMint; } function verify( address account, bytes32[] memory proof, bytes32 root ) internal pure returns (bool) { bytes32 leaf = keccak256(abi.encodePacked(account)); return MerkleProof.verify(proof, root, leaf); } }
// 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/token/ERC721/extensions/IERC721Enumerable.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 MintedQueryForZeroAddress(); error BurnedQueryForZeroAddress(); error AuxQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerIndexOutOfBounds(); error OwnerQueryForNonexistentToken(); error TokenIndexOutOfBounds(); 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 See {IERC721Enumerable-totalSupply}. * @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) { if (owner == address(0)) revert MintedQueryForZeroAddress(); 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) { if (owner == address(0)) revert BurnedQueryForZeroAddress(); 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) { if (owner == address(0)) revert AuxQueryForZeroAddress(); 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 { if (owner == address(0)) revert AuxQueryForZeroAddress(); _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 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); bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr || isApprovedForAll(prevOwnership.addr, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, prevOwnership.addr); // 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; _ownerships[tokenId].addr = to; _ownerships[tokenId].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; if (_ownerships[nextTokenId].addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId < _currentIndex) { _ownerships[nextTokenId].addr = prevOwnership.addr; _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { TokenOwnership memory prevOwnership = ownershipOf(tokenId); _beforeTokenTransfers(prevOwnership.addr, address(0), tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, prevOwnership.addr); // 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[prevOwnership.addr].balance -= 1; _addressData[prevOwnership.addr].numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. _ownerships[tokenId].addr = prevOwnership.addr; _ownerships[tokenId].startTimestamp = uint64(block.timestamp); _ownerships[tokenId].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; if (_ownerships[nextTokenId].addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId < _currentIndex) { _ownerships[nextTokenId].addr = prevOwnership.addr; _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(prevOwnership.addr, address(0), tokenId); _afterTokenTransfers(prevOwnership.addr, 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 (last updated v4.5.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) external 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 (last updated v4.5.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. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = _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 v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// 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 (finance/PaymentSplitter.sol) pragma solidity ^0.8.0; import "../token/ERC20/utils/SafeERC20.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. * * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you * to run tests before sending real value to this contract. */ contract PaymentSplitter is Context { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; mapping(IERC20 => uint256) private _erc20TotalReleased; mapping(IERC20 => mapping(address => uint256)) private _erc20Released; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ constructor(address[] memory payees, uint256[] memory shares_) payable { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20 * contract. */ function totalReleased(IERC20 token) public view returns (uint256) { return _erc20TotalReleased[token]; } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view returns (uint256) { return _shares[account]; } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view returns (uint256) { return _released[account]; } /** * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an * IERC20 contract. */ function released(IERC20 token, address account) public view returns (uint256) { return _erc20Released[token][account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 totalReceived = address(this).balance + totalReleased(); uint256 payment = _pendingPayment(account, totalReceived, released(account)); require(payment != 0, "PaymentSplitter: account is not due payment"); _released[account] += payment; _totalReleased += payment; Address.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20 * contract. */ function release(IERC20 token, address account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token); uint256 payment = _pendingPayment(account, totalReceived, released(token, account)); require(payment != 0, "PaymentSplitter: account is not due payment"); _erc20Released[token][account] += payment; _erc20TotalReleased[token] += payment; SafeERC20.safeTransfer(token, account, payment); emit ERC20PaymentReleased(token, account, payment); } /** * @dev internal logic for computing the pending payment of an `account` given the token historical balances and * already released amounts. */ function _pendingPayment( address account, uint256 totalReceived, uint256 alreadyReleased ) private view returns (uint256) { return (totalReceived * _shares[account]) / _totalShares - alreadyReleased; } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); require(shares_ > 0, "PaymentSplitter: shares are 0"); require(_shares[account] == 0, "PaymentSplitter: account already has shares"); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares + shares_; emit PayeeAdded(account, shares_); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 substraction 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 (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 (last updated v4.5.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// 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/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be payed 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 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 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.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol";
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"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":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20PaymentReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"PAAMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"PayeeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_presaleNormalRoot","type":"bytes32"},{"internalType":"bytes32","name":"_presaleOGRoot","type":"bytes32"}],"name":"enablePresale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enablePublic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"limitPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_amount","type":"uint64"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"normalPresaleMaxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"normalPresaleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ogPresaleMaxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ogPresaleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"payee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_amount","type":"uint64"},{"internalType":"bool","name":"og","type":"bool"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"presale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"presaleIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_contractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_limitPerWallet","type":"uint256"}],"name":"setLimitPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ogPresaleMaxMint","type":"uint256"},{"internalType":"uint256","name":"_normalPresaleMaxMint","type":"uint256"}],"name":"setPresaleMaxMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"shares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"state","outputs":[{"internalType":"enum PrimeApeAthletes.Sale","name":"","type":"uint8"}],"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":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"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"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
66f8b0a10e470000608052612710601255600f601355600560155560036017556019805460ff19169055610120604052604360a0818152906200403b60c03980516200005491601b9160209091019062000a52565b5060408051808201909152605a8152600a60208201526200007a90601c90600262000ae1565b50604080518082019091527394d5459df3d5133e37b6f337584941469199d84c815273bd584ce590b7dcdbb93b11e095d9e1d5880b44d96020820152620000c690601d90600262000b24565b50348015620000d457600080fd5b50601d8054806020026020016040519081016040528092919081815260200182805480156200012d57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116200010e575b5050505050601c8054806020026020016040519081016040528092919081815260200182805480156200018057602002820191906000526020600020905b8154815260200190600101908083116200016b575b5050604080518082018252601081526f5072696d654170654174686c6574657360801b60208083019182528351808501909452600384526250414160e81b908401528151919550919350620001da92506002919062000a52565b508051620001f090600390602084019062000a52565b50506000805550620002023362000414565b8051825114620002745760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b60648201526084015b60405180910390fd5b6000825111620002c75760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f2070617965657300000000000060448201526064016200026b565b60005b825181101562000333576200031e838281518110620002ed57620002ed62000b93565b60200260200101518383815181106200030a576200030a62000b93565b60200260200101516200046660201b60201c565b806200032a8162000bbf565b915050620002ca565b5050506200036f601d60008154811062000351576200035162000b93565b6000918252602090912001546001600160a01b031661025862000654565b620003a5601d6000815481106200038a576200038a62000b93565b6000918252602090912001546001600160a01b031662000414565b620003dd601d600081548110620003c057620003c062000b93565b6000918252602090912001546001600160a01b031660c862000755565b6040518060600160405280603681526020016200407e6036913980516200040d9160189160209091019062000a52565b5062000ce3565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216620004d35760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b60648201526084016200026b565b60008111620005255760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a2073686172657320617265203000000060448201526064016200026b565b6001600160a01b0382166000908152600d602052604090205415620005a15760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b60648201526084016200026b565b600f8054600181019091557f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8020180546001600160a01b0319166001600160a01b0384169081179091556000908152600d60205260409020819055600b546200060b90829062000bdd565b600b55604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b6127106001600160601b0382161115620006c45760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084016200026b565b6001600160a01b0382166200071c5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016200026b565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600855565b620007778282604051806020016040528060008152506200077b60201b60201c565b5050565b6200078a83838360016200078f565b505050565b6000546001600160a01b038516620007b957604051622e076360e81b815260040160405180910390fd5b83620007d85760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080546001600160801b031981166001600160401b038083168c018116918217680100000000000000006001600160401b031990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b42909216919091021790558080850183801562000891575062000891876001600160a01b03166200095260201b62001b0d1760201c565b1562000911575b60405182906001600160a01b03891690600090600080516020620040b4833981519152908290a46001820191620008d59060009089908862000961565b620008f3576040516368d2bf6b60e11b815260040160405180910390fd5b80821415620008985782600054146200090b57600080fd5b62000947565b5b6040516001830192906001600160a01b03891690600090600080516020620040b4833981519152908290a48082141562000912575b506000555050505050565b6001600160a01b03163b151590565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906200099890339089908890889060040162000bf8565b6020604051808303816000875af1925050508015620009d6575060408051601f3d908101601f19168201909252620009d39181019062000c73565b60015b62000a35573d80801562000a07576040519150601f19603f3d011682016040523d82523d6000602084013e62000a0c565b606091505b50805162000a2d576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b82805462000a609062000ca6565b90600052602060002090601f01602090048101928262000a84576000855562000acf565b82601f1062000a9f57805160ff191683800117855562000acf565b8280016001018555821562000acf579182015b8281111562000acf57825182559160200191906001019062000ab2565b5062000add92915062000b7c565b5090565b82805482825590600052602060002090810192821562000acf579160200282015b8281111562000acf578251829060ff1690559160200191906001019062000b02565b82805482825590600052602060002090810192821562000acf579160200282015b8281111562000acf57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000b45565b5b8082111562000add576000815560010162000b7d565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141562000bd65762000bd662000ba9565b5060010190565b6000821982111562000bf35762000bf362000ba9565b500190565b600060018060a01b038087168352602081871681850152856040850152608060608501528451915081608085015260005b8281101562000c475785810182015185820160a00152810162000c29565b8281111562000c5a57600060a084870101525b5050601f01601f19169190910160a00195945050505050565b60006020828403121562000c8657600080fd5b81516001600160e01b03198116811462000c9f57600080fd5b9392505050565b600181811c9082168062000cbb57607f821691505b6020821081141562000cdd57634e487b7160e01b600052602260045260246000fd5b50919050565b60805161332e62000d0d600039600081816107e901528181611266015261198d015261332e6000f3fe60806040526004361061031e5760003560e01c806370a08231116101ab578063bc92e1dd116100f7578063dc64a75411610095578063e985e9c51161006f578063e985e9c5146109b6578063eb8d2444146109ff578063f2fde38b14610a14578063fb9d09c814610a3457600080fd5b8063dc64a75414610977578063e33b7de31461098c578063e8a3d485146109a157600080fd5b8063c87b56dd116100d1578063c87b56dd146108be578063c884ef83146108de578063ce7c2ac21461090b578063d79779b21461094157600080fd5b8063bc92e1dd14610861578063c19d93fb14610881578063c285e107146108a857600080fd5b806395d89b4111610164578063a035b1fe1161013e578063a035b1fe146107d7578063a22cb4651461080b578063a620ce5a1461082b578063b88d4fde1461084157600080fd5b806395d89b41146107765780639852595c1461078b5780639df01192146107c157600080fd5b806370a08231146106cd578063715018a6146106ed57806381966241146107025780638b83209b146107185780638da5cb5b14610738578063938e3d7b1461075657600080fd5b8063406072a91161026a5780634f72e497116102235780635944c753116101fd5780635944c753146106585780636352211e1461067857806363c766b9146106985780636c0360eb146106b857600080fd5b80634f72e4971461060f57806351e0df5b1461062557806355f804b31461063857600080fd5b8063406072a91461053457806342842e0e1461057a57806344df8e701461059a57806346285a6f146105af57806348b75044146105cf5780634f558e79146105ef57600080fd5b806319165587116102d75780632a55205a116102b15780632a55205a146104b65780632f2770db146104f557806330f72cd41461050a5780633a98ef391461051f57600080fd5b8063191655871461046057806323b872dd14610480578063279cca41146104a057600080fd5b806301ffc9a71461036c57806304634d8d146103a157806306fdde03146103c3578063081812fc146103e5578063095ea7b31461041d57806318160ddd1461043d57600080fd5b36610367577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b34801561037857600080fd5b5061038c610387366004612a90565b610a47565b60405190151581526020015b60405180910390f35b3480156103ad57600080fd5b506103c16103bc366004612ade565b610a58565b005b3480156103cf57600080fd5b506103d8610a99565b6040516103989190612b6b565b3480156103f157600080fd5b50610405610400366004612b7e565b610b2b565b6040516001600160a01b039091168152602001610398565b34801561042957600080fd5b506103c1610438366004612b97565b610b6f565b34801561044957600080fd5b50600154600054035b604051908152602001610398565b34801561046c57600080fd5b506103c161047b366004612bc3565b610bfd565b34801561048c57600080fd5b506103c161049b366004612be0565b610d2b565b3480156104ac57600080fd5b5061045260155481565b3480156104c257600080fd5b506104d66104d1366004612c21565b610d36565b604080516001600160a01b039093168352602083019190915201610398565b34801561050157600080fd5b506103c1610de2565b34801561051657600080fd5b5061038c610e23565b34801561052b57600080fd5b50600b54610452565b34801561054057600080fd5b5061045261054f366004612c43565b6001600160a01b03918216600090815260116020908152604080832093909416825291909152205490565b34801561058657600080fd5b506103c1610595366004612be0565b610e45565b3480156105a657600080fd5b506103c1610e60565b3480156105bb57600080fd5b506103c16105ca366004612c21565b610e96565b3480156105db57600080fd5b506103c16105ea366004612c43565b610ed5565b3480156105fb57600080fd5b5061038c61060a366004612b7e565b6110ae565b34801561061b57600080fd5b5061045260165481565b6103c1610633366004612ca1565b6110b9565b34801561064457600080fd5b506103c1610653366004612d33565b6113e9565b34801561066457600080fd5b506103c1610673366004612da4565b61141f565b34801561068457600080fd5b50610405610693366004612b7e565b611454565b3480156106a457600080fd5b506103c16106b3366004612b7e565b611466565b3480156106c457600080fd5b506103d8611495565b3480156106d957600080fd5b506104526106e8366004612bc3565b611523565b3480156106f957600080fd5b506103c1611571565b34801561070e57600080fd5b5061045260145481565b34801561072457600080fd5b50610405610733366004612b7e565b6115a7565b34801561074457600080fd5b50600a546001600160a01b0316610405565b34801561076257600080fd5b506103c1610771366004612d33565b6115d7565b34801561078257600080fd5b506103d861160d565b34801561079757600080fd5b506104526107a6366004612bc3565b6001600160a01b03166000908152600e602052604090205490565b3480156107cd57600080fd5b5061045260175481565b3480156107e357600080fd5b506104527f000000000000000000000000000000000000000000000000000000000000000081565b34801561081757600080fd5b506103c1610826366004612de2565b61161c565b34801561083757600080fd5b5061045260135481565b34801561084d57600080fd5b506103c161085c366004612e26565b6116b2565b34801561086d57600080fd5b506103c161087c366004612c21565b611703565b34801561088d57600080fd5b5060195461089b9060ff1681565b6040516103989190612f1b565b3480156108b457600080fd5b5061045260125481565b3480156108ca57600080fd5b506103d86108d9366004612b7e565b611738565b3480156108ea57600080fd5b506104526108f9366004612bc3565b601a6020526000908152604090205481565b34801561091757600080fd5b50610452610926366004612bc3565b6001600160a01b03166000908152600d602052604090205490565b34801561094d57600080fd5b5061045261095c366004612bc3565b6001600160a01b031660009081526010602052604090205490565b34801561098357600080fd5b506103c16117e1565b34801561099857600080fd5b50600c54610452565b3480156109ad57600080fd5b506103d861181f565b3480156109c257600080fd5b5061038c6109d1366004612c43565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a0b57600080fd5b5061038c61182c565b348015610a2057600080fd5b506103c1610a2f366004612bc3565b611835565b6103c1610a42366004612f43565b6118d0565b6000610a5282611b1c565b92915050565b600a546001600160a01b03163314610a8b5760405162461bcd60e51b8152600401610a8290612f5e565b60405180910390fd5b610a958282611b41565b5050565b606060028054610aa890612f93565b80601f0160208091040260200160405190810160405280929190818152602001828054610ad490612f93565b8015610b215780601f10610af657610100808354040283529160200191610b21565b820191906000526020600020905b815481529060010190602001808311610b0457829003601f168201915b5050505050905090565b6000610b3682611bfb565b610b53576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610b7a82611454565b9050806001600160a01b0316836001600160a01b03161415610baf5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610bcf5750610bcd81336109d1565b155b15610bed576040516367d9dca160e11b815260040160405180910390fd5b610bf8838383611c26565b505050565b6001600160a01b0381166000908152600d6020526040902054610c325760405162461bcd60e51b8152600401610a8290612fce565b6000610c3d600c5490565b610c47904761302a565b90506000610c748383610c6f866001600160a01b03166000908152600e602052604090205490565b611c82565b905080610c935760405162461bcd60e51b8152600401610a8290613042565b6001600160a01b0383166000908152600e602052604081208054839290610cbb90849061302a565b9250508190555080600c6000828254610cd4919061302a565b90915550610ce490508382611cca565b604080516001600160a01b0385168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a1505050565b610bf8838383611de3565b60008281526009602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610dab5750604080518082019091526008546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610dca906001600160601b03168761308d565b610dd491906130c2565b915196919550909350505050565b600a546001600160a01b03163314610e0c5760405162461bcd60e51b8152600401610a8290612f5e565b601980546000919060ff19166001835b0217905550565b600060015b60195460ff166002811115610e3f57610e3f612f05565b14905090565b610bf8838383604051806020016040528060008152506116b2565b600a546001600160a01b03163314610e8a5760405162461bcd60e51b8152600401610a8290612f5e565b60015460005403601255565b600a546001600160a01b03163314610ec05760405162461bcd60e51b8152600401610a8290612f5e565b6019805460ff19166001179055601455601655565b6001600160a01b0381166000908152600d6020526040902054610f0a5760405162461bcd60e51b8152600401610a8290612fce565b6001600160a01b0382166000908152601060205260408120546040516370a0823160e01b81523060048201526001600160a01b038516906370a0823190602401602060405180830381865afa158015610f67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8b91906130d6565b610f95919061302a565b90506000610fce8383610c6f87876001600160a01b03918216600090815260116020908152604080832093909416825291909152205490565b905080610fed5760405162461bcd60e51b8152600401610a8290613042565b6001600160a01b0380851660009081526011602090815260408083209387168352929052908120805483929061102490849061302a565b90915550506001600160a01b0384166000908152601060205260408120805483929061105190849061302a565b909155506110629050848483611ff7565b604080516001600160a01b038581168252602082018490528616917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a250505050565b6000610a5282611bfb565b600160195460ff1660028111156110d2576110d2612f05565b146111165760405162461bcd60e51b8152602060048201526014602482015273283932b9b0b632903737ba1032b730b13632b21760611b6044820152606401610a82565b6000846001600160401b03161161115d5760405162461bcd60e51b815260206004820152600b60248201526a1e995c9bc8185b5bdd5b9d60aa1b6044820152606401610a82565b6111ab338383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508892506111a391505057601654612049565b601454612049565b6111f75760405162461bcd60e51b815260206004820152601d60248201527f4e6f742073656c656374656420666f72207468652070726573616c652e0000006044820152606401610a82565b6000836112065760175461120a565b6015545b905080856001600160401b031611156112575760405162461bcd60e51b815260206004820152600f60248201526e1b585e081b5a5b9d08185b5bdd5b9d608a1b6044820152606401610a82565b61128a6001600160401b0386167f000000000000000000000000000000000000000000000000000000000000000061308d565b3410156112a95760405162461bcd60e51b8152600401610a82906130ef565b601254856001600160401b03166112c36001546000540390565b6112cd919061302a565b11156112eb5760405162461bcd60e51b8152600401610a8290613135565b336000908152601a60205260409020548190611311906001600160401b0388169061302a565b111561135f5760405162461bcd60e51b815260206004820152601c60248201527f50757263686173652065786365656473206d617820616c6c6f776564000000006044820152606401610a82565b61137233866001600160401b0316612099565b336000908152601a6020526040812080546001600160401b038816929061139a90849061302a565b9091555050604080516001600160401b038716815233602082015281517f466d5609dc64b68a9ac5ad7535d461461bf5787387623fdc41e2bfa553147d62929181900390910190a15050505050565b600a546001600160a01b031633146114135760405162461bcd60e51b8152600401610a8290612f5e565b610bf8601883836129e1565b600a546001600160a01b031633146114495760405162461bcd60e51b8152600401610a8290612f5e565b610bf88383836120b3565b600061145f8261217e565b5192915050565b600a546001600160a01b031633146114905760405162461bcd60e51b8152600401610a8290612f5e565b601355565b601880546114a290612f93565b80601f01602080910402602001604051908101604052809291908181526020018280546114ce90612f93565b801561151b5780601f106114f05761010080835404028352916020019161151b565b820191906000526020600020905b8154815290600101906020018083116114fe57829003601f168201915b505050505081565b60006001600160a01b03821661154c576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b600a546001600160a01b0316331461159b5760405162461bcd60e51b8152600401610a8290612f5e565b6115a56000612298565b565b6000600f82815481106115bc576115bc613180565b6000918252602090912001546001600160a01b031692915050565b600a546001600160a01b031633146116015760405162461bcd60e51b8152600401610a8290612f5e565b610bf8601b83836129e1565b606060038054610aa890612f93565b6001600160a01b0382163314156116465760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6116bd848484611de3565b6001600160a01b0383163b151580156116df57506116dd848484846122ea565b155b156116fd576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b600a546001600160a01b0316331461172d5760405162461bcd60e51b8152600401610a8290612f5e565b601591909155601755565b606061174382611bfb565b6117835760405162461bcd60e51b81526020600482015260116024820152703737b732bc34b9ba32b73a103a37b5b2b760791b6044820152606401610a82565b600061178d6123d3565b90508051600014156117af575050604080516020810190915260008152919050565b806117b9846123e2565b6040516020016117ca929190613196565b604051602081830303815290604052915050919050565b600a546001600160a01b0316331461180b5760405162461bcd60e51b8152600401610a8290612f5e565b601980546002919060ff1916600183610e1c565b601b80546114a290612f93565b60006002610e28565b600a546001600160a01b0316331461185f5760405162461bcd60e51b8152600401610a8290612f5e565b6001600160a01b0381166118c45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a82565b6118cd81612298565b50565b600260195460ff1660028111156118e9576118e9612f05565b146119365760405162461bcd60e51b815260206004820152601860248201527f5075626c69632073616c65206e6f7420656e61626c65642e00000000000000006044820152606401610a82565b6000816001600160401b03161161197e5760405162461bcd60e51b815260206004820152600c60248201526b2d32b9379030b6b7bab73a1760a11b6044820152606401610a82565b6119b16001600160401b0382167f000000000000000000000000000000000000000000000000000000000000000061308d565b3410156119d05760405162461bcd60e51b8152600401610a82906130ef565b601254816001600160401b03166119ea6001546000540390565b6119f4919061302a565b1115611a125760405162461bcd60e51b8152600401610a8290613135565b601354336000908152601a6020526040902054611a39906001600160401b0384169061302a565b1115611a875760405162461bcd60e51b815260206004820152601d60248201527f50757263686173652065786365656473206d617820616c6c6f7765642e0000006044820152606401610a82565b611a9a33826001600160401b0316612099565b336000908152601a6020526040812080546001600160401b0384169290611ac290849061302a565b9091555050604080516001600160401b038316815233602082015281517f466d5609dc64b68a9ac5ad7535d461461bf5787387623fdc41e2bfa553147d62929181900390910190a150565b6001600160a01b03163b151590565b60006001600160e01b0319821663152a902d60e11b1480610a525750610a52826124df565b6127106001600160601b0382161115611b6c5760405162461bcd60e51b8152600401610a82906131d5565b6001600160a01b038216611bc25760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610a82565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600855565b6000805482108015610a52575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600b546001600160a01b0384166000908152600d602052604081205490918391611cac908661308d565b611cb691906130c2565b611cc0919061321f565b90505b9392505050565b80471015611d1a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a82565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611d67576040519150601f19603f3d011682016040523d82523d6000602084013e611d6c565b606091505b5050905080610bf85760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610a82565b6000611dee8261217e565b80519091506000906001600160a01b0316336001600160a01b03161480611e1c57508151611e1c90336109d1565b80611e37575033611e2c84610b2b565b6001600160a01b0316145b905080611e5757604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b031614611e8c5760405162a1148160e81b815260040160405180910390fd5b6001600160a01b038416611eb357604051633a954ecd60e21b815260040160405180910390fd5b611ec36000848460000151611c26565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217909255908601808352912054909116611fad57600054811015611fad57825160008281526004602090815260409091208054918601516001600160401b0316600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610bf890849061252f565b6040516bffffffffffffffffffffffff19606085901b1660208201526000908190603401604051602081830303815290604052805190602001209050612090848483612601565b95945050505050565b610a95828260405180602001604052806000815250612617565b6127106001600160601b03821611156120de5760405162461bcd60e51b8152600401610a82906131d5565b6001600160a01b0382166121345760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610a82565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600990529190942093519051909116600160a01b029116179055565b60408051606081018252600080825260208201819052918101919091528160005481101561227f57600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff1615159181018290529061227d5780516001600160a01b031615612214579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215612278579392505050565b612214565b505b604051636f96cda160e11b815260040160405180910390fd5b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061231f903390899088908890600401613236565b6020604051808303816000875af192505050801561235a575060408051601f3d908101601f1916820190925261235791810190613273565b60015b6123b5573d808015612388576040519150601f19603f3d011682016040523d82523d6000602084013e61238d565b606091505b5080516123ad576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606060188054610aa890612f93565b6060816124065750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612430578061241a81613290565b91506124299050600a836130c2565b915061240a565b6000816001600160401b0381111561244a5761244a612e10565b6040519080825280601f01601f191660200182016040528015612474576020820181803683370190505b5090505b84156123cb5761248960018361321f565b9150612496600a866132ab565b6124a190603061302a565b60f81b8183815181106124b6576124b6613180565b60200101906001600160f81b031916908160001a9053506124d8600a866130c2565b9450612478565b60006001600160e01b031982166380ac58cd60e01b148061251057506001600160e01b03198216635b5e139f60e01b145b80610a5257506301ffc9a760e01b6001600160e01b0319831614610a52565b6000612584826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126249092919063ffffffff16565b805190915015610bf857808060200190518101906125a291906132bf565b610bf85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a82565b60008261260e8584612633565b14949350505050565b610bf883838360016126a7565b6060611cc08484600085612877565b600081815b845181101561269f57600085828151811061265557612655613180565b6020026020010151905080831161267b576000838152602082905260409020925061268c565b600081815260208490526040902092505b508061269781613290565b915050612638565b509392505050565b6000546001600160a01b0385166126d057604051622e076360e81b815260040160405180910390fd5b836126ee5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b42909216919091021790558080850183801561279f57506001600160a01b0387163b15155b15612828575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46127f060008884806001019550886122ea565b61280d576040516368d2bf6b60e11b815260040160405180910390fd5b808214156127a557826000541461282357600080fd5b61286e565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415612829575b50600055611ff0565b6060824710156128d85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610a82565b6001600160a01b0385163b61292f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a82565b600080866001600160a01b0316858760405161294b91906132dc565b60006040518083038185875af1925050503d8060008114612988576040519150601f19603f3d011682016040523d82523d6000602084013e61298d565b606091505b509150915061299d8282866129a8565b979650505050505050565b606083156129b7575081611cc3565b8251156129c75782518084602001fd5b8160405162461bcd60e51b8152600401610a829190612b6b565b8280546129ed90612f93565b90600052602060002090601f016020900481019282612a0f5760008555612a55565b82601f10612a285782800160ff19823516178555612a55565b82800160010185558215612a55579182015b82811115612a55578235825591602001919060010190612a3a565b50612a61929150612a65565b5090565b5b80821115612a615760008155600101612a66565b6001600160e01b0319811681146118cd57600080fd5b600060208284031215612aa257600080fd5b8135611cc381612a7a565b6001600160a01b03811681146118cd57600080fd5b80356001600160601b0381168114612ad957600080fd5b919050565b60008060408385031215612af157600080fd5b8235612afc81612aad565b9150612b0a60208401612ac2565b90509250929050565b60005b83811015612b2e578181015183820152602001612b16565b838111156116fd5750506000910152565b60008151808452612b57816020860160208601612b13565b601f01601f19169290920160200192915050565b602081526000611cc36020830184612b3f565b600060208284031215612b9057600080fd5b5035919050565b60008060408385031215612baa57600080fd5b8235612bb581612aad565b946020939093013593505050565b600060208284031215612bd557600080fd5b8135611cc381612aad565b600080600060608486031215612bf557600080fd5b8335612c0081612aad565b92506020840135612c1081612aad565b929592945050506040919091013590565b60008060408385031215612c3457600080fd5b50508035926020909101359150565b60008060408385031215612c5657600080fd5b8235612c6181612aad565b91506020830135612c7181612aad565b809150509250929050565b80356001600160401b0381168114612ad957600080fd5b80151581146118cd57600080fd5b60008060008060608587031215612cb757600080fd5b612cc085612c7c565b93506020850135612cd081612c93565b925060408501356001600160401b0380821115612cec57600080fd5b818701915087601f830112612d0057600080fd5b813581811115612d0f57600080fd5b8860208260051b8501011115612d2457600080fd5b95989497505060200194505050565b60008060208385031215612d4657600080fd5b82356001600160401b0380821115612d5d57600080fd5b818501915085601f830112612d7157600080fd5b813581811115612d8057600080fd5b866020828501011115612d9257600080fd5b60209290920196919550909350505050565b600080600060608486031215612db957600080fd5b833592506020840135612dcb81612aad565b9150612dd960408501612ac2565b90509250925092565b60008060408385031215612df557600080fd5b8235612e0081612aad565b91506020830135612c7181612c93565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612e3c57600080fd5b8435612e4781612aad565b93506020850135612e5781612aad565b92506040850135915060608501356001600160401b0380821115612e7a57600080fd5b818701915087601f830112612e8e57600080fd5b813581811115612ea057612ea0612e10565b604051601f8201601f19908116603f01168101908382118183101715612ec857612ec8612e10565b816040528281528a6020848701011115612ee157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612f3d57634e487b7160e01b600052602160045260246000fd5b91905290565b600060208284031215612f5557600080fd5b611cc382612c7c565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680612fa757607f821691505b60208210811415612fc857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000821982111561303d5761303d613014565b500190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b60008160001904831182151516156130a7576130a7613014565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826130d1576130d16130ac565b500490565b6000602082840312156130e857600080fd5b5051919050565b60208082526026908201527f596f75206e65656420746f2073656e642070726f70657220616d6f756e74206f604082015265331032ba341760d11b606082015260800190565b6020808252602b908201527f507572636861736520776f756c6420657863656564206d617820737570706c7960408201526a1037b3103a37b5b2b7399760a91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600083516131a8818460208801612b13565b8351908301906131bc818360208801612b13565b64173539b7b760d91b9101908152600501949350505050565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b60008282101561323157613231613014565b500390565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061326990830184612b3f565b9695505050505050565b60006020828403121561328557600080fd5b8151611cc381612a7a565b60006000198214156132a4576132a4613014565b5060010190565b6000826132ba576132ba6130ac565b500690565b6000602082840312156132d157600080fd5b8151611cc381612c93565b600082516132ee818460208701612b13565b919091019291505056fea2646970667358221220335167f786e6c3b3d09d4c9b50adb8aa0dbf63692ea1c2a93189def42f9bfbab64736f6c634300080c003368747470733a2f2f697066732e696f2f697066732f516d524c77545052314c65335069356b7667486d46547a536d69486f6d42536f7962746e62546471427658693451697066733a2f2f516d506f413457314e4c624442365a4855326f7348583347354344355665747a76724d47313153424b73714b44552fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
Deployed Bytecode
0x60806040526004361061031e5760003560e01c806370a08231116101ab578063bc92e1dd116100f7578063dc64a75411610095578063e985e9c51161006f578063e985e9c5146109b6578063eb8d2444146109ff578063f2fde38b14610a14578063fb9d09c814610a3457600080fd5b8063dc64a75414610977578063e33b7de31461098c578063e8a3d485146109a157600080fd5b8063c87b56dd116100d1578063c87b56dd146108be578063c884ef83146108de578063ce7c2ac21461090b578063d79779b21461094157600080fd5b8063bc92e1dd14610861578063c19d93fb14610881578063c285e107146108a857600080fd5b806395d89b4111610164578063a035b1fe1161013e578063a035b1fe146107d7578063a22cb4651461080b578063a620ce5a1461082b578063b88d4fde1461084157600080fd5b806395d89b41146107765780639852595c1461078b5780639df01192146107c157600080fd5b806370a08231146106cd578063715018a6146106ed57806381966241146107025780638b83209b146107185780638da5cb5b14610738578063938e3d7b1461075657600080fd5b8063406072a91161026a5780634f72e497116102235780635944c753116101fd5780635944c753146106585780636352211e1461067857806363c766b9146106985780636c0360eb146106b857600080fd5b80634f72e4971461060f57806351e0df5b1461062557806355f804b31461063857600080fd5b8063406072a91461053457806342842e0e1461057a57806344df8e701461059a57806346285a6f146105af57806348b75044146105cf5780634f558e79146105ef57600080fd5b806319165587116102d75780632a55205a116102b15780632a55205a146104b65780632f2770db146104f557806330f72cd41461050a5780633a98ef391461051f57600080fd5b8063191655871461046057806323b872dd14610480578063279cca41146104a057600080fd5b806301ffc9a71461036c57806304634d8d146103a157806306fdde03146103c3578063081812fc146103e5578063095ea7b31461041d57806318160ddd1461043d57600080fd5b36610367577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b34801561037857600080fd5b5061038c610387366004612a90565b610a47565b60405190151581526020015b60405180910390f35b3480156103ad57600080fd5b506103c16103bc366004612ade565b610a58565b005b3480156103cf57600080fd5b506103d8610a99565b6040516103989190612b6b565b3480156103f157600080fd5b50610405610400366004612b7e565b610b2b565b6040516001600160a01b039091168152602001610398565b34801561042957600080fd5b506103c1610438366004612b97565b610b6f565b34801561044957600080fd5b50600154600054035b604051908152602001610398565b34801561046c57600080fd5b506103c161047b366004612bc3565b610bfd565b34801561048c57600080fd5b506103c161049b366004612be0565b610d2b565b3480156104ac57600080fd5b5061045260155481565b3480156104c257600080fd5b506104d66104d1366004612c21565b610d36565b604080516001600160a01b039093168352602083019190915201610398565b34801561050157600080fd5b506103c1610de2565b34801561051657600080fd5b5061038c610e23565b34801561052b57600080fd5b50600b54610452565b34801561054057600080fd5b5061045261054f366004612c43565b6001600160a01b03918216600090815260116020908152604080832093909416825291909152205490565b34801561058657600080fd5b506103c1610595366004612be0565b610e45565b3480156105a657600080fd5b506103c1610e60565b3480156105bb57600080fd5b506103c16105ca366004612c21565b610e96565b3480156105db57600080fd5b506103c16105ea366004612c43565b610ed5565b3480156105fb57600080fd5b5061038c61060a366004612b7e565b6110ae565b34801561061b57600080fd5b5061045260165481565b6103c1610633366004612ca1565b6110b9565b34801561064457600080fd5b506103c1610653366004612d33565b6113e9565b34801561066457600080fd5b506103c1610673366004612da4565b61141f565b34801561068457600080fd5b50610405610693366004612b7e565b611454565b3480156106a457600080fd5b506103c16106b3366004612b7e565b611466565b3480156106c457600080fd5b506103d8611495565b3480156106d957600080fd5b506104526106e8366004612bc3565b611523565b3480156106f957600080fd5b506103c1611571565b34801561070e57600080fd5b5061045260145481565b34801561072457600080fd5b50610405610733366004612b7e565b6115a7565b34801561074457600080fd5b50600a546001600160a01b0316610405565b34801561076257600080fd5b506103c1610771366004612d33565b6115d7565b34801561078257600080fd5b506103d861160d565b34801561079757600080fd5b506104526107a6366004612bc3565b6001600160a01b03166000908152600e602052604090205490565b3480156107cd57600080fd5b5061045260175481565b3480156107e357600080fd5b506104527f00000000000000000000000000000000000000000000000000f8b0a10e47000081565b34801561081757600080fd5b506103c1610826366004612de2565b61161c565b34801561083757600080fd5b5061045260135481565b34801561084d57600080fd5b506103c161085c366004612e26565b6116b2565b34801561086d57600080fd5b506103c161087c366004612c21565b611703565b34801561088d57600080fd5b5060195461089b9060ff1681565b6040516103989190612f1b565b3480156108b457600080fd5b5061045260125481565b3480156108ca57600080fd5b506103d86108d9366004612b7e565b611738565b3480156108ea57600080fd5b506104526108f9366004612bc3565b601a6020526000908152604090205481565b34801561091757600080fd5b50610452610926366004612bc3565b6001600160a01b03166000908152600d602052604090205490565b34801561094d57600080fd5b5061045261095c366004612bc3565b6001600160a01b031660009081526010602052604090205490565b34801561098357600080fd5b506103c16117e1565b34801561099857600080fd5b50600c54610452565b3480156109ad57600080fd5b506103d861181f565b3480156109c257600080fd5b5061038c6109d1366004612c43565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a0b57600080fd5b5061038c61182c565b348015610a2057600080fd5b506103c1610a2f366004612bc3565b611835565b6103c1610a42366004612f43565b6118d0565b6000610a5282611b1c565b92915050565b600a546001600160a01b03163314610a8b5760405162461bcd60e51b8152600401610a8290612f5e565b60405180910390fd5b610a958282611b41565b5050565b606060028054610aa890612f93565b80601f0160208091040260200160405190810160405280929190818152602001828054610ad490612f93565b8015610b215780601f10610af657610100808354040283529160200191610b21565b820191906000526020600020905b815481529060010190602001808311610b0457829003601f168201915b5050505050905090565b6000610b3682611bfb565b610b53576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610b7a82611454565b9050806001600160a01b0316836001600160a01b03161415610baf5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610bcf5750610bcd81336109d1565b155b15610bed576040516367d9dca160e11b815260040160405180910390fd5b610bf8838383611c26565b505050565b6001600160a01b0381166000908152600d6020526040902054610c325760405162461bcd60e51b8152600401610a8290612fce565b6000610c3d600c5490565b610c47904761302a565b90506000610c748383610c6f866001600160a01b03166000908152600e602052604090205490565b611c82565b905080610c935760405162461bcd60e51b8152600401610a8290613042565b6001600160a01b0383166000908152600e602052604081208054839290610cbb90849061302a565b9250508190555080600c6000828254610cd4919061302a565b90915550610ce490508382611cca565b604080516001600160a01b0385168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a1505050565b610bf8838383611de3565b60008281526009602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610dab5750604080518082019091526008546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610dca906001600160601b03168761308d565b610dd491906130c2565b915196919550909350505050565b600a546001600160a01b03163314610e0c5760405162461bcd60e51b8152600401610a8290612f5e565b601980546000919060ff19166001835b0217905550565b600060015b60195460ff166002811115610e3f57610e3f612f05565b14905090565b610bf8838383604051806020016040528060008152506116b2565b600a546001600160a01b03163314610e8a5760405162461bcd60e51b8152600401610a8290612f5e565b60015460005403601255565b600a546001600160a01b03163314610ec05760405162461bcd60e51b8152600401610a8290612f5e565b6019805460ff19166001179055601455601655565b6001600160a01b0381166000908152600d6020526040902054610f0a5760405162461bcd60e51b8152600401610a8290612fce565b6001600160a01b0382166000908152601060205260408120546040516370a0823160e01b81523060048201526001600160a01b038516906370a0823190602401602060405180830381865afa158015610f67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8b91906130d6565b610f95919061302a565b90506000610fce8383610c6f87876001600160a01b03918216600090815260116020908152604080832093909416825291909152205490565b905080610fed5760405162461bcd60e51b8152600401610a8290613042565b6001600160a01b0380851660009081526011602090815260408083209387168352929052908120805483929061102490849061302a565b90915550506001600160a01b0384166000908152601060205260408120805483929061105190849061302a565b909155506110629050848483611ff7565b604080516001600160a01b038581168252602082018490528616917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a250505050565b6000610a5282611bfb565b600160195460ff1660028111156110d2576110d2612f05565b146111165760405162461bcd60e51b8152602060048201526014602482015273283932b9b0b632903737ba1032b730b13632b21760611b6044820152606401610a82565b6000846001600160401b03161161115d5760405162461bcd60e51b815260206004820152600b60248201526a1e995c9bc8185b5bdd5b9d60aa1b6044820152606401610a82565b6111ab338383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508892506111a391505057601654612049565b601454612049565b6111f75760405162461bcd60e51b815260206004820152601d60248201527f4e6f742073656c656374656420666f72207468652070726573616c652e0000006044820152606401610a82565b6000836112065760175461120a565b6015545b905080856001600160401b031611156112575760405162461bcd60e51b815260206004820152600f60248201526e1b585e081b5a5b9d08185b5bdd5b9d608a1b6044820152606401610a82565b61128a6001600160401b0386167f00000000000000000000000000000000000000000000000000f8b0a10e47000061308d565b3410156112a95760405162461bcd60e51b8152600401610a82906130ef565b601254856001600160401b03166112c36001546000540390565b6112cd919061302a565b11156112eb5760405162461bcd60e51b8152600401610a8290613135565b336000908152601a60205260409020548190611311906001600160401b0388169061302a565b111561135f5760405162461bcd60e51b815260206004820152601c60248201527f50757263686173652065786365656473206d617820616c6c6f776564000000006044820152606401610a82565b61137233866001600160401b0316612099565b336000908152601a6020526040812080546001600160401b038816929061139a90849061302a565b9091555050604080516001600160401b038716815233602082015281517f466d5609dc64b68a9ac5ad7535d461461bf5787387623fdc41e2bfa553147d62929181900390910190a15050505050565b600a546001600160a01b031633146114135760405162461bcd60e51b8152600401610a8290612f5e565b610bf8601883836129e1565b600a546001600160a01b031633146114495760405162461bcd60e51b8152600401610a8290612f5e565b610bf88383836120b3565b600061145f8261217e565b5192915050565b600a546001600160a01b031633146114905760405162461bcd60e51b8152600401610a8290612f5e565b601355565b601880546114a290612f93565b80601f01602080910402602001604051908101604052809291908181526020018280546114ce90612f93565b801561151b5780601f106114f05761010080835404028352916020019161151b565b820191906000526020600020905b8154815290600101906020018083116114fe57829003601f168201915b505050505081565b60006001600160a01b03821661154c576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b600a546001600160a01b0316331461159b5760405162461bcd60e51b8152600401610a8290612f5e565b6115a56000612298565b565b6000600f82815481106115bc576115bc613180565b6000918252602090912001546001600160a01b031692915050565b600a546001600160a01b031633146116015760405162461bcd60e51b8152600401610a8290612f5e565b610bf8601b83836129e1565b606060038054610aa890612f93565b6001600160a01b0382163314156116465760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6116bd848484611de3565b6001600160a01b0383163b151580156116df57506116dd848484846122ea565b155b156116fd576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b600a546001600160a01b0316331461172d5760405162461bcd60e51b8152600401610a8290612f5e565b601591909155601755565b606061174382611bfb565b6117835760405162461bcd60e51b81526020600482015260116024820152703737b732bc34b9ba32b73a103a37b5b2b760791b6044820152606401610a82565b600061178d6123d3565b90508051600014156117af575050604080516020810190915260008152919050565b806117b9846123e2565b6040516020016117ca929190613196565b604051602081830303815290604052915050919050565b600a546001600160a01b0316331461180b5760405162461bcd60e51b8152600401610a8290612f5e565b601980546002919060ff1916600183610e1c565b601b80546114a290612f93565b60006002610e28565b600a546001600160a01b0316331461185f5760405162461bcd60e51b8152600401610a8290612f5e565b6001600160a01b0381166118c45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a82565b6118cd81612298565b50565b600260195460ff1660028111156118e9576118e9612f05565b146119365760405162461bcd60e51b815260206004820152601860248201527f5075626c69632073616c65206e6f7420656e61626c65642e00000000000000006044820152606401610a82565b6000816001600160401b03161161197e5760405162461bcd60e51b815260206004820152600c60248201526b2d32b9379030b6b7bab73a1760a11b6044820152606401610a82565b6119b16001600160401b0382167f00000000000000000000000000000000000000000000000000f8b0a10e47000061308d565b3410156119d05760405162461bcd60e51b8152600401610a82906130ef565b601254816001600160401b03166119ea6001546000540390565b6119f4919061302a565b1115611a125760405162461bcd60e51b8152600401610a8290613135565b601354336000908152601a6020526040902054611a39906001600160401b0384169061302a565b1115611a875760405162461bcd60e51b815260206004820152601d60248201527f50757263686173652065786365656473206d617820616c6c6f7765642e0000006044820152606401610a82565b611a9a33826001600160401b0316612099565b336000908152601a6020526040812080546001600160401b0384169290611ac290849061302a565b9091555050604080516001600160401b038316815233602082015281517f466d5609dc64b68a9ac5ad7535d461461bf5787387623fdc41e2bfa553147d62929181900390910190a150565b6001600160a01b03163b151590565b60006001600160e01b0319821663152a902d60e11b1480610a525750610a52826124df565b6127106001600160601b0382161115611b6c5760405162461bcd60e51b8152600401610a82906131d5565b6001600160a01b038216611bc25760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610a82565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600855565b6000805482108015610a52575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600b546001600160a01b0384166000908152600d602052604081205490918391611cac908661308d565b611cb691906130c2565b611cc0919061321f565b90505b9392505050565b80471015611d1a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a82565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611d67576040519150601f19603f3d011682016040523d82523d6000602084013e611d6c565b606091505b5050905080610bf85760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610a82565b6000611dee8261217e565b80519091506000906001600160a01b0316336001600160a01b03161480611e1c57508151611e1c90336109d1565b80611e37575033611e2c84610b2b565b6001600160a01b0316145b905080611e5757604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b031614611e8c5760405162a1148160e81b815260040160405180910390fd5b6001600160a01b038416611eb357604051633a954ecd60e21b815260040160405180910390fd5b611ec36000848460000151611c26565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217909255908601808352912054909116611fad57600054811015611fad57825160008281526004602090815260409091208054918601516001600160401b0316600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610bf890849061252f565b6040516bffffffffffffffffffffffff19606085901b1660208201526000908190603401604051602081830303815290604052805190602001209050612090848483612601565b95945050505050565b610a95828260405180602001604052806000815250612617565b6127106001600160601b03821611156120de5760405162461bcd60e51b8152600401610a82906131d5565b6001600160a01b0382166121345760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610a82565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600990529190942093519051909116600160a01b029116179055565b60408051606081018252600080825260208201819052918101919091528160005481101561227f57600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff1615159181018290529061227d5780516001600160a01b031615612214579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215612278579392505050565b612214565b505b604051636f96cda160e11b815260040160405180910390fd5b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061231f903390899088908890600401613236565b6020604051808303816000875af192505050801561235a575060408051601f3d908101601f1916820190925261235791810190613273565b60015b6123b5573d808015612388576040519150601f19603f3d011682016040523d82523d6000602084013e61238d565b606091505b5080516123ad576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606060188054610aa890612f93565b6060816124065750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612430578061241a81613290565b91506124299050600a836130c2565b915061240a565b6000816001600160401b0381111561244a5761244a612e10565b6040519080825280601f01601f191660200182016040528015612474576020820181803683370190505b5090505b84156123cb5761248960018361321f565b9150612496600a866132ab565b6124a190603061302a565b60f81b8183815181106124b6576124b6613180565b60200101906001600160f81b031916908160001a9053506124d8600a866130c2565b9450612478565b60006001600160e01b031982166380ac58cd60e01b148061251057506001600160e01b03198216635b5e139f60e01b145b80610a5257506301ffc9a760e01b6001600160e01b0319831614610a52565b6000612584826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126249092919063ffffffff16565b805190915015610bf857808060200190518101906125a291906132bf565b610bf85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a82565b60008261260e8584612633565b14949350505050565b610bf883838360016126a7565b6060611cc08484600085612877565b600081815b845181101561269f57600085828151811061265557612655613180565b6020026020010151905080831161267b576000838152602082905260409020925061268c565b600081815260208490526040902092505b508061269781613290565b915050612638565b509392505050565b6000546001600160a01b0385166126d057604051622e076360e81b815260040160405180910390fd5b836126ee5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b42909216919091021790558080850183801561279f57506001600160a01b0387163b15155b15612828575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46127f060008884806001019550886122ea565b61280d576040516368d2bf6b60e11b815260040160405180910390fd5b808214156127a557826000541461282357600080fd5b61286e565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415612829575b50600055611ff0565b6060824710156128d85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610a82565b6001600160a01b0385163b61292f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a82565b600080866001600160a01b0316858760405161294b91906132dc565b60006040518083038185875af1925050503d8060008114612988576040519150601f19603f3d011682016040523d82523d6000602084013e61298d565b606091505b509150915061299d8282866129a8565b979650505050505050565b606083156129b7575081611cc3565b8251156129c75782518084602001fd5b8160405162461bcd60e51b8152600401610a829190612b6b565b8280546129ed90612f93565b90600052602060002090601f016020900481019282612a0f5760008555612a55565b82601f10612a285782800160ff19823516178555612a55565b82800160010185558215612a55579182015b82811115612a55578235825591602001919060010190612a3a565b50612a61929150612a65565b5090565b5b80821115612a615760008155600101612a66565b6001600160e01b0319811681146118cd57600080fd5b600060208284031215612aa257600080fd5b8135611cc381612a7a565b6001600160a01b03811681146118cd57600080fd5b80356001600160601b0381168114612ad957600080fd5b919050565b60008060408385031215612af157600080fd5b8235612afc81612aad565b9150612b0a60208401612ac2565b90509250929050565b60005b83811015612b2e578181015183820152602001612b16565b838111156116fd5750506000910152565b60008151808452612b57816020860160208601612b13565b601f01601f19169290920160200192915050565b602081526000611cc36020830184612b3f565b600060208284031215612b9057600080fd5b5035919050565b60008060408385031215612baa57600080fd5b8235612bb581612aad565b946020939093013593505050565b600060208284031215612bd557600080fd5b8135611cc381612aad565b600080600060608486031215612bf557600080fd5b8335612c0081612aad565b92506020840135612c1081612aad565b929592945050506040919091013590565b60008060408385031215612c3457600080fd5b50508035926020909101359150565b60008060408385031215612c5657600080fd5b8235612c6181612aad565b91506020830135612c7181612aad565b809150509250929050565b80356001600160401b0381168114612ad957600080fd5b80151581146118cd57600080fd5b60008060008060608587031215612cb757600080fd5b612cc085612c7c565b93506020850135612cd081612c93565b925060408501356001600160401b0380821115612cec57600080fd5b818701915087601f830112612d0057600080fd5b813581811115612d0f57600080fd5b8860208260051b8501011115612d2457600080fd5b95989497505060200194505050565b60008060208385031215612d4657600080fd5b82356001600160401b0380821115612d5d57600080fd5b818501915085601f830112612d7157600080fd5b813581811115612d8057600080fd5b866020828501011115612d9257600080fd5b60209290920196919550909350505050565b600080600060608486031215612db957600080fd5b833592506020840135612dcb81612aad565b9150612dd960408501612ac2565b90509250925092565b60008060408385031215612df557600080fd5b8235612e0081612aad565b91506020830135612c7181612c93565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612e3c57600080fd5b8435612e4781612aad565b93506020850135612e5781612aad565b92506040850135915060608501356001600160401b0380821115612e7a57600080fd5b818701915087601f830112612e8e57600080fd5b813581811115612ea057612ea0612e10565b604051601f8201601f19908116603f01168101908382118183101715612ec857612ec8612e10565b816040528281528a6020848701011115612ee157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612f3d57634e487b7160e01b600052602160045260246000fd5b91905290565b600060208284031215612f5557600080fd5b611cc382612c7c565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680612fa757607f821691505b60208210811415612fc857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000821982111561303d5761303d613014565b500190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b60008160001904831182151516156130a7576130a7613014565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826130d1576130d16130ac565b500490565b6000602082840312156130e857600080fd5b5051919050565b60208082526026908201527f596f75206e65656420746f2073656e642070726f70657220616d6f756e74206f604082015265331032ba341760d11b606082015260800190565b6020808252602b908201527f507572636861736520776f756c6420657863656564206d617820737570706c7960408201526a1037b3103a37b5b2b7399760a91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600083516131a8818460208801612b13565b8351908301906131bc818360208801612b13565b64173539b7b760d91b9101908152600501949350505050565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b60008282101561323157613231613014565b500390565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061326990830184612b3f565b9695505050505050565b60006020828403121561328557600080fd5b8151611cc381612a7a565b60006000198214156132a4576132a4613014565b5060010190565b6000826132ba576132ba6130ac565b500690565b6000602082840312156132d157600080fd5b8151611cc381612c93565b600082516132ee818460208701612b13565b919091019291505056fea2646970667358221220335167f786e6c3b3d09d4c9b50adb8aa0dbf63692ea1c2a93189def42f9bfbab64736f6c634300080c0033
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.