Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 440 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Approval For... | 21487840 | 5 days ago | IN | 0 ETH | 0.00030649 | ||||
Set Approval For... | 19647991 | 262 days ago | IN | 0 ETH | 0.0007474 | ||||
Set Approval For... | 19591705 | 270 days ago | IN | 0 ETH | 0.00107674 | ||||
Set Approval For... | 19591701 | 270 days ago | IN | 0 ETH | 0.00107333 | ||||
Set Approval For... | 19582989 | 271 days ago | IN | 0 ETH | 0.00109987 | ||||
Set Approval For... | 19557952 | 275 days ago | IN | 0 ETH | 0.00095004 | ||||
Set Approval For... | 18804910 | 380 days ago | IN | 0 ETH | 0.00071527 | ||||
Set Approval For... | 18627424 | 405 days ago | IN | 0 ETH | 0.00138677 | ||||
Set Approval For... | 18395850 | 438 days ago | IN | 0 ETH | 0.0003045 | ||||
Set Approval For... | 18166683 | 470 days ago | IN | 0 ETH | 0.00041169 | ||||
Set Approval For... | 17947616 | 500 days ago | IN | 0 ETH | 0.00054981 | ||||
Set Approval For... | 17876878 | 510 days ago | IN | 0 ETH | 0.00085803 | ||||
Set Approval For... | 17649667 | 542 days ago | IN | 0 ETH | 0.00137237 | ||||
Set Approval For... | 17605997 | 548 days ago | IN | 0 ETH | 0.00062046 | ||||
Set Approval For... | 17407758 | 576 days ago | IN | 0 ETH | 0.00136279 | ||||
Set Approval For... | 17405665 | 576 days ago | IN | 0 ETH | 0.0009678 | ||||
Set Approval For... | 17302062 | 591 days ago | IN | 0 ETH | 0.00182796 | ||||
Set Approval For... | 17275372 | 595 days ago | IN | 0 ETH | 0.00220268 | ||||
Set Approval For... | 17275371 | 595 days ago | IN | 0 ETH | 0.00218045 | ||||
Set Approval For... | 17151032 | 612 days ago | IN | 0 ETH | 0.00146349 | ||||
Set Approval For... | 17128126 | 615 days ago | IN | 0 ETH | 0.0016217 | ||||
Safe Transfer Fr... | 17126996 | 616 days ago | IN | 0 ETH | 0.00193754 | ||||
Set Approval For... | 17126985 | 616 days ago | IN | 0 ETH | 0.00167229 | ||||
Set Approval For... | 17126976 | 616 days ago | IN | 0 ETH | 0.00168608 | ||||
Set Approval For... | 17126852 | 616 days ago | IN | 0 ETH | 0.00151719 |
Loading...
Loading
Contract Name:
PotaNFT
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.15; import "@openzeppelin/contracts/access/Ownable.sol"; import "erc721a/contracts/ERC721A.sol"; import "erc721a/contracts/extensions/ERC721AQueryable.sol"; import "solady/src/utils/ECDSA.sol"; import "solady/src/utils/LibString.sol"; import "solady/src/utils/SafeTransferLib.sol"; /// @title POTA NFT contract PotaNFT is ERC721A, ERC721AQueryable, Ownable { using ECDSA for bytes32; uint256 public constant PRICE_UNIT = 0.001 ether; string private _tokenURI; address public signer; uint8 public maxPerWallet = 2; uint8 public maxPerTransaction = 2; uint16 public maxSupply = 500; uint16 private _whitelistPriceUnits = _toPriceUnits(0.025 ether); uint16 private _publicPriceUnits = _toPriceUnits(0.025 ether); bool public paused = true; bool public mintLocked; bool public maxSupplyLocked; bool public tokenURILocked; constructor() ERC721A("POTA", "POTA") {} function _startTokenId() internal view virtual override returns (uint256) { return 1; } function tokenURI(uint256 tokenId) public view override(ERC721A, IERC721A) returns (string memory) { return LibString.replace(_tokenURI, "{id}", _toString(tokenId)); } function publicPrice() external view returns (uint256) { return _toPrice(_publicPriceUnits); } function whitelistPrice() external view returns (uint256) { return _toPrice(_whitelistPriceUnits); } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* MINTING FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ function potaMint(uint256 quantity) external payable mintNotPaused requireMintable(quantity) requireUserMintable(quantity) requireExactPayment(_publicPriceUnits, quantity) { _mint(msg.sender, quantity); } function potaList(uint256 quantity) external payable mintNotPaused requireMintable(quantity) requireUserMintable(quantity) requireExactPayment(_whitelistPriceUnits, quantity) { _mint(msg.sender, quantity); } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* HELPERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ function _toPriceUnits(uint256 price) private pure returns (uint16) { unchecked { require(price % PRICE_UNIT == 0, "Price must be a multiple of PRICE_UNIT."); require((price /= PRICE_UNIT) <= type(uint16).max, "Overflow."); return uint16(price); } } function _toPrice(uint16 priceUnits) private pure returns (uint256) { return uint256(priceUnits) * PRICE_UNIT; } modifier requireUserMintable(uint256 quantity) { unchecked { require(quantity <= maxPerTransaction, "Max per transaction reached."); require(_numberMinted(msg.sender) + quantity <= maxPerWallet, "Max number minted reached."); } _; } modifier requireMintable(uint256 quantity) { unchecked { require(mintLocked == false, "Locked."); require(_totalMinted() + quantity <= maxSupply, "Out of stock!"); } _; } modifier requireExactPayment(uint16 priceUnits, uint256 quantity) { unchecked { require(quantity <= 100, "Quantity too high."); require(msg.value == _toPrice(priceUnits) * quantity, "Wrong Ether value."); } _; } modifier requireSignature(bytes calldata signature) { require( keccak256(abi.encode(msg.sender)).toEthSignedMessageHash().recover(signature) == signer, "Invalid signature." ); _; } modifier mintNotPaused() { require(paused == false, "Paused."); _; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ADMIN FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ function airdrop(address[] calldata to, uint256 quantity) external onlyOwner requireMintable(quantity * to.length) { unchecked { for (uint256 i; i != to.length; ++i) { _mint(to[i], quantity); } } } function setTokenURI(string calldata value) external onlyOwner { require(tokenURILocked == false, "Locked."); _tokenURI = value; } function setMaxSupply(uint16 value) external onlyOwner { require(maxSupplyLocked == false, "Locked."); maxSupply = value; } function setMaxPerWallet(uint8 value) external onlyOwner { maxPerWallet = value; } function setMaxPerTransaction(uint8 value) external onlyOwner { maxPerTransaction = value; } function setPaused(bool value) external onlyOwner { if (value == false) { require(maxSupply != 0, "Max supply not set."); require(signer != address(0), "Signer not set."); } paused = value; } function setSigner(address value) external onlyOwner { require(value != address(0), "Signer must not be the zero address."); signer = value; } function lockMint() external onlyOwner { mintLocked = true; } function lockMaxSupply() external onlyOwner { maxSupplyLocked = true; } function lockTokenURI() external onlyOwner { tokenURILocked = true; } function setWhitelistPrice(uint256 value) external onlyOwner { _whitelistPriceUnits = _toPriceUnits(value); } function setPublicPrice(uint256 value) external onlyOwner { _publicPriceUnits = _toPriceUnits(value); } function withdraw() external payable onlyOwner { SafeTransferLib.safeTransferETH(msg.sender, address(this).balance); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// @dev Caution! This library won't check that a token has code, responsibility is delegated to the caller. library SafeTransferLib { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The ETH transfer has failed. error ETHTransferFailed(); /// @dev The ERC20 `transferFrom` has failed. error TransferFromFailed(); /// @dev The ERC20 `transfer` has failed. error TransferFailed(); /// @dev The ERC20 `approve` has failed. error ApproveFailed(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Suggested gas stipend for contract receiving ETH /// that disallows any storage writes. uint256 internal constant _GAS_STIPEND_NO_STORAGE_WRITES = 2300; /// @dev Suggested gas stipend for contract receiving ETH to perform a few /// storage reads and writes, but low enough to prevent griefing. /// Multiply by a small constant (e.g. 2), if needed. uint256 internal constant _GAS_STIPEND_NO_GRIEF = 100000; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ETH OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Sends `amount` (in wei) ETH to `to`. /// Reverts upon failure. function safeTransferETH(address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { // Transfer the ETH and check if it succeeded or not. if iszero(call(gas(), to, amount, 0, 0, 0, 0)) { // Store the function selector of `ETHTransferFailed()`. mstore(0x00, 0xb12d13eb) // Revert with (offset, size). revert(0x1c, 0x04) } } } /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`. /// The `gasStipend` can be set to a low enough value to prevent /// storage writes or gas griefing. /// /// If sending via the normal procedure fails, force sends the ETH by /// creating a temporary contract which uses `SELFDESTRUCT` to force send the ETH. /// /// Reverts if the current contract has insufficient balance. function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal { /// @solidity memory-safe-assembly assembly { // If insufficient balance, revert. if lt(selfbalance(), amount) { // Store the function selector of `ETHTransferFailed()`. mstore(0x00, 0xb12d13eb) // Revert with (offset, size). revert(0x1c, 0x04) } // Transfer the ETH and check if it succeeded or not. if iszero(call(gasStipend, to, amount, 0, 0, 0, 0)) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. // We can directly use `SELFDESTRUCT` in the contract creation. // Compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758 pop(create(amount, 0x0b, 0x16)) } } } /// @dev Force sends `amount` (in wei) ETH to `to`, with a gas stipend /// equal to `_GAS_STIPEND_NO_GRIEF`. This gas stipend is a reasonable default /// for 99% of cases and can be overriden with the three-argument version of this /// function if necessary. /// /// If sending via the normal procedure fails, force sends the ETH by /// creating a temporary contract which uses `SELFDESTRUCT` to force send the ETH. /// /// Reverts if the current contract has insufficient balance. function forceSafeTransferETH(address to, uint256 amount) internal { // Manually inlined because the compiler doesn't inline functions with branches. /// @solidity memory-safe-assembly assembly { // If insufficient balance, revert. if lt(selfbalance(), amount) { // Store the function selector of `ETHTransferFailed()`. mstore(0x00, 0xb12d13eb) // Revert with (offset, size). revert(0x1c, 0x04) } // Transfer the ETH and check if it succeeded or not. if iszero(call(_GAS_STIPEND_NO_GRIEF, to, amount, 0, 0, 0, 0)) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. // We can directly use `SELFDESTRUCT` in the contract creation. // Compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758 pop(create(amount, 0x0b, 0x16)) } } } /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`. /// The `gasStipend` can be set to a low enough value to prevent /// storage writes or gas griefing. /// /// Simply use `gasleft()` for `gasStipend` if you don't need a gas stipend. /// /// Note: Does NOT revert upon failure. /// Returns whether the transfer of ETH is successful instead. function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal returns (bool success) { /// @solidity memory-safe-assembly assembly { // Transfer the ETH and check if it succeeded or not. success := call(gasStipend, to, amount, 0, 0, 0, 0) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ERC20 OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Sends `amount` of ERC20 `token` from `from` to `to`. /// Reverts upon failure. /// /// The `from` account must have at least `amount` approved for /// the current contract to manage. function safeTransferFrom(address token, address from, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. // Store the function selector of `transferFrom(address,address,uint256)`. mstore(0x00, 0x23b872dd) mstore(0x20, from) // Store the `from` argument. mstore(0x40, to) // Store the `to` argument. mstore(0x60, amount) // Store the `amount` argument. if iszero( and( // The arguments of `and` are evaluated from right to left. // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(eq(mload(0x00), 1), iszero(returndatasize())), call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20) ) ) { // Store the function selector of `TransferFromFailed()`. mstore(0x00, 0x7939f424) // Revert with (offset, size). revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot to zero. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Sends all of ERC20 `token` from `from` to `to`. /// Reverts upon failure. /// /// The `from` account must have at least `amount` approved for /// the current contract to manage. function safeTransferAllFrom(address token, address from, address to) internal returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`. mstore(0x20, from) // Store the `from` argument. if iszero( and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20) ) ) { // Store the function selector of `TransferFromFailed()`. mstore(0x00, 0x7939f424) // Revert with (offset, size). revert(0x1c, 0x04) } // Store the function selector of `transferFrom(address,address,uint256)`. mstore(0x00, 0x23b872dd) mstore(0x40, to) // Store the `to` argument. // The `amount` argument is already written to the memory word at 0x6a. amount := mload(0x60) if iszero( and( // The arguments of `and` are evaluated from right to left. // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(eq(mload(0x00), 1), iszero(returndatasize())), call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20) ) ) { // Store the function selector of `TransferFromFailed()`. mstore(0x00, 0x7939f424) // Revert with (offset, size). revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot to zero. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Sends `amount` of ERC20 `token` from the current contract to `to`. /// Reverts upon failure. function safeTransfer(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x1a, to) // Store the `to` argument. mstore(0x3a, amount) // Store the `amount` argument. // Store the function selector of `transfer(address,uint256)`, // left by 6 bytes (enough for 8tb of memory represented by the free memory pointer). // We waste 6-3 = 3 bytes to save on 6 runtime gas (PUSH1 0x224 SHL). mstore(0x00, 0xa9059cbb000000000000) if iszero( and( // The arguments of `and` are evaluated from right to left. // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(eq(mload(0x00), 1), iszero(returndatasize())), call(gas(), token, 0, 0x16, 0x44, 0x00, 0x20) ) ) { // Store the function selector of `TransferFailed()`. mstore(0x00, 0x90b8ec18) // Revert with (offset, size). revert(0x1c, 0x04) } // 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 Sends all of ERC20 `token` from the current contract to `to`. /// Reverts upon failure. function safeTransferAll(address token, address to) internal returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`. mstore(0x20, address()) // Store the address of the current contract. if iszero( and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x1c, 0x24, 0x3a, 0x20) ) ) { // Store the function selector of `TransferFailed()`. mstore(0x00, 0x90b8ec18) // Revert with (offset, size). revert(0x1c, 0x04) } mstore(0x1a, to) // Store the `to` argument. // The `amount` argument is already written to the memory word at 0x3a. amount := mload(0x3a) // Store the function selector of `transfer(address,uint256)`, // left by 6 bytes (enough for 8tb of memory represented by the free memory pointer). // We waste 6-3 = 3 bytes to save on 6 runtime gas (PUSH1 0x224 SHL). mstore(0x00, 0xa9059cbb000000000000) if iszero( and( // The arguments of `and` are evaluated from right to left. // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(eq(mload(0x00), 1), iszero(returndatasize())), call(gas(), token, 0, 0x16, 0x44, 0x00, 0x20) ) ) { // Store the function selector of `TransferFailed()`. mstore(0x00, 0x90b8ec18) // Revert with (offset, size). revert(0x1c, 0x04) } // 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 Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. /// Reverts upon failure. function safeApprove(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x1a, to) // Store the `to` argument. mstore(0x3a, amount) // Store the `amount` argument. // Store the function selector of `approve(address,uint256)`, // left by 6 bytes (enough for 8tb of memory represented by the free memory pointer). // We waste 6-3 = 3 bytes to save on 6 runtime gas (PUSH1 0x224 SHL). mstore(0x00, 0x095ea7b3000000000000) if iszero( and( // The arguments of `and` are evaluated from right to left. // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(eq(mload(0x00), 1), iszero(returndatasize())), call(gas(), token, 0, 0x16, 0x44, 0x00, 0x20) ) ) { // Store the function selector of `ApproveFailed()`. mstore(0x00, 0x3e3f8f73) // Revert with (offset, size). revert(0x1c, 0x04) } // 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 Returns the amount of ERC20 `token` owned by `account`. /// Returns zero if the `token` does not exist. function balanceOf(address token, address account) internal view returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`. mstore(0x20, account) // Store the `account` argument. amount := mul( mload(0x20), and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x1c, 0x24, 0x20, 0x20) ) ) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library for converting numbers into strings and other string operations. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol) library LibString { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The `length` of the output is too small to contain all the hex digits. error HexLengthInsufficient(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The constant returned when the `search` is not found in the string. uint256 internal constant NOT_FOUND = type(uint256).max; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* DECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the base 10 decimal representation of `value`. function toString(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly 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. str := add(mload(0x40), 0x80) // Update the free memory pointer to allocate. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str let w := not(0) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 {} { str := add(str, w) // `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) 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) } } /// @dev Returns the base 10 decimal representation of `value`. function toString(int256 value) internal pure returns (string memory str) { if (value >= 0) { return toString(uint256(value)); } unchecked { str = toString(uint256(-value)); } /// @solidity memory-safe-assembly assembly { // We still have some spare memory space on the left, // as we have allocated 3 words (96 bytes) for up to 78 digits. let length := mload(str) // Load the string length. mstore(str, 0x2d) // Store the '-' character. str := sub(str, 1) // Move back the string pointer by a byte. mstore(str, add(length, 1)) // Update the string length. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* HEXADECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2 + 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexString(uint256 value, uint256 length) internal pure returns (string memory str) { str = toHexStringNoPrefix(value, length); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexStringNoPrefix(uint256 value, uint256 length) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, `length * 2` bytes // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length. // We add 0x20 to the total and round down to a multiple of 0x20. // (0x20 + 0x20 + 0x02 + 0x20) = 0x62. str := add(mload(0x40), and(add(shl(1, length), 0x42), not(0x1f))) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let start := sub(str, add(length, length)) let w := not(1) // Tsk. let temp := value // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for {} 1 {} { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(xor(str, start)) { break } } if temp { // Store the function selector of `HexLengthInsufficient()`. mstore(0x00, 0x2194895a) // Revert with (offset, size). revert(0x1c, 0x04) } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2 + 2` bytes. function toHexString(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2` bytes. function toHexStringNoPrefix(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x40 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0. str := add(mload(0x40), 0x80) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let w := not(1) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 {} { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(temp) { break } } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte, /// and the alphabets are capitalized conditionally according to /// https://eips.ethereum.org/EIPS/eip-55 function toHexStringChecksumed(address value) internal pure returns (string memory str) { str = toHexString(value); /// @solidity memory-safe-assembly assembly { let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...` let o := add(str, 0x22) let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... ` let t := shl(240, 136) // `0b10001000 << 240` for { let i := 0 } 1 {} { mstore(add(i, i), mul(t, byte(i, hashed))) i := add(i, 1) if eq(i, 20) { break } } mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask))))) o := add(o, 0x20) mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask))))) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. function toHexString(address value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(address value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { str := mload(0x40) // Allocate the memory. // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x28 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80. mstore(0x40, add(str, 0x80)) // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) str := add(str, 2) mstore(str, 40) let o := add(str, 0x20) mstore(add(o, 40), 0) value := shl(96, value) // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let i := 0 } 1 {} { let p := add(o, add(i, i)) let temp := byte(i, value) mstore8(add(p, 1), mload(and(temp, 15))) mstore8(p, mload(shr(4, temp))) i := add(i, 1) if eq(i, 20) { break } } } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexString(bytes memory raw) internal pure returns (string memory str) { str = toHexStringNoPrefix(raw); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { let length := mload(raw) str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix. mstore(str, add(length, length)) // Store the length of the output. // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let o := add(str, 0x20) let end := add(raw, length) for {} iszero(eq(raw, end)) {} { raw := add(raw, 1) mstore8(add(o, 1), mload(and(mload(raw), 15))) mstore8(o, mload(and(shr(4, mload(raw)), 15))) o := add(o, 2) } mstore(o, 0) // Zeroize the slot after the string. mstore(0x40, and(add(o, 31), not(31))) // Allocate the memory. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* RUNE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the number of UTF characters in the string. function runeCount(string memory s) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { if mload(s) { mstore(0x00, div(not(0), 255)) mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506) let o := add(s, 0x20) let end := add(o, mload(s)) for { result := 1 } 1 { result := add(result, 1) } { o := add(o, byte(0, mload(shr(250, mload(o))))) if iszero(lt(o, end)) { break } } } } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* BYTE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // For performance and bytecode compactness, all indices of the following operations // are byte (ASCII) offsets, not UTF character offsets. /// @dev Returns `subject` all occurrences of `search` replaced with `replacement`. function replace(string memory subject, string memory search, string memory replacement) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) let replacementLength := mload(replacement) subject := add(subject, 0x20) search := add(search, 0x20) replacement := add(replacement, 0x20) result := add(mload(0x40), 0x20) let subjectEnd := add(subject, subjectLength) if iszero(gt(searchLength, subjectLength)) { let subjectSearchEnd := add(sub(subjectEnd, searchLength), 1) let h := 0 if iszero(lt(searchLength, 32)) { h := keccak256(search, searchLength) } let m := shl(3, sub(32, and(searchLength, 31))) let s := mload(search) for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Copy the `replacement` one word at a time. for { let o := 0 } 1 {} { mstore(add(result, o), mload(add(replacement, o))) o := add(o, 0x20) if iszero(lt(o, replacementLength)) { break } } result := add(result, replacementLength) subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } } let resultRemainder := result result := add(mload(0x40), 0x20) let k := add(sub(resultRemainder, result), sub(subjectEnd, subject)) // Copy the rest of the string one word at a time. for {} lt(subject, subjectEnd) {} { mstore(resultRemainder, mload(subject)) resultRemainder := add(resultRemainder, 0x20) subject := add(subject, 0x20) } result := sub(result, 0x20) // Zeroize the slot after the string. let last := add(add(result, 0x20), k) mstore(last, 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), not(31))) // Store the length of the result. mstore(result, k) } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for { let subjectLength := mload(subject) } 1 {} { if iszero(mload(search)) { if iszero(gt(from, subjectLength)) { result := from break } result := subjectLength break } let searchLength := mload(search) let subjectStart := add(subject, 0x20) result := not(0) // Initialize to `NOT_FOUND`. subject := add(subjectStart, from) let end := add(sub(add(subjectStart, subjectLength), searchLength), 1) let m := shl(3, sub(32, and(searchLength, 31))) let s := mload(add(search, 0x20)) if iszero(and(lt(subject, end), lt(from, subjectLength))) { break } if iszero(lt(searchLength, 32)) { for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if iszero(shr(m, xor(mload(subject), s))) { if eq(keccak256(subject, searchLength), h) { result := sub(subject, subjectStart) break } } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } for {} 1 {} { if iszero(shr(m, xor(mload(subject), s))) { result := sub(subject, subjectStart) break } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = indexOf(subject, search, 0); } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for {} 1 {} { result := not(0) // Initialize to `NOT_FOUND`. let searchLength := mload(search) if gt(searchLength, mload(subject)) { break } let w := result let fromMax := sub(mload(subject), searchLength) if iszero(gt(fromMax, from)) { from := fromMax } let end := add(add(subject, 0x20), w) subject := add(add(subject, 0x20), from) if iszero(gt(subject, end)) { break } // As this function is not too often used, // we shall simply use keccak256 for smaller bytecode size. for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if eq(keccak256(subject, searchLength), h) { result := sub(subject, add(end, 1)) break } subject := add(subject, w) // `sub(subject, 1)`. if iszero(gt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = lastIndexOf(subject, search, uint256(int256(-1))); } /// @dev Returns whether `subject` starts with `search`. function startsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( iszero(gt(searchLength, mload(subject))), eq( keccak256(add(subject, 0x20), searchLength), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns whether `subject` ends with `search`. function endsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) let subjectLength := mload(subject) // Whether `search` is not longer than `subject`. let withinRange := iszero(gt(searchLength, subjectLength)) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( withinRange, eq( keccak256( // `subject + 0x20 + max(subjectLength - searchLength, 0)`. add(add(subject, 0x20), mul(withinRange, sub(subjectLength, searchLength))), searchLength ), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns `subject` repeated `times`. function repeat(string memory subject, uint256 times) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(or(iszero(times), iszero(subjectLength))) { subject := add(subject, 0x20) result := mload(0x40) let output := add(result, 0x20) for {} 1 {} { // Copy the `subject` one word at a time. for { let o := 0 } 1 {} { mstore(add(output, o), mload(add(subject, o))) o := add(o, 0x20) if iszero(lt(o, subjectLength)) { break } } output := add(output, subjectLength) times := sub(times, 1) if iszero(times) { break } } // Zeroize the slot after the string. mstore(output, 0) // Store the length. let resultLength := sub(output, add(result, 0x20)) mstore(result, resultLength) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(result, and(add(resultLength, 63), not(31)))) } } } /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive). /// `start` and `end` are byte offsets. function slice(string memory subject, uint256 start, uint256 end) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(gt(subjectLength, end)) { end := subjectLength } if iszero(gt(subjectLength, start)) { start := subjectLength } if lt(start, end) { result := mload(0x40) let resultLength := sub(end, start) mstore(result, resultLength) subject := add(subject, start) let w := not(31) // Copy the `subject` one word at a time, backwards. for { let o := and(add(resultLength, 31), w) } 1 {} { mstore(add(result, o), mload(add(subject, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(result, 0x20), resultLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(result, and(add(resultLength, 63), w))) } } } /// @dev Returns a copy of `subject` sliced from `start` to the end of the string. /// `start` is a byte offset. function slice(string memory subject, uint256 start) internal pure returns (string memory result) { result = slice(subject, start, uint256(int256(-1))); } /// @dev Returns all the indices of `search` in `subject`. /// The indices are byte offsets. function indicesOf(string memory subject, string memory search) internal pure returns (uint256[] memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) if iszero(gt(searchLength, subjectLength)) { subject := add(subject, 0x20) search := add(search, 0x20) result := add(mload(0x40), 0x20) let subjectStart := subject let subjectSearchEnd := add(sub(add(subject, subjectLength), searchLength), 1) let h := 0 if iszero(lt(searchLength, 32)) { h := keccak256(search, searchLength) } let m := shl(3, sub(32, and(searchLength, 31))) let s := mload(search) for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Append to `result`. mstore(result, sub(subject, subjectStart)) result := add(result, 0x20) // Advance `subject` by `searchLength`. subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } let resultEnd := result // Assign `result` to the free memory pointer. result := mload(0x40) // Store the length of `result`. mstore(result, shr(5, sub(resultEnd, add(result, 0x20)))) // Allocate memory for result. // We allocate one more word, so this array can be recycled for {split}. mstore(0x40, add(resultEnd, 0x20)) } } } /// @dev Returns a arrays of strings based on the `delimiter` inside of the `subject` string. function split(string memory subject, string memory delimiter) internal pure returns (string[] memory result) { uint256[] memory indices = indicesOf(subject, delimiter); /// @solidity memory-safe-assembly assembly { let w := not(31) let indexPtr := add(indices, 0x20) let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1))) mstore(add(indicesEnd, w), mload(subject)) mstore(indices, add(mload(indices), 1)) let prevIndex := 0 for {} 1 {} { let index := mload(indexPtr) mstore(indexPtr, 0x60) if iszero(eq(index, prevIndex)) { let element := mload(0x40) let elementLength := sub(index, prevIndex) mstore(element, elementLength) // Copy the `subject` one word at a time, backwards. for { let o := and(add(elementLength, 31), w) } 1 {} { mstore(add(element, o), mload(add(add(subject, prevIndex), o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(element, 0x20), elementLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(element, and(add(elementLength, 63), w))) // Store the `element` into the array. mstore(indexPtr, element) } prevIndex := add(index, mload(delimiter)) indexPtr := add(indexPtr, 0x20) if iszero(lt(indexPtr, indicesEnd)) { break } } result := indices if iszero(mload(delimiter)) { result := add(indices, 0x20) mstore(result, sub(mload(indices), 2)) } } } /// @dev Returns a concatenated string of `a` and `b`. /// Cheaper than `string.concat()` and does not de-align the free memory pointer. function concat(string memory a, string memory b) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let w := not(31) result := mload(0x40) let aLength := mload(a) // Copy `a` one word at a time, backwards. for { let o := and(add(mload(a), 32), w) } 1 {} { mstore(add(result, o), mload(add(a, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let bLength := mload(b) let output := add(result, mload(a)) // Copy `b` one word at a time, backwards. for { let o := and(add(bLength, 32), w) } 1 {} { mstore(add(output, o), mload(add(b, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let totalLength := add(aLength, bLength) let last := add(add(result, 0x20), totalLength) // Zeroize the slot after the string. mstore(last, 0) // Stores the length. mstore(result, totalLength) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), w)) } } /// @dev Returns a copy of the string in either lowercase or UPPERCASE. function toCase(string memory subject, bool toUpper) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let length := mload(subject) if length { result := add(mload(0x40), 0x20) subject := add(subject, 1) let flags := shl(add(70, shl(5, toUpper)), 67108863) let w := not(0) for { let o := length } 1 {} { o := add(o, w) let b := and(0xff, mload(add(subject, o))) mstore8(add(result, o), xor(b, and(shr(b, flags), 0x20))) if iszero(o) { break } } // Restore the result. result := mload(0x40) // Stores the string length. mstore(result, length) // Zeroize the slot after the string. let last := add(add(result, 0x20), length) mstore(last, 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), not(31))) } } } /// @dev Returns a lowercased copy of the string. function lower(string memory subject) internal pure returns (string memory result) { result = toCase(subject, false); } /// @dev Returns an UPPERCASED copy of the string. function upper(string memory subject) internal pure returns (string memory result) { result = toCase(subject, true); } /// @dev Escapes the string to be used within HTML tags. function escapeHTML(string memory s) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { for { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) // Store the bytes of the packed offsets and strides into the scratch space. // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6. mstore(0x1f, 0x900094) mstore(0x08, 0xc0000000a6ab) // Store ""&'<>" into the scratch space. mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b)) } iszero(eq(s, end)) {} { s := add(s, 1) let c := and(mload(s), 0xff) // Not in `["\"","'","&","<",">"]`. if iszero(and(shl(c, 1), 0x500000c400000000)) { mstore8(result, c) result := add(result, 1) continue } let t := shr(248, mload(c)) mstore(result, mload(and(t, 31))) result := add(result, shr(5, t)) } let last := result // Zeroize the slot after the string. mstore(last, 0) // Restore the result to the start of the free memory. result := mload(0x40) // Store the length of the result. mstore(result, sub(last, add(result, 0x20))) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), not(31))) } } /// @dev Escapes the string to be used within double-quotes in a JSON. function escapeJSON(string memory s) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { for { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) // Store "\\u0000" in scratch space. // Store "0123456789abcdef" in scratch space. // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`. // into the scratch space. mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672) // Bitmask for detecting `["\"","\\"]`. let e := or(shl(0x22, 1), shl(0x5c, 1)) } iszero(eq(s, end)) {} { s := add(s, 1) let c := and(mload(s), 0xff) if iszero(lt(c, 0x20)) { if iszero(and(shl(c, 1), e)) { // Not in `["\"","\\"]`. mstore8(result, c) result := add(result, 1) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), c) result := add(result, 2) continue } if iszero(and(shl(c, 1), 0x3700)) { // Not in `["\b","\t","\n","\f","\d"]`. mstore8(0x1d, mload(shr(4, c))) // Hex value. mstore8(0x1e, mload(and(c, 15))) // Hex value. mstore(result, mload(0x19)) // "\\u00XX". result := add(result, 6) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), mload(add(c, 8))) result := add(result, 2) } let last := result // Zeroize the slot after the string. mstore(last, 0) // Restore the result to the start of the free memory. result := mload(0x40) // Store the length of the result. mstore(result, sub(last, add(result, 0x20))) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), not(31))) } } /// @dev Returns whether `a` equals `b`. function eq(string memory a, string memory b) internal pure returns (bool result) { assembly { result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b))) } } /// @dev Packs a single string with its length into a single word. /// Returns `bytes32(0)` if the length is zero or greater than 31. function packOne(string memory a) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { // We don't need to zero right pad the string, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes. mload(add(a, 0x1f)), // `length != 0 && length < 32`. Abuses underflow. // Assumes that the length is valid and within the block gas limit. lt(sub(mload(a), 1), 0x1f) ) } } /// @dev Unpacks a string packed using {packOne}. /// Returns the empty string if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packOne}, the output behaviour is undefined. function unpackOne(bytes32 packed) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. result := mload(0x40) // Allocate 2 words (1 for the length, 1 for the bytes). mstore(0x40, add(result, 0x40)) // Zeroize the length slot. mstore(result, 0) // Store the length and bytes. mstore(add(result, 0x1f), packed) // Right pad with zeroes. mstore(add(add(result, 0x20), mload(result)), 0) } } /// @dev Packs two strings with their lengths into a single word. /// Returns `bytes32(0)` if combined length is zero or greater than 30. function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { let aLength := mload(a) // We don't need to zero right pad the strings, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes of `a` and `b`. or( shl(shl(3, sub(0x1f, aLength)), mload(add(a, aLength))), mload(sub(add(b, 0x1e), aLength)) ), // `totalLength != 0 && totalLength < 31`. Abuses underflow. // Assumes that the lengths are valid and within the block gas limit. lt(sub(add(aLength, mload(b)), 1), 0x1e) ) } } /// @dev Unpacks strings packed using {packTwo}. /// Returns the empty strings if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packTwo}, the output behaviour is undefined. function unpackTwo(bytes32 packed) internal pure returns (string memory resultA, string memory resultB) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. resultA := mload(0x40) resultB := add(resultA, 0x40) // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words. mstore(0x40, add(resultB, 0x40)) // Zeroize the length slots. mstore(resultA, 0) mstore(resultB, 0) // Store the lengths and bytes. mstore(add(resultA, 0x1f), packed) mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA)))) // Right pad with zeroes. mstore(add(add(resultA, 0x20), mload(resultA)), 0) mstore(add(add(resultB, 0x20), mload(resultB)), 0) } } /// @dev Directly returns `a` without copying. function directReturn(string memory a) internal pure { assembly { // Assumes that the string does not start from the scratch space. let retStart := sub(a, 0x20) let retSize := add(mload(a), 0x40) // Right pad with zeroes. Just in case the string is produced // by a method that doesn't zero right pad. mstore(add(retStart, retSize), 0) // Store the return offset. mstore(retStart, 0x20) // End the transaction, returning the string. return(retStart, retSize) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Gas optimized ECDSA wrapper. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/ECDSA.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ECDSA.sol) /// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol) library ECDSA { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The signature is invalid. error InvalidSignature(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The number which `s` must not exceed in order for /// the signature to be non-malleable. bytes32 private constant _MALLEABILITY_THRESHOLD = 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* RECOVERY OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // Note: as of Solady version 0.0.68, these functions will // revert upon recovery failure for more safety by default. /// @dev Recovers the signer's address from a message digest `hash`, /// and the `signature`. /// /// This function does NOT accept EIP-2098 short form signatures. /// Use `recover(bytes32 hash, bytes32 r, bytes32 vs)` for EIP-2098 /// short form signatures instead. function recover(bytes32 hash, bytes calldata signature) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { // Copy the free memory pointer so that we can restore it later. let m := mload(0x40) // Directly copy `r` and `s` from the calldata. calldatacopy(0x40, signature.offset, 0x40) // Store the `hash` in the scratch space. mstore(0x00, hash) // Compute `v` and store it in the scratch space. mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) pop( staticcall( gas(), // Amount of gas left for the transaction. and( // If the signature is exactly 65 bytes in length. eq(signature.length, 65), // If `s` in lower half order, such that the signature is not malleable. lt(mload(0x60), add(_MALLEABILITY_THRESHOLD, 1)) ), // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x00, // Start of output. 0x20 // Size of output. ) ) result := mload(0x00) // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. if iszero(returndatasize()) { // Store the function selector of `InvalidSignature()`. mstore(0x00, 0x8baa579f) // Revert with (offset, size). revert(0x1c, 0x04) } // Restore the zero slot. mstore(0x60, 0) // Restore the free memory pointer. mstore(0x40, m) } } /// @dev Recovers the signer's address from a message digest `hash`, /// and the EIP-2098 short form signature defined by `r` and `vs`. /// /// This function only accepts EIP-2098 short form signatures. /// See: https://eips.ethereum.org/EIPS/eip-2098 /// /// To be honest, I do not recommend using EIP-2098 signatures /// for simplicity, performance, and security reasons. Most if not /// all clients support traditional non EIP-2098 signatures by default. /// As such, this method is intentionally not fully inlined. /// It is merely included for completeness. function recover(bytes32 hash, bytes32 r, bytes32 vs) internal view returns (address result) { uint8 v; bytes32 s; /// @solidity memory-safe-assembly assembly { s := shr(1, shl(1, vs)) v := add(shr(255, vs), 27) } result = recover(hash, v, r, s); } /// @dev Recovers the signer's address from a message digest `hash`, /// and the signature defined by `v`, `r`, `s`. function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { // Copy the free memory pointer so that we can restore it later. let m := mload(0x40) mstore(0x00, hash) mstore(0x20, and(v, 0xff)) mstore(0x40, r) mstore(0x60, s) pop( staticcall( gas(), // Amount of gas left for the transaction. // If `s` in lower half order, such that the signature is not malleable. lt(s, add(_MALLEABILITY_THRESHOLD, 1)), // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x00, // Start of output. 0x20 // Size of output. ) ) result := mload(0x00) // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. if iszero(returndatasize()) { // Store the function selector of `InvalidSignature()`. mstore(0x00, 0x8baa579f) // Revert with (offset, size). revert(0x1c, 0x04) } // Restore the zero slot. mstore(0x60, 0) // Restore the free memory pointer. mstore(0x40, m) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* TRY-RECOVER OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // WARNING! // These functions will NOT revert upon recovery failure. // Instead, they will return the zero address upon recovery failure. // It is critical that the returned address is NEVER compared against // a zero address (e.g. an uninitialized address variable). /// @dev Recovers the signer's address from a message digest `hash`, /// and the `signature`. /// /// This function does NOT accept EIP-2098 short form signatures. /// Use `recover(bytes32 hash, bytes32 r, bytes32 vs)` for EIP-2098 /// short form signatures instead. function tryRecover(bytes32 hash, bytes calldata signature) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { if iszero(xor(signature.length, 65)) { // Copy the free memory pointer so that we can restore it later. let m := mload(0x40) // Directly copy `r` and `s` from the calldata. calldatacopy(0x40, signature.offset, 0x40) // If `s` in lower half order, such that the signature is not malleable. if iszero(gt(mload(0x60), _MALLEABILITY_THRESHOLD)) { // Store the `hash` in the scratch space. mstore(0x00, hash) // Compute `v` and store it in the scratch space. mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) pop( staticcall( gas(), // Amount of gas left for the transaction. 0x01, // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x40, // Start of output. 0x20 // Size of output. ) ) // Restore the zero slot. mstore(0x60, 0) // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. result := mload(xor(0x60, returndatasize())) } // Restore the free memory pointer. mstore(0x40, m) } } } /// @dev Recovers the signer's address from a message digest `hash`, /// and the EIP-2098 short form signature defined by `r` and `vs`. /// /// This function only accepts EIP-2098 short form signatures. /// See: https://eips.ethereum.org/EIPS/eip-2098 /// /// To be honest, I do not recommend using EIP-2098 signatures /// for simplicity, performance, and security reasons. Most if not /// all clients support traditional non EIP-2098 signatures by default. /// As such, this method is intentionally not fully inlined. /// It is merely included for completeness. function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal view returns (address result) { uint8 v; bytes32 s; /// @solidity memory-safe-assembly assembly { s := shr(1, shl(1, vs)) v := add(shr(255, vs), 27) } result = tryRecover(hash, v, r, s); } /// @dev Recovers the signer's address from a message digest `hash`, /// and the signature defined by `v`, `r`, `s`. function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { // Copy the free memory pointer so that we can restore it later. let m := mload(0x40) // If `s` in lower half order, such that the signature is not malleable. if iszero(gt(s, _MALLEABILITY_THRESHOLD)) { // Store the `hash`, `v`, `r`, `s` in the scratch space. mstore(0x00, hash) mstore(0x20, and(v, 0xff)) mstore(0x40, r) mstore(0x60, s) pop( staticcall( gas(), // Amount of gas left for the transaction. 0x01, // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x40, // Start of output. 0x20 // Size of output. ) ) // Restore the zero slot. mstore(0x60, 0) // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. result := mload(xor(0x60, returndatasize())) } // Restore the free memory pointer. mstore(0x40, m) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* HASHING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns an Ethereum Signed Message, created from a `hash`. /// This produces a hash corresponding to the one signed with the /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign) /// JSON-RPC method as part of EIP-191. function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { // Store into scratch space for keccak256. mstore(0x20, hash) mstore(0x00, "\x00\x00\x00\x00\x19Ethereum Signed Message:\n32") // 0x40 - 0x04 = 0x3c result := keccak256(0x04, 0x3c) } } /// @dev Returns an Ethereum Signed Message, created from `s`. /// This produces a hash corresponding to the one signed with the /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign) /// JSON-RPC method as part of EIP-191. function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32 result) { assembly { // The length of "\x19Ethereum Signed Message:\n" is 26 bytes (i.e. 0x1a). // If we reserve 2 words, we'll have 64 - 26 = 38 bytes to store the // ASCII decimal representation of the length of `s` up to about 2 ** 126. // Instead of allocating, we temporarily copy the 64 bytes before the // start of `s` data to some variables. let m := mload(sub(s, 0x20)) // The length of `s` is in bytes. let sLength := mload(s) let ptr := add(s, 0x20) let w := not(0) // `end` marks the end of the memory which we will compute the keccak256 of. let end := add(ptr, sLength) // Convert the length of the bytes to ASCII decimal representation // and store it into the memory. for { let temp := sLength } 1 {} { ptr := add(ptr, w) // `sub(ptr, 1)`. mstore8(ptr, add(48, mod(temp, 10))) temp := div(temp, 10) if iszero(temp) { break } } // Copy the header over to the memory. mstore(sub(ptr, 0x20), "\x00\x00\x00\x00\x00\x00\x19Ethereum Signed Message:\n") // Compute the keccak256 of the memory. result := keccak256(sub(ptr, 0x1a), sub(end, sub(ptr, 0x1a))) // Restore the previous memory. mstore(s, sLength) mstore(sub(s, 0x20), m) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* EMPTY CALLDATA HELPERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns an empty calldata bytes. function emptySignature() internal pure returns (bytes calldata signature) { /// @solidity memory-safe-assembly assembly { signature.length := 0 } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AQueryable.sol'; import '../ERC721A.sol'; /** * @title ERC721AQueryable. * * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable { /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) { return ownership; } ownership = _ownershipAt(tokenId); if (ownership.burned) { return ownership; } return _ownershipOf(tokenId); } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] calldata tokenIds) external view virtual override returns (TokenOwnership[] memory) { unchecked { uint256 tokenIdsLength = tokenIds.length; TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength); for (uint256 i; i != tokenIdsLength; ++i) { ownerships[i] = explicitOwnershipOf(tokenIds[i]); } return ownerships; } } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view virtual override returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _nextTokenId(); // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, stopLimit)`. if (stop > stopLimit) { stop = stopLimit; } uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (start < stop) { uint256 rangeLength = stop - start; if (rangeLength < tokenIdsMaxLength) { tokenIdsMaxLength = rangeLength; } } else { tokenIdsMaxLength = 0; } uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength); if (tokenIdsMaxLength == 0) { return tokenIds; } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`. // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range. if (!ownership.burned) { currOwnershipAddr = ownership.addr; } for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } // Downsize the array to fit. assembly { mstore(tokenIds, tokenIdsIdx) } return tokenIds; } } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); TokenOwnership memory ownership; for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) public payable virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../IERC721A.sol'; /** * @dev Interface of ERC721AQueryable. */ interface IERC721AQueryable is IERC721A { /** * Invalid query range (`start` >= `stop`). */ error InvalidQueryRange(); /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory); /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory); /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory); /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view returns (uint256[] memory); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"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":"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":"PRICE_UNIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","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 IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxPerTransaction","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWallet","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"potaList","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"potaMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"publicPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"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":"uint8","name":"value","type":"uint8"}],"name":"setMaxPerTransaction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"value","type":"uint8"}],"name":"setMaxPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"value","type":"uint16"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setPublicPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"value","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"value","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setWhitelistPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURILocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"whitelistPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"}]
Contract Creation Code
60806040526002600a60146101000a81548160ff021916908360ff1602179055506002600a60156101000a81548160ff021916908360ff1602179055506101f4600a60166101000a81548161ffff021916908361ffff160217905550620000736658d15e17628000620001ba60201b60201c565b600a60186101000a81548161ffff021916908361ffff160217905550620000a76658d15e17628000620001ba60201b60201c565b600a601a6101000a81548161ffff021916908361ffff1602179055506001600a601c6101000a81548160ff021916908315150217905550348015620000eb57600080fd5b506040518060400160405280600481526020017f504f5441000000000000000000000000000000000000000000000000000000008152506040518060400160405280600481526020017f504f5441000000000000000000000000000000000000000000000000000000008152508160029081620001699190620005db565b5080600390816200017b9190620005db565b506200018c6200028a60201b60201c565b6000819055505050620001b4620001a86200029360201b60201c565b6200029b60201b60201c565b6200080c565b60008066038d7ea4c680008381620001d757620001d6620006c2565b5b06146200021b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002129062000778565b60405180910390fd5b61ffff801666038d7ea4c6800083816200023a5762000239620006c2565b5b04925082111562000282576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200027990620007ea565b60405180910390fd5b819050919050565b60006001905090565b600033905090565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620003e357607f821691505b602082108103620003f957620003f86200039b565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620004637fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000424565b6200046f868362000424565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620004bc620004b6620004b08462000487565b62000491565b62000487565b9050919050565b6000819050919050565b620004d8836200049b565b620004f0620004e782620004c3565b84845462000431565b825550505050565b600090565b62000507620004f8565b62000514818484620004cd565b505050565b5b818110156200053c5762000530600082620004fd565b6001810190506200051a565b5050565b601f8211156200058b576200055581620003ff565b620005608462000414565b8101602085101562000570578190505b620005886200057f8562000414565b83018262000519565b50505b505050565b600082821c905092915050565b6000620005b06000198460080262000590565b1980831691505092915050565b6000620005cb83836200059d565b9150826002028217905092915050565b620005e68262000361565b67ffffffffffffffff8111156200060257620006016200036c565b5b6200060e8254620003ca565b6200061b82828562000540565b600060209050601f8311600181146200065357600084156200063e578287015190505b6200064a8582620005bd565b865550620006ba565b601f1984166200066386620003ff565b60005b828110156200068d5784890151825560018201915060208501945060208101905062000666565b86831015620006ad5784890151620006a9601f8916826200059d565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082825260208201905092915050565b7f5072696365206d7573742062652061206d756c7469706c65206f66205052494360008201527f455f554e49542e00000000000000000000000000000000000000000000000000602082015250565b600062000760602783620006f1565b91506200076d8262000702565b604082019050919050565b60006020820190508181036000830152620007938162000751565b9050919050565b7f4f766572666c6f772e0000000000000000000000000000000000000000000000600082015250565b6000620007d2600983620006f1565b9150620007df826200079a565b602082019050919050565b600060208201905081810360008301526200080581620007c3565b9050919050565b614745806200081c6000396000f3fe6080604052600436106102885760003560e01c80638da5cb5b1161015a578063c6275255116100c1578063e0df5b6f1161007a578063e0df5b6f14610949578063e985e9c514610972578063ed435e58146109af578063f2fde38b146109da578063fc1a1c3614610a03578063fca76c2614610a2e57610288565b8063c62752551461084d578063c87b56dd14610876578063ccdc7178146108b3578063d5abeb01146108dc578063df3c3a3014610907578063e0b6bb671461093257610288565b8063abf08ae111610113578063abf08ae11461075b578063ac998f4514610784578063b88d4fde146107af578063bc44d6c2146107cb578063c204642c146107e7578063c23dc68f1461081057610288565b80638da5cb5b1461064957806395d89b411461067457806399a2557a1461069f578063a22cb465146106dc578063a8d0466c14610705578063a945bf801461073057610288565b8063453c2310116101fe5780636be8d5ee116101b75780636be8d5ee1461054a5780636c19e7831461056657806370a082311461058f578063715018a6146105cc578063717d57d3146105e35780638462151c1461060c57610288565b8063453c2310146104385780634b980d67146104635780635bbb21771461048e5780635c975abb146104cb5780635e5a9e30146104f65780636352211e1461050d57610288565b806316c38b3c1161025057806316c38b3c1461037757806318160ddd146103a0578063238ac933146103cb57806323b872dd146103f65780633ccfd60b1461041257806342842e0e1461041c57610288565b806301ffc9a71461028d57806306421c2f146102ca57806306fdde03146102f3578063081812fc1461031e578063095ea7b31461035b575b600080fd5b34801561029957600080fd5b506102b460048036038101906102af9190613052565b610a45565b6040516102c1919061309a565b60405180910390f35b3480156102d657600080fd5b506102f160048036038101906102ec91906130ef565b610ad7565b005b3480156102ff57600080fd5b50610308610b55565b60405161031591906131ac565b60405180910390f35b34801561032a57600080fd5b5061034560048036038101906103409190613204565b610be7565b6040516103529190613272565b60405180910390f35b610375600480360381019061037091906132b9565b610c66565b005b34801561038357600080fd5b5061039e60048036038101906103999190613325565b610daa565b005b3480156103ac57600080fd5b506103b5610ec4565b6040516103c29190613361565b60405180910390f35b3480156103d757600080fd5b506103e0610edb565b6040516103ed9190613272565b60405180910390f35b610410600480360381019061040b919061337c565b610f01565b005b61041a611223565b005b6104366004803603810190610431919061337c565b611237565b005b34801561044457600080fd5b5061044d611257565b60405161045a91906133eb565b60405180910390f35b34801561046f57600080fd5b5061047861126a565b60405161048591906133eb565b60405180910390f35b34801561049a57600080fd5b506104b560048036038101906104b0919061346b565b61127d565b6040516104c2919061361b565b60405180910390f35b3480156104d757600080fd5b506104e0611340565b6040516104ed919061309a565b60405180910390f35b34801561050257600080fd5b5061050b611353565b005b34801561051957600080fd5b50610534600480360381019061052f9190613204565b611378565b6040516105419190613272565b60405180910390f35b610564600480360381019061055f9190613204565b61138a565b005b34801561057257600080fd5b5061058d6004803603810190610588919061363d565b6115ff565b005b34801561059b57600080fd5b506105b660048036038101906105b1919061363d565b6116ba565b6040516105c39190613361565b60405180910390f35b3480156105d857600080fd5b506105e1611772565b005b3480156105ef57600080fd5b5061060a60048036038101906106059190613204565b611786565b005b34801561061857600080fd5b50610633600480360381019061062e919061363d565b6117b6565b6040516106409190613728565b60405180910390f35b34801561065557600080fd5b5061065e6118f9565b60405161066b9190613272565b60405180910390f35b34801561068057600080fd5b50610689611923565b60405161069691906131ac565b60405180910390f35b3480156106ab57600080fd5b506106c660048036038101906106c1919061374a565b6119b5565b6040516106d39190613728565b60405180910390f35b3480156106e857600080fd5b5061070360048036038101906106fe919061379d565b611bc1565b005b34801561071157600080fd5b5061071a611ccc565b604051610727919061309a565b60405180910390f35b34801561073c57600080fd5b50610745611cdf565b6040516107529190613361565b60405180910390f35b34801561076757600080fd5b50610782600480360381019061077d9190613809565b611cff565b005b34801561079057600080fd5b50610799611d25565b6040516107a6919061309a565b60405180910390f35b6107c960048036038101906107c49190613966565b611d38565b005b6107e560048036038101906107e09190613204565b611dab565b005b3480156107f357600080fd5b5061080e60048036038101906108099190613a3f565b612020565b005b34801561081c57600080fd5b5061083760048036038101906108329190613204565b61213d565b6040516108449190613af4565b60405180910390f35b34801561085957600080fd5b50610874600480360381019061086f9190613204565b6121a7565b005b34801561088257600080fd5b5061089d60048036038101906108989190613204565b6121d7565b6040516108aa91906131ac565b60405180910390f35b3480156108bf57600080fd5b506108da60048036038101906108d59190613809565b6122b2565b005b3480156108e857600080fd5b506108f16122d8565b6040516108fe9190613b1e565b60405180910390f35b34801561091357600080fd5b5061091c6122ec565b604051610929919061309a565b60405180910390f35b34801561093e57600080fd5b506109476122ff565b005b34801561095557600080fd5b50610970600480360381019061096b9190613b8f565b612324565b005b34801561097e57600080fd5b5061099960048036038101906109949190613bdc565b612398565b6040516109a6919061309a565b60405180910390f35b3480156109bb57600080fd5b506109c461242c565b6040516109d19190613361565b60405180910390f35b3480156109e657600080fd5b50610a0160048036038101906109fc919061363d565b612437565b005b348015610a0f57600080fd5b50610a186124ba565b604051610a259190613361565b60405180910390f35b348015610a3a57600080fd5b50610a436124da565b005b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610aa057506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610ad05750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b610adf6124ff565b60001515600a601e9054906101000a900460ff16151514610b35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2c90613c68565b60405180910390fd5b80600a60166101000a81548161ffff021916908361ffff16021790555050565b606060028054610b6490613cb7565b80601f0160208091040260200160405190810160405280929190818152602001828054610b9090613cb7565b8015610bdd5780601f10610bb257610100808354040283529160200191610bdd565b820191906000526020600020905b815481529060010190602001808311610bc057829003601f168201915b5050505050905090565b6000610bf28261257d565b610c28576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610c7182611378565b90508073ffffffffffffffffffffffffffffffffffffffff16610c926125dc565b73ffffffffffffffffffffffffffffffffffffffff1614610cf557610cbe81610cb96125dc565b612398565b610cf4576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b826006600084815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b610db26124ff565b6000151581151503610ea7576000600a60169054906101000a900461ffff1661ffff1603610e15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0c90613d34565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610ea6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9d90613da0565b60405180910390fd5b5b80600a601c6101000a81548160ff02191690831515021790555050565b6000610ece6125e4565b6001546000540303905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610f0c826125ed565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610f73576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080610f7f846126b9565b91509150610f958187610f906125dc565b6126e0565b610fe157610faa86610fa56125dc565b612398565b610fe0576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603611047576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110548686866001612724565b801561105f57600082555b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001019190508190555061112d8561110988888761272a565b7c020000000000000000000000000000000000000000000000000000000017612752565b600460008681526020019081526020016000208190555060007c02000000000000000000000000000000000000000000000000000000008416036111b357600060018501905060006004600083815260200190815260200160002054036111b15760005481146111b0578360046000838152602001908152602001600020819055505b5b505b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461121b868686600161277d565b505050505050565b61122b6124ff565b6112353347612783565b565b61125283838360405180602001604052806000815250611d38565b505050565b600a60149054906101000a900460ff1681565b600a60159054906101000a900460ff1681565b6060600083839050905060008167ffffffffffffffff8111156112a3576112a261383b565b5b6040519080825280602002602001820160405280156112dc57816020015b6112c9612f97565b8152602001906001900390816112c15790505b50905060005b8281146113345761130b8686838181106112ff576112fe613dc0565b5b9050602002013561213d565b82828151811061131e5761131d613dc0565b5b60200260200101819052508060010190506112e2565b50809250505092915050565b600a601c9054906101000a900460ff1681565b61135b6124ff565b6001600a601f6101000a81548160ff021916908315150217905550565b6000611383826125ed565b9050919050565b60001515600a601c9054906101000a900460ff161515146113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d790613e3b565b60405180910390fd5b8060001515600a601d9054906101000a900460ff16151514611437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142e90613c68565b60405180910390fd5b600a60169054906101000a900461ffff1661ffff16816114556127a3565b011115611497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148e90613ea7565b60405180910390fd5b81600a60159054906101000a900460ff1660ff168111156114ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e490613f13565b60405180910390fd5b600a60149054906101000a900460ff1660ff168161150a336127b6565b01111561154c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154390613f7f565b60405180910390fd5b600a601a9054906101000a900461ffff168360648111156115a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159990613feb565b60405180910390fd5b806115ac8361280d565b0234146115ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e590614057565b60405180910390fd5b6115f8338661282d565b5050505050565b6116076124ff565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611676576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166d906140e9565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611721576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b61177a6124ff565b61178460006129e8565b565b61178e6124ff565b61179781612aae565b600a60186101000a81548161ffff021916908361ffff16021790555050565b606060008060006117c6856116ba565b905060008167ffffffffffffffff8111156117e4576117e361383b565b5b6040519080825280602002602001820160405280156118125781602001602082028036833780820191505090505b50905061181d612f97565b60006118276125e4565b90505b8386146118eb5761183a81612b72565b915081604001516118e057600073ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff161461188557816000015194505b8773ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16036118df57808387806001019850815181106118d2576118d1613dc0565b5b6020026020010181815250505b5b80600101905061182a565b508195505050505050919050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606003805461193290613cb7565b80601f016020809104026020016040519081016040528092919081815260200182805461195e90613cb7565b80156119ab5780601f10611980576101008083540402835291602001916119ab565b820191906000526020600020905b81548152906001019060200180831161198e57829003601f168201915b5050505050905090565b60608183106119f0576040517f32c1995a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806119fb612b9d565b9050611a056125e4565b851015611a1757611a146125e4565b94505b80841115611a23578093505b6000611a2e876116ba565b905084861015611a51576000868603905081811015611a4b578091505b50611a56565b600090505b60008167ffffffffffffffff811115611a7257611a7161383b565b5b604051908082528060200260200182016040528015611aa05781602001602082028036833780820191505090505b50905060008203611ab75780945050505050611bba565b6000611ac28861213d565b905060008160400151611ad757816000015190505b60008990505b888114158015611aed5750848714155b15611bac57611afb81612b72565b92508260400151611ba157600073ffffffffffffffffffffffffffffffffffffffff16836000015173ffffffffffffffffffffffffffffffffffffffff1614611b4657826000015191505b8a73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611ba05780848880600101995081518110611b9357611b92613dc0565b5b6020026020010181815250505b5b806001019050611add565b508583528296505050505050505b9392505050565b8060076000611bce6125dc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611c7b6125dc565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611cc0919061309a565b60405180910390a35050565b600a601e9054906101000a900460ff1681565b6000611cfa600a601a9054906101000a900461ffff1661280d565b905090565b611d076124ff565b80600a60146101000a81548160ff021916908360ff16021790555050565b600a601f9054906101000a900460ff1681565b611d43848484610f01565b60008373ffffffffffffffffffffffffffffffffffffffff163b14611da557611d6e84848484612ba6565b611da4576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50505050565b60001515600a601c9054906101000a900460ff16151514611e01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df890613e3b565b60405180910390fd5b8060001515600a601d9054906101000a900460ff16151514611e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4f90613c68565b60405180910390fd5b600a60169054906101000a900461ffff1661ffff1681611e766127a3565b011115611eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaf90613ea7565b60405180910390fd5b81600a60159054906101000a900460ff1660ff16811115611f0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f0590613f13565b60405180910390fd5b600a60149054906101000a900460ff1660ff1681611f2b336127b6565b011115611f6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6490613f7f565b60405180910390fd5b600a60189054906101000a900461ffff16836064811115611fc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fba90613feb565b60405180910390fd5b80611fcd8361280d565b02341461200f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161200690614057565b60405180910390fd5b612019338661282d565b5050505050565b6120286124ff565b82829050816120379190614138565b60001515600a601d9054906101000a900460ff1615151461208d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208490613c68565b60405180910390fd5b600a60169054906101000a900461ffff1661ffff16816120ab6127a3565b0111156120ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e490613ea7565b60405180910390fd5b60005b8484905081146121365761212b8585838181106121105761210f613dc0565b5b9050602002016020810190612125919061363d565b8461282d565b8060010190506120f0565b5050505050565b612145612f97565b61214d612f97565b6121556125e4565b8310806121695750612165612b9d565b8310155b1561217757809150506121a2565b61218083612b72565b905080604001511561219557809150506121a2565b61219e83612cf6565b9150505b919050565b6121af6124ff565b6121b881612aae565b600a601a6101000a81548161ffff021916908361ffff16021790555050565b60606122ab600980546121e990613cb7565b80601f016020809104026020016040519081016040528092919081815260200182805461221590613cb7565b80156122625780601f1061223757610100808354040283529160200191612262565b820191906000526020600020905b81548152906001019060200180831161224557829003601f168201915b50505050506040518060400160405280600481526020017f7b69647d000000000000000000000000000000000000000000000000000000008152506122a685612d16565b612d66565b9050919050565b6122ba6124ff565b80600a60156101000a81548160ff021916908360ff16021790555050565b600a60169054906101000a900461ffff1681565b600a601d9054906101000a900460ff1681565b6123076124ff565b6001600a601d6101000a81548160ff021916908315150217905550565b61232c6124ff565b60001515600a601f9054906101000a900460ff16151514612382576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237990613c68565b60405180910390fd5b818160099182612393929190614331565b505050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b66038d7ea4c6800081565b61243f6124ff565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036124ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124a590614473565b60405180910390fd5b6124b7816129e8565b50565b60006124d5600a60189054906101000a900461ffff1661280d565b905090565b6124e26124ff565b6001600a601e6101000a81548160ff021916908315150217905550565b612507612ec0565b73ffffffffffffffffffffffffffffffffffffffff166125256118f9565b73ffffffffffffffffffffffffffffffffffffffff161461257b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612572906144df565b60405180910390fd5b565b6000816125886125e4565b11158015612597575060005482105b80156125d5575060007c0100000000000000000000000000000000000000000000000000000000600460008581526020019081526020016000205416145b9050919050565b600033905090565b60006001905090565b600080829050806125fc6125e4565b11612682576000548110156126815760006004600083815260200190815260200160002054905060007c010000000000000000000000000000000000000000000000000000000082160361267f575b6000810361267557600460008360019003935083815260200190815260200160002054905061264b565b80925050506126b4565b505b5b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b60008060006006600085815260200190815260200160002090508092508254915050915091565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e8612741868684612ec8565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b60008060008084865af161279f5763b12d13eb6000526004601cfd5b5050565b60006127ad6125e4565b60005403905090565b600067ffffffffffffffff6040600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054901c169050919050565b600066038d7ea4c680008261ffff166128269190614138565b9050919050565b6000805490506000820361286d576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61287a6000848385612724565b600160406001901b178202600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506128f1836128e2600086600061272a565b6128eb85612ed1565b17612752565b6004600083815260200190815260200160002081905550600080838301905073ffffffffffffffffffffffffffffffffffffffff85169150828260007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600183015b81811461299257808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600181019050612957565b50600082036129cd576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060008190555050506129e3600084838561277d565b505050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008066038d7ea4c680008381612ac857612ac76144ff565b5b0614612b09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b00906145a0565b60405180910390fd5b61ffff801666038d7ea4c680008381612b2557612b246144ff565b5b049250821115612b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b619061460c565b60405180910390fd5b819050919050565b612b7a612f97565b612b966004600084815260200190815260200160002054612ee1565b9050919050565b60008054905090565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612bcc6125dc565b8786866040518563ffffffff1660e01b8152600401612bee9493929190614681565b6020604051808303816000875af1925050508015612c2a57506040513d601f19601f82011682018060405250810190612c2791906146e2565b60015b612ca3573d8060008114612c5a576040519150601f19603f3d011682016040523d82523d6000602084013e612c5f565b606091505b506000815103612c9b576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b612cfe612f97565b612d0f612d0a836125ed565b612ee1565b9050919050565b606060a060405101806040526020810391506000825281835b600115612d5157600184039350600a81066030018453600a8104905080612d2f575b50828103602084039350808452505050919050565b60608351835183516020870196506020860195506020850194506020604051019350828701838311612e6657600183820301600060208510612da85784892090505b601f851660200360031b89515b600115612e61578b51818118831c612e3e578315612df95783888e2014612df857808a5260018a01995060018d019c50848d10612df25750612e61565b50612e5c565b5b60005b600115612e1957808c0151818c0152602081019050878110612dfc575b50868a019950878d019c508715612e3d57848d10612e375750612e61565b50612e5c565b5b808a5260018a01995060018d019c50848d10612e5a5750612e61565b505b612db5565b505050505b846020604051019550888203868203015b828a1015612e94578951825260208201915060208a019950612e77565b60208703965080602088010160008152601f19601f820116604052818852505050505050509392505050565b600033905090565b60009392505050565b60006001821460e11b9050919050565b612ee9612f97565b81816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060a082901c816020019067ffffffffffffffff16908167ffffffffffffffff168152505060007c01000000000000000000000000000000000000000000000000000000008316141581604001901515908115158152505060e882901c816060019062ffffff16908162ffffff1681525050919050565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff168152602001600015158152602001600062ffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61302f81612ffa565b811461303a57600080fd5b50565b60008135905061304c81613026565b92915050565b60006020828403121561306857613067612ff0565b5b60006130768482850161303d565b91505092915050565b60008115159050919050565b6130948161307f565b82525050565b60006020820190506130af600083018461308b565b92915050565b600061ffff82169050919050565b6130cc816130b5565b81146130d757600080fd5b50565b6000813590506130e9816130c3565b92915050565b60006020828403121561310557613104612ff0565b5b6000613113848285016130da565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561315657808201518184015260208101905061313b565b60008484015250505050565b6000601f19601f8301169050919050565b600061317e8261311c565b6131888185613127565b9350613198818560208601613138565b6131a181613162565b840191505092915050565b600060208201905081810360008301526131c68184613173565b905092915050565b6000819050919050565b6131e1816131ce565b81146131ec57600080fd5b50565b6000813590506131fe816131d8565b92915050565b60006020828403121561321a57613219612ff0565b5b6000613228848285016131ef565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061325c82613231565b9050919050565b61326c81613251565b82525050565b60006020820190506132876000830184613263565b92915050565b61329681613251565b81146132a157600080fd5b50565b6000813590506132b38161328d565b92915050565b600080604083850312156132d0576132cf612ff0565b5b60006132de858286016132a4565b92505060206132ef858286016131ef565b9150509250929050565b6133028161307f565b811461330d57600080fd5b50565b60008135905061331f816132f9565b92915050565b60006020828403121561333b5761333a612ff0565b5b600061334984828501613310565b91505092915050565b61335b816131ce565b82525050565b60006020820190506133766000830184613352565b92915050565b60008060006060848603121561339557613394612ff0565b5b60006133a3868287016132a4565b93505060206133b4868287016132a4565b92505060406133c5868287016131ef565b9150509250925092565b600060ff82169050919050565b6133e5816133cf565b82525050565b600060208201905061340060008301846133dc565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261342b5761342a613406565b5b8235905067ffffffffffffffff8111156134485761344761340b565b5b60208301915083602082028301111561346457613463613410565b5b9250929050565b6000806020838503121561348257613481612ff0565b5b600083013567ffffffffffffffff8111156134a05761349f612ff5565b5b6134ac85828601613415565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6134ed81613251565b82525050565b600067ffffffffffffffff82169050919050565b613510816134f3565b82525050565b61351f8161307f565b82525050565b600062ffffff82169050919050565b61353d81613525565b82525050565b60808201600082015161355960008501826134e4565b50602082015161356c6020850182613507565b50604082015161357f6040850182613516565b5060608201516135926060850182613534565b50505050565b60006135a48383613543565b60808301905092915050565b6000602082019050919050565b60006135c8826134b8565b6135d281856134c3565b93506135dd836134d4565b8060005b8381101561360e5781516135f58882613598565b9750613600836135b0565b9250506001810190506135e1565b5085935050505092915050565b6000602082019050818103600083015261363581846135bd565b905092915050565b60006020828403121561365357613652612ff0565b5b6000613661848285016132a4565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61369f816131ce565b82525050565b60006136b18383613696565b60208301905092915050565b6000602082019050919050565b60006136d58261366a565b6136df8185613675565b93506136ea83613686565b8060005b8381101561371b57815161370288826136a5565b975061370d836136bd565b9250506001810190506136ee565b5085935050505092915050565b6000602082019050818103600083015261374281846136ca565b905092915050565b60008060006060848603121561376357613762612ff0565b5b6000613771868287016132a4565b9350506020613782868287016131ef565b9250506040613793868287016131ef565b9150509250925092565b600080604083850312156137b4576137b3612ff0565b5b60006137c2858286016132a4565b92505060206137d385828601613310565b9150509250929050565b6137e6816133cf565b81146137f157600080fd5b50565b600081359050613803816137dd565b92915050565b60006020828403121561381f5761381e612ff0565b5b600061382d848285016137f4565b91505092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61387382613162565b810181811067ffffffffffffffff821117156138925761389161383b565b5b80604052505050565b60006138a5612fe6565b90506138b1828261386a565b919050565b600067ffffffffffffffff8211156138d1576138d061383b565b5b6138da82613162565b9050602081019050919050565b82818337600083830152505050565b6000613909613904846138b6565b61389b565b90508281526020810184848401111561392557613924613836565b5b6139308482856138e7565b509392505050565b600082601f83011261394d5761394c613406565b5b813561395d8482602086016138f6565b91505092915050565b600080600080608085870312156139805761397f612ff0565b5b600061398e878288016132a4565b945050602061399f878288016132a4565b93505060406139b0878288016131ef565b925050606085013567ffffffffffffffff8111156139d1576139d0612ff5565b5b6139dd87828801613938565b91505092959194509250565b60008083601f8401126139ff576139fe613406565b5b8235905067ffffffffffffffff811115613a1c57613a1b61340b565b5b602083019150836020820283011115613a3857613a37613410565b5b9250929050565b600080600060408486031215613a5857613a57612ff0565b5b600084013567ffffffffffffffff811115613a7657613a75612ff5565b5b613a82868287016139e9565b93509350506020613a95868287016131ef565b9150509250925092565b608082016000820151613ab560008501826134e4565b506020820151613ac86020850182613507565b506040820151613adb6040850182613516565b506060820151613aee6060850182613534565b50505050565b6000608082019050613b096000830184613a9f565b92915050565b613b18816130b5565b82525050565b6000602082019050613b336000830184613b0f565b92915050565b60008083601f840112613b4f57613b4e613406565b5b8235905067ffffffffffffffff811115613b6c57613b6b61340b565b5b602083019150836001820283011115613b8857613b87613410565b5b9250929050565b60008060208385031215613ba657613ba5612ff0565b5b600083013567ffffffffffffffff811115613bc457613bc3612ff5565b5b613bd085828601613b39565b92509250509250929050565b60008060408385031215613bf357613bf2612ff0565b5b6000613c01858286016132a4565b9250506020613c12858286016132a4565b9150509250929050565b7f4c6f636b65642e00000000000000000000000000000000000000000000000000600082015250565b6000613c52600783613127565b9150613c5d82613c1c565b602082019050919050565b60006020820190508181036000830152613c8181613c45565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680613ccf57607f821691505b602082108103613ce257613ce1613c88565b5b50919050565b7f4d617820737570706c79206e6f74207365742e00000000000000000000000000600082015250565b6000613d1e601383613127565b9150613d2982613ce8565b602082019050919050565b60006020820190508181036000830152613d4d81613d11565b9050919050565b7f5369676e6572206e6f74207365742e0000000000000000000000000000000000600082015250565b6000613d8a600f83613127565b9150613d9582613d54565b602082019050919050565b60006020820190508181036000830152613db981613d7d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f5061757365642e00000000000000000000000000000000000000000000000000600082015250565b6000613e25600783613127565b9150613e3082613def565b602082019050919050565b60006020820190508181036000830152613e5481613e18565b9050919050565b7f4f7574206f662073746f636b2100000000000000000000000000000000000000600082015250565b6000613e91600d83613127565b9150613e9c82613e5b565b602082019050919050565b60006020820190508181036000830152613ec081613e84565b9050919050565b7f4d617820706572207472616e73616374696f6e20726561636865642e00000000600082015250565b6000613efd601c83613127565b9150613f0882613ec7565b602082019050919050565b60006020820190508181036000830152613f2c81613ef0565b9050919050565b7f4d6178206e756d626572206d696e74656420726561636865642e000000000000600082015250565b6000613f69601a83613127565b9150613f7482613f33565b602082019050919050565b60006020820190508181036000830152613f9881613f5c565b9050919050565b7f5175616e7469747920746f6f20686967682e0000000000000000000000000000600082015250565b6000613fd5601283613127565b9150613fe082613f9f565b602082019050919050565b6000602082019050818103600083015261400481613fc8565b9050919050565b7f57726f6e672045746865722076616c75652e0000000000000000000000000000600082015250565b6000614041601283613127565b915061404c8261400b565b602082019050919050565b6000602082019050818103600083015261407081614034565b9050919050565b7f5369676e6572206d757374206e6f7420626520746865207a65726f206164647260008201527f6573732e00000000000000000000000000000000000000000000000000000000602082015250565b60006140d3602483613127565b91506140de82614077565b604082019050919050565b60006020820190508181036000830152614102816140c6565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614143826131ce565b915061414e836131ce565b925082820261415c816131ce565b9150828204841483151761417357614172614109565b5b5092915050565b600082905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026141e77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826141aa565b6141f186836141aa565b95508019841693508086168417925050509392505050565b6000819050919050565b600061422e614229614224846131ce565b614209565b6131ce565b9050919050565b6000819050919050565b61424883614213565b61425c61425482614235565b8484546141b7565b825550505050565b600090565b614271614264565b61427c81848461423f565b505050565b5b818110156142a057614295600082614269565b600181019050614282565b5050565b601f8211156142e5576142b681614185565b6142bf8461419a565b810160208510156142ce578190505b6142e26142da8561419a565b830182614281565b50505b505050565b600082821c905092915050565b6000614308600019846008026142ea565b1980831691505092915050565b600061432183836142f7565b9150826002028217905092915050565b61433b838361417a565b67ffffffffffffffff8111156143545761435361383b565b5b61435e8254613cb7565b6143698282856142a4565b6000601f8311600181146143985760008415614386578287013590505b6143908582614315565b8655506143f8565b601f1984166143a686614185565b60005b828110156143ce578489013582556001820191506020850194506020810190506143a9565b868310156143eb57848901356143e7601f8916826142f7565b8355505b6001600288020188555050505b50505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061445d602683613127565b915061446882614401565b604082019050919050565b6000602082019050818103600083015261448c81614450565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006144c9602083613127565b91506144d482614493565b602082019050919050565b600060208201905081810360008301526144f8816144bc565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f5072696365206d7573742062652061206d756c7469706c65206f66205052494360008201527f455f554e49542e00000000000000000000000000000000000000000000000000602082015250565b600061458a602783613127565b91506145958261452e565b604082019050919050565b600060208201905081810360008301526145b98161457d565b9050919050565b7f4f766572666c6f772e0000000000000000000000000000000000000000000000600082015250565b60006145f6600983613127565b9150614601826145c0565b602082019050919050565b60006020820190508181036000830152614625816145e9565b9050919050565b600081519050919050565b600082825260208201905092915050565b60006146538261462c565b61465d8185614637565b935061466d818560208601613138565b61467681613162565b840191505092915050565b60006080820190506146966000830187613263565b6146a36020830186613263565b6146b06040830185613352565b81810360608301526146c28184614648565b905095945050505050565b6000815190506146dc81613026565b92915050565b6000602082840312156146f8576146f7612ff0565b5b6000614706848285016146cd565b9150509291505056fea26469706673582212206d1742a73f9f5bfbbc9eb9f121024e34badda548823bd4254ec9ed2445b2f89464736f6c63430008110033
Deployed Bytecode
0x6080604052600436106102885760003560e01c80638da5cb5b1161015a578063c6275255116100c1578063e0df5b6f1161007a578063e0df5b6f14610949578063e985e9c514610972578063ed435e58146109af578063f2fde38b146109da578063fc1a1c3614610a03578063fca76c2614610a2e57610288565b8063c62752551461084d578063c87b56dd14610876578063ccdc7178146108b3578063d5abeb01146108dc578063df3c3a3014610907578063e0b6bb671461093257610288565b8063abf08ae111610113578063abf08ae11461075b578063ac998f4514610784578063b88d4fde146107af578063bc44d6c2146107cb578063c204642c146107e7578063c23dc68f1461081057610288565b80638da5cb5b1461064957806395d89b411461067457806399a2557a1461069f578063a22cb465146106dc578063a8d0466c14610705578063a945bf801461073057610288565b8063453c2310116101fe5780636be8d5ee116101b75780636be8d5ee1461054a5780636c19e7831461056657806370a082311461058f578063715018a6146105cc578063717d57d3146105e35780638462151c1461060c57610288565b8063453c2310146104385780634b980d67146104635780635bbb21771461048e5780635c975abb146104cb5780635e5a9e30146104f65780636352211e1461050d57610288565b806316c38b3c1161025057806316c38b3c1461037757806318160ddd146103a0578063238ac933146103cb57806323b872dd146103f65780633ccfd60b1461041257806342842e0e1461041c57610288565b806301ffc9a71461028d57806306421c2f146102ca57806306fdde03146102f3578063081812fc1461031e578063095ea7b31461035b575b600080fd5b34801561029957600080fd5b506102b460048036038101906102af9190613052565b610a45565b6040516102c1919061309a565b60405180910390f35b3480156102d657600080fd5b506102f160048036038101906102ec91906130ef565b610ad7565b005b3480156102ff57600080fd5b50610308610b55565b60405161031591906131ac565b60405180910390f35b34801561032a57600080fd5b5061034560048036038101906103409190613204565b610be7565b6040516103529190613272565b60405180910390f35b610375600480360381019061037091906132b9565b610c66565b005b34801561038357600080fd5b5061039e60048036038101906103999190613325565b610daa565b005b3480156103ac57600080fd5b506103b5610ec4565b6040516103c29190613361565b60405180910390f35b3480156103d757600080fd5b506103e0610edb565b6040516103ed9190613272565b60405180910390f35b610410600480360381019061040b919061337c565b610f01565b005b61041a611223565b005b6104366004803603810190610431919061337c565b611237565b005b34801561044457600080fd5b5061044d611257565b60405161045a91906133eb565b60405180910390f35b34801561046f57600080fd5b5061047861126a565b60405161048591906133eb565b60405180910390f35b34801561049a57600080fd5b506104b560048036038101906104b0919061346b565b61127d565b6040516104c2919061361b565b60405180910390f35b3480156104d757600080fd5b506104e0611340565b6040516104ed919061309a565b60405180910390f35b34801561050257600080fd5b5061050b611353565b005b34801561051957600080fd5b50610534600480360381019061052f9190613204565b611378565b6040516105419190613272565b60405180910390f35b610564600480360381019061055f9190613204565b61138a565b005b34801561057257600080fd5b5061058d6004803603810190610588919061363d565b6115ff565b005b34801561059b57600080fd5b506105b660048036038101906105b1919061363d565b6116ba565b6040516105c39190613361565b60405180910390f35b3480156105d857600080fd5b506105e1611772565b005b3480156105ef57600080fd5b5061060a60048036038101906106059190613204565b611786565b005b34801561061857600080fd5b50610633600480360381019061062e919061363d565b6117b6565b6040516106409190613728565b60405180910390f35b34801561065557600080fd5b5061065e6118f9565b60405161066b9190613272565b60405180910390f35b34801561068057600080fd5b50610689611923565b60405161069691906131ac565b60405180910390f35b3480156106ab57600080fd5b506106c660048036038101906106c1919061374a565b6119b5565b6040516106d39190613728565b60405180910390f35b3480156106e857600080fd5b5061070360048036038101906106fe919061379d565b611bc1565b005b34801561071157600080fd5b5061071a611ccc565b604051610727919061309a565b60405180910390f35b34801561073c57600080fd5b50610745611cdf565b6040516107529190613361565b60405180910390f35b34801561076757600080fd5b50610782600480360381019061077d9190613809565b611cff565b005b34801561079057600080fd5b50610799611d25565b6040516107a6919061309a565b60405180910390f35b6107c960048036038101906107c49190613966565b611d38565b005b6107e560048036038101906107e09190613204565b611dab565b005b3480156107f357600080fd5b5061080e60048036038101906108099190613a3f565b612020565b005b34801561081c57600080fd5b5061083760048036038101906108329190613204565b61213d565b6040516108449190613af4565b60405180910390f35b34801561085957600080fd5b50610874600480360381019061086f9190613204565b6121a7565b005b34801561088257600080fd5b5061089d60048036038101906108989190613204565b6121d7565b6040516108aa91906131ac565b60405180910390f35b3480156108bf57600080fd5b506108da60048036038101906108d59190613809565b6122b2565b005b3480156108e857600080fd5b506108f16122d8565b6040516108fe9190613b1e565b60405180910390f35b34801561091357600080fd5b5061091c6122ec565b604051610929919061309a565b60405180910390f35b34801561093e57600080fd5b506109476122ff565b005b34801561095557600080fd5b50610970600480360381019061096b9190613b8f565b612324565b005b34801561097e57600080fd5b5061099960048036038101906109949190613bdc565b612398565b6040516109a6919061309a565b60405180910390f35b3480156109bb57600080fd5b506109c461242c565b6040516109d19190613361565b60405180910390f35b3480156109e657600080fd5b50610a0160048036038101906109fc919061363d565b612437565b005b348015610a0f57600080fd5b50610a186124ba565b604051610a259190613361565b60405180910390f35b348015610a3a57600080fd5b50610a436124da565b005b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610aa057506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610ad05750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b610adf6124ff565b60001515600a601e9054906101000a900460ff16151514610b35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2c90613c68565b60405180910390fd5b80600a60166101000a81548161ffff021916908361ffff16021790555050565b606060028054610b6490613cb7565b80601f0160208091040260200160405190810160405280929190818152602001828054610b9090613cb7565b8015610bdd5780601f10610bb257610100808354040283529160200191610bdd565b820191906000526020600020905b815481529060010190602001808311610bc057829003601f168201915b5050505050905090565b6000610bf28261257d565b610c28576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610c7182611378565b90508073ffffffffffffffffffffffffffffffffffffffff16610c926125dc565b73ffffffffffffffffffffffffffffffffffffffff1614610cf557610cbe81610cb96125dc565b612398565b610cf4576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b826006600084815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b610db26124ff565b6000151581151503610ea7576000600a60169054906101000a900461ffff1661ffff1603610e15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0c90613d34565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610ea6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9d90613da0565b60405180910390fd5b5b80600a601c6101000a81548160ff02191690831515021790555050565b6000610ece6125e4565b6001546000540303905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610f0c826125ed565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610f73576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080610f7f846126b9565b91509150610f958187610f906125dc565b6126e0565b610fe157610faa86610fa56125dc565b612398565b610fe0576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603611047576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110548686866001612724565b801561105f57600082555b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001019190508190555061112d8561110988888761272a565b7c020000000000000000000000000000000000000000000000000000000017612752565b600460008681526020019081526020016000208190555060007c02000000000000000000000000000000000000000000000000000000008416036111b357600060018501905060006004600083815260200190815260200160002054036111b15760005481146111b0578360046000838152602001908152602001600020819055505b5b505b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461121b868686600161277d565b505050505050565b61122b6124ff565b6112353347612783565b565b61125283838360405180602001604052806000815250611d38565b505050565b600a60149054906101000a900460ff1681565b600a60159054906101000a900460ff1681565b6060600083839050905060008167ffffffffffffffff8111156112a3576112a261383b565b5b6040519080825280602002602001820160405280156112dc57816020015b6112c9612f97565b8152602001906001900390816112c15790505b50905060005b8281146113345761130b8686838181106112ff576112fe613dc0565b5b9050602002013561213d565b82828151811061131e5761131d613dc0565b5b60200260200101819052508060010190506112e2565b50809250505092915050565b600a601c9054906101000a900460ff1681565b61135b6124ff565b6001600a601f6101000a81548160ff021916908315150217905550565b6000611383826125ed565b9050919050565b60001515600a601c9054906101000a900460ff161515146113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d790613e3b565b60405180910390fd5b8060001515600a601d9054906101000a900460ff16151514611437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142e90613c68565b60405180910390fd5b600a60169054906101000a900461ffff1661ffff16816114556127a3565b011115611497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148e90613ea7565b60405180910390fd5b81600a60159054906101000a900460ff1660ff168111156114ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e490613f13565b60405180910390fd5b600a60149054906101000a900460ff1660ff168161150a336127b6565b01111561154c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154390613f7f565b60405180910390fd5b600a601a9054906101000a900461ffff168360648111156115a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159990613feb565b60405180910390fd5b806115ac8361280d565b0234146115ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e590614057565b60405180910390fd5b6115f8338661282d565b5050505050565b6116076124ff565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611676576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166d906140e9565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611721576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b61177a6124ff565b61178460006129e8565b565b61178e6124ff565b61179781612aae565b600a60186101000a81548161ffff021916908361ffff16021790555050565b606060008060006117c6856116ba565b905060008167ffffffffffffffff8111156117e4576117e361383b565b5b6040519080825280602002602001820160405280156118125781602001602082028036833780820191505090505b50905061181d612f97565b60006118276125e4565b90505b8386146118eb5761183a81612b72565b915081604001516118e057600073ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff161461188557816000015194505b8773ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16036118df57808387806001019850815181106118d2576118d1613dc0565b5b6020026020010181815250505b5b80600101905061182a565b508195505050505050919050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606003805461193290613cb7565b80601f016020809104026020016040519081016040528092919081815260200182805461195e90613cb7565b80156119ab5780601f10611980576101008083540402835291602001916119ab565b820191906000526020600020905b81548152906001019060200180831161198e57829003601f168201915b5050505050905090565b60608183106119f0576040517f32c1995a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806119fb612b9d565b9050611a056125e4565b851015611a1757611a146125e4565b94505b80841115611a23578093505b6000611a2e876116ba565b905084861015611a51576000868603905081811015611a4b578091505b50611a56565b600090505b60008167ffffffffffffffff811115611a7257611a7161383b565b5b604051908082528060200260200182016040528015611aa05781602001602082028036833780820191505090505b50905060008203611ab75780945050505050611bba565b6000611ac28861213d565b905060008160400151611ad757816000015190505b60008990505b888114158015611aed5750848714155b15611bac57611afb81612b72565b92508260400151611ba157600073ffffffffffffffffffffffffffffffffffffffff16836000015173ffffffffffffffffffffffffffffffffffffffff1614611b4657826000015191505b8a73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611ba05780848880600101995081518110611b9357611b92613dc0565b5b6020026020010181815250505b5b806001019050611add565b508583528296505050505050505b9392505050565b8060076000611bce6125dc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611c7b6125dc565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611cc0919061309a565b60405180910390a35050565b600a601e9054906101000a900460ff1681565b6000611cfa600a601a9054906101000a900461ffff1661280d565b905090565b611d076124ff565b80600a60146101000a81548160ff021916908360ff16021790555050565b600a601f9054906101000a900460ff1681565b611d43848484610f01565b60008373ffffffffffffffffffffffffffffffffffffffff163b14611da557611d6e84848484612ba6565b611da4576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50505050565b60001515600a601c9054906101000a900460ff16151514611e01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df890613e3b565b60405180910390fd5b8060001515600a601d9054906101000a900460ff16151514611e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4f90613c68565b60405180910390fd5b600a60169054906101000a900461ffff1661ffff1681611e766127a3565b011115611eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaf90613ea7565b60405180910390fd5b81600a60159054906101000a900460ff1660ff16811115611f0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f0590613f13565b60405180910390fd5b600a60149054906101000a900460ff1660ff1681611f2b336127b6565b011115611f6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6490613f7f565b60405180910390fd5b600a60189054906101000a900461ffff16836064811115611fc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fba90613feb565b60405180910390fd5b80611fcd8361280d565b02341461200f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161200690614057565b60405180910390fd5b612019338661282d565b5050505050565b6120286124ff565b82829050816120379190614138565b60001515600a601d9054906101000a900460ff1615151461208d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208490613c68565b60405180910390fd5b600a60169054906101000a900461ffff1661ffff16816120ab6127a3565b0111156120ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e490613ea7565b60405180910390fd5b60005b8484905081146121365761212b8585838181106121105761210f613dc0565b5b9050602002016020810190612125919061363d565b8461282d565b8060010190506120f0565b5050505050565b612145612f97565b61214d612f97565b6121556125e4565b8310806121695750612165612b9d565b8310155b1561217757809150506121a2565b61218083612b72565b905080604001511561219557809150506121a2565b61219e83612cf6565b9150505b919050565b6121af6124ff565b6121b881612aae565b600a601a6101000a81548161ffff021916908361ffff16021790555050565b60606122ab600980546121e990613cb7565b80601f016020809104026020016040519081016040528092919081815260200182805461221590613cb7565b80156122625780601f1061223757610100808354040283529160200191612262565b820191906000526020600020905b81548152906001019060200180831161224557829003601f168201915b50505050506040518060400160405280600481526020017f7b69647d000000000000000000000000000000000000000000000000000000008152506122a685612d16565b612d66565b9050919050565b6122ba6124ff565b80600a60156101000a81548160ff021916908360ff16021790555050565b600a60169054906101000a900461ffff1681565b600a601d9054906101000a900460ff1681565b6123076124ff565b6001600a601d6101000a81548160ff021916908315150217905550565b61232c6124ff565b60001515600a601f9054906101000a900460ff16151514612382576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237990613c68565b60405180910390fd5b818160099182612393929190614331565b505050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b66038d7ea4c6800081565b61243f6124ff565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036124ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124a590614473565b60405180910390fd5b6124b7816129e8565b50565b60006124d5600a60189054906101000a900461ffff1661280d565b905090565b6124e26124ff565b6001600a601e6101000a81548160ff021916908315150217905550565b612507612ec0565b73ffffffffffffffffffffffffffffffffffffffff166125256118f9565b73ffffffffffffffffffffffffffffffffffffffff161461257b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612572906144df565b60405180910390fd5b565b6000816125886125e4565b11158015612597575060005482105b80156125d5575060007c0100000000000000000000000000000000000000000000000000000000600460008581526020019081526020016000205416145b9050919050565b600033905090565b60006001905090565b600080829050806125fc6125e4565b11612682576000548110156126815760006004600083815260200190815260200160002054905060007c010000000000000000000000000000000000000000000000000000000082160361267f575b6000810361267557600460008360019003935083815260200190815260200160002054905061264b565b80925050506126b4565b505b5b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b60008060006006600085815260200190815260200160002090508092508254915050915091565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e8612741868684612ec8565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b60008060008084865af161279f5763b12d13eb6000526004601cfd5b5050565b60006127ad6125e4565b60005403905090565b600067ffffffffffffffff6040600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054901c169050919050565b600066038d7ea4c680008261ffff166128269190614138565b9050919050565b6000805490506000820361286d576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61287a6000848385612724565b600160406001901b178202600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506128f1836128e2600086600061272a565b6128eb85612ed1565b17612752565b6004600083815260200190815260200160002081905550600080838301905073ffffffffffffffffffffffffffffffffffffffff85169150828260007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600183015b81811461299257808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600181019050612957565b50600082036129cd576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060008190555050506129e3600084838561277d565b505050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008066038d7ea4c680008381612ac857612ac76144ff565b5b0614612b09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b00906145a0565b60405180910390fd5b61ffff801666038d7ea4c680008381612b2557612b246144ff565b5b049250821115612b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b619061460c565b60405180910390fd5b819050919050565b612b7a612f97565b612b966004600084815260200190815260200160002054612ee1565b9050919050565b60008054905090565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612bcc6125dc565b8786866040518563ffffffff1660e01b8152600401612bee9493929190614681565b6020604051808303816000875af1925050508015612c2a57506040513d601f19601f82011682018060405250810190612c2791906146e2565b60015b612ca3573d8060008114612c5a576040519150601f19603f3d011682016040523d82523d6000602084013e612c5f565b606091505b506000815103612c9b576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b612cfe612f97565b612d0f612d0a836125ed565b612ee1565b9050919050565b606060a060405101806040526020810391506000825281835b600115612d5157600184039350600a81066030018453600a8104905080612d2f575b50828103602084039350808452505050919050565b60608351835183516020870196506020860195506020850194506020604051019350828701838311612e6657600183820301600060208510612da85784892090505b601f851660200360031b89515b600115612e61578b51818118831c612e3e578315612df95783888e2014612df857808a5260018a01995060018d019c50848d10612df25750612e61565b50612e5c565b5b60005b600115612e1957808c0151818c0152602081019050878110612dfc575b50868a019950878d019c508715612e3d57848d10612e375750612e61565b50612e5c565b5b808a5260018a01995060018d019c50848d10612e5a5750612e61565b505b612db5565b505050505b846020604051019550888203868203015b828a1015612e94578951825260208201915060208a019950612e77565b60208703965080602088010160008152601f19601f820116604052818852505050505050509392505050565b600033905090565b60009392505050565b60006001821460e11b9050919050565b612ee9612f97565b81816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060a082901c816020019067ffffffffffffffff16908167ffffffffffffffff168152505060007c01000000000000000000000000000000000000000000000000000000008316141581604001901515908115158152505060e882901c816060019062ffffff16908162ffffff1681525050919050565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff168152602001600015158152602001600062ffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61302f81612ffa565b811461303a57600080fd5b50565b60008135905061304c81613026565b92915050565b60006020828403121561306857613067612ff0565b5b60006130768482850161303d565b91505092915050565b60008115159050919050565b6130948161307f565b82525050565b60006020820190506130af600083018461308b565b92915050565b600061ffff82169050919050565b6130cc816130b5565b81146130d757600080fd5b50565b6000813590506130e9816130c3565b92915050565b60006020828403121561310557613104612ff0565b5b6000613113848285016130da565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561315657808201518184015260208101905061313b565b60008484015250505050565b6000601f19601f8301169050919050565b600061317e8261311c565b6131888185613127565b9350613198818560208601613138565b6131a181613162565b840191505092915050565b600060208201905081810360008301526131c68184613173565b905092915050565b6000819050919050565b6131e1816131ce565b81146131ec57600080fd5b50565b6000813590506131fe816131d8565b92915050565b60006020828403121561321a57613219612ff0565b5b6000613228848285016131ef565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061325c82613231565b9050919050565b61326c81613251565b82525050565b60006020820190506132876000830184613263565b92915050565b61329681613251565b81146132a157600080fd5b50565b6000813590506132b38161328d565b92915050565b600080604083850312156132d0576132cf612ff0565b5b60006132de858286016132a4565b92505060206132ef858286016131ef565b9150509250929050565b6133028161307f565b811461330d57600080fd5b50565b60008135905061331f816132f9565b92915050565b60006020828403121561333b5761333a612ff0565b5b600061334984828501613310565b91505092915050565b61335b816131ce565b82525050565b60006020820190506133766000830184613352565b92915050565b60008060006060848603121561339557613394612ff0565b5b60006133a3868287016132a4565b93505060206133b4868287016132a4565b92505060406133c5868287016131ef565b9150509250925092565b600060ff82169050919050565b6133e5816133cf565b82525050565b600060208201905061340060008301846133dc565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261342b5761342a613406565b5b8235905067ffffffffffffffff8111156134485761344761340b565b5b60208301915083602082028301111561346457613463613410565b5b9250929050565b6000806020838503121561348257613481612ff0565b5b600083013567ffffffffffffffff8111156134a05761349f612ff5565b5b6134ac85828601613415565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6134ed81613251565b82525050565b600067ffffffffffffffff82169050919050565b613510816134f3565b82525050565b61351f8161307f565b82525050565b600062ffffff82169050919050565b61353d81613525565b82525050565b60808201600082015161355960008501826134e4565b50602082015161356c6020850182613507565b50604082015161357f6040850182613516565b5060608201516135926060850182613534565b50505050565b60006135a48383613543565b60808301905092915050565b6000602082019050919050565b60006135c8826134b8565b6135d281856134c3565b93506135dd836134d4565b8060005b8381101561360e5781516135f58882613598565b9750613600836135b0565b9250506001810190506135e1565b5085935050505092915050565b6000602082019050818103600083015261363581846135bd565b905092915050565b60006020828403121561365357613652612ff0565b5b6000613661848285016132a4565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61369f816131ce565b82525050565b60006136b18383613696565b60208301905092915050565b6000602082019050919050565b60006136d58261366a565b6136df8185613675565b93506136ea83613686565b8060005b8381101561371b57815161370288826136a5565b975061370d836136bd565b9250506001810190506136ee565b5085935050505092915050565b6000602082019050818103600083015261374281846136ca565b905092915050565b60008060006060848603121561376357613762612ff0565b5b6000613771868287016132a4565b9350506020613782868287016131ef565b9250506040613793868287016131ef565b9150509250925092565b600080604083850312156137b4576137b3612ff0565b5b60006137c2858286016132a4565b92505060206137d385828601613310565b9150509250929050565b6137e6816133cf565b81146137f157600080fd5b50565b600081359050613803816137dd565b92915050565b60006020828403121561381f5761381e612ff0565b5b600061382d848285016137f4565b91505092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61387382613162565b810181811067ffffffffffffffff821117156138925761389161383b565b5b80604052505050565b60006138a5612fe6565b90506138b1828261386a565b919050565b600067ffffffffffffffff8211156138d1576138d061383b565b5b6138da82613162565b9050602081019050919050565b82818337600083830152505050565b6000613909613904846138b6565b61389b565b90508281526020810184848401111561392557613924613836565b5b6139308482856138e7565b509392505050565b600082601f83011261394d5761394c613406565b5b813561395d8482602086016138f6565b91505092915050565b600080600080608085870312156139805761397f612ff0565b5b600061398e878288016132a4565b945050602061399f878288016132a4565b93505060406139b0878288016131ef565b925050606085013567ffffffffffffffff8111156139d1576139d0612ff5565b5b6139dd87828801613938565b91505092959194509250565b60008083601f8401126139ff576139fe613406565b5b8235905067ffffffffffffffff811115613a1c57613a1b61340b565b5b602083019150836020820283011115613a3857613a37613410565b5b9250929050565b600080600060408486031215613a5857613a57612ff0565b5b600084013567ffffffffffffffff811115613a7657613a75612ff5565b5b613a82868287016139e9565b93509350506020613a95868287016131ef565b9150509250925092565b608082016000820151613ab560008501826134e4565b506020820151613ac86020850182613507565b506040820151613adb6040850182613516565b506060820151613aee6060850182613534565b50505050565b6000608082019050613b096000830184613a9f565b92915050565b613b18816130b5565b82525050565b6000602082019050613b336000830184613b0f565b92915050565b60008083601f840112613b4f57613b4e613406565b5b8235905067ffffffffffffffff811115613b6c57613b6b61340b565b5b602083019150836001820283011115613b8857613b87613410565b5b9250929050565b60008060208385031215613ba657613ba5612ff0565b5b600083013567ffffffffffffffff811115613bc457613bc3612ff5565b5b613bd085828601613b39565b92509250509250929050565b60008060408385031215613bf357613bf2612ff0565b5b6000613c01858286016132a4565b9250506020613c12858286016132a4565b9150509250929050565b7f4c6f636b65642e00000000000000000000000000000000000000000000000000600082015250565b6000613c52600783613127565b9150613c5d82613c1c565b602082019050919050565b60006020820190508181036000830152613c8181613c45565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680613ccf57607f821691505b602082108103613ce257613ce1613c88565b5b50919050565b7f4d617820737570706c79206e6f74207365742e00000000000000000000000000600082015250565b6000613d1e601383613127565b9150613d2982613ce8565b602082019050919050565b60006020820190508181036000830152613d4d81613d11565b9050919050565b7f5369676e6572206e6f74207365742e0000000000000000000000000000000000600082015250565b6000613d8a600f83613127565b9150613d9582613d54565b602082019050919050565b60006020820190508181036000830152613db981613d7d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f5061757365642e00000000000000000000000000000000000000000000000000600082015250565b6000613e25600783613127565b9150613e3082613def565b602082019050919050565b60006020820190508181036000830152613e5481613e18565b9050919050565b7f4f7574206f662073746f636b2100000000000000000000000000000000000000600082015250565b6000613e91600d83613127565b9150613e9c82613e5b565b602082019050919050565b60006020820190508181036000830152613ec081613e84565b9050919050565b7f4d617820706572207472616e73616374696f6e20726561636865642e00000000600082015250565b6000613efd601c83613127565b9150613f0882613ec7565b602082019050919050565b60006020820190508181036000830152613f2c81613ef0565b9050919050565b7f4d6178206e756d626572206d696e74656420726561636865642e000000000000600082015250565b6000613f69601a83613127565b9150613f7482613f33565b602082019050919050565b60006020820190508181036000830152613f9881613f5c565b9050919050565b7f5175616e7469747920746f6f20686967682e0000000000000000000000000000600082015250565b6000613fd5601283613127565b9150613fe082613f9f565b602082019050919050565b6000602082019050818103600083015261400481613fc8565b9050919050565b7f57726f6e672045746865722076616c75652e0000000000000000000000000000600082015250565b6000614041601283613127565b915061404c8261400b565b602082019050919050565b6000602082019050818103600083015261407081614034565b9050919050565b7f5369676e6572206d757374206e6f7420626520746865207a65726f206164647260008201527f6573732e00000000000000000000000000000000000000000000000000000000602082015250565b60006140d3602483613127565b91506140de82614077565b604082019050919050565b60006020820190508181036000830152614102816140c6565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614143826131ce565b915061414e836131ce565b925082820261415c816131ce565b9150828204841483151761417357614172614109565b5b5092915050565b600082905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026141e77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826141aa565b6141f186836141aa565b95508019841693508086168417925050509392505050565b6000819050919050565b600061422e614229614224846131ce565b614209565b6131ce565b9050919050565b6000819050919050565b61424883614213565b61425c61425482614235565b8484546141b7565b825550505050565b600090565b614271614264565b61427c81848461423f565b505050565b5b818110156142a057614295600082614269565b600181019050614282565b5050565b601f8211156142e5576142b681614185565b6142bf8461419a565b810160208510156142ce578190505b6142e26142da8561419a565b830182614281565b50505b505050565b600082821c905092915050565b6000614308600019846008026142ea565b1980831691505092915050565b600061432183836142f7565b9150826002028217905092915050565b61433b838361417a565b67ffffffffffffffff8111156143545761435361383b565b5b61435e8254613cb7565b6143698282856142a4565b6000601f8311600181146143985760008415614386578287013590505b6143908582614315565b8655506143f8565b601f1984166143a686614185565b60005b828110156143ce578489013582556001820191506020850194506020810190506143a9565b868310156143eb57848901356143e7601f8916826142f7565b8355505b6001600288020188555050505b50505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061445d602683613127565b915061446882614401565b604082019050919050565b6000602082019050818103600083015261448c81614450565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006144c9602083613127565b91506144d482614493565b602082019050919050565b600060208201905081810360008301526144f8816144bc565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f5072696365206d7573742062652061206d756c7469706c65206f66205052494360008201527f455f554e49542e00000000000000000000000000000000000000000000000000602082015250565b600061458a602783613127565b91506145958261452e565b604082019050919050565b600060208201905081810360008301526145b98161457d565b9050919050565b7f4f766572666c6f772e0000000000000000000000000000000000000000000000600082015250565b60006145f6600983613127565b9150614601826145c0565b602082019050919050565b60006020820190508181036000830152614625816145e9565b9050919050565b600081519050919050565b600082825260208201905092915050565b60006146538261462c565b61465d8185614637565b935061466d818560208601613138565b61467681613162565b840191505092915050565b60006080820190506146966000830187613263565b6146a36020830186613263565b6146b06040830185613352565b81810360608301526146c28184614648565b905095945050505050565b6000815190506146dc81613026565b92915050565b6000602082840312156146f8576146f7612ff0565b5b6000614706848285016146cd565b9150509291505056fea26469706673582212206d1742a73f9f5bfbbc9eb9f121024e34badda548823bd4254ec9ed2445b2f89464736f6c63430008110033
Loading...
Loading
Loading...
Loading
OVERVIEW
Our collection called the Portraits of the Aniverse is characterized by having special creatures within this verse called POTAs.This is our genesis collection which's gonna serve as a Gateway for everything relating the mighty POTAs universe.Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.