Source Code
Overview
ETH Balance
0.0138 ETH
Token Holdings
More Info
ContractCreator
TokenTracker
Multichain Info
N/A
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0 ETH | ||||
4505144 | 25 hrs ago | 0.0138 ETH | ||||
4489727 | 30 hrs ago | 0 ETH | ||||
4489727 | 30 hrs ago | 0 ETH | ||||
4489727 | 30 hrs ago | 0 ETH | ||||
4489727 | 30 hrs ago | 0 ETH | ||||
4489727 | 30 hrs ago | 0 ETH | ||||
4489727 | 30 hrs ago | 0 ETH | ||||
4489727 | 30 hrs ago | 0 ETH | ||||
4489727 | 30 hrs ago | 0 ETH | ||||
4489727 | 30 hrs ago | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
Boogers
Compiler Version
v0.8.24+commit.e11b9ed9
ZkSolc Version
v1.5.7
Optimization Enabled:
Yes with Mode 3
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "erc721a/contracts/ERC721A.sol"; import "erc721a/contracts/interfaces/IERC721ABurnable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "erc721a/contracts/extensions/ERC721AQueryable.sol"; contract Boogers is Ownable, ERC721A, ERC721AQueryable, IERC721ABurnable, ReentrancyGuard { using Strings for uint256; address private _owner; uint256 private _currentIndex = 1; string public _name; string private _symbol; uint256 public cost = 0.0069 ether; string public baseURI = "https://www.WEBSITE.xyz/api/tokens/"; uint256 public _maxSupply = 999; bool public isSaleActive = true; constructor() payable ERC721A("Boogers", "BOOG") Ownable(msg.sender) { _owner = msg.sender; _currentIndex = _startTokenId(); } /*---------- ----------- ---------- Public Functions ---------- ----------- ----------*/ /** @notice Mint Function */ function _mint(uint256 count) external payable nonReentrant { require(isSaleActive, "Sale is not active"); uint256 userBalance = balanceOf(msg.sender); require(totalSupply() + count <= _maxSupply, "Maximum supply reached"); if (msg.sender == _owner) { _safeMint(msg.sender, count); } else if (userBalance < 1) { // Allow the user to mint one NFT for free require(msg.value >= (cost * count) - cost, "Insufficient Payment"); for (uint256 i = 0; i < count; i++) { _safeMint(msg.sender, 1); } } else if (userBalance > 0) { require(msg.value >= cost * count, "Insufficient Payment"); for (uint256 i = 0; i < count; i++) { _safeMint(msg.sender, 1); } } } function tokenURI( uint256 tokenId ) public view virtual override(ERC721A, IERC721A) returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); return string(abi.encodePacked(baseURI,tokenId.toString())); } function owner() public view virtual override returns (address) { return _owner; } /*---------- ----------- ---------- Deployer Functions ---------- ----------- ----------*/ function _teamMint() external onlyOwner { _safeMint(msg.sender, 1); } function _startTokenId() internal view virtual override returns (uint256) { return 1; } function tokensOfOwner( address user ) external view virtual override returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(user); 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 == user) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } function _flipSale() external onlyOwner { isSaleActive = !isSaleActive; } function setSupply(uint256 supply_) public onlyOwner { _maxSupply = supply_; } function setCost(uint256 cost_) public onlyOwner { cost = cost_; } function setBaseURI(string memory uri) public onlyOwner { baseURI = uri; } function burn(uint256 tokenId) external virtual override onlyOwner { _burn(tokenId, true); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // 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()`. * * The `_sequentialUpTo()` function can be overriden to enable spot mints * (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`. * * 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; // The amount of tokens minted above `_sequentialUpTo()`. // We call these spot mints (i.e. non-sequential mints). uint256 private _spotMinted; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID for sequential mints. * * Override this function to change the starting token ID for sequential mints. * * Note: The value returned must never change after any tokens have been minted. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the maximum token ID (inclusive) for sequential mints. * * Override this function to return a value less than 2**256 - 1, * but greater than `_startTokenId()`, to enable spot (non-sequential) mints. * * Note: The value returned must never change after any tokens have been minted. */ function _sequentialUpTo() internal view virtual returns (uint256) { return type(uint256).max; } /** * @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 result) { // Counter underflow is impossible as `_burnCounter` cannot be incremented // more than `_currentIndex + _spotMinted - _startTokenId()` times. unchecked { // With spot minting, the intermediate `result` can be temporarily negative, // and the computation must be unchecked. result = _currentIndex - _burnCounter - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += _spotMinted; } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256 result) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { result = _currentIndex - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += _spotMinted; } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } /** * @dev Returns the total number of tokens that are spot-minted. */ function _totalSpotMinted() internal view virtual returns (uint256) { return _spotMinted; } // ============================================================= // 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.selector); 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.selector); 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 Returns whether the ownership slot at `index` is initialized. * An uninitialized slot does not necessarily mean that the slot has no owner. */ function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) { return _packedOwnerships[index] != 0; } /** * @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); } } /** * @dev Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) { if (_startTokenId() <= tokenId) { packed = _packedOwnerships[tokenId]; if (tokenId > _sequentialUpTo()) { if (_packedOwnershipExists(packed)) return packed; _revert(OwnerQueryForNonexistentToken.selector); } // If the data at the starting slot does not exist, start the scan. if (packed == 0) { if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector); // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `tokenId` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. for (;;) { unchecked { packed = _packedOwnerships[--tokenId]; } if (packed == 0) continue; if (packed & _BITMASK_BURNED == 0) return packed; // Otherwise, the token is burned, and we must revert. // This handles the case of batch burned tokens, where only the burned bit // of the starting slot is set, and remaining slots are left uninitialized. _revert(OwnerQueryForNonexistentToken.selector); } } // Otherwise, the data exists and we can skip the scan. // This is possible because we have already achieved the target condition. // This saves 2143 gas on transfers of initialized tokens. // If the token is not burned, return `packed`. Otherwise, revert. if (packed & _BITMASK_BURNED == 0) return packed; } _revert(OwnerQueryForNonexistentToken.selector); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}. * * Requirements: * * - The caller must own the token or be an approved operator. */ function approve(address to, uint256 tokenId) public payable virtual override { _approve(to, tokenId, true); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector); 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 result) { if (_startTokenId() <= tokenId) { if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]); if (tokenId < _currentIndex) { uint256 packed; while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId; result = packed & _BITMASK_BURNED == 0; } } } /** * @dev Returns whether `packed` represents a token that exists. */ function _packedOwnershipExists(uint256 packed) private pure returns (bool result) { assembly { // The following is equivalent to `owner != address(0) && burned == false`. // Symbolically tested. result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_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); // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean. from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS)); if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector); (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.selector); _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; } } } } // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; assembly { // 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. from, // `from`. toMasked, // `to`. tokenId // `tokenId`. ) } if (toMasked == 0) _revert(TransferToZeroAddress.selector); _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.selector); } } /** * @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.selector); } 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.selector); _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: // - `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) ); // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); uint256 end = startTokenId + quantity; uint256 tokenId = startTokenId; if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); do { assembly { // 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`. tokenId // `tokenId`. ) } // The `!=` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. } while (++tokenId != end); _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.selector); if (quantity == 0) _revert(MintZeroQuantity.selector); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector); _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) ); if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); 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.selector); } } while (index < end); // This prevents reentrancy to `_safeMint`. // It does not prevent reentrancy to `_safeMintSpot`. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } /** * @dev Mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * Emits a {Transfer} event for each mint. */ function _mintSpot(address to, uint256 tokenId) internal virtual { if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector); uint256 prevOwnershipPacked = _packedOwnerships[tokenId]; if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector); _beforeTokenTransfers(address(0), to, tokenId, 1); // Overflows are incredibly unrealistic. // The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1. // `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1. unchecked { // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `true` (as `quantity == 1`). _packedOwnerships[tokenId] = _packOwnershipData( to, _nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked) ); // Updates: // - `balance += 1`. // - `numberMinted += 1`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1; // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); assembly { // 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`. tokenId // `tokenId`. ) } ++_spotMinted; } _afterTokenTransfers(address(0), to, tokenId, 1); } /** * @dev Safely mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * See {_mintSpot}. * * Emits a {Transfer} event. */ function _safeMintSpot( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mintSpot(to, tokenId); unchecked { if (to.code.length != 0) { uint256 currentSpotMinted = _spotMinted; if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } // This prevents reentrancy to `_safeMintSpot`. // It does not prevent reentrancy to `_safeMint`. if (_spotMinted != currentSpotMinted) revert(); } } } /** * @dev Equivalent to `_safeMintSpot(to, tokenId, '')`. */ function _safeMintSpot(address to, uint256 tokenId) internal virtual { _safeMintSpot(to, tokenId, ''); } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Equivalent to `_approve(to, tokenId, false)`. */ function _approve(address to, uint256 tokenId) internal virtual { _approve(to, tokenId, false); } /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - `tokenId` must exist. * * Emits an {Approval} event. */ function _approve( address to, uint256 tokenId, bool approvalCheck ) internal virtual { address owner = ownerOf(tokenId); if (approvalCheck && _msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { _revert(ApprovalCallerNotOwnerNorApproved.selector); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector); } _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 + _spotMinted` 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.selector); 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) } } /** * @dev For more efficient reverts. */ function _revert(bytes4 errorSelector) internal pure { assembly { mstore(0x00, errorSelector) revert(0x00, 0x04) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // 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 ownership) { unchecked { if (tokenId >= _startTokenId()) { if (tokenId > _sequentialUpTo()) return _ownershipAt(tokenId); if (tokenId < _nextTokenId()) { // If the `tokenId` is within bounds, // scan backwards for the initialized ownership slot. while (!_ownershipIsInitialized(tokenId)) --tokenId; return _ownershipAt(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) { TokenOwnership[] memory ownerships; uint256 i = tokenIds.length; assembly { // Grab the free memory pointer. ownerships := mload(0x40) // Store the length. mstore(ownerships, i) // Allocate one word for the length, // `tokenIds.length` words for the pointers. i := shl(5, i) // Multiply `i` by 32. mstore(0x40, add(add(ownerships, 0x20), i)) } while (i != 0) { uint256 tokenId; assembly { i := sub(i, 0x20) tokenId := calldataload(add(tokenIds.offset, i)) } TokenOwnership memory ownership = explicitOwnershipOf(tokenId); assembly { // Store the pointer of `ownership` in the `ownerships` array. mstore(add(add(ownerships, 0x20), i), ownership) } } 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) { return _tokensOfOwnerIn(owner, start, stop); } /** * @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) { // If spot mints are enabled, full-range scan is disabled. if (_sequentialUpTo() != type(uint256).max) _revert(NotCompatibleWithSpotMints.selector); uint256 start = _startTokenId(); uint256 stop = _nextTokenId(); uint256[] memory tokenIds; if (start != stop) tokenIds = _tokensOfOwnerIn(owner, start, stop); return tokenIds; } /** * @dev Helper function for returning an array of token IDs owned by `owner`. * * Note that this function is optimized for smaller bytecode size over runtime gas, * since it is meant to be called off-chain. */ function _tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) private view returns (uint256[] memory tokenIds) { unchecked { if (start >= stop) _revert(InvalidQueryRange.selector); // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) start = _startTokenId(); uint256 nextTokenId = _nextTokenId(); // If spot mints are enabled, scan all the way until the specified `stop`. uint256 stopLimit = _sequentialUpTo() != type(uint256).max ? stop : nextTokenId; // Set `stop = min(stop, stopLimit)`. if (stop >= stopLimit) stop = stopLimit; // Number of tokens to scan. uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength` to zero if the range contains no tokens. if (start >= stop) tokenIdsMaxLength = 0; // If there are one or more tokens to scan. if (tokenIdsMaxLength != 0) { // Set `tokenIdsMaxLength = min(balanceOf(owner), tokenIdsMaxLength)`. if (stop - start <= tokenIdsMaxLength) tokenIdsMaxLength = stop - start; uint256 m; // Start of available memory. assembly { // Grab the free memory pointer. tokenIds := mload(0x40) // Allocate one word for the length, and `tokenIdsMaxLength` words // for the data. `shl(5, x)` is equivalent to `mul(32, x)`. m := add(tokenIds, shl(5, add(tokenIdsMaxLength, 1))) mstore(0x40, m) } // 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; uint256 tokenIdsIdx; // Use a do-while, which is slightly more efficient for this case, // as the array will at least contain one element. do { if (_sequentialUpTo() != type(uint256).max) { // Skip the remaining unused sequential slots. if (start == nextTokenId) start = _sequentialUpTo() + 1; // Reset `currOwnershipAddr`, as each spot-minted token is a batch of one. if (start > _sequentialUpTo()) currOwnershipAddr = address(0); } ownership = _ownershipAt(start); // This implicitly allocates memory. assembly { switch mload(add(ownership, 0x40)) // if `ownership.burned == false`. case 0 { // if `ownership.addr != address(0)`. // The `addr` already has it's upper 96 bits clearned, // since it is written to memory with regular Solidity. if mload(ownership) { currOwnershipAddr := mload(ownership) } // if `currOwnershipAddr == owner`. // The `shl(96, x)` is to make the comparison agnostic to any // dirty upper 96 bits in `owner`. if iszero(shl(96, xor(currOwnershipAddr, owner))) { tokenIdsIdx := add(tokenIdsIdx, 1) mstore(add(tokenIds, shl(5, tokenIdsIdx)), start) } } // Otherwise, reset `currOwnershipAddr`. // This handles the case of batch burned tokens // (burned bit of first slot set, remaining slots left uninitialized). default { currOwnershipAddr := 0 } start := add(start, 1) // Free temporary memory implicitly allocated for ownership // to avoid quadratic memory expansion costs. mstore(0x40, m) } } while (!(start == stop || tokenIdsIdx == tokenIdsMaxLength)); // Store the length of the array. assembly { mstore(tokenIds, tokenIdsIdx) } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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 { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at, * consider using {ReentrancyGuardTransient} instead. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.2.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SafeCast} from "./math/SafeCast.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { using SafeCast for *; bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev The string being parsed contains characters that are not in scope of the given base. */ error StringsInvalidChar(); /** * @dev The string being parsed is not a properly formatted address. */ error StringsInvalidAddressFormat(); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; assembly ("memory-safe") { ptr := add(buffer, add(32, length)) } while (true) { ptr--; assembly ("memory-safe") { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal * representation, according to EIP-55. */ function toChecksumHexString(address addr) internal pure returns (string memory) { bytes memory buffer = bytes(toHexString(addr)); // hash the hex part of buffer (skip length + 2 bytes, length 40) uint256 hashValue; assembly ("memory-safe") { hashValue := shr(96, keccak256(add(buffer, 0x22), 40)) } for (uint256 i = 41; i > 1; --i) { // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f) if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) { // case shift by xoring with 0x20 buffer[i] ^= 0x20; } hashValue >>= 4; } return string(buffer); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } /** * @dev Parse a decimal string and returns the value as a `uint256`. * * Requirements: * - The string must be formatted as `[0-9]*` * - The result must fit into an `uint256` type */ function parseUint(string memory input) internal pure returns (uint256) { return parseUint(input, 0, bytes(input).length); } /** * @dev Variant of {parseUint} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `[0-9]*` * - The result must fit into an `uint256` type */ function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) { (bool success, uint256 value) = tryParseUint(input, begin, end); if (!success) revert StringsInvalidChar(); return value; } /** * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) { return _tryParseUintUncheckedBounds(input, 0, bytes(input).length); } /** * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid * character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseUint( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, uint256 value) { if (end > bytes(input).length || begin > end) return (false, 0); return _tryParseUintUncheckedBounds(input, begin, end); } /** * @dev Implementation of {tryParseUint} that does not check bounds. Caller should make sure that * `begin <= end <= input.length`. Other inputs would result in undefined behavior. */ function _tryParseUintUncheckedBounds( string memory input, uint256 begin, uint256 end ) private pure returns (bool success, uint256 value) { bytes memory buffer = bytes(input); uint256 result = 0; for (uint256 i = begin; i < end; ++i) { uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i))); if (chr > 9) return (false, 0); result *= 10; result += chr; } return (true, result); } /** * @dev Parse a decimal string and returns the value as a `int256`. * * Requirements: * - The string must be formatted as `[-+]?[0-9]*` * - The result must fit in an `int256` type. */ function parseInt(string memory input) internal pure returns (int256) { return parseInt(input, 0, bytes(input).length); } /** * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `[-+]?[0-9]*` * - The result must fit in an `int256` type. */ function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) { (bool success, int256 value) = tryParseInt(input, begin, end); if (!success) revert StringsInvalidChar(); return value; } /** * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if * the result does not fit in a `int256`. * * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`. */ function tryParseInt(string memory input) internal pure returns (bool success, int256 value) { return _tryParseIntUncheckedBounds(input, 0, bytes(input).length); } uint256 private constant ABS_MIN_INT256 = 2 ** 255; /** * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid * character or if the result does not fit in a `int256`. * * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`. */ function tryParseInt( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, int256 value) { if (end > bytes(input).length || begin > end) return (false, 0); return _tryParseIntUncheckedBounds(input, begin, end); } /** * @dev Implementation of {tryParseInt} that does not check bounds. Caller should make sure that * `begin <= end <= input.length`. Other inputs would result in undefined behavior. */ function _tryParseIntUncheckedBounds( string memory input, uint256 begin, uint256 end ) private pure returns (bool success, int256 value) { bytes memory buffer = bytes(input); // Check presence of a negative sign. bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty bool positiveSign = sign == bytes1("+"); bool negativeSign = sign == bytes1("-"); uint256 offset = (positiveSign || negativeSign).toUint(); (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end); if (absSuccess && absValue < ABS_MIN_INT256) { return (true, negativeSign ? -int256(absValue) : int256(absValue)); } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) { return (true, type(int256).min); } else return (false, 0); } /** * @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as a `uint256`. * * Requirements: * - The string must be formatted as `(0x)?[0-9a-fA-F]*` * - The result must fit in an `uint256` type. */ function parseHexUint(string memory input) internal pure returns (uint256) { return parseHexUint(input, 0, bytes(input).length); } /** * @dev Variant of {parseHexUint} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `(0x)?[0-9a-fA-F]*` * - The result must fit in an `uint256` type. */ function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) { (bool success, uint256 value) = tryParseHexUint(input, begin, end); if (!success) revert StringsInvalidChar(); return value; } /** * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) { return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length); } /** * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an * invalid character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseHexUint( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, uint256 value) { if (end > bytes(input).length || begin > end) return (false, 0); return _tryParseHexUintUncheckedBounds(input, begin, end); } /** * @dev Implementation of {tryParseHexUint} that does not check bounds. Caller should make sure that * `begin <= end <= input.length`. Other inputs would result in undefined behavior. */ function _tryParseHexUintUncheckedBounds( string memory input, uint256 begin, uint256 end ) private pure returns (bool success, uint256 value) { bytes memory buffer = bytes(input); // skip 0x prefix if present bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty uint256 offset = hasPrefix.toUint() * 2; uint256 result = 0; for (uint256 i = begin + offset; i < end; ++i) { uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i))); if (chr > 15) return (false, 0); result *= 16; unchecked { // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check). // This guaratees that adding a value < 16 will not cause an overflow, hence the unchecked. result += chr; } } return (true, result); } /** * @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as an `address`. * * Requirements: * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}` */ function parseAddress(string memory input) internal pure returns (address) { return parseAddress(input, 0, bytes(input).length); } /** * @dev Variant of {parseAddress} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}` */ function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) { (bool success, address value) = tryParseAddress(input, begin, end); if (!success) revert StringsInvalidAddressFormat(); return value; } /** * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly * formatted address. See {parseAddress} requirements. */ function tryParseAddress(string memory input) internal pure returns (bool success, address value) { return tryParseAddress(input, 0, bytes(input).length); } /** * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly * formatted address. See {parseAddress} requirements. */ function tryParseAddress( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, address value) { if (end > bytes(input).length || begin > end) return (false, address(0)); bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty uint256 expectedLength = 40 + hasPrefix.toUint() * 2; // check that input is the correct length if (end - begin == expectedLength) { // length guarantees that this does not overflow, and value is at most type(uint160).max (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end); return (s, address(uint160(v))); } else { return (false, address(0)); } } function _tryParseChr(bytes1 chr) private pure returns (uint8) { uint8 value = uint8(chr); // Try to parse `chr`: // - Case 1: [0-9] // - Case 2: [a-f] // - Case 3: [A-F] // - otherwise not supported unchecked { if (value > 47 && value < 58) value -= 48; else if (value > 96 && value < 103) value -= 87; else if (value > 64 && value < 71) value -= 55; else return type(uint8).max; } return value; } /** * @dev Reads a bytes32 from a bytes array without bounds checking. * * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the * assembly block as such would prevent some optimizations. */ function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) { // This is not memory safe in the general case, but all calls to this private function are within bounds. assembly ("memory-safe") { value := mload(add(buffer, add(0x20, offset))) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../extensions/IERC721ABurnable.sol';
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // 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(); /** * `_sequentialUpTo()` must be greater than `_startTokenId()`. */ error SequentialUpToTooSmall(); /** * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`. */ error SequentialMintExceedsLimit(); /** * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`. */ error SpotMintTokenIdTooSmall(); /** * Cannot mint over a token that already exists. */ error TokenAlreadyExists(); /** * The feature is not compatible with spot mints. */ error NotCompatibleWithSpotMints(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // 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.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../IERC721A.sol'; /** * @dev Interface of ERC721ABurnable. */ interface IERC721ABurnable is IERC721A { /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; import {SafeCast} from "./SafeCast.sol"; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant. * * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone. * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute * one branch when needed, making this function more expensive. */ function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) { unchecked { // branchless ternary works because: // b ^ (a ^ b) == a // b ^ 0 == b return b ^ ((a ^ b) * int256(SafeCast.toUint(condition))); } } /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return ternary(a > b, a, b); } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return ternary(a < b, a, b); } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson. // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift, // taking advantage of the most significant (or "sign" bit) in two's complement representation. // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result, // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative). int256 mask = n >> 255; // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it. return uint256((n + mask) ^ mask); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol) pragma solidity ^0.8.20; import {Panic} from "../Panic.sol"; import {SafeCast} from "./SafeCast.sol"; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an success flag (no overflow). */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow). */ function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow). */ function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a success flag (no division by zero). */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero). */ function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant. * * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone. * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute * one branch when needed, making this function more expensive. */ function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) { unchecked { // branchless ternary works because: // b ^ (a ^ b) == a // b ^ 0 == b return b ^ ((a ^ b) * SafeCast.toUint(condition)); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(a > b, a, b); } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(a < b, a, b); } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. Panic.panic(Panic.DIVISION_BY_ZERO); } // The following calculation ensures accurate ceiling division without overflow. // Since a is non-zero, (a - 1) / b will not overflow. // The largest possible result occurs when (a - 1) / b is type(uint256).max, // but the largest value we can obtain is type(uint256).max - 1, which happens // when a = type(uint256).max and b = 1. unchecked { return SafeCast.toUint(a > 0) * ((a - 1) / b + 1); } } /** * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2²⁵⁶ + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0. if (denominator <= prod1) { Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW)); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv ≡ 1 mod 2⁴. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2⁸ inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶ inverse *= 2 - denominator * inverse; // inverse mod 2³² inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴ inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸ inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶ // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @dev Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0); } /** * @dev Calculate the modular multiplicative inverse of a number in Z/nZ. * * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0. * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible. * * If the input value is not inversible, 0 is returned. * * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}. */ function invMod(uint256 a, uint256 n) internal pure returns (uint256) { unchecked { if (n == 0) return 0; // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version) // Used to compute integers x and y such that: ax + ny = gcd(a, n). // When the gcd is 1, then the inverse of a modulo n exists and it's x. // ax + ny = 1 // ax = 1 + (-y)n // ax ≡ 1 (mod n) # x is the inverse of a modulo n // If the remainder is 0 the gcd is n right away. uint256 remainder = a % n; uint256 gcd = n; // Therefore the initial coefficients are: // ax + ny = gcd(a, n) = n // 0a + 1n = n int256 x = 0; int256 y = 1; while (remainder != 0) { uint256 quotient = gcd / remainder; (gcd, remainder) = ( // The old remainder is the next gcd to try. remainder, // Compute the next remainder. // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd // where gcd is at most n (capped to type(uint256).max) gcd - remainder * quotient ); (x, y) = ( // Increment the coefficient of a. y, // Decrement the coefficient of n. // Can overflow, but the result is casted to uint256 so that the // next value of y is "wrapped around" to a value between 0 and n - 1. x - y * int256(quotient) ); } if (gcd != 1) return 0; // No inverse exists. return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative. } } /** * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`. * * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that * `a**(p-2)` is the modular multiplicative inverse of a in Fp. * * NOTE: this function does NOT check that `p` is a prime greater than `2`. */ function invModPrime(uint256 a, uint256 p) internal view returns (uint256) { unchecked { return Math.modExp(a, p - 2, p); } } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m) * * Requirements: * - modulus can't be zero * - underlying staticcall to precompile must succeed * * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make * sure the chain you're using it on supports the precompiled contract for modular exponentiation * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, * the underlying function will succeed given the lack of a revert, but the result may be incorrectly * interpreted as 0. */ function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) { (bool success, uint256 result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m). * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying * to operate modulo 0 or if the underlying precompile reverted. * * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack * of a revert, but the result may be incorrectly interpreted as 0. */ function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) { if (m == 0) return (false, 0); assembly ("memory-safe") { let ptr := mload(0x40) // | Offset | Content | Content (Hex) | // |-----------|------------|--------------------------------------------------------------------| // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x60:0x7f | value of b | 0x<.............................................................b> | // | 0x80:0x9f | value of e | 0x<.............................................................e> | // | 0xa0:0xbf | value of m | 0x<.............................................................m> | mstore(ptr, 0x20) mstore(add(ptr, 0x20), 0x20) mstore(add(ptr, 0x40), 0x20) mstore(add(ptr, 0x60), b) mstore(add(ptr, 0x80), e) mstore(add(ptr, 0xa0), m) // Given the result < m, it's guaranteed to fit in 32 bytes, // so we can use the memory scratch space located at offset 0. success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20) result := mload(0x00) } } /** * @dev Variant of {modExp} that supports inputs of arbitrary length. */ function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) { (bool success, bytes memory result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Variant of {tryModExp} that supports inputs of arbitrary length. */ function tryModExp( bytes memory b, bytes memory e, bytes memory m ) internal view returns (bool success, bytes memory result) { if (_zeroBytes(m)) return (false, new bytes(0)); uint256 mLen = m.length; // Encode call args in result and move the free memory pointer result = abi.encodePacked(b.length, e.length, mLen, b, e, m); assembly ("memory-safe") { let dataPtr := add(result, 0x20) // Write result on top of args to avoid allocating extra memory. success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen) // Overwrite the length. // result.length > returndatasize() is guaranteed because returndatasize() == m.length mstore(result, mLen) // Set the memory pointer after the returned data. mstore(0x40, add(dataPtr, mLen)) } } /** * @dev Returns whether the provided byte array is zero. */ function _zeroBytes(bytes memory byteArray) private pure returns (bool) { for (uint256 i = 0; i < byteArray.length; ++i) { if (byteArray[i] != 0) { return false; } } return true; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * This method is based on Newton's method for computing square roots; the algorithm is restricted to only * using integer operations. */ function sqrt(uint256 a) internal pure returns (uint256) { unchecked { // Take care of easy edge cases when a == 0 or a == 1 if (a <= 1) { return a; } // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between // the current value as `ε_n = | x_n - sqrt(a) |`. // // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is // bigger than any uint256. // // By noticing that // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)` // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar // to the msb function. uint256 aa = a; uint256 xn = 1; if (aa >= (1 << 128)) { aa >>= 128; xn <<= 64; } if (aa >= (1 << 64)) { aa >>= 64; xn <<= 32; } if (aa >= (1 << 32)) { aa >>= 32; xn <<= 16; } if (aa >= (1 << 16)) { aa >>= 16; xn <<= 8; } if (aa >= (1 << 8)) { aa >>= 8; xn <<= 4; } if (aa >= (1 << 4)) { aa >>= 4; xn <<= 2; } if (aa >= (1 << 2)) { xn <<= 1; } // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1). // // We can refine our estimation by noticing that the middle of that interval minimizes the error. // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2). // This is going to be our x_0 (and ε_0) xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2) // From here, Newton's method give us: // x_{n+1} = (x_n + a / x_n) / 2 // // One should note that: // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a // = ((x_n² + a) / (2 * x_n))² - a // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²) // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²) // = (x_n² - a)² / (2 * x_n)² // = ((x_n² - a) / (2 * x_n))² // ≥ 0 // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n // // This gives us the proof of quadratic convergence of the sequence: // ε_{n+1} = | x_{n+1} - sqrt(a) | // = | (x_n + a / x_n) / 2 - sqrt(a) | // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) | // = | (x_n - sqrt(a))² / (2 * x_n) | // = | ε_n² / (2 * x_n) | // = ε_n² / | (2 * x_n) | // // For the first iteration, we have a special case where x_0 is known: // ε_1 = ε_0² / | (2 * x_0) | // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2))) // ≤ 2**(2*e-4) / (3 * 2**(e-1)) // ≤ 2**(e-3) / 3 // ≤ 2**(e-3-log2(3)) // ≤ 2**(e-4.5) // // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n: // ε_{n+1} = ε_n² / | (2 * x_n) | // ≤ (2**(e-k))² / (2 * 2**(e-1)) // ≤ 2**(2*e-2*k) / 2**e // ≤ 2**(e-2*k) xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5 xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9 xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18 xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36 xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72 // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either // sqrt(a) or sqrt(a) + 1. return xn - SafeCast.toUint(xn > a / xn); } } /** * @dev Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; uint256 exp; unchecked { exp = 128 * SafeCast.toUint(value > (1 << 128) - 1); value >>= exp; result += exp; exp = 64 * SafeCast.toUint(value > (1 << 64) - 1); value >>= exp; result += exp; exp = 32 * SafeCast.toUint(value > (1 << 32) - 1); value >>= exp; result += exp; exp = 16 * SafeCast.toUint(value > (1 << 16) - 1); value >>= exp; result += exp; exp = 8 * SafeCast.toUint(value > (1 << 8) - 1); value >>= exp; result += exp; exp = 4 * SafeCast.toUint(value > (1 << 4) - 1); value >>= exp; result += exp; exp = 2 * SafeCast.toUint(value > (1 << 2) - 1); value >>= exp; result += exp; result += SafeCast.toUint(value > 1); } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; uint256 isGt; unchecked { isGt = SafeCast.toUint(value > (1 << 128) - 1); value >>= isGt * 128; result += isGt * 16; isGt = SafeCast.toUint(value > (1 << 64) - 1); value >>= isGt * 64; result += isGt * 8; isGt = SafeCast.toUint(value > (1 << 32) - 1); value >>= isGt * 32; result += isGt * 4; isGt = SafeCast.toUint(value > (1 << 16) - 1); value >>= isGt * 16; result += isGt * 2; result += SafeCast.toUint(value > (1 << 8) - 1); } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol) // This file was procedurally generated from scripts/generate/templates/SafeCast.js. pragma solidity ^0.8.20; /** * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeCast { /** * @dev Value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value); /** * @dev An int value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedIntToUint(int256 value); /** * @dev Value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedIntDowncast(uint8 bits, int256 value); /** * @dev An uint value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedUintToInt(uint256 value); /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits */ function toUint248(uint256 value) internal pure returns (uint248) { if (value > type(uint248).max) { revert SafeCastOverflowedUintDowncast(248, value); } return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits */ function toUint240(uint256 value) internal pure returns (uint240) { if (value > type(uint240).max) { revert SafeCastOverflowedUintDowncast(240, value); } return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits */ function toUint232(uint256 value) internal pure returns (uint232) { if (value > type(uint232).max) { revert SafeCastOverflowedUintDowncast(232, value); } return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { if (value > type(uint224).max) { revert SafeCastOverflowedUintDowncast(224, value); } return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits */ function toUint216(uint256 value) internal pure returns (uint216) { if (value > type(uint216).max) { revert SafeCastOverflowedUintDowncast(216, value); } return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits */ function toUint208(uint256 value) internal pure returns (uint208) { if (value > type(uint208).max) { revert SafeCastOverflowedUintDowncast(208, value); } return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits */ function toUint200(uint256 value) internal pure returns (uint200) { if (value > type(uint200).max) { revert SafeCastOverflowedUintDowncast(200, value); } return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits */ function toUint192(uint256 value) internal pure returns (uint192) { if (value > type(uint192).max) { revert SafeCastOverflowedUintDowncast(192, value); } return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits */ function toUint184(uint256 value) internal pure returns (uint184) { if (value > type(uint184).max) { revert SafeCastOverflowedUintDowncast(184, value); } return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits */ function toUint176(uint256 value) internal pure returns (uint176) { if (value > type(uint176).max) { revert SafeCastOverflowedUintDowncast(176, value); } return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits */ function toUint168(uint256 value) internal pure returns (uint168) { if (value > type(uint168).max) { revert SafeCastOverflowedUintDowncast(168, value); } return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits */ function toUint160(uint256 value) internal pure returns (uint160) { if (value > type(uint160).max) { revert SafeCastOverflowedUintDowncast(160, value); } return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits */ function toUint152(uint256 value) internal pure returns (uint152) { if (value > type(uint152).max) { revert SafeCastOverflowedUintDowncast(152, value); } return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits */ function toUint144(uint256 value) internal pure returns (uint144) { if (value > type(uint144).max) { revert SafeCastOverflowedUintDowncast(144, value); } return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits */ function toUint136(uint256 value) internal pure returns (uint136) { if (value > type(uint136).max) { revert SafeCastOverflowedUintDowncast(136, value); } return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { if (value > type(uint128).max) { revert SafeCastOverflowedUintDowncast(128, value); } return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits */ function toUint120(uint256 value) internal pure returns (uint120) { if (value > type(uint120).max) { revert SafeCastOverflowedUintDowncast(120, value); } return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits */ function toUint112(uint256 value) internal pure returns (uint112) { if (value > type(uint112).max) { revert SafeCastOverflowedUintDowncast(112, value); } return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits */ function toUint104(uint256 value) internal pure returns (uint104) { if (value > type(uint104).max) { revert SafeCastOverflowedUintDowncast(104, value); } return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { if (value > type(uint96).max) { revert SafeCastOverflowedUintDowncast(96, value); } return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint88` operator. * * Requirements: * * - input must fit into 88 bits */ function toUint88(uint256 value) internal pure returns (uint88) { if (value > type(uint88).max) { revert SafeCastOverflowedUintDowncast(88, value); } return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint80` operator. * * Requirements: * * - input must fit into 80 bits */ function toUint80(uint256 value) internal pure returns (uint80) { if (value > type(uint80).max) { revert SafeCastOverflowedUintDowncast(80, value); } return uint80(value); } /** * @dev Returns the downcasted uint72 from uint256, reverting on * overflow (when the input is greater than largest uint72). * * Counterpart to Solidity's `uint72` operator. * * Requirements: * * - input must fit into 72 bits */ function toUint72(uint256 value) internal pure returns (uint72) { if (value > type(uint72).max) { revert SafeCastOverflowedUintDowncast(72, value); } return uint72(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { revert SafeCastOverflowedUintDowncast(64, value); } return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits */ function toUint56(uint256 value) internal pure returns (uint56) { if (value > type(uint56).max) { revert SafeCastOverflowedUintDowncast(56, value); } return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits */ function toUint48(uint256 value) internal pure returns (uint48) { if (value > type(uint48).max) { revert SafeCastOverflowedUintDowncast(48, value); } return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits */ function toUint40(uint256 value) internal pure returns (uint40) { if (value > type(uint40).max) { revert SafeCastOverflowedUintDowncast(40, value); } return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { if (value > type(uint32).max) { revert SafeCastOverflowedUintDowncast(32, value); } return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits */ function toUint24(uint256 value) internal pure returns (uint24) { if (value > type(uint24).max) { revert SafeCastOverflowedUintDowncast(24, value); } return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { if (value > type(uint16).max) { revert SafeCastOverflowedUintDowncast(16, value); } return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits */ function toUint8(uint256 value) internal pure returns (uint8) { if (value > type(uint8).max) { revert SafeCastOverflowedUintDowncast(8, value); } return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { if (value < 0) { revert SafeCastOverflowedIntToUint(value); } return uint256(value); } /** * @dev Returns the downcasted int248 from int256, reverting on * overflow (when the input is less than smallest int248 or * greater than largest int248). * * Counterpart to Solidity's `int248` operator. * * Requirements: * * - input must fit into 248 bits */ function toInt248(int256 value) internal pure returns (int248 downcasted) { downcasted = int248(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(248, value); } } /** * @dev Returns the downcasted int240 from int256, reverting on * overflow (when the input is less than smallest int240 or * greater than largest int240). * * Counterpart to Solidity's `int240` operator. * * Requirements: * * - input must fit into 240 bits */ function toInt240(int256 value) internal pure returns (int240 downcasted) { downcasted = int240(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(240, value); } } /** * @dev Returns the downcasted int232 from int256, reverting on * overflow (when the input is less than smallest int232 or * greater than largest int232). * * Counterpart to Solidity's `int232` operator. * * Requirements: * * - input must fit into 232 bits */ function toInt232(int256 value) internal pure returns (int232 downcasted) { downcasted = int232(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(232, value); } } /** * @dev Returns the downcasted int224 from int256, reverting on * overflow (when the input is less than smallest int224 or * greater than largest int224). * * Counterpart to Solidity's `int224` operator. * * Requirements: * * - input must fit into 224 bits */ function toInt224(int256 value) internal pure returns (int224 downcasted) { downcasted = int224(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(224, value); } } /** * @dev Returns the downcasted int216 from int256, reverting on * overflow (when the input is less than smallest int216 or * greater than largest int216). * * Counterpart to Solidity's `int216` operator. * * Requirements: * * - input must fit into 216 bits */ function toInt216(int256 value) internal pure returns (int216 downcasted) { downcasted = int216(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(216, value); } } /** * @dev Returns the downcasted int208 from int256, reverting on * overflow (when the input is less than smallest int208 or * greater than largest int208). * * Counterpart to Solidity's `int208` operator. * * Requirements: * * - input must fit into 208 bits */ function toInt208(int256 value) internal pure returns (int208 downcasted) { downcasted = int208(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(208, value); } } /** * @dev Returns the downcasted int200 from int256, reverting on * overflow (when the input is less than smallest int200 or * greater than largest int200). * * Counterpart to Solidity's `int200` operator. * * Requirements: * * - input must fit into 200 bits */ function toInt200(int256 value) internal pure returns (int200 downcasted) { downcasted = int200(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(200, value); } } /** * @dev Returns the downcasted int192 from int256, reverting on * overflow (when the input is less than smallest int192 or * greater than largest int192). * * Counterpart to Solidity's `int192` operator. * * Requirements: * * - input must fit into 192 bits */ function toInt192(int256 value) internal pure returns (int192 downcasted) { downcasted = int192(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(192, value); } } /** * @dev Returns the downcasted int184 from int256, reverting on * overflow (when the input is less than smallest int184 or * greater than largest int184). * * Counterpart to Solidity's `int184` operator. * * Requirements: * * - input must fit into 184 bits */ function toInt184(int256 value) internal pure returns (int184 downcasted) { downcasted = int184(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(184, value); } } /** * @dev Returns the downcasted int176 from int256, reverting on * overflow (when the input is less than smallest int176 or * greater than largest int176). * * Counterpart to Solidity's `int176` operator. * * Requirements: * * - input must fit into 176 bits */ function toInt176(int256 value) internal pure returns (int176 downcasted) { downcasted = int176(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(176, value); } } /** * @dev Returns the downcasted int168 from int256, reverting on * overflow (when the input is less than smallest int168 or * greater than largest int168). * * Counterpart to Solidity's `int168` operator. * * Requirements: * * - input must fit into 168 bits */ function toInt168(int256 value) internal pure returns (int168 downcasted) { downcasted = int168(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(168, value); } } /** * @dev Returns the downcasted int160 from int256, reverting on * overflow (when the input is less than smallest int160 or * greater than largest int160). * * Counterpart to Solidity's `int160` operator. * * Requirements: * * - input must fit into 160 bits */ function toInt160(int256 value) internal pure returns (int160 downcasted) { downcasted = int160(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(160, value); } } /** * @dev Returns the downcasted int152 from int256, reverting on * overflow (when the input is less than smallest int152 or * greater than largest int152). * * Counterpart to Solidity's `int152` operator. * * Requirements: * * - input must fit into 152 bits */ function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(152, value); } } /** * @dev Returns the downcasted int144 from int256, reverting on * overflow (when the input is less than smallest int144 or * greater than largest int144). * * Counterpart to Solidity's `int144` operator. * * Requirements: * * - input must fit into 144 bits */ function toInt144(int256 value) internal pure returns (int144 downcasted) { downcasted = int144(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(144, value); } } /** * @dev Returns the downcasted int136 from int256, reverting on * overflow (when the input is less than smallest int136 or * greater than largest int136). * * Counterpart to Solidity's `int136` operator. * * Requirements: * * - input must fit into 136 bits */ function toInt136(int256 value) internal pure returns (int136 downcasted) { downcasted = int136(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(136, value); } } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits */ function toInt128(int256 value) internal pure returns (int128 downcasted) { downcasted = int128(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(128, value); } } /** * @dev Returns the downcasted int120 from int256, reverting on * overflow (when the input is less than smallest int120 or * greater than largest int120). * * Counterpart to Solidity's `int120` operator. * * Requirements: * * - input must fit into 120 bits */ function toInt120(int256 value) internal pure returns (int120 downcasted) { downcasted = int120(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(120, value); } } /** * @dev Returns the downcasted int112 from int256, reverting on * overflow (when the input is less than smallest int112 or * greater than largest int112). * * Counterpart to Solidity's `int112` operator. * * Requirements: * * - input must fit into 112 bits */ function toInt112(int256 value) internal pure returns (int112 downcasted) { downcasted = int112(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(112, value); } } /** * @dev Returns the downcasted int104 from int256, reverting on * overflow (when the input is less than smallest int104 or * greater than largest int104). * * Counterpart to Solidity's `int104` operator. * * Requirements: * * - input must fit into 104 bits */ function toInt104(int256 value) internal pure returns (int104 downcasted) { downcasted = int104(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(104, value); } } /** * @dev Returns the downcasted int96 from int256, reverting on * overflow (when the input is less than smallest int96 or * greater than largest int96). * * Counterpart to Solidity's `int96` operator. * * Requirements: * * - input must fit into 96 bits */ function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(96, value); } } /** * @dev Returns the downcasted int88 from int256, reverting on * overflow (when the input is less than smallest int88 or * greater than largest int88). * * Counterpart to Solidity's `int88` operator. * * Requirements: * * - input must fit into 88 bits */ function toInt88(int256 value) internal pure returns (int88 downcasted) { downcasted = int88(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(88, value); } } /** * @dev Returns the downcasted int80 from int256, reverting on * overflow (when the input is less than smallest int80 or * greater than largest int80). * * Counterpart to Solidity's `int80` operator. * * Requirements: * * - input must fit into 80 bits */ function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(80, value); } } /** * @dev Returns the downcasted int72 from int256, reverting on * overflow (when the input is less than smallest int72 or * greater than largest int72). * * Counterpart to Solidity's `int72` operator. * * Requirements: * * - input must fit into 72 bits */ function toInt72(int256 value) internal pure returns (int72 downcasted) { downcasted = int72(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(72, value); } } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits */ function toInt64(int256 value) internal pure returns (int64 downcasted) { downcasted = int64(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(64, value); } } /** * @dev Returns the downcasted int56 from int256, reverting on * overflow (when the input is less than smallest int56 or * greater than largest int56). * * Counterpart to Solidity's `int56` operator. * * Requirements: * * - input must fit into 56 bits */ function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(56, value); } } /** * @dev Returns the downcasted int48 from int256, reverting on * overflow (when the input is less than smallest int48 or * greater than largest int48). * * Counterpart to Solidity's `int48` operator. * * Requirements: * * - input must fit into 48 bits */ function toInt48(int256 value) internal pure returns (int48 downcasted) { downcasted = int48(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(48, value); } } /** * @dev Returns the downcasted int40 from int256, reverting on * overflow (when the input is less than smallest int40 or * greater than largest int40). * * Counterpart to Solidity's `int40` operator. * * Requirements: * * - input must fit into 40 bits */ function toInt40(int256 value) internal pure returns (int40 downcasted) { downcasted = int40(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(40, value); } } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits */ function toInt32(int256 value) internal pure returns (int32 downcasted) { downcasted = int32(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(32, value); } } /** * @dev Returns the downcasted int24 from int256, reverting on * overflow (when the input is less than smallest int24 or * greater than largest int24). * * Counterpart to Solidity's `int24` operator. * * Requirements: * * - input must fit into 24 bits */ function toInt24(int256 value) internal pure returns (int24 downcasted) { downcasted = int24(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(24, value); } } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits */ function toInt16(int256 value) internal pure returns (int16 downcasted) { downcasted = int16(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(16, value); } } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits */ function toInt8(int256 value) internal pure returns (int8 downcasted) { downcasted = int8(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(8, value); } } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive if (value > uint256(type(int256).max)) { revert SafeCastOverflowedUintToInt(value); } return int256(value); } /** * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump. */ function toUint(bool b) internal pure returns (uint256 u) { assembly ("memory-safe") { u := iszero(iszero(b)) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol) pragma solidity ^0.8.20; /** * @dev Helper library for emitting standardized panic codes. * * ```solidity * contract Example { * using Panic for uint256; * * // Use any of the declared internal constants * function foo() { Panic.GENERIC.panic(); } * * // Alternatively * function foo() { Panic.panic(Panic.GENERIC); } * } * ``` * * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil]. * * _Available since v5.1._ */ // slither-disable-next-line unused-state library Panic { /// @dev generic / unspecified error uint256 internal constant GENERIC = 0x00; /// @dev used by the assert() builtin uint256 internal constant ASSERT = 0x01; /// @dev arithmetic underflow or overflow uint256 internal constant UNDER_OVERFLOW = 0x11; /// @dev division or modulo by zero uint256 internal constant DIVISION_BY_ZERO = 0x12; /// @dev enum conversion error uint256 internal constant ENUM_CONVERSION_ERROR = 0x21; /// @dev invalid encoding in storage uint256 internal constant STORAGE_ENCODING_ERROR = 0x22; /// @dev empty array pop uint256 internal constant EMPTY_ARRAY_POP = 0x31; /// @dev array out of bounds access uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32; /// @dev resource error (too large allocation or too large array) uint256 internal constant RESOURCE_ERROR = 0x41; /// @dev calling invalid internal function uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51; /// @dev Reverts with a panic code. Recommended to use with /// the internal constants with predefined codes. function panic(uint256 code) internal pure { assembly ("memory-safe") { mstore(0x00, 0x4e487b71) mstore(0x20, code) revert(0x1c, 0x24) } } }
{ "evmVersion": "paris", "optimizer": { "enabled": true, "mode": "3" }, "outputSelection": { "*": { "*": [ "abi", "metadata" ], "": [ "ast" ] } }, "detectMissingLibraries": false, "forceEVMLA": false, "enableEraVMExtensions": true, "libraries": {} }
[{"inputs":[],"stateMutability":"payable","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":"NotCompatibleWithSpotMints","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"SequentialMintExceedsLimit","type":"error"},{"inputs":[],"name":"SequentialUpToTooSmall","type":"error"},{"inputs":[],"name":"SpotMintTokenIdTooSmall","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","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":"_flipSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"_maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"_mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"_name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_teamMint","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":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cost","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":"ownership","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":"isSaleActive","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":"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":"string","name":"uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"cost_","type":"uint256"}],"name":"setCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"supply_","type":"uint256"}],"name":"setSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","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":"result","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"}]
Contract Creation Code
9c4d535b0000000000000000000000000000000000000000000000000000000000000000010004a7cb58095da638d58f765c893be82357903230d50ca70cdc5161301ef000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x0003000000000002000800000000000200020000000103550000006003100270000004110030019d0000000100200190000000320000c13d00000411033001970000008004000039000000400040043f000000040030008c00000a8f0000413d000000000201043b000000e0022002700000042a0020009c000000790000a13d0000042b0020009c000000970000a13d0000042c0020009c000000bd0000a13d0000042d0020009c000001820000a13d0000042e0020009c0000028f0000613d0000042f0020009c000002ae0000613d000004300020009c00000a8f0000c13d000000240030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000401100370000000000601043b000004150060009c00000a8f0000213d0000000b01000039000000000101041a00000415021001970000000001000411000000000012004b000005140000c13d000000000006004b000005ff0000c13d0000042801000041000000800010043f000000840000043f0000045b0100004100001042000104300000000701000039000000800010043f0000041201000041000000a00010043f0000010001000039000000400010043f0000000401000039000000c00010043f0000041301000041000000e00010043f0000000006000411000000000006004b000000440000c13d0000042801000041000001000010043f000001040000043f00000429010000410000104200010430000000000100041a0000041402100197000000000262019f000000000020041b00000000020004140000041505100197000004110020009c0000041102008041000000c00120021000000416011001c70000800d0200003900000003030000390000041704000041104010360000040f000000010020019000000a8f0000613d000000800100043d000004180010009c000002650000813d0000000307000039000000000207041a000000010420019000000001032002700000007f0330618f0000001f0030008c00000000020000390000000102002039000000000024004b000005470000c13d000000200030008c000000710000413d0000001f021000390000000502200270000004190220009a000000200010008c0000041a020040410000001f033000390000000503300270000004190330009a000000000032004b000000710000813d000000000002041b0000000102200039000000000032004b0000006d0000413d000000200010008c000001770000413d000000000070043f0000049903100198000002480000c13d000000a0040000390000041a02000041000002560000013d000004430020009c000000a90000213d0000044f0020009c000001060000213d000004550020009c000001aa0000213d000004580020009c000002ce0000613d000004590020009c00000a8f0000c13d000000240030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000401100370000000000201043b000004940020019800000a8f0000c13d00000001010000390000049502200197000004960020009c0000048a0000613d000004970020009c0000048a0000613d000004980020009c000000000100c019000000800010043f0000047301000041000010410001042e000004380020009c000001110000213d0000043e0020009c000001d70000213d000004410020009c000002d60000613d000004420020009c00000a8f0000c13d000000240030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000401100370000000000101043b10400f350000040f0000041501100197000002c70000013d000004440020009c000001640000213d0000044a0020009c000001e60000213d0000044d0020009c000003140000613d0000044e0020009c00000a8f0000c13d000000240030008c00000a8f0000413d0000000401100370000000000301043b0000000a02000039000000000102041a000000020010008c000005770000c13d0000048e01000041000000800010043f0000048f010000410000104200010430000004330020009c000001fa0000213d000004360020009c000003190000613d000004370020009c00000a8f0000c13d000000440030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000402100370000000000202043b000800000002001d000004150020009c00000a8f0000213d0000002401100370000000000201043b000000000002004b0000000001000039000000010100c039000700000002001d000000000012004b00000a8f0000c13d0000000001000411000000000010043f0000000801000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b0000000802000029000000000020043f000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000201041a0000049a022001970000000703000029000000000232019f000000000021041b000000400100043d0000000000310435000004110010009c000004110100804100000040011002100000000002000414000004110020009c0000041102008041000000c002200210000000000112019f0000046e011001c70000800d0200003900000003030000390000046f04000041000000000500041100000008060000290000060c0000013d000004500020009c0000020a0000213d000004530020009c000003780000613d000004540020009c00000a8f0000c13d0000000001000416000000000001004b00000a8f0000c13d0000000f01000039000002120000013d000004390020009c000002160000213d0000043c0020009c000003d10000613d0000043d0020009c00000a8f0000c13d000000240030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000401100370000000000101043b000400000001001d000004150010009c00000a8f0000213d0000000401000029000000000001004b000005fb0000613d000000000010043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000101041a0000041c01100197000600000001001d00000005011002100000003f021000390000047403200197000000400200043d000300000002001d0000000002230019000000000032004b000000000300003900000001030040390000041c0020009c000002650000213d0000000100300190000002650000c13d000000400020043f000000030200002900000006030000290000000002320436000200000002001d0000001f0210018f000000000001004b000001510000613d0000000204000029000000000114001900000000030000310000000203300367000000003503043c0000000004540436000000000014004b0000014d0000c13d000000000002004b000000400100043d000004720010009c000002650000213d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000000060000006b0000076d0000c13d000000400100043d000800000001001d000000030200002900000a980000013d000004450020009c000002390000213d000004480020009c000003e80000613d000004490020009c00000a8f0000c13d000000240030008c00000a8f0000413d0000000001000416000000000001004b00000a8f0000c13d10400e9d0000040f00000004010000390000000201100367000000000101043b0000000f02000039000000000012041b0000000001000019000010410001042e000000000001004b0000000002000019000002610000613d00000003021002100000049b0220027f0000049b02200167000000a00300043d000000000223016f0000000101100210000000000212019f000002610000013d000004310020009c000003fb0000613d000004320020009c00000a8f0000c13d000000240030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000401100370000000000201043b000000000002004b000006ba0000613d0000000101000039000000000101041a000000000021004b000006ba0000a13d000700000002001d000800000002001d000000000020043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000101041a000000000001004b0000063f0000c13d0000000802000029000000000002004b000000010220008a000001940000c13d000001d10000013d000004560020009c0000040c0000613d000004570020009c00000a8f0000c13d000000240030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000401100370000000000201043b000000000002004b000006510000613d0000000101000039000000000101041a000000000021004b000006510000a13d000700000002001d000800000002001d000000000020043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000101041a000000000001004b000006470000c13d0000000802000029000000000002004b000000010220008a000001bc0000c13d0000047501000041000000000010043f0000001101000039000000040010043f000004760100004100001042000104300000043f0020009c0000042b0000613d000004400020009c00000a8f0000c13d000000240030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000401100370000000000101043b000004150010009c00000a8f0000213d10400c510000040f000002c70000013d0000044b0020009c0000044a0000613d0000044c0020009c00000a8f0000c13d000000000103001910400ab30000040f000800000001001d000700000002001d000600000003001d000000400100043d000500000001001d10400ac50000040f0000000504000029000000000004043500000008010000290000000702000029000000060300002910400c690000040f0000000001000019000010410001042e000004340020009c000004570000613d000004350020009c00000a8f0000c13d0000000001000416000000000001004b00000a8f0000c13d10400e9d0000040f0000001201000039000000000201041a0000049a03200197000000ff0020019000000001033061bf000000000031041b0000000001000019000010410001042e000004510020009c000004780000613d000004520020009c00000a8f0000c13d0000000001000416000000000001004b00000a8f0000c13d0000001101000039000000000101041a000000800010043f0000047301000041000010410001042e0000043a0020009c000004840000613d0000043b0020009c00000a8f0000c13d0000000001000416000000000001004b00000a8f0000c13d0000000403000039000000000203041a000000010420019000000001012002700000007f0110618f0000001f0010008c00000000050000390000000105002039000000000552013f0000000100500190000005470000c13d000000800010043f000000000004004b000004fe0000613d000000000030043f000000000001004b0000000002000019000005030000613d0000041e030000410000000002000019000000000403041a000000a005200039000000000045043500000001033000390000002002200039000000000012004b000002310000413d000005030000013d000004460020009c0000048d0000613d000004470020009c00000a8f0000c13d0000000001000416000000000001004b00000a8f0000c13d0000001201000039000000000101041a000000ff001001900000000001000039000000010100c039000000800010043f0000047301000041000010410001042e0000041a020000410000002005000039000000010430008a00000005044002700000041b0440009a000000000605001900000080055000390000000005050433000000000052041b00000020056000390000000102200039000000000042004b0000024d0000c13d000000a004600039000000000013004b0000025f0000813d0000000303100210000000f80330018f0000049b0330027f0000049b033001670000000004040433000000000334016f000000000032041b000000010110021000000001021001bf000000000027041b000000c00100043d0000041c0010009c0000026b0000a13d0000047501000041000000000010043f0000004101000039000000040010043f000004760100004100001042000104300000000402000039000000000302041a000000010030019000000001023002700000007f0220618f0000001f0020008c00000000040000390000000104002039000000000343013f0000000100300190000005470000c13d000000200020008c000002860000413d0000001f0310003900000005033002700000041d0330009a000000200010008c0000041e030040410000001f0220003900000005022002700000041d0220009a000000000023004b000002860000813d000000000003041b0000000103300039000000000023004b000002820000413d000000200010008c0000000407000039000004f30000413d000000000070043f0000049903100198000005190000c13d000000e0040000390000041e02000041000005270000013d0000000001000416000000000001004b00000a8f0000c13d0000000d03000039000000000203041a000000010420019000000001012002700000007f0110618f0000001f0010008c00000000050000390000000105002039000000000552013f0000000100500190000005470000c13d000000800010043f000000000004004b000004fe0000613d000000000030043f000000000001004b0000000002000019000005030000613d0000045d030000410000000002000019000000000403041a000000a005200039000000000045043500000001033000390000002002200039000000000012004b000002a60000413d000005030000013d000000440030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000402100370000000000202043b000004150020009c00000a8f0000213d0000002401100370000000000101043b000800000001001d000004150010009c00000a8f0000213d000000000020043f0000000801000039000000200010043f0000000001000019104010250000040f000000080200002910400b3c0000040f000000000101041a000000ff001001900000000001000039000000010100c039000000400200043d0000000000120435000004110020009c000004110200804100000040012002100000045c011001c7000010410001042e0000000001000416000000000001004b00000a8f0000c13d10400e9d0000040f000000000100041110400eae0000040f0000000001000019000010410001042e000000240030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000402100370000000000202043b0000041c0020009c00000a8f0000213d0000002304200039000000000034004b00000a8f0000813d000700040020003d0000000704100360000000000404043b0000041c0040009c00000a8f0000213d000000050540021000000000025200190000002402200039000000000032004b00000a8f0000213d0000000006050019000000800040043f000000a002500039000000400020043f000000000004004b000006550000c13d00000020010000390000000001120436000000800300043d00000000003104350000004001200039000000000003004b0000050b0000613d000000800400003900000000050000190000002004400039000000000604043300000000870604340000041507700197000000000771043600000000080804330000041c08800197000000000087043500000040076000390000000007070433000000000007004b0000000007000039000000010700c039000000400810003900000000007804350000006006600039000000000606043300000478066001970000006007100039000000000067043500000080011000390000000105500039000000000035004b000002fb0000413d0000050b0000013d000000000103001910400ab30000040f10400b4c0000040f0000000001000019000010410001042e000000640030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000402100370000000000202043b000400000002001d000004150020009c00000a8f0000213d0000004402100370000000000202043b0000002401100370000000000301043b000000000023004b0000058b0000813d0000000104000039000000000104041a000000000012004b0000000002018019000300000002001d000000010030008c000000010300a0390000000401000029000000000001004b000005fb0000613d000700000003001d000000000010043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000100600000003d000000000101043b0000000703000029000000030230006b00000a950000a13d000000000101041a0000041c0110019800000a950000613d000000000012004b0000000002018019000200000002001d0000000501200210000000400200043d000100000002001d00000000012100190000002001100039000000400010043f000600000001001d000004720010009c000002650000213d00000006020000290000008001200039000000400010043f00000060012000390000000000010435000000400120003900000000000104350000002001200039000000000001043500000000000204350000000101000039000000000101041a000000000031004b0000000001000019000008c20000a13d0000000701000029000800000001001d000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000101041a000000000001004b000009bb0000c13d0000000801000029000000010110008a000003640000013d000000440030008c00000a8f0000413d0000000402100370000000000202043b000700000002001d000004150020009c00000a8f0000213d0000002401100370000000000101043b000000000001004b000003f70000613d000600000001001d000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000101041a000000000001004b000003ac0000c13d0000000101000039000000000101041a0000000602000029000000000021004b000003f70000a13d000000010220008a000800000002001d000000000020043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000101041a000000000001004b0000000802000029000003990000613d0000045f001001980000000602000029000003f70000c13d000804150010019b0000000003000411000000080030006c000007490000c13d000000000020043f0000000701000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d00000007020000290000041506200197000000000101043b000000000201041a0000041402200197000000000262019f000000000021041b0000000001000414000004110010009c0000041101008041000000c00110021000000416011001c70000800d0200003900000004030000390000049104000041000000080500002900000006070000290000060c0000013d0000000001000416000000000001004b00000a8f0000c13d0000000b01000039000000000101041a00000415021001970000000001000411000000000012004b000005140000c13d000000000100041a0000041402100197000000000020041b00000000020004140000041505100197000004110020009c0000041102008041000000c00120021000000416011001c70000800d020000390000000303000039000004170400004100000000060000190000060c0000013d000000240030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000401100370000000000201043b0000000b01000039000000000101041a00000415011001970000000003000411000000000031004b000005860000c13d000000000002004b0000058f0000c13d0000049201000041000000000010043f00000471010000410000104200010430000000240030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000401100370000000000101043b10400e3e0000040f000000400200043d000800000002001d10400b1a0000040f0000000801000029000004110010009c000004110100804100000040011002100000046d011001c7000010410001042e0000000001000416000000000001004b00000a8f0000c13d0000000303000039000000000203041a000000010420019000000001012002700000007f0110618f0000001f0010008c00000000050000390000000105002039000000000552013f0000000100500190000005470000c13d000000800010043f000000000004004b000004fe0000613d000000000030043f000000000001004b0000000002000019000005030000613d0000041a030000410000000002000019000000000403041a000000a005200039000000000045043500000001033000390000002002200039000000000012004b000004230000413d000005030000013d0000000001000416000000000001004b00000a8f0000c13d0000001003000039000000000203041a000000010420019000000001012002700000007f0110618f0000001f0010008c00000000050000390000000105002039000000000552013f0000000100500190000005470000c13d000000800010043f000000000004004b000004fe0000613d000000000030043f000000000001004b0000000002000019000005030000613d00000424030000410000000002000019000000000403041a000000a005200039000000000045043500000001033000390000002002200039000000000012004b000004420000413d000005030000013d000000240030008c00000a8f0000413d0000000001000416000000000001004b00000a8f0000c13d10400e9d0000040f00000004010000390000000201100367000000000101043b0000001102000039000000000012041b0000000001000019000010410001042e000000840030008c00000a8f0000413d0000000402100370000000000202043b000800000002001d000004150020009c00000a8f0000213d0000002402100370000000000202043b000700000002001d000004150020009c00000a8f0000213d0000006402100370000000000402043b0000041c0040009c00000a8f0000213d0000002302400039000000000032004b00000a8f0000813d0000000402400039000000000121034f000000000201043b000000240140003910400ae20000040f00000044020000390000000202200367000000000302043b00000000040100190000000801000029000000070200002910400c690000040f0000000001000019000010410001042e0000000001000416000000000001004b00000a8f0000c13d0000000201000039000000000101041a0000049b011001670000000102000039000000000202041a0000000001120019000000800010043f0000047301000041000010410001042e0000000001000416000000000001004b00000a8f0000c13d0000000b01000039000000000101041a0000041501100197000000800010043f0000047301000041000010410001042e000000240030008c00000a8f0000413d0000000002000416000000000002004b00000a8f0000c13d0000000402100370000000000502043b0000041c0050009c00000a8f0000213d0000002302500039000000000032004b00000a8f0000813d0000000406500039000000000261034f000000000202043b0000041c0020009c000002650000213d0000001f0720003900000499077001970000003f077000390000049907700197000004720070009c000002650000213d00000024055000390000008007700039000000400070043f000000800020043f0000000005520019000000000035004b00000a8f0000213d0000002003600039000000000331034f00000499052001980000001f0620018f000000a001500039000004b70000613d000000a007000039000000000803034f000000008908043c0000000007970436000000000017004b000004b30000c13d000000000006004b000004c40000613d000000000353034f0000000305600210000000000601043300000000065601cf000000000656022f000000000303043b0000010005500089000000000353022f00000000035301cf000000000363019f0000000000310435000000a00120003900000000000104350000000b01000039000000000101041a00000415021001970000000001000411000000000012004b000006cd0000c13d000000800200043d0000041c0020009c000002650000213d0000001001000039000000000501041a000000010050019000000001035002700000007f0330618f0000001f0030008c00000000060000390000000106002039000000000565013f0000000100500190000005470000c13d000000200030008c000004eb0000413d000000000010043f0000001f052000390000000505500270000004210550009a000000200020008c00000424050040410000001f033000390000000503300270000004210330009a000000000035004b000004eb0000813d000000000005041b0000000105500039000000000035004b000004e70000413d0000001f0020008c0000093b0000a13d000000000010043f0000049904200198000009f40000c13d000000a005000039000004240300004100000a020000013d000000000001004b0000000002000019000005320000613d00000003021002100000049b0220027f0000049b02200167000000e00300043d000000000223016f0000000101100210000000000212019f000005320000013d0000049a02200197000000a00020043f000000000001004b000000200200003900000000020060390000002002200039000000800100003910400ad00000040f000000400100043d000800000001001d000000800200003910400a9e0000040f00000008020000290000000001210049000004110010009c00000411010080410000006001100210000004110020009c00000411020080410000004002200210000000000121019f000010410001042e0000045a02000041000000800020043f000000840010043f0000045b0100004100001042000104300000041e020000410000002005000039000000010430008a00000005044002700000041f0440009a0000000006050019000000c0055000390000000005050433000000000052041b00000020056000390000000102200039000000000042004b0000051e0000c13d000000e004600039000000000013004b000005300000813d0000000303100210000000f80330018f0000049b0330027f0000049b033001670000000004040433000000000334016f000000000032041b000000010110021000000001021001bf000000000027041b0000000101000039000000000011041b0000000a02000039000000000012041b0000000c02000039000000000012041b00000420030000410000000f04000039000000000034041b0000001003000039000000000503041a000000010050019000000001045002700000007f0440618f0000001f0040008c00000000060000390000000106002039000000000565013f00000001005001900000054d0000613d0000047501000041000000000010043f0000002201000039000000040010043f00000476010000410000104200010430000000200040008c000005590000413d000000410040008c000005590000413d0000001f044000390000000504400270000004210440009a0000042205000041000000000005041b0000000105500039000000000045004b000005550000413d0000004704000039000000000043041b000000000030043f00000423030000410000042404000041000000000034041b00000425030000410000042604000041000000000034041b000003e7030000390000001104000039000000000034041b0000001203000039000000000403041a0000049a0440019700000001044001bf000000000043041b000000000300041100000415033001970000000b04000039000000000504041a0000041405500197000000000335019f000000000034041b000000000012041b0000002001000039000001000010044300000120000004430000042701000041000010410001042e0000000201000039000000000012041b0000001201000039000000000201041a000000ff00200190000005f80000c13d0000046b02000041000000800020043f0000002002000039000000840020043f000000a40010043f0000048c01000041000000c40010043f0000048d0100004100001042000104300000045a01000041000000800010043f000000840030043f0000045b0100004100001042000104300000047001000041000000000010043f00000471010000410000104200010430000700000002001d000000000020043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000201041a000000000002004b000005b90000c13d0000000101000039000000000101041a0000000702000029000000000021004b000003f70000a13d0000000001020019000000010110008a000800000001001d000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000201041a000000000002004b0000000801000029000005a60000613d0000045f002001980000000701000029000003f70000c13d000800000002001d000000000010043f0000000701000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d00000008020000290000041502200197000000000101043b000500000001001d000000000301041a000600000002001d0000000001000411000000000021004b0000084f0000613d000000000031004b0000084f0000613d000400000003001d0000000601000029000000000010043f0000000801000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b0000000002000411000000000020043f000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000101041a000000ff0010019000000004030000290000084f0000c13d0000047a01000041000000000010043f0000047101000041000010420001043000000000010004110000041501100198000006110000c13d0000048b01000041000000000010043f00000471010000410000104200010430000000000100041a0000041402100197000000000262019f000000000020041b00000000020004140000041505100197000004110020009c0000041102008041000000c00120021000000416011001c70000800d0200003900000003030000390000041704000041104010360000040f000000010020019000000a8f0000613d0000000001000019000010410001042e000500000003001d000800000001001d000000000010043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d0000000202000039000000000202041a0000049b022001670000000103000039000000000403041a0000000002240019000000000101043b0000000503000029000000000032001a000001d10000413d00000000023200190000001103000039000000000303041a000000000032004b000006d70000a13d000000400100043d00000044021000390000048a0300004100000000003204350000002402100039000000160300003900000000003204350000046b020000410000000000210435000000040210003900000020030000390000000000320435000004110010009c0000041101008041000000400110021000000486011001c700001042000104300000045f001001980000000701000029000006b90000c13d000004600010009c000006ec0000413d0000004002000039000004600110012a000006f40000013d0000045f001001980000000701000029000006510000c13d000000000010043f0000000701000039000000200010043f0000000001000019104010250000040f000000000101041a000000a70000013d0000049301000041000000000010043f00000471010000410000104200010430000004770040009c000002650000213d0000000703600029000000000331034f000000000403043b0000008003200039000000400030043f0000006003200039000000000003043500000040032000390000000000030435000000200320003900000000000304350000000000020435000000000004004b000006ae0000613d0000000103000039000000000303041a000000000043004b000006ae0000a13d000600000006001d000800000004001d000000000040043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000101041a000000000001004b0000067e0000c13d0000000804000029000000010440008a0000066a0000013d000000400100043d000004720010009c0000000803000029000002650000213d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000000000030043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000400200043d000004720020009c0000000606000029000002650000213d000000000301034f0000000201000367000000000303043b000000000303041a0000008004200039000000400040043f0000006004200039000000e80530027000000000005404350000045f003001980000000004000039000000010400c0390000004005200039000000000045043500000415043001970000000004420436000000a0033002700000041c033001970000000000340435000000200460008c00000080036000390000000000230435000000400200043d000002f20000613d0000000703400029000000000331034f000004720020009c0000000006040019000006590000a13d000002650000013d000000400400043d00000064014000390000046902000041000000000021043500000044014000390000046a02000041000000000021043500000024014000390000002f0200003900000000002104350000046b010000410000000000140435000000040140003900000020020000390000000000210435000004110040009c000004110400804100000040014002100000046c011001c70000104200010430000000400200043d0000045a03000041000000000032043500000004032000390000000000130435000004110020009c0000041102008041000000400120021000000476011001c70000104200010430000700000004001d0000000b02000039000000000202041a00000415022001970000000003000411000000000023004b000007bb0000c13d000000400100043d000400000001001d000004810010009c000002650000213d00000004020000290000002001200039000000400010043f0000000000020435000000050000006b000009450000c13d0000048901000041000000000010043f00000471010000410000104200010430000004620010009c000004610110212a00000000020000390000002002002039000004630010009c00000010022081bf0000046401108197000004630110812a000004650010009c00000008022080390000041c01108197000004650110812a000027100010008c00000004022080390000041101108197000027100110811a000000640010008c00000002022080390000ffff0110818f000000640110811a000000090010008c000000010220203900000499052001970000005f015000390000049906100197000000400300043d0000000001360019000000000061004b000000000600003900000001060040390000041c0010009c000002650000213d0000000100600190000002650000c13d000000400010043f00000001012000390000000001130436000000200650003900000499056001980000001f0460018f0000071d0000613d0000000005510019000000000600003100000002066003670000000007010019000000006806043c0000000007870436000000000057004b000007190000c13d000000000004004b000000000223001900000021022000390000000706000029000000090060008c0000000a4660011a0000000304400210000000010220008a00000000050204330000046605500197000004670440021f0000046804400197000000000454019f0000000000420435000007210000213d0000001006000039000000000506041a000000010750019000000001025002700000007f0220618f0000001f0020008c00000000040000390000000104002039000000000445013f0000000100400190000005470000c13d000000400400043d00000000090400190000002004400039000000000007004b0000091f0000613d000000000060043f000000000002004b000009210000613d000004240500004100000000060000190000000007460019000000000805041a000000000087043500000001055000390000002006600039000000000026004b000007410000413d000009210000013d0000000801000029000000000010043f0000000801000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b00000000020004110000041502200197000000000020043f000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000101041a000000ff001001900000000602000029000003b30000c13d0000049001000041000000000010043f0000047101000041000010420001043000000001050000390000000003000019000500000000001d000007780000013d00000005013002100000000201100029000000000051043500000001033000390000000105500039000000060030006c000001600000613d000700000003001d000000400100043d000004720010009c000002650000213d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000800000005001d000000000050043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000400200043d000004720020009c0000000805000029000002650000213d000000000101043b000000000101041a0000008003200039000000400030043f0000006003200039000000e804100270000000000043043500000040032000390000045f001001980000000004000039000000010400c0390000000000430435000000a0031002700000041c0330019700000020042000390000000000340435000004150110019700000000001204350000000703000029000007750000c13d000000000001004b00000000020100190000000502006029000500000002001d0000041501200197000000040010006c000007750000c13d00000003010000290000000001010433000000000031004b000007710000213d0000047501000041000000000010043f0000003201000039000000040010043f00000476010000410000104200010430000000000101041a0000041c001001980000000f01000039000000000201041a00000005012000b90000090f0000c13d000000000002004b0000000504000029000007c90000613d000000000021004b000001d10000413d00000000032100d9000000000043004b000001d10000c13d00000000012100490000000002000416000000000012004b000009180000413d000000050000006b000009ef0000613d0000000103000039000400000000001d000007d70000013d00000004020000290000000102200039000400000002001d000000050020006c000009ef0000813d000000400200043d000004810020009c000002650000213d0000002001200039000000400010043f000200000002001d0000000000020435000000000103041a000600000001001d0000047c0100004100000000001004430000000001000414000004110010009c0000041101008041000000c0011002100000047d011001c70000800b020000391040103b0000040f000000010020019000000a910000613d000000000101043b000700000001001d0000000601000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d0000000702000029000000a0022002100000000803000029000000000232019f0000047f022001c7000000000101043b000000000021041b000000000030043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f0000000103000039000000010020019000000a8f0000613d000000000101043b000000000201041a000004820220009a000000000021041b0000000601000029000300010010003d000700000001001d0000000001000019000008280000013d00000007070000290000000001000414000004110010009c0000041101008041000000c00110021000000416011001c70000800d020000390000000403000039000004800400004100000000050000190000000806000029000700000007001d104010360000040f00000001002001900000000103000039000000000103001900000a8f0000613d0000000100100190000008170000613d0000000707000029000000060070006c0000082f0000613d0000000107700039000008180000013d0000000301000029000000000013041b00000483010000410000000000100443000000000100041100000004001004430000000001000414000004110010009c0000041101008041000000c00110021000000484011001c700008002020000391040103b0000040f000000010020019000000a910000613d000000000101043b000000000001004b0000000103000039000007d20000613d000000000103041a000700000001001d000000010210008a0000000001000411000000020300002910400f6a0000040f000000000001004b00000a9a0000613d0000000103000039000000000103041a000000070010006c000007d20000613d00000a8f0000013d000000000003004b000008530000613d0000000501000029000000000001041b0000000601000029000000000010043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000201041a0000047b0220009a000000000021041b0000047c0100004100000000001004430000000001000414000004110010009c0000041101008041000000c0011002100000047d011001c70000800b020000391040103b0000040f000000010020019000000a910000613d000000000101043b000500000001001d0000000701000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d0000000502000029000000a00220021000000006022001af0000047e022001c7000000000101043b000000000021041b00000008010000290000047f00100198000008ae0000c13d00000007010000290000000101100039000500000001001d000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000000101041a000000000001004b000008ae0000c13d0000000101000039000000000101041a000000050010006b000008ae0000613d0000000501000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b0000000802000029000000000021041b0000000001000414000004110010009c0000041101008041000000c00110021000000416011001c70000800d0200003900000004030000390000048004000041000000060500002900000000060000190000000707000029104010360000040f000000010020019000000a8f0000613d0000000201000039000000000201041a0000000102200039000000000021041b0000000001000019000010410001042e000800000001001d0000000001000019000500000000001d0000000705000029000008cc0000013d000800000000001d0000000601000029000000400010043f000000010550003900000001010000390000000100100190000008d30000613d000000030050006c00000a920000613d0000000502000029000000020020006c00000a920000613d000000400100043d000004720010009c000002650000213d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000700000005001d000000000050043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000400200043d000004720020009c0000000705000029000002650000213d000000000101043b000000000101041a0000006003200039000000e804100270000000000043043500000040032000390000045f001001980000000004000039000000010400c0390000000000430435000000a0031002700000041c033001970000002004200039000000000034043500000415011001970000000000120435000008c70000c13d000000000001004b00000000020100190000000802006029000800000002001d000000040120014f0000041500100198000008c80000c13d00000005010000290000000101100039000500000001001d000000050110021000000001011000290000000000510435000008c80000013d000000000002004b0000000503000029000009150000613d00000000022100d9000000000032004b000001d10000c13d0000000002000416000000000012004b000009ec0000813d000000400100043d00000044021000390000048503000041000000000032043500000024021000390000001403000039000006340000013d0000049a05500197000000000054043500000000024200190000000003030433000000000003004b0000092d0000613d000000000400001900000000052400190000000006140019000000000606043300000000006504350000002004400039000000000034004b000009260000413d00000000012300190000000000010435000800000009001d0000000002910049000000200120008a0000000000190435000000000109001910400ad00000040f000000400100043d000700000001001d000000080200002910400a9e0000040f00000007020000290000050b0000013d000000000002004b00000000030000190000093f0000613d000000a00300043d00000003042002100000049b0440027f0000049b04400167000000000443016f000000010320021000000a0d0000013d0000047c0100004100000000001004430000000001000414000004110010009c0000041101008041000000c0011002100000047d011001c70000800b020000391040103b0000040f000000010020019000000a910000613d000000000101043b000600000001001d0000000701000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d0000000602000029000000a0022002100000000503000029000000010030008c00000000030000190000047f03006041000000000223019f0000000803000029000000000232019f000000000101043b000000000021041b000000000030043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000000101043b000000050400002900000487024000d1000000000301041a0000000002230019000000000021041b000600070040002d00000000010000190000098f0000013d00000007070000290000000001000414000004110010009c0000041101008041000000c00110021000000416011001c70000800d020000390000000403000039000004800400004100000000050000190000000806000029000700000007001d104010360000040f0000000100200190000000010100003900000a8f0000613d00000001001001900000097f0000613d00000007070000290000000107700039000000060070006c000009800000c13d00000001010000390000000602000029000000000021041b00000483010000410000000000100443000000000100041100000004001004430000000001000414000004110010009c0000041101008041000000c00110021000000484011001c700008002020000391040103b0000040f000000010020019000000a910000613d000000000101043b000000000001004b000009ef0000613d0000000101000039000000000201041a000700000002001d000000050220006a0000000001000411000800000002001d000000040300002910400f6a0000040f000000000001004b00000a9a0000613d00000008020000290000000102200039000000070020006c000009ac0000413d0000000101000039000000000101041a000000070010006c000009ef0000613d00000a8f0000013d000000400100043d000004720010009c000002650000213d0000008002100039000000400020043f00000060021000390000000000020435000000400210003900000000000204350000002002100039000000000002043500000000000104350000000801000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d000000400200043d000004720020009c000002650000213d000000000101043b000000000101041a0000008003200039000000400030043f0000006003200039000000e804100270000000000043043500000040032000390000045f001001980000000004000039000000010400c0390000000000430435000000a0031002700000041c033001970000002004200039000000000034043500000415011001970000000000120435000800000000001d000800000001601d000008c30000013d000000050000006b000000010300003900000a110000c13d00000001010000390000000a02000039000000000012041b0000000001000019000010410001042e00000424030000410000002006000039000000010540008a0000000505500270000004790550009a000000000706001900000080066000390000000006060433000000000063041b00000020067000390000000103300039000000000053004b000009f90000c13d000000a005700039000000000024004b00000a0b0000813d0000000304200210000000f80440018f0000049b0440027f0000049b044001670000000005050433000000000445016f000000000043041b00000001030000390000000104200210000000000234019f000000000021041b0000000001000019000010410001042e000400000000001d00000a180000013d00000004020000290000000102200039000400000002001d000000050020006c000009ef0000813d000000400200043d000004810020009c000002650000213d0000002001200039000000400010043f000200000002001d0000000000020435000000000103041a000600000001001d0000047c0100004100000000001004430000000001000414000004110010009c0000041101008041000000c0011002100000047d011001c70000800b020000391040103b0000040f000000010020019000000a910000613d000000000101043b000700000001001d0000000601000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000a8f0000613d0000000702000029000000a0022002100000000803000029000000000232019f0000047f022001c7000000000101043b000000000021041b000000000030043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f0000000103000039000000010020019000000a8f0000613d000000000101043b000000000201041a000004820220009a000000000021041b0000000601000029000300010010003d000700000001001d000000000100001900000a690000013d00000007070000290000000001000414000004110010009c0000041101008041000000c00110021000000416011001c70000800d020000390000000403000039000004800400004100000000050000190000000806000029000700000007001d104010360000040f00000001002001900000000103000039000000000103001900000a8f0000613d000000010010019000000a580000613d0000000707000029000000060070006c00000a700000613d000000010770003900000a590000013d0000000301000029000000000013041b00000483010000410000000000100443000000000100041100000004001004430000000001000414000004110010009c0000041101008041000000c00110021000000484011001c700008002020000391040103b0000040f000000010020019000000a910000613d000000000101043b000000000001004b000000010300003900000a130000613d000000000103041a000700000001001d000000010210008a0000000001000411000000020300002910400f6a0000040f000000000001004b00000a9a0000613d0000000103000039000000000103041a000000070010006c00000a130000613d00000000010000190000104200010430000000000001042f000000010100002900000005020000290000000000210435000000400100043d000800000001001d000000010200002910400b2d0000040f0000050a0000013d0000048801000041000000000010043f0000047101000041000010420001043000000020030000390000000004310436000000003202043400000000002404350000004001100039000000000002004b00000aad0000613d000000000400001900000000051400190000000006430019000000000606043300000000006504350000002004400039000000000024004b00000aa60000413d000000000312001900000000000304350000001f0220003900000499022001970000000001120019000000000001042d0000049c0010009c00000ac30000213d000000630010008c00000ac30000a13d00000002030003670000000401300370000000000101043b000004150010009c00000ac30000213d0000002402300370000000000202043b000004150020009c00000ac30000213d0000004403300370000000000303043b000000000001042d000000000100001900001042000104300000049d0010009c00000aca0000813d0000002001100039000000400010043f000000000001042d0000047501000041000000000010043f0000004101000039000000040010043f000004760100004100001042000104300000001f0220003900000499022001970000000001120019000000000021004b000000000200003900000001020040390000041c0010009c00000adc0000213d000000010020019000000adc0000c13d000000400010043f000000000001042d0000047501000041000000000010043f0000004101000039000000040010043f00000476010000410000104200010430000004180020009c00000b120000813d00000000040100190000001f0120003900000499011001970000003f011000390000049905100197000000400100043d0000000005510019000000000015004b000000000700003900000001070040390000041c0050009c00000b120000213d000000010070019000000b120000c13d000000400050043f00000000052104360000000007420019000000000037004b00000b180000213d00000499062001980000001f0720018f0000000204400367000000000365001900000b020000613d000000000804034f0000000009050019000000008a08043c0000000009a90436000000000039004b00000afe0000c13d000000000007004b00000b0f0000613d000000000464034f0000000306700210000000000703043300000000076701cf000000000767022f000000000404043b0000010006600089000000000464022f00000000046401cf000000000474019f000000000043043500000000022500190000000000020435000000000001042d0000047501000041000000000010043f0000004101000039000000040010043f000004760100004100001042000104300000000001000019000010420001043000000000430104340000041503300197000000000332043600000000040404330000041c04400197000000000043043500000040031000390000000003030433000000000003004b0000000003000039000000010300c0390000004004200039000000000034043500000060022000390000006001100039000000000101043300000478011001970000000000120435000000000001042d00000020030000390000000004310436000000000302043300000000003404350000004001100039000000000003004b00000b3b0000613d00000000040000190000002002200039000000000502043300000000015104360000000104400039000000000034004b00000b350000413d000000000001042d0000041502200197000000000020043f000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000b4a0000613d000000000101043b000000000001042d000000000100001900001042000104300007000000000002000300000002001d000500000001001d000600000003001d000000000003004b00000c400000613d0000000601000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000c3e0000613d000000000101043b000000000101041a000000000001004b00000b7b0000c13d0000000101000039000000000101041a000000060010006c00000c400000a13d0000000602000029000000010220008a000700000002001d000000000020043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000c3e0000613d000000000101043b000000000101041a000000000001004b000000070200002900000b680000613d0000045f0010019800000c400000c13d00000005020000290000041502200197000400000001001d0000041501100197000700000002001d000000000021004b00000c440000c13d0000000601000029000000000010043f0000000701000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000c3e0000613d000000000201043b000000000302041a00000000010004110000041504100197000000070040006c00000bbc0000613d000000000034004b00000bbc0000613d000500000004001d000100000003001d000200000002001d0000000701000029000000000010043f0000000801000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000c3e0000613d000000000101043b0000000502000029000000000020043f000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000c3e0000613d000000000101043b000000000101041a000000ff001001900000000202000029000000010300002900000c4d0000613d000000000003004b00000bbf0000613d000000000002041b0000000701000029000000000010043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000c3e0000613d000000000101043b000000000201041a000000010220008a000000000021041b00000003010000290000041501100197000500000001001d000000000010043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000c3e0000613d000000000101043b000000000201041a0000000102200039000000000021041b0000047c0100004100000000001004430000000001000414000004110010009c0000041101008041000000c0011002100000047d011001c70000800b020000391040103b0000040f000000010020019000000c480000613d000000000101043b000300000001001d0000000601000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000c3e0000613d0000000302000029000000a00220021000000005022001af0000047f022001c7000000000101043b000000000021041b00000004010000290000047f0010019800000c2d0000c13d00000006010000290000000101100039000300000001001d000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000c3e0000613d000000000101043b000000000101041a000000000001004b00000c2d0000c13d0000000101000039000000000101041a000000030010006b00000c2d0000613d0000000301000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000c3e0000613d000000000101043b0000000402000029000000000021041b0000000001000414000004110010009c0000041101008041000000c00110021000000416011001c70000800d0200003900000004030000390000048004000041000000070500002900000005060000290000000607000029104010360000040f000000010020019000000c3e0000613d000000050000006b00000c490000613d000000000001042d000000000100001900001042000104300000049201000041000000000010043f000004710100004100001042000104300000049e01000041000000000010043f00000471010000410000104200010430000000000001042f0000049f01000041000000000010043f000004710100004100001042000104300000047a01000041000000000010043f00000471010000410000104200010430000004150110019800000c630000613d000000000010043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000c670000613d000000000101043b000000000101041a0000041c01100197000000000001042d0000048b01000041000000000010043f0000047101000041000010420001043000000000010000190000104200010430000a000000000002000100000004001d000500000002001d000600000001001d000700000003001d000000000003004b00000dec0000613d0000000701000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000dea0000613d000000000101043b000000000101041a000000000001004b00000c990000c13d0000000101000039000000000101041a000000070010006c00000dec0000a13d0000000702000029000000010220008a000800000002001d000000000020043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000dea0000613d000000000101043b000000000101041a000000000001004b000000080200002900000c860000613d0000045f0010019800000dec0000c13d00000006020000290000041502200197000300000001001d0000041501100197000800000002001d000000000021004b00000df10000c13d0000000701000029000000000010043f0000000701000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000dea0000613d000000000301043b000000000403041a00000000010004110000041502100197000400000002001d000000080020006c00000cda0000613d000000040040006b00000cda0000613d000200000004001d000600000003001d0000000801000029000000000010043f0000000801000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000dea0000613d000000000101043b0000000402000029000000000020043f000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000dea0000613d000000000101043b000000000101041a000000ff001001900000000603000029000000020400002900000df90000613d000000000004004b00000cdd0000613d000000000003041b0000000801000029000000000010043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000dea0000613d000000000101043b000000000201041a000000010220008a000000000021041b00000005010000290000041501100197000600000001001d000000000010043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000dea0000613d000000000101043b000000000201041a0000000102200039000000000021041b0000047c0100004100000000001004430000000001000414000004110010009c0000041101008041000000c0011002100000047d011001c70000800b020000391040103b0000040f000000010020019000000df00000613d000000000101043b000200000001001d0000000701000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000dea0000613d0000000202000029000000a0022002100000000606000029000000000262019f0000047f022001c7000000000101043b000000000021041b00000003010000290000047f0010019800000d4e0000c13d00000007010000290000000101100039000200000001001d000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000dea0000613d000000000101043b000000000101041a000000000001004b000000060600002900000d4e0000c13d0000000101000039000000000101041a000000020010006b00000d4e0000613d0000000201000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000dea0000613d000000000101043b0000000302000029000000000021041b00000006060000290000000001000414000004110010009c0000041101008041000000c00110021000000416011001c70000800d020000390000000403000039000004800400004100000008050000290000000707000029104010360000040f000000010020019000000dea0000613d000000060000006b00000df50000613d00000483010000410000000000100443000000050100002900000004001004430000000001000414000004110010009c0000041101008041000000c00110021000000484011001c700008002020000391040103b0000040f000000010020019000000df00000613d000000000101043b000000000001004b00000de90000613d0000000008000415000000400b00043d0000006401b00039000000800700003900000000007104350000004401b00039000000070200002900000000002104350000002401b0003900000008020000290000000000210435000004a00100004100000000001b04350000000401b00039000000040200002900000000002104350000008403b00039000000010100002900000000210104340000000000130435000000a403b00039000000000001004b00000d8c0000613d000000000400001900000000053400190000000006420019000000000606043300000000006504350000002004400039000000000014004b00000d850000413d0000000002310019000000000002043500000000040004140000000602000029000000040020008c00000d9a0000c13d00000000050004150000000a0550008a00000005055002100000000103000031000000200030008c0000002004000039000000000403401900000dd10000013d000700000008001d000500000007001d0000001f011000390000049901100197000000a401100039000004110010009c000004110100804100000060011002100000041100b0009c000004110300004100000000030b40190000004003300210000000000131019f000004110040009c0000041104008041000000c003400210000000000113019f00080000000b001d104010360000040f000000080b00002900000060031002700000041103300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000000057b001900000dbd0000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b00000db90000c13d000000000006004b00000dca0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f0000000005000415000000090550008a0000000505500210000000010020019000000dfd0000613d00000007080000290000001f01400039000000600210018f0000000001b20019000000000021004b000000000200003900000001020040390000041c0010009c00000e2f0000213d000000010020019000000e2f0000c13d000000400010043f000000200030008c00000dea0000413d00000000010b0433000004940010019800000dea0000c13d0000000502500270000000000201001f0000000002000415000000000228004900000000020000020000049501100197000004a00010009c00000e2b0000c13d000000000001042d000000000100001900001042000104300000049201000041000000000010043f00000471010000410000104200010430000000000001042f0000049e01000041000000000010043f000004710100004100001042000104300000049f01000041000000000010043f000004710100004100001042000104300000047a01000041000000000010043f00000471010000410000104200010430000000000003004b00000e010000c13d000000600200003900000e280000013d0000001f02300039000004a1022001970000003f02200039000004a204200197000000400200043d0000000004420019000000000024004b000000000500003900000001050040390000041c0040009c00000e2f0000213d000000010050019000000e2f0000c13d000000400040043f0000001f0430018f0000000006320436000004a305300198000500000006001d000000000356001900000e1b0000613d000000000601034f0000000507000029000000006806043c0000000007870436000000000037004b00000e170000c13d000000000004004b00000e280000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000000001020433000000000001004b00000e350000c13d0000048801000041000000000010043f000004710100004100001042000104300000047501000041000000000010043f0000004101000039000000040010043f000004760100004100001042000104300000000502000029000004110020009c00000411020080410000004002200210000004110010009c00000411010080410000006001100210000000000121019f000010420001043000010000000000020000000003010019000000400100043d000004a40010009c00000e970000813d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000000000003004b00000e940000613d0000000102000039000000000202041a000000000032004b00000e940000a13d000100000003001d000000000030043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000e950000613d000000000101043b000000000101041a000000000001004b00000e660000c13d0000000103000029000000010330008a00000e520000013d000000400100043d000004720010009c000000010300002900000e970000213d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000000000030043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000e950000613d000000000301034f000000400100043d000004720010009c00000e970000213d000000000203043b000000000202041a0000008003100039000000400030043f0000006003100039000000e80420027000000000004304350000045f002001980000000003000039000000010300c0390000004004100039000000000034043500000415032001970000000003310436000000a0022002700000041c022001970000000000230435000000000001042d000000000100001900001042000104300000047501000041000000000010043f0000004101000039000000040010043f000004760100004100001042000104300000000b01000039000000000101041a00000415021001970000000001000411000000000012004b00000ea40000c13d000000000001042d000000400200043d0000045a03000041000000000032043500000004032000390000000000130435000004110020009c0000041102008041000000400120021000000476011001c700001042000104300005000000000002000300000001001d000000400200043d0000049d0020009c00000f270000813d0000002001200039000000400010043f000100000002001d00000000000204350000000101000039000000000101041a000500000001001d0000047c0100004100000000001004430000000001000414000004110010009c0000041101008041000000c0011002100000047d011001c70000800b020000391040103b0000040f000000010020019000000f260000613d000000000101043b000400000001001d0000000501000029000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000f030000613d000000030200002900000415032001970000000402000029000000a002200210000000000232019f0000047f022001c7000000000101043b000000000021041b000400000003001d000000000030043f0000000601000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000f030000613d000000000101043b000000000201041a000004820220009a000000000021041b000000040000006b00000f2d0000613d0000000501000029000200010010003d0000000001000019000000010010019000000f050000c13d0000000001000414000004110010009c0000041101008041000000c00110021000000416011001c70000800d0200003900000004030000390000048004000041000000000500001900000004060000290000000507000029104010360000040f0000000100200190000000010100003900000ef20000c13d0000000001000019000010420001043000000001010000390000000202000029000000000021041b00000483010000410000000000100443000000030100002900000004001004430000000001000414000004110010009c0000041101008041000000c00110021000000484011001c700008002020000391040103b0000040f000000010020019000000f260000613d000000000101043b000000000001004b00000f250000613d0000000101000039000000000101041a000500000001001d000000010210008a0000000301000029000000010300002910400f6a0000040f000000000001004b00000f310000613d0000000101000039000000000101041a000000050010006c00000f030000c13d000000000001042d000000000001042f0000047501000041000000000010043f0000004101000039000000040010043f00000476010000410000104200010430000004a501000041000000000010043f000004710100004100001042000104300000048801000041000000000010043f000004710100004100001042000104300001000000000002000000000001004b00000f660000613d000100000001001d000000000010043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000f640000613d000000000101043b000000000101041a000000000001004b00000f610000c13d0000000101000039000000000101041a0000000102000029000000000021004b00000f660000a13d000000010220008a000100000002001d000000000020043f0000000501000039000000200010043f0000000001000414000004110010009c0000041101008041000000c0011002100000045e011001c700008010020000391040103b0000040f000000010020019000000f640000613d000000000101043b000000000101041a000000000001004b000000010200002900000f4e0000613d0000045f0010019800000f660000c13d000000000001042d000000000100001900001042000104300000049201000041000000000010043f000004710100004100001042000104300004000000000002000000400b00043d0000006404b00039000000800800003900000000008404350000004404b000390000000000240435000004a00200004100000000002b0435000000000200041100000415022001970000000404b0003900000000002404350000002402b0003900000000000204350000008404b0003900000000230304340000000000340435000000a404b00039000000000003004b00000f870000613d000000000500001900000000064500190000000007520019000000000707043300000000007604350000002005500039000000000035004b00000f800000413d0000000002430019000000000002043500000000040004140000041502100197000000040020008c00000f950000c13d0000000005000415000000040550008a00000005055002100000000103000031000000200030008c0000002004000039000000000403401900000fca0000013d000100000008001d0000001f013000390000049901100197000000a401100039000004110010009c000004110100804100000060011002100000041100b0009c000004110300004100000000030b40190000004003300210000000000131019f000004110040009c0000041104008041000000c003400210000000000113019f00020000000b001d104010360000040f000000020b00002900000060031002700000041103300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000000057b001900000fb70000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b00000fb30000c13d000000000006004b00000fc40000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f0000000005000415000000030550008a0000000505500210000000010020019000000fe30000613d0000001f01400039000000600210018f0000000001b20019000000000021004b000000000200003900000001020040390000041c0010009c000010150000213d0000000100200190000010150000c13d000000400010043f0000001f0030008c00000fe10000a13d00000000010b0433000004940010019800000fe10000c13d0000000502500270000000000201001f0000049501100197000004a00010009c00000000010000390000000101006039000000000001042d00000000010000190000104200010430000000000003004b00000fe70000c13d00000060020000390000100e0000013d0000001f02300039000004a1022001970000003f02200039000004a204200197000000400200043d0000000004420019000000000024004b000000000500003900000001050040390000041c0040009c000010150000213d0000000100500190000010150000c13d000000400040043f0000001f0430018f0000000006320436000004a305300198000100000006001d0000000003560019000010010000613d000000000601034f0000000107000029000000006806043c0000000007870436000000000037004b00000ffd0000c13d000000000004004b0000100e0000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000000001020433000000000001004b0000101b0000c13d0000048801000041000000000010043f000004710100004100001042000104300000047501000041000000000010043f0000004101000039000000040010043f000004760100004100001042000104300000000102000029000004110020009c00000411020080410000004002200210000004110010009c00000411010080410000006001100210000000000121019f0000104200010430000000000001042f0000000002000414000004110020009c0000041102008041000000c002200210000004110010009c00000411010080410000004001100210000000000121019f0000045e011001c700008010020000391040103b0000040f0000000100200190000010340000613d000000000101043b000000000001042d0000000001000019000010420001043000001039002104210000000102000039000000000001042d0000000002000019000000000001042d0000103e002104230000000102000039000000000001042d0000000002000019000000000001042d0000104000000432000010410001042e0000104200010430000000000000000000000000000000000000000000000000000000000000000000000000ffffffff426f6f6765727300000000000000000000000000000000000000000000000000424f4f4700000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffff02000000000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e000000000000000000000000000000000000000000000000100000000000000003da8a5f161a6c3ff06a60736d0ed24d7963cc6a5c4fafd2fa1dae9bb908e07a5c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b3da8a5f161a6c3ff06a60736d0ed24d7963cc6a5c4fafd2fa1dae9bb908e07a4000000000000000000000000000000000000000000000000ffffffffffffffff75ca53043ea007e5c65182cbb028f60d7179ff4b55739a3949b401801c942e658a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b75ca53043ea007e5c65182cbb028f60d7179ff4b55739a3949b401801c942e640000000000000000000000000000000000000000000000000018838370f34000e497b8238be5e4f32f72d877ba0627e627848cb8a6504aa01d21a347d565198e1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae67468747470733a2f2f7777772e574542534954452e78797a2f6170692f746f6b651b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae6726e732f00000000000000000000000000000000000000000000000000000000001b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae67300000002000000000000000000000000000000400000010000000000000000001e4fbdf7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000001000000000000000000000000000000000000000000000000000000000000000000000000005bbb21760000000000000000000000000000000000000000000000000000000099a2557900000000000000000000000000000000000000000000000000000000c23dc68e00000000000000000000000000000000000000000000000000000000d28d885100000000000000000000000000000000000000000000000000000000d28d885200000000000000000000000000000000000000000000000000000000e985e9c500000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000c23dc68f00000000000000000000000000000000000000000000000000000000c87b56dd00000000000000000000000000000000000000000000000000000000b88d4fdd00000000000000000000000000000000000000000000000000000000b88d4fde00000000000000000000000000000000000000000000000000000000ba81678f0000000000000000000000000000000000000000000000000000000099a2557a00000000000000000000000000000000000000000000000000000000a22cb46500000000000000000000000000000000000000000000000000000000715018a5000000000000000000000000000000000000000000000000000000008da5cb5a000000000000000000000000000000000000000000000000000000008da5cb5b0000000000000000000000000000000000000000000000000000000095d89b4100000000000000000000000000000000000000000000000000000000715018a6000000000000000000000000000000000000000000000000000000008462151c000000000000000000000000000000000000000000000000000000006c0360ea000000000000000000000000000000000000000000000000000000006c0360eb0000000000000000000000000000000000000000000000000000000070a08231000000000000000000000000000000000000000000000000000000005bbb2177000000000000000000000000000000000000000000000000000000006352211e0000000000000000000000000000000000000000000000000000000023b872dc0000000000000000000000000000000000000000000000000000000042966c670000000000000000000000000000000000000000000000000000000055f804b20000000000000000000000000000000000000000000000000000000055f804b300000000000000000000000000000000000000000000000000000000564566a80000000000000000000000000000000000000000000000000000000042966c680000000000000000000000000000000000000000000000000000000044a0d68a000000000000000000000000000000000000000000000000000000003b4c4b24000000000000000000000000000000000000000000000000000000003b4c4b250000000000000000000000000000000000000000000000000000000042842e0e0000000000000000000000000000000000000000000000000000000023b872dd000000000000000000000000000000000000000000000000000000002c52619600000000000000000000000000000000000000000000000000000000095ea7b20000000000000000000000000000000000000000000000000000000018160ddc0000000000000000000000000000000000000000000000000000000018160ddd0000000000000000000000000000000000000000000000000000000022f4596f00000000000000000000000000000000000000000000000000000000095ea7b30000000000000000000000000000000000000000000000000000000013faede60000000000000000000000000000000000000000000000000000000006fdde020000000000000000000000000000000000000000000000000000000006fdde0300000000000000000000000000000000000000000000000000000000081812fc0000000000000000000000000000000000000000000000000000000000b3b5c70000000000000000000000000000000000000000000000000000000001ffc9a7118cdaa70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000008000000000000000000000000000000000000000000000000000000020000000000000000000000000d7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5020000000000000000000000000000000000004000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000000000000000000000000000000000000000004ee2d6d415b85acef810000000000000000000000000000000000000000000004ee2d6d415b85acef80ffffffff000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000ffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000005f5e10000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff30313233343536373839616263646566000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000006e6578697374656e7420746f6b656e00000000000000000000000000000000004552433732314d657461646174613a2055524920717565727920666f72206e6f08c379a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000840000000000000000000000000000000000000000000000000000000000000080000000000000000000000000020000000000000000000000000000000000002000000000000000000000000017307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3132c1995a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff7f000000000000000000000000000000000000002000000080000000000000000000000000000000000000000000000000000000000000003fffffffffffffffe04e487b7100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000007fffffffffffff60000000000000000000000000000000000000000000000000000000000ffffffe497b8238be5e4f32f72d877ba0627e627848cb8a6504aa01d21a347d565198d59c896be00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffff00000000000000000000000000000001796b89b91644bc98cd93958e4c9038275d622183e25ac5af08cc6b5d95539132020000020000000000000000000000000000000400000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef000000000000000000000000000000000000000000000000ffffffffffffffdffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffff1806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b830200000200000000000000000000000000000024000000000000000000000000496e73756666696369656e74205061796d656e7400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000000000010000000000000001d1a57ed600000000000000000000000000000000000000000000000000000000b562e8dd000000000000000000000000000000000000000000000000000000004d6178696d756d20737570706c792072656163686564000000000000000000008f4eb6040000000000000000000000000000000000000000000000000000000053616c65206973206e6f7420616374697665000000000000000000000000000000000000000000000000000000000000000000640000008000000000000000003ee5aeb5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000800000000000000000cfb3b942000000000000000000000000000000000000000000000000000000008c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925df2d9b4200000000000000000000000000000000000000000000000000000000cf4700e40000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000001ffc9a7000000000000000000000000000000000000000000000000000000005b5e139f0000000000000000000000000000000000000000000000000000000080ac58cd00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffffe0a114810000000000000000000000000000000000000000000000000000000000ea553b3400000000000000000000000000000000000000000000000000000000150b7a020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000003ffffffe000000000000000000000000000000000000000000000000000000000ffffffe0000000000000000000000000000000000000000000000000ffffffffffffff802e076300000000000000000000000000000000000000000000000000000000006e96592ffc361b9d3653b54fcaee71d36836b6ce80f377ec66abb587e3f15ccc
Loading...
Loading
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.