ETH Price: $2,385.26 (+2.03%)

Contract

0x0C6E6Bb5d22d9c27F7375F50C4d1b4E14bd9411f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Mint159915142022-11-17 18:24:23686 days ago1668709463IN
0x0C6E6Bb5...14bd9411f
0 ETH0.000659627.27888268
0x60806040159861502022-11-17 0:26:23687 days ago1668644783IN
 Create: DeadLinkz
0 ETH0.0333939915.52811248

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DeadLinkz

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 20 : DeadLinkz.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC721AQueryableUpgradeable, ERC721AUpgradeable, IERC721AUpgradeable} from "@erc721a-upgradable/extensions/ERC721AQueryableUpgradeable.sol";
import {Ownable} from "@solidstate-solidity/access/ownable/Ownable.sol";
import {ECDSA} from "@solady/utils/ECDSA.sol";
import {DeadLinkzStorage} from "./DeadLinkzStorage.sol";
import {IDeadLinkz} from "./IDeadLinkz.sol";

contract DeadLinkz is IDeadLinkz, ERC721AQueryableUpgradeable, Ownable {
    using ECDSA for bytes32;

    /// @notice Maximum supply of the mint passes
    uint256 public constant MAX_SUPPLY = 4004;

    /**
     * @notice Initialize the implementation
     */
    function initialize(string memory baseUri_, address signer_)
        public
        initializerERC721A
    {
        __ERC721A_init("D3ADLINKZ", "D3AD");
        __ERC721AQueryable_init();
        DeadLinkzStorage.layout().signer = signer_;
        DeadLinkzStorage.layout().maxMintQuantity = 1;
        setBaseUri(baseUri_);
    }

    /**
     * @notice Mint an NFT
     */
    function mint(uint256 quantity, bytes calldata signature)
        public
        payable
        insideTotalSupply(quantity)
        onlyEoa
    {
        if (!DeadLinkzStorage.layout().publicSale) {
            require(
                DeadLinkzStorage.layout().whitelistSale,
                "Whitelist not open"
            );
            bytes32 data = keccak256(abi.encodePacked(msg.sender, quantity));
            address signer_ = data.toEthSignedMessageHash().recover(signature);
            require(DeadLinkzStorage.layout().signer == signer_, "Not allowed");
        }
        require(
            DeadLinkzStorage.layout().addressNumMints[msg.sender] + quantity <=
                DeadLinkzStorage.layout().maxMintQuantity,
            "Minting above wallet limit"
        );
        DeadLinkzStorage.layout().addressNumMints[msg.sender] += quantity;
        _mint(msg.sender, quantity);
    }

    modifier onlyEoa() {
        require(tx.origin == msg.sender, "Not EOA");
        _;
    }

    /**
     * @notice Mint as an admin
     * @param recipient Mint recipient
     * @param quantity Mint quantity
     */
    function mintAsAdmin(address recipient, uint256 quantity)
        public
        onlyOwner
        insideTotalSupply(quantity)
    {
        _mint(recipient, quantity);
    }

    modifier insideTotalSupply(uint256 _quantity) {
        require(_totalMinted() + _quantity <= MAX_SUPPLY, "Above total supply");
        _;
    }

    /**
     * @notice Set the base token URI
     */
    function setBaseUri(string memory baseURI_) public onlyOwner {
        DeadLinkzStorage.layout().baseURI = baseURI_;
    }

    /**
     * @dev Base token URI
     */
    function _baseURI() internal view virtual override returns (string memory) {
        return DeadLinkzStorage.layout().baseURI;
    }

    /**
     * @notice Return the token URI for an NFT
     * @param tokenId Token ID
     */
    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        override(ERC721AUpgradeable, IERC721AUpgradeable)
        returns (string memory)
    {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
        string memory baseURI = _baseURI();
        string memory result = string(
            abi.encodePacked(baseURI, _toString(tokenId), ".json")
        );
        return bytes(baseURI).length != 0 ? result : "";
    }

    /**
     * @notice Toggle the public sale
     */
    function toggleSale() public onlyOwner {
        bool lastState = DeadLinkzStorage.layout().publicSale;
        DeadLinkzStorage.layout().publicSale = !lastState;
    }

    function getPublicSale() public view returns (bool) {
        return DeadLinkzStorage.layout().publicSale;
    }

    /**
     * @notice Toggle the whitelist sale
     */
    function toggleWhitelistSale() public onlyOwner {
        bool lastState = DeadLinkzStorage.layout().whitelistSale;
        DeadLinkzStorage.layout().whitelistSale = !lastState;
    }

    function getWhitelistSale() public view returns (bool) {
        return DeadLinkzStorage.layout().whitelistSale;
    }

    /**
     * @notice Set the maximum mints per wallet
     * @param quantity Maximum quantity
     */
    function setMaxMintQuantity(uint256 quantity) public onlyOwner {
        DeadLinkzStorage.layout().maxMintQuantity = quantity;
    }

    /**
     * @dev Returns the starting token ID.
     */
    function _startTokenId()
        internal
        view
        virtual
        override(ERC721AUpgradeable)
        returns (uint256)
    {
        return 1;
    }
}

File 2 of 20 : ERC721AStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library ERC721AStorage {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    struct Layout {
        // =============================================================
        //                            STORAGE
        // =============================================================

        // The next token ID to be minted.
        uint256 _currentIndex;
        // The number of tokens burned.
        uint256 _burnCounter;
        // Token name
        string _name;
        // Token symbol
        string _symbol;
        // Mapping from token ID to ownership details
        // An empty struct value does not necessarily mean the token is unowned.
        // See {_packedOwnershipOf} implementation for details.
        //
        // Bits Layout:
        // - [0..159]   `addr`
        // - [160..223] `startTimestamp`
        // - [224]      `burned`
        // - [225]      `nextInitialized`
        // - [232..255] `extraData`
        mapping(uint256 => uint256) _packedOwnerships;
        // Mapping owner address to address data.
        //
        // Bits Layout:
        // - [0..63]    `balance`
        // - [64..127]  `numberMinted`
        // - [128..191] `numberBurned`
        // - [192..255] `aux`
        mapping(address => uint256) _packedAddressData;
        // Mapping from token ID to approved address.
        mapping(uint256 => ERC721AStorage.TokenApprovalRef) _tokenApprovals;
        // Mapping from owner to operator approvals
        mapping(address => mapping(address => bool)) _operatorApprovals;
    }

    bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.ERC721A');

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }
}

File 3 of 20 : ERC721AUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721AUpgradeable.sol';
import {ERC721AStorage} from './ERC721AStorage.sol';
import './ERC721A__Initializable.sol';

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721ReceiverUpgradeable {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721AUpgradeable is ERC721A__Initializable, IERC721AUpgradeable {
    using ERC721AStorage for ERC721AStorage.Layout;

    // =============================================================
    //                           CONSTANTS
    // =============================================================

    // Mask of an entry in packed address data.
    uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant _BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant _BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant _BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant _BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant _BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;

    // The bit position of `extraData` in packed ownership.
    uint256 private constant _BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

    function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializingERC721A {
        __ERC721A_init_unchained(name_, symbol_);
    }

    function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializingERC721A {
        ERC721AStorage.layout()._name = name_;
        ERC721AStorage.layout()._symbol = symbol_;
        ERC721AStorage.layout()._currentIndex = _startTokenId();
    }

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return ERC721AStorage.layout()._currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return ERC721AStorage.layout()._currentIndex - ERC721AStorage.layout()._burnCounter - _startTokenId();
        }
    }

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view virtual returns (uint256) {
        // Counter underflow is impossible as `_currentIndex` does not decrement,
        // and it is initialized to `_startTokenId()`.
        unchecked {
            return ERC721AStorage.layout()._currentIndex - _startTokenId();
        }
    }

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return ERC721AStorage.layout()._burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return ERC721AStorage.layout()._packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return
            (ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return
            (ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return uint64(ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_AUX);
    }

    /**
     * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal virtual {
        uint256 packed = ERC721AStorage.layout()._packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
        ERC721AStorage.layout()._packedAddressData[owner] = packed;
    }

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes
        // of the XOR of all function selectors in the interface.
        // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
        // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() public view virtual override returns (string memory) {
        return ERC721AStorage.layout()._name;
    }

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return ERC721AStorage.layout()._symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        string memory baseURI = _baseURI();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(ERC721AStorage.layout()._packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal virtual {
        if (ERC721AStorage.layout()._packedOwnerships[index] == 0) {
            ERC721AStorage.layout()._packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {
        if (_startTokenId() <= tokenId) {
            packed = ERC721AStorage.layout()._packedOwnerships[tokenId];
            // If not burned.
            if (packed & _BITMASK_BURNED == 0) {
                // If the data at the starting slot does not exist, start the scan.
                if (packed == 0) {
                    if (tokenId >= ERC721AStorage.layout()._currentIndex) revert OwnerQueryForNonexistentToken();
                    // Invariant:
                    // There will always be an initialized ownership slot
                    // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                    // before an unintialized ownership slot
                    // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                    // Hence, `tokenId` will not underflow.
                    //
                    // We can directly compare the packed value.
                    // If the address is zero, packed will be zero.
                    for (;;) {
                        unchecked {
                            packed = ERC721AStorage.layout()._packedOwnerships[--tokenId];
                        }
                        if (packed == 0) continue;
                        return packed;
                    }
                }
                // Otherwise, the data exists and is not burned. We can skip the scan.
                // This is possible because we have already achieved the target condition.
                // This saves 2143 gas on transfers of initialized tokens.
                return packed;
            }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
        ownership.burned = packed & _BITMASK_BURNED != 0;
        ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
            result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
        }
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
            result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     */
    function approve(address to, uint256 tokenId) public payable virtual override {
        _approve(to, tokenId, true);
    }

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return ERC721AStorage.layout()._tokenApprovals[tokenId].value;
    }

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom}
     * for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        ERC721AStorage.layout()._operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return ERC721AStorage.layout()._operatorApprovals[owner][operator];
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < ERC721AStorage.layout()._currentIndex && // If within bounds,
            ERC721AStorage.layout()._packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, _BITMASK_ADDRESS)
            // `msgSender == owner || msgSender == approvedAddress`.
            result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        ERC721AStorage.TokenApprovalRef storage tokenApproval = ERC721AStorage.layout()._tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();

        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // We can directly increment and decrement the balances.
            --ERC721AStorage.layout()._packedAddressData[from]; // Updates: `balance -= 1`.
            ++ERC721AStorage.layout()._packedAddressData[to]; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData(
                to,
                _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != ERC721AStorage.layout()._currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public payable virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token IDs
     * are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token IDs
     * have been transferred. This includes minting.
     * And also called after one token has been burned.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * `from` - Previous owner of the given token ID.
     * `to` - Target address that will receive the token.
     * `tokenId` - Token ID to be transferred.
     * `_data` - Optional data to send along with the call.
     *
     * Returns whether the call correctly returned the expected magic value.
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try
            ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data)
        returns (bytes4 retval) {
            return retval == ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _mint(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = ERC721AStorage.layout()._currentIndex;
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            // The duplicated `log4` removes an extra check and reduces stack juggling.
            // The assembly, together with the surrounding Solidity code, have been
            // delicately arranged to nudge the compiler into producing optimized opcodes.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    startTokenId // `tokenId`.
                )

                // The `iszero(eq(,))` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
                // The compiler will optimize the `iszero` away for performance.
                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

            ERC721AStorage.layout()._currentIndex = end;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = ERC721AStorage.layout()._currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

            ERC721AStorage.layout()._currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * See {_mint}.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        _mint(to, quantity);

        unchecked {
            if (to.code.length != 0) {
                uint256 end = ERC721AStorage.layout()._currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (ERC721AStorage.layout()._currentIndex != end) revert();
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, '');
    }

    // =============================================================
    //                       APPROVAL OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_approve(to, tokenId, false)`.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _approve(to, tokenId, false);
    }

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the
     * zero address clears previous approvals.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function _approve(
        address to,
        uint256 tokenId,
        bool approvalCheck
    ) internal virtual {
        address owner = ownerOf(tokenId);

        if (approvalCheck)
            if (_msgSenderERC721A() != owner)
                if (!isApprovedForAll(owner, _msgSenderERC721A())) {
                    revert ApprovalCallerNotOwnerNorApproved();
                }

        ERC721AStorage.layout()._tokenApprovals[tokenId].value = to;
        emit Approval(owner, to, tokenId);
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        address from = address(uint160(prevOwnershipPacked));

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
            ERC721AStorage.layout()._packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData(
                from,
                (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != ERC721AStorage.layout()._currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            ERC721AStorage.layout()._burnCounter++;
        }
    }

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
        uint256 packed = ERC721AStorage.layout()._packedOwnerships[index];
        if (packed == 0) revert OwnershipNotInitializedForExtraData();
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
        ERC721AStorage.layout()._packedOwnerships[index] = packed;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
    }

    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value) internal pure virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
            let m := add(mload(0x40), 0xa0)
            // Update the free memory pointer to allocate.
            mstore(0x40, m)
            // Assign the `str` to the end.
            str := sub(m, 0x20)
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // prettier-ignore
            for { let temp := value } 1 {} {
                str := sub(str, 1)
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }
}

File 4 of 20 : ERC721A__Initializable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable diamond facet contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */

import {ERC721A__InitializableStorage} from './ERC721A__InitializableStorage.sol';

abstract contract ERC721A__Initializable {
    using ERC721A__InitializableStorage for ERC721A__InitializableStorage.Layout;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializerERC721A() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(
            ERC721A__InitializableStorage.layout()._initializing
                ? _isConstructor()
                : !ERC721A__InitializableStorage.layout()._initialized,
            'ERC721A__Initializable: contract is already initialized'
        );

        bool isTopLevelCall = !ERC721A__InitializableStorage.layout()._initializing;
        if (isTopLevelCall) {
            ERC721A__InitializableStorage.layout()._initializing = true;
            ERC721A__InitializableStorage.layout()._initialized = true;
        }

        _;

        if (isTopLevelCall) {
            ERC721A__InitializableStorage.layout()._initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializingERC721A() {
        require(
            ERC721A__InitializableStorage.layout()._initializing,
            'ERC721A__Initializable: contract is not initializing'
        );
        _;
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        // extcodesize checks the size of the code stored in an address, and
        // address returns the current address. Since the code is still not
        // deployed when running a constructor, any checks on its code size will
        // yield zero, making it an effective way to detect if a contract is
        // under construction or not.
        address self = address(this);
        uint256 cs;
        assembly {
            cs := extcodesize(self)
        }
        return cs == 0;
    }
}

File 5 of 20 : ERC721A__InitializableStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This is a base storage for the  initialization function for upgradeable diamond facet contracts
 **/

library ERC721A__InitializableStorage {
    struct Layout {
        /*
         * Indicates that the contract has been initialized.
         */
        bool _initialized;
        /*
         * Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.initializable.facet');

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }
}

File 6 of 20 : IERC721AUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721AUpgradeable {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables
     * (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`,
     * checking first that contract recipients are aware of the ERC721 protocol
     * to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move
     * this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external payable;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom}
     * whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the
     * zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external payable;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom}
     * for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

File 7 of 20 : ERC721AQueryableUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721AQueryableUpgradeable.sol';
import '../ERC721AUpgradeable.sol';
import '../ERC721A__Initializable.sol';

/**
 * @title ERC721AQueryable.
 *
 * @dev ERC721A subclass with convenience query functions.
 */
abstract contract ERC721AQueryableUpgradeable is
    ERC721A__Initializable,
    ERC721AUpgradeable,
    IERC721AQueryableUpgradeable
{
    function __ERC721AQueryable_init() internal onlyInitializingERC721A {
        __ERC721AQueryable_init_unchained();
    }

    function __ERC721AQueryable_init_unchained() internal onlyInitializingERC721A {}

    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) {
        TokenOwnership memory ownership;
        if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) {
            return ownership;
        }
        ownership = _ownershipAt(tokenId);
        if (ownership.burned) {
            return ownership;
        }
        return _ownershipOf(tokenId);
    }

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] calldata tokenIds)
        external
        view
        virtual
        override
        returns (TokenOwnership[] memory)
    {
        unchecked {
            uint256 tokenIdsLength = tokenIds.length;
            TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);
            for (uint256 i; i != tokenIdsLength; ++i) {
                ownerships[i] = explicitOwnershipOf(tokenIds[i]);
            }
            return ownerships;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view virtual override returns (uint256[] memory) {
        unchecked {
            if (start >= stop) revert InvalidQueryRange();
            uint256 tokenIdsIdx;
            uint256 stopLimit = _nextTokenId();
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            // Set `stop = min(stop, stopLimit)`.
            if (stop > stopLimit) {
                stop = stopLimit;
            }
            uint256 tokenIdsMaxLength = balanceOf(owner);
            // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
            // to cater for cases where `balanceOf(owner)` is too big.
            if (start < stop) {
                uint256 rangeLength = stop - start;
                if (rangeLength < tokenIdsMaxLength) {
                    tokenIdsMaxLength = rangeLength;
                }
            } else {
                tokenIdsMaxLength = 0;
            }
            uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);
            if (tokenIdsMaxLength == 0) {
                return tokenIds;
            }
            // We need to call `explicitOwnershipOf(start)`,
            // because the slot at `start` may not be initialized.
            TokenOwnership memory ownership = explicitOwnershipOf(start);
            address currOwnershipAddr;
            // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`.
            // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range.
            if (!ownership.burned) {
                currOwnershipAddr = ownership.addr;
            }
            for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            // Downsize the array to fit.
            assembly {
                mstore(tokenIds, tokenIdsIdx)
            }
            return tokenIds;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {
        unchecked {
            uint256 tokenIdsIdx;
            address currOwnershipAddr;
            uint256 tokenIdsLength = balanceOf(owner);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            TokenOwnership memory ownership;
            for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            return tokenIds;
        }
    }
}

File 8 of 20 : IERC721AQueryableUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721AUpgradeable.sol';

/**
 * @dev Interface of ERC721AQueryable.
 */
interface IERC721AQueryableUpgradeable is IERC721AUpgradeable {
    /**
     * Invalid query range (`start` >= `stop`).
     */
    error InvalidQueryRange();

    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view returns (uint256[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view returns (uint256[] memory);
}

File 9 of 20 : ECDSA.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Gas optimized ECDSA wrapper.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/ECDSA.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ECDSA.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol)
library ECDSA {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         CONSTANTS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The number which `s` must not exceed in order for
    /// the signature to be non-malleable.
    bytes32 private constant _MALLEABILITY_THRESHOLD =
        0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                    RECOVERY OPERATIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Recovers the signer's address from a message digest `hash`,
    /// and the `signature`.
    ///
    /// This function does NOT accept EIP-2098 short form signatures.
    /// Use `recover(bytes32 hash, bytes32 r, bytes32 vs)` for EIP-2098
    /// short form signatures instead.
    ///
    /// WARNING!
    /// The `result` will be the zero address upon recovery failure.
    /// As such, it is extremely important to ensure that the address which
    /// the `result` is compared against is never zero.
    function recover(bytes32 hash, bytes calldata signature) internal view returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            if eq(signature.length, 65) {
                // Copy the free memory pointer so that we can restore it later.
                let m := mload(0x40)
                // Directly copy `r` and `s` from the calldata.
                calldatacopy(0x40, signature.offset, 0x40)

                // If `s` in lower half order, such that the signature is not malleable.
                if iszero(gt(mload(0x60), _MALLEABILITY_THRESHOLD)) {
                    mstore(0x00, hash)
                    // Compute `v` and store it in the scratch space.
                    mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40))))
                    pop(
                        staticcall(
                            gas(), // Amount of gas left for the transaction.
                            0x01, // Address of `ecrecover`.
                            0x00, // Start of input.
                            0x80, // Size of input.
                            0x40, // Start of output.
                            0x20 // Size of output.
                        )
                    )
                    // Restore the zero slot.
                    mstore(0x60, 0)
                    // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
                    result := mload(sub(0x60, returndatasize()))
                }
                // Restore the free memory pointer.
                mstore(0x40, m)
            }
        }
    }

    /// @dev Recovers the signer's address from a message digest `hash`,
    /// and the EIP-2098 short form signature defined by `r` and `vs`.
    ///
    /// This function only accepts EIP-2098 short form signatures.
    /// See: https://eips.ethereum.org/EIPS/eip-2098
    ///
    /// To be honest, I do not recommend using EIP-2098 signatures
    /// for simplicity, performance, and security reasons. Most if not
    /// all clients support traditional non EIP-2098 signatures by default.
    /// As such, this method is intentionally not fully inlined.
    /// It is merely included for completeness.
    ///
    /// WARNING!
    /// The `result` will be the zero address upon recovery failure.
    /// As such, it is extremely important to ensure that the address which
    /// the `result` is compared against is never zero.
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal view returns (address result) {
        uint8 v;
        bytes32 s;
        /// @solidity memory-safe-assembly
        assembly {
            s := shr(1, shl(1, vs))
            v := add(shr(255, vs), 27)
        }
        result = recover(hash, v, r, s);
    }

    /// @dev Recovers the signer's address from a message digest `hash`,
    /// and the signature defined by `v`, `r`, `s`.
    ///
    /// WARNING!
    /// The `result` will be the zero address upon recovery failure.
    /// As such, it is extremely important to ensure that the address which
    /// the `result` is compared against is never zero.
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal view returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            // Copy the free memory pointer so that we can restore it later.
            let m := mload(0x40)

            // If `s` in lower half order, such that the signature is not malleable.
            if iszero(gt(s, _MALLEABILITY_THRESHOLD)) {
                mstore(0x00, hash)
                mstore(0x20, v)
                mstore(0x40, r)
                mstore(0x60, s)
                pop(
                    staticcall(
                        gas(), // Amount of gas left for the transaction.
                        0x01, // Address of `ecrecover`.
                        0x00, // Start of input.
                        0x80, // Size of input.
                        0x40, // Start of output.
                        0x20 // Size of output.
                    )
                )
                // Restore the zero slot.
                mstore(0x60, 0)
                // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
                result := mload(sub(0x60, returndatasize()))
            }
            // Restore the free memory pointer.
            mstore(0x40, m)
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                     HASHING OPERATIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns an Ethereum Signed Message, created from a `hash`.
    /// This produces a hash corresponding to the one signed with the
    /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign)
    /// JSON-RPC method as part of EIP-191.
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            // Store into scratch space for keccak256.
            mstore(0x20, hash)
            mstore(0x00, "\x00\x00\x00\x00\x19Ethereum Signed Message:\n32")
            // 0x40 - 0x04 = 0x3c
            result := keccak256(0x04, 0x3c)
        }
    }

    /// @dev Returns an Ethereum Signed Message, created from `s`.
    /// This produces a hash corresponding to the one signed with the
    /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign)
    /// JSON-RPC method as part of EIP-191.
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32 result) {
        assembly {
            // We need at most 128 bytes for Ethereum signed message header.
            // The max length of the ASCII reprenstation of a uint256 is 78 bytes.
            // The length of "\x19Ethereum Signed Message:\n" is 26 bytes (i.e. 0x1a).
            // The next multiple of 32 above 78 + 26 is 128 (i.e. 0x80).

            // Instead of allocating, we temporarily copy the 128 bytes before the
            // start of `s` data to some variables.
            let m3 := mload(sub(s, 0x60))
            let m2 := mload(sub(s, 0x40))
            let m1 := mload(sub(s, 0x20))
            // The length of `s` is in bytes.
            let sLength := mload(s)

            let ptr := add(s, 0x20)

            // `end` marks the end of the memory which we will compute the keccak256 of.
            let end := add(ptr, sLength)

            // Convert the length of the bytes to ASCII decimal representation
            // and store it into the memory.
            // prettier-ignore
            for { let temp := sLength } 1 {} {
                ptr := sub(ptr, 1)
                mstore8(ptr, add(48, mod(temp, 10)))
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

            // Copy the header over to the memory.
            mstore(sub(ptr, 0x20), "\x00\x00\x00\x00\x00\x00\x19Ethereum Signed Message:\n")
            // Compute the keccak256 of the memory.
            result := keccak256(sub(ptr, 0x1a), sub(end, sub(ptr, 0x1a)))

            // Restore the previous memory.
            mstore(s, sLength)
            mstore(sub(s, 0x20), m1)
            mstore(sub(s, 0x40), m2)
            mstore(sub(s, 0x60), m3)
        }
    }
}

File 10 of 20 : IOwnable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.8;

import { IERC173 } from '../../interfaces/IERC173.sol';

interface IOwnable is IERC173 {}

File 11 of 20 : IOwnableInternal.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.8;

import { IERC173Internal } from '../../interfaces/IERC173Internal.sol';

interface IOwnableInternal is IERC173Internal {
    error Ownable__NotOwner();
    error Ownable__NotTransitiveOwner();
}

File 12 of 20 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.8;

import { IERC173 } from '../../interfaces/IERC173.sol';
import { IOwnable } from './IOwnable.sol';
import { OwnableInternal } from './OwnableInternal.sol';
import { OwnableStorage } from './OwnableStorage.sol';

/**
 * @title Ownership access control based on ERC173
 */
abstract contract Ownable is IOwnable, OwnableInternal {
    using OwnableStorage for OwnableStorage.Layout;

    /**
     * @inheritdoc IERC173
     */
    function owner() public view virtual returns (address) {
        return _owner();
    }

    /**
     * @inheritdoc IERC173
     */
    function transferOwnership(address account) public virtual onlyOwner {
        _transferOwnership(account);
    }
}

File 13 of 20 : OwnableInternal.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.8;

import { IERC173 } from '../../interfaces/IERC173.sol';
import { AddressUtils } from '../../utils/AddressUtils.sol';
import { IOwnableInternal } from './IOwnableInternal.sol';
import { OwnableStorage } from './OwnableStorage.sol';

abstract contract OwnableInternal is IOwnableInternal {
    using AddressUtils for address;
    using OwnableStorage for OwnableStorage.Layout;

    modifier onlyOwner() {
        if (msg.sender != _owner()) revert Ownable__NotOwner();
        _;
    }

    modifier onlyTransitiveOwner() {
        if (msg.sender != _transitiveOwner())
            revert Ownable__NotTransitiveOwner();
        _;
    }

    function _owner() internal view virtual returns (address) {
        return OwnableStorage.layout().owner;
    }

    function _transitiveOwner() internal view virtual returns (address) {
        address owner = _owner();

        while (owner.isContract()) {
            try IERC173(owner).owner() returns (address transitiveOwner) {
                owner = transitiveOwner;
            } catch {
                return owner;
            }
        }

        return owner;
    }

    function _transferOwnership(address account) internal virtual {
        OwnableStorage.layout().setOwner(account);
        emit OwnershipTransferred(msg.sender, account);
    }
}

File 14 of 20 : OwnableStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.8;

library OwnableStorage {
    struct Layout {
        address owner;
    }

    bytes32 internal constant STORAGE_SLOT =
        keccak256('solidstate.contracts.storage.Ownable');

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }

    function setOwner(Layout storage l, address owner) internal {
        l.owner = owner;
    }
}

File 15 of 20 : IERC173.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.8;

import { IERC173Internal } from './IERC173Internal.sol';

/**
 * @title Contract ownership standard interface
 * @dev see https://eips.ethereum.org/EIPS/eip-173
 */
interface IERC173 is IERC173Internal {
    /**
     * @notice get the ERC173 contract owner
     * @return conrtact owner
     */
    function owner() external view returns (address);

    /**
     * @notice transfer contract ownership to new account
     * @param account address of new owner
     */
    function transferOwnership(address account) external;
}

File 16 of 20 : IERC173Internal.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.8;

/**
 * @title Partial ERC173 interface needed by internal functions
 */
interface IERC173Internal {
    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );
}

File 17 of 20 : AddressUtils.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.8;

import { UintUtils } from './UintUtils.sol';

library AddressUtils {
    using UintUtils for uint256;

    error AddressUtils__InsufficientBalance();
    error AddressUtils__NotContract();
    error AddressUtils__SendValueFailed();

    function toString(address account) internal pure returns (string memory) {
        return uint256(uint160(account)).toHexString(20);
    }

    function isContract(address account) internal view returns (bool) {
        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    function sendValue(address payable account, uint256 amount) internal {
        (bool success, ) = account.call{ value: amount }('');
        if (!success) revert AddressUtils__SendValueFailed();
    }

    function functionCall(address target, bytes memory data)
        internal
        returns (bytes memory)
    {
        return
            functionCall(target, data, 'AddressUtils: failed low-level call');
    }

    function functionCall(
        address target,
        bytes memory data,
        string memory error
    ) internal returns (bytes memory) {
        return _functionCallWithValue(target, data, 0, error);
    }

    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return
            functionCallWithValue(
                target,
                data,
                value,
                'AddressUtils: failed low-level call with value'
            );
    }

    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory error
    ) internal returns (bytes memory) {
        if (value > address(this).balance)
            revert AddressUtils__InsufficientBalance();
        return _functionCallWithValue(target, data, value, error);
    }

    function _functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory error
    ) private returns (bytes memory) {
        if (!isContract(target)) revert AddressUtils__NotContract();

        (bool success, bytes memory returnData) = target.call{ value: value }(
            data
        );

        if (success) {
            return returnData;
        } else if (returnData.length > 0) {
            assembly {
                let returnData_size := mload(returnData)
                revert(add(32, returnData), returnData_size)
            }
        } else {
            revert(error);
        }
    }
}

File 18 of 20 : UintUtils.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.8;

/**
 * @title utility functions for uint256 operations
 * @dev derived from https://github.com/OpenZeppelin/openzeppelin-contracts/ (MIT license)
 */
library UintUtils {
    error UintUtils__InsufficientHexLength();

    bytes16 private constant HEX_SYMBOLS = '0123456789abcdef';

    function add(uint256 a, int256 b) internal pure returns (uint256) {
        return b < 0 ? sub(a, -b) : a + uint256(b);
    }

    function sub(uint256 a, int256 b) internal pure returns (uint256) {
        return b < 0 ? add(a, -b) : a - uint256(b);
    }

    function toString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return '0';
        }

        uint256 temp = value;
        uint256 digits;

        while (temp != 0) {
            digits++;
            temp /= 10;
        }

        bytes memory buffer = new bytes(digits);

        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }

        return string(buffer);
    }

    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return '0x00';
        }

        uint256 length = 0;

        for (uint256 temp = value; temp != 0; temp >>= 8) {
            unchecked {
                length++;
            }
        }

        return toHexString(value, length);
    }

    function toHexString(uint256 value, uint256 length)
        internal
        pure
        returns (string memory)
    {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = '0';
        buffer[1] = 'x';

        unchecked {
            for (uint256 i = 2 * length + 1; i > 1; --i) {
                buffer[i] = HEX_SYMBOLS[value & 0xf];
                value >>= 4;
            }
        }

        if (value != 0) revert UintUtils__InsufficientHexLength();

        return string(buffer);
    }
}

File 19 of 20 : DeadLinkzStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

library DeadLinkzStorage {
    struct Layout {
        /// @notice Base URI of the NFT
        string baseURI;
        /// @notice External signer for minting
        address signer;
        /// @notice Whitelist sale
        bool whitelistSale;
        /// @notice Public sale
        bool publicSale;
        /// @notice Maximum per wallet
        uint256 maxMintQuantity;
        /// @notice Number of mints for a wallet
        mapping(address => uint256) addressNumMints;
    }

    bytes32 internal constant STORAGE_SLOT =
        keccak256("deadlinkz.contracts.storage.deadlinkz");

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }
}

File 20 of 20 : IDeadLinkz.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {IERC721AUpgradeable} from "@erc721a-upgradable/IERC721AUpgradeable.sol";

interface IDeadLinkz is IERC721AUpgradeable {
    function mint(uint256 quantity, bytes calldata signature) external payable;
}

Settings
{
  "remappings": [
    "@erc721a-upgradable/=lib/ERC721A-Upgradeable/contracts/",
    "@solady/=lib/solady/src/",
    "@solidstate-solidity/=lib/solidstate-solidity/contracts/",
    "@std/=lib/forge-std/src/",
    "ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "solady/=lib/solady/src/",
    "solidstate-solidity/=lib/solidstate-solidity/contracts/",
    "solmate/=lib/solady/lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"Ownable__NotOwner","type":"error"},{"inputs":[],"name":"Ownable__NotTransitiveOwner","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPublicSale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistSale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"baseUri_","type":"string"},{"internalType":"address","name":"signer_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintAsAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"setMaxMintQuantity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleWhitelistSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506125f1806100206000396000f3fe6080604052600436106101cd5760003560e01c80637d8966e4116100f7578063b88d4fde11610095578063db7fd40811610064578063db7fd4081461051b578063e1b6d92e1461052e578063e985e9c51461054e578063f2fde38b1461056e57600080fd5b8063b88d4fde1461049b578063c23dc68f146104ae578063c87b56dd146104db578063d7ad08d3146104fb57600080fd5b806395d89b41116100d157806395d89b411461042657806399a2557a1461043b578063a0bcfc7f1461045b578063a22cb4651461047b57600080fd5b80637d8966e4146103cf5780638462151c146103e45780638da5cb5b1461041157600080fd5b80633bc996c51161016f5780635bbb21771161013e5780635bbb2177146103425780636352211e1461036f57806370a082311461038f5780637ab4339d146103af57600080fd5b80633bc996c5146102c257806342842e0e146102ee5780634bf530551461030157806359eda1b51461032d57600080fd5b8063095ea7b3116101ab578063095ea7b31461026157806318160ddd1461027657806323b872dd1461029957806332cb6b0c146102ac57600080fd5b806301ffc9a7146101d257806306fdde0314610207578063081812fc14610229575b600080fd5b3480156101de57600080fd5b506101f26101ed366004611df4565b61058e565b60405190151581526020015b60405180910390f35b34801561021357600080fd5b5061021c6105e0565b6040516101fe9190611e61565b34801561023557600080fd5b50610249610244366004611e74565b61067b565b6040516001600160a01b0390911681526020016101fe565b61027461026f366004611ea4565b6106c8565b005b34801561028257600080fd5b5061028b6106d8565b6040519081526020016101fe565b6102746102a7366004611ece565b6106f8565b3480156102b857600080fd5b5061028b610fa481565b3480156102ce57600080fd5b5060008051602061257c83398151915254600160a01b900460ff166101f2565b6102746102fc366004611ece565b6108ef565b34801561030d57600080fd5b5060008051602061257c83398151915254600160a81b900460ff166101f2565b34801561033957600080fd5b5061027461090f565b34801561034e57600080fd5b5061036261035d366004611f0a565b610974565b6040516101fe9190611fba565b34801561037b57600080fd5b5061024961038a366004611e74565b610a3f565b34801561039b57600080fd5b5061028b6103aa366004611ffc565b610a4a565b3480156103bb57600080fd5b506102746103ca3660046120c2565b610ab2565b3480156103db57600080fd5b50610274610c65565b3480156103f057600080fd5b506104046103ff366004611ffc565b610cca565b6040516101fe919061210f565b34801561041d57600080fd5b50610249610dd2565b34801561043257600080fd5b5061021c610de1565b34801561044757600080fd5b50610404610456366004612147565b610df9565b34801561046757600080fd5b5061027461047636600461217a565b610f7f565b34801561048757600080fd5b506102746104963660046121ae565b610fe3565b6102746104a93660046121ea565b611060565b3480156104ba57600080fd5b506104ce6104c9366004611e74565b6110aa565b6040516101fe9190612265565b3480156104e757600080fd5b5061021c6104f6366004611e74565b611137565b34801561050757600080fd5b50610274610516366004611e74565b6111c1565b610274610529366004612273565b61121e565b34801561053a57600080fd5b50610274610549366004611ea4565b611517565b34801561055a57600080fd5b506101f26105693660046122ee565b6115b4565b34801561057a57600080fd5b50610274610589366004611ffc565b6115f1565b60006301ffc9a760e01b6001600160e01b0319831614806105bf57506380ac58cd60e01b6001600160e01b03198316145b806105da5750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606105ea611636565b60020180546105f890612318565b80601f016020809104026020016040519081016040528092919081815260200182805461062490612318565b80156106715780601f1061064657610100808354040283529160200191610671565b820191906000526020600020905b81548152906001019060200180831161065457829003601f168201915b5050505050905090565b60006106868261165a565b6106a3576040516333d1c03960e21b815260040160405180910390fd5b6106ab611636565b60009283526006016020525060409020546001600160a01b031690565b6106d4828260016116a3565b5050565b600060016106e4611636565b600101546106f0611636565b540303919050565b600061070382611758565b9050836001600160a01b0316816001600160a01b0316146107365760405162a1148160e81b815260040160405180910390fd5b60008061074284611805565b9150915061076781876107523390565b6001600160a01b039081169116811491141790565b6107925761077586336115b4565b61079257604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166107b957604051633a954ecd60e21b815260040160405180910390fd5b80156107c457600082555b6107cc611636565b6001600160a01b03871660009081526005919091016020526040902080546000190190556107f8611636565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b1761082f611636565b60008681526004919091016020526040812091909155600160e11b841690036108a5576001840161085e611636565b6000828152600491909101602052604081205490036108a35761087f611636565b5481146108a3578361088f611636565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b61090a83838360405180602001604052806000815250611060565b505050565b61091761182d565b6001600160a01b0316336001600160a01b03161461094857604051632f7a8ee160e01b815260040160405180910390fd5b60008051602061257c8339815191528054600160a01b80820460ff16150260ff60a01b19909116179055565b6060816000816001600160401b0381111561099157610991612017565b6040519080825280602002602001820160405280156109e357816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816109af5790505b50905060005b828114610a3657610a11868683818110610a0557610a05612352565b905060200201356110aa565b828281518110610a2357610a23612352565b60209081029190910101526001016109e9565b50949350505050565b60006105da82611758565b60006001600160a01b038216610a73576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b03610a83611636565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b60008051602061259c83398151915254610100900460ff16610ae75760008051602061259c8339815191525460ff1615610aeb565b303b155b610b625760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a656400000000000000000060648201526084015b60405180910390fd5b60008051602061259c83398151915254610100900460ff16158015610b9e5760008051602061259c833981519152805461ffff19166101011790555b610be5604051806040016040528060098152602001682219a0a22624a725ad60b91b81525060405180604001604052806004815260200163110cd05160e21b81525061185b565b610bed611899565b60008051602061257c83398151915280546001600160a01b0319166001600160a01b03841617905560017f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a94255610c4283610f7f565b801561090a57505060008051602061259c833981519152805461ff001916905550565b610c6d61182d565b6001600160a01b0316336001600160a01b031614610c9e57604051632f7a8ee160e01b815260040160405180910390fd5b60008051602061257c8339815191528054600160a81b80820460ff16150260ff60a81b19909116179055565b60606000806000610cda85610a4a565b90506000816001600160401b03811115610cf657610cf6612017565b604051908082528060200260200182016040528015610d1f578160200160208202803683370190505b509050610d4c60408051608081018252600080825260208201819052918101829052606081019190915290565b60015b838614610dc657610d5f816118d7565b91508160400151610dbe5781516001600160a01b031615610d7f57815194505b876001600160a01b0316856001600160a01b031603610dbe5780838780600101985081518110610db157610db1612352565b6020026020010181815250505b600101610d4f565b50909695505050505050565b6000610ddc61182d565b905090565b6060610deb611636565b60030180546105f890612318565b6060818310610e1b57604051631960ccad60e11b815260040160405180910390fd5b600080610e2661191e565b90506001851015610e3657600194505b80841115610e42578093505b6000610e4d87610a4a565b905084861015610e6c5785850381811015610e66578091505b50610e70565b5060005b6000816001600160401b03811115610e8a57610e8a612017565b604051908082528060200260200182016040528015610eb3578160200160208202803683370190505b50905081600003610ec9579350610f7892505050565b6000610ed4886110aa565b905060008160400151610ee5575080515b885b888114158015610ef75750848714155b15610f6c57610f05816118d7565b92508260400151610f645782516001600160a01b031615610f2557825191505b8a6001600160a01b0316826001600160a01b031603610f645780848880600101995081518110610f5757610f57612352565b6020026020010181815250505b600101610ee7565b50505092835250909150505b9392505050565b610f8761182d565b6001600160a01b0316336001600160a01b031614610fb857604051632f7a8ee160e01b815260040160405180910390fd5b7f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a9406106d482826123ae565b80610fec611636565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61106b8484846106f8565b6001600160a01b0383163b156110a4576110878484848461192e565b6110a4576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6040805160808101825260008082526020820181905291810182905260608101919091526040805160808101825260008082526020820181905291810182905260608101919091526001831080611108575061110461191e565b8310155b156111135792915050565b61111c836118d7565b905080604001511561112e5792915050565b610f7883611a19565b60606111428261165a565b61115f57604051630a14c4b560e41b815260040160405180910390fd5b6000611169611a4e565b905060008161117785611a7c565b60405160200161118892919061246d565b604051602081830303815290604052905081516000036111b757604051806020016040528060008152506111b9565b805b949350505050565b6111c961182d565b6001600160a01b0316336001600160a01b0316146111fa57604051632f7a8ee160e01b815260040160405180910390fd5b7f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a94255565b82610fa48161122b611ac0565b61123591906124ac565b11156112785760405162461bcd60e51b815260206004820152601260248201527141626f766520746f74616c20737570706c7960701b6044820152606401610b59565b3233146112b15760405162461bcd60e51b81526020600482015260076024820152664e6f7420454f4160c81b6044820152606401610b59565b60008051602061257c83398151915254600160a81b900460ff1661141f5760008051602061257c83398151915254600160a01b900460ff1661132a5760405162461bcd60e51b81526020600482015260126024820152712bb434ba32b634b9ba103737ba1037b832b760711b6044820152606401610b59565b6040516bffffffffffffffffffffffff193360601b1660208201526034810185905260009060540160405160208183030381529060405280519060200120905060006113a785856113a0856020527b19457468657265756d205369676e6564204d6573736167653a0a3332600052603c60042090565b9190611ad3565b90506001600160a01b0381167f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a940600101546001600160a01b03161461141c5760405162461bcd60e51b815260206004820152600b60248201526a139bdd08185b1b1bddd95960aa1b6044820152606401610b59565b50505b7f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a942543360009081527f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a943602052604090205461147b9086906124ac565b11156114c95760405162461bcd60e51b815260206004820152601a60248201527f4d696e74696e672061626f76652077616c6c6574206c696d69740000000000006044820152606401610b59565b3360009081527f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a9436020526040812080548692906115079084906124ac565b909155506110a490503385611b42565b61151f61182d565b6001600160a01b0316336001600160a01b03161461155057604051632f7a8ee160e01b815260040160405180910390fd5b80610fa48161155d611ac0565b61156791906124ac565b11156115aa5760405162461bcd60e51b815260206004820152601260248201527141626f766520746f74616c20737570706c7960701b6044820152606401610b59565b61090a8383611b42565b60006115be611636565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b6115f961182d565b6001600160a01b0316336001600160a01b03161461162a57604051632f7a8ee160e01b815260040160405180910390fd5b61163381611c7d565b50565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b6000816001111580156116745750611670611636565b5482105b80156105da5750600160e01b611688611636565b60008481526004919091016020526040902054161592915050565b60006116ae83610a3f565b905081156116ed57336001600160a01b038216146116ed576116d081336115b4565b6116ed576040516367d9dca160e11b815260040160405180910390fd5b836116f6611636565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b6000816001116117ec5761176a611636565b600083815260049190910160205260408120549150600160e01b821690036117ec57806000036117e75761179c611636565b5482106117bc57604051636f96cda160e11b815260040160405180910390fd5b6117c4611636565b6000199092016000818152600493909301602052604090922054905080156117bc575b919050565b604051636f96cda160e11b815260040160405180910390fd5b6000806000611812611636565b60009485526006016020525050604090912080549092909150565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f671680460546001600160a01b031690565b60008051602061259c83398151915254610100900460ff1661188f5760405162461bcd60e51b8152600401610b59906124cd565b6106d48282611cf0565b60008051602061259c83398151915254610100900460ff166118cd5760405162461bcd60e51b8152600401610b59906124cd565b6118d5611d63565b565b6040805160808101825260008082526020820181905291810182905260608101919091526105da611906611636565b60008481526004919091016020526040902054611d97565b6000611928611636565b54919050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611963903390899088908890600401612521565b6020604051808303816000875af192505050801561199e575060408051601f3d908101601f1916820190925261199b9181019061255e565b60015b6119fc573d8080156119cc576040519150601f19603f3d011682016040523d82523d6000602084013e6119d1565b606091505b5080516000036119f4576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6040805160808101825260008082526020820181905291810182905260608101919091526105da611a4983611758565b611d97565b60607f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a94080546105f890612318565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480611a965750819003601f19909101908152919050565b60006001611acc611636565b5403919050565b600060418203610f78576040516040846040377f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a060605111611b385784600052604084013560001a602052602060406080600060015afa5060006060523d6060035191505b6040529392505050565b6000611b4c611636565b5490506000829003611b715760405163b562e8dd60e01b815260040160405180910390fd5b680100000000000000018202611b85611636565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b6001841460e11b1717611bc0611636565b600083815260049190910160205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114611c4a57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101611c12565b5081600003611c6b57604051622e076360e81b815260040160405180910390fd5b80611c74611636565b555061090a9050565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f67168046080546001600160a01b0319166001600160a01b0383161790556040516001600160a01b0382169033907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b60008051602061259c83398151915254610100900460ff16611d245760405162461bcd60e51b8152600401610b59906124cd565b81611d2d611636565b60020190611d3b90826123ae565b5080611d45611636565b60030190611d5390826123ae565b506001611d5e611636565b555050565b60008051602061259c83398151915254610100900460ff166118d55760405162461bcd60e51b8152600401610b59906124cd565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b6001600160e01b03198116811461163357600080fd5b600060208284031215611e0657600080fd5b8135610f7881611dde565b60005b83811015611e2c578181015183820152602001611e14565b50506000910152565b60008151808452611e4d816020860160208601611e11565b601f01601f19169290920160200192915050565b602081526000610f786020830184611e35565b600060208284031215611e8657600080fd5b5035919050565b80356001600160a01b03811681146117e757600080fd5b60008060408385031215611eb757600080fd5b611ec083611e8d565b946020939093013593505050565b600080600060608486031215611ee357600080fd5b611eec84611e8d565b9250611efa60208501611e8d565b9150604084013590509250925092565b60008060208385031215611f1d57600080fd5b82356001600160401b0380821115611f3457600080fd5b818501915085601f830112611f4857600080fd5b813581811115611f5757600080fd5b8660208260051b8501011115611f6c57600080fd5b60209290920196919550909350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b81811015610dc657611fe9838551611f7e565b9284019260809290920191600101611fd6565b60006020828403121561200e57600080fd5b610f7882611e8d565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b038084111561204757612047612017565b604051601f8501601f19908116603f0116810190828211818310171561206f5761206f612017565b8160405280935085815286868601111561208857600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126120b357600080fd5b610f788383356020850161202d565b600080604083850312156120d557600080fd5b82356001600160401b038111156120eb57600080fd5b6120f7858286016120a2565b92505061210660208401611e8d565b90509250929050565b6020808252825182820181905260009190848201906040850190845b81811015610dc65783518352928401929184019160010161212b565b60008060006060848603121561215c57600080fd5b61216584611e8d565b95602085013595506040909401359392505050565b60006020828403121561218c57600080fd5b81356001600160401b038111156121a257600080fd5b6111b9848285016120a2565b600080604083850312156121c157600080fd5b6121ca83611e8d565b9150602083013580151581146121df57600080fd5b809150509250929050565b6000806000806080858703121561220057600080fd5b61220985611e8d565b935061221760208601611e8d565b92506040850135915060608501356001600160401b0381111561223957600080fd5b8501601f8101871361224a57600080fd5b6122598782356020840161202d565b91505092959194509250565b608081016105da8284611f7e565b60008060006040848603121561228857600080fd5b8335925060208401356001600160401b03808211156122a657600080fd5b818601915086601f8301126122ba57600080fd5b8135818111156122c957600080fd5b8760208285010111156122db57600080fd5b6020830194508093505050509250925092565b6000806040838503121561230157600080fd5b61230a83611e8d565b915061210660208401611e8d565b600181811c9082168061232c57607f821691505b60208210810361234c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b601f82111561090a57600081815260208120601f850160051c8101602086101561238f5750805b601f850160051c820191505b818110156108e75782815560010161239b565b81516001600160401b038111156123c7576123c7612017565b6123db816123d58454612318565b84612368565b602080601f83116001811461241057600084156123f85750858301515b600019600386901b1c1916600185901b1785556108e7565b600085815260208120601f198616915b8281101561243f57888601518255948401946001909101908401612420565b508582101561245d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000835161247f818460208801611e11565b835190830190612493818360208801611e11565b64173539b7b760d91b9101908152600501949350505050565b808201808211156105da57634e487b7160e01b600052601160045260246000fd5b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061255490830184611e35565b9695505050505050565b60006020828403121561257057600080fd5b8151610f7881611dde56fe95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a941ee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa264697066735822122002f99ea11fbcb8d3ea1c0c0f7df5c89924db026437dc6d198a0a6bf29411917264736f6c63430008110033

Deployed Bytecode

0x6080604052600436106101cd5760003560e01c80637d8966e4116100f7578063b88d4fde11610095578063db7fd40811610064578063db7fd4081461051b578063e1b6d92e1461052e578063e985e9c51461054e578063f2fde38b1461056e57600080fd5b8063b88d4fde1461049b578063c23dc68f146104ae578063c87b56dd146104db578063d7ad08d3146104fb57600080fd5b806395d89b41116100d157806395d89b411461042657806399a2557a1461043b578063a0bcfc7f1461045b578063a22cb4651461047b57600080fd5b80637d8966e4146103cf5780638462151c146103e45780638da5cb5b1461041157600080fd5b80633bc996c51161016f5780635bbb21771161013e5780635bbb2177146103425780636352211e1461036f57806370a082311461038f5780637ab4339d146103af57600080fd5b80633bc996c5146102c257806342842e0e146102ee5780634bf530551461030157806359eda1b51461032d57600080fd5b8063095ea7b3116101ab578063095ea7b31461026157806318160ddd1461027657806323b872dd1461029957806332cb6b0c146102ac57600080fd5b806301ffc9a7146101d257806306fdde0314610207578063081812fc14610229575b600080fd5b3480156101de57600080fd5b506101f26101ed366004611df4565b61058e565b60405190151581526020015b60405180910390f35b34801561021357600080fd5b5061021c6105e0565b6040516101fe9190611e61565b34801561023557600080fd5b50610249610244366004611e74565b61067b565b6040516001600160a01b0390911681526020016101fe565b61027461026f366004611ea4565b6106c8565b005b34801561028257600080fd5b5061028b6106d8565b6040519081526020016101fe565b6102746102a7366004611ece565b6106f8565b3480156102b857600080fd5b5061028b610fa481565b3480156102ce57600080fd5b5060008051602061257c83398151915254600160a01b900460ff166101f2565b6102746102fc366004611ece565b6108ef565b34801561030d57600080fd5b5060008051602061257c83398151915254600160a81b900460ff166101f2565b34801561033957600080fd5b5061027461090f565b34801561034e57600080fd5b5061036261035d366004611f0a565b610974565b6040516101fe9190611fba565b34801561037b57600080fd5b5061024961038a366004611e74565b610a3f565b34801561039b57600080fd5b5061028b6103aa366004611ffc565b610a4a565b3480156103bb57600080fd5b506102746103ca3660046120c2565b610ab2565b3480156103db57600080fd5b50610274610c65565b3480156103f057600080fd5b506104046103ff366004611ffc565b610cca565b6040516101fe919061210f565b34801561041d57600080fd5b50610249610dd2565b34801561043257600080fd5b5061021c610de1565b34801561044757600080fd5b50610404610456366004612147565b610df9565b34801561046757600080fd5b5061027461047636600461217a565b610f7f565b34801561048757600080fd5b506102746104963660046121ae565b610fe3565b6102746104a93660046121ea565b611060565b3480156104ba57600080fd5b506104ce6104c9366004611e74565b6110aa565b6040516101fe9190612265565b3480156104e757600080fd5b5061021c6104f6366004611e74565b611137565b34801561050757600080fd5b50610274610516366004611e74565b6111c1565b610274610529366004612273565b61121e565b34801561053a57600080fd5b50610274610549366004611ea4565b611517565b34801561055a57600080fd5b506101f26105693660046122ee565b6115b4565b34801561057a57600080fd5b50610274610589366004611ffc565b6115f1565b60006301ffc9a760e01b6001600160e01b0319831614806105bf57506380ac58cd60e01b6001600160e01b03198316145b806105da5750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606105ea611636565b60020180546105f890612318565b80601f016020809104026020016040519081016040528092919081815260200182805461062490612318565b80156106715780601f1061064657610100808354040283529160200191610671565b820191906000526020600020905b81548152906001019060200180831161065457829003601f168201915b5050505050905090565b60006106868261165a565b6106a3576040516333d1c03960e21b815260040160405180910390fd5b6106ab611636565b60009283526006016020525060409020546001600160a01b031690565b6106d4828260016116a3565b5050565b600060016106e4611636565b600101546106f0611636565b540303919050565b600061070382611758565b9050836001600160a01b0316816001600160a01b0316146107365760405162a1148160e81b815260040160405180910390fd5b60008061074284611805565b9150915061076781876107523390565b6001600160a01b039081169116811491141790565b6107925761077586336115b4565b61079257604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166107b957604051633a954ecd60e21b815260040160405180910390fd5b80156107c457600082555b6107cc611636565b6001600160a01b03871660009081526005919091016020526040902080546000190190556107f8611636565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b1761082f611636565b60008681526004919091016020526040812091909155600160e11b841690036108a5576001840161085e611636565b6000828152600491909101602052604081205490036108a35761087f611636565b5481146108a3578361088f611636565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b61090a83838360405180602001604052806000815250611060565b505050565b61091761182d565b6001600160a01b0316336001600160a01b03161461094857604051632f7a8ee160e01b815260040160405180910390fd5b60008051602061257c8339815191528054600160a01b80820460ff16150260ff60a01b19909116179055565b6060816000816001600160401b0381111561099157610991612017565b6040519080825280602002602001820160405280156109e357816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816109af5790505b50905060005b828114610a3657610a11868683818110610a0557610a05612352565b905060200201356110aa565b828281518110610a2357610a23612352565b60209081029190910101526001016109e9565b50949350505050565b60006105da82611758565b60006001600160a01b038216610a73576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b03610a83611636565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b60008051602061259c83398151915254610100900460ff16610ae75760008051602061259c8339815191525460ff1615610aeb565b303b155b610b625760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a656400000000000000000060648201526084015b60405180910390fd5b60008051602061259c83398151915254610100900460ff16158015610b9e5760008051602061259c833981519152805461ffff19166101011790555b610be5604051806040016040528060098152602001682219a0a22624a725ad60b91b81525060405180604001604052806004815260200163110cd05160e21b81525061185b565b610bed611899565b60008051602061257c83398151915280546001600160a01b0319166001600160a01b03841617905560017f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a94255610c4283610f7f565b801561090a57505060008051602061259c833981519152805461ff001916905550565b610c6d61182d565b6001600160a01b0316336001600160a01b031614610c9e57604051632f7a8ee160e01b815260040160405180910390fd5b60008051602061257c8339815191528054600160a81b80820460ff16150260ff60a81b19909116179055565b60606000806000610cda85610a4a565b90506000816001600160401b03811115610cf657610cf6612017565b604051908082528060200260200182016040528015610d1f578160200160208202803683370190505b509050610d4c60408051608081018252600080825260208201819052918101829052606081019190915290565b60015b838614610dc657610d5f816118d7565b91508160400151610dbe5781516001600160a01b031615610d7f57815194505b876001600160a01b0316856001600160a01b031603610dbe5780838780600101985081518110610db157610db1612352565b6020026020010181815250505b600101610d4f565b50909695505050505050565b6000610ddc61182d565b905090565b6060610deb611636565b60030180546105f890612318565b6060818310610e1b57604051631960ccad60e11b815260040160405180910390fd5b600080610e2661191e565b90506001851015610e3657600194505b80841115610e42578093505b6000610e4d87610a4a565b905084861015610e6c5785850381811015610e66578091505b50610e70565b5060005b6000816001600160401b03811115610e8a57610e8a612017565b604051908082528060200260200182016040528015610eb3578160200160208202803683370190505b50905081600003610ec9579350610f7892505050565b6000610ed4886110aa565b905060008160400151610ee5575080515b885b888114158015610ef75750848714155b15610f6c57610f05816118d7565b92508260400151610f645782516001600160a01b031615610f2557825191505b8a6001600160a01b0316826001600160a01b031603610f645780848880600101995081518110610f5757610f57612352565b6020026020010181815250505b600101610ee7565b50505092835250909150505b9392505050565b610f8761182d565b6001600160a01b0316336001600160a01b031614610fb857604051632f7a8ee160e01b815260040160405180910390fd5b7f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a9406106d482826123ae565b80610fec611636565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61106b8484846106f8565b6001600160a01b0383163b156110a4576110878484848461192e565b6110a4576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6040805160808101825260008082526020820181905291810182905260608101919091526040805160808101825260008082526020820181905291810182905260608101919091526001831080611108575061110461191e565b8310155b156111135792915050565b61111c836118d7565b905080604001511561112e5792915050565b610f7883611a19565b60606111428261165a565b61115f57604051630a14c4b560e41b815260040160405180910390fd5b6000611169611a4e565b905060008161117785611a7c565b60405160200161118892919061246d565b604051602081830303815290604052905081516000036111b757604051806020016040528060008152506111b9565b805b949350505050565b6111c961182d565b6001600160a01b0316336001600160a01b0316146111fa57604051632f7a8ee160e01b815260040160405180910390fd5b7f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a94255565b82610fa48161122b611ac0565b61123591906124ac565b11156112785760405162461bcd60e51b815260206004820152601260248201527141626f766520746f74616c20737570706c7960701b6044820152606401610b59565b3233146112b15760405162461bcd60e51b81526020600482015260076024820152664e6f7420454f4160c81b6044820152606401610b59565b60008051602061257c83398151915254600160a81b900460ff1661141f5760008051602061257c83398151915254600160a01b900460ff1661132a5760405162461bcd60e51b81526020600482015260126024820152712bb434ba32b634b9ba103737ba1037b832b760711b6044820152606401610b59565b6040516bffffffffffffffffffffffff193360601b1660208201526034810185905260009060540160405160208183030381529060405280519060200120905060006113a785856113a0856020527b19457468657265756d205369676e6564204d6573736167653a0a3332600052603c60042090565b9190611ad3565b90506001600160a01b0381167f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a940600101546001600160a01b03161461141c5760405162461bcd60e51b815260206004820152600b60248201526a139bdd08185b1b1bddd95960aa1b6044820152606401610b59565b50505b7f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a942543360009081527f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a943602052604090205461147b9086906124ac565b11156114c95760405162461bcd60e51b815260206004820152601a60248201527f4d696e74696e672061626f76652077616c6c6574206c696d69740000000000006044820152606401610b59565b3360009081527f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a9436020526040812080548692906115079084906124ac565b909155506110a490503385611b42565b61151f61182d565b6001600160a01b0316336001600160a01b03161461155057604051632f7a8ee160e01b815260040160405180910390fd5b80610fa48161155d611ac0565b61156791906124ac565b11156115aa5760405162461bcd60e51b815260206004820152601260248201527141626f766520746f74616c20737570706c7960701b6044820152606401610b59565b61090a8383611b42565b60006115be611636565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b6115f961182d565b6001600160a01b0316336001600160a01b03161461162a57604051632f7a8ee160e01b815260040160405180910390fd5b61163381611c7d565b50565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b6000816001111580156116745750611670611636565b5482105b80156105da5750600160e01b611688611636565b60008481526004919091016020526040902054161592915050565b60006116ae83610a3f565b905081156116ed57336001600160a01b038216146116ed576116d081336115b4565b6116ed576040516367d9dca160e11b815260040160405180910390fd5b836116f6611636565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b6000816001116117ec5761176a611636565b600083815260049190910160205260408120549150600160e01b821690036117ec57806000036117e75761179c611636565b5482106117bc57604051636f96cda160e11b815260040160405180910390fd5b6117c4611636565b6000199092016000818152600493909301602052604090922054905080156117bc575b919050565b604051636f96cda160e11b815260040160405180910390fd5b6000806000611812611636565b60009485526006016020525050604090912080549092909150565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f671680460546001600160a01b031690565b60008051602061259c83398151915254610100900460ff1661188f5760405162461bcd60e51b8152600401610b59906124cd565b6106d48282611cf0565b60008051602061259c83398151915254610100900460ff166118cd5760405162461bcd60e51b8152600401610b59906124cd565b6118d5611d63565b565b6040805160808101825260008082526020820181905291810182905260608101919091526105da611906611636565b60008481526004919091016020526040902054611d97565b6000611928611636565b54919050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611963903390899088908890600401612521565b6020604051808303816000875af192505050801561199e575060408051601f3d908101601f1916820190925261199b9181019061255e565b60015b6119fc573d8080156119cc576040519150601f19603f3d011682016040523d82523d6000602084013e6119d1565b606091505b5080516000036119f4576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6040805160808101825260008082526020820181905291810182905260608101919091526105da611a4983611758565b611d97565b60607f95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a94080546105f890612318565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480611a965750819003601f19909101908152919050565b60006001611acc611636565b5403919050565b600060418203610f78576040516040846040377f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a060605111611b385784600052604084013560001a602052602060406080600060015afa5060006060523d6060035191505b6040529392505050565b6000611b4c611636565b5490506000829003611b715760405163b562e8dd60e01b815260040160405180910390fd5b680100000000000000018202611b85611636565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b6001841460e11b1717611bc0611636565b600083815260049190910160205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114611c4a57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101611c12565b5081600003611c6b57604051622e076360e81b815260040160405180910390fd5b80611c74611636565b555061090a9050565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f67168046080546001600160a01b0319166001600160a01b0383161790556040516001600160a01b0382169033907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b60008051602061259c83398151915254610100900460ff16611d245760405162461bcd60e51b8152600401610b59906124cd565b81611d2d611636565b60020190611d3b90826123ae565b5080611d45611636565b60030190611d5390826123ae565b506001611d5e611636565b555050565b60008051602061259c83398151915254610100900460ff166118d55760405162461bcd60e51b8152600401610b59906124cd565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b6001600160e01b03198116811461163357600080fd5b600060208284031215611e0657600080fd5b8135610f7881611dde565b60005b83811015611e2c578181015183820152602001611e14565b50506000910152565b60008151808452611e4d816020860160208601611e11565b601f01601f19169290920160200192915050565b602081526000610f786020830184611e35565b600060208284031215611e8657600080fd5b5035919050565b80356001600160a01b03811681146117e757600080fd5b60008060408385031215611eb757600080fd5b611ec083611e8d565b946020939093013593505050565b600080600060608486031215611ee357600080fd5b611eec84611e8d565b9250611efa60208501611e8d565b9150604084013590509250925092565b60008060208385031215611f1d57600080fd5b82356001600160401b0380821115611f3457600080fd5b818501915085601f830112611f4857600080fd5b813581811115611f5757600080fd5b8660208260051b8501011115611f6c57600080fd5b60209290920196919550909350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b81811015610dc657611fe9838551611f7e565b9284019260809290920191600101611fd6565b60006020828403121561200e57600080fd5b610f7882611e8d565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b038084111561204757612047612017565b604051601f8501601f19908116603f0116810190828211818310171561206f5761206f612017565b8160405280935085815286868601111561208857600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126120b357600080fd5b610f788383356020850161202d565b600080604083850312156120d557600080fd5b82356001600160401b038111156120eb57600080fd5b6120f7858286016120a2565b92505061210660208401611e8d565b90509250929050565b6020808252825182820181905260009190848201906040850190845b81811015610dc65783518352928401929184019160010161212b565b60008060006060848603121561215c57600080fd5b61216584611e8d565b95602085013595506040909401359392505050565b60006020828403121561218c57600080fd5b81356001600160401b038111156121a257600080fd5b6111b9848285016120a2565b600080604083850312156121c157600080fd5b6121ca83611e8d565b9150602083013580151581146121df57600080fd5b809150509250929050565b6000806000806080858703121561220057600080fd5b61220985611e8d565b935061221760208601611e8d565b92506040850135915060608501356001600160401b0381111561223957600080fd5b8501601f8101871361224a57600080fd5b6122598782356020840161202d565b91505092959194509250565b608081016105da8284611f7e565b60008060006040848603121561228857600080fd5b8335925060208401356001600160401b03808211156122a657600080fd5b818601915086601f8301126122ba57600080fd5b8135818111156122c957600080fd5b8760208285010111156122db57600080fd5b6020830194508093505050509250925092565b6000806040838503121561230157600080fd5b61230a83611e8d565b915061210660208401611e8d565b600181811c9082168061232c57607f821691505b60208210810361234c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b601f82111561090a57600081815260208120601f850160051c8101602086101561238f5750805b601f850160051c820191505b818110156108e75782815560010161239b565b81516001600160401b038111156123c7576123c7612017565b6123db816123d58454612318565b84612368565b602080601f83116001811461241057600084156123f85750858301515b600019600386901b1c1916600185901b1785556108e7565b600085815260208120601f198616915b8281101561243f57888601518255948401946001909101908401612420565b508582101561245d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000835161247f818460208801611e11565b835190830190612493818360208801611e11565b64173539b7b760d91b9101908152600501949350505050565b808201808211156105da57634e487b7160e01b600052601160045260246000fd5b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061255490830184611e35565b9695505050505050565b60006020828403121561257057600080fd5b8151610f7881611dde56fe95ea8623012be88135df08fe59fd8fc6080eac3fdd1d854d6f1ff6072cd3a941ee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa264697066735822122002f99ea11fbcb8d3ea1c0c0f7df5c89924db026437dc6d198a0a6bf29411917264736f6c63430008110033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.