Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 143 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Transfer From | 17995911 | 371 days ago | IN | 0 ETH | 0.00112431 | ||||
Set Approval For... | 17707755 | 411 days ago | IN | 0 ETH | 0.00077347 | ||||
Set Approval For... | 17437031 | 449 days ago | IN | 0 ETH | 0.00192194 | ||||
Set Approval For... | 17432468 | 450 days ago | IN | 0 ETH | 0.00124914 | ||||
Set Approval For... | 17432454 | 450 days ago | IN | 0 ETH | 0.00128629 | ||||
Set Approval For... | 17432442 | 450 days ago | IN | 0 ETH | 0.00129579 | ||||
Set Approval For... | 17429556 | 450 days ago | IN | 0 ETH | 0.00216676 | ||||
Set Approval For... | 17429288 | 450 days ago | IN | 0 ETH | 0.00260562 | ||||
Set Approval For... | 17429073 | 451 days ago | IN | 0 ETH | 0.00190607 | ||||
Set Approval For... | 17422470 | 451 days ago | IN | 0 ETH | 0.00195108 | ||||
Withdraw Erc20 | 17421471 | 452 days ago | IN | 0 ETH | 0.00165834 | ||||
Withdraw | 17421444 | 452 days ago | IN | 0 ETH | 0.00073472 | ||||
Set Approval For... | 17411515 | 453 days ago | IN | 0 ETH | 0.00098305 | ||||
Set Approval For... | 17411160 | 453 days ago | IN | 0 ETH | 0.00079315 | ||||
Set Approval For... | 17411154 | 453 days ago | IN | 0 ETH | 0.00088631 | ||||
Set Approval For... | 17410898 | 453 days ago | IN | 0 ETH | 0.00114087 | ||||
Set Approval For... | 17410893 | 453 days ago | IN | 0 ETH | 0.00108412 | ||||
Set Approval For... | 17410891 | 453 days ago | IN | 0 ETH | 0.00112395 | ||||
Set Approval For... | 17410886 | 453 days ago | IN | 0 ETH | 0.00106769 | ||||
Set Approval For... | 17410877 | 453 days ago | IN | 0 ETH | 0.00122638 | ||||
Set Approval For... | 17410841 | 453 days ago | IN | 0 ETH | 0.0014985 | ||||
Set Approval For... | 17410822 | 453 days ago | IN | 0 ETH | 0.00129913 | ||||
Set Approval For... | 17410813 | 453 days ago | IN | 0 ETH | 0.00124283 | ||||
Set Approval For... | 17410780 | 453 days ago | IN | 0 ETH | 0.00120508 | ||||
Set Approval For... | 17410761 | 453 days ago | IN | 0 ETH | 0.00116579 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
17421444 | 452 days ago | 0.5 ETH |
Loading...
Loading
Contract Name:
NFTContract
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT /* ,----, ,--,,-.----. ,----.. ,--. ,/ .`| ,--.'|\ / \ / / \ .--.--. ,---, ,----.. ,--.'| ,---,. ,` .' : ,--, | :| : \ / . : / / '. ,`--.' | / / \ ,--, ,--,: : | ,' .' | ; ; / ,---.'| : '| | .\ : . / ;. \ : /`. // / : / . : ,--.'| ,`--.'`| ' :,---.' |.'___,/ ,' | | : _' |. : |: |. ; / ` ; | |--`: |.' ' . / ;. \| |, | : : | || | .'| : | .--.--. : : |.' || | \ :; | ; \ ; | : ;_ `----': |. ; / ` ;`--'_ : | \ | :: : : ; |.'; ; / / ' | ' ' ; :| : . /| : | ; | '\ \ `. ' ' ;; | ; \ ; |,' ,'| | : ' '; |: | |-,`----' | || : /`./ ' | .'. |; | |`-' . | ' ' ' : `----. \ | | || : | ; | '' | | ' ' ;. ;| : ;/| ' : ;| : ;_ | | : | '| | ; ' ; \; / | __ \ \ | ' : ;. | ' ' ' :| | : | | | \ || | .' | | ' \ \ `. ' : | : ;: ' | \ \ ', / / /`--' / | | '' ; \; / |' : |__ ' : | ; .'' : ' ' : | `----. \ | | ' ,/ : : : ; : / '--'. / ' : | \ \ ', / | | '.'| | | '`--' | | | ; |.' / /`--' / ; : ;--' | | : \ \ .' `--'---' ; |.' ; : / ; : ; ' : | | : \ '---' '--'. / | ,/ `---'.| `---` '---' \ \ .' | , / ; |.' | | ,' `--'---' '---' `---` `---` ---`-' '---' `----' If we listen, we can understand that it is a store of value. FortheHPOS10Icommunity,bytheHPOS10Icommunity. Welcome to the HarryPotterObamaSonic10Inu (BITCOIN) NFT Collection! This smart contract is your gateway to the world of HarryPotterObamaSonic10Inu. ------------------------------------------------------------------------------------------------------------------------------ ABOUT ------------------------------------------------------------------------------------------------------------------------------ It allows degens like you to mint exclusive NFTs using $BITCOIN or ETH. Prepare to be amazed and join the forefront of a revolutionary movement! Get ready to dive into the mind-blowing NFT collection that unleashes the untapped potential of your $BITCOIN. Embark on an extraordinary journey as you unlock the true value of your wealth. But be warned, the numbers you encounter here are beyond human comprehension, with an unfathomable magnitude of zeros, revealing infinite possibilities. Embrace this audacious leap into the realm of wei, where the true power of your resources awaits. Will you dare to seize this unparalleled opportunity? The choice is yours. ------------------------------------------------------------------------------------------------------------------------------ MINTING INSTRUCTIONS FOR $BITCOIN ------------------------------------------------------------------------------------------------------------------------------ You will need to approve the NFT contract to spend $BITCOIN on your behalf. Follow the steps bellow to allow the exact amount to be spent. Since this in wei, these are large numbers with a lot of zeros.. ------------------------------------------------------------------------------------------------------------------------------ APPROVE THE NFT CONTRACT TO SPEND YOUR $BITCOIN ------------------------------------------------------------------------------------------------------------------------------ 1. Visit the HPOS10I token contract at https://etherscan.io/token/0x72e4f9f808c49a2a61de9c5896298920dc4eeea9#writeContract 2. Connect your wallet. 3. Call the approve function in the HPOS10I token contract with the following parameters: - spender: 0xC7FD4e740C41D535273C40cE4b79cD7Ec65636b0 - amount: 10000000000000000000000 /// If you want to mint more than one NFT, multiply the amount by the desired quantity. /// ------------------------------------------------------------------------------------------------------------------------------ MINT YOUR NFTs ------------------------------------------------------------------------------------------------------------------------------ 1. Visit the NFT contract at https://etherscan.io/address/0xC7FD4e740C41D535273C40cE4b79cD7Ec65636b0#writeContract 2. Call the `mintNFTforRealPeoplesBITCOIN` function in the NFT contract, specifying the quantity of NFTs you wish to mint. ------------------------------------------------------------------------------------------------------------------------------ PS: Need to mint quickly? If you're a true degen in a hurry, you can mint NFTs using ETH as well. Each NFT is priced at 0.025 ETH. Simply call the mintNFTforETH function with the desired quantity of NFTs to mint. */ pragma solidity ^0.8.4; import { RevokableOperatorFilterer } from "./RevokableOperatorFilterer.sol"; import { RevokableDefaultOperatorFilterer } from "./RevokableDefaultOperatorFilterer.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "erc721a/contracts/extensions/ERC721AQueryable.sol"; import "erc721a/contracts/extensions/ERC721ABurnable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract NFTContract is ERC721AQueryable, ERC721ABurnable, RevokableDefaultOperatorFilterer, Ownable, ReentrancyGuard { using SafeMath for uint256; uint256 private _mintCost; uint256 private _currentErc20Cost; uint256 private _freeSupply; uint256 private _maxSupply; address erc20Address; bool private _isPublicMintEnabled; bool private _isPresaleMintEnabled; bool private _isSaleClosed; string private _tokenBaseURI = "ipfs://QmVvCHjejfMwmyHnKEkzA8QT14PnigDewN7tH94q8NpdJv/"; // IPFS base URI for all tokens function setApprovalForAll(address operator, bool approved) public override(ERC721A, IERC721A) onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve(address operator, uint256 tokenId) public payable override(ERC721A, IERC721A) onlyAllowedOperatorApproval(operator) { super.approve(operator, tokenId); } function transferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } function owner() public view virtual override(Ownable, RevokableOperatorFilterer) returns (address) { return Ownable.owner(); } /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor() ERC721A("HPOS10I NFTS", "HPOS10I NFT") Ownable() { _freeSupply = 420; _maxSupply = 4200; _mintCost = 0.025 ether; _currentErc20Cost = 10000 ether; _isPublicMintEnabled = false; _isSaleClosed = false; erc20Address = 0x72e4f9F808C49A2a61dE9C5896298920Dc4EEEa9; } /** * @dev Changes contract state to enable public access to `mintTokens` function * Can only be called by the current owner. */ function allowPublicMint() public onlyOwner { _isPublicMintEnabled = true; } /** * @dev Changes contract state to disable public access to `mintTokens` function * Can only be called by the current owner. */ function denyPublicMint() public onlyOwner { _isPublicMintEnabled = false; } /** * @dev Changes contract state to enable public access to `burnBackStagePassForRave` function * Can only be called by the current owner. */ function closeSale() public onlyOwner { _isSaleClosed = true; } /** * @dev Changes contract state to disable public access to `burnBackStagePassForRave` function * Can only be called by the current owner. */ function reOpenSale() public onlyOwner { _isSaleClosed = false; } /** * @dev Mint a token to each Address of `recipients`. * Can only be called if requirements are satisfied. */ function mintTokensTo(address[] calldata recipients) public payable nonReentrant { require(recipients.length > 0, "Missing recipient addresses"); require(owner() == msg.sender, "Only owner can airdrop"); require( recipients.length > 0 && recipients.length <= 20, "You can drop minimum 1, maximum 20 NFTs" ); require( recipients.length.add(totalSupply()) < (_maxSupply + 1), "Exceeds max supply" ); for (uint256 i = 0; i < recipients.length; i++) { _safeMint(recipients[i], 1); } } /** * @dev Mint `count` tokens if requirements are satisfied. * */ function mintNFTforETH(uint256 count) public payable nonReentrant { require(_isPublicMintEnabled || owner() == msg.sender, "Mint disabled"); require( count > 0 && count <= 20, "You can mint minimum 1, maximum 20 NFTs" ); require(totalSupply() < (_maxSupply + 1), "Exceeds max supply"); require( owner() == msg.sender || msg.value >= _mintCost.mul(count), "Ether value sent is below the price" ); _safeMint(msg.sender, count); } /** * @dev Mint token for HPOS10INU * */ function mintNFTforRealPeoplesBITCOIN(uint256 count) public nonReentrant { require(_isPublicMintEnabled || owner() == msg.sender, "Mint disabled"); require( count > 0 && count <= 20, "You can mint minimum 1, maximum 20 NFTs" ); require(totalSupply() < (_maxSupply + 1), "Exceeds max supply"); IERC20(erc20Address).transferFrom(msg.sender, address(this), count.mul(currentErc20Cost())); _safeMint(msg.sender, count); } function freeMint(uint256 count) public nonReentrant { require(_isPublicMintEnabled || owner() == msg.sender, "Mint disabled"); require( count > 0 && count <= 20, "You can mint minimum 1, maximum 20 NFTs" ); require(totalSupply() < (_maxSupply + 1), "Exceeds max supply"); require(totalSupply() <= _freeSupply, "You can only mint for erc20 token"); _safeMint(msg.sender, count); } /** * @dev Returns the current cost of mint. */ function currentErc20Cost() public view returns (uint256) { return _currentErc20Cost; } /** * @dev Update the cost * Can only be called by the current owner. */ function setCurrentErc20Cost(uint256 cost) public onlyOwner { _currentErc20Cost = cost; } /** * @dev Sets the ERC20 address * @param _erc20Address The RAVE token address */ function setErc20Address(address _erc20Address) public onlyOwner { erc20Address = _erc20Address; } /** * @dev Update the max supply. * Can only be called by owner. */ function setMaxSupply(uint256 max) public onlyOwner { _maxSupply = max; } /** * @dev Update the cost to mint a token. * Can only be called by owner. */ function setCost(uint256 cost) public onlyOwner { _mintCost = cost; } /** * @dev Transfers balance to owner. * Can only be called by owner. */ function withdraw() public onlyOwner { payable(owner()).transfer(address(this).balance); } /** * @dev Transfers balance to owner. * Can only be called by owner. */ function withdrawErc20(address _erc20TokenContractAddress) public onlyOwner { IERC20(_erc20TokenContractAddress).transfer(msg.sender, IERC20(_erc20TokenContractAddress).balanceOf(address(this))); } /** * @dev Returns the maximum supply * @return uint256 maximumSupply */ function getMaxSupply() public view returns (uint256) { return _maxSupply; } /** * @dev Returns the current supply * @return uint256 totalSupply */ function getCurrentSupply() public view returns (uint256) { return totalSupply(); } /** * @dev Returns the status of the mint. True if mint is enabled. * @return bool isPublicMintEnabled */ function getMintStatus() public view returns (bool) { return _isPublicMintEnabled; } /** * @dev Changes the base URI. * @param URI URI of the metadata directory * Can only be called by owner. */ function setBaseURI(string calldata URI) external onlyOwner { _tokenBaseURI = URI; } function _baseURI() internal view override returns (string memory) { return _tokenBaseURI; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import { OperatorFilterer } from "./OperatorFilterer.sol"; /** * @title RevokableOperatorFilterer * @notice This contract is meant to allow contracts to permanently opt out of the OperatorFilterRegistry. The Registry * itself has an "unregister" function, but if the contract is ownable, the owner can re-register at any point. * As implemented, this abstract contract allows the contract owner to toggle the * isOperatorFilterRegistryRevoked flag in order to permanently bypass the OperatorFilterRegistry checks. */ abstract contract RevokableOperatorFilterer is OperatorFilterer { error OnlyOwner(); error AlreadyRevoked(); bool private _isOperatorFilterRegistryRevoked; modifier onlyAllowedOperator(address from) override { // Check registry code length to facilitate testing in environments without a deployed registry. if ( !_isOperatorFilterRegistryRevoked && address(OPERATOR_FILTER_REGISTRY).code.length > 0 ) { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from == msg.sender) { _; return; } if ( !OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), msg.sender) ) { revert OperatorNotAllowed(msg.sender); } } _; } modifier onlyAllowedOperatorApproval(address operator) override { // Check registry code length to facilitate testing in environments without a deployed registry. if ( !_isOperatorFilterRegistryRevoked && address(OPERATOR_FILTER_REGISTRY).code.length > 0 ) { if ( !OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator) ) { revert OperatorNotAllowed(operator); } } _; } /** * @notice Disable the isOperatorFilterRegistryRevoked flag. OnlyOwner. */ function revokeOperatorFilterRegistry() external { if (msg.sender != owner()) { revert OnlyOwner(); } if (_isOperatorFilterRegistryRevoked) { revert AlreadyRevoked(); } _isOperatorFilterRegistryRevoked = true; } function isOperatorFilterRegistryRevoked() public view returns (bool) { return _isOperatorFilterRegistryRevoked; } /** * @dev assume the contract has an owner, but leave specific Ownable implementation up to inheriting contract */ function owner() public view virtual returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import { RevokableOperatorFilterer } from "./RevokableOperatorFilterer.sol"; import { OperatorFilterer } from "./OperatorFilterer.sol"; /** * @title RevokableDefaultOperatorFilterer * @notice Inherits from RevokableOperatorFilterer and automatically subscribes to the default OpenSea subscription. */ abstract contract RevokableDefaultOperatorFilterer is RevokableOperatorFilterer { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import { IOperatorFilterRegistry } from "./IOperatorFilterRegistry.sol"; /** * @title OperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. */ abstract contract OperatorFilterer { error OperatorNotAllowed(address operator); IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (subscribe) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe( address(this), subscriptionOrRegistrantToCopy ); } else { if (subscriptionOrRegistrantToCopy != address(0)) { OPERATOR_FILTER_REGISTRY.registerAndCopyEntries( address(this), subscriptionOrRegistrantToCopy ); } else { OPERATOR_FILTER_REGISTRY.register(address(this)); } } } } modifier onlyAllowedOperator(address from) virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from == msg.sender) { _; return; } if ( !OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), msg.sender) ) { revert OperatorNotAllowed(msg.sender); } } _; } modifier onlyAllowedOperatorApproval(address operator) virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if ( !OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator) ) { revert OperatorNotAllowed(operator); } } _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { function isOperatorAllowed(address registrant, address operator) external view returns (bool); function register(address registrant) external; function registerAndSubscribe(address registrant, address subscription) external; function registerAndCopyEntries(address registrant, address registrantToCopy) external; function unregister(address addr) external; function updateOperator( address registrant, address operator, bool filtered ) external; function updateOperators( address registrant, address[] calldata operators, bool filtered ) external; function updateCodeHash( address registrant, bytes32 codehash, bool filtered ) external; function updateCodeHashes( address registrant, bytes32[] calldata codeHashes, bool filtered ) external; function subscribe(address registrant, address registrantToSubscribe) external; function unsubscribe(address registrant, bool copyExistingEntries) external; function subscriptionOf(address addr) external returns (address registrant); function subscribers(address registrant) external returns (address[] memory); function subscriberAt(address registrant, uint256 index) external returns (address); function copyEntriesOf(address registrant, address registrantToCopy) external; function isOperatorFiltered(address registrant, address operator) external returns (bool); function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); function filteredOperators(address addr) external returns (address[] memory); function filteredCodeHashes(address addr) external returns (bytes32[] memory); function filteredOperatorAt(address registrant, uint256 index) external returns (address); function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); function isRegistered(address addr) external returns (bool); function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../IERC721A.sol'; /** * @dev Interface of ERC721AQueryable. */ interface IERC721AQueryable is IERC721A { /** * Invalid query range (`start` >= `stop`). */ error InvalidQueryRange(); /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory); /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory); /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory); /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view returns (uint256[] memory); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../IERC721A.sol'; /** * @dev Interface of ERC721ABurnable. */ interface IERC721ABurnable is IERC721A { /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) external; }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AQueryable.sol'; import '../ERC721A.sol'; /** * @title ERC721AQueryable. * * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable { /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) { return ownership; } ownership = _ownershipAt(tokenId); if (ownership.burned) { return ownership; } return _ownershipOf(tokenId); } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] calldata tokenIds) external view virtual override returns (TokenOwnership[] memory) { unchecked { uint256 tokenIdsLength = tokenIds.length; TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength); for (uint256 i; i != tokenIdsLength; ++i) { ownerships[i] = explicitOwnershipOf(tokenIds[i]); } return ownerships; } } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view virtual override returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _nextTokenId(); // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, stopLimit)`. if (stop > stopLimit) { stop = stopLimit; } uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (start < stop) { uint256 rangeLength = stop - start; if (rangeLength < tokenIdsMaxLength) { tokenIdsMaxLength = rangeLength; } } else { tokenIdsMaxLength = 0; } uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength); if (tokenIdsMaxLength == 0) { return tokenIds; } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`. // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range. if (!ownership.burned) { currOwnershipAddr = ownership.addr; } for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } // Downsize the array to fit. assembly { mstore(tokenIds, tokenIdsIdx) } return tokenIds; } } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); TokenOwnership memory ownership; for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721ABurnable.sol'; import '../ERC721A.sol'; /** * @title ERC721ABurnable. * * @dev ERC721A token that can be irreversibly burned (destroyed). */ abstract contract ERC721ABurnable is ERC721A, IERC721ABurnable { /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual override { _burn(tokenId, true); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @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 payable; /** * @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); // ============================================================= // IERC721Metadata // ============================================================= /** * @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); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @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, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @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) public payable virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @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) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @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. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @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 memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyRevoked","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","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":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowPublicMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closeSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentErc20Cost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"denyPublicMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"freeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMintStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOperatorFilterRegistryRevoked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"mintNFTforETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"mintNFTforRealPeoplesBITCOIN","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"}],"name":"mintTokensTo","outputs":[],"stateMutability":"payable","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":"reOpenSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revokeOperatorFilterRegistry","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":"payable","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":"payable","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":"URI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"cost","type":"uint256"}],"name":"setCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"cost","type":"uint256"}],"name":"setCurrentErc20Cost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_erc20Address","type":"address"}],"name":"setErc20Address","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"max","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_erc20TokenContractAddress","type":"address"}],"name":"withdrawErc20","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e0604052603660808181529062002f1660a03980516200002991600f91602090910190620002c9565b503480156200003757600080fd5b50604080518082018252600c81526b48504f53313049204e46545360a01b60208083019182528351808501909452600b84526a121413d4cc4c124813919560aa1b908401528151733cc6cdda760b79bafa08df41ecfa224f810dceb693600193929091620000a891600291620002c9565b508051620000be906003906020840190620002c9565b506000805550506daaeb6d7670e522a718067333cd4e3b156200020a5780156200015857604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200013957600080fd5b505af11580156200014e573d6000803e3d6000fd5b505050506200020a565b6001600160a01b03821615620001a95760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af2903906044016200011e565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b158015620001f057600080fd5b505af115801562000205573d6000803e3d6000fd5b505050505b50620002189050336200026f565b60016009556101a4600c55611068600d556658d15e17628000600a5569021e19e0c9bab2400000600b55600e8054600161ff0160a81b0319167372e4f9f808c49a2a61de9c5896298920dc4eeea9179055620003ab565b600880546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620002d7906200036f565b90600052602060002090601f016020900481019282620002fb576000855562000346565b82601f106200031657805160ff191683800117855562000346565b8280016001018555821562000346579182015b828111156200034657825182559160200191906001019062000329565b506200035492915062000358565b5090565b5b8082111562000354576000815560010162000359565b600181811c908216806200038457607f821691505b602082108103620003a557634e487b7160e01b600052602260045260246000fd5b50919050565b612b5b80620003bb6000396000f3fe6080604052600436106102675760003560e01c806370a0823111610144578063a22cb465116100b6578063c7e42b1b1161007a578063c7e42b1b146106cf578063c87b56dd146106ef578063e985e9c51461070f578063ecba222a14610758578063ee55efee14610770578063f2fde38b1461078557600080fd5b8063a22cb4651461063c578063ad538e801461065c578063b88d4fde1461067c578063c05dd2721461068f578063c23dc68f146106a257600080fd5b80638da5cb5b116101085780638da5cb5b1461059d578063941ada0e146105c057806395d89b41146105df57806399a2557a146105f45780639edcc31014610614578063a1224ad31461062957600080fd5b806370a0823114610506578063715018a6146105265780637c928fe91461053b5780638462151c1461055b578063893d4e061461058857600080fd5b806342966c68116101dd5780634f3e1efc116101a15780634f3e1efc1461044f57806355f804b3146104645780635bbb2177146104845780635ef9432a146104b15780636352211e146104c65780636f8b44b0146104e657600080fd5b806342966c68146103c557806344a0d68a146103e55780634a39fa80146104055780634c0f38c2146104255780634dae50a91461043a57600080fd5b806318160ddd1161022f57806318160ddd1461033057806323b872dd1461035357806335133b40146103665780633ccfd60b1461037b57806341f434341461039057806342842e0e146103b257600080fd5b806301ffc9a71461026c57806306fdde03146102a1578063081812fc146102c3578063095ea7b3146102fb5780630f1b03f114610310575b600080fd5b34801561027857600080fd5b5061028c610287366004612456565b6107a5565b60405190151581526020015b60405180910390f35b3480156102ad57600080fd5b506102b66107f7565b60405161029891906124cb565b3480156102cf57600080fd5b506102e36102de3660046124de565b610889565b6040516001600160a01b039091168152602001610298565b61030e610309366004612513565b6108cd565b005b34801561031c57600080fd5b5061030e61032b3660046124de565b6109ad565b34801561033c57600080fd5b50600154600054035b604051908152602001610298565b61030e61036136600461253d565b610b0e565b34801561037257600080fd5b5061030e610bf9565b34801561038757600080fd5b5061030e610c10565b34801561039c57600080fd5b506102e36daaeb6d7670e522a718067333cd4e81565b61030e6103c036600461253d565b610c58565b3480156103d157600080fd5b5061030e6103e03660046124de565b610d38565b3480156103f157600080fd5b5061030e6104003660046124de565b610d43565b34801561041157600080fd5b5061030e610420366004612579565b610d50565b34801561043157600080fd5b50600d54610345565b34801561044657600080fd5b5061030e610d7a565b34801561045b57600080fd5b50610345610d91565b34801561047057600080fd5b5061030e61047f366004612594565b610da5565b34801561049057600080fd5b506104a461049f366004612652565b610db9565b60405161029891906126d1565b3480156104bd57600080fd5b5061030e610e85565b3480156104d257600080fd5b506102e36104e13660046124de565b610efa565b3480156104f257600080fd5b5061030e6105013660046124de565b610f05565b34801561051257600080fd5b50610345610521366004612579565b610f12565b34801561053257600080fd5b5061030e610f61565b34801561054757600080fd5b5061030e6105563660046124de565b610f75565b34801561056757600080fd5b5061057b610576366004612579565b61108c565b6040516102989190612713565b34801561059457600080fd5b50600b54610345565b3480156105a957600080fd5b5060085461010090046001600160a01b03166102e3565b3480156105cc57600080fd5b50600e54600160a01b900460ff1661028c565b3480156105eb57600080fd5b506102b6611195565b34801561060057600080fd5b5061057b61060f36600461274b565b6111a4565b34801561062057600080fd5b5061030e61131e565b61030e610637366004612652565b61133b565b34801561064857600080fd5b5061030e61065736600461278c565b6114f4565b34801561066857600080fd5b5061030e6106773660046124de565b6115ca565b61030e61068a3660046127d9565b6115d7565b61030e61069d3660046124de565b6116c5565b3480156106ae57600080fd5b506106c26106bd3660046124de565b6117f3565b60405161029891906128b5565b3480156106db57600080fd5b5061030e6106ea366004612579565b61186b565b3480156106fb57600080fd5b506102b661070a3660046124de565b611954565b34801561071b57600080fd5b5061028c61072a3660046128c3565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b34801561076457600080fd5b5060085460ff1661028c565b34801561077c57600080fd5b5061030e6119d7565b34801561079157600080fd5b5061030e6107a0366004612579565b6119f4565b60006301ffc9a760e01b6001600160e01b0319831614806107d657506380ac58cd60e01b6001600160e01b03198316145b806107f15750635b5e139f60e01b6001600160e01b03198316145b92915050565b606060028054610806906128f6565b80601f0160208091040260200160405190810160405280929190818152602001828054610832906128f6565b801561087f5780601f106108545761010080835404028352916020019161087f565b820191906000526020600020905b81548152906001019060200180831161086257829003601f168201915b5050505050905090565b600061089482611a6a565b6108b1576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600854829060ff161580156108f057506daaeb6d7670e522a718067333cd4e3b15155b1561099e57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa15801561094d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109719190612930565b61099e57604051633b79c77360e21b81526001600160a01b03821660048201526024015b60405180910390fd5b6109a88383611a91565b505050565b6109b5611b31565b600e54600160a01b900460ff16806109dd57506008546001600160a01b036101009091041633145b6109f95760405162461bcd60e51b81526004016109959061294d565b600081118015610a0a575060148111155b610a265760405162461bcd60e51b815260040161099590612974565b600d54610a349060016129d1565b6001546000540310610a585760405162461bcd60e51b8152600401610995906129e9565b600e546001600160a01b03166323b872dd3330610a7e610a77600b5490565b8690611b8a565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af1158015610ad2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af69190612930565b50610b013382611b96565b610b0b6001600955565b50565b600854839060ff16158015610b3157506daaeb6d7670e522a718067333cd4e3b15155b15610be857336001600160a01b03821603610b5657610b51848484611bb0565b610bf3565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc99190612930565b610be857604051633b79c77360e21b8152336004820152602401610995565b610bf3848484611bb0565b50505050565b610c01611d40565b600e805460ff60a01b19169055565b610c18611d40565b6008546040516001600160a01b0361010090920491909116904780156108fc02916000818181858888f19350505050158015610b0b573d6000803e3d6000fd5b600854839060ff16158015610c7b57506daaeb6d7670e522a718067333cd4e3b15155b15610d2d57336001600160a01b03821603610c9b57610b51848484611da0565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015610cea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0e9190612930565b610d2d57604051633b79c77360e21b8152336004820152602401610995565b610bf3848484611da0565b610b0b816001611dbb565b610d4b611d40565b600a55565b610d58611d40565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b610d82611d40565b600e805460ff60b01b19169055565b6000610da06001546000540390565b905090565b610dad611d40565b6109a8600f83836123a7565b60608160008167ffffffffffffffff811115610dd757610dd76127c3565b604051908082528060200260200182016040528015610e2957816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610df55790505b50905060005b828114610e7c57610e57868683818110610e4b57610e4b612a15565b905060200201356117f3565b828281518110610e6957610e69612a15565b6020908102919091010152600101610e2f565b50949350505050565b60085461010090046001600160a01b03166001600160a01b0316336001600160a01b031614610ec757604051635fc483c560e01b815260040160405180910390fd5b60085460ff1615610eeb5760405163905e710760e01b815260040160405180910390fd5b6008805460ff19166001179055565b60006107f182611ef3565b610f0d611d40565b600d55565b60006001600160a01b038216610f3b576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b610f69611d40565b610f736000611f5a565b565b610f7d611b31565b600e54600160a01b900460ff1680610fa557506008546001600160a01b036101009091041633145b610fc15760405162461bcd60e51b81526004016109959061294d565b600081118015610fd2575060148111155b610fee5760405162461bcd60e51b815260040161099590612974565b600d54610ffc9060016129d1565b60015460005403106110205760405162461bcd60e51b8152600401610995906129e9565b600c546001546000540311156110825760405162461bcd60e51b815260206004820152602160248201527f596f752063616e206f6e6c79206d696e7420666f7220657263323020746f6b656044820152603760f91b6064820152608401610995565b610b013382611b96565b6060600080600061109c85610f12565b905060008167ffffffffffffffff8111156110b9576110b96127c3565b6040519080825280602002602001820160405280156110e2578160200160208202803683370190505b50905061110f60408051608081018252600080825260208201819052918101829052606081019190915290565b60005b8386146111895761112281611fb4565b915081604001516111815781516001600160a01b03161561114257815194505b876001600160a01b0316856001600160a01b031603611181578083878060010198508151811061117457611174612a15565b6020026020010181815250505b600101611112565b50909695505050505050565b606060038054610806906128f6565b60608183106111c657604051631960ccad60e11b815260040160405180910390fd5b6000806111d260005490565b9050808411156111e0578093505b60006111eb87610f12565b90508486101561120a5785850381811015611204578091505b5061120e565b5060005b60008167ffffffffffffffff811115611229576112296127c3565b604051908082528060200260200182016040528015611252578160200160208202803683370190505b5090508160000361126857935061131792505050565b6000611273886117f3565b905060008160400151611284575080515b885b8881141580156112965750848714155b1561130b576112a481611fb4565b925082604001516113035782516001600160a01b0316156112c457825191505b8a6001600160a01b0316826001600160a01b03160361130357808488806001019950815181106112f6576112f6612a15565b6020026020010181815250505b600101611286565b50505092835250909150505b9392505050565b611326611d40565b600e805460ff60a01b1916600160a01b179055565b611343611b31565b806113905760405162461bcd60e51b815260206004820152601b60248201527f4d697373696e6720726563697069656e742061646472657373657300000000006044820152606401610995565b6008546001600160a01b036101009091041633146113e95760405162461bcd60e51b815260206004820152601660248201527504f6e6c79206f776e65722063616e2061697264726f760541b6044820152606401610995565b80158015906113f9575060148111155b6114555760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2064726f70206d696e696d756d20312c206d6178696d756d206044820152663230204e46547360c81b6064820152608401610995565b600d546114639060016129d1565b61147a6114736001546000540390565b8390611ff0565b106114975760405162461bcd60e51b8152600401610995906129e9565b60005b818110156114e5576114d38383838181106114b7576114b7612a15565b90506020020160208101906114cc9190612579565b6001611b96565b806114dd81612a2b565b91505061149a565b506114f06001600955565b5050565b600854829060ff1615801561151757506daaeb6d7670e522a718067333cd4e3b15155b156115c057604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611574573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115989190612930565b6115c057604051633b79c77360e21b81526001600160a01b0382166004820152602401610995565b6109a88383611ffc565b6115d2611d40565b600b55565b600854849060ff161580156115fa57506daaeb6d7670e522a718067333cd4e3b15155b156116b257336001600160a01b038216036116205761161b85858585612068565b6116be565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa15801561166f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116939190612930565b6116b257604051633b79c77360e21b8152336004820152602401610995565b6116be85858585612068565b5050505050565b6116cd611b31565b600e54600160a01b900460ff16806116f557506008546001600160a01b036101009091041633145b6117115760405162461bcd60e51b81526004016109959061294d565b600081118015611722575060148111155b61173e5760405162461bcd60e51b815260040161099590612974565b600d5461174c9060016129d1565b60015460005403106117705760405162461bcd60e51b8152600401610995906129e9565b6008546001600160a01b036101009091041633148061179b5750600a546117979082611b8a565b3410155b6110825760405162461bcd60e51b815260206004820152602360248201527f45746865722076616c75652073656e742069732062656c6f772074686520707260448201526269636560e81b6064820152608401610995565b60408051608080820183526000808352602080840182905283850182905260608085018390528551938401865282845290830182905293820181905292810183905290915060005483106118475792915050565b61185083611fb4565b90508060400151156118625792915050565b611317836120ac565b611873611d40565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156118c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e59190612a44565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611930573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f09190612930565b606061195f82611a6a565b61197c57604051630a14c4b560e41b815260040160405180910390fd5b60006119866120e1565b905080516000036119a65760405180602001604052806000815250611317565b806119b0846120f0565b6040516020016119c1929190612a5d565b6040516020818303038152906040529392505050565b6119df611d40565b600e805460ff60b01b1916600160b01b179055565b6119fc611d40565b6001600160a01b038116611a615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610995565b610b0b81611f5a565b60008054821080156107f1575050600090815260046020526040902054600160e01b161590565b6000611a9c82610efa565b9050336001600160a01b03821614611ad557611ab8813361072a565b611ad5576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600260095403611b835760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610995565b6002600955565b60006113178284612a8c565b6114f0828260405180602001604052806000815250612134565b6000611bbb82611ef3565b9050836001600160a01b0316816001600160a01b031614611bee5760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054611c1a8187335b6001600160a01b039081169116811491141790565b611c4557611c28863361072a565b611c4557604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611c6c57604051633a954ecd60e21b815260040160405180910390fd5b8015611c7757600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b84169003611d0957600184016000818152600460205260408120549003611d07576000548114611d075760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b0316600080516020612b0683398151915260405160405180910390a4505050505050565b6008546001600160a01b03610100909104163314610f735760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610995565b6109a8838383604051806020016040528060008152506115d7565b6000611dc683611ef3565b905080600080611de486600090815260066020526040902080549091565b915091508415611e2457611df9818433611c05565b611e2457611e07833361072a565b611e2457604051632ce44b5f60e11b815260040160405180910390fd5b8015611e2f57600082555b6001600160a01b038316600081815260056020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260046020526040812091909155600160e11b85169003611ebd57600186016000818152600460205260408120549003611ebb576000548114611ebb5760008181526004602052604090208590555b505b60405186906000906001600160a01b03861690600080516020612b06833981519152908390a45050600180548101905550505050565b600081600054811015611f415760008181526004602052604081205490600160e01b82169003611f3f575b80600003611317575060001901600081815260046020526040902054611f1e565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040805160808101825260008082526020820181905291810182905260608101919091526000828152600460205260409020546107f19061219a565b600061131782846129d1565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b612073848484610b0e565b6001600160a01b0383163b15610bf35761208f848484846121e2565b610bf3576040516368d2bf6b60e11b815260040160405180910390fd5b6040805160808101825260008082526020820181905291810182905260608101919091526107f16120dc83611ef3565b61219a565b6060600f8054610806906128f6565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a90048061210a5750819003601f19909101908152919050565b61213e83836122cd565b6001600160a01b0383163b156109a8576000548281035b61216860008683806001019450866121e2565b612185576040516368d2bf6b60e11b815260040160405180910390fd5b8181106121555781600054146116be57600080fd5b604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612217903390899088908890600401612aab565b6020604051808303816000875af1925050508015612252575060408051601f3d908101601f1916820190925261224f91810190612ae8565b60015b6122b0573d808015612280576040519150601f19603f3d011682016040523d82523d6000602084013e612285565b606091505b5080516000036122a8576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b60008054908290036122f25760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b17831790558284019083908390600080516020612b068339815191528180a4600183015b81811461237d5780836000600080516020612b06833981519152600080a4600101612357565b508160000361239e57604051622e076360e81b815260040160405180910390fd5b60005550505050565b8280546123b3906128f6565b90600052602060002090601f0160209004810192826123d5576000855561241b565b82601f106123ee5782800160ff1982351617855561241b565b8280016001018555821561241b579182015b8281111561241b578235825591602001919060010190612400565b5061242792915061242b565b5090565b5b80821115612427576000815560010161242c565b6001600160e01b031981168114610b0b57600080fd5b60006020828403121561246857600080fd5b813561131781612440565b60005b8381101561248e578181015183820152602001612476565b83811115610bf35750506000910152565b600081518084526124b7816020860160208601612473565b601f01601f19169290920160200192915050565b602081526000611317602083018461249f565b6000602082840312156124f057600080fd5b5035919050565b80356001600160a01b038116811461250e57600080fd5b919050565b6000806040838503121561252657600080fd5b61252f836124f7565b946020939093013593505050565b60008060006060848603121561255257600080fd5b61255b846124f7565b9250612569602085016124f7565b9150604084013590509250925092565b60006020828403121561258b57600080fd5b611317826124f7565b600080602083850312156125a757600080fd5b823567ffffffffffffffff808211156125bf57600080fd5b818501915085601f8301126125d357600080fd5b8135818111156125e257600080fd5b8660208285010111156125f457600080fd5b60209290920196919550909350505050565b60008083601f84011261261857600080fd5b50813567ffffffffffffffff81111561263057600080fd5b6020830191508360208260051b850101111561264b57600080fd5b9250929050565b6000806020838503121561266557600080fd5b823567ffffffffffffffff81111561267c57600080fd5b61268885828601612606565b90969095509350505050565b80516001600160a01b0316825260208082015167ffffffffffffffff169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b8181101561118957612700838551612694565b92840192608092909201916001016126ed565b6020808252825182820181905260009190848201906040850190845b818110156111895783518352928401929184019160010161272f565b60008060006060848603121561276057600080fd5b612769846124f7565b95602085013595506040909401359392505050565b8015158114610b0b57600080fd5b6000806040838503121561279f57600080fd5b6127a8836124f7565b915060208301356127b88161277e565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156127ef57600080fd5b6127f8856124f7565b9350612806602086016124f7565b925060408501359150606085013567ffffffffffffffff8082111561282a57600080fd5b818701915087601f83011261283e57600080fd5b813581811115612850576128506127c3565b604051601f8201601f19908116603f01168101908382118183101715612878576128786127c3565b816040528281528a602084870101111561289157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b608081016107f18284612694565b600080604083850312156128d657600080fd5b6128df836124f7565b91506128ed602084016124f7565b90509250929050565b600181811c9082168061290a57607f821691505b60208210810361292a57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561294257600080fd5b81516113178161277e565b6020808252600d908201526c135a5b9d08191a5cd8589b1959609a1b604082015260600190565b60208082526027908201527f596f752063616e206d696e74206d696e696d756d20312c206d6178696d756d206040820152663230204e46547360c81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082198211156129e4576129e46129bb565b500190565b60208082526012908201527145786365656473206d617820737570706c7960701b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060018201612a3d57612a3d6129bb565b5060010190565b600060208284031215612a5657600080fd5b5051919050565b60008351612a6f818460208801612473565b835190830190612a83818360208801612473565b01949350505050565b6000816000190483118215151615612aa657612aa66129bb565b500290565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612ade9083018461249f565b9695505050505050565b600060208284031215612afa57600080fd5b81516113178161244056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212209dd08cad1ae46e10f161b6bbf025ed3a5e767f882e579426465eec434bc18daa64736f6c634300080d0033697066733a2f2f516d567643486a656a664d776d79486e4b456b7a413851543134506e69674465774e377448393471384e70644a762f
Deployed Bytecode
0x6080604052600436106102675760003560e01c806370a0823111610144578063a22cb465116100b6578063c7e42b1b1161007a578063c7e42b1b146106cf578063c87b56dd146106ef578063e985e9c51461070f578063ecba222a14610758578063ee55efee14610770578063f2fde38b1461078557600080fd5b8063a22cb4651461063c578063ad538e801461065c578063b88d4fde1461067c578063c05dd2721461068f578063c23dc68f146106a257600080fd5b80638da5cb5b116101085780638da5cb5b1461059d578063941ada0e146105c057806395d89b41146105df57806399a2557a146105f45780639edcc31014610614578063a1224ad31461062957600080fd5b806370a0823114610506578063715018a6146105265780637c928fe91461053b5780638462151c1461055b578063893d4e061461058857600080fd5b806342966c68116101dd5780634f3e1efc116101a15780634f3e1efc1461044f57806355f804b3146104645780635bbb2177146104845780635ef9432a146104b15780636352211e146104c65780636f8b44b0146104e657600080fd5b806342966c68146103c557806344a0d68a146103e55780634a39fa80146104055780634c0f38c2146104255780634dae50a91461043a57600080fd5b806318160ddd1161022f57806318160ddd1461033057806323b872dd1461035357806335133b40146103665780633ccfd60b1461037b57806341f434341461039057806342842e0e146103b257600080fd5b806301ffc9a71461026c57806306fdde03146102a1578063081812fc146102c3578063095ea7b3146102fb5780630f1b03f114610310575b600080fd5b34801561027857600080fd5b5061028c610287366004612456565b6107a5565b60405190151581526020015b60405180910390f35b3480156102ad57600080fd5b506102b66107f7565b60405161029891906124cb565b3480156102cf57600080fd5b506102e36102de3660046124de565b610889565b6040516001600160a01b039091168152602001610298565b61030e610309366004612513565b6108cd565b005b34801561031c57600080fd5b5061030e61032b3660046124de565b6109ad565b34801561033c57600080fd5b50600154600054035b604051908152602001610298565b61030e61036136600461253d565b610b0e565b34801561037257600080fd5b5061030e610bf9565b34801561038757600080fd5b5061030e610c10565b34801561039c57600080fd5b506102e36daaeb6d7670e522a718067333cd4e81565b61030e6103c036600461253d565b610c58565b3480156103d157600080fd5b5061030e6103e03660046124de565b610d38565b3480156103f157600080fd5b5061030e6104003660046124de565b610d43565b34801561041157600080fd5b5061030e610420366004612579565b610d50565b34801561043157600080fd5b50600d54610345565b34801561044657600080fd5b5061030e610d7a565b34801561045b57600080fd5b50610345610d91565b34801561047057600080fd5b5061030e61047f366004612594565b610da5565b34801561049057600080fd5b506104a461049f366004612652565b610db9565b60405161029891906126d1565b3480156104bd57600080fd5b5061030e610e85565b3480156104d257600080fd5b506102e36104e13660046124de565b610efa565b3480156104f257600080fd5b5061030e6105013660046124de565b610f05565b34801561051257600080fd5b50610345610521366004612579565b610f12565b34801561053257600080fd5b5061030e610f61565b34801561054757600080fd5b5061030e6105563660046124de565b610f75565b34801561056757600080fd5b5061057b610576366004612579565b61108c565b6040516102989190612713565b34801561059457600080fd5b50600b54610345565b3480156105a957600080fd5b5060085461010090046001600160a01b03166102e3565b3480156105cc57600080fd5b50600e54600160a01b900460ff1661028c565b3480156105eb57600080fd5b506102b6611195565b34801561060057600080fd5b5061057b61060f36600461274b565b6111a4565b34801561062057600080fd5b5061030e61131e565b61030e610637366004612652565b61133b565b34801561064857600080fd5b5061030e61065736600461278c565b6114f4565b34801561066857600080fd5b5061030e6106773660046124de565b6115ca565b61030e61068a3660046127d9565b6115d7565b61030e61069d3660046124de565b6116c5565b3480156106ae57600080fd5b506106c26106bd3660046124de565b6117f3565b60405161029891906128b5565b3480156106db57600080fd5b5061030e6106ea366004612579565b61186b565b3480156106fb57600080fd5b506102b661070a3660046124de565b611954565b34801561071b57600080fd5b5061028c61072a3660046128c3565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b34801561076457600080fd5b5060085460ff1661028c565b34801561077c57600080fd5b5061030e6119d7565b34801561079157600080fd5b5061030e6107a0366004612579565b6119f4565b60006301ffc9a760e01b6001600160e01b0319831614806107d657506380ac58cd60e01b6001600160e01b03198316145b806107f15750635b5e139f60e01b6001600160e01b03198316145b92915050565b606060028054610806906128f6565b80601f0160208091040260200160405190810160405280929190818152602001828054610832906128f6565b801561087f5780601f106108545761010080835404028352916020019161087f565b820191906000526020600020905b81548152906001019060200180831161086257829003601f168201915b5050505050905090565b600061089482611a6a565b6108b1576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600854829060ff161580156108f057506daaeb6d7670e522a718067333cd4e3b15155b1561099e57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa15801561094d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109719190612930565b61099e57604051633b79c77360e21b81526001600160a01b03821660048201526024015b60405180910390fd5b6109a88383611a91565b505050565b6109b5611b31565b600e54600160a01b900460ff16806109dd57506008546001600160a01b036101009091041633145b6109f95760405162461bcd60e51b81526004016109959061294d565b600081118015610a0a575060148111155b610a265760405162461bcd60e51b815260040161099590612974565b600d54610a349060016129d1565b6001546000540310610a585760405162461bcd60e51b8152600401610995906129e9565b600e546001600160a01b03166323b872dd3330610a7e610a77600b5490565b8690611b8a565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af1158015610ad2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af69190612930565b50610b013382611b96565b610b0b6001600955565b50565b600854839060ff16158015610b3157506daaeb6d7670e522a718067333cd4e3b15155b15610be857336001600160a01b03821603610b5657610b51848484611bb0565b610bf3565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc99190612930565b610be857604051633b79c77360e21b8152336004820152602401610995565b610bf3848484611bb0565b50505050565b610c01611d40565b600e805460ff60a01b19169055565b610c18611d40565b6008546040516001600160a01b0361010090920491909116904780156108fc02916000818181858888f19350505050158015610b0b573d6000803e3d6000fd5b600854839060ff16158015610c7b57506daaeb6d7670e522a718067333cd4e3b15155b15610d2d57336001600160a01b03821603610c9b57610b51848484611da0565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015610cea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0e9190612930565b610d2d57604051633b79c77360e21b8152336004820152602401610995565b610bf3848484611da0565b610b0b816001611dbb565b610d4b611d40565b600a55565b610d58611d40565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b610d82611d40565b600e805460ff60b01b19169055565b6000610da06001546000540390565b905090565b610dad611d40565b6109a8600f83836123a7565b60608160008167ffffffffffffffff811115610dd757610dd76127c3565b604051908082528060200260200182016040528015610e2957816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610df55790505b50905060005b828114610e7c57610e57868683818110610e4b57610e4b612a15565b905060200201356117f3565b828281518110610e6957610e69612a15565b6020908102919091010152600101610e2f565b50949350505050565b60085461010090046001600160a01b03166001600160a01b0316336001600160a01b031614610ec757604051635fc483c560e01b815260040160405180910390fd5b60085460ff1615610eeb5760405163905e710760e01b815260040160405180910390fd5b6008805460ff19166001179055565b60006107f182611ef3565b610f0d611d40565b600d55565b60006001600160a01b038216610f3b576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b610f69611d40565b610f736000611f5a565b565b610f7d611b31565b600e54600160a01b900460ff1680610fa557506008546001600160a01b036101009091041633145b610fc15760405162461bcd60e51b81526004016109959061294d565b600081118015610fd2575060148111155b610fee5760405162461bcd60e51b815260040161099590612974565b600d54610ffc9060016129d1565b60015460005403106110205760405162461bcd60e51b8152600401610995906129e9565b600c546001546000540311156110825760405162461bcd60e51b815260206004820152602160248201527f596f752063616e206f6e6c79206d696e7420666f7220657263323020746f6b656044820152603760f91b6064820152608401610995565b610b013382611b96565b6060600080600061109c85610f12565b905060008167ffffffffffffffff8111156110b9576110b96127c3565b6040519080825280602002602001820160405280156110e2578160200160208202803683370190505b50905061110f60408051608081018252600080825260208201819052918101829052606081019190915290565b60005b8386146111895761112281611fb4565b915081604001516111815781516001600160a01b03161561114257815194505b876001600160a01b0316856001600160a01b031603611181578083878060010198508151811061117457611174612a15565b6020026020010181815250505b600101611112565b50909695505050505050565b606060038054610806906128f6565b60608183106111c657604051631960ccad60e11b815260040160405180910390fd5b6000806111d260005490565b9050808411156111e0578093505b60006111eb87610f12565b90508486101561120a5785850381811015611204578091505b5061120e565b5060005b60008167ffffffffffffffff811115611229576112296127c3565b604051908082528060200260200182016040528015611252578160200160208202803683370190505b5090508160000361126857935061131792505050565b6000611273886117f3565b905060008160400151611284575080515b885b8881141580156112965750848714155b1561130b576112a481611fb4565b925082604001516113035782516001600160a01b0316156112c457825191505b8a6001600160a01b0316826001600160a01b03160361130357808488806001019950815181106112f6576112f6612a15565b6020026020010181815250505b600101611286565b50505092835250909150505b9392505050565b611326611d40565b600e805460ff60a01b1916600160a01b179055565b611343611b31565b806113905760405162461bcd60e51b815260206004820152601b60248201527f4d697373696e6720726563697069656e742061646472657373657300000000006044820152606401610995565b6008546001600160a01b036101009091041633146113e95760405162461bcd60e51b815260206004820152601660248201527504f6e6c79206f776e65722063616e2061697264726f760541b6044820152606401610995565b80158015906113f9575060148111155b6114555760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2064726f70206d696e696d756d20312c206d6178696d756d206044820152663230204e46547360c81b6064820152608401610995565b600d546114639060016129d1565b61147a6114736001546000540390565b8390611ff0565b106114975760405162461bcd60e51b8152600401610995906129e9565b60005b818110156114e5576114d38383838181106114b7576114b7612a15565b90506020020160208101906114cc9190612579565b6001611b96565b806114dd81612a2b565b91505061149a565b506114f06001600955565b5050565b600854829060ff1615801561151757506daaeb6d7670e522a718067333cd4e3b15155b156115c057604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611574573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115989190612930565b6115c057604051633b79c77360e21b81526001600160a01b0382166004820152602401610995565b6109a88383611ffc565b6115d2611d40565b600b55565b600854849060ff161580156115fa57506daaeb6d7670e522a718067333cd4e3b15155b156116b257336001600160a01b038216036116205761161b85858585612068565b6116be565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa15801561166f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116939190612930565b6116b257604051633b79c77360e21b8152336004820152602401610995565b6116be85858585612068565b5050505050565b6116cd611b31565b600e54600160a01b900460ff16806116f557506008546001600160a01b036101009091041633145b6117115760405162461bcd60e51b81526004016109959061294d565b600081118015611722575060148111155b61173e5760405162461bcd60e51b815260040161099590612974565b600d5461174c9060016129d1565b60015460005403106117705760405162461bcd60e51b8152600401610995906129e9565b6008546001600160a01b036101009091041633148061179b5750600a546117979082611b8a565b3410155b6110825760405162461bcd60e51b815260206004820152602360248201527f45746865722076616c75652073656e742069732062656c6f772074686520707260448201526269636560e81b6064820152608401610995565b60408051608080820183526000808352602080840182905283850182905260608085018390528551938401865282845290830182905293820181905292810183905290915060005483106118475792915050565b61185083611fb4565b90508060400151156118625792915050565b611317836120ac565b611873611d40565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156118c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e59190612a44565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611930573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f09190612930565b606061195f82611a6a565b61197c57604051630a14c4b560e41b815260040160405180910390fd5b60006119866120e1565b905080516000036119a65760405180602001604052806000815250611317565b806119b0846120f0565b6040516020016119c1929190612a5d565b6040516020818303038152906040529392505050565b6119df611d40565b600e805460ff60b01b1916600160b01b179055565b6119fc611d40565b6001600160a01b038116611a615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610995565b610b0b81611f5a565b60008054821080156107f1575050600090815260046020526040902054600160e01b161590565b6000611a9c82610efa565b9050336001600160a01b03821614611ad557611ab8813361072a565b611ad5576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600260095403611b835760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610995565b6002600955565b60006113178284612a8c565b6114f0828260405180602001604052806000815250612134565b6000611bbb82611ef3565b9050836001600160a01b0316816001600160a01b031614611bee5760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054611c1a8187335b6001600160a01b039081169116811491141790565b611c4557611c28863361072a565b611c4557604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611c6c57604051633a954ecd60e21b815260040160405180910390fd5b8015611c7757600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b84169003611d0957600184016000818152600460205260408120549003611d07576000548114611d075760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b0316600080516020612b0683398151915260405160405180910390a4505050505050565b6008546001600160a01b03610100909104163314610f735760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610995565b6109a8838383604051806020016040528060008152506115d7565b6000611dc683611ef3565b905080600080611de486600090815260066020526040902080549091565b915091508415611e2457611df9818433611c05565b611e2457611e07833361072a565b611e2457604051632ce44b5f60e11b815260040160405180910390fd5b8015611e2f57600082555b6001600160a01b038316600081815260056020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260046020526040812091909155600160e11b85169003611ebd57600186016000818152600460205260408120549003611ebb576000548114611ebb5760008181526004602052604090208590555b505b60405186906000906001600160a01b03861690600080516020612b06833981519152908390a45050600180548101905550505050565b600081600054811015611f415760008181526004602052604081205490600160e01b82169003611f3f575b80600003611317575060001901600081815260046020526040902054611f1e565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040805160808101825260008082526020820181905291810182905260608101919091526000828152600460205260409020546107f19061219a565b600061131782846129d1565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b612073848484610b0e565b6001600160a01b0383163b15610bf35761208f848484846121e2565b610bf3576040516368d2bf6b60e11b815260040160405180910390fd5b6040805160808101825260008082526020820181905291810182905260608101919091526107f16120dc83611ef3565b61219a565b6060600f8054610806906128f6565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a90048061210a5750819003601f19909101908152919050565b61213e83836122cd565b6001600160a01b0383163b156109a8576000548281035b61216860008683806001019450866121e2565b612185576040516368d2bf6b60e11b815260040160405180910390fd5b8181106121555781600054146116be57600080fd5b604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612217903390899088908890600401612aab565b6020604051808303816000875af1925050508015612252575060408051601f3d908101601f1916820190925261224f91810190612ae8565b60015b6122b0573d808015612280576040519150601f19603f3d011682016040523d82523d6000602084013e612285565b606091505b5080516000036122a8576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b60008054908290036122f25760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b17831790558284019083908390600080516020612b068339815191528180a4600183015b81811461237d5780836000600080516020612b06833981519152600080a4600101612357565b508160000361239e57604051622e076360e81b815260040160405180910390fd5b60005550505050565b8280546123b3906128f6565b90600052602060002090601f0160209004810192826123d5576000855561241b565b82601f106123ee5782800160ff1982351617855561241b565b8280016001018555821561241b579182015b8281111561241b578235825591602001919060010190612400565b5061242792915061242b565b5090565b5b80821115612427576000815560010161242c565b6001600160e01b031981168114610b0b57600080fd5b60006020828403121561246857600080fd5b813561131781612440565b60005b8381101561248e578181015183820152602001612476565b83811115610bf35750506000910152565b600081518084526124b7816020860160208601612473565b601f01601f19169290920160200192915050565b602081526000611317602083018461249f565b6000602082840312156124f057600080fd5b5035919050565b80356001600160a01b038116811461250e57600080fd5b919050565b6000806040838503121561252657600080fd5b61252f836124f7565b946020939093013593505050565b60008060006060848603121561255257600080fd5b61255b846124f7565b9250612569602085016124f7565b9150604084013590509250925092565b60006020828403121561258b57600080fd5b611317826124f7565b600080602083850312156125a757600080fd5b823567ffffffffffffffff808211156125bf57600080fd5b818501915085601f8301126125d357600080fd5b8135818111156125e257600080fd5b8660208285010111156125f457600080fd5b60209290920196919550909350505050565b60008083601f84011261261857600080fd5b50813567ffffffffffffffff81111561263057600080fd5b6020830191508360208260051b850101111561264b57600080fd5b9250929050565b6000806020838503121561266557600080fd5b823567ffffffffffffffff81111561267c57600080fd5b61268885828601612606565b90969095509350505050565b80516001600160a01b0316825260208082015167ffffffffffffffff169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b8181101561118957612700838551612694565b92840192608092909201916001016126ed565b6020808252825182820181905260009190848201906040850190845b818110156111895783518352928401929184019160010161272f565b60008060006060848603121561276057600080fd5b612769846124f7565b95602085013595506040909401359392505050565b8015158114610b0b57600080fd5b6000806040838503121561279f57600080fd5b6127a8836124f7565b915060208301356127b88161277e565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156127ef57600080fd5b6127f8856124f7565b9350612806602086016124f7565b925060408501359150606085013567ffffffffffffffff8082111561282a57600080fd5b818701915087601f83011261283e57600080fd5b813581811115612850576128506127c3565b604051601f8201601f19908116603f01168101908382118183101715612878576128786127c3565b816040528281528a602084870101111561289157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b608081016107f18284612694565b600080604083850312156128d657600080fd5b6128df836124f7565b91506128ed602084016124f7565b90509250929050565b600181811c9082168061290a57607f821691505b60208210810361292a57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561294257600080fd5b81516113178161277e565b6020808252600d908201526c135a5b9d08191a5cd8589b1959609a1b604082015260600190565b60208082526027908201527f596f752063616e206d696e74206d696e696d756d20312c206d6178696d756d206040820152663230204e46547360c81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082198211156129e4576129e46129bb565b500190565b60208082526012908201527145786365656473206d617820737570706c7960701b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060018201612a3d57612a3d6129bb565b5060010190565b600060208284031215612a5657600080fd5b5051919050565b60008351612a6f818460208801612473565b835190830190612a83818360208801612473565b01949350505050565b6000816000190483118215151615612aa657612aa66129bb565b500290565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612ade9083018461249f565b9695505050505050565b600060208284031215612afa57600080fd5b81516113178161244056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212209dd08cad1ae46e10f161b6bbf025ed3a5e767f882e579426465eec434bc18daa64736f6c634300080d0033
Loading...
Loading
Loading...
Loading
OVERVIEW
If we listen, we can understand that it is a store of value. TG: https://t.me/hpos10iMultichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.