ETH Price: $2,953.61 (-0.10%)

Token

SpartaDex - Polis (POLIS)

Overview

Max Total Supply

12,396 POLIS

Holders

5,939

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 POLIS
0x25d55133bF81ba34173fdAD41868f268C8dc1d14
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
Polis

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.18;

import {IPolis} from "./interfaces/IPolis.sol";
import {ERC721AQueryable, ERC721A} from "./ERC721AQueryable.sol";
import {IERC721A} from "./interfaces/IERC721A.sol";
import {IAccessControlHolder, IAccessControl} from "../IAccessControlHolder.sol";
import {IERC2981, ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract Polis is
    IPolis,
    IAccessControlHolder,
    ERC721AQueryable,
    ERC2981,
    Ownable
{
    bytes32 internal constant POLIS_MINTER = keccak256("POLIS_MINTER");
    bytes32 internal constant POLIS_UPGRADE = keccak256("POLIS_UPGRADE");
    bytes32 internal constant METADATA_MANAGER = keccak256("METADATA_MANAGER");

    IAccessControl public immutable override acl;
    string internal baseTokenURI;
    string public override contractURI;
    mapping(uint256 => uint8) internal senateLevels_;
    mapping(address => bool) public freePolisMinted;

    modifier onlyMinterRoleAccess() {
        _ensureHasMinterRole(msg.sender);
        _;
    }

    modifier onlyUpgradeRoleAccess() {
        _ensureHasUpgradeRole(msg.sender);
        _;
    }

    modifier canMintFreeToken() {
        _ensureCanMint(msg.sender);
        _;
    }

    modifier onlyIfExsits(uint256 tokenId) {
        _ensureExists(tokenId);
        _;
    }

    modifier onlyMetadataManager() {
        _ensureHasMetadataManagerRole(msg.sender);
        _;
    }

    constructor(
        IAccessControl acl_,
        uint96 royaltyNumerator_,
        address owner_,
        address treasury_,
        string memory baseTokenURI_,
        string memory contractURI_
    ) ERC721A("SpartaDex - Polis", "POLIS") {
        acl = acl_;
        baseTokenURI = baseTokenURI_;
        contractURI = contractURI_;
        _setDefaultRoyalty(treasury_, royaltyNumerator_);
        _transferOwnership(owner_);
    }

    function upgrade(
        uint256 tokenId,
        uint8 level
    ) external onlyUpgradeRoleAccess onlyIfExsits(tokenId) {
        _upgrade(tokenId, level);
    }

    function mintAsMinter(address to) external override onlyMinterRoleAccess {
        _safeMint(to, 1);
    }

    function mint() external canMintFreeToken {
        address sender = msg.sender;
        _safeMint(sender, 1);
        freePolisMinted[sender] = true;
    }

    function setBaseTokenURI(
        string calldata baseTokenURI_
    ) external override onlyMetadataManager {
        string memory previousBaseTokenURI = baseTokenURI;
        baseTokenURI = baseTokenURI_;

        emit BaseTokenURIChanged(previousBaseTokenURI, baseTokenURI);
    }

    function setContractURI(
        string calldata contractURI_
    ) external override onlyMetadataManager {
        string memory previousContractURI = contractURI;
        contractURI = contractURI_;

        emit ContractURIChanged(previousContractURI, contractURI);
    }

    function boost(
        uint256 tokenId,
        uint256 from
    ) external view returns (uint256) {
        uint256 level = senateLevels_[tokenId];

        uint256 boostFactor;

        if (level <= 10) {
            boostFactor = 100 + (level * 2);
        } else if (level <= 20) {
            boostFactor = 120 + ((level - 10) * 5);
        } else if (level <= 30) {
            boostFactor = 170 + ((level - 20) * 8);
        } else if (level <= 40) {
            boostFactor = 250 + ((level - 30) * 12);
        } else {
            boostFactor = 370 + ((level - 40) * 15);
        }

        uint256 boostedValue = (from * boostFactor) / 100;

        return boostedValue;
    }

    function senateLevel(uint256 tokenId) external view returns (uint8) {
        return senateLevels_[tokenId];
    }

    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(IERC721A, ERC721A, ERC2981) returns (bool) {
        return
            ERC721A.supportsInterface(interfaceId) ||
            ERC2981.supportsInterface(interfaceId);
    }

    function ownerOf(
        uint256 tokenId
    ) public view override(ERC721A, IERC721A, IPolis) returns (address) {
        return ERC721A.ownerOf(tokenId);
    }

    function _upgrade(uint256 tokenId, uint8 level) internal {
        uint8 currentLevel = senateLevels_[tokenId];
        if (currentLevel >= level) {
            revert LevelDowngrade();
        }
        senateLevels_[tokenId] = level;
        emit Upgrade(tokenId, level);
    }

    function _ensureHasMinterRole(address addr) internal view {
        if (!acl.hasRole(POLIS_MINTER, addr)) {
            revert OnlyMinterRoleAccess();
        }
    }

    function _ensureHasUpgradeRole(address addr) internal view {
        if (!acl.hasRole(POLIS_UPGRADE, addr)) {
            revert OnlyUpgradeRoleAccess();
        }
    }

    function _ensureExists(uint256 tokenId) internal view {
        if (!_exists(tokenId)) {
            _revert(URIQueryForNonexistentToken.selector);
        }
    }

    function _startTokenId() internal view virtual override returns (uint256) {
        return 1;
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return baseTokenURI;
    }

    function _ensureCanMint(address sender) internal view {
        if (freePolisMinted[sender]) {
            revert CannotMintFreePolis();
        }
    }

    function _ensureHasMetadataManagerRole(address sender) internal view {
        if (!acl.hasRole(METADATA_MANAGER, sender)) {
            revert OnlyMetadataManagerAccess();
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/IERC165.sol";

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(
        uint256 tokenId,
        uint256 salePrice
    ) external view returns (address receiver, uint256 royaltyAmount);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
        return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: invalid receiver");

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 9 of 14 : IAccessControlHolder.sol
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.18;

import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";

/**
 * @title IAccessControlHolder
 * @notice Interface created to store reference to the access control.
 */
interface IAccessControlHolder {
    /**
     * @notice Function returns reference to IAccessControl.
     * @return IAccessControl reference to access control.
     */
    function acl() external view returns (IAccessControl);
}

File 10 of 14 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity 0.8.18;

import{IERC721A} from  "./interfaces/IERC721A.sol";

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

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    // =============================================================
    //                            STORAGE
    // =============================================================

    // The next token ID to be minted.
    uint256 internal _currentIndex;

    // The number of tokens burned.
    uint256 private _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned.
    // See {_packedOwnershipOf} implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    // - [232..255] `extraData`
    mapping(uint256 => uint256) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => uint256) private _packedAddressData;

    // Mapping from token ID to approved address.
    mapping(uint256 => TokenApprovalRef) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

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

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(
        uint256 tokenId
    ) internal view returns (uint256 packed) {
        if (_startTokenId() <= tokenId) {
            packed = _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 >= _currentIndex)
                        _revert(OwnerQueryForNonexistentToken.selector);
                    // Invariant:
                    // There will always be an initialized ownership slot
                    // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                    // before an unintialized ownership slot
                    // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                    // Hence, `tokenId` will not underflow.
                    //
                    // We can directly compare the packed value.
                    // If the address is zero, packed will be zero.
                    for (;;) {
                        unchecked {
                            packed = _packedOwnerships[--tokenId];
                        }
                        if (packed == 0) continue;
                        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.selector);
    }

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

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

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

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

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

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

        return _tokenApprovals[tokenId].value;
    }

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

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

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

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

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

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

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

        // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.
        from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));

        if (address(uint160(prevOwnershipPacked)) != from)
            _revert(TransferFromIncorrectOwner.selector);

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

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

        _beforeTokenTransfers(from, to, tokenId, 1);

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

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

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

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

        // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
        uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
        assembly {
            // Emit the `Transfer` event.
            log4(
                0, // Start of data (0, since no data).
                0, // End of data (0, since no data).
                _TRANSFER_EVENT_SIGNATURE, // Signature.
                from, // `from`.
                toMasked, // `to`.
                tokenId // `tokenId`.
            )
        }
        if (toMasked == 0) _revert(TransferToZeroAddress.selector);

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

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

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

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

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

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

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

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

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

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) |
                    _nextExtraData(address(0), to, 0)
            );

            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] +=
                quantity *
                ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
            uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;

            if (toMasked == 0) _revert(MintToZeroAddress.selector);

            uint256 end = startTokenId + quantity;
            uint256 tokenId = startTokenId;

            do {
                assembly {
                    // Emit the `Transfer` event.
                    log4(
                        0, // Start of data (0, since no data).
                        0, // End of data (0, since no data).
                        _TRANSFER_EVENT_SIGNATURE, // Signature.
                        0, // `address(0)`.
                        toMasked, // `to`.
                        tokenId // `tokenId`.
                    )
                }
                // The `!=` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
            } while (++tokenId != end);

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

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

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

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

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

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

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

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

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

    /**
     * @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 && _msgSenderERC721A() != owner)
            if (!isApprovedForAll(owner, _msgSenderERC721A())) {
                _revert(ApprovalCallerNotOwnerNorApproved.selector);
            }

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

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

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

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

        address from = address(uint160(prevOwnershipPacked));

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev For more efficient reverts.
     */
    function _revert(bytes4 errorSelector) internal pure {
        assembly {
            mstore(0x00, errorSelector)
            revert(0x00, 0x04)
        }
    }
}

// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import {IERC721AQueryable} from "./interfaces/IERC721AQueryable.sol";
import {ERC721A} from "./ERC721A.sol";

/**
 * @title ERC721AQueryable.
 *
 * @dev ERC721A subclass with convenience query functions.
 */
abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(
        uint256 tokenId
    ) public view virtual override returns (TokenOwnership memory ownership) {
        if (tokenId >= _startTokenId()) {
            if (tokenId < _nextTokenId()) {
                ownership = _ownershipAt(tokenId);
                if (!ownership.burned) {
                    ownership = _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) {
        TokenOwnership[] memory ownerships;
        uint256 i = tokenIds.length;
        assembly {
            // Grab the free memory pointer.
            ownerships := mload(0x40)
            // Store the length.
            mstore(ownerships, i)
            // Allocate one word for the length,
            // `tokenIds.length` words for the pointers.
            i := shl(5, i) // Multiply `i` by 32.
            mstore(0x40, add(add(ownerships, 0x20), i))
        }
        while (i != 0) {
            uint256 tokenId;
            assembly {
                i := sub(i, 0x20)
                tokenId := calldataload(add(tokenIds.offset, i))
            }
            TokenOwnership memory ownership = explicitOwnershipOf(tokenId);
            assembly {
                // Store the pointer of `ownership` in the `ownerships` array.
                mstore(add(add(ownerships, 0x20), i), ownership)
            }
        }
        return ownerships;
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view virtual override returns (uint256[] memory) {
        unchecked {
            if (start >= stop) _revert(InvalidQueryRange.selector);
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            uint256 stopLimit = _nextTokenId();
            // Set `stop = min(stop, stopLimit)`.
            if (stop >= stopLimit) {
                stop = stopLimit;
            }
            uint256[] memory tokenIds;
            uint256 tokenIdsMaxLength = balanceOf(owner);
            bool startLtStop = start < stop;
            assembly {
                // Set `tokenIdsMaxLength` to zero if `start` is less than `stop`.
                tokenIdsMaxLength := mul(tokenIdsMaxLength, startLtStop)
            }
            if (tokenIdsMaxLength != 0) {
                // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
                // to cater for cases where `balanceOf(owner)` is too big.
                if (stop - start <= tokenIdsMaxLength) {
                    tokenIdsMaxLength = stop - start;
                }
                assembly {
                    // Grab the free memory pointer.
                    tokenIds := mload(0x40)
                    // Allocate one word for the length, and `tokenIdsMaxLength` words
                    // for the data. `shl(5, x)` is equivalent to `mul(32, x)`.
                    mstore(
                        0x40,
                        add(tokenIds, shl(5, add(tokenIdsMaxLength, 1)))
                    )
                }
                // We need to call `explicitOwnershipOf(start)`,
                // because the slot at `start` may not be initialized.
                TokenOwnership memory ownership = explicitOwnershipOf(start);
                address currOwnershipAddr;
                // If the starting slot exists (i.e. not burned),
                // initialize `currOwnershipAddr`.
                // `ownership.address` will not be zero,
                // as `start` is clamped to the valid token ID range.
                if (!ownership.burned) {
                    currOwnershipAddr = ownership.addr;
                }
                uint256 tokenIdsIdx;
                // Use a do-while, which is slightly more efficient for this case,
                // as the array will at least contain one element.
                do {
                    ownership = _ownershipAt(start);
                    assembly {
                        // if `ownership.burned == false`.
                        if iszero(mload(add(ownership, 0x40))) {
                            // if `ownership.addr != address(0)`.
                            // The `addr` already has it's upper 96 bits clearned,
                            // since it is written to memory with regular Solidity.
                            if mload(ownership) {
                                currOwnershipAddr := mload(ownership)
                            }
                            // if `currOwnershipAddr == owner`.
                            // The `shl(96, x)` is to make the comparison agnostic to any
                            // dirty upper 96 bits in `owner`.
                            if iszero(shl(96, xor(currOwnershipAddr, owner))) {
                                tokenIdsIdx := add(tokenIdsIdx, 1)
                                mstore(
                                    add(tokenIds, shl(5, tokenIdsIdx)),
                                    start
                                )
                            }
                        }
                        start := add(start, 1)
                    }
                } while (!(start == stop || tokenIdsIdx == tokenIdsMaxLength));
                // Store the length of the array.
                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) {
        uint256 tokenIdsLength = balanceOf(owner);
        uint256[] memory tokenIds;
        assembly {
            // Grab the free memory pointer.
            tokenIds := mload(0x40)
            // Allocate one word for the length, and `tokenIdsMaxLength` words
            // for the data. `shl(5, x)` is equivalent to `mul(32, x)`.
            mstore(0x40, add(tokenIds, shl(5, add(tokenIdsLength, 1))))
            // Store the length of `tokenIds`.
            mstore(tokenIds, tokenIdsLength)
        }
        address currOwnershipAddr;
        uint256 tokenIdsIdx;
        for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ) {
            TokenOwnership memory ownership = _ownershipAt(i);
            assembly {
                // if `ownership.burned == false`.
                if iszero(mload(add(ownership, 0x40))) {
                    // if `ownership.addr != address(0)`.
                    // The `addr` already has it's upper 96 bits clearned,
                    // since it is written to memory with regular Solidity.
                    if mload(ownership) {
                        currOwnershipAddr := mload(ownership)
                    }
                    // if `currOwnershipAddr == owner`.
                    // The `shl(96, x)` is to make the comparison agnostic to any
                    // dirty upper 96 bits in `owner`.
                    if iszero(shl(96, xor(currOwnershipAddr, owner))) {
                        tokenIdsIdx := add(tokenIdsIdx, 1)
                        mstore(add(tokenIds, shl(5, tokenIdsIdx)), i)
                    }
                }
                i := add(i, 1)
            }
        }
        return tokenIds;
    }
}

// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity 0.8.18;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity 0.8.18;
import {IERC721A} from "./IERC721A.sol";

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

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

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

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

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

//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.18;

import {IERC721A} from "./IERC721A.sol";

interface IPolis is IERC721A {
    error OnlyMinterRoleAccess();
    error OnlyUpgradeRoleAccess();
    error CannotMintFreePolis();
    error LevelDowngrade();
    error OnlyMetadataManagerAccess();

    event Upgrade(uint256 indexed tokenId, uint8 to);
    event BaseTokenURIChanged(string from, string to);
    event ContractURIChanged(string from, string to);

    function upgrade(uint256 tokenId, uint8 level) external;

    function senateLevel(uint256 tokenId) external view returns (uint8);

    function mint() external;

    function mintAsMinter(address to) external;

    function setBaseTokenURI(string calldata baseTokenURI) external;

    function setContractURI(string calldata baseTokenURI) external;

    function boost(
        uint256 tokenId,
        uint256 from
    ) external view returns (uint256);

    function ownerOf(uint256 tokenId) external view returns (address);

    function contractURI() external view returns (string memory);
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract IAccessControl","name":"acl_","type":"address"},{"internalType":"uint96","name":"royaltyNumerator_","type":"uint96"},{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"treasury_","type":"address"},{"internalType":"string","name":"baseTokenURI_","type":"string"},{"internalType":"string","name":"contractURI_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"CannotMintFreePolis","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"LevelDowngrade","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OnlyMetadataManagerAccess","type":"error"},{"inputs":[],"name":"OnlyMinterRoleAccess","type":"error"},{"inputs":[],"name":"OnlyUpgradeRoleAccess","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":false,"internalType":"string","name":"from","type":"string"},{"indexed":false,"internalType":"string","name":"to","type":"string"}],"name":"BaseTokenURIChanged","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":false,"internalType":"string","name":"from","type":"string"},{"indexed":false,"internalType":"string","name":"to","type":"string"}],"name":"ContractURIChanged","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"to","type":"uint8"}],"name":"Upgrade","type":"event"},{"inputs":[],"name":"acl","outputs":[{"internalType":"contract IAccessControl","name":"","type":"address"}],"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"},{"internalType":"uint256","name":"from","type":"uint256"}],"name":"boost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"ownership","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"freePolisMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mintAsMinter","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":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"senateLevel","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","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":"baseTokenURI_","type":"string"}],"name":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"contractURI_","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint8","name":"level","type":"uint8"}],"name":"upgrade","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040523480156200001157600080fd5b50604051620048a6380380620048a6833981810160405281019062000037919062000690565b6040518060400160405280601181526020017f537061727461446578202d20506f6c69730000000000000000000000000000008152506040518060400160405280600581526020017f504f4c49530000000000000000000000000000000000000000000000000000008152508160029081620000b49190620009b5565b508060039081620000c69190620009b5565b50620000d76200018660201b60201c565b6000819055505050620000ff620000f36200018f60201b60201c565b6200019760201b60201c565b8573ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff168152505081600b9081620001449190620009b5565b5080600c9081620001569190620009b5565b506200016983866200025d60201b60201c565b6200017a846200019760201b60201c565b50505050505062000bb7565b60006001905090565b600033905090565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6200026d6200040060201b60201c565b6bffffffffffffffffffffffff16816bffffffffffffffffffffffff161115620002ce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002c59062000b23565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160362000340576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003379062000b95565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff16815250600860008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055509050505050565b6000612710905090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200044b826200041e565b9050919050565b60006200045f826200043e565b9050919050565b620004718162000452565b81146200047d57600080fd5b50565b600081519050620004918162000466565b92915050565b60006bffffffffffffffffffffffff82169050919050565b620004ba8162000497565b8114620004c657600080fd5b50565b600081519050620004da81620004af565b92915050565b620004eb816200043e565b8114620004f757600080fd5b50565b6000815190506200050b81620004e0565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b62000566826200051b565b810181811067ffffffffffffffff821117156200058857620005876200052c565b5b80604052505050565b60006200059d6200040a565b9050620005ab82826200055b565b919050565b600067ffffffffffffffff821115620005ce57620005cd6200052c565b5b620005d9826200051b565b9050602081019050919050565b60005b8381101562000606578082015181840152602081019050620005e9565b60008484015250505050565b6000620006296200062384620005b0565b62000591565b90508281526020810184848401111562000648576200064762000516565b5b62000655848285620005e6565b509392505050565b600082601f83011262000675576200067462000511565b5b81516200068784826020860162000612565b91505092915050565b60008060008060008060c08789031215620006b057620006af62000414565b5b6000620006c089828a0162000480565b9650506020620006d389828a01620004c9565b9550506040620006e689828a01620004fa565b9450506060620006f989828a01620004fa565b935050608087015167ffffffffffffffff8111156200071d576200071c62000419565b5b6200072b89828a016200065d565b92505060a087015167ffffffffffffffff8111156200074f576200074e62000419565b5b6200075d89828a016200065d565b9150509295509295509295565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620007bd57607f821691505b602082108103620007d357620007d262000775565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200083d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620007fe565b620008498683620007fe565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062000896620008906200088a8462000861565b6200086b565b62000861565b9050919050565b6000819050919050565b620008b28362000875565b620008ca620008c1826200089d565b8484546200080b565b825550505050565b600090565b620008e1620008d2565b620008ee818484620008a7565b505050565b5b8181101562000916576200090a600082620008d7565b600181019050620008f4565b5050565b601f82111562000965576200092f81620007d9565b6200093a84620007ee565b810160208510156200094a578190505b620009626200095985620007ee565b830182620008f3565b50505b505050565b600082821c905092915050565b60006200098a600019846008026200096a565b1980831691505092915050565b6000620009a5838362000977565b9150826002028217905092915050565b620009c0826200076a565b67ffffffffffffffff811115620009dc57620009db6200052c565b5b620009e88254620007a4565b620009f58282856200091a565b600060209050601f83116001811462000a2d576000841562000a18578287015190505b62000a24858262000997565b86555062000a94565b601f19841662000a3d86620007d9565b60005b8281101562000a675784890151825560018201915060208501945060208101905062000a40565b8683101562000a87578489015162000a83601f89168262000977565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201527f2073616c65507269636500000000000000000000000000000000000000000000602082015250565b600062000b0b602a8362000a9c565b915062000b188262000aad565b604082019050919050565b6000602082019050818103600083015262000b3e8162000afc565b9050919050565b7f455243323938313a20696e76616c696420726563656976657200000000000000600082015250565b600062000b7d60198362000a9c565b915062000b8a8262000b45565b602082019050919050565b6000602082019050818103600083015262000bb08162000b6e565b9050919050565b608051613cbe62000be86000396000818161178f01528181611caa01528181611f31015261217c0152613cbe6000f3fe6080604052600436106101e35760003560e01c8063715018a611610102578063a22cb46511610095578063de28735911610064578063de28735914610719578063e8a3d48514610744578063e985e9c51461076f578063f2fde38b146107ac576101e3565b8063a22cb4651461065a578063b88d4fde14610683578063c23dc68f1461069f578063c87b56dd146106dc576101e3565b80638da5cb5b116100d15780638da5cb5b1461059e578063938e3d7b146105c957806395d89b41146105f257806399a2557a1461061d576101e3565b8063715018a6146104e45780637dfe5b92146104fb5780638462151c146105245780638ae3b23914610561576101e3565b806323b872dd1161017a57806342842e0e1161014957806342842e0e146104115780635bbb21771461042d5780636352211e1461046a57806370a08231146104a7576101e3565b806323b872dd146103515780632a55205a1461036d57806330176e13146103ab57806340be7bec146103d4576101e3565b8063095ea7b3116101b6578063095ea7b3146102ca5780631249c58b146102e657806318160ddd146102fd5780631e3c471514610328576101e3565b806301ffc9a7146101e8578063058430ac1461022557806306fdde0314610262578063081812fc1461028d575b600080fd5b3480156101f457600080fd5b5061020f600480360381019061020a91906129a6565b6107d5565b60405161021c91906129ee565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612a67565b6107f7565b60405161025991906129ee565b60405180910390f35b34801561026e57600080fd5b50610277610817565b6040516102849190612b24565b60405180910390f35b34801561029957600080fd5b506102b460048036038101906102af9190612b7c565b6108a9565b6040516102c19190612bb8565b60405180910390f35b6102e460048036038101906102df9190612bd3565b610907565b005b3480156102f257600080fd5b506102fb610917565b005b34801561030957600080fd5b5061031261098b565b60405161031f9190612c22565b60405180910390f35b34801561033457600080fd5b5061034f600480360381019061034a9190612a67565b6109a2565b005b61036b60048036038101906103669190612c3d565b6109b9565b005b34801561037957600080fd5b50610394600480360381019061038f9190612c90565b610c7a565b6040516103a2929190612cd0565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd9190612d5e565b610e64565b005b3480156103e057600080fd5b506103fb60048036038101906103f69190612c90565b610f4d565b6040516104089190612c22565b60405180910390f35b61042b60048036038101906104269190612c3d565b611090565b005b34801561043957600080fd5b50610454600480360381019061044f9190612e01565b6110b0565b6040516104619190612fb1565b60405180910390f35b34801561047657600080fd5b50610491600480360381019061048c9190612b7c565b611110565b60405161049e9190612bb8565b60405180910390f35b3480156104b357600080fd5b506104ce60048036038101906104c99190612a67565b611122565b6040516104db9190612c22565b60405180910390f35b3480156104f057600080fd5b506104f96111b9565b005b34801561050757600080fd5b50610522600480360381019061051d919061300c565b6111cd565b005b34801561053057600080fd5b5061054b60048036038101906105469190612a67565b6111ef565b604051610558919061310a565b60405180910390f35b34801561056d57600080fd5b5061058860048036038101906105839190612b7c565b611280565b604051610595919061313b565b60405180910390f35b3480156105aa57600080fd5b506105b36112aa565b6040516105c09190612bb8565b60405180910390f35b3480156105d557600080fd5b506105f060048036038101906105eb9190612d5e565b6112d4565b005b3480156105fe57600080fd5b506106076113bd565b6040516106149190612b24565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f9190613156565b61144f565b604051610651919061310a565b60405180910390f35b34801561066657600080fd5b50610681600480360381019061067c91906131d5565b611567565b005b61069d60048036038101906106989190613345565b611672565b005b3480156106ab57600080fd5b506106c660048036038101906106c19190612b7c565b6116c4565b6040516106d3919061341d565b60405180910390f35b3480156106e857600080fd5b5061070360048036038101906106fe9190612b7c565b611710565b6040516107109190612b24565b60405180910390f35b34801561072557600080fd5b5061072e61178d565b60405161073b9190613497565b60405180910390f35b34801561075057600080fd5b506107596117b1565b6040516107669190612b24565b60405180910390f35b34801561077b57600080fd5b50610796600480360381019061079191906134b2565b61183f565b6040516107a391906129ee565b60405180910390f35b3480156107b857600080fd5b506107d360048036038101906107ce9190612a67565b6118d3565b005b60006107e082611956565b806107f057506107ef826119e8565b5b9050919050565b600e6020528060005260406000206000915054906101000a900460ff1681565b60606002805461082690613521565b80601f016020809104026020016040519081016040528092919081815260200182805461085290613521565b801561089f5780601f106108745761010080835404028352916020019161089f565b820191906000526020600020905b81548152906001019060200180831161088257829003601f168201915b5050505050905090565b60006108b482611a62565b6108c9576108c863cf4700e460e01b611ac1565b5b6006600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61091382826001611acb565b5050565b61092033611bfa565b6000339050610930816001611c81565b6001600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610995611c9f565b6001546000540303905090565b6109ab33611ca8565b6109b6816001611c81565b50565b60006109c482611d9d565b905073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161693508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610a3957610a3863a114810060e01b611ac1565b5b600080610a4584611e53565b91509150610a5b8187610a56611e7a565b611e82565b610a8657610a7086610a6b611e7a565b61183f565b610a8557610a846359c896be60e01b611ac1565b5b5b610a938686866001611ec6565b8015610a9e57600082555b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815460010191905081905550610b6c85610b48888887611ecc565b7c020000000000000000000000000000000000000000000000000000000017611ef4565b600460008681526020019081526020016000208190555060007c0200000000000000000000000000000000000000000000000000000000841603610bf25760006001850190506000600460008381526020019081526020016000205403610bf0576000548114610bef578360046000838152602001908152602001600020819055505b5b505b600073ffffffffffffffffffffffffffffffffffffffff8673ffffffffffffffffffffffffffffffffffffffff161690508481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a460008103610c6457610c6363ea553b3460e01b611ac1565b5b610c718787876001611f1f565b50505050505050565b6000806000600960008681526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1603610e0f5760086040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b6000610e19611f25565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff1686610e459190613581565b610e4f91906135f2565b90508160000151819350935050509250929050565b610e6d33611f2f565b6000600b8054610e7c90613521565b80601f0160208091040260200160405190810160405280929190818152602001828054610ea890613521565b8015610ef55780601f10610eca57610100808354040283529160200191610ef5565b820191906000526020600020905b815481529060010190602001808311610ed857829003601f168201915b505050505090508282600b9182610f0d9291906137d0565b507fa5867b5328616714836e0684e8bf5bcd97da56e6cd01d359f25172f7f2fd6c4a81600b604051610f40929190613924565b60405180910390a1505050565b600080600d600085815260200190815260200160002060009054906101000a900460ff1660ff1690506000600a8211610fa057600282610f8d9190613581565b6064610f99919061395b565b9050611068565b60148211610fd4576005600a83610fb7919061398f565b610fc19190613581565b6078610fcd919061395b565b9050611067565b601e8211611008576008601483610feb919061398f565b610ff59190613581565b60aa611001919061395b565b9050611066565b6028821161103c57600c601e8361101f919061398f565b6110299190613581565b60fa611035919061395b565b9050611065565b600f60288361104b919061398f565b6110559190613581565b610172611062919061395b565b90505b5b5b5b6000606482866110789190613581565b61108291906135f2565b905080935050505092915050565b6110ab83838360405180602001604052806000815250611672565b505050565b606080600084849050905060405191508082528060051b90508060208301016040525b6000811461110557600060208203915081860135905060006110f4826116c4565b9050808360208601015250506110d3565b819250505092915050565b600061111b82612024565b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361116857611167638f4eb60460e01b611ac1565b5b67ffffffffffffffff600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b6111c1612036565b6111cb60006120b4565b565b6111d63361217a565b816111e08161226f565b6111ea8383612290565b505050565b606060006111fc83611122565b9050606060405190506001820160051b81016040528181526000806000611221611c9f565b90505b8482146112735760006112368261235d565b905060408101516112675780511561124d57805193505b87841860601b61126657600183019250818360051b8601525b5b60018201915050611224565b5082945050505050919050565b6000600d600083815260200190815260200160002060009054906101000a900460ff169050919050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6112dd33611f2f565b6000600c80546112ec90613521565b80601f016020809104026020016040519081016040528092919081815260200182805461131890613521565b80156113655780601f1061133a57610100808354040283529160200191611365565b820191906000526020600020905b81548152906001019060200180831161134857829003601f168201915b505050505090508282600c918261137d9291906137d0565b507fc8f194308d228309ebaa790e9225de5b2163dbdb6e49fcd28880065dd33dbe7681600c6040516113b0929190613924565b60405180910390a1505050565b6060600380546113cc90613521565b80601f01602080910402602001604051908101604052809291908181526020018280546113f890613521565b80156114455780601f1061141a57610100808354040283529160200191611445565b820191906000526020600020905b81548152906001019060200180831161142857829003601f168201915b5050505050905090565b6060818310611469576114686332c1995a60e01b611ac1565b5b611471611c9f565b83101561148357611480611c9f565b92505b600061148d612388565b905080831061149a578092505b606060006114a787611122565b9050600085871090508082029150600082146115595781878703116114cc5786860391505b60405192506001820160051b830160405260006114e8886116c4565b9050600081604001516114fd57816000015190505b60005b6115098a61235d565b9250604083015161153a5782511561152057825191505b8a821860601b61153957600181019050898160051b8701525b5b60018a019950888a148061154d57508481145b15611500578086525050505b829450505050509392505050565b8060076000611574611e7a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611621611e7a565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161166691906129ee565b60405180910390a35050565b61167d8484846109b9565b60008373ffffffffffffffffffffffffffffffffffffffff163b146116be576116a884848484612391565b6116bd576116bc63d1a57ed660e01b611ac1565b5b5b50505050565b6116cc6128eb565b6116d4611c9f565b821061170b576116e2612388565b82101561170a576116f28261235d565b9050806040015161170957611706826124c0565b90505b5b5b919050565b606061171b82611a62565b6117305761172f63a14c4b5060e01b611ac1565b5b600061173a6124e0565b9050600081510361175a5760405180602001604052806000815250611785565b8061176484612572565b6040516020016117759291906139ff565b6040516020818303038152906040525b915050919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600c80546117be90613521565b80601f01602080910402602001604051908101604052809291908181526020018280546117ea90613521565b80156118375780601f1061180c57610100808354040283529160200191611837565b820191906000526020600020905b81548152906001019060200180831161181a57829003601f168201915b505050505081565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6118db612036565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361194a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194190613a95565b60405180910390fd5b611953816120b4565b50565b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806119b157506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806119e15750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a5b5750611a5a826125c2565b5b9050919050565b600081611a6d611c9f565b11158015611a7c575060005482105b8015611aba575060007c0100000000000000000000000000000000000000000000000000000000600460008581526020019081526020016000205416145b9050919050565b8060005260046000fd5b6000611ad683611110565b9050818015611b1857508073ffffffffffffffffffffffffffffffffffffffff16611aff611e7a565b73ffffffffffffffffffffffffffffffffffffffff1614155b15611b4457611b2e81611b29611e7a565b61183f565b611b4357611b4263cfb3b94260e01b611ac1565b5b5b836006600085815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a450505050565b600e60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611c7e576040517f363918c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b611c9b82826040518060200160405280600081525061262c565b5050565b60006001905090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166391d148547fbf4730cb329bc7b3b8d6e2d2d906d5767eabf8aa280f6459bf1c5d38d5d86ec7836040518363ffffffff1660e01b8152600401611d23929190613ace565b602060405180830381865afa158015611d40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d649190613b0c565b611d9a576040517f4ed935e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600081611da8611c9f565b11611e3d576004600083815260200190815260200160002054905060007c0100000000000000000000000000000000000000000000000000000000821603611e3c5760008103611e37576000548210611e0c57611e0b63df2d9b4260e01b611ac1565b5b5b600460008360019003935083815260200190815260200160002054905060008103611e4e57611e0d565b611e4e565b5b611e4d63df2d9b4260e01b611ac1565b5b919050565b60008060006006600085815260200190815260200160002090508092508254915050915091565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e8611ee38686846126b1565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b6000612710905090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166391d148547ff9c666ad895960522076ddf49f40da5a5dee670748dd686b28fe169d75a93238836040518363ffffffff1660e01b8152600401611faa929190613ace565b602060405180830381865afa158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb9190613b0c565b612021576040517f2707ed3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600061202f82611d9d565b9050919050565b61203e6126ba565b73ffffffffffffffffffffffffffffffffffffffff1661205c6112aa565b73ffffffffffffffffffffffffffffffffffffffff16146120b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a990613b85565b60405180910390fd5b565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166391d148547f6ff2d1daf3b640b9ce9af47bc5a6d1a904890579b2efccded8e0562a4d8eb6ab836040518363ffffffff1660e01b81526004016121f5929190613ace565b602060405180830381865afa158015612212573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122369190613b0c565b61226c576040517fe80d0ba600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b61227881611a62565b61228d5761228c63a14c4b5060e01b611ac1565b5b50565b6000600d600084815260200190815260200160002060009054906101000a900460ff1690508160ff168160ff16106122f4576040517f2e43229a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600d600085815260200190815260200160002060006101000a81548160ff021916908360ff160217905550827f14d54973c509ce10520c1e0be443c7340095855c124ddda2a3627d4fa542d85183604051612350919061313b565b60405180910390a2505050565b6123656128eb565b61238160046000848152602001908152602001600020546126c2565b9050919050565b60008054905090565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a026123b7611e7a565b8786866040518563ffffffff1660e01b81526004016123d99493929190613bfa565b6020604051808303816000875af192505050801561241557506040513d601f19601f820116820180604052508101906124129190613c5b565b60015b61246d573d8060008114612445576040519150601f19603f3d011682016040523d82523d6000602084013e61244a565b606091505b5060008151036124655761246463d1a57ed660e01b611ac1565b5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b6124c86128eb565b6124d96124d483611d9d565b6126c2565b9050919050565b6060600b80546124ef90613521565b80601f016020809104026020016040519081016040528092919081815260200182805461251b90613521565b80156125685780601f1061253d57610100808354040283529160200191612568565b820191906000526020600020905b81548152906001019060200180831161254b57829003601f168201915b5050505050905090565b606060a060405101806040526020810391506000825281835b6001156125ad57600184039350600a81066030018453600a810490508061258b575b50828103602084039350808452505050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6126368383612778565b60008373ffffffffffffffffffffffffffffffffffffffff163b146126ac57600080549050600083820390505b6126766000868380600101945086612391565b61268b5761268a63d1a57ed660e01b611ac1565b5b8181106126635781600054146126a9576126a8600060e01b611ac1565b5b50505b505050565b60009392505050565b600033905090565b6126ca6128eb565b81816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060a082901c816020019067ffffffffffffffff16908167ffffffffffffffff168152505060007c01000000000000000000000000000000000000000000000000000000008316141581604001901515908115158152505060e882901c816060019062ffffff16908162ffffff1681525050919050565b600080549050600082036127975761279663b562e8dd60e01b611ac1565b5b6127a46000848385611ec6565b6127c4836127b56000866000611ecc565b6127be856128db565b17611ef4565b6004600083815260200190815260200160002081905550600160406001901b178202600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161690506000810361287c5761287b632e07630060e01b611ac1565b5b6000838301905060008390505b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a481816001019150810361288957816000819055505050506128d66000848385611f1f565b505050565b60006001821460e11b9050919050565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff168152602001600015158152602001600062ffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6129838161294e565b811461298e57600080fd5b50565b6000813590506129a08161297a565b92915050565b6000602082840312156129bc576129bb612944565b5b60006129ca84828501612991565b91505092915050565b60008115159050919050565b6129e8816129d3565b82525050565b6000602082019050612a0360008301846129df565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3482612a09565b9050919050565b612a4481612a29565b8114612a4f57600080fd5b50565b600081359050612a6181612a3b565b92915050565b600060208284031215612a7d57612a7c612944565b5b6000612a8b84828501612a52565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ace578082015181840152602081019050612ab3565b60008484015250505050565b6000601f19601f8301169050919050565b6000612af682612a94565b612b008185612a9f565b9350612b10818560208601612ab0565b612b1981612ada565b840191505092915050565b60006020820190508181036000830152612b3e8184612aeb565b905092915050565b6000819050919050565b612b5981612b46565b8114612b6457600080fd5b50565b600081359050612b7681612b50565b92915050565b600060208284031215612b9257612b91612944565b5b6000612ba084828501612b67565b91505092915050565b612bb281612a29565b82525050565b6000602082019050612bcd6000830184612ba9565b92915050565b60008060408385031215612bea57612be9612944565b5b6000612bf885828601612a52565b9250506020612c0985828601612b67565b9150509250929050565b612c1c81612b46565b82525050565b6000602082019050612c376000830184612c13565b92915050565b600080600060608486031215612c5657612c55612944565b5b6000612c6486828701612a52565b9350506020612c7586828701612a52565b9250506040612c8686828701612b67565b9150509250925092565b60008060408385031215612ca757612ca6612944565b5b6000612cb585828601612b67565b9250506020612cc685828601612b67565b9150509250929050565b6000604082019050612ce56000830185612ba9565b612cf26020830184612c13565b9392505050565b600080fd5b600080fd5b600080fd5b60008083601f840112612d1e57612d1d612cf9565b5b8235905067ffffffffffffffff811115612d3b57612d3a612cfe565b5b602083019150836001820283011115612d5757612d56612d03565b5b9250929050565b60008060208385031215612d7557612d74612944565b5b600083013567ffffffffffffffff811115612d9357612d92612949565b5b612d9f85828601612d08565b92509250509250929050565b60008083601f840112612dc157612dc0612cf9565b5b8235905067ffffffffffffffff811115612dde57612ddd612cfe565b5b602083019150836020820283011115612dfa57612df9612d03565b5b9250929050565b60008060208385031215612e1857612e17612944565b5b600083013567ffffffffffffffff811115612e3657612e35612949565b5b612e4285828601612dab565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612e8381612a29565b82525050565b600067ffffffffffffffff82169050919050565b612ea681612e89565b82525050565b612eb5816129d3565b82525050565b600062ffffff82169050919050565b612ed381612ebb565b82525050565b608082016000820151612eef6000850182612e7a565b506020820151612f026020850182612e9d565b506040820151612f156040850182612eac565b506060820151612f286060850182612eca565b50505050565b6000612f3a8383612ed9565b60808301905092915050565b6000602082019050919050565b6000612f5e82612e4e565b612f688185612e59565b9350612f7383612e6a565b8060005b83811015612fa4578151612f8b8882612f2e565b9750612f9683612f46565b925050600181019050612f77565b5085935050505092915050565b60006020820190508181036000830152612fcb8184612f53565b905092915050565b600060ff82169050919050565b612fe981612fd3565b8114612ff457600080fd5b50565b60008135905061300681612fe0565b92915050565b6000806040838503121561302357613022612944565b5b600061303185828601612b67565b925050602061304285828601612ff7565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61308181612b46565b82525050565b60006130938383613078565b60208301905092915050565b6000602082019050919050565b60006130b78261304c565b6130c18185613057565b93506130cc83613068565b8060005b838110156130fd5781516130e48882613087565b97506130ef8361309f565b9250506001810190506130d0565b5085935050505092915050565b6000602082019050818103600083015261312481846130ac565b905092915050565b61313581612fd3565b82525050565b6000602082019050613150600083018461312c565b92915050565b60008060006060848603121561316f5761316e612944565b5b600061317d86828701612a52565b935050602061318e86828701612b67565b925050604061319f86828701612b67565b9150509250925092565b6131b2816129d3565b81146131bd57600080fd5b50565b6000813590506131cf816131a9565b92915050565b600080604083850312156131ec576131eb612944565b5b60006131fa85828601612a52565b925050602061320b858286016131c0565b9150509250929050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61325282612ada565b810181811067ffffffffffffffff821117156132715761327061321a565b5b80604052505050565b600061328461293a565b90506132908282613249565b919050565b600067ffffffffffffffff8211156132b0576132af61321a565b5b6132b982612ada565b9050602081019050919050565b82818337600083830152505050565b60006132e86132e384613295565b61327a565b90508281526020810184848401111561330457613303613215565b5b61330f8482856132c6565b509392505050565b600082601f83011261332c5761332b612cf9565b5b813561333c8482602086016132d5565b91505092915050565b6000806000806080858703121561335f5761335e612944565b5b600061336d87828801612a52565b945050602061337e87828801612a52565b935050604061338f87828801612b67565b925050606085013567ffffffffffffffff8111156133b0576133af612949565b5b6133bc87828801613317565b91505092959194509250565b6080820160008201516133de6000850182612e7a565b5060208201516133f16020850182612e9d565b5060408201516134046040850182612eac565b5060608201516134176060850182612eca565b50505050565b600060808201905061343260008301846133c8565b92915050565b6000819050919050565b600061345d61345861345384612a09565b613438565b612a09565b9050919050565b600061346f82613442565b9050919050565b600061348182613464565b9050919050565b61349181613476565b82525050565b60006020820190506134ac6000830184613488565b92915050565b600080604083850312156134c9576134c8612944565b5b60006134d785828601612a52565b92505060206134e885828601612a52565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061353957607f821691505b60208210810361354c5761354b6134f2565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061358c82612b46565b915061359783612b46565b92508282026135a581612b46565b915082820484148315176135bc576135bb613552565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006135fd82612b46565b915061360883612b46565b925082613618576136176135c3565b5b828204905092915050565b600082905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026136907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82613653565b61369a8683613653565b95508019841693508086168417925050509392505050565b60006136cd6136c86136c384612b46565b613438565b612b46565b9050919050565b6000819050919050565b6136e7836136b2565b6136fb6136f3826136d4565b848454613660565b825550505050565b600090565b613710613703565b61371b8184846136de565b505050565b5b8181101561373f57613734600082613708565b600181019050613721565b5050565b601f821115613784576137558161362e565b61375e84613643565b8101602085101561376d578190505b61378161377985613643565b830182613720565b50505b505050565b600082821c905092915050565b60006137a760001984600802613789565b1980831691505092915050565b60006137c08383613796565b9150826002028217905092915050565b6137da8383613623565b67ffffffffffffffff8111156137f3576137f261321a565b5b6137fd8254613521565b613808828285613743565b6000601f8311600181146138375760008415613825578287013590505b61382f85826137b4565b865550613897565b601f1984166138458661362e565b60005b8281101561386d57848901358255600182019150602085019450602081019050613848565b8683101561388a5784890135613886601f891682613796565b8355505b6001600288020188555050505b50505050505050565b600081546138ad81613521565b6138b78186612a9f565b945060018216600081146138d257600181146138e85761391b565b60ff19831686528115156020028601935061391b565b6138f18561362e565b60005b83811015613913578154818901526001820191506020810190506138f4565b808801955050505b50505092915050565b6000604082019050818103600083015261393e8185612aeb565b9050818103602083015261395281846138a0565b90509392505050565b600061396682612b46565b915061397183612b46565b925082820190508082111561398957613988613552565b5b92915050565b600061399a82612b46565b91506139a583612b46565b92508282039050818111156139bd576139bc613552565b5b92915050565b600081905092915050565b60006139d982612a94565b6139e381856139c3565b93506139f3818560208601612ab0565b80840191505092915050565b6000613a0b82856139ce565b9150613a1782846139ce565b91508190509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613a7f602683612a9f565b9150613a8a82613a23565b604082019050919050565b60006020820190508181036000830152613aae81613a72565b9050919050565b6000819050919050565b613ac881613ab5565b82525050565b6000604082019050613ae36000830185613abf565b613af06020830184612ba9565b9392505050565b600081519050613b06816131a9565b92915050565b600060208284031215613b2257613b21612944565b5b6000613b3084828501613af7565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613b6f602083612a9f565b9150613b7a82613b39565b602082019050919050565b60006020820190508181036000830152613b9e81613b62565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000613bcc82613ba5565b613bd68185613bb0565b9350613be6818560208601612ab0565b613bef81612ada565b840191505092915050565b6000608082019050613c0f6000830187612ba9565b613c1c6020830186612ba9565b613c296040830185612c13565b8181036060830152613c3b8184613bc1565b905095945050505050565b600081519050613c558161297a565b92915050565b600060208284031215613c7157613c70612944565b5b6000613c7f84828501613c46565b9150509291505056fea2646970667358221220a3862d8876c89bdf8b87cfa876ce11698efcaf67a082179da37da4426f82db3264736f6c6343000812003300000000000000000000000001b3646adb846061411da058757b944049075b2200000000000000000000000000000000000000000000000000000000000002ee000000000000000000000000264f0da714b8665019389550e45106983c39c8c20000000000000000000000003e8e2dfb31556c824ab6004042068c26be56c4cc00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002968747470733a2f2f6170702e7370617274616465782e696f2f6170692f76312f6d657461646174612f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002868747470733a2f2f6170702e7370617274616465782e696f2f6170692f76312f6d65746164617461000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106101e35760003560e01c8063715018a611610102578063a22cb46511610095578063de28735911610064578063de28735914610719578063e8a3d48514610744578063e985e9c51461076f578063f2fde38b146107ac576101e3565b8063a22cb4651461065a578063b88d4fde14610683578063c23dc68f1461069f578063c87b56dd146106dc576101e3565b80638da5cb5b116100d15780638da5cb5b1461059e578063938e3d7b146105c957806395d89b41146105f257806399a2557a1461061d576101e3565b8063715018a6146104e45780637dfe5b92146104fb5780638462151c146105245780638ae3b23914610561576101e3565b806323b872dd1161017a57806342842e0e1161014957806342842e0e146104115780635bbb21771461042d5780636352211e1461046a57806370a08231146104a7576101e3565b806323b872dd146103515780632a55205a1461036d57806330176e13146103ab57806340be7bec146103d4576101e3565b8063095ea7b3116101b6578063095ea7b3146102ca5780631249c58b146102e657806318160ddd146102fd5780631e3c471514610328576101e3565b806301ffc9a7146101e8578063058430ac1461022557806306fdde0314610262578063081812fc1461028d575b600080fd5b3480156101f457600080fd5b5061020f600480360381019061020a91906129a6565b6107d5565b60405161021c91906129ee565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612a67565b6107f7565b60405161025991906129ee565b60405180910390f35b34801561026e57600080fd5b50610277610817565b6040516102849190612b24565b60405180910390f35b34801561029957600080fd5b506102b460048036038101906102af9190612b7c565b6108a9565b6040516102c19190612bb8565b60405180910390f35b6102e460048036038101906102df9190612bd3565b610907565b005b3480156102f257600080fd5b506102fb610917565b005b34801561030957600080fd5b5061031261098b565b60405161031f9190612c22565b60405180910390f35b34801561033457600080fd5b5061034f600480360381019061034a9190612a67565b6109a2565b005b61036b60048036038101906103669190612c3d565b6109b9565b005b34801561037957600080fd5b50610394600480360381019061038f9190612c90565b610c7a565b6040516103a2929190612cd0565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd9190612d5e565b610e64565b005b3480156103e057600080fd5b506103fb60048036038101906103f69190612c90565b610f4d565b6040516104089190612c22565b60405180910390f35b61042b60048036038101906104269190612c3d565b611090565b005b34801561043957600080fd5b50610454600480360381019061044f9190612e01565b6110b0565b6040516104619190612fb1565b60405180910390f35b34801561047657600080fd5b50610491600480360381019061048c9190612b7c565b611110565b60405161049e9190612bb8565b60405180910390f35b3480156104b357600080fd5b506104ce60048036038101906104c99190612a67565b611122565b6040516104db9190612c22565b60405180910390f35b3480156104f057600080fd5b506104f96111b9565b005b34801561050757600080fd5b50610522600480360381019061051d919061300c565b6111cd565b005b34801561053057600080fd5b5061054b60048036038101906105469190612a67565b6111ef565b604051610558919061310a565b60405180910390f35b34801561056d57600080fd5b5061058860048036038101906105839190612b7c565b611280565b604051610595919061313b565b60405180910390f35b3480156105aa57600080fd5b506105b36112aa565b6040516105c09190612bb8565b60405180910390f35b3480156105d557600080fd5b506105f060048036038101906105eb9190612d5e565b6112d4565b005b3480156105fe57600080fd5b506106076113bd565b6040516106149190612b24565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f9190613156565b61144f565b604051610651919061310a565b60405180910390f35b34801561066657600080fd5b50610681600480360381019061067c91906131d5565b611567565b005b61069d60048036038101906106989190613345565b611672565b005b3480156106ab57600080fd5b506106c660048036038101906106c19190612b7c565b6116c4565b6040516106d3919061341d565b60405180910390f35b3480156106e857600080fd5b5061070360048036038101906106fe9190612b7c565b611710565b6040516107109190612b24565b60405180910390f35b34801561072557600080fd5b5061072e61178d565b60405161073b9190613497565b60405180910390f35b34801561075057600080fd5b506107596117b1565b6040516107669190612b24565b60405180910390f35b34801561077b57600080fd5b50610796600480360381019061079191906134b2565b61183f565b6040516107a391906129ee565b60405180910390f35b3480156107b857600080fd5b506107d360048036038101906107ce9190612a67565b6118d3565b005b60006107e082611956565b806107f057506107ef826119e8565b5b9050919050565b600e6020528060005260406000206000915054906101000a900460ff1681565b60606002805461082690613521565b80601f016020809104026020016040519081016040528092919081815260200182805461085290613521565b801561089f5780601f106108745761010080835404028352916020019161089f565b820191906000526020600020905b81548152906001019060200180831161088257829003601f168201915b5050505050905090565b60006108b482611a62565b6108c9576108c863cf4700e460e01b611ac1565b5b6006600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61091382826001611acb565b5050565b61092033611bfa565b6000339050610930816001611c81565b6001600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610995611c9f565b6001546000540303905090565b6109ab33611ca8565b6109b6816001611c81565b50565b60006109c482611d9d565b905073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161693508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610a3957610a3863a114810060e01b611ac1565b5b600080610a4584611e53565b91509150610a5b8187610a56611e7a565b611e82565b610a8657610a7086610a6b611e7a565b61183f565b610a8557610a846359c896be60e01b611ac1565b5b5b610a938686866001611ec6565b8015610a9e57600082555b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815460010191905081905550610b6c85610b48888887611ecc565b7c020000000000000000000000000000000000000000000000000000000017611ef4565b600460008681526020019081526020016000208190555060007c0200000000000000000000000000000000000000000000000000000000841603610bf25760006001850190506000600460008381526020019081526020016000205403610bf0576000548114610bef578360046000838152602001908152602001600020819055505b5b505b600073ffffffffffffffffffffffffffffffffffffffff8673ffffffffffffffffffffffffffffffffffffffff161690508481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a460008103610c6457610c6363ea553b3460e01b611ac1565b5b610c718787876001611f1f565b50505050505050565b6000806000600960008681526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1603610e0f5760086040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b6000610e19611f25565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff1686610e459190613581565b610e4f91906135f2565b90508160000151819350935050509250929050565b610e6d33611f2f565b6000600b8054610e7c90613521565b80601f0160208091040260200160405190810160405280929190818152602001828054610ea890613521565b8015610ef55780601f10610eca57610100808354040283529160200191610ef5565b820191906000526020600020905b815481529060010190602001808311610ed857829003601f168201915b505050505090508282600b9182610f0d9291906137d0565b507fa5867b5328616714836e0684e8bf5bcd97da56e6cd01d359f25172f7f2fd6c4a81600b604051610f40929190613924565b60405180910390a1505050565b600080600d600085815260200190815260200160002060009054906101000a900460ff1660ff1690506000600a8211610fa057600282610f8d9190613581565b6064610f99919061395b565b9050611068565b60148211610fd4576005600a83610fb7919061398f565b610fc19190613581565b6078610fcd919061395b565b9050611067565b601e8211611008576008601483610feb919061398f565b610ff59190613581565b60aa611001919061395b565b9050611066565b6028821161103c57600c601e8361101f919061398f565b6110299190613581565b60fa611035919061395b565b9050611065565b600f60288361104b919061398f565b6110559190613581565b610172611062919061395b565b90505b5b5b5b6000606482866110789190613581565b61108291906135f2565b905080935050505092915050565b6110ab83838360405180602001604052806000815250611672565b505050565b606080600084849050905060405191508082528060051b90508060208301016040525b6000811461110557600060208203915081860135905060006110f4826116c4565b9050808360208601015250506110d3565b819250505092915050565b600061111b82612024565b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361116857611167638f4eb60460e01b611ac1565b5b67ffffffffffffffff600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b6111c1612036565b6111cb60006120b4565b565b6111d63361217a565b816111e08161226f565b6111ea8383612290565b505050565b606060006111fc83611122565b9050606060405190506001820160051b81016040528181526000806000611221611c9f565b90505b8482146112735760006112368261235d565b905060408101516112675780511561124d57805193505b87841860601b61126657600183019250818360051b8601525b5b60018201915050611224565b5082945050505050919050565b6000600d600083815260200190815260200160002060009054906101000a900460ff169050919050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6112dd33611f2f565b6000600c80546112ec90613521565b80601f016020809104026020016040519081016040528092919081815260200182805461131890613521565b80156113655780601f1061133a57610100808354040283529160200191611365565b820191906000526020600020905b81548152906001019060200180831161134857829003601f168201915b505050505090508282600c918261137d9291906137d0565b507fc8f194308d228309ebaa790e9225de5b2163dbdb6e49fcd28880065dd33dbe7681600c6040516113b0929190613924565b60405180910390a1505050565b6060600380546113cc90613521565b80601f01602080910402602001604051908101604052809291908181526020018280546113f890613521565b80156114455780601f1061141a57610100808354040283529160200191611445565b820191906000526020600020905b81548152906001019060200180831161142857829003601f168201915b5050505050905090565b6060818310611469576114686332c1995a60e01b611ac1565b5b611471611c9f565b83101561148357611480611c9f565b92505b600061148d612388565b905080831061149a578092505b606060006114a787611122565b9050600085871090508082029150600082146115595781878703116114cc5786860391505b60405192506001820160051b830160405260006114e8886116c4565b9050600081604001516114fd57816000015190505b60005b6115098a61235d565b9250604083015161153a5782511561152057825191505b8a821860601b61153957600181019050898160051b8701525b5b60018a019950888a148061154d57508481145b15611500578086525050505b829450505050509392505050565b8060076000611574611e7a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611621611e7a565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161166691906129ee565b60405180910390a35050565b61167d8484846109b9565b60008373ffffffffffffffffffffffffffffffffffffffff163b146116be576116a884848484612391565b6116bd576116bc63d1a57ed660e01b611ac1565b5b5b50505050565b6116cc6128eb565b6116d4611c9f565b821061170b576116e2612388565b82101561170a576116f28261235d565b9050806040015161170957611706826124c0565b90505b5b5b919050565b606061171b82611a62565b6117305761172f63a14c4b5060e01b611ac1565b5b600061173a6124e0565b9050600081510361175a5760405180602001604052806000815250611785565b8061176484612572565b6040516020016117759291906139ff565b6040516020818303038152906040525b915050919050565b7f00000000000000000000000001b3646adb846061411da058757b944049075b2281565b600c80546117be90613521565b80601f01602080910402602001604051908101604052809291908181526020018280546117ea90613521565b80156118375780601f1061180c57610100808354040283529160200191611837565b820191906000526020600020905b81548152906001019060200180831161181a57829003601f168201915b505050505081565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6118db612036565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361194a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194190613a95565b60405180910390fd5b611953816120b4565b50565b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806119b157506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806119e15750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a5b5750611a5a826125c2565b5b9050919050565b600081611a6d611c9f565b11158015611a7c575060005482105b8015611aba575060007c0100000000000000000000000000000000000000000000000000000000600460008581526020019081526020016000205416145b9050919050565b8060005260046000fd5b6000611ad683611110565b9050818015611b1857508073ffffffffffffffffffffffffffffffffffffffff16611aff611e7a565b73ffffffffffffffffffffffffffffffffffffffff1614155b15611b4457611b2e81611b29611e7a565b61183f565b611b4357611b4263cfb3b94260e01b611ac1565b5b5b836006600085815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a450505050565b600e60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611c7e576040517f363918c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b611c9b82826040518060200160405280600081525061262c565b5050565b60006001905090565b7f00000000000000000000000001b3646adb846061411da058757b944049075b2273ffffffffffffffffffffffffffffffffffffffff166391d148547fbf4730cb329bc7b3b8d6e2d2d906d5767eabf8aa280f6459bf1c5d38d5d86ec7836040518363ffffffff1660e01b8152600401611d23929190613ace565b602060405180830381865afa158015611d40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d649190613b0c565b611d9a576040517f4ed935e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600081611da8611c9f565b11611e3d576004600083815260200190815260200160002054905060007c0100000000000000000000000000000000000000000000000000000000821603611e3c5760008103611e37576000548210611e0c57611e0b63df2d9b4260e01b611ac1565b5b5b600460008360019003935083815260200190815260200160002054905060008103611e4e57611e0d565b611e4e565b5b611e4d63df2d9b4260e01b611ac1565b5b919050565b60008060006006600085815260200190815260200160002090508092508254915050915091565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e8611ee38686846126b1565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b6000612710905090565b7f00000000000000000000000001b3646adb846061411da058757b944049075b2273ffffffffffffffffffffffffffffffffffffffff166391d148547ff9c666ad895960522076ddf49f40da5a5dee670748dd686b28fe169d75a93238836040518363ffffffff1660e01b8152600401611faa929190613ace565b602060405180830381865afa158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb9190613b0c565b612021576040517f2707ed3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600061202f82611d9d565b9050919050565b61203e6126ba565b73ffffffffffffffffffffffffffffffffffffffff1661205c6112aa565b73ffffffffffffffffffffffffffffffffffffffff16146120b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a990613b85565b60405180910390fd5b565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b7f00000000000000000000000001b3646adb846061411da058757b944049075b2273ffffffffffffffffffffffffffffffffffffffff166391d148547f6ff2d1daf3b640b9ce9af47bc5a6d1a904890579b2efccded8e0562a4d8eb6ab836040518363ffffffff1660e01b81526004016121f5929190613ace565b602060405180830381865afa158015612212573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122369190613b0c565b61226c576040517fe80d0ba600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b61227881611a62565b61228d5761228c63a14c4b5060e01b611ac1565b5b50565b6000600d600084815260200190815260200160002060009054906101000a900460ff1690508160ff168160ff16106122f4576040517f2e43229a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600d600085815260200190815260200160002060006101000a81548160ff021916908360ff160217905550827f14d54973c509ce10520c1e0be443c7340095855c124ddda2a3627d4fa542d85183604051612350919061313b565b60405180910390a2505050565b6123656128eb565b61238160046000848152602001908152602001600020546126c2565b9050919050565b60008054905090565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a026123b7611e7a565b8786866040518563ffffffff1660e01b81526004016123d99493929190613bfa565b6020604051808303816000875af192505050801561241557506040513d601f19601f820116820180604052508101906124129190613c5b565b60015b61246d573d8060008114612445576040519150601f19603f3d011682016040523d82523d6000602084013e61244a565b606091505b5060008151036124655761246463d1a57ed660e01b611ac1565b5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b6124c86128eb565b6124d96124d483611d9d565b6126c2565b9050919050565b6060600b80546124ef90613521565b80601f016020809104026020016040519081016040528092919081815260200182805461251b90613521565b80156125685780601f1061253d57610100808354040283529160200191612568565b820191906000526020600020905b81548152906001019060200180831161254b57829003601f168201915b5050505050905090565b606060a060405101806040526020810391506000825281835b6001156125ad57600184039350600a81066030018453600a810490508061258b575b50828103602084039350808452505050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6126368383612778565b60008373ffffffffffffffffffffffffffffffffffffffff163b146126ac57600080549050600083820390505b6126766000868380600101945086612391565b61268b5761268a63d1a57ed660e01b611ac1565b5b8181106126635781600054146126a9576126a8600060e01b611ac1565b5b50505b505050565b60009392505050565b600033905090565b6126ca6128eb565b81816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060a082901c816020019067ffffffffffffffff16908167ffffffffffffffff168152505060007c01000000000000000000000000000000000000000000000000000000008316141581604001901515908115158152505060e882901c816060019062ffffff16908162ffffff1681525050919050565b600080549050600082036127975761279663b562e8dd60e01b611ac1565b5b6127a46000848385611ec6565b6127c4836127b56000866000611ecc565b6127be856128db565b17611ef4565b6004600083815260200190815260200160002081905550600160406001901b178202600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161690506000810361287c5761287b632e07630060e01b611ac1565b5b6000838301905060008390505b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a481816001019150810361288957816000819055505050506128d66000848385611f1f565b505050565b60006001821460e11b9050919050565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff168152602001600015158152602001600062ffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6129838161294e565b811461298e57600080fd5b50565b6000813590506129a08161297a565b92915050565b6000602082840312156129bc576129bb612944565b5b60006129ca84828501612991565b91505092915050565b60008115159050919050565b6129e8816129d3565b82525050565b6000602082019050612a0360008301846129df565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3482612a09565b9050919050565b612a4481612a29565b8114612a4f57600080fd5b50565b600081359050612a6181612a3b565b92915050565b600060208284031215612a7d57612a7c612944565b5b6000612a8b84828501612a52565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ace578082015181840152602081019050612ab3565b60008484015250505050565b6000601f19601f8301169050919050565b6000612af682612a94565b612b008185612a9f565b9350612b10818560208601612ab0565b612b1981612ada565b840191505092915050565b60006020820190508181036000830152612b3e8184612aeb565b905092915050565b6000819050919050565b612b5981612b46565b8114612b6457600080fd5b50565b600081359050612b7681612b50565b92915050565b600060208284031215612b9257612b91612944565b5b6000612ba084828501612b67565b91505092915050565b612bb281612a29565b82525050565b6000602082019050612bcd6000830184612ba9565b92915050565b60008060408385031215612bea57612be9612944565b5b6000612bf885828601612a52565b9250506020612c0985828601612b67565b9150509250929050565b612c1c81612b46565b82525050565b6000602082019050612c376000830184612c13565b92915050565b600080600060608486031215612c5657612c55612944565b5b6000612c6486828701612a52565b9350506020612c7586828701612a52565b9250506040612c8686828701612b67565b9150509250925092565b60008060408385031215612ca757612ca6612944565b5b6000612cb585828601612b67565b9250506020612cc685828601612b67565b9150509250929050565b6000604082019050612ce56000830185612ba9565b612cf26020830184612c13565b9392505050565b600080fd5b600080fd5b600080fd5b60008083601f840112612d1e57612d1d612cf9565b5b8235905067ffffffffffffffff811115612d3b57612d3a612cfe565b5b602083019150836001820283011115612d5757612d56612d03565b5b9250929050565b60008060208385031215612d7557612d74612944565b5b600083013567ffffffffffffffff811115612d9357612d92612949565b5b612d9f85828601612d08565b92509250509250929050565b60008083601f840112612dc157612dc0612cf9565b5b8235905067ffffffffffffffff811115612dde57612ddd612cfe565b5b602083019150836020820283011115612dfa57612df9612d03565b5b9250929050565b60008060208385031215612e1857612e17612944565b5b600083013567ffffffffffffffff811115612e3657612e35612949565b5b612e4285828601612dab565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612e8381612a29565b82525050565b600067ffffffffffffffff82169050919050565b612ea681612e89565b82525050565b612eb5816129d3565b82525050565b600062ffffff82169050919050565b612ed381612ebb565b82525050565b608082016000820151612eef6000850182612e7a565b506020820151612f026020850182612e9d565b506040820151612f156040850182612eac565b506060820151612f286060850182612eca565b50505050565b6000612f3a8383612ed9565b60808301905092915050565b6000602082019050919050565b6000612f5e82612e4e565b612f688185612e59565b9350612f7383612e6a565b8060005b83811015612fa4578151612f8b8882612f2e565b9750612f9683612f46565b925050600181019050612f77565b5085935050505092915050565b60006020820190508181036000830152612fcb8184612f53565b905092915050565b600060ff82169050919050565b612fe981612fd3565b8114612ff457600080fd5b50565b60008135905061300681612fe0565b92915050565b6000806040838503121561302357613022612944565b5b600061303185828601612b67565b925050602061304285828601612ff7565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61308181612b46565b82525050565b60006130938383613078565b60208301905092915050565b6000602082019050919050565b60006130b78261304c565b6130c18185613057565b93506130cc83613068565b8060005b838110156130fd5781516130e48882613087565b97506130ef8361309f565b9250506001810190506130d0565b5085935050505092915050565b6000602082019050818103600083015261312481846130ac565b905092915050565b61313581612fd3565b82525050565b6000602082019050613150600083018461312c565b92915050565b60008060006060848603121561316f5761316e612944565b5b600061317d86828701612a52565b935050602061318e86828701612b67565b925050604061319f86828701612b67565b9150509250925092565b6131b2816129d3565b81146131bd57600080fd5b50565b6000813590506131cf816131a9565b92915050565b600080604083850312156131ec576131eb612944565b5b60006131fa85828601612a52565b925050602061320b858286016131c0565b9150509250929050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61325282612ada565b810181811067ffffffffffffffff821117156132715761327061321a565b5b80604052505050565b600061328461293a565b90506132908282613249565b919050565b600067ffffffffffffffff8211156132b0576132af61321a565b5b6132b982612ada565b9050602081019050919050565b82818337600083830152505050565b60006132e86132e384613295565b61327a565b90508281526020810184848401111561330457613303613215565b5b61330f8482856132c6565b509392505050565b600082601f83011261332c5761332b612cf9565b5b813561333c8482602086016132d5565b91505092915050565b6000806000806080858703121561335f5761335e612944565b5b600061336d87828801612a52565b945050602061337e87828801612a52565b935050604061338f87828801612b67565b925050606085013567ffffffffffffffff8111156133b0576133af612949565b5b6133bc87828801613317565b91505092959194509250565b6080820160008201516133de6000850182612e7a565b5060208201516133f16020850182612e9d565b5060408201516134046040850182612eac565b5060608201516134176060850182612eca565b50505050565b600060808201905061343260008301846133c8565b92915050565b6000819050919050565b600061345d61345861345384612a09565b613438565b612a09565b9050919050565b600061346f82613442565b9050919050565b600061348182613464565b9050919050565b61349181613476565b82525050565b60006020820190506134ac6000830184613488565b92915050565b600080604083850312156134c9576134c8612944565b5b60006134d785828601612a52565b92505060206134e885828601612a52565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061353957607f821691505b60208210810361354c5761354b6134f2565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061358c82612b46565b915061359783612b46565b92508282026135a581612b46565b915082820484148315176135bc576135bb613552565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006135fd82612b46565b915061360883612b46565b925082613618576136176135c3565b5b828204905092915050565b600082905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026136907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82613653565b61369a8683613653565b95508019841693508086168417925050509392505050565b60006136cd6136c86136c384612b46565b613438565b612b46565b9050919050565b6000819050919050565b6136e7836136b2565b6136fb6136f3826136d4565b848454613660565b825550505050565b600090565b613710613703565b61371b8184846136de565b505050565b5b8181101561373f57613734600082613708565b600181019050613721565b5050565b601f821115613784576137558161362e565b61375e84613643565b8101602085101561376d578190505b61378161377985613643565b830182613720565b50505b505050565b600082821c905092915050565b60006137a760001984600802613789565b1980831691505092915050565b60006137c08383613796565b9150826002028217905092915050565b6137da8383613623565b67ffffffffffffffff8111156137f3576137f261321a565b5b6137fd8254613521565b613808828285613743565b6000601f8311600181146138375760008415613825578287013590505b61382f85826137b4565b865550613897565b601f1984166138458661362e565b60005b8281101561386d57848901358255600182019150602085019450602081019050613848565b8683101561388a5784890135613886601f891682613796565b8355505b6001600288020188555050505b50505050505050565b600081546138ad81613521565b6138b78186612a9f565b945060018216600081146138d257600181146138e85761391b565b60ff19831686528115156020028601935061391b565b6138f18561362e565b60005b83811015613913578154818901526001820191506020810190506138f4565b808801955050505b50505092915050565b6000604082019050818103600083015261393e8185612aeb565b9050818103602083015261395281846138a0565b90509392505050565b600061396682612b46565b915061397183612b46565b925082820190508082111561398957613988613552565b5b92915050565b600061399a82612b46565b91506139a583612b46565b92508282039050818111156139bd576139bc613552565b5b92915050565b600081905092915050565b60006139d982612a94565b6139e381856139c3565b93506139f3818560208601612ab0565b80840191505092915050565b6000613a0b82856139ce565b9150613a1782846139ce565b91508190509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613a7f602683612a9f565b9150613a8a82613a23565b604082019050919050565b60006020820190508181036000830152613aae81613a72565b9050919050565b6000819050919050565b613ac881613ab5565b82525050565b6000604082019050613ae36000830185613abf565b613af06020830184612ba9565b9392505050565b600081519050613b06816131a9565b92915050565b600060208284031215613b2257613b21612944565b5b6000613b3084828501613af7565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613b6f602083612a9f565b9150613b7a82613b39565b602082019050919050565b60006020820190508181036000830152613b9e81613b62565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000613bcc82613ba5565b613bd68185613bb0565b9350613be6818560208601612ab0565b613bef81612ada565b840191505092915050565b6000608082019050613c0f6000830187612ba9565b613c1c6020830186612ba9565b613c296040830185612c13565b8181036060830152613c3b8184613bc1565b905095945050505050565b600081519050613c558161297a565b92915050565b600060208284031215613c7157613c70612944565b5b6000613c7f84828501613c46565b9150509291505056fea2646970667358221220a3862d8876c89bdf8b87cfa876ce11698efcaf67a082179da37da4426f82db3264736f6c63430008120033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000001b3646adb846061411da058757b944049075b2200000000000000000000000000000000000000000000000000000000000002ee000000000000000000000000264f0da714b8665019389550e45106983c39c8c20000000000000000000000003e8e2dfb31556c824ab6004042068c26be56c4cc00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002968747470733a2f2f6170702e7370617274616465782e696f2f6170692f76312f6d657461646174612f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002868747470733a2f2f6170702e7370617274616465782e696f2f6170692f76312f6d65746164617461000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : acl_ (address): 0x01B3646Adb846061411Da058757B944049075B22
Arg [1] : royaltyNumerator_ (uint96): 750
Arg [2] : owner_ (address): 0x264f0DA714B8665019389550E45106983C39c8c2
Arg [3] : treasury_ (address): 0x3E8E2dfb31556c824ab6004042068c26bE56c4cc
Arg [4] : baseTokenURI_ (string): https://app.spartadex.io/api/v1/metadata/
Arg [5] : contractURI_ (string): https://app.spartadex.io/api/v1/metadata

-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 00000000000000000000000001b3646adb846061411da058757b944049075b22
Arg [1] : 00000000000000000000000000000000000000000000000000000000000002ee
Arg [2] : 000000000000000000000000264f0da714b8665019389550e45106983c39c8c2
Arg [3] : 0000000000000000000000003e8e2dfb31556c824ab6004042068c26be56c4cc
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000029
Arg [7] : 68747470733a2f2f6170702e7370617274616465782e696f2f6170692f76312f
Arg [8] : 6d657461646174612f0000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000028
Arg [10] : 68747470733a2f2f6170702e7370617274616465782e696f2f6170692f76312f
Arg [11] : 6d65746164617461000000000000000000000000000000000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.