ERC-721
Overview
Max Total Supply
2,780 BP
Holders
89
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
0 BPLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
BenchmarkNFT
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Base64.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract BenchmarkNFT is ERC721, Ownable { using Strings for uint256; using Base64 for bytes; uint constant public platinumMaxNumber = 1000; uint constant public goldMaxNumber = 6000; uint public startPricePlatinum = 46629e13; //0.46629 uint public startPriceGold = 9326e13; //0.09326 uint public perPeriodAddPricePlatinum = 2742e13; //0.02742 uint public perPeriodAddPriceGold = 548e13; //0.00548 uint public periodPlatinum = 100; uint public periodGold = 500; uint public maxBuy = 30; address public treasuryAddress; uint public platinumCounter = 0;//1-1000 uint public goldCounter = 1000;//1001-6000 string public baseURI = ""; mapping(uint => string) public description; mapping(uint => string) public image; event Buy(address sender, uint256 quantity, uint256 level,string coupon); constructor() ERC721("Benchmark Pass", "BP") { treasuryAddress = 0x5650c7939A14E1321AA11d97a236161Ab31aCB36; } function setMetadata(uint256 level, string memory _description, string memory _image) public onlyOwner { description[level] = _description; image[level] = _image; } function setBaseURI(string calldata _baseURIPrefix) external onlyOwner { baseURI = _baseURIPrefix; } function _baseURI() internal view override returns (string memory) { return baseURI; } function buy(uint256 quantity, uint256 level) external payable { require(level <= 1, 'invalid level'); uint payAmount = getPrice(level, quantity); require(msg.value >= payAmount, 'Insufficient payment amount'); (bool ret,) = treasuryAddress.call{value : payAmount}(''); require(ret, 'Address: unable to send value, recipient may have reverted'); if (msg.value > payAmount) { uint refund = msg.value - payAmount; (bool success,) = msg.sender.call{value : refund}(''); require(success, 'Address: unable to send value, recipient may have reverted'); } _mintTo(msg.sender, quantity, level); } function _mintTo(address to, uint quantity, uint level) private { if (level == 1) { uint startTokenId = goldCounter; require(startTokenId + quantity <= goldMaxNumber, 'max gold supply'); for (uint i = 0; i < quantity; ++i) { ++startTokenId; _mint(to, startTokenId); } goldCounter = startTokenId; } else { uint startTokenId = platinumCounter; require(startTokenId + quantity <= platinumMaxNumber, 'max platinum supply'); for (uint i = 0; i < quantity; ++i) { ++startTokenId; _mint(to, startTokenId); } platinumCounter = startTokenId; } } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (bytes(baseURI).length > 0) { return super.tokenURI(tokenId); } else { _requireMinted(tokenId); uint level = 0; string memory trait_type_level = 'platinum'; if (tokenId > platinumMaxNumber) { level = 1; trait_type_level = 'gold'; } string memory metadata = string(abi.encodePacked( "{", "\"tokenId\":\"", tokenId.toString(), "\",", "\"name\":\"", name(), "\",", "\"image\":\"", image[level], "\",", "\"description\":\"", description[level], "\",", "\"attributes\":[{\"trait_type\":\"level\",\"value\":\"", trait_type_level, "\"}]", "}" )); return string(abi.encodePacked( "data:application/json;base64,", bytes(metadata).encode() )); } } function tokensOfOwnerIn(address owner, uint256 start, uint256 stop) external view returns (uint256[] memory) { require(start < stop, 'InvalidQueryRange'); if (start < 1) { start = 1; } uint256 maxTokenId = goldMaxNumber; if (stop > maxTokenId) { stop = maxTokenId; } uint256 ownerTokenCount = balanceOf(owner); if (start < stop) { uint256 rangeLength = stop - start + 1; if (rangeLength < ownerTokenCount) { ownerTokenCount = rangeLength; } } else { ownerTokenCount = 0; } uint256[] memory ownedTokenIds = new uint256[](ownerTokenCount); uint256 currentTokenId = start; uint256 ownedTokenIndex = 0; while (ownedTokenIndex < ownerTokenCount && currentTokenId <= stop) { address currentTokenOwner = _ownerOf(currentTokenId); if (currentTokenOwner == owner) { ownedTokenIds[ownedTokenIndex++] = currentTokenId; } currentTokenId++; } // Downsize the array to fit. assembly { mstore(ownedTokenIds, ownedTokenIndex) } return ownedTokenIds; } function tokensOfOwner(address owner) public view returns (uint256[] memory){ uint256 ownerTokenCount = balanceOf(owner); uint256[] memory ownedTokenIds = new uint256[](ownerTokenCount); uint256 currentTokenId = 1; uint256 ownedTokenIndex = 0; uint256 maxTokenId = goldMaxNumber; while (ownedTokenIndex < ownerTokenCount && currentTokenId <= maxTokenId) { address currentTokenOwner = _ownerOf(currentTokenId); if (currentTokenOwner == owner) { ownedTokenIds[ownedTokenIndex++] = currentTokenId; } currentTokenId++; } return ownedTokenIds; } function totalSupply() public view returns (uint256) { return platinumCounter + goldCounter - platinumMaxNumber; } function getCurrentPeriod(uint256 level) public view returns (uint256) { if (level == 1) { return (goldCounter - platinumMaxNumber) / periodGold; } else { return platinumCounter / periodPlatinum; } } function getPrice(uint level, uint quantity) public view returns (uint256) { require(quantity <= maxBuy, 'invalid quantity'); uint currentPeriod = getCurrentPeriod(level); if (level == 1) { uint currentPrice = startPriceGold + currentPeriod * perPeriodAddPriceGold; uint nextPrice = currentPrice + perPeriodAddPriceGold; uint currentPeriodEndQuantity = (currentPeriod + 1) * periodGold; uint goldMint = goldCounter - platinumMaxNumber; if (goldMint + quantity <= currentPeriodEndQuantity) { return quantity * currentPrice; } else { uint num1 = currentPeriodEndQuantity - goldMint; uint num2 = quantity - num1; return num1 * currentPrice + num2 * nextPrice; } } else { uint currentPrice = startPricePlatinum + currentPeriod * perPeriodAddPricePlatinum; uint nextPrice = currentPrice + perPeriodAddPricePlatinum; uint currentPeriodEndQuantity = (currentPeriod + 1) * periodPlatinum; if (platinumCounter + quantity <= currentPeriodEndQuantity) { return quantity * currentPrice; } else { uint num1 = currentPeriodEndQuantity - platinumCounter; uint num2 = quantity - num1; return num1 * currentPrice + num2 * nextPrice; } } } function getBuyInfo() public view returns ( uint256 platinumMint, uint256 platinumMax, uint256 platinumPrice, uint256 platinumPerAddPrice, uint256 platinumPeriodNum, uint256 goldMint, uint256 goldMax, uint256 goldPrice, uint256 goldPerAddPrice, uint256 goldPeriodNum ) { platinumMint = platinumCounter; platinumMax = platinumMaxNumber; platinumPrice = getPrice(0, 1); platinumPerAddPrice = perPeriodAddPricePlatinum; goldMax = goldMaxNumber - platinumMaxNumber; goldMint = goldCounter - platinumMaxNumber; goldPrice = getPrice(1, 1); goldPerAddPrice = perPeriodAddPriceGold; uint periodNoPlatinum = getCurrentPeriod(0); uint periodNoGold = getCurrentPeriod(1); uint currentPeriodEndQuantityPlatinum = (periodNoPlatinum + 1) * periodPlatinum; uint currentPeriodEndQuantityGold = (periodNoGold + 1) * periodGold; platinumPeriodNum = currentPeriodEndQuantityPlatinum - platinumMint; goldPeriodNum = currentPeriodEndQuantityGold - goldMint; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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.9.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such * that `ownerOf(tokenId)` is `a`. */ // solhint-disable-next-line func-name-mixedcase function __unsafe_increaseBalance(address account, uint256 amount) internal { _balances[account] += amount; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [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://consensys.net/diligence/blog/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.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol) pragma solidity ^0.8.0; /** * @dev Provides a set of functions to operate with Base64 strings. * * _Available since v4.5._ */ library Base64 { /** * @dev Base64 Encoding/Decoding Table */ string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * @dev Converts a `bytes` to its Bytes64 `string` representation. */ function encode(bytes memory data) internal pure returns (string memory) { /** * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol */ if (data.length == 0) return ""; // Loads the table into memory string memory table = _TABLE; // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter // and split into 4 numbers of 6 bits. // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up // - `data.length + 2` -> Round up // - `/ 3` -> Number of 3-bytes chunks // - `4 *` -> 4 characters for each chunk string memory result = new string(4 * ((data.length + 2) / 3)); /// @solidity memory-safe-assembly assembly { // Prepare the lookup table (skip the first "length" byte) let tablePtr := add(table, 1) // Prepare result pointer, jump over length let resultPtr := add(result, 32) // Run over the input, 3 bytes at a time for { let dataPtr := data let endPtr := add(data, mload(data)) } lt(dataPtr, endPtr) { } { // Advance 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // To write each character, shift the 3 bytes (18 bits) chunk // 4 times in blocks of 6 bits for each character (18, 12, 6, 0) // and apply logical AND with 0x3F which is the number of // the previous character in the ASCII table prior to the Base64 Table // The result is then added to the table to get the character to write, // and finally write it in the result pointer but with a left shift // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F)))) resultPtr := add(resultPtr, 1) // Advance } // When data `bytes` is not exactly 3 bytes long // it is padded with `=` characters at the end switch mod(mload(data), 3) case 1 { mstore8(sub(resultPtr, 1), 0x3d) mstore8(sub(resultPtr, 2), 0x3d) } case 2 { mstore8(sub(resultPtr, 1), 0x3d) } } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ 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 Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { require(proofPos == proofLen, "MerkleProof: invalid multiproof"); unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { require(proofPos == proofLen, "MerkleProof: invalid multiproof"); unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"level","type":"uint256"},{"indexed":false,"internalType":"string","name":"coupon","type":"string"}],"name":"Buy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"level","type":"uint256"}],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBuyInfo","outputs":[{"internalType":"uint256","name":"platinumMint","type":"uint256"},{"internalType":"uint256","name":"platinumMax","type":"uint256"},{"internalType":"uint256","name":"platinumPrice","type":"uint256"},{"internalType":"uint256","name":"platinumPerAddPrice","type":"uint256"},{"internalType":"uint256","name":"platinumPeriodNum","type":"uint256"},{"internalType":"uint256","name":"goldMint","type":"uint256"},{"internalType":"uint256","name":"goldMax","type":"uint256"},{"internalType":"uint256","name":"goldPrice","type":"uint256"},{"internalType":"uint256","name":"goldPerAddPrice","type":"uint256"},{"internalType":"uint256","name":"goldPeriodNum","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"getCurrentPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"goldCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"goldMaxNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"image","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"maxBuy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"perPeriodAddPriceGold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"perPeriodAddPricePlatinum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodGold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodPlatinum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platinumCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platinumMaxNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURIPrefix","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"},{"internalType":"string","name":"_description","type":"string"},{"internalType":"string","name":"_image","type":"string"}],"name":"setMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startPriceGold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startPricePlatinum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","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"},{"inputs":[],"name":"treasuryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6706789848d451200060075567014b5379d3c0c00060085566616a583fbdc00060095566137807ed5e8000600a556064600b556101f4600c55601e600d556000600f8190556103e860105560a0604052608090815260119062000063908262000218565b503480156200007157600080fd5b506040518060400160405280600e81526020016d42656e63686d61726b205061737360901b81525060405180604001604052806002815260200161042560f41b8152508160009081620000c5919062000218565b506001620000d4828262000218565b505050620000f1620000eb6200011d60201b60201c565b62000121565b600e80546001600160a01b031916735650c7939a14e1321aa11d97a236161ab31acb36179055620002e4565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200019e57607f821691505b602082108103620001bf57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200021357600081815260208120601f850160051c81016020861015620001ee5750805b601f850160051c820191505b818110156200020f57828155600101620001fa565b5050505b505050565b81516001600160401b0381111562000234576200023462000173565b6200024c8162000245845462000189565b84620001c5565b602080601f8311600181146200028457600084156200026b5750858301515b600019600386901b1c1916600185901b1785556200020f565b600085815260208120601f198616915b82811015620002b55788860151825594840194600190910190840162000294565b5085821015620002d45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b612b3c80620002f46000396000f3fe60806040526004361061023b5760003560e01c80638462151c1161012e578063bf15b558116100ab578063d6febde81161006f578063d6febde8146106a3578063ddb2139d146106b6578063ddc1044a146106cc578063e985e9c5146106e2578063f2fde38b1461072b57600080fd5b8063bf15b55814610617578063c176fe211461062d578063c5f956af14610643578063c79178c614610663578063c87b56dd1461068357600080fd5b806399a2557a116100f257806399a2557a1461058b578063a090b493146105ab578063a22cb465146105c1578063af3f44fa146105e1578063b88d4fde146105f757600080fd5b80638462151c146104ff57806385b404e81461052c5780638da5cb5b146105425780639135fdb91461056057806395d89b411461057657600080fd5b80633008dba9116101bc5780636352211e116101805780636352211e1461047f5780636c0360eb1461049f57806370a08231146104b457806370db69d6146104d4578063715018a6146104ea57600080fd5b80633008dba9146103e957806342842e0e146103ff57806355f804b31461041f57806359f9f50f1461043f5780635cf4ee911461045f57600080fd5b806318160ddd1161020357806318160ddd146103155780631aa7c1ce1461032a57806322684db01461038957806323b872dd146103a95780632c5f13e0146103c957600080fd5b806301ffc9a71461024057806306fdde0314610275578063081812fc14610297578063095ea7b3146102cf5780630e462ef8146102f1575b600080fd5b34801561024c57600080fd5b5061026061025b366004611ffb565b61074b565b60405190151581526020015b60405180910390f35b34801561028157600080fd5b5061028a61079d565b60405161026c9190612068565b3480156102a357600080fd5b506102b76102b236600461207b565b61082f565b6040516001600160a01b03909116815260200161026c565b3480156102db57600080fd5b506102ef6102ea3660046120ab565b610856565b005b3480156102fd57600080fd5b50610307600c5481565b60405190815260200161026c565b34801561032157600080fd5b50610307610970565b34801561033657600080fd5b5061033f610994565b604080519a8b5260208b0199909952978901969096526060880194909452608087019290925260a086015260c085015260e08401526101008301526101208201526101400161026c565b34801561039557600080fd5b506103076103a436600461207b565b610a6a565b3480156103b557600080fd5b506102ef6103c43660046120d5565b610aa6565b3480156103d557600080fd5b5061028a6103e436600461207b565b610ad7565b3480156103f557600080fd5b5061030760095481565b34801561040b57600080fd5b506102ef61041a3660046120d5565b610b71565b34801561042b57600080fd5b506102ef61043a366004612111565b610b8c565b34801561044b57600080fd5b506102ef61045a36600461222f565b610ba1565b34801561046b57600080fd5b5061030761047a36600461229c565b610be0565b34801561048b57600080fd5b506102b761049a36600461207b565b610dda565b3480156104ab57600080fd5b5061028a610e3a565b3480156104c057600080fd5b506103076104cf3660046122be565b610e47565b3480156104e057600080fd5b50610307600d5481565b3480156104f657600080fd5b506102ef610ecd565b34801561050b57600080fd5b5061051f61051a3660046122be565b610ee1565b60405161026c91906122d9565b34801561053857600080fd5b5061030760085481565b34801561054e57600080fd5b506006546001600160a01b03166102b7565b34801561056c57600080fd5b5061030760075481565b34801561058257600080fd5b5061028a610fbf565b34801561059757600080fd5b5061051f6105a636600461231d565b610fce565b3480156105b757600080fd5b50610307600f5481565b3480156105cd57600080fd5b506102ef6105dc366004612350565b611141565b3480156105ed57600080fd5b5061030761177081565b34801561060357600080fd5b506102ef61061236600461238c565b611150565b34801561062357600080fd5b506103076103e881565b34801561063957600080fd5b50610307600a5481565b34801561064f57600080fd5b50600e546102b7906001600160a01b031681565b34801561066f57600080fd5b5061028a61067e36600461207b565b611182565b34801561068f57600080fd5b5061028a61069e36600461207b565b61119b565b6102ef6106b136600461229c565b611293565b3480156106c257600080fd5b5061030760105481565b3480156106d857600080fd5b50610307600b5481565b3480156106ee57600080fd5b506102606106fd366004612408565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561073757600080fd5b506102ef6107463660046122be565b611432565b60006001600160e01b031982166380ac58cd60e01b148061077c57506001600160e01b03198216635b5e139f60e01b145b8061079757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546107ac9061243b565b80601f01602080910402602001604051908101604052809291908181526020018280546107d89061243b565b80156108255780601f106107fa57610100808354040283529160200191610825565b820191906000526020600020905b81548152906001019060200180831161080857829003601f168201915b5050505050905090565b600061083a826114ab565b506000908152600460205260409020546001600160a01b031690565b600061086182610dda565b9050806001600160a01b0316836001600160a01b0316036108d35760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806108ef57506108ef81336106fd565b6109615760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016108ca565b61096b838361150a565b505050565b60006103e8601054600f54610985919061248b565b61098f919061249e565b905090565b600f546103e86000808080808080806109ae816001610be0565b60095490985096506109c46103e861177061249e565b93506103e86010546109d6919061249e565b94506109e3600180610be0565b9250600a54915060006109f66000610a6a565b90506000610a046001610a6a565b90506000600b54836001610a18919061248b565b610a2291906124b1565b90506000600c54836001610a36919061248b565b610a4091906124b1565b9050610a4c8e8361249e565b9950610a58898261249e565b94505050505090919293949596979899565b600081600103610a9157600c546103e8601054610a87919061249e565b61079791906124c8565b600b54600f5461079791906124c8565b919050565b610ab03382611578565b610acc5760405162461bcd60e51b81526004016108ca906124ea565b61096b8383836115f7565b60126020526000908152604090208054610af09061243b565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1c9061243b565b8015610b695780601f10610b3e57610100808354040283529160200191610b69565b820191906000526020600020905b815481529060010190602001808311610b4c57829003601f168201915b505050505081565b61096b83838360405180602001604052806000815250611150565b610b9461175b565b601161096b828483612585565b610ba961175b565b6000838152601260205260409020610bc18382612646565b506000838152601360205260409020610bda8282612646565b50505050565b6000600d54821115610c275760405162461bcd60e51b815260206004820152601060248201526f696e76616c6964207175616e7469747960801b60448201526064016108ca565b6000610c3284610a6a565b905083600103610d0d576000600a5482610c4c91906124b1565b600854610c59919061248b565b90506000600a5482610c6b919061248b565b90506000600c54846001610c7f919061248b565b610c8991906124b1565b905060006103e8601054610c9d919061249e565b905081610caa888361248b565b11610cc557610cb984886124b1565b95505050505050610797565b6000610cd1828461249e565b90506000610cdf828a61249e565b9050610ceb85826124b1565b610cf587846124b1565b610cff919061248b565b975050505050505050610797565b600060095482610d1d91906124b1565b600754610d2a919061248b565b9050600060095482610d3c919061248b565b90506000600b54846001610d50919061248b565b610d5a91906124b1565b90508086600f54610d6b919061248b565b11610d8557610d7a83876124b1565b945050505050610797565b6000600f5482610d95919061249e565b90506000610da3828961249e565b9050610daf84826124b1565b610db986846124b1565b610dc3919061248b565b9650505050505050610797565b5050505092915050565b6000818152600260205260408120546001600160a01b0316806107975760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016108ca565b60118054610af09061243b565b60006001600160a01b038216610eb15760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016108ca565b506001600160a01b031660009081526003602052604090205490565b610ed561175b565b610edf60006117b5565b565b60606000610eee83610e47565b905060008167ffffffffffffffff811115610f0b57610f0b612183565b604051908082528060200260200182016040528015610f34578160200160208202803683370190505b509050600160006117705b8482108015610f4e5750808311155b15610fb4576000838152600260205260409020546001600160a01b039081169088168103610fa157838584610f8281612706565b955081518110610f9457610f9461271f565b6020026020010181815250505b83610fab81612706565b94505050610f3f565b509195945050505050565b6060600180546107ac9061243b565b60608183106110135760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964517565727952616e676560781b60448201526064016108ca565b600183101561102157600192505b61177080831115611030578092505b600061103b86610e47565b905083851015611070576000611051868661249e565b61105c90600161248b565b90508181101561106a578091505b50611074565b5060005b60008167ffffffffffffffff81111561108f5761108f612183565b6040519080825280602002602001820160405280156110b8578160200160208202803683370190505b5090508560005b83811080156110ce5750868211155b15611134576000828152600260205260409020546001600160a01b03908116908a1681036111215782848361110281612706565b9450815181106111145761111461271f565b6020026020010181815250505b8261112b81612706565b935050506110bf565b8252509695505050505050565b61114c338383611807565b5050565b61115a3383611578565b6111765760405162461bcd60e51b81526004016108ca906124ea565b610bda848484846118d5565b60136020526000908152604090208054610af09061243b565b60606000601180546111ac9061243b565b905011156111bd5761079782611908565b6111c6826114ab565b604080518082019091526008815267706c6174696e756d60c01b60208201526000906103e884111561121357505060408051808201909152600481526319dbdb1960e21b60208201526001905b600061121e8561196f565b61122661079d565b600085815260136020908152604080832060128352928190209051611250959493928891016127c1565b604051602081830303815290604052905061126a81611a02565b60405160200161127a9190612904565b6040516020818303038152906040529350505050919050565b60018111156112d45760405162461bcd60e51b815260206004820152600d60248201526c1a5b9d985b1a59081b195d995b609a1b60448201526064016108ca565b60006112e08284610be0565b9050803410156113325760405162461bcd60e51b815260206004820152601b60248201527f496e73756666696369656e74207061796d656e7420616d6f756e74000000000060448201526064016108ca565b600e546040516000916001600160a01b03169083908381818185875af1925050503d806000811461137f576040519150601f19603f3d011682016040523d82523d6000602084013e611384565b606091505b50509050806113a55760405162461bcd60e51b81526004016108ca90612949565b813411156114275760006113b9833461249e565b604051909150600090339083908381818185875af1925050503d80600081146113fe576040519150601f19603f3d011682016040523d82523d6000602084013e611403565b606091505b50509050806114245760405162461bcd60e51b81526004016108ca90612949565b50505b610bda338585611b54565b61143a61175b565b6001600160a01b03811661149f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108ca565b6114a8816117b5565b50565b6000818152600260205260409020546001600160a01b03166114a85760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016108ca565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061153f82610dda565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061158483610dda565b9050806001600160a01b0316846001600160a01b031614806115cb57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806115ef5750836001600160a01b03166115e48461082f565b6001600160a01b0316145b949350505050565b826001600160a01b031661160a82610dda565b6001600160a01b0316146116305760405162461bcd60e51b81526004016108ca906129a6565b6001600160a01b0382166116925760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016108ca565b826001600160a01b03166116a582610dda565b6001600160a01b0316146116cb5760405162461bcd60e51b81526004016108ca906129a6565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6006546001600160a01b03163314610edf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108ca565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036118685760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108ca565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6118e08484846115f7565b6118ec84848484611c72565b610bda5760405162461bcd60e51b81526004016108ca906129eb565b6060611913826114ab565b600061191d611d73565b9050600081511161193d5760405180602001604052806000815250611968565b806119478461196f565b604051602001611958929190612a3d565b6040516020818303038152906040525b9392505050565b6060600061197c83611d82565b600101905060008167ffffffffffffffff81111561199c5761199c612183565b6040519080825280601f01601f1916602001820160405280156119c6576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846119d057509392505050565b60608151600003611a2157505060408051602081019091526000815290565b6000604051806060016040528060408152602001612ac76040913990506000600384516002611a50919061248b565b611a5a91906124c8565b611a659060046124b1565b67ffffffffffffffff811115611a7d57611a7d612183565b6040519080825280601f01601f191660200182016040528015611aa7576020820181803683370190505b509050600182016020820185865187015b80821015611b13576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250611ab8565b5050600386510660018114611b2f5760028114611b4257610fb4565b603d6001830353603d6002830353610fb4565b603d6001830353509195945050505050565b80600103611be557601054611770611b6c848361248b565b1115611bac5760405162461bcd60e51b815260206004820152600f60248201526e6d617820676f6c6420737570706c7960881b60448201526064016108ca565b60005b83811015611bdc57611bc082612706565b9150611bcc8583611e5a565b611bd581612706565b9050611baf565b50601055505050565b600f546103e8611bf5848361248b565b1115611c395760405162461bcd60e51b81526020600482015260136024820152726d617820706c6174696e756d20737570706c7960681b60448201526064016108ca565b60005b83811015611c6957611c4d82612706565b9150611c598583611e5a565b611c6281612706565b9050611c3c565b50600f55505050565b60006001600160a01b0384163b15611d6857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611cb6903390899088908890600401612a6c565b6020604051808303816000875af1925050508015611cf1575060408051601f3d908101601f19168201909252611cee91810190612aa9565b60015b611d4e573d808015611d1f576040519150601f19603f3d011682016040523d82523d6000602084013e611d24565b606091505b508051600003611d465760405162461bcd60e51b81526004016108ca906129eb565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506115ef565b506001949350505050565b6060601180546107ac9061243b565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611dc15772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611ded576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611e0b57662386f26fc10000830492506010015b6305f5e1008310611e23576305f5e100830492506008015b6127108310611e3757612710830492506004015b60648310611e49576064830492506002015b600a83106107975760010192915050565b6001600160a01b038216611eb05760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108ca565b6000818152600260205260409020546001600160a01b031615611f155760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108ca565b6000818152600260205260409020546001600160a01b031615611f7a5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108ca565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b0319811681146114a857600080fd5b60006020828403121561200d57600080fd5b813561196881611fe5565b60005b8381101561203357818101518382015260200161201b565b50506000910152565b60008151808452612054816020860160208601612018565b601f01601f19169290920160200192915050565b602081526000611968602083018461203c565b60006020828403121561208d57600080fd5b5035919050565b80356001600160a01b0381168114610aa157600080fd5b600080604083850312156120be57600080fd5b6120c783612094565b946020939093013593505050565b6000806000606084860312156120ea57600080fd5b6120f384612094565b925061210160208501612094565b9150604084013590509250925092565b6000806020838503121561212457600080fd5b823567ffffffffffffffff8082111561213c57600080fd5b818501915085601f83011261215057600080fd5b81358181111561215f57600080fd5b86602082850101111561217157600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156121b4576121b4612183565b604051601f8501601f19908116603f011681019082821181831017156121dc576121dc612183565b816040528093508581528686860111156121f557600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261222057600080fd5b61196883833560208501612199565b60008060006060848603121561224457600080fd5b83359250602084013567ffffffffffffffff8082111561226357600080fd5b61226f8783880161220f565b9350604086013591508082111561228557600080fd5b506122928682870161220f565b9150509250925092565b600080604083850312156122af57600080fd5b50508035926020909101359150565b6000602082840312156122d057600080fd5b61196882612094565b6020808252825182820181905260009190848201906040850190845b81811015612311578351835292840192918401916001016122f5565b50909695505050505050565b60008060006060848603121561233257600080fd5b61233b84612094565b95602085013595506040909401359392505050565b6000806040838503121561236357600080fd5b61236c83612094565b91506020830135801515811461238157600080fd5b809150509250929050565b600080600080608085870312156123a257600080fd5b6123ab85612094565b93506123b960208601612094565b925060408501359150606085013567ffffffffffffffff8111156123dc57600080fd5b8501601f810187136123ed57600080fd5b6123fc87823560208401612199565b91505092959194509250565b6000806040838503121561241b57600080fd5b61242483612094565b915061243260208401612094565b90509250929050565b600181811c9082168061244f57607f821691505b60208210810361246f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561079757610797612475565b8181038181111561079757610797612475565b808202811582820484141761079757610797612475565b6000826124e557634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b601f82111561096b57600081815260208120601f850160051c8101602086101561255e5750805b601f850160051c820191505b8181101561257d5782815560010161256a565b505050505050565b67ffffffffffffffff83111561259d5761259d612183565b6125b1836125ab835461243b565b83612537565b6000601f8411600181146125e557600085156125cd5750838201355b600019600387901b1c1916600186901b17835561263f565b600083815260209020601f19861690835b8281101561261657868501358255602094850194600190920191016125f6565b50868210156126335760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b815167ffffffffffffffff81111561266057612660612183565b6126748161266e845461243b565b84612537565b602080601f8311600181146126a957600084156126915750858301515b600019600386901b1c1916600185901b17855561257d565b600085815260208120601f198616915b828110156126d8578886015182559484019460019091019084016126b9565b50858210156126f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001820161271857612718612475565b5060010190565b634e487b7160e01b600052603260045260246000fd5b60008151612747818560208601612018565b9290920192915050565b6000815461275e8161243b565b60018281168015612776576001811461278b57610dd0565b60ff1984168752821515830287019450610dd0565b8560005260208060002060005b858110156127b15781548a820152908401908201612798565b5050509590910195945050505050565b607b60f81b81526a113a37b5b2b724b2111d1160a91b600182015285516000906127f281600c850160208b01612018565b61088b60f21b600c91840191820181905267113730b6b2911d1160c11b600e8301528751612827816016850160208c01612018565b60169201918201819052681134b6b0b3b2911d1160b91b60188301526128506021830188612751565b9081526e113232b9b1b934b83a34b7b7111d1160891b600282015290506128f86128eb6128dc6128d6612897612889601187018b612751565b61088b60f21b815260020190565b7f2261747472696275746573223a5b7b2274726169745f74797065223a226c657681526c32b61116113b30b63ab2911d1160991b6020820152602d0190565b87612735565b62227d5d60e81b815260030190565b607d60f81b815260010190565b98975050505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161293c81601d850160208701612018565b91909101601d0192915050565b6020808252603a908201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260408201527f6563697069656e74206d61792068617665207265766572746564000000000000606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008351612a4f818460208801612018565b835190830190612a63818360208801612018565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612a9f9083018461203c565b9695505050505050565b600060208284031215612abb57600080fd5b815161196881611fe556fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212200718f1387a995d69758d29b7ffef5a11f7cfe2ee518f551b67a98e0c994afd7664736f6c63430008140033
Deployed Bytecode
0x60806040526004361061023b5760003560e01c80638462151c1161012e578063bf15b558116100ab578063d6febde81161006f578063d6febde8146106a3578063ddb2139d146106b6578063ddc1044a146106cc578063e985e9c5146106e2578063f2fde38b1461072b57600080fd5b8063bf15b55814610617578063c176fe211461062d578063c5f956af14610643578063c79178c614610663578063c87b56dd1461068357600080fd5b806399a2557a116100f257806399a2557a1461058b578063a090b493146105ab578063a22cb465146105c1578063af3f44fa146105e1578063b88d4fde146105f757600080fd5b80638462151c146104ff57806385b404e81461052c5780638da5cb5b146105425780639135fdb91461056057806395d89b411461057657600080fd5b80633008dba9116101bc5780636352211e116101805780636352211e1461047f5780636c0360eb1461049f57806370a08231146104b457806370db69d6146104d4578063715018a6146104ea57600080fd5b80633008dba9146103e957806342842e0e146103ff57806355f804b31461041f57806359f9f50f1461043f5780635cf4ee911461045f57600080fd5b806318160ddd1161020357806318160ddd146103155780631aa7c1ce1461032a57806322684db01461038957806323b872dd146103a95780632c5f13e0146103c957600080fd5b806301ffc9a71461024057806306fdde0314610275578063081812fc14610297578063095ea7b3146102cf5780630e462ef8146102f1575b600080fd5b34801561024c57600080fd5b5061026061025b366004611ffb565b61074b565b60405190151581526020015b60405180910390f35b34801561028157600080fd5b5061028a61079d565b60405161026c9190612068565b3480156102a357600080fd5b506102b76102b236600461207b565b61082f565b6040516001600160a01b03909116815260200161026c565b3480156102db57600080fd5b506102ef6102ea3660046120ab565b610856565b005b3480156102fd57600080fd5b50610307600c5481565b60405190815260200161026c565b34801561032157600080fd5b50610307610970565b34801561033657600080fd5b5061033f610994565b604080519a8b5260208b0199909952978901969096526060880194909452608087019290925260a086015260c085015260e08401526101008301526101208201526101400161026c565b34801561039557600080fd5b506103076103a436600461207b565b610a6a565b3480156103b557600080fd5b506102ef6103c43660046120d5565b610aa6565b3480156103d557600080fd5b5061028a6103e436600461207b565b610ad7565b3480156103f557600080fd5b5061030760095481565b34801561040b57600080fd5b506102ef61041a3660046120d5565b610b71565b34801561042b57600080fd5b506102ef61043a366004612111565b610b8c565b34801561044b57600080fd5b506102ef61045a36600461222f565b610ba1565b34801561046b57600080fd5b5061030761047a36600461229c565b610be0565b34801561048b57600080fd5b506102b761049a36600461207b565b610dda565b3480156104ab57600080fd5b5061028a610e3a565b3480156104c057600080fd5b506103076104cf3660046122be565b610e47565b3480156104e057600080fd5b50610307600d5481565b3480156104f657600080fd5b506102ef610ecd565b34801561050b57600080fd5b5061051f61051a3660046122be565b610ee1565b60405161026c91906122d9565b34801561053857600080fd5b5061030760085481565b34801561054e57600080fd5b506006546001600160a01b03166102b7565b34801561056c57600080fd5b5061030760075481565b34801561058257600080fd5b5061028a610fbf565b34801561059757600080fd5b5061051f6105a636600461231d565b610fce565b3480156105b757600080fd5b50610307600f5481565b3480156105cd57600080fd5b506102ef6105dc366004612350565b611141565b3480156105ed57600080fd5b5061030761177081565b34801561060357600080fd5b506102ef61061236600461238c565b611150565b34801561062357600080fd5b506103076103e881565b34801561063957600080fd5b50610307600a5481565b34801561064f57600080fd5b50600e546102b7906001600160a01b031681565b34801561066f57600080fd5b5061028a61067e36600461207b565b611182565b34801561068f57600080fd5b5061028a61069e36600461207b565b61119b565b6102ef6106b136600461229c565b611293565b3480156106c257600080fd5b5061030760105481565b3480156106d857600080fd5b50610307600b5481565b3480156106ee57600080fd5b506102606106fd366004612408565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561073757600080fd5b506102ef6107463660046122be565b611432565b60006001600160e01b031982166380ac58cd60e01b148061077c57506001600160e01b03198216635b5e139f60e01b145b8061079757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546107ac9061243b565b80601f01602080910402602001604051908101604052809291908181526020018280546107d89061243b565b80156108255780601f106107fa57610100808354040283529160200191610825565b820191906000526020600020905b81548152906001019060200180831161080857829003601f168201915b5050505050905090565b600061083a826114ab565b506000908152600460205260409020546001600160a01b031690565b600061086182610dda565b9050806001600160a01b0316836001600160a01b0316036108d35760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806108ef57506108ef81336106fd565b6109615760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016108ca565b61096b838361150a565b505050565b60006103e8601054600f54610985919061248b565b61098f919061249e565b905090565b600f546103e86000808080808080806109ae816001610be0565b60095490985096506109c46103e861177061249e565b93506103e86010546109d6919061249e565b94506109e3600180610be0565b9250600a54915060006109f66000610a6a565b90506000610a046001610a6a565b90506000600b54836001610a18919061248b565b610a2291906124b1565b90506000600c54836001610a36919061248b565b610a4091906124b1565b9050610a4c8e8361249e565b9950610a58898261249e565b94505050505090919293949596979899565b600081600103610a9157600c546103e8601054610a87919061249e565b61079791906124c8565b600b54600f5461079791906124c8565b919050565b610ab03382611578565b610acc5760405162461bcd60e51b81526004016108ca906124ea565b61096b8383836115f7565b60126020526000908152604090208054610af09061243b565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1c9061243b565b8015610b695780601f10610b3e57610100808354040283529160200191610b69565b820191906000526020600020905b815481529060010190602001808311610b4c57829003601f168201915b505050505081565b61096b83838360405180602001604052806000815250611150565b610b9461175b565b601161096b828483612585565b610ba961175b565b6000838152601260205260409020610bc18382612646565b506000838152601360205260409020610bda8282612646565b50505050565b6000600d54821115610c275760405162461bcd60e51b815260206004820152601060248201526f696e76616c6964207175616e7469747960801b60448201526064016108ca565b6000610c3284610a6a565b905083600103610d0d576000600a5482610c4c91906124b1565b600854610c59919061248b565b90506000600a5482610c6b919061248b565b90506000600c54846001610c7f919061248b565b610c8991906124b1565b905060006103e8601054610c9d919061249e565b905081610caa888361248b565b11610cc557610cb984886124b1565b95505050505050610797565b6000610cd1828461249e565b90506000610cdf828a61249e565b9050610ceb85826124b1565b610cf587846124b1565b610cff919061248b565b975050505050505050610797565b600060095482610d1d91906124b1565b600754610d2a919061248b565b9050600060095482610d3c919061248b565b90506000600b54846001610d50919061248b565b610d5a91906124b1565b90508086600f54610d6b919061248b565b11610d8557610d7a83876124b1565b945050505050610797565b6000600f5482610d95919061249e565b90506000610da3828961249e565b9050610daf84826124b1565b610db986846124b1565b610dc3919061248b565b9650505050505050610797565b5050505092915050565b6000818152600260205260408120546001600160a01b0316806107975760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016108ca565b60118054610af09061243b565b60006001600160a01b038216610eb15760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016108ca565b506001600160a01b031660009081526003602052604090205490565b610ed561175b565b610edf60006117b5565b565b60606000610eee83610e47565b905060008167ffffffffffffffff811115610f0b57610f0b612183565b604051908082528060200260200182016040528015610f34578160200160208202803683370190505b509050600160006117705b8482108015610f4e5750808311155b15610fb4576000838152600260205260409020546001600160a01b039081169088168103610fa157838584610f8281612706565b955081518110610f9457610f9461271f565b6020026020010181815250505b83610fab81612706565b94505050610f3f565b509195945050505050565b6060600180546107ac9061243b565b60608183106110135760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964517565727952616e676560781b60448201526064016108ca565b600183101561102157600192505b61177080831115611030578092505b600061103b86610e47565b905083851015611070576000611051868661249e565b61105c90600161248b565b90508181101561106a578091505b50611074565b5060005b60008167ffffffffffffffff81111561108f5761108f612183565b6040519080825280602002602001820160405280156110b8578160200160208202803683370190505b5090508560005b83811080156110ce5750868211155b15611134576000828152600260205260409020546001600160a01b03908116908a1681036111215782848361110281612706565b9450815181106111145761111461271f565b6020026020010181815250505b8261112b81612706565b935050506110bf565b8252509695505050505050565b61114c338383611807565b5050565b61115a3383611578565b6111765760405162461bcd60e51b81526004016108ca906124ea565b610bda848484846118d5565b60136020526000908152604090208054610af09061243b565b60606000601180546111ac9061243b565b905011156111bd5761079782611908565b6111c6826114ab565b604080518082019091526008815267706c6174696e756d60c01b60208201526000906103e884111561121357505060408051808201909152600481526319dbdb1960e21b60208201526001905b600061121e8561196f565b61122661079d565b600085815260136020908152604080832060128352928190209051611250959493928891016127c1565b604051602081830303815290604052905061126a81611a02565b60405160200161127a9190612904565b6040516020818303038152906040529350505050919050565b60018111156112d45760405162461bcd60e51b815260206004820152600d60248201526c1a5b9d985b1a59081b195d995b609a1b60448201526064016108ca565b60006112e08284610be0565b9050803410156113325760405162461bcd60e51b815260206004820152601b60248201527f496e73756666696369656e74207061796d656e7420616d6f756e74000000000060448201526064016108ca565b600e546040516000916001600160a01b03169083908381818185875af1925050503d806000811461137f576040519150601f19603f3d011682016040523d82523d6000602084013e611384565b606091505b50509050806113a55760405162461bcd60e51b81526004016108ca90612949565b813411156114275760006113b9833461249e565b604051909150600090339083908381818185875af1925050503d80600081146113fe576040519150601f19603f3d011682016040523d82523d6000602084013e611403565b606091505b50509050806114245760405162461bcd60e51b81526004016108ca90612949565b50505b610bda338585611b54565b61143a61175b565b6001600160a01b03811661149f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108ca565b6114a8816117b5565b50565b6000818152600260205260409020546001600160a01b03166114a85760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016108ca565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061153f82610dda565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061158483610dda565b9050806001600160a01b0316846001600160a01b031614806115cb57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806115ef5750836001600160a01b03166115e48461082f565b6001600160a01b0316145b949350505050565b826001600160a01b031661160a82610dda565b6001600160a01b0316146116305760405162461bcd60e51b81526004016108ca906129a6565b6001600160a01b0382166116925760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016108ca565b826001600160a01b03166116a582610dda565b6001600160a01b0316146116cb5760405162461bcd60e51b81526004016108ca906129a6565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6006546001600160a01b03163314610edf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108ca565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036118685760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108ca565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6118e08484846115f7565b6118ec84848484611c72565b610bda5760405162461bcd60e51b81526004016108ca906129eb565b6060611913826114ab565b600061191d611d73565b9050600081511161193d5760405180602001604052806000815250611968565b806119478461196f565b604051602001611958929190612a3d565b6040516020818303038152906040525b9392505050565b6060600061197c83611d82565b600101905060008167ffffffffffffffff81111561199c5761199c612183565b6040519080825280601f01601f1916602001820160405280156119c6576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846119d057509392505050565b60608151600003611a2157505060408051602081019091526000815290565b6000604051806060016040528060408152602001612ac76040913990506000600384516002611a50919061248b565b611a5a91906124c8565b611a659060046124b1565b67ffffffffffffffff811115611a7d57611a7d612183565b6040519080825280601f01601f191660200182016040528015611aa7576020820181803683370190505b509050600182016020820185865187015b80821015611b13576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250611ab8565b5050600386510660018114611b2f5760028114611b4257610fb4565b603d6001830353603d6002830353610fb4565b603d6001830353509195945050505050565b80600103611be557601054611770611b6c848361248b565b1115611bac5760405162461bcd60e51b815260206004820152600f60248201526e6d617820676f6c6420737570706c7960881b60448201526064016108ca565b60005b83811015611bdc57611bc082612706565b9150611bcc8583611e5a565b611bd581612706565b9050611baf565b50601055505050565b600f546103e8611bf5848361248b565b1115611c395760405162461bcd60e51b81526020600482015260136024820152726d617820706c6174696e756d20737570706c7960681b60448201526064016108ca565b60005b83811015611c6957611c4d82612706565b9150611c598583611e5a565b611c6281612706565b9050611c3c565b50600f55505050565b60006001600160a01b0384163b15611d6857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611cb6903390899088908890600401612a6c565b6020604051808303816000875af1925050508015611cf1575060408051601f3d908101601f19168201909252611cee91810190612aa9565b60015b611d4e573d808015611d1f576040519150601f19603f3d011682016040523d82523d6000602084013e611d24565b606091505b508051600003611d465760405162461bcd60e51b81526004016108ca906129eb565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506115ef565b506001949350505050565b6060601180546107ac9061243b565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611dc15772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611ded576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611e0b57662386f26fc10000830492506010015b6305f5e1008310611e23576305f5e100830492506008015b6127108310611e3757612710830492506004015b60648310611e49576064830492506002015b600a83106107975760010192915050565b6001600160a01b038216611eb05760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108ca565b6000818152600260205260409020546001600160a01b031615611f155760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108ca565b6000818152600260205260409020546001600160a01b031615611f7a5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108ca565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b0319811681146114a857600080fd5b60006020828403121561200d57600080fd5b813561196881611fe5565b60005b8381101561203357818101518382015260200161201b565b50506000910152565b60008151808452612054816020860160208601612018565b601f01601f19169290920160200192915050565b602081526000611968602083018461203c565b60006020828403121561208d57600080fd5b5035919050565b80356001600160a01b0381168114610aa157600080fd5b600080604083850312156120be57600080fd5b6120c783612094565b946020939093013593505050565b6000806000606084860312156120ea57600080fd5b6120f384612094565b925061210160208501612094565b9150604084013590509250925092565b6000806020838503121561212457600080fd5b823567ffffffffffffffff8082111561213c57600080fd5b818501915085601f83011261215057600080fd5b81358181111561215f57600080fd5b86602082850101111561217157600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156121b4576121b4612183565b604051601f8501601f19908116603f011681019082821181831017156121dc576121dc612183565b816040528093508581528686860111156121f557600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261222057600080fd5b61196883833560208501612199565b60008060006060848603121561224457600080fd5b83359250602084013567ffffffffffffffff8082111561226357600080fd5b61226f8783880161220f565b9350604086013591508082111561228557600080fd5b506122928682870161220f565b9150509250925092565b600080604083850312156122af57600080fd5b50508035926020909101359150565b6000602082840312156122d057600080fd5b61196882612094565b6020808252825182820181905260009190848201906040850190845b81811015612311578351835292840192918401916001016122f5565b50909695505050505050565b60008060006060848603121561233257600080fd5b61233b84612094565b95602085013595506040909401359392505050565b6000806040838503121561236357600080fd5b61236c83612094565b91506020830135801515811461238157600080fd5b809150509250929050565b600080600080608085870312156123a257600080fd5b6123ab85612094565b93506123b960208601612094565b925060408501359150606085013567ffffffffffffffff8111156123dc57600080fd5b8501601f810187136123ed57600080fd5b6123fc87823560208401612199565b91505092959194509250565b6000806040838503121561241b57600080fd5b61242483612094565b915061243260208401612094565b90509250929050565b600181811c9082168061244f57607f821691505b60208210810361246f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561079757610797612475565b8181038181111561079757610797612475565b808202811582820484141761079757610797612475565b6000826124e557634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b601f82111561096b57600081815260208120601f850160051c8101602086101561255e5750805b601f850160051c820191505b8181101561257d5782815560010161256a565b505050505050565b67ffffffffffffffff83111561259d5761259d612183565b6125b1836125ab835461243b565b83612537565b6000601f8411600181146125e557600085156125cd5750838201355b600019600387901b1c1916600186901b17835561263f565b600083815260209020601f19861690835b8281101561261657868501358255602094850194600190920191016125f6565b50868210156126335760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b815167ffffffffffffffff81111561266057612660612183565b6126748161266e845461243b565b84612537565b602080601f8311600181146126a957600084156126915750858301515b600019600386901b1c1916600185901b17855561257d565b600085815260208120601f198616915b828110156126d8578886015182559484019460019091019084016126b9565b50858210156126f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001820161271857612718612475565b5060010190565b634e487b7160e01b600052603260045260246000fd5b60008151612747818560208601612018565b9290920192915050565b6000815461275e8161243b565b60018281168015612776576001811461278b57610dd0565b60ff1984168752821515830287019450610dd0565b8560005260208060002060005b858110156127b15781548a820152908401908201612798565b5050509590910195945050505050565b607b60f81b81526a113a37b5b2b724b2111d1160a91b600182015285516000906127f281600c850160208b01612018565b61088b60f21b600c91840191820181905267113730b6b2911d1160c11b600e8301528751612827816016850160208c01612018565b60169201918201819052681134b6b0b3b2911d1160b91b60188301526128506021830188612751565b9081526e113232b9b1b934b83a34b7b7111d1160891b600282015290506128f86128eb6128dc6128d6612897612889601187018b612751565b61088b60f21b815260020190565b7f2261747472696275746573223a5b7b2274726169745f74797065223a226c657681526c32b61116113b30b63ab2911d1160991b6020820152602d0190565b87612735565b62227d5d60e81b815260030190565b607d60f81b815260010190565b98975050505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161293c81601d850160208701612018565b91909101601d0192915050565b6020808252603a908201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260408201527f6563697069656e74206d61792068617665207265766572746564000000000000606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008351612a4f818460208801612018565b835190830190612a63818360208801612018565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612a9f9083018461203c565b9695505050505050565b600060208284031215612abb57600080fd5b815161196881611fe556fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212200718f1387a995d69758d29b7ffef5a11f7cfe2ee518f551b67a98e0c994afd7664736f6c63430008140033
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.