Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 16925102 | 609 days ago | IN | 0 ETH | 0.07908656 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ProjectEnvision
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import {ERC721AQueryableUpgradeable, ERC721AUpgradeable, IERC721AUpgradeable} from "@erc721a-upgradable/extensions/ERC721AQueryableUpgradeable.sol"; import {Ownable} from "@solidstate-solidity/access/ownable/Ownable.sol"; import {AddressUtils} from "@solidstate-solidity/utils/AddressUtils.sol"; import {ERC2981, IERC2981} from "@solidstate-solidity/token/common/ERC2981/ERC2981.sol"; import {IERC165} from "@solidstate-solidity/interfaces/IERC165.sol"; import {IERC20} from "@solidstate-solidity/interfaces/IERC20.sol"; import {ERC2981Storage} from "@solidstate-solidity/token/common/ERC2981/ERC2981Storage.sol"; import {OperatorFilterer} from "@closedsea/OperatorFilterer.sol"; import {MerkleProofLib} from "@solady/utils/MerkleProofLib.sol"; import {ITokenWrapper} from "./interfaces/ITokenWrapper.sol"; import {IProjectEnvision} from "./interfaces/IProjectEnvision.sol"; import {ProjectEnvisionStorage} from "./ProjectEnvisionStorage.sol"; contract ProjectEnvision is ERC2981, IProjectEnvision, ERC721AQueryableUpgradeable, OperatorFilterer, Ownable { /// @notice Maximum supply uint256 public constant MAX_SUPPLY = 4500; /** * @notice Initialize the implementation */ function initialize(string memory uri) public initializerERC721A { __ERC721A_init("Project Envision", "PE"); __ERC721AQueryable_init(); _registerForOperatorFiltering(); setBaseUri(uri); setMaxMintQuantity(3, 2, 2); setMintPrices(0.035 ether, 0.038 ether, 0.042 ether); updateRoyalty(address(this), 500); } /** * @notice Mint as a whitelisted person * @param status status (0 = OG, 1 = Whitelist) * @param quantity Quantity to mint * @param merkleProof Merkle proof for the whitelist */ function mintWhitelist( uint64 status, uint64 quantity, bytes32[] calldata merkleProof ) public payable hasValidMerkleProof(status, merkleProof) { ProjectEnvisionStorage.Layout storage pes = ProjectEnvisionStorage .layout(); require(pes.whitelistSale, "Whitelist Sale Not Open"); require(quantity > 0, "Minimum 1"); uint256 mintableSupply = ( status == 0 ? MAX_SUPPLY : MAX_SUPPLY - pes.ogReserve ); require( _totalMinted() + quantity <= mintableSupply, "Above Total Supply" ); uint256 price = status == 0 ? pes.ogPrice : pes.whitelistPrice; require(msg.value >= price * quantity, "Not Enough ETH"); uint64 numMinted = pes.addressMintCount[status][msg.sender] + quantity; uint64 maxMint = status == 0 ? pes.ogMaxMint : pes.whitelistMaxMint; require(numMinted <= maxMint, "Minting Above Limit"); pes.addressMintCount[status][msg.sender] = numMinted; _mint(msg.sender, quantity); } /** * @notice Validate the merkle proof for an nft */ modifier hasValidMerkleProof( uint256 status, bytes32[] calldata merkleProof ) { require(status >= 0 && status <= 1, "Invalid Status"); require( MerkleProofLib.verify( merkleProof, ProjectEnvisionStorage.layout().whitelistMerkleRoot[status], keccak256(abi.encodePacked(msg.sender)) ), "Not Whitelisted" ); _; } /** * @notice Mint an NFT * @param quantity Quantity to mint */ function mint(uint64 quantity) public payable onlyUnsold(quantity) { require( ProjectEnvisionStorage.layout().publicSale, "Public Sale Not Open" ); require(quantity > 0, "Minimum 1"); require( msg.value >= ProjectEnvisionStorage.layout().publicPrice * quantity, "Not Enough ETH" ); uint64 numMinted = _getAux(msg.sender) + quantity; require( numMinted <= ProjectEnvisionStorage.layout().publicMaxMint, "Minting Above Limit" ); _setAux(msg.sender, numMinted); _mint(msg.sender, quantity); } /** * @dev Prevent overshooting supply */ modifier onlyUnsold(uint256 _quantity) { require(_totalMinted() + _quantity <= MAX_SUPPLY, "Above Total Supply"); _; } /** * @dev Prevent contract mints */ modifier onlyEoa() { require(tx.origin == msg.sender, "Not EOA"); _; } /** * @notice Check total minted for an address */ function totalMinted(address address_) public view returns (uint256) { return _getAux(address_); } /** * @notice Admin mint to a wallet */ function mintAsAdmin( address recipient, uint256 quantity ) public onlyOwner onlyUnsold(quantity) { _mint(recipient, quantity); } /** * @notice Set the base token URI */ function setBaseUri(string memory baseURI_) public onlyOwner { ProjectEnvisionStorage.layout().baseURI = baseURI_; } /** * @dev Base token URI */ function _baseURI() internal view virtual override returns (string memory) { return ProjectEnvisionStorage.layout().baseURI; } /** * @notice Return the token URI for an NFT * @param tokenId Token ID */ function tokenURI( uint256 tokenId ) public view virtual override(ERC721AUpgradeable, IERC721AUpgradeable) returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); string memory result = string( abi.encodePacked(baseURI, _toString(tokenId), ".json") ); return bytes(baseURI).length != 0 ? result : ""; } /** * @notice Toggle the public sale */ function toggleSale() public onlyOwner { bool lastState = ProjectEnvisionStorage.layout().publicSale; ProjectEnvisionStorage.layout().publicSale = !lastState; } function getPublicSale() public view returns (bool) { return ProjectEnvisionStorage.layout().publicSale; } /** * @notice Toggle the whitelist sale */ function toggleWhitelistSale() public onlyOwner { bool lastState = ProjectEnvisionStorage.layout().whitelistSale; ProjectEnvisionStorage.layout().whitelistSale = !lastState; } function getWhitelistSale() public view returns (bool) { return ProjectEnvisionStorage.layout().whitelistSale; } /** * @notice Set the maximum mints per wallet * @param ogQty Maximum quantity for og * @param whitelistQty Maximum quantity for whitelist * @param publicQty Maximum quantity for public */ function setMaxMintQuantity( uint64 ogQty, uint64 whitelistQty, uint64 publicQty ) public onlyOwner { ProjectEnvisionStorage.layout().ogMaxMint = ogQty; ProjectEnvisionStorage.layout().whitelistMaxMint = whitelistQty; ProjectEnvisionStorage.layout().publicMaxMint = publicQty; } /** * @notice Set the mint prices */ function setMintPrices( uint256 ogPrice, uint256 whitelistPrice, uint256 publicPrice ) public onlyOwner { ProjectEnvisionStorage.layout().ogPrice = ogPrice; ProjectEnvisionStorage.layout().publicPrice = publicPrice; ProjectEnvisionStorage.layout().whitelistPrice = whitelistPrice; } /** * @notice OG Reserve */ function setOgReserve(uint256 amount) public onlyOwner { ProjectEnvisionStorage.layout().ogReserve = amount; } /** * @notice Return the prices for each part of the sale */ function getSaleState() public view returns (uint64, uint64, uint64, uint256, uint256, uint256) { return ( ProjectEnvisionStorage.layout().ogMaxMint, ProjectEnvisionStorage.layout().whitelistMaxMint, ProjectEnvisionStorage.layout().publicMaxMint, ProjectEnvisionStorage.layout().ogPrice, ProjectEnvisionStorage.layout().whitelistPrice, ProjectEnvisionStorage.layout().publicPrice ); } /** * @notice Sets the merkle root for a specific status */ function setWhitelistMerkleRoot( uint256 status, bytes32 merkleRoot ) external onlyOwner { ProjectEnvisionStorage.layout().whitelistMerkleRoot[ status ] = merkleRoot; } /** * @notice Sets the royalty percentage */ function updateRoyalty( address defaultRoyaltyReceiver, uint16 defaultRoyaltyBPS ) public onlyOwner { ERC2981Storage.Layout storage l = ERC2981Storage.layout(); l.defaultRoyaltyReceiver = defaultRoyaltyReceiver; l.defaultRoyaltyBPS = defaultRoyaltyBPS; } /** * @dev Returns the starting token ID. */ function _startTokenId() internal view virtual override(ERC721AUpgradeable) returns (uint256) { return 1; } function transferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } /** * @notice Withdraw ETH from contract */ function withdraw() external onlyOwner { _withdraw(); } function _withdraw() private { uint256 balance = address(this).balance; AddressUtils.sendValue( payable(0x0dB4bcD94e2F64cEC5a7a87c943a4bf5A51D5436), (balance * 40) / 100 ); AddressUtils.sendValue( payable(0xb397C5bE1E8fE89fb269801e636e278E5A6D7d31), (balance * 40) / 100 ); AddressUtils.sendValue( payable(0xb7419b10A2973384B0390a525Ab84465d4c72ee1), (balance * 20) / 100 ); } function withdrawEverything() external onlyOwner { ITokenWrapper wrappedEther = ITokenWrapper( 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 ); uint256 wethBalance = wrappedEther.balanceOf(address(this)); if (wethBalance > 0) { wrappedEther.withdraw(wethBalance); } ITokenWrapper blur = ITokenWrapper( 0x0000000000A39bb272e79075ade125fd351887Ac ); uint256 blurBalance = blur.balanceOf(address(this)); if (blurBalance > 0) { blur.withdraw(blurBalance); } _withdraw(); } /** * @dev Add support for EIP-2981 */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721AUpgradeable, IERC721AUpgradeable, IERC165) returns (bool) { return interfaceId == 0x2a55205a || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library ERC721AStorage { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } struct Layout { // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 _currentIndex; // The number of tokens burned. uint256 _burnCounter; // Token name string _name; // Token symbol string _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) _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => ERC721AStorage.TokenApprovalRef) _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) _operatorApprovals; } bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.ERC721A'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AUpgradeable.sol'; import {ERC721AStorage} from './ERC721AStorage.sol'; import './ERC721A__Initializable.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721ReceiverUpgradeable { 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 ERC721AUpgradeable is ERC721A__Initializable, IERC721AUpgradeable { using ERC721AStorage for ERC721AStorage.Layout; // ============================================================= // 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; // ============================================================= // CONSTRUCTOR // ============================================================= function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializingERC721A { __ERC721A_init_unchained(name_, symbol_); } function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializingERC721A { ERC721AStorage.layout()._name = name_; ERC721AStorage.layout()._symbol = symbol_; ERC721AStorage.layout()._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 ERC721AStorage.layout()._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 ERC721AStorage.layout()._currentIndex - ERC721AStorage.layout()._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 ERC721AStorage.layout()._currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return ERC721AStorage.layout()._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 ERC721AStorage.layout()._packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (ERC721AStorage.layout()._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 (ERC721AStorage.layout()._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(ERC721AStorage.layout()._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 = ERC721AStorage.layout()._packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); ERC721AStorage.layout()._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 ERC721AStorage.layout()._name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return ERC721AStorage.layout()._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(ERC721AStorage.layout()._packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (ERC721AStorage.layout()._packedOwnerships[index] == 0) { ERC721AStorage.layout()._packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) { if (_startTokenId() <= tokenId) { packed = ERC721AStorage.layout()._packedOwnerships[tokenId]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // If the data at the starting slot does not exist, start the scan. if (packed == 0) { if (tokenId >= ERC721AStorage.layout()._currentIndex) revert OwnerQueryForNonexistentToken(); // 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, `tokenId` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. for (;;) { unchecked { packed = ERC721AStorage.layout()._packedOwnerships[--tokenId]; } if (packed == 0) continue; return packed; } } // Otherwise, the data exists and is not burned. We can skip the scan. // This is possible because we have already achieved the target condition. // This saves 2143 gas on transfers of initialized tokens. 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. See {ERC721A-_approve}. * * Requirements: * * - The caller must own the token or be an approved operator. */ function approve(address to, uint256 tokenId) public payable virtual override { _approve(to, tokenId, true); } /** * @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 ERC721AStorage.layout()._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 { ERC721AStorage.layout()._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 ERC721AStorage.layout()._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 < ERC721AStorage.layout()._currentIndex && // If within bounds, ERC721AStorage.layout()._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) { ERC721AStorage.TokenApprovalRef storage tokenApproval = ERC721AStorage.layout()._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. --ERC721AStorage.layout()._packedAddressData[from]; // Updates: `balance -= 1`. ++ERC721AStorage.layout()._packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. ERC721AStorage.layout()._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 (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != ERC721AStorage.layout()._currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. ERC721AStorage.layout()._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__IERC721ReceiverUpgradeable(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (bytes4 retval) { return retval == ERC721A__IERC721ReceiverUpgradeable(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 = ERC721AStorage.layout()._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`. ERC721AStorage.layout()._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`. ERC721AStorage.layout()._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(); ERC721AStorage.layout()._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 = ERC721AStorage.layout()._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`. ERC721AStorage.layout()._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`. ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); ERC721AStorage.layout()._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 = ERC721AStorage.layout()._currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (ERC721AStorage.layout()._currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Equivalent to `_approve(to, tokenId, false)`. */ function _approve(address to, uint256 tokenId) internal virtual { _approve(to, tokenId, false); } /** * @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: * * - `tokenId` must exist. * * Emits an {Approval} event. */ function _approve( address to, uint256 tokenId, bool approvalCheck ) internal virtual { address owner = ownerOf(tokenId); if (approvalCheck) if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } ERC721AStorage.layout()._tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } // ============================================================= // 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;`. ERC721AStorage.layout()._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`. ERC721AStorage.layout()._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 (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != ERC721AStorage.layout()._currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. ERC721AStorage.layout()._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 { ERC721AStorage.layout()._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 = ERC721AStorage.layout()._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); ERC721AStorage.layout()._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 pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable diamond facet contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ import {ERC721A__InitializableStorage} from './ERC721A__InitializableStorage.sol'; abstract contract ERC721A__Initializable { using ERC721A__InitializableStorage for ERC721A__InitializableStorage.Layout; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializerERC721A() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require( ERC721A__InitializableStorage.layout()._initializing ? _isConstructor() : !ERC721A__InitializableStorage.layout()._initialized, 'ERC721A__Initializable: contract is already initialized' ); bool isTopLevelCall = !ERC721A__InitializableStorage.layout()._initializing; if (isTopLevelCall) { ERC721A__InitializableStorage.layout()._initializing = true; ERC721A__InitializableStorage.layout()._initialized = true; } _; if (isTopLevelCall) { ERC721A__InitializableStorage.layout()._initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializingERC721A() { require( ERC721A__InitializableStorage.layout()._initializing, 'ERC721A__Initializable: contract is not initializing' ); _; } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. address self = address(this); uint256 cs; assembly { cs := extcodesize(self) } return cs == 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base storage for the initialization function for upgradeable diamond facet contracts **/ library ERC721A__InitializableStorage { struct Layout { /* * Indicates that the contract has been initialized. */ bool _initialized; /* * Indicates that the contract is in the process of being initialized. */ bool _initializing; } bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.initializable.facet'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721AUpgradeable { /** * 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 './IERC721AQueryableUpgradeable.sol'; import '../ERC721AUpgradeable.sol'; import '../ERC721A__Initializable.sol'; /** * @title ERC721AQueryable. * * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryableUpgradeable is ERC721A__Initializable, ERC721AUpgradeable, IERC721AQueryableUpgradeable { function __ERC721AQueryable_init() internal onlyInitializingERC721A { __ERC721AQueryable_init_unchained(); } function __ERC721AQueryable_init_unchained() internal onlyInitializingERC721A {} /** * @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 '../IERC721AUpgradeable.sol'; /** * @dev Interface of ERC721AQueryable. */ interface IERC721AQueryableUpgradeable is IERC721AUpgradeable { /** * 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 pragma solidity ^0.8.4; /// @notice Optimized and flexible operator filterer to abide to OpenSea's /// mandatory on-chain royalty enforcement in order for new collections to /// receive royalties. /// For more information, see: /// See: https://github.com/ProjectOpenSea/operator-filter-registry abstract contract OperatorFilterer { /// @dev The default OpenSea operator blocklist subscription. address internal constant _DEFAULT_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6; /// @dev The OpenSea operator filter registry. address internal constant _OPERATOR_FILTER_REGISTRY = 0x000000000000AAeB6D7670E522A718067333cd4E; /// @dev Registers the current contract to OpenSea's operator filter, /// and subscribe to the default OpenSea operator blocklist. /// Note: Will not revert nor update existing settings for repeated registration. function _registerForOperatorFiltering() internal virtual { _registerForOperatorFiltering(_DEFAULT_SUBSCRIPTION, true); } /// @dev Registers the current contract to OpenSea's operator filter. /// Note: Will not revert nor update existing settings for repeated registration. function _registerForOperatorFiltering(address subscriptionOrRegistrantToCopy, bool subscribe) internal virtual { /// @solidity memory-safe-assembly assembly { let functionSelector := 0x7d3e3dbe // `registerAndSubscribe(address,address)`. // Clean the upper 96 bits of `subscriptionOrRegistrantToCopy` in case they are dirty. subscriptionOrRegistrantToCopy := shr(96, shl(96, subscriptionOrRegistrantToCopy)) for {} iszero(subscribe) {} { if iszero(subscriptionOrRegistrantToCopy) { functionSelector := 0x4420e486 // `register(address)`. break } functionSelector := 0xa0af2903 // `registerAndCopyEntries(address,address)`. break } // Store the function selector. mstore(0x00, shl(224, functionSelector)) // Store the `address(this)`. mstore(0x04, address()) // Store the `subscriptionOrRegistrantToCopy`. mstore(0x24, subscriptionOrRegistrantToCopy) // Register into the registry. pop(call(gas(), _OPERATOR_FILTER_REGISTRY, 0, 0x00, 0x44, 0x00, 0x00)) // Restore the part of the free memory pointer that was overwritten, // which is guaranteed to be zero, because of Solidity's memory size limits. mstore(0x24, 0) } } /// @dev Modifier to guard a function and revert if the caller is a blocked operator. modifier onlyAllowedOperator(address from) virtual { if (from != msg.sender) { if (!_isPriorityOperator(msg.sender)) { if (_operatorFilteringEnabled()) _revertIfBlocked(msg.sender); } } _; } /// @dev Modifier to guard a function from approving a blocked operator.. modifier onlyAllowedOperatorApproval(address operator) virtual { if (!_isPriorityOperator(operator)) { if (_operatorFilteringEnabled()) _revertIfBlocked(operator); } _; } /// @dev Helper function that reverts if the `operator` is blocked by the registry. function _revertIfBlocked(address operator) private view { /// @solidity memory-safe-assembly assembly { // Store the function selector of `isOperatorAllowed(address,address)`, // shifted left by 6 bytes, which is enough for 8tb of memory. // We waste 6-3 = 3 bytes to save on 6 runtime gas (PUSH1 0x224 SHL). mstore(0x00, 0xc6171134001122334455) // Store the `address(this)`. mstore(0x1a, address()) // Store the `operator`. mstore(0x3a, operator) // `isOperatorAllowed` always returns true if it does not revert. if iszero(staticcall(gas(), _OPERATOR_FILTER_REGISTRY, 0x16, 0x44, 0x00, 0x00)) { // Bubble up the revert if the staticcall reverts. returndatacopy(0x00, 0x00, returndatasize()) revert(0x00, returndatasize()) } // We'll skip checking if `from` is inside the blacklist. // Even though that can block transferring out of wrapper contracts, // we don't want tokens to be stuck. // Restore the part of the free memory pointer that was overwritten, // which is guaranteed to be zero, if less than 8tb of memory is used. mstore(0x3a, 0) } } /// @dev For deriving contracts to override, so that operator filtering /// can be turned on / off. /// Returns true by default. function _operatorFilteringEnabled() internal view virtual returns (bool) { return true; } /// @dev For deriving contracts to override, so that preferred marketplaces can /// skip operator filtering, helping users save gas. /// Returns false for all inputs by default. function _isPriorityOperator(address) internal view virtual returns (bool) { return false; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Gas optimized verification of proof of inclusion for a leaf in a Merkle tree. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/MerkleProofLib.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/MerkleProofLib.sol) /// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol) library MerkleProofLib { /// @dev Returns whether `leaf` exists in the Merkle tree with `root`, given `proof`. function verify( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool isValid) { /// @solidity memory-safe-assembly assembly { if proof.length { // Left shift by 5 is equivalent to multiplying by 0x20. let end := add(proof.offset, shl(5, proof.length)) // Initialize `offset` to the offset of `proof` in the calldata. let offset := proof.offset // Iterate over proof elements to compute root hash. // prettier-ignore for {} 1 {} { // Slot of `leaf` in scratch space. // If the condition is true: 0x20, otherwise: 0x00. let scratch := shl(5, gt(leaf, calldataload(offset))) // Store elements to hash contiguously in scratch space. // Scratch space is 64 bytes (0x00 - 0x3f) and both elements are 32 bytes. mstore(scratch, leaf) mstore(xor(scratch, 0x20), calldataload(offset)) // Reuse `leaf` to store the hash to reduce stack operations. leaf := keccak256(0x00, 0x40) offset := add(offset, 0x20) // prettier-ignore if iszero(lt(offset, end)) { break } } } isValid := eq(leaf, root) } } /// @dev Returns whether all `leafs` exist in the Merkle tree with `root`, /// given `proof` and `flags`. function verifyMultiProof( bytes32[] calldata proof, bytes32 root, bytes32[] calldata leafs, bool[] calldata flags ) internal pure returns (bool isValid) { // Rebuilds the root by consuming and producing values on a queue. // The queue starts with the `leafs` array, and goes into a `hashes` array. // After the process, the last element on the queue is verified // to be equal to the `root`. // // The `flags` array denotes whether the sibling // should be popped from the queue (`flag == true`), or // should be popped from the `proof` (`flag == false`). /// @solidity memory-safe-assembly assembly { // If the number of flags is correct. // prettier-ignore for {} eq(add(leafs.length, proof.length), add(flags.length, 1)) {} { // For the case where `proof.length + leafs.length == 1`. if iszero(flags.length) { // `isValid = (proof.length == 1 ? proof[0] : leafs[0]) == root`. isValid := eq( calldataload( xor(leafs.offset, mul(xor(proof.offset, leafs.offset), proof.length)) ), root ) break } // We can use the free memory space for the queue. // We don't need to allocate, since the queue is temporary. let hashesFront := mload(0x40) // Copy the leafs into the hashes. // Sometimes, a little memory expansion costs less than branching. // Should cost less, even with a high free memory offset of 0x7d00. // Left shift by 5 is equivalent to multiplying by 0x20. calldatacopy(hashesFront, leafs.offset, shl(5, leafs.length)) // Compute the back of the hashes. let hashesBack := add(hashesFront, shl(5, leafs.length)) // This is the end of the memory for the queue. // We recycle `flags.length` to save on stack variables // (this trick may not always save gas). flags.length := add(hashesBack, shl(5, flags.length)) // We don't need to make a copy of `proof.offset` or `flags.offset`, // as they are pass-by-value (this trick may not always save gas). // prettier-ignore for {} 1 {} { // Pop from `hashes`. let a := mload(hashesFront) // Pop from `hashes`. let b := mload(add(hashesFront, 0x20)) hashesFront := add(hashesFront, 0x40) // If the flag is false, load the next proof, // else, pops from the queue. if iszero(calldataload(flags.offset)) { // Loads the next proof. b := calldataload(proof.offset) proof.offset := add(proof.offset, 0x20) // Unpop from `hashes`. hashesFront := sub(hashesFront, 0x20) } // Advance to the next flag offset. flags.offset := add(flags.offset, 0x20) // Slot of `a` in scratch space. // If the condition is true: 0x20, otherwise: 0x00. let scratch := shl(5, gt(a, b)) // Hash the scratch space and push the result onto the queue. mstore(scratch, a) mstore(xor(scratch, 0x20), b) mstore(hashesBack, keccak256(0x00, 0x40)) hashesBack := add(hashesBack, 0x20) // prettier-ignore if iszero(lt(hashesBack, flags.length)) { break } } // Checks if the last value in the queue is same as the root. isValid := eq(mload(sub(hashesBack, 0x20)), root) break } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC173 } from '../../interfaces/IERC173.sol'; import { IOwnableInternal } from './IOwnableInternal.sol'; interface IOwnable is IOwnableInternal, IERC173 {}
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC173Internal } from '../../interfaces/IERC173Internal.sol'; interface IOwnableInternal is IERC173Internal { error Ownable__NotOwner(); error Ownable__NotTransitiveOwner(); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC173 } from '../../interfaces/IERC173.sol'; import { IOwnable } from './IOwnable.sol'; import { OwnableInternal } from './OwnableInternal.sol'; /** * @title Ownership access control based on ERC173 */ abstract contract Ownable is IOwnable, OwnableInternal { /** * @inheritdoc IERC173 */ function owner() public view virtual returns (address) { return _owner(); } /** * @inheritdoc IERC173 */ function transferOwnership(address account) public virtual onlyOwner { _transferOwnership(account); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC173 } from '../../interfaces/IERC173.sol'; import { AddressUtils } from '../../utils/AddressUtils.sol'; import { IOwnableInternal } from './IOwnableInternal.sol'; import { OwnableStorage } from './OwnableStorage.sol'; abstract contract OwnableInternal is IOwnableInternal { using AddressUtils for address; modifier onlyOwner() { if (msg.sender != _owner()) revert Ownable__NotOwner(); _; } modifier onlyTransitiveOwner() { if (msg.sender != _transitiveOwner()) revert Ownable__NotTransitiveOwner(); _; } function _owner() internal view virtual returns (address) { return OwnableStorage.layout().owner; } function _transitiveOwner() internal view virtual returns (address owner) { owner = _owner(); while (owner.isContract()) { try IERC173(owner).owner() returns (address transitiveOwner) { owner = transitiveOwner; } catch { break; } } } function _transferOwnership(address account) internal virtual { _setOwner(account); } function _setOwner(address account) internal virtual { OwnableStorage.Layout storage l = OwnableStorage.layout(); emit OwnershipTransferred(l.owner, account); l.owner = account; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; library OwnableStorage { struct Layout { address owner; } bytes32 internal constant STORAGE_SLOT = keccak256('solidstate.contracts.storage.Ownable'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC165Internal } from './IERC165Internal.sol'; /** * @title ERC165 interface registration interface * @dev see https://eips.ethereum.org/EIPS/eip-165 */ interface IERC165 is IERC165Internal { /** * @notice query whether contract has registered support for given interface * @param interfaceId interface id * @return bool whether interface is supported */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC165Internal } from './IERC165Internal.sol'; /** * @title ERC165 interface registration interface */ interface IERC165Internal { }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC173Internal } from './IERC173Internal.sol'; /** * @title Contract ownership standard interface * @dev see https://eips.ethereum.org/EIPS/eip-173 */ interface IERC173 is IERC173Internal { /** * @notice get the ERC173 contract owner * @return contract owner */ function owner() external view returns (address); /** * @notice transfer contract ownership to new account * @param account address of new owner */ function transferOwnership(address account) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /** * @title Partial ERC173 interface needed by internal functions */ interface IERC173Internal { event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC20Internal } from './IERC20Internal.sol'; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 is IERC20Internal { /** * @notice query the total minted token supply * @return token supply */ function totalSupply() external view returns (uint256); /** * @notice query the token balance of given account * @param account address to query * @return token balance */ function balanceOf(address account) external view returns (uint256); /** * @notice query the allowance granted from given holder to given spender * @param holder approver of allowance * @param spender recipient of allowance * @return token allowance */ function allowance( address holder, address spender ) external view returns (uint256); /** * @notice grant approval to spender to spend tokens * @dev prefer ERC20Extended functions to avoid transaction-ordering vulnerability (see https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729) * @param spender recipient of allowance * @param amount quantity of tokens approved for spending * @return success status (always true; otherwise function should revert) */ function approve(address spender, uint256 amount) external returns (bool); /** * @notice transfer tokens to given recipient * @param recipient beneficiary of token transfer * @param amount quantity of tokens to transfer * @return success status (always true; otherwise function should revert) */ function transfer( address recipient, uint256 amount ) external returns (bool); /** * @notice transfer tokens to given recipient on behalf of given holder * @param holder holder of tokens prior to transfer * @param recipient beneficiary of token transfer * @param amount quantity of tokens to transfer * @return success status (always true; otherwise function should revert) */ function transferFrom( address holder, address recipient, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /** * @title Partial ERC20 interface needed by internal functions */ interface IERC20Internal { event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC165 } from './IERC165.sol'; import { IERC2981Internal } from './IERC2981Internal.sol'; /** * @title ERC2981 interface * @dev see https://eips.ethereum.org/EIPS/eip-2981 */ interface IERC2981 is IERC2981Internal, IERC165 { /** * @notice called with the sale price to determine how much royalty is owed and to whom * @param tokenId the ERC721 or ERC1155 token id to query for royalty information * @param salePrice the sale price of the given asset * @return receiever rightful recipient of royalty * @return royaltyAmount amount of royalty owed */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiever, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /** * @title ERC2981 interface */ interface IERC2981Internal { }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC2981 } from '../../../interfaces/IERC2981.sol'; import { ERC2981Storage } from './ERC2981Storage.sol'; import { ERC2981Internal } from './ERC2981Internal.sol'; /** * @title ERC2981 implementation */ abstract contract ERC2981 is IERC2981, ERC2981Internal { /** * @notice inheritdoc IERC2981 */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address, uint256) { return _royaltyInfo(tokenId, salePrice); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { ERC2981Storage } from './ERC2981Storage.sol'; import { IERC2981Internal } from '../../../interfaces/IERC2981Internal.sol'; /** * @title ERC2981 internal functions */ abstract contract ERC2981Internal is IERC2981Internal { /** * @notice calculate how much royalty is owed and to whom * @dev royalty must be paid in addition to, rather than deducted from, salePrice * @param tokenId the ERC721 or ERC1155 token id to query for royalty information * @param salePrice the sale price of the given asset * @return royaltyReceiver rightful recipient of royalty * @return royalty amount of royalty owed */ function _royaltyInfo( uint256 tokenId, uint256 salePrice ) internal view virtual returns (address royaltyReceiver, uint256 royalty) { uint256 royaltyBPS = _getRoyaltyBPS(tokenId); // intermediate multiplication overflow is theoretically possible here, but // not an issue in practice because of practical constraints of salePrice return (_getRoyaltyReceiver(tokenId), (royaltyBPS * salePrice) / 10000); } /** * @notice query the royalty rate (denominated in basis points) for given token id * @dev implementation supports per-token-id values as well as a global default * @param tokenId token whose royalty rate to query * @return royaltyBPS royalty rate */ function _getRoyaltyBPS( uint256 tokenId ) internal view virtual returns (uint16 royaltyBPS) { ERC2981Storage.Layout storage l = ERC2981Storage.layout(); royaltyBPS = l.royaltiesBPS[tokenId]; if (royaltyBPS == 0) { royaltyBPS = l.defaultRoyaltyBPS; } } /** * @notice query the royalty receiver for given token id * @dev implementation supports per-token-id values as well as a global default * @param tokenId token whose royalty receiver to query * @return royaltyReceiver royalty receiver */ function _getRoyaltyReceiver( uint256 tokenId ) internal view virtual returns (address royaltyReceiver) { ERC2981Storage.Layout storage l = ERC2981Storage.layout(); royaltyReceiver = l.royaltyReceivers[tokenId]; if (royaltyReceiver == address(0)) { royaltyReceiver = l.defaultRoyaltyReceiver; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; library ERC2981Storage { struct Layout { // token id -> royalty (denominated in basis points) mapping(uint256 => uint16) royaltiesBPS; uint16 defaultRoyaltyBPS; // token id -> receiver address mapping(uint256 => address) royaltyReceivers; address defaultRoyaltyReceiver; } bytes32 internal constant STORAGE_SLOT = keccak256('solidstate.contracts.storage.ERC2981'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { UintUtils } from './UintUtils.sol'; library AddressUtils { using UintUtils for uint256; error AddressUtils__InsufficientBalance(); error AddressUtils__NotContract(); error AddressUtils__SendValueFailed(); function toString(address account) internal pure returns (string memory) { return uint256(uint160(account)).toHexString(20); } function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable account, uint256 amount) internal { (bool success, ) = account.call{ value: amount }(''); if (!success) revert AddressUtils__SendValueFailed(); } function functionCall( address target, bytes memory data ) internal returns (bytes memory) { return functionCall(target, data, 'AddressUtils: failed low-level call'); } function functionCall( address target, bytes memory data, string memory error ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, error); } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue( target, data, value, 'AddressUtils: failed low-level call with value' ); } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory error ) internal returns (bytes memory) { if (value > address(this).balance) revert AddressUtils__InsufficientBalance(); return _functionCallWithValue(target, data, value, error); } /** * @notice execute arbitrary external call with limited gas usage and amount of copied return data * @dev derived from https://github.com/nomad-xyz/ExcessivelySafeCall (MIT License) * @param target recipient of call * @param gasAmount gas allowance for call * @param value native token value to include in call * @param maxCopy maximum number of bytes to copy from return data * @param data encoded call data * @return success whether call is successful * @return returnData copied return data */ function excessivelySafeCall( address target, uint256 gasAmount, uint256 value, uint16 maxCopy, bytes memory data ) internal returns (bool success, bytes memory returnData) { returnData = new bytes(maxCopy); assembly { // execute external call via assembly to avoid automatic copying of return data success := call( gasAmount, target, value, add(data, 0x20), mload(data), 0, 0 ) // determine whether to limit amount of data to copy let toCopy := returndatasize() if gt(toCopy, maxCopy) { toCopy := maxCopy } // store the length of the copied bytes mstore(returnData, toCopy) // copy the bytes from returndata[0:toCopy] returndatacopy(add(returnData, 0x20), 0, toCopy) } } function _functionCallWithValue( address target, bytes memory data, uint256 value, string memory error ) private returns (bytes memory) { if (!isContract(target)) revert AddressUtils__NotContract(); (bool success, bytes memory returnData) = target.call{ value: value }( data ); if (success) { return returnData; } else if (returnData.length > 0) { assembly { let returnData_size := mload(returnData) revert(add(32, returnData), returnData_size) } } else { revert(error); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /** * @title utility functions for uint256 operations * @dev derived from https://github.com/OpenZeppelin/openzeppelin-contracts/ (MIT license) */ library UintUtils { error UintUtils__InsufficientHexLength(); bytes16 private constant HEX_SYMBOLS = '0123456789abcdef'; function add(uint256 a, int256 b) internal pure returns (uint256) { return b < 0 ? sub(a, -b) : a + uint256(b); } function sub(uint256 a, int256 b) internal pure returns (uint256) { return b < 0 ? add(a, -b) : a - uint256(b); } function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return '0'; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return '0x00'; } uint256 length = 0; for (uint256 temp = value; temp != 0; temp >>= 8) { unchecked { length++; } } return toHexString(value, length); } function toHexString( uint256 value, uint256 length ) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = '0'; buffer[1] = 'x'; unchecked { for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_SYMBOLS[value & 0xf]; value >>= 4; } } if (value != 0) revert UintUtils__InsufficientHexLength(); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; library ProjectEnvisionStorage { struct Layout { /// @notice Base URI of the NFT string baseURI; /// @notice Whitelist sale bool whitelistSale; /// @notice Public sale bool publicSale; /// @notice OG price uint256 ogPrice; /// @notice Maximum per wallet uint64 ogMaxMint; /// @notice Whitelist price uint256 whitelistPrice; /// @notice Maximum per wallet uint64 whitelistMaxMint; /// @notice Actual Price uint256 publicPrice; /// @notice Maximum per wallet uint64 publicMaxMint; /// @notice Whitelist merkle root bytes32[2] whitelistMerkleRoot; /// @notice Tier mint count mapping(uint64 => mapping(address => uint64)) addressMintCount; /// @notice OG Reserve uint256 ogReserve; } bytes32 internal constant STORAGE_SLOT = keccak256("ProjectEnvision.contracts.storage.ProjectEnvision"); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IERC721AUpgradeable} from "@erc721a-upgradable/IERC721AUpgradeable.sol"; interface IProjectEnvision is IERC721AUpgradeable { }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ITokenWrapper { function balanceOf(address user) external view returns (uint256); function withdraw(uint256 amount) external; }
{ "remappings": [ "@closedsea/=lib/closedsea/src/", "@erc721a-upgradable/=lib/ERC721A-Upgradeable/contracts/", "@erc721a/=lib/ERC721A/contracts/", "@os/=lib/operator-filter-registry/src/", "@solady/=lib/solady/src/", "@solidstate-solidity/=lib/solidstate-solidity/contracts/", "@std/=lib/forge-std/src/", "ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/", "ERC721A/=lib/ERC721A/contracts/", "closedsea/=lib/closedsea/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/closedsea/lib/openzeppelin-contracts/lib/erc4626-tests/", "erc721a-upgradeable/=lib/closedsea/lib/erc721a-upgradeable/contracts/", "erc721a/=lib/closedsea/lib/erc721a/contracts/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts-upgradeable/=lib/closedsea/lib/openzeppelin-contracts-upgradeable/contracts/", "openzeppelin-contracts/=lib/closedsea/lib/openzeppelin-contracts/contracts/", "operator-filter-registry/=lib/operator-filter-registry/src/", "solady/=lib/solady/src/", "solidstate-solidity/=lib/solidstate-solidity/contracts/", "solmate/=lib/solady/lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"AddressUtils__SendValueFailed","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":"Ownable__NotOwner","type":"error"},{"inputs":[],"name":"Ownable__NotTransitiveOwner","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":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","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":"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 IERC721AUpgradeable.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 IERC721AUpgradeable.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPublicSale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSaleState","outputs":[{"internalType":"uint64","name":"","type":"uint64"},{"internalType":"uint64","name":"","type":"uint64"},{"internalType":"uint64","name":"","type":"uint64"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistSale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"quantity","type":"uint64"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintAsAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"status","type":"uint64"},{"internalType":"uint64","name":"quantity","type":"uint64"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mintWhitelist","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"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":"baseURI_","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"ogQty","type":"uint64"},{"internalType":"uint64","name":"whitelistQty","type":"uint64"},{"internalType":"uint64","name":"publicQty","type":"uint64"}],"name":"setMaxMintQuantity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"ogPrice","type":"uint256"},{"internalType":"uint256","name":"whitelistPrice","type":"uint256"},{"internalType":"uint256","name":"publicPrice","type":"uint256"}],"name":"setMintPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setOgReserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"status","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"setWhitelistMerkleRoot","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":[],"name":"toggleSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleWhitelistSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":[{"internalType":"address","name":"address_","type":"address"}],"name":"totalMinted","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":"account","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"defaultRoyaltyReceiver","type":"address"},{"internalType":"uint16","name":"defaultRoyaltyBPS","type":"uint16"}],"name":"updateRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawEverything","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50613406806100206000396000f3fe60806040526004361061023a5760003560e01c806370a082311161012e578063c15b38d6116100ab578063e985e9c51161006f578063e985e9c5146106a9578063ebdf0919146106c9578063f2fde38b146106e9578063f62d188814610709578063fb9d09c81461072957600080fd5b8063c15b38d614610607578063c23dc68f14610627578063c87b56dd14610654578063d1e191a414610674578063e1b6d92e1461068957600080fd5b806399a2557a116100f257806399a2557a146105745780639ad5db2614610594578063a0bcfc7f146105b4578063a22cb465146105d4578063b88d4fde146105f457600080fd5b806370a08231146104e85780637d8966e4146105085780638462151c1461051d5780638da5cb5b1461054a57806395d89b411461055f57600080fd5b80633bc996c5116101bc5780635bbb2177116101805780635bbb2177146104485780635d125272146104755780636352211e146104885780636cbca547146104a85780636fb081a4146104c857600080fd5b80633bc996c5146103e15780633ccfd60b146103f657806342842e0e1461040b5780634bf530551461041e57806359eda1b51461043357600080fd5b806318160ddd1161020357806318160ddd1461031157806323b872dd1461032657806325bdb2a8146103395780632a55205a1461038c57806332cb6b0c146103cb57600080fd5b80623d47901461023f57806301ffc9a71461027257806306fdde03146102a2578063081812fc146102c4578063095ea7b3146102fc575b600080fd5b34801561024b57600080fd5b5061025f61025a366004612ad4565b61073c565b6040519081526020015b60405180910390f35b34801561027e57600080fd5b5061029261028d366004612b05565b610756565b6040519015158152602001610269565b3480156102ae57600080fd5b506102b7610781565b6040516102699190612b72565b3480156102d057600080fd5b506102e46102df366004612b85565b61081c565b6040516001600160a01b039091168152602001610269565b61030f61030a366004612b9e565b610869565b005b34801561031d57600080fd5b5061025f610879565b61030f610334366004612bc8565b610899565b34801561034557600080fd5b5061034e6108c4565b604080516001600160401b039788168152958716602087015293909516928401929092526060830152608082015260a081019190915260c001610269565b34801561039857600080fd5b506103ac6103a7366004612c04565b610943565b604080516001600160a01b039093168352602083019190915201610269565b3480156103d757600080fd5b5061025f61119481565b3480156103ed57600080fd5b5061029261095c565b34801561040257600080fd5b5061030f610972565b61030f610419366004612bc8565b6109b5565b34801561042a57600080fd5b506102926109da565b34801561043f57600080fd5b5061030f6109f5565b34801561045457600080fd5b50610468610463366004612c6a565b610a60565b6040516102699190612ce7565b61030f610483366004612d40565b610b2b565b34801561049457600080fd5b506102e46104a3366004612b85565b610eb3565b3480156104b457600080fd5b5061030f6104c3366004612da0565b610ebe565b3480156104d457600080fd5b5061030f6104e3366004612de3565b610f7d565b3480156104f457600080fd5b5061025f610503366004612ad4565b610fe2565b34801561051457600080fd5b5061030f61104a565b34801561052957600080fd5b5061053d610538366004612ad4565b6110c1565b6040516102699190612e0f565b34801561055657600080fd5b506102e46111c9565b34801561056b57600080fd5b506102b76111d8565b34801561058057600080fd5b5061053d61058f366004612e47565b6111f0565b3480156105a057600080fd5b5061030f6105af366004612b85565b611376565b3480156105c057600080fd5b5061030f6105cf366004612f05565b6113bf565b3480156105e057600080fd5b5061030f6105ef366004612f4d565b61140c565b61030f610602366004612f89565b611489565b34801561061357600080fd5b5061030f610622366004612c04565b6114b6565b34801561063357600080fd5b50610647610642366004612b85565b611512565b6040516102699190613004565b34801561066057600080fd5b506102b761066f366004612b85565b61159f565b34801561068057600080fd5b5061030f611629565b34801561069557600080fd5b5061030f6106a4366004612b9e565b61181b565b3480156106b557600080fd5b506102926106c4366004613012565b611898565b3480156106d557600080fd5b5061030f6106e4366004613045565b6118d5565b3480156106f557600080fd5b5061030f610704366004612ad4565b611984565b34801561071557600080fd5b5061030f610724366004612f05565b6119c9565b61030f610737366004613078565b611b70565b600061074782611d3d565b6001600160401b031692915050565b600063152a902d60e11b6001600160e01b03198316148061077b575061077b82611d70565b92915050565b606061078b611dbe565b600201805461079990613093565b80601f01602080910402602001604051908101604052809291908181526020018280546107c590613093565b80156108125780601f106107e757610100808354040283529160200191610812565b820191906000526020600020905b8154815290600101906020018083116107f557829003601f168201915b5050505050905090565b600061082782611de2565b610844576040516333d1c03960e21b815260040160405180910390fd5b61084c611dbe565b60009283526006016020525060409020546001600160a01b031690565b61087582826001611e2b565b5050565b60006001610885611dbe565b60010154610891611dbe565b540303919050565b826001600160a01b03811633146108b3576108b333611ee0565b6108be848484611f24565b50505050565b6000806000806000806108d561211b565b600301546001600160401b03166108ea61211b565b600501546001600160401b03166108ff61211b565b600701546001600160401b031661091461211b565b6002015461092061211b565b6004015461092c61211b565b60060154949b939a50919850965094509092509050565b600080610950848461213f565b915091505b9250929050565b600061096661211b565b6001015460ff16919050565b61097a61217f565b6001600160a01b0316336001600160a01b0316146109ab57604051632f7a8ee160e01b815260040160405180910390fd5b6109b36121ad565b565b826001600160a01b03811633146109cf576109cf33611ee0565b6108be84848461222c565b60006109e461211b565b60010154610100900460ff16919050565b6109fd61217f565b6001600160a01b0316336001600160a01b031614610a2e57604051632f7a8ee160e01b815260040160405180910390fd5b6000610a3861211b565b6001015460ff1690508015610a4b61211b565b600101805460ff191691151591909117905550565b6060816000816001600160401b03811115610a7d57610a7d612e7a565b604051908082528060200260200182016040528015610acf57816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610a9b5790505b50905060005b828114610b2257610afd868683818110610af157610af16130c7565b90506020020135611512565b828281518110610b0f57610b0f6130c7565b6020908102919091010152600101610ad5565b50949350505050565b6001600160401b03841682826001831115610b7e5760405162461bcd60e51b815260206004820152600e60248201526d496e76616c69642053746174757360901b60448201526064015b60405180910390fd5b610bda8282610b8b61211b565b6008018660028110610b9f57610b9f6130c7565b01546040516bffffffffffffffffffffffff193360601b16602082015260340160405160208183030381529060405280519060200120612247565b610c185760405162461bcd60e51b815260206004820152600f60248201526e139bdd0815da1a5d195b1a5cdd1959608a1b6044820152606401610b75565b6000610c2261211b565b600181015490915060ff16610c795760405162461bcd60e51b815260206004820152601760248201527f57686974656c6973742053616c65204e6f74204f70656e0000000000000000006044820152606401610b75565b6000876001600160401b031611610cbe5760405162461bcd60e51b81526020600482015260096024820152684d696e696d756d203160b81b6044820152606401610b75565b60006001600160401b03891615610ce557600b820154610ce0906111946130f3565b610ce9565b6111945b905080886001600160401b0316610cfe612281565b610d089190613106565b1115610d265760405162461bcd60e51b8152600401610b7590613119565b60006001600160401b038a1615610d41578260040154610d47565b82600201545b9050610d5c6001600160401b038a1682613145565b341015610d9c5760405162461bcd60e51b815260206004820152600e60248201526d09cdee8408adcdeeaced0408aa8960931b6044820152606401610b75565b6001600160401b03808b166000908152600a8501602090815260408083203384529091528120549091610dd1918c911661315c565b905060006001600160401b038c1615610df75760058501546001600160401b0316610e06565b60038501546001600160401b03165b9050806001600160401b0316826001600160401b03161115610e605760405162461bcd60e51b8152602060048201526013602482015272135a5b9d1a5b99c810589bdd9948131a5b5a5d606a1b6044820152606401610b75565b6001600160401b038c81166000908152600a870160209081526040808320338085529252909120805467ffffffffffffffff1916858416179055610ea5918d16612294565b505050505050505050505050565b600061077b826123cf565b610ec661217f565b6001600160a01b0316336001600160a01b031614610ef757604051632f7a8ee160e01b815260040160405180910390fd5b82610f0061211b565b600301805467ffffffffffffffff19166001600160401b039290921691909117905581610f2b61211b565b600501805467ffffffffffffffff19166001600160401b039290921691909117905580610f5661211b565b600701805467ffffffffffffffff19166001600160401b0392909216919091179055505050565b610f8561217f565b6001600160a01b0316336001600160a01b031614610fb657604051632f7a8ee160e01b815260040160405180910390fd5b82610fbf61211b565b6002015580610fcc61211b565b6006015581610fd961211b565b60040155505050565b60006001600160a01b03821661100b576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b0361101b611dbe565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b61105261217f565b6001600160a01b0316336001600160a01b03161461108357604051632f7a8ee160e01b815260040160405180910390fd5b600061108d61211b565b60010154610100900460ff16905080156110a561211b565b60010180549115156101000261ff001990921691909117905550565b606060008060006110d185610fe2565b90506000816001600160401b038111156110ed576110ed612e7a565b604051908082528060200260200182016040528015611116578160200160208202803683370190505b50905061114360408051608081018252600080825260208201819052918101829052606081019190915290565b60015b8386146111bd576111568161247c565b915081604001516111b55781516001600160a01b03161561117657815194505b876001600160a01b0316856001600160a01b0316036111b557808387806001019850815181106111a8576111a86130c7565b6020026020010181815250505b600101611146565b50909695505050505050565b60006111d361217f565b905090565b60606111e2611dbe565b600301805461079990613093565b606081831061121257604051631960ccad60e11b815260040160405180910390fd5b60008061121d6124c3565b9050600185101561122d57600194505b80841115611239578093505b600061124487610fe2565b905084861015611263578585038181101561125d578091505b50611267565b5060005b6000816001600160401b0381111561128157611281612e7a565b6040519080825280602002602001820160405280156112aa578160200160208202803683370190505b509050816000036112c057935061136f92505050565b60006112cb88611512565b9050600081604001516112dc575080515b885b8881141580156112ee5750848714155b15611363576112fc8161247c565b9250826040015161135b5782516001600160a01b03161561131c57825191505b8a6001600160a01b0316826001600160a01b03160361135b578084888060010199508151811061134e5761134e6130c7565b6020026020010181815250505b6001016112de565b50505092835250909150505b9392505050565b61137e61217f565b6001600160a01b0316336001600160a01b0316146113af57604051632f7a8ee160e01b815260040160405180910390fd5b806113b861211b565b600b015550565b6113c761217f565b6001600160a01b0316336001600160a01b0316146113f857604051632f7a8ee160e01b815260040160405180910390fd5b8061140161211b565b9061087590826131c9565b80611415611dbe565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b836001600160a01b03811633146114a3576114a333611ee0565b6114af858585856124d3565b5050505050565b6114be61217f565b6001600160a01b0316336001600160a01b0316146114ef57604051632f7a8ee160e01b815260040160405180910390fd5b806114f861211b565b600801836002811061150c5761150c6130c7565b01555050565b6040805160808101825260008082526020820181905291810182905260608101919091526040805160808101825260008082526020820181905291810182905260608101919091526001831080611570575061156c6124c3565b8310155b1561157b5792915050565b6115848361247c565b90508060400151156115965792915050565b61136f83612517565b60606115aa82611de2565b6115c757604051630a14c4b560e41b815260040160405180910390fd5b60006115d161254c565b90506000816115df85612561565b6040516020016115f0929190613288565b6040516020818303038152906040529050815160000361161f5760405180602001604052806000815250611621565b805b949350505050565b61163161217f565b6001600160a01b0316336001600160a01b03161461166257604051632f7a8ee160e01b815260040160405180910390fd5b6040516370a0823160e01b815230600482015273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29060009082906370a0823190602401602060405180830381865afa1580156116b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116da91906132c7565b9050801561173d57604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b15801561172457600080fd5b505af1158015611738573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526ea39bb272e79075ade125fd351887ac9060009082906370a0823190602401602060405180830381865afa15801561178c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b091906132c7565b9050801561181357604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156117fa57600080fd5b505af115801561180e573d6000803e3d6000fd5b505050505b6108be6121ad565b61182361217f565b6001600160a01b0316336001600160a01b03161461185457604051632f7a8ee160e01b815260040160405180910390fd5b8061119481611861612281565b61186b9190613106565b11156118895760405162461bcd60e51b8152600401610b7590613119565b6118938383612294565b505050565b60006118a2611dbe565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b6118dd61217f565b6001600160a01b0316336001600160a01b03161461190e57604051632f7a8ee160e01b815260040160405180910390fd5b7ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b282280546001600160a01b0319166001600160a01b0393909316929092179091557ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b2820805461ffff191661ffff909216919091179055565b61198c61217f565b6001600160a01b0316336001600160a01b0316146119bd57604051632f7a8ee160e01b815260040160405180910390fd5b6119c6816125a5565b50565b6000805160206133b183398151915254610100900460ff166119fe576000805160206133b18339815191525460ff1615611a02565b303b155b611a745760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610b75565b6000805160206133b183398151915254610100900460ff16158015611ab0576000805160206133b1833981519152805461ffff19166101011790555b611afc6040518060400160405280601081526020016f283937b532b1ba1022b73b34b9b4b7b760811b81525060405180604001604052806002815260200161504560f01b8152506125ae565b611b046125ec565b611b0c612628565b611b15826113bf565b611b226003600280610ebe565b611b42667c585087238000668700cc75770000669536c708910000610f7d565b611b4e306101f46118d5565b80156108755750506000805160206133b1833981519152805461ff0019169055565b806001600160401b031661119481611b86612281565b611b909190613106565b1115611bae5760405162461bcd60e51b8152600401610b7590613119565b611bb661211b565b60010154610100900460ff16611c055760405162461bcd60e51b8152602060048201526014602482015273283ab13634b19029b0b632902737ba1027b832b760611b6044820152606401610b75565b6000826001600160401b031611611c4a5760405162461bcd60e51b81526020600482015260096024820152684d696e696d756d203160b81b6044820152606401610b75565b816001600160401b0316611c5c61211b565b60060154611c6a9190613145565b341015611caa5760405162461bcd60e51b815260206004820152600e60248201526d09cdee8408adcdeeaced0408aa8960931b6044820152606401610b75565b600082611cb633611d3d565b611cc0919061315c565b9050611cca61211b565b600701546001600160401b039081169082161115611d205760405162461bcd60e51b8152602060048201526013602482015272135a5b9d1a5b99c810589bdd9948131a5b5a5d606a1b6044820152606401610b75565b611d2a3382612647565b61189333846001600160401b0316612294565b600060c0611d49611dbe565b6001600160a01b03909316600090815260059390930160205260409092205490911c919050565b60006301ffc9a760e01b6001600160e01b031983161480611da157506380ac58cd60e01b6001600160e01b03198316145b8061077b5750506001600160e01b031916635b5e139f60e01b1490565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b600081600111158015611dfc5750611df8611dbe565b5482105b801561077b5750600160e01b611e10611dbe565b60008481526004919091016020526040902054161592915050565b6000611e3683610eb3565b90508115611e7557336001600160a01b03821614611e7557611e588133611898565b611e75576040516367d9dca160e11b815260040160405180910390fd5b83611e7e611dbe565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa611f1c573d6000803e3d6000fd5b6000603a5250565b6000611f2f826123cf565b9050836001600160a01b0316816001600160a01b031614611f625760405162a1148160e81b815260040160405180910390fd5b600080611f6e846126b0565b91509150611f938187611f7e3390565b6001600160a01b039081169116811491141790565b611fbe57611fa18633611898565b611fbe57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611fe557604051633a954ecd60e21b815260040160405180910390fd5b8015611ff057600082555b611ff8611dbe565b6001600160a01b0387166000908152600591909101602052604090208054600019019055612024611dbe565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b1761205b611dbe565b60008681526004919091016020526040812091909155600160e11b841690036120d1576001840161208a611dbe565b6000828152600491909101602052604081205490036120cf576120ab611dbe565b5481146120cf57836120bb611dbe565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b7f270c533d28f00dd65e3b7f8153c97cb575f81183d846e4f29c9618c9428eb77a90565b600080600061214d856126d8565b61ffff16905061215c85612726565b6127106121698684613145565b61217391906132e0565b92509250509250929050565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f671680460546001600160a01b031690565b476121e2730db4bcd94e2f64cec5a7a87c943a4bf5a51d543660646121d3846028613145565b6121dd91906132e0565b612796565b61220773b397c5be1e8fe89fb269801e636e278e5a6d7d3160646121d3846028613145565b6119c673b7419b10a2973384b0390a525ab84465d4c72ee160646121d3846014613145565b61189383838360405180602001604052806000815250611489565b60008315612279578360051b8501855b803580851160051b948552602094851852604060002093018181106122575750505b501492915050565b6000600161228d611dbe565b5403919050565b600061229e611dbe565b54905060008290036122c35760405163b562e8dd60e01b815260040160405180910390fd5b6801000000000000000182026122d7611dbe565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b6001841460e11b1717612312611dbe565b600083815260049190910160205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b81811461239c57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101612364565b50816000036123bd57604051622e076360e81b815260040160405180910390fd5b806123c6611dbe565b55506118939050565b600081600111612463576123e1611dbe565b600083815260049190910160205260408120549150600160e01b82169003612463578060000361245e57612413611dbe565b54821061243357604051636f96cda160e11b815260040160405180910390fd5b61243b611dbe565b600019909201600081815260049390930160205260409092205490508015612433575b919050565b604051636f96cda160e11b815260040160405180910390fd5b60408051608081018252600080825260208201819052918101829052606081019190915261077b6124ab611dbe565b6000848152600491909101602052604090205461280a565b60006124cd611dbe565b54919050565b6124de848484610899565b6001600160a01b0383163b156108be576124fa84848484612851565b6108be576040516368d2bf6b60e11b815260040160405180910390fd5b60408051608081018252600080825260208201819052918101829052606081019190915261077b612547836123cf565b61280a565b606061255661211b565b805461079990613093565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a90048061257b5750819003601f19909101908152919050565b6119c68161293c565b6000805160206133b183398151915254610100900460ff166125e25760405162461bcd60e51b8152600401610b7590613302565b61087582826129b6565b6000805160206133b183398151915254610100900460ff166126205760405162461bcd60e51b8152600401610b7590613302565b6109b3612a29565b6109b3733cc6cdda760b79bafa08df41ecfa224f810dceb66001612a5d565b6000612651611dbe565b6001600160a01b038416600090815260059190910160205260409020546001600160c01b031660c083901b1790508181612689611dbe565b6001600160a01b039095166000908152600595909501602052604090942093909355505050565b60008060006126bd611dbe565b60009485526006016020525050604090912080549092909150565b60008181527ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b281f6020819052604082205461ffff169182900361272057600181015461ffff1691505b50919050565b60008181527ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b282160205260409020546001600160a01b03167ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b281f8161272057600301546001600160a01b031692915050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146127e3576040519150601f19603f3d011682016040523d82523d6000602084013e6127e8565b606091505b50509050806118935760405163c6d73c5560e01b815260040160405180910390fd5b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612886903390899088908890600401613356565b6020604051808303816000875af19250505080156128c1575060408051601f3d908101601f191682019092526128be91810190613393565b60015b61291f573d8080156128ef576040519150601f19603f3d011682016040523d82523d6000602084013e6128f4565b606091505b508051600003612917576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f67168046080546040516001600160a01b038481169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a380546001600160a01b0319166001600160a01b0392909216919091179055565b6000805160206133b183398151915254610100900460ff166129ea5760405162461bcd60e51b8152600401610b7590613302565b816129f3611dbe565b60020190612a0190826131c9565b5080612a0b611dbe565b60030190612a1990826131c9565b506001612a24611dbe565b555050565b6000805160206133b183398151915254610100900460ff166109b35760405162461bcd60e51b8152600401610b7590613302565b6001600160a01b0390911690637d3e3dbe81612a8a5782612a835750634420e486612a8a565b5063a0af29035b8060e01b60005250306004528160245260008060446000806daaeb6d7670e522a718067333cd4e5af15060006024525050565b80356001600160a01b038116811461245e57600080fd5b600060208284031215612ae657600080fd5b61136f82612abd565b6001600160e01b0319811681146119c657600080fd5b600060208284031215612b1757600080fd5b813561136f81612aef565b60005b83811015612b3d578181015183820152602001612b25565b50506000910152565b60008151808452612b5e816020860160208601612b22565b601f01601f19169290920160200192915050565b60208152600061136f6020830184612b46565b600060208284031215612b9757600080fd5b5035919050565b60008060408385031215612bb157600080fd5b612bba83612abd565b946020939093013593505050565b600080600060608486031215612bdd57600080fd5b612be684612abd565b9250612bf460208501612abd565b9150604084013590509250925092565b60008060408385031215612c1757600080fd5b50508035926020909101359150565b60008083601f840112612c3857600080fd5b5081356001600160401b03811115612c4f57600080fd5b6020830191508360208260051b850101111561095557600080fd5b60008060208385031215612c7d57600080fd5b82356001600160401b03811115612c9357600080fd5b612c9f85828601612c26565b90969095509350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b818110156111bd57612d16838551612cab565b9284019260809290920191600101612d03565b80356001600160401b038116811461245e57600080fd5b60008060008060608587031215612d5657600080fd5b612d5f85612d29565b9350612d6d60208601612d29565b925060408501356001600160401b03811115612d8857600080fd5b612d9487828801612c26565b95989497509550505050565b600080600060608486031215612db557600080fd5b612dbe84612d29565b9250612dcc60208501612d29565b9150612dda60408501612d29565b90509250925092565b600080600060608486031215612df857600080fd5b505081359360208301359350604090920135919050565b6020808252825182820181905260009190848201906040850190845b818110156111bd57835183529284019291840191600101612e2b565b600080600060608486031215612e5c57600080fd5b612e6584612abd565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115612eaa57612eaa612e7a565b604051601f8501601f19908116603f01168101908282118183101715612ed257612ed2612e7a565b81604052809350858152868686011115612eeb57600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215612f1757600080fd5b81356001600160401b03811115612f2d57600080fd5b8201601f81018413612f3e57600080fd5b61162184823560208401612e90565b60008060408385031215612f6057600080fd5b612f6983612abd565b915060208301358015158114612f7e57600080fd5b809150509250929050565b60008060008060808587031215612f9f57600080fd5b612fa885612abd565b9350612fb660208601612abd565b92506040850135915060608501356001600160401b03811115612fd857600080fd5b8501601f81018713612fe957600080fd5b612ff887823560208401612e90565b91505092959194509250565b6080810161077b8284612cab565b6000806040838503121561302557600080fd5b61302e83612abd565b915061303c60208401612abd565b90509250929050565b6000806040838503121561305857600080fd5b61306183612abd565b9150602083013561ffff81168114612f7e57600080fd5b60006020828403121561308a57600080fd5b61136f82612d29565b600181811c908216806130a757607f821691505b60208210810361272057634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561077b5761077b6130dd565b8082018082111561077b5761077b6130dd565b60208082526012908201527141626f766520546f74616c20537570706c7960701b604082015260600190565b808202811582820484141761077b5761077b6130dd565b6001600160401b0381811683821601908082111561317c5761317c6130dd565b5092915050565b601f82111561189357600081815260208120601f850160051c810160208610156131aa5750805b601f850160051c820191505b81811015612113578281556001016131b6565b81516001600160401b038111156131e2576131e2612e7a565b6131f6816131f08454613093565b84613183565b602080601f83116001811461322b57600084156132135750858301515b600019600386901b1c1916600185901b178555612113565b600085815260208120601f198616915b8281101561325a5788860151825594840194600190910190840161323b565b50858210156132785787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000835161329a818460208801612b22565b8351908301906132ae818360208801612b22565b64173539b7b760d91b9101908152600501949350505050565b6000602082840312156132d957600080fd5b5051919050565b6000826132fd57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061338990830184612b46565b9695505050505050565b6000602082840312156133a557600080fd5b815161136f81612aef56feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa264697066735822122099961a3ede3de190c722352903286b2a525b9749c0a54a8a50c76025021f06aa64736f6c63430008110033
Deployed Bytecode
0x60806040526004361061023a5760003560e01c806370a082311161012e578063c15b38d6116100ab578063e985e9c51161006f578063e985e9c5146106a9578063ebdf0919146106c9578063f2fde38b146106e9578063f62d188814610709578063fb9d09c81461072957600080fd5b8063c15b38d614610607578063c23dc68f14610627578063c87b56dd14610654578063d1e191a414610674578063e1b6d92e1461068957600080fd5b806399a2557a116100f257806399a2557a146105745780639ad5db2614610594578063a0bcfc7f146105b4578063a22cb465146105d4578063b88d4fde146105f457600080fd5b806370a08231146104e85780637d8966e4146105085780638462151c1461051d5780638da5cb5b1461054a57806395d89b411461055f57600080fd5b80633bc996c5116101bc5780635bbb2177116101805780635bbb2177146104485780635d125272146104755780636352211e146104885780636cbca547146104a85780636fb081a4146104c857600080fd5b80633bc996c5146103e15780633ccfd60b146103f657806342842e0e1461040b5780634bf530551461041e57806359eda1b51461043357600080fd5b806318160ddd1161020357806318160ddd1461031157806323b872dd1461032657806325bdb2a8146103395780632a55205a1461038c57806332cb6b0c146103cb57600080fd5b80623d47901461023f57806301ffc9a71461027257806306fdde03146102a2578063081812fc146102c4578063095ea7b3146102fc575b600080fd5b34801561024b57600080fd5b5061025f61025a366004612ad4565b61073c565b6040519081526020015b60405180910390f35b34801561027e57600080fd5b5061029261028d366004612b05565b610756565b6040519015158152602001610269565b3480156102ae57600080fd5b506102b7610781565b6040516102699190612b72565b3480156102d057600080fd5b506102e46102df366004612b85565b61081c565b6040516001600160a01b039091168152602001610269565b61030f61030a366004612b9e565b610869565b005b34801561031d57600080fd5b5061025f610879565b61030f610334366004612bc8565b610899565b34801561034557600080fd5b5061034e6108c4565b604080516001600160401b039788168152958716602087015293909516928401929092526060830152608082015260a081019190915260c001610269565b34801561039857600080fd5b506103ac6103a7366004612c04565b610943565b604080516001600160a01b039093168352602083019190915201610269565b3480156103d757600080fd5b5061025f61119481565b3480156103ed57600080fd5b5061029261095c565b34801561040257600080fd5b5061030f610972565b61030f610419366004612bc8565b6109b5565b34801561042a57600080fd5b506102926109da565b34801561043f57600080fd5b5061030f6109f5565b34801561045457600080fd5b50610468610463366004612c6a565b610a60565b6040516102699190612ce7565b61030f610483366004612d40565b610b2b565b34801561049457600080fd5b506102e46104a3366004612b85565b610eb3565b3480156104b457600080fd5b5061030f6104c3366004612da0565b610ebe565b3480156104d457600080fd5b5061030f6104e3366004612de3565b610f7d565b3480156104f457600080fd5b5061025f610503366004612ad4565b610fe2565b34801561051457600080fd5b5061030f61104a565b34801561052957600080fd5b5061053d610538366004612ad4565b6110c1565b6040516102699190612e0f565b34801561055657600080fd5b506102e46111c9565b34801561056b57600080fd5b506102b76111d8565b34801561058057600080fd5b5061053d61058f366004612e47565b6111f0565b3480156105a057600080fd5b5061030f6105af366004612b85565b611376565b3480156105c057600080fd5b5061030f6105cf366004612f05565b6113bf565b3480156105e057600080fd5b5061030f6105ef366004612f4d565b61140c565b61030f610602366004612f89565b611489565b34801561061357600080fd5b5061030f610622366004612c04565b6114b6565b34801561063357600080fd5b50610647610642366004612b85565b611512565b6040516102699190613004565b34801561066057600080fd5b506102b761066f366004612b85565b61159f565b34801561068057600080fd5b5061030f611629565b34801561069557600080fd5b5061030f6106a4366004612b9e565b61181b565b3480156106b557600080fd5b506102926106c4366004613012565b611898565b3480156106d557600080fd5b5061030f6106e4366004613045565b6118d5565b3480156106f557600080fd5b5061030f610704366004612ad4565b611984565b34801561071557600080fd5b5061030f610724366004612f05565b6119c9565b61030f610737366004613078565b611b70565b600061074782611d3d565b6001600160401b031692915050565b600063152a902d60e11b6001600160e01b03198316148061077b575061077b82611d70565b92915050565b606061078b611dbe565b600201805461079990613093565b80601f01602080910402602001604051908101604052809291908181526020018280546107c590613093565b80156108125780601f106107e757610100808354040283529160200191610812565b820191906000526020600020905b8154815290600101906020018083116107f557829003601f168201915b5050505050905090565b600061082782611de2565b610844576040516333d1c03960e21b815260040160405180910390fd5b61084c611dbe565b60009283526006016020525060409020546001600160a01b031690565b61087582826001611e2b565b5050565b60006001610885611dbe565b60010154610891611dbe565b540303919050565b826001600160a01b03811633146108b3576108b333611ee0565b6108be848484611f24565b50505050565b6000806000806000806108d561211b565b600301546001600160401b03166108ea61211b565b600501546001600160401b03166108ff61211b565b600701546001600160401b031661091461211b565b6002015461092061211b565b6004015461092c61211b565b60060154949b939a50919850965094509092509050565b600080610950848461213f565b915091505b9250929050565b600061096661211b565b6001015460ff16919050565b61097a61217f565b6001600160a01b0316336001600160a01b0316146109ab57604051632f7a8ee160e01b815260040160405180910390fd5b6109b36121ad565b565b826001600160a01b03811633146109cf576109cf33611ee0565b6108be84848461222c565b60006109e461211b565b60010154610100900460ff16919050565b6109fd61217f565b6001600160a01b0316336001600160a01b031614610a2e57604051632f7a8ee160e01b815260040160405180910390fd5b6000610a3861211b565b6001015460ff1690508015610a4b61211b565b600101805460ff191691151591909117905550565b6060816000816001600160401b03811115610a7d57610a7d612e7a565b604051908082528060200260200182016040528015610acf57816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610a9b5790505b50905060005b828114610b2257610afd868683818110610af157610af16130c7565b90506020020135611512565b828281518110610b0f57610b0f6130c7565b6020908102919091010152600101610ad5565b50949350505050565b6001600160401b03841682826001831115610b7e5760405162461bcd60e51b815260206004820152600e60248201526d496e76616c69642053746174757360901b60448201526064015b60405180910390fd5b610bda8282610b8b61211b565b6008018660028110610b9f57610b9f6130c7565b01546040516bffffffffffffffffffffffff193360601b16602082015260340160405160208183030381529060405280519060200120612247565b610c185760405162461bcd60e51b815260206004820152600f60248201526e139bdd0815da1a5d195b1a5cdd1959608a1b6044820152606401610b75565b6000610c2261211b565b600181015490915060ff16610c795760405162461bcd60e51b815260206004820152601760248201527f57686974656c6973742053616c65204e6f74204f70656e0000000000000000006044820152606401610b75565b6000876001600160401b031611610cbe5760405162461bcd60e51b81526020600482015260096024820152684d696e696d756d203160b81b6044820152606401610b75565b60006001600160401b03891615610ce557600b820154610ce0906111946130f3565b610ce9565b6111945b905080886001600160401b0316610cfe612281565b610d089190613106565b1115610d265760405162461bcd60e51b8152600401610b7590613119565b60006001600160401b038a1615610d41578260040154610d47565b82600201545b9050610d5c6001600160401b038a1682613145565b341015610d9c5760405162461bcd60e51b815260206004820152600e60248201526d09cdee8408adcdeeaced0408aa8960931b6044820152606401610b75565b6001600160401b03808b166000908152600a8501602090815260408083203384529091528120549091610dd1918c911661315c565b905060006001600160401b038c1615610df75760058501546001600160401b0316610e06565b60038501546001600160401b03165b9050806001600160401b0316826001600160401b03161115610e605760405162461bcd60e51b8152602060048201526013602482015272135a5b9d1a5b99c810589bdd9948131a5b5a5d606a1b6044820152606401610b75565b6001600160401b038c81166000908152600a870160209081526040808320338085529252909120805467ffffffffffffffff1916858416179055610ea5918d16612294565b505050505050505050505050565b600061077b826123cf565b610ec661217f565b6001600160a01b0316336001600160a01b031614610ef757604051632f7a8ee160e01b815260040160405180910390fd5b82610f0061211b565b600301805467ffffffffffffffff19166001600160401b039290921691909117905581610f2b61211b565b600501805467ffffffffffffffff19166001600160401b039290921691909117905580610f5661211b565b600701805467ffffffffffffffff19166001600160401b0392909216919091179055505050565b610f8561217f565b6001600160a01b0316336001600160a01b031614610fb657604051632f7a8ee160e01b815260040160405180910390fd5b82610fbf61211b565b6002015580610fcc61211b565b6006015581610fd961211b565b60040155505050565b60006001600160a01b03821661100b576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b0361101b611dbe565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b61105261217f565b6001600160a01b0316336001600160a01b03161461108357604051632f7a8ee160e01b815260040160405180910390fd5b600061108d61211b565b60010154610100900460ff16905080156110a561211b565b60010180549115156101000261ff001990921691909117905550565b606060008060006110d185610fe2565b90506000816001600160401b038111156110ed576110ed612e7a565b604051908082528060200260200182016040528015611116578160200160208202803683370190505b50905061114360408051608081018252600080825260208201819052918101829052606081019190915290565b60015b8386146111bd576111568161247c565b915081604001516111b55781516001600160a01b03161561117657815194505b876001600160a01b0316856001600160a01b0316036111b557808387806001019850815181106111a8576111a86130c7565b6020026020010181815250505b600101611146565b50909695505050505050565b60006111d361217f565b905090565b60606111e2611dbe565b600301805461079990613093565b606081831061121257604051631960ccad60e11b815260040160405180910390fd5b60008061121d6124c3565b9050600185101561122d57600194505b80841115611239578093505b600061124487610fe2565b905084861015611263578585038181101561125d578091505b50611267565b5060005b6000816001600160401b0381111561128157611281612e7a565b6040519080825280602002602001820160405280156112aa578160200160208202803683370190505b509050816000036112c057935061136f92505050565b60006112cb88611512565b9050600081604001516112dc575080515b885b8881141580156112ee5750848714155b15611363576112fc8161247c565b9250826040015161135b5782516001600160a01b03161561131c57825191505b8a6001600160a01b0316826001600160a01b03160361135b578084888060010199508151811061134e5761134e6130c7565b6020026020010181815250505b6001016112de565b50505092835250909150505b9392505050565b61137e61217f565b6001600160a01b0316336001600160a01b0316146113af57604051632f7a8ee160e01b815260040160405180910390fd5b806113b861211b565b600b015550565b6113c761217f565b6001600160a01b0316336001600160a01b0316146113f857604051632f7a8ee160e01b815260040160405180910390fd5b8061140161211b565b9061087590826131c9565b80611415611dbe565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b836001600160a01b03811633146114a3576114a333611ee0565b6114af858585856124d3565b5050505050565b6114be61217f565b6001600160a01b0316336001600160a01b0316146114ef57604051632f7a8ee160e01b815260040160405180910390fd5b806114f861211b565b600801836002811061150c5761150c6130c7565b01555050565b6040805160808101825260008082526020820181905291810182905260608101919091526040805160808101825260008082526020820181905291810182905260608101919091526001831080611570575061156c6124c3565b8310155b1561157b5792915050565b6115848361247c565b90508060400151156115965792915050565b61136f83612517565b60606115aa82611de2565b6115c757604051630a14c4b560e41b815260040160405180910390fd5b60006115d161254c565b90506000816115df85612561565b6040516020016115f0929190613288565b6040516020818303038152906040529050815160000361161f5760405180602001604052806000815250611621565b805b949350505050565b61163161217f565b6001600160a01b0316336001600160a01b03161461166257604051632f7a8ee160e01b815260040160405180910390fd5b6040516370a0823160e01b815230600482015273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29060009082906370a0823190602401602060405180830381865afa1580156116b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116da91906132c7565b9050801561173d57604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b15801561172457600080fd5b505af1158015611738573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526ea39bb272e79075ade125fd351887ac9060009082906370a0823190602401602060405180830381865afa15801561178c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b091906132c7565b9050801561181357604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156117fa57600080fd5b505af115801561180e573d6000803e3d6000fd5b505050505b6108be6121ad565b61182361217f565b6001600160a01b0316336001600160a01b03161461185457604051632f7a8ee160e01b815260040160405180910390fd5b8061119481611861612281565b61186b9190613106565b11156118895760405162461bcd60e51b8152600401610b7590613119565b6118938383612294565b505050565b60006118a2611dbe565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b6118dd61217f565b6001600160a01b0316336001600160a01b03161461190e57604051632f7a8ee160e01b815260040160405180910390fd5b7ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b282280546001600160a01b0319166001600160a01b0393909316929092179091557ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b2820805461ffff191661ffff909216919091179055565b61198c61217f565b6001600160a01b0316336001600160a01b0316146119bd57604051632f7a8ee160e01b815260040160405180910390fd5b6119c6816125a5565b50565b6000805160206133b183398151915254610100900460ff166119fe576000805160206133b18339815191525460ff1615611a02565b303b155b611a745760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610b75565b6000805160206133b183398151915254610100900460ff16158015611ab0576000805160206133b1833981519152805461ffff19166101011790555b611afc6040518060400160405280601081526020016f283937b532b1ba1022b73b34b9b4b7b760811b81525060405180604001604052806002815260200161504560f01b8152506125ae565b611b046125ec565b611b0c612628565b611b15826113bf565b611b226003600280610ebe565b611b42667c585087238000668700cc75770000669536c708910000610f7d565b611b4e306101f46118d5565b80156108755750506000805160206133b1833981519152805461ff0019169055565b806001600160401b031661119481611b86612281565b611b909190613106565b1115611bae5760405162461bcd60e51b8152600401610b7590613119565b611bb661211b565b60010154610100900460ff16611c055760405162461bcd60e51b8152602060048201526014602482015273283ab13634b19029b0b632902737ba1027b832b760611b6044820152606401610b75565b6000826001600160401b031611611c4a5760405162461bcd60e51b81526020600482015260096024820152684d696e696d756d203160b81b6044820152606401610b75565b816001600160401b0316611c5c61211b565b60060154611c6a9190613145565b341015611caa5760405162461bcd60e51b815260206004820152600e60248201526d09cdee8408adcdeeaced0408aa8960931b6044820152606401610b75565b600082611cb633611d3d565b611cc0919061315c565b9050611cca61211b565b600701546001600160401b039081169082161115611d205760405162461bcd60e51b8152602060048201526013602482015272135a5b9d1a5b99c810589bdd9948131a5b5a5d606a1b6044820152606401610b75565b611d2a3382612647565b61189333846001600160401b0316612294565b600060c0611d49611dbe565b6001600160a01b03909316600090815260059390930160205260409092205490911c919050565b60006301ffc9a760e01b6001600160e01b031983161480611da157506380ac58cd60e01b6001600160e01b03198316145b8061077b5750506001600160e01b031916635b5e139f60e01b1490565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b600081600111158015611dfc5750611df8611dbe565b5482105b801561077b5750600160e01b611e10611dbe565b60008481526004919091016020526040902054161592915050565b6000611e3683610eb3565b90508115611e7557336001600160a01b03821614611e7557611e588133611898565b611e75576040516367d9dca160e11b815260040160405180910390fd5b83611e7e611dbe565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa611f1c573d6000803e3d6000fd5b6000603a5250565b6000611f2f826123cf565b9050836001600160a01b0316816001600160a01b031614611f625760405162a1148160e81b815260040160405180910390fd5b600080611f6e846126b0565b91509150611f938187611f7e3390565b6001600160a01b039081169116811491141790565b611fbe57611fa18633611898565b611fbe57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611fe557604051633a954ecd60e21b815260040160405180910390fd5b8015611ff057600082555b611ff8611dbe565b6001600160a01b0387166000908152600591909101602052604090208054600019019055612024611dbe565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b1761205b611dbe565b60008681526004919091016020526040812091909155600160e11b841690036120d1576001840161208a611dbe565b6000828152600491909101602052604081205490036120cf576120ab611dbe565b5481146120cf57836120bb611dbe565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b7f270c533d28f00dd65e3b7f8153c97cb575f81183d846e4f29c9618c9428eb77a90565b600080600061214d856126d8565b61ffff16905061215c85612726565b6127106121698684613145565b61217391906132e0565b92509250509250929050565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f671680460546001600160a01b031690565b476121e2730db4bcd94e2f64cec5a7a87c943a4bf5a51d543660646121d3846028613145565b6121dd91906132e0565b612796565b61220773b397c5be1e8fe89fb269801e636e278e5a6d7d3160646121d3846028613145565b6119c673b7419b10a2973384b0390a525ab84465d4c72ee160646121d3846014613145565b61189383838360405180602001604052806000815250611489565b60008315612279578360051b8501855b803580851160051b948552602094851852604060002093018181106122575750505b501492915050565b6000600161228d611dbe565b5403919050565b600061229e611dbe565b54905060008290036122c35760405163b562e8dd60e01b815260040160405180910390fd5b6801000000000000000182026122d7611dbe565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b6001841460e11b1717612312611dbe565b600083815260049190910160205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b81811461239c57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101612364565b50816000036123bd57604051622e076360e81b815260040160405180910390fd5b806123c6611dbe565b55506118939050565b600081600111612463576123e1611dbe565b600083815260049190910160205260408120549150600160e01b82169003612463578060000361245e57612413611dbe565b54821061243357604051636f96cda160e11b815260040160405180910390fd5b61243b611dbe565b600019909201600081815260049390930160205260409092205490508015612433575b919050565b604051636f96cda160e11b815260040160405180910390fd5b60408051608081018252600080825260208201819052918101829052606081019190915261077b6124ab611dbe565b6000848152600491909101602052604090205461280a565b60006124cd611dbe565b54919050565b6124de848484610899565b6001600160a01b0383163b156108be576124fa84848484612851565b6108be576040516368d2bf6b60e11b815260040160405180910390fd5b60408051608081018252600080825260208201819052918101829052606081019190915261077b612547836123cf565b61280a565b606061255661211b565b805461079990613093565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a90048061257b5750819003601f19909101908152919050565b6119c68161293c565b6000805160206133b183398151915254610100900460ff166125e25760405162461bcd60e51b8152600401610b7590613302565b61087582826129b6565b6000805160206133b183398151915254610100900460ff166126205760405162461bcd60e51b8152600401610b7590613302565b6109b3612a29565b6109b3733cc6cdda760b79bafa08df41ecfa224f810dceb66001612a5d565b6000612651611dbe565b6001600160a01b038416600090815260059190910160205260409020546001600160c01b031660c083901b1790508181612689611dbe565b6001600160a01b039095166000908152600595909501602052604090942093909355505050565b60008060006126bd611dbe565b60009485526006016020525050604090912080549092909150565b60008181527ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b281f6020819052604082205461ffff169182900361272057600181015461ffff1691505b50919050565b60008181527ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b282160205260409020546001600160a01b03167ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b281f8161272057600301546001600160a01b031692915050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146127e3576040519150601f19603f3d011682016040523d82523d6000602084013e6127e8565b606091505b50509050806118935760405163c6d73c5560e01b815260040160405180910390fd5b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612886903390899088908890600401613356565b6020604051808303816000875af19250505080156128c1575060408051601f3d908101601f191682019092526128be91810190613393565b60015b61291f573d8080156128ef576040519150601f19603f3d011682016040523d82523d6000602084013e6128f4565b606091505b508051600003612917576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f67168046080546040516001600160a01b038481169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a380546001600160a01b0319166001600160a01b0392909216919091179055565b6000805160206133b183398151915254610100900460ff166129ea5760405162461bcd60e51b8152600401610b7590613302565b816129f3611dbe565b60020190612a0190826131c9565b5080612a0b611dbe565b60030190612a1990826131c9565b506001612a24611dbe565b555050565b6000805160206133b183398151915254610100900460ff166109b35760405162461bcd60e51b8152600401610b7590613302565b6001600160a01b0390911690637d3e3dbe81612a8a5782612a835750634420e486612a8a565b5063a0af29035b8060e01b60005250306004528160245260008060446000806daaeb6d7670e522a718067333cd4e5af15060006024525050565b80356001600160a01b038116811461245e57600080fd5b600060208284031215612ae657600080fd5b61136f82612abd565b6001600160e01b0319811681146119c657600080fd5b600060208284031215612b1757600080fd5b813561136f81612aef565b60005b83811015612b3d578181015183820152602001612b25565b50506000910152565b60008151808452612b5e816020860160208601612b22565b601f01601f19169290920160200192915050565b60208152600061136f6020830184612b46565b600060208284031215612b9757600080fd5b5035919050565b60008060408385031215612bb157600080fd5b612bba83612abd565b946020939093013593505050565b600080600060608486031215612bdd57600080fd5b612be684612abd565b9250612bf460208501612abd565b9150604084013590509250925092565b60008060408385031215612c1757600080fd5b50508035926020909101359150565b60008083601f840112612c3857600080fd5b5081356001600160401b03811115612c4f57600080fd5b6020830191508360208260051b850101111561095557600080fd5b60008060208385031215612c7d57600080fd5b82356001600160401b03811115612c9357600080fd5b612c9f85828601612c26565b90969095509350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b818110156111bd57612d16838551612cab565b9284019260809290920191600101612d03565b80356001600160401b038116811461245e57600080fd5b60008060008060608587031215612d5657600080fd5b612d5f85612d29565b9350612d6d60208601612d29565b925060408501356001600160401b03811115612d8857600080fd5b612d9487828801612c26565b95989497509550505050565b600080600060608486031215612db557600080fd5b612dbe84612d29565b9250612dcc60208501612d29565b9150612dda60408501612d29565b90509250925092565b600080600060608486031215612df857600080fd5b505081359360208301359350604090920135919050565b6020808252825182820181905260009190848201906040850190845b818110156111bd57835183529284019291840191600101612e2b565b600080600060608486031215612e5c57600080fd5b612e6584612abd565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115612eaa57612eaa612e7a565b604051601f8501601f19908116603f01168101908282118183101715612ed257612ed2612e7a565b81604052809350858152868686011115612eeb57600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215612f1757600080fd5b81356001600160401b03811115612f2d57600080fd5b8201601f81018413612f3e57600080fd5b61162184823560208401612e90565b60008060408385031215612f6057600080fd5b612f6983612abd565b915060208301358015158114612f7e57600080fd5b809150509250929050565b60008060008060808587031215612f9f57600080fd5b612fa885612abd565b9350612fb660208601612abd565b92506040850135915060608501356001600160401b03811115612fd857600080fd5b8501601f81018713612fe957600080fd5b612ff887823560208401612e90565b91505092959194509250565b6080810161077b8284612cab565b6000806040838503121561302557600080fd5b61302e83612abd565b915061303c60208401612abd565b90509250929050565b6000806040838503121561305857600080fd5b61306183612abd565b9150602083013561ffff81168114612f7e57600080fd5b60006020828403121561308a57600080fd5b61136f82612d29565b600181811c908216806130a757607f821691505b60208210810361272057634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561077b5761077b6130dd565b8082018082111561077b5761077b6130dd565b60208082526012908201527141626f766520546f74616c20537570706c7960701b604082015260600190565b808202811582820484141761077b5761077b6130dd565b6001600160401b0381811683821601908082111561317c5761317c6130dd565b5092915050565b601f82111561189357600081815260208120601f850160051c810160208610156131aa5750805b601f850160051c820191505b81811015612113578281556001016131b6565b81516001600160401b038111156131e2576131e2612e7a565b6131f6816131f08454613093565b84613183565b602080601f83116001811461322b57600084156132135750858301515b600019600386901b1c1916600185901b178555612113565b600085815260208120601f198616915b8281101561325a5788860151825594840194600190910190840161323b565b50858210156132785787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000835161329a818460208801612b22565b8351908301906132ae818360208801612b22565b64173539b7b760d91b9101908152600501949350505050565b6000602082840312156132d957600080fd5b5051919050565b6000826132fd57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061338990830184612b46565b9695505050505050565b6000602082840312156133a557600080fd5b815161136f81612aef56feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa264697066735822122099961a3ede3de190c722352903286b2a525b9749c0a54a8a50c76025021f06aa64736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.