ETH Price: $3,487.77 (-0.09%)

Element 369 (E369)
 

Overview

TokenID

240

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
Element369NFT

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 31 : Element369NFT.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.26;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/interfaces/IERC165.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import "erc721a/contracts/ERC721A.sol";
import "./interfaces/IWETH9.sol";
import "./interfaces/IE369HolderVault.sol";
import "./lib/constants.sol";
import "./lib/Time.sol";
import "./lib/OracleLibrary.sol";
import "./lib/TickMath.sol";

/// @title Element 369 NFT Contract
contract Element369NFT is ERC721A, Ownable, IERC165 {
    using SafeERC20 for IERC20;
    using Strings for uint8;

    // --------------------------- STATE VARIABLES --------------------------- //

    address public immutable devWallet;
    address public FluxHub;
    address public HolderVault;

    string public contractURI;
    string public baseURI;

    /// @notice Total multipliers of all existing tokens.
    /// @dev Used in cycle reward calculation of the Element 369 Holder Vault contract.
    uint256 public multiplierPool;

    /// @notice Time used for TWAP calculation
    uint32 public secondsAgo = 5 * 60;

    /// @notice Allowed deviation of the minAmountOut from historical price.
    uint32 public deviation = 1000;

    /// @notice Static multipliers per tier used during mint.
    mapping(uint8 tier => uint16) public tierMultipliers;

    /// @notice Static prices per tier used during mint.
    mapping(uint8 tier => uint256) public tierPrices;

    /// @notice Packed data per each NFT.
    /// @dev Includes: Tier, Multiplier, Mint Cycle, Burn Cycle, Owner at the time of burn.
    mapping(uint256 => uint256) private _packedTokenData;

    mapping(uint32 cycle777Id => bool) private is777MultipliersSet;

    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
    event ContractURIUpdated();

    // --------------------------- MODIFIERS --------------------------- //

    modifier onlySale() {
        if (!isSaleActive()) revert SaleInactive();
        _;
    }

    error SaleInactive();
    error ZeroInput();
    error ZeroAddress();
    error IncorrectTier();
    error Unauthorized();
    error Prohibited();
    error DataQueryForNonexistentToken();
    error TWAP();

    // --------------------------- CONSTRUCTOR --------------------------- //

    constructor(address _owner, address _devWallet, string memory _contractURI, string memory _baseURI)
        ERC721A("Element 369", "E369")
        Ownable(_owner)
    {
        if (_owner == address(0)) revert ZeroAddress();
        if (_devWallet == address(0)) revert ZeroAddress();
        if (bytes(_contractURI).length == 0) revert ZeroInput();
        if (bytes(_baseURI).length == 0) revert ZeroInput();

        contractURI = _contractURI;
        baseURI = _baseURI;
        devWallet = _devWallet;

        tierMultipliers[1] = 1;
        tierMultipliers[2] = 10;
        tierMultipliers[3] = 100;

        tierPrices[1] = 100_000_000 ether;
        tierPrices[2] = 1_000_000_000 ether;
        tierPrices[3] = 10_000_000_000 ether;
    }

    // --------------------------- PUBLIC FUNCTIONS --------------------------- //

    /// @notice Mints NFTs using TitanX tokens during the presale.
    /// @param tieredNfts List of NFTs to mint, represented by their tier number.
    function mintWithTitanX(uint8[] calldata tieredNfts) public onlySale {
        if (FluxHub == address(0)) revert ZeroAddress();
        updateMultipliersIfNecessary();
        uint256 titanXPool = _processNftTiers(tieredNfts);
        uint256 devFee = titanXPool * DEV_PERCENT / PERCENTAGE_BASE;
        IERC20 titanX = IERC20(TITANX);
        titanX.safeTransferFrom(msg.sender, FluxHub, titanXPool - devFee);
        titanX.safeTransferFrom(msg.sender, devWallet, devFee);
        _mint(msg.sender, tieredNfts.length);
    }

    /// @notice Mints NFTs using Ethereum during the presale.
    /// @param tieredNfts List of NFTs to mint, represented by their tier number.
    /// @param deadline Deadline for the transaction.
    /// @dev Refunds TitanX if the amount swapped is greater than the price.
    function mintWithEth(uint8[] calldata tieredNfts, uint256 deadline) public payable onlySale {
        if (FluxHub == address(0)) revert ZeroAddress();
        updateMultipliersIfNecessary();
        uint256 titanXPool = _processNftTiers(tieredNfts);
        uint256 devFee = titanXPool * DEV_PERCENT / PERCENTAGE_BASE;
        uint256 swappedAmount = _swapETHForTitanX(titanXPool, deadline);
        IERC20 titanX = IERC20(TITANX);
        titanX.safeTransfer(FluxHub, titanXPool - devFee);
        titanX.safeTransfer(devWallet, devFee);
        if (swappedAmount > titanXPool) {
            titanX.safeTransfer(msg.sender, swappedAmount - titanXPool);
        }
        _mint(msg.sender, tieredNfts.length);
    }

    /// @notice Burns provided NFT token IDs from the owner and stores burn cycle.
    /// @param tokenIds Token IDs to burn.
    function batchBurn(uint256[] calldata tokenIds) external {
        if (tokenIds.length == 0) revert ZeroInput();
        uint32 currentCycle = getCurrentE369Cycle();
        uint32 currentCycle777 = getCurrentCycle777();
        uint32 startCycleId = getStartCycleForCycle777(currentCycle777);
        uint32 endCycleId = getEndCycleForCycle777(currentCycle777);
        if (currentCycle > startCycleId && currentCycle < endCycleId && currentCycle777 < MAX_777_CYCLES_NUMBER) {
            uint256 totalApplicableMultipliers;
            for (uint256 i = 0; i < tokenIds.length; i++) {
                uint256 tokenId = tokenIds[i];
                if (ownerOf(tokenId) != msg.sender) revert Unauthorized();
                _burn(tokenId);
                (uint16 multiplier, uint64 mintCycle) = _updateBurnCycleConditional(tokenId, currentCycle, msg.sender);
                if (mintCycle <= startCycleId) totalApplicableMultipliers += multiplier;
                multiplierPool -= multiplier;
            }
            IE369HolderVault(HolderVault).updateStoredMultipliersOnBurn(
                currentCycle777, multiplierPool, totalApplicableMultipliers
            );
        } else {
            for (uint256 i = 0; i < tokenIds.length; i++) {
                uint256 tokenId = tokenIds[i];
                if (ownerOf(tokenId) != msg.sender) revert Unauthorized();
                _burn(tokenId);
                multiplierPool -= _updateBurnCycle(tokenId, currentCycle, msg.sender);
            }
        }
    }

    function updateMultipliersIfNecessary() public {
        uint32 currentCycle = getCurrentE369Cycle();
        uint32 currentCycle777 = getCurrentCycle777();
        if (currentCycle777 >= MAX_777_CYCLES_NUMBER) return;
        if (!is777MultipliersSet[currentCycle777] && currentCycle > getStartCycleForCycle777(currentCycle777)) {
            IE369HolderVault(HolderVault).updateStoredMultipliers(currentCycle777, multiplierPool);
            is777MultipliersSet[currentCycle777] = true;
        }
    }

    function getCurrentE369Cycle() public view returns (uint32) {
        uint32 daysPassed = Time.daysSince(FLUX_START_DATE) + 1;
        return daysPassed / E369_CYCLE_INTERVAL;
    }

    /// @notice Returns the current 777 day cycle.
    function getCurrentCycle777() public view returns (uint32) {
        uint32 daysPassed = Time.daysSince(FLUX_START_DATE) + 1;
        return daysPassed / CYCLE_777_DAYS;
    }

    function getStartCycleForCycle777(uint32 cycle777Id) public pure returns (uint32) {
        return ((CYCLE_777_DAYS * cycle777Id) + CYCLE_777_DAYS / 2) / E369_CYCLE_INTERVAL - 1;
    }

    function getEndCycleForCycle777(uint32 cycle777Id) public pure returns (uint32) {
        return ((CYCLE_777_DAYS * (cycle777Id + 1)) / E369_CYCLE_INTERVAL);
    }

    // --------------------------- ADMINISTRATIVE FUNCTIONS --------------------------- //

    /// @notice Sets the Element 369 Protocol addresses.
    /// @param _vault The address of the Holder Vault contract.
    /// @param _hub The address of the Flux Hub contract.
    function setProtocolAddresses(address _vault, address _hub) external onlyOwner {
        if (HolderVault != address(0)) revert Prohibited();
        if (_vault == address(0)) revert ZeroAddress();
        if (_hub == address(0)) revert ZeroAddress();
        HolderVault = _vault;
        FluxHub = _hub;
        IE369HolderVault(HolderVault).setFluxHub(_hub);
    }

    /// @notice Sets the contract-level metadata URI.
    /// @param _uri The URI of the contract metadata.
    function setContractURI(string memory _uri) external onlyOwner {
        if (bytes(_uri).length == 0) revert ZeroInput();
        contractURI = _uri;
        emit ContractURIUpdated();
    }

    /// @notice Sets NFTs base URI.
    /// @param _uri The base URI string.
    function setBaseURI(string memory _uri) external onlyOwner {
        if (bytes(_uri).length == 0) revert ZeroInput();
        baseURI = _uri;
        emit BatchMetadataUpdate(1, type(uint256).max);
    }

    /// @notice Sets the number of seconds to look back for TWAP price calculations.
    /// @param limit The number of seconds to use for TWAP price lookback.
    function setSecondsAgo(uint32 limit) external onlyOwner {
        if (limit == 0) revert ZeroInput();
        secondsAgo = limit;
    }

    /// @notice Sets the allowed price deviation for TWAP checks.
    /// @param limit The allowed deviation in basis points (e.g., 500 = 5%).
    function setDeviation(uint32 limit) external onlyOwner {
        if (limit == 0) revert ZeroInput();
        if (limit > BPS_BASE) revert Prohibited();
        deviation = limit;
    }

    // --------------------------- VIEW FUNCTIONS --------------------------- //

    /// @notice Returns if token mint is currently active.
    function isSaleActive() public view returns (bool) {
        if (Time.blockTs() < MINT_START_DATE || Time.blockTs() > ELEMENT_END_DATE) return false;
        uint32 daysPassed = Time.daysSince(FLUX_START_DATE) + 1;
        if (daysPassed <= 132) return true;
        uint256 cyclesPassed = daysPassed / MINT_CYCLE_LENGTH;
        return cyclesPassed % 2 == 0;
    }

    /// @notice Returns the total number of NFTs per tier.
    /// @param start Token id to start with.
    /// @param limit Limit of the results returned.
    /// @return total An array where each index corresponds to the total NFTs for a specific tier.
    /// @dev Should not be called by contracts.
    function getTotalNftsPerTiers(uint256 start, uint256 limit) external view returns (uint256[] memory total) {
        uint256 totalTokenIds = _nextTokenId();
        uint256 end = start + limit > totalTokenIds ? totalTokenIds : start + limit;
        total = new uint256[](3);
        for (uint256 tokenId = start; tokenId < end; tokenId++) {
            if (_exists(tokenId)) {
                total[_getNftTier(_packedTokenData[tokenId]) - 1]++;
            }
        }
    }

    /// @notice Returns all token IDs owned by a specific account.
    /// @param account The address of the token owner.
    /// @return tokenIds An array of token IDs owned by the account.
    /// @dev Should not be called by contracts.
    function tokenIdsOf(address account) external view returns (uint256[] memory tokenIds) {
        uint256 totalTokenIds = _nextTokenId();
        uint256 userBalance = balanceOf(account);
        tokenIds = new uint256[](userBalance);
        if (userBalance == 0) return tokenIds;
        uint256 counter;
        for (uint256 tokenId = 1; tokenId < totalTokenIds; tokenId++) {
            if (_exists(tokenId) && ownerOf(tokenId) == account) {
                tokenIds[counter] = tokenId;
                counter++;
                if (counter == userBalance) return tokenIds;
            }
        }
    }

    /// @notice Returns the total number of NFTs burned.
    function totalBurned() external view returns (uint256) {
        return _totalBurned();
    }

    /// @notice Returns the packed data for Token IDs of the owner.
    /// @param tokenIds Array of Token IDs to query.
    /// @param account Owner of token IDs.
    /// @return data Array of packed data for corresponding token IDs.
    /// @dev Returns zero address if not burned.
    function batchGetPackedTokenData(uint256[] memory tokenIds, address account)
        external
        view
        returns (uint256[] memory data)
    {
        data = new uint256[](tokenIds.length);
        for (uint256 i = 0; i < tokenIds.length; i++) {
            uint256 tokenId = tokenIds[i];
            uint256 tokenData = _packedTokenData[tokenId];
            if (_getBurnCycle(tokenData) == 0) {
                if (ownerOf(tokenId) != account) revert Unauthorized();
            } else {
                if (_getBurnAddress(tokenData) != account) revert Unauthorized();
            }
            data[i] = tokenData;
        }
    }

    /// @notice Returns the decoded data for Token IDs.
    /// @param tokenIds Array of Token IDs to query.
    /// @return tiers Array of tiers for corresponding token IDs.
    /// @return multipliers Array of multipliers for corresponding token IDs.
    /// @return mintCycles Array of mint cycle IDs for corresponding token IDs.
    /// @return burnCycles Array of burn cycle IDs for corresponding token IDs.
    /// @return burnAddresses Array of burn wallet addresses of the owners who burned the token for corresponding token IDs.
    /// @dev Returns zero address if not burned.
    function batchGetTokenData(uint256[] memory tokenIds)
        external
        view
        returns (
            uint8[] memory tiers,
            uint16[] memory multipliers,
            uint32[] memory mintCycles,
            uint32[] memory burnCycles,
            address[] memory burnAddresses
        )
    {
        tiers = new uint8[](tokenIds.length);
        multipliers = new uint16[](tokenIds.length);
        mintCycles = new uint32[](tokenIds.length);
        burnCycles = new uint32[](tokenIds.length);
        burnAddresses = new address[](tokenIds.length);
        for (uint256 i = 0; i < tokenIds.length; i++) {
            uint256 tokenId = tokenIds[i];
            uint256 tokenData = _packedTokenData[tokenId];
            tiers[i] = _getNftTier(tokenData);
            multipliers[i] = _getMultiplier(tokenData);
            uint32 mintCycle = _getMintCycle(tokenData);
            if (mintCycle == 0) revert DataQueryForNonexistentToken();
            mintCycles[i] = mintCycle;
            burnCycles[i] = _getBurnCycle(tokenData);
            burnAddresses[i] = _getBurnAddress(tokenData);
        }
    }

    /// @notice Returns a tier number for a specific token ID.
    /// @param tokenId Token ID of the token.
    /// @return Tier of the NFT.
    function getNftTier(uint256 tokenId) public view returns (uint8) {
        uint256 packedData = _packedTokenData[tokenId];
        return _getNftTier(packedData);
    }

    /// @notice Returns a multiplier for a specific token ID.
    /// @param tokenId Token ID of the token.
    /// @return Multiplier of the NFT.
    function getMultiplier(uint256 tokenId) public view returns (uint64) {
        uint256 packedData = _packedTokenData[tokenId];
        return _getMultiplier(packedData);
    }

    /// @notice Returns Cycle ID of when the token ID was minted.
    /// @param tokenId Token ID of the token.
    /// @return Cycle ID when NFT was minted.
    function getMintCycle(uint256 tokenId) public view returns (uint64) {
        uint256 packedData = _packedTokenData[tokenId];
        return _getMintCycle(packedData);
    }

    /// @notice Returns Cycle ID of when the token ID was burned.
    /// @param tokenId Token ID of the token.
    /// @return Cycle ID when NFT was burned.
    /// @dev Returns 0 if not burned.
    function getBurnCycle(uint256 tokenId) public view returns (uint64) {
        uint256 packedData = _packedTokenData[tokenId];
        return _getBurnCycle(packedData);
    }

    /// @notice Returns the wallet address of the owner that burned the Token ID.
    /// @param tokenId Token ID of the token.
    /// @return Wallet address of the owner.
    /// @dev Returns zero address if not burned.
    function getBurnAddress(uint256 tokenId) public view returns (address) {
        uint256 packedData = _packedTokenData[tokenId];
        return _getBurnAddress(packedData);
    }

    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
        return string(abi.encodePacked(baseURI, getNftTier(tokenId).toString(), ".json"));
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721A) returns (bool) {
        return interfaceId == INTERFACE_ID_ERC165 || interfaceId == INTERFACE_ID_ERC721
            || interfaceId == INTERFACE_ID_ERC721Metadata || super.supportsInterface(interfaceId);
    }

    // --------------------------- INTERNAL FUNCTIONS --------------------------- //

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

    function _processNftTiers(uint8[] calldata tieredNfts) internal returns (uint256 titanXPool) {
        if (tieredNfts.length == 0) revert ZeroInput();
        uint256 currentIndex = _nextTokenId();
        uint32 currentCycle = getCurrentE369Cycle();
        for (uint256 i = 0; i < tieredNfts.length; i++) {
            uint8 tier = tieredNfts[i];
            if (tier == 0 || tier > 3) revert IncorrectTier();
            uint16 multiplier = tierMultipliers[tier];
            _setNftData(currentIndex + i, tier, multiplier, currentCycle);

            unchecked {
                multiplierPool += multiplier;
                titanXPool += tierPrices[tier];
            }
        }
    }

    function _getNftTier(uint256 packedData) internal pure returns (uint8) {
        return uint8(packedData & BITMASK_NFT_TIER);
    }

    function _getMultiplier(uint256 packedData) internal pure returns (uint16) {
        return uint16((packedData >> BITPOS_MULTIPLIER) & BITMASK_MULTIPLIER);
    }

    function _getMintCycle(uint256 packedData) internal pure returns (uint32) {
        return uint32((packedData >> BITPOS_MINT_CYCLE) & BITMASK_MINT_CYCLE);
    }

    function _getBurnCycle(uint256 packedData) internal pure returns (uint32) {
        return uint32((packedData >> BITPOS_BURN_CYCLE) & BITMASK_BURN_CYCLE);
    }

    function _getBurnAddress(uint256 packedData) internal pure returns (address) {
        return address(uint160((packedData >> BITPOS_BURN_ADDRESS) & BITMASK_BURN_ADDRESS));
    }

    function _setNftData(uint256 tokenId, uint8 nftTier, uint16 multiplier, uint64 mintCycle) internal {
        uint256 packedData = _packData(nftTier, multiplier, mintCycle);
        _packedTokenData[tokenId] = packedData;
    }

    function _packData(uint8 nftTier, uint16 multiplier, uint64 mintCycle) internal pure returns (uint256) {
        return (uint256(nftTier) << BITPOS_NFT_TIER) | uint256(multiplier) << BITPOS_MULTIPLIER
            | (uint256(mintCycle) << BITPOS_MINT_CYCLE);
    }

    function _updateBurnCycle(uint256 tokenId, uint64 burnCycle, address burnAddress) internal returns (uint16) {
        uint256 packedData = _packedTokenData[tokenId];
        uint16 multiplier = _getMultiplier(packedData);
        packedData =
            (packedData & ~(BITMASK_BURN_CYCLE << BITPOS_BURN_CYCLE)) & ~(BITMASK_BURN_ADDRESS << BITPOS_BURN_ADDRESS);

        packedData |= (uint256(burnCycle) << BITPOS_BURN_CYCLE);
        packedData |= (uint256(uint160(burnAddress)) << BITPOS_BURN_ADDRESS);

        _packedTokenData[tokenId] = packedData;
        return multiplier;
    }

    function _updateBurnCycleConditional(uint256 tokenId, uint64 burnCycle, address burnAddress)
        internal
        returns (uint16 multiplier, uint64 mintCycle)
    {
        uint256 packedData = _packedTokenData[tokenId];
        multiplier = _getMultiplier(packedData);
        mintCycle = _getMintCycle(packedData);

        packedData =
            (packedData & ~(BITMASK_BURN_CYCLE << BITPOS_BURN_CYCLE)) & ~(BITMASK_BURN_ADDRESS << BITPOS_BURN_ADDRESS);

        packedData |= (uint256(burnCycle) << BITPOS_BURN_CYCLE);
        packedData |= (uint256(uint160(burnAddress)) << BITPOS_BURN_ADDRESS);

        _packedTokenData[tokenId] = packedData;
    }

    function _swapETHForTitanX(uint256 minAmountOut, uint256 deadline) internal returns (uint256) {
        IWETH9(WETH9).deposit{value: msg.value}();
        _twapCheck(WETH9, TITANX, msg.value, minAmountOut);
        ISwapRouter.ExactInputSingleParams memory params = ISwapRouter.ExactInputSingleParams({
            tokenIn: WETH9,
            tokenOut: TITANX,
            fee: POOL_FEE_1PERCENT,
            recipient: address(this),
            deadline: deadline,
            amountIn: msg.value,
            amountOutMinimum: minAmountOut,
            sqrtPriceLimitX96: 0
        });
        IERC20(WETH9).safeIncreaseAllowance(UNISWAP_V3_ROUTER, msg.value);
        uint256 amountOut = ISwapRouter(UNISWAP_V3_ROUTER).exactInputSingle(params);
        return amountOut;
    }

    function _twapCheck(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut) internal view {
        address poolAddress = TITANX_WETH_POOL;
        uint32 _secondsAgo = secondsAgo;
        uint32 oldestObservation = OracleLibrary.getOldestObservationSecondsAgo(poolAddress);
        if (oldestObservation < _secondsAgo) {
            _secondsAgo = oldestObservation;
        }

        (int24 arithmeticMeanTick,) = OracleLibrary.consult(poolAddress, _secondsAgo);
        uint160 sqrtPriceX96 = TickMath.getSqrtRatioAtTick(arithmeticMeanTick);
        uint256 twapAmountOut =
            OracleLibrary.getQuoteForSqrtRatioX96(sqrtPriceX96, uint128(amountIn), tokenIn, tokenOut);
        uint256 lowerBound = (twapAmountOut * (BPS_BASE - deviation)) / BPS_BASE;

        if (minAmountOut < lowerBound) revert TWAP();
    }
}

File 2 of 31 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

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

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

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

File 3 of 31 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../utils/introspection/IERC165.sol";

File 4 of 31 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";

File 5 of 31 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
        external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 6 of 31 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

File 7 of 31 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 8 of 31 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success,) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(address target, bool success, bytes memory returndata)
        internal
        view
        returns (bytes memory)
    {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

File 9 of 31 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 10 of 31 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @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 11 of 31 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero

    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
     * Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.
            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 12 of 31 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 13 of 31 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant HEX_DIGITS = "0123456789abcdef";
    uint8 private constant ADDRESS_LENGTH = 20;

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        uint256 localValue = value;
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = HEX_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
     * representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 14 of 31 : IUniswapV3SwapCallback.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
    /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
    /// @dev In the implementation you must pay the pool tokens owed for the swap.
    /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
    /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
    /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
    /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
    /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
    function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes calldata data) external;
}

File 15 of 31 : IUniswapV3Pool.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import "./pool/IUniswapV3PoolImmutables.sol";
import "./pool/IUniswapV3PoolState.sol";
import "./pool/IUniswapV3PoolDerivedState.sol";
import "./pool/IUniswapV3PoolActions.sol";
import "./pool/IUniswapV3PoolOwnerActions.sol";
import "./pool/IUniswapV3PoolEvents.sol";

/// @title The interface for a Uniswap V3 Pool
/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @dev The pool interface is broken up into many smaller pieces
interface IUniswapV3Pool is
    IUniswapV3PoolImmutables,
    IUniswapV3PoolState,
    IUniswapV3PoolDerivedState,
    IUniswapV3PoolActions,
    IUniswapV3PoolOwnerActions,
    IUniswapV3PoolEvents
{}

File 16 of 31 : IUniswapV3PoolActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface IUniswapV3PoolActions {
    /// @notice Sets the initial price for the pool
    /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value
    /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96
    function initialize(uint160 sqrtPriceX96) external;

    /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
    /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
    /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
    /// on tickLower, tickUpper, the amount of liquidity, and the current price.
    /// @param recipient The address for which the liquidity will be created
    /// @param tickLower The lower tick of the position in which to add liquidity
    /// @param tickUpper The upper tick of the position in which to add liquidity
    /// @param amount The amount of liquidity to mint
    /// @param data Any data that should be passed through to the callback
    /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
    /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
    function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes calldata data)
        external
        returns (uint256 amount0, uint256 amount1);

    /// @notice Collects tokens owed to a position
    /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
    /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
    /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
    /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
    /// @param recipient The address which should receive the fees collected
    /// @param tickLower The lower tick of the position for which to collect fees
    /// @param tickUpper The upper tick of the position for which to collect fees
    /// @param amount0Requested How much token0 should be withdrawn from the fees owed
    /// @param amount1Requested How much token1 should be withdrawn from the fees owed
    /// @return amount0 The amount of fees collected in token0
    /// @return amount1 The amount of fees collected in token1
    function collect(
        address recipient,
        int24 tickLower,
        int24 tickUpper,
        uint128 amount0Requested,
        uint128 amount1Requested
    ) external returns (uint128 amount0, uint128 amount1);

    /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
    /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
    /// @dev Fees must be collected separately via a call to #collect
    /// @param tickLower The lower tick of the position for which to burn liquidity
    /// @param tickUpper The upper tick of the position for which to burn liquidity
    /// @param amount How much liquidity to burn
    /// @return amount0 The amount of token0 sent to the recipient
    /// @return amount1 The amount of token1 sent to the recipient
    function burn(int24 tickLower, int24 tickUpper, uint128 amount)
        external
        returns (uint256 amount0, uint256 amount1);

    /// @notice Swap token0 for token1, or token1 for token0
    /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
    /// @param recipient The address to receive the output of the swap
    /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
    /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
    /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
    /// value after the swap. If one for zero, the price cannot be greater than this value after the swap
    /// @param data Any data to be passed through to the callback
    /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
    /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
    function swap(
        address recipient,
        bool zeroForOne,
        int256 amountSpecified,
        uint160 sqrtPriceLimitX96,
        bytes calldata data
    ) external returns (int256 amount0, int256 amount1);

    /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
    /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback
    /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
    /// with 0 amount{0,1} and sending the donation amount(s) from the callback
    /// @param recipient The address which will receive the token0 and token1 amounts
    /// @param amount0 The amount of token0 to send
    /// @param amount1 The amount of token1 to send
    /// @param data Any data to be passed through to the callback
    function flash(address recipient, uint256 amount0, uint256 amount1, bytes calldata data) external;

    /// @notice Increase the maximum number of price and liquidity observations that this pool will store
    /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
    /// the input observationCardinalityNext.
    /// @param observationCardinalityNext The desired minimum number of observations for the pool to store
    function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
}

File 17 of 31 : IUniswapV3PoolDerivedState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that is not stored
/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
/// blockchain. The functions here may have variable gas costs.
interface IUniswapV3PoolDerivedState {
    /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
    /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
    /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
    /// you must call it with secondsAgos = [3600, 0].
    /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
    /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
    /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
    /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
    /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
    /// timestamp
    function observe(uint32[] calldata secondsAgos)
        external
        view
        returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);

    /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
    /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
    /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
    /// snapshot is taken and the second snapshot is taken.
    /// @param tickLower The lower tick of the range
    /// @param tickUpper The upper tick of the range
    /// @return tickCumulativeInside The snapshot of the tick accumulator for the range
    /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
    /// @return secondsInside The snapshot of seconds per liquidity for the range
    function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
        external
        view
        returns (int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside);
}

File 18 of 31 : IUniswapV3PoolEvents.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Events emitted by a pool
/// @notice Contains all events emitted by the pool
interface IUniswapV3PoolEvents {
    /// @notice Emitted exactly once by a pool when #initialize is first called on the pool
    /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize
    /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96
    /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool
    event Initialize(uint160 sqrtPriceX96, int24 tick);

    /// @notice Emitted when liquidity is minted for a given position
    /// @param sender The address that minted the liquidity
    /// @param owner The owner of the position and recipient of any minted liquidity
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount The amount of liquidity minted to the position range
    /// @param amount0 How much token0 was required for the minted liquidity
    /// @param amount1 How much token1 was required for the minted liquidity
    event Mint(
        address sender,
        address indexed owner,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount,
        uint256 amount0,
        uint256 amount1
    );

    /// @notice Emitted when fees are collected by the owner of a position
    /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees
    /// @param owner The owner of the position for which fees are collected
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount0 The amount of token0 fees collected
    /// @param amount1 The amount of token1 fees collected
    event Collect(
        address indexed owner,
        address recipient,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount0,
        uint128 amount1
    );

    /// @notice Emitted when a position's liquidity is removed
    /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect
    /// @param owner The owner of the position for which liquidity is removed
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount The amount of liquidity to remove
    /// @param amount0 The amount of token0 withdrawn
    /// @param amount1 The amount of token1 withdrawn
    event Burn(
        address indexed owner,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount,
        uint256 amount0,
        uint256 amount1
    );

    /// @notice Emitted by the pool for any swaps between token0 and token1
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param recipient The address that received the output of the swap
    /// @param amount0 The delta of the token0 balance of the pool
    /// @param amount1 The delta of the token1 balance of the pool
    /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
    /// @param liquidity The liquidity of the pool after the swap
    /// @param tick The log base 1.0001 of price of the pool after the swap
    event Swap(
        address indexed sender,
        address indexed recipient,
        int256 amount0,
        int256 amount1,
        uint160 sqrtPriceX96,
        uint128 liquidity,
        int24 tick
    );

    /// @notice Emitted by the pool for any flashes of token0/token1
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param recipient The address that received the tokens from flash
    /// @param amount0 The amount of token0 that was flashed
    /// @param amount1 The amount of token1 that was flashed
    /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
    /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee
    event Flash(
        address indexed sender,
        address indexed recipient,
        uint256 amount0,
        uint256 amount1,
        uint256 paid0,
        uint256 paid1
    );

    /// @notice Emitted by the pool for increases to the number of observations that can be stored
    /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index
    /// just before a mint/swap/burn.
    /// @param observationCardinalityNextOld The previous value of the next observation cardinality
    /// @param observationCardinalityNextNew The updated value of the next observation cardinality
    event IncreaseObservationCardinalityNext(
        uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew
    );

    /// @notice Emitted when the protocol fee is changed by the pool
    /// @param feeProtocol0Old The previous value of the token0 protocol fee
    /// @param feeProtocol1Old The previous value of the token1 protocol fee
    /// @param feeProtocol0New The updated value of the token0 protocol fee
    /// @param feeProtocol1New The updated value of the token1 protocol fee
    event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);

    /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
    /// @param sender The address that collects the protocol fees
    /// @param recipient The address that receives the collected protocol fees
    /// @param amount0 The amount of token0 protocol fees that is withdrawn
    /// @param amount0 The amount of token1 protocol fees that is withdrawn
    event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
}

File 19 of 31 : IUniswapV3PoolImmutables.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values
interface IUniswapV3PoolImmutables {
    /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface
    /// @return The contract address
    function factory() external view returns (address);

    /// @notice The first of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token0() external view returns (address);

    /// @notice The second of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token1() external view returns (address);

    /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
    /// @return The fee
    function fee() external view returns (uint24);

    /// @notice The pool tick spacing
    /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
    /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
    /// This value is an int24 to avoid casting even though it is always positive.
    /// @return The tick spacing
    function tickSpacing() external view returns (int24);

    /// @notice The maximum amount of position liquidity that can use any tick in the range
    /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and
    /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool
    /// @return The max amount of liquidity per tick
    function maxLiquidityPerTick() external view returns (uint128);
}

File 20 of 31 : IUniswapV3PoolOwnerActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissioned pool actions
/// @notice Contains pool methods that may only be called by the factory owner
interface IUniswapV3PoolOwnerActions {
    /// @notice Set the denominator of the protocol's % share of the fees
    /// @param feeProtocol0 new protocol fee for token0 of the pool
    /// @param feeProtocol1 new protocol fee for token1 of the pool
    function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;

    /// @notice Collect the protocol fee accrued to the pool
    /// @param recipient The address to which collected protocol fees should be sent
    /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1
    /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0
    /// @return amount0 The protocol fee collected in token0
    /// @return amount1 The protocol fee collected in token1
    function collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested)
        external
        returns (uint128 amount0, uint128 amount1);
}

File 21 of 31 : IUniswapV3PoolState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any frequency including multiple times
/// per transaction
interface IUniswapV3PoolState {
    /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
    /// when accessed externally.
    /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
    /// tick The current tick of the pool, i.e. according to the last tick transition that was run.
    /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
    /// boundary.
    /// observationIndex The index of the last oracle observation that was written,
    /// observationCardinality The current maximum number of observations stored in the pool,
    /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
    /// feeProtocol The protocol fee for both tokens of the pool.
    /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
    /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
    /// unlocked Whether the pool is currently locked to reentrancy
    function slot0()
        external
        view
        returns (
            uint160 sqrtPriceX96,
            int24 tick,
            uint16 observationIndex,
            uint16 observationCardinality,
            uint16 observationCardinalityNext,
            uint8 feeProtocol,
            bool unlocked
        );

    /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal0X128() external view returns (uint256);

    /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal1X128() external view returns (uint256);

    /// @notice The amounts of token0 and token1 that are owed to the protocol
    /// @dev Protocol fees will never exceed uint128 max in either token
    function protocolFees() external view returns (uint128 token0, uint128 token1);

    /// @notice The currently in range liquidity available to the pool
    /// @dev This value has no relationship to the total liquidity across all ticks
    function liquidity() external view returns (uint128);

    /// @notice Look up information about a specific tick in the pool
    /// @param tick The tick to look up
    /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or
    /// tick upper,
    /// liquidityNet how much liquidity changes when the pool price crosses the tick,
    /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
    /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
    /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
    /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
    /// secondsOutside the seconds spent on the other side of the tick from the current tick,
    /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.
    /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.
    /// In addition, these values are only relative and must be used only in comparison to previous snapshots for
    /// a specific position.
    function ticks(int24 tick)
        external
        view
        returns (
            uint128 liquidityGross,
            int128 liquidityNet,
            uint256 feeGrowthOutside0X128,
            uint256 feeGrowthOutside1X128,
            int56 tickCumulativeOutside,
            uint160 secondsPerLiquidityOutsideX128,
            uint32 secondsOutside,
            bool initialized
        );

    /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information
    function tickBitmap(int16 wordPosition) external view returns (uint256);

    /// @notice Returns the information about a position by the position's key
    /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
    /// @return _liquidity The amount of liquidity in the position,
    /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
    /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
    /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
    /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
    function positions(bytes32 key)
        external
        view
        returns (
            uint128 _liquidity,
            uint256 feeGrowthInside0LastX128,
            uint256 feeGrowthInside1LastX128,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        );

    /// @notice Returns data about a specific observation index
    /// @param index The element of the observations array to fetch
    /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time
    /// ago, rather than at a specific index in the array.
    /// @return blockTimestamp The timestamp of the observation,
    /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
    /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
    /// Returns initialized whether the observation has been initialized and the values are safe to use
    function observations(uint256 index)
        external
        view
        returns (
            uint32 blockTimestamp,
            int56 tickCumulative,
            uint160 secondsPerLiquidityCumulativeX128,
            bool initialized
        );
}

File 22 of 31 : ISwapRouter.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

import "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol";

/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V3
interface ISwapRouter is IUniswapV3SwapCallback {
    struct ExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);

    struct ExactInputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);

    struct ExactOutputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);

    struct ExactOutputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}

File 23 of 31 : IE369HolderVault.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

interface IE369HolderVault {
    function register777CycleTokens(uint256 infernoAmount, uint256 e280Amount) external;
    function updateStoredMultipliers(uint32 cycleId, uint256 totalMultipliers) external;
    function updateStoredMultipliersOnBurn(uint32 cycleId, uint256 totalMultipliers, uint256 multiplierDeduction)
        external;
    function setFluxHub(address fluxHub) external;
}

File 24 of 31 : ITitanOnBurn.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface ITitanOnBurn {
    function onBurn(address user, uint256 amount) external;
}

File 25 of 31 : IWETH9.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.10;

import "@openzeppelin/contracts/interfaces/IERC20.sol";

/// @title Interface for WETH9
interface IWETH9 is IERC20 {
    /// @notice Deposit ether to get wrapped ether
    function deposit() external payable;

    /// @notice Withdraw wrapped ether to get ether
    function withdraw(uint256) external;
}

File 26 of 31 : constants.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "../interfaces/ITitanOnBurn.sol";
import "@openzeppelin/contracts/interfaces/IERC20.sol";

// ===================== Contract Addresses =====================================
address constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address constant TITANX = 0xF19308F923582A6f7c465e5CE7a9Dc1BEC6665B1;
address constant FLUX = 0xBFDE5ac4f5Adb419A931a5bF64B0f3BB5a623d06;
address constant FLUX_STAKING = 0xd605a87187563C94c577a6E57e4a36eC8433B9aE;
address constant FLUX_AUCTIONS = 0x36e5a8105f000029d4B3B99d0C3D0e24aaA52adF;
address constant HELIOS = 0x2614f29C39dE46468A921Fd0b41fdd99A01f2EDf;
address constant INFERNO = 0x00F116ac0c304C570daAA68FA6c30a86A04B5C5F;
address constant E280 = 0xe9A53C43a0B58706e67341C4055de861e29Ee943;

// ===================== POOLS ==================================================
address constant TITANX_WETH_POOL = 0xc45A81BC23A64eA556ab4CdF08A86B61cdcEEA8b;
address constant TITANX_INFERNO_POOL = 0x1E90B67149e688DfB95fD73Acacd8ADefd16d88D;
address constant TITANX_HELIOS_POOL = 0x2C83C54C5612BfD62a78124D4A0eA001278a689c;

// ===================== FLUX ===================================================
uint32 constant FLUX_START_DATE = 1727024400;

// ===================== NFT ====================================================
uint32 constant MINT_START_DATE = FLUX_START_DATE + 60 days;
uint32 constant ELEMENT_END_DATE = FLUX_START_DATE + 2331 days;
uint32 constant MINT_CYCLE_LENGTH = 44;
uint8 constant DEV_PERCENT = 8;

uint256 constant BITPOS_NFT_TIER = 0;
uint256 constant BITMASK_NFT_TIER = (1 << 8) - 1;

uint256 constant BITPOS_MULTIPLIER = 8;
uint256 constant BITMASK_MULTIPLIER = (1 << 16) - 1;

uint256 constant BITPOS_MINT_CYCLE = 24;
uint256 constant BITMASK_MINT_CYCLE = (1 << 32) - 1;

uint256 constant BITPOS_BURN_CYCLE = 56;
uint256 constant BITMASK_BURN_CYCLE = (1 << 32) - 1;

uint256 constant BITPOS_BURN_ADDRESS = 88;
uint256 constant BITMASK_BURN_ADDRESS = (1 << 160) - 1;

// ===================== FLUX HUB ===============================================
uint32 constant MAX_DURATION = 2888 days;
uint32 constant MAX_STAKES_PER_CLAIM = 100;
uint32 constant TREASURY_PERCENTS = 70;
uint32 constant DAY_777_OFFSET = 3;
uint32 constant INFERNO_SWAP_PERCENTAGE = 42;
uint32 constant BURN_PERCENTAGE = 16;

uint32 constant INCENTIVE_FEE_BASE = 100_000;
uint32 constant BPS_BASE = 10_000;
uint32 constant PERCENTAGE_BASE = 100;

// ===================== Holder Vault ===========================================
uint32 constant CYCLE_CREATION_OFFSET = 2;
uint32 constant MAX_777_CYCLES_NUMBER = 4;
uint32 constant CYCLE_777_DAYS = 777;
uint32 constant E369_CYCLE_INTERVAL = 11;
uint16 constant MAX_CYCLES_PER_CLAIM = 100;
uint8 constant BACKING_CLAIM_TAX = 3;

// ===================== UNISWAP Interface ======================================

address constant UNISWAP_V2_FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
address constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address constant UNISWAP_V3_ROUTER = 0xE592427A0AEce92De3Edee1F18E0157C05861564;
uint24 constant POOL_FEE_1PERCENT = 10000;

// ===================== Interface IDs ==========================================
bytes4 constant INTERFACE_ID_ERC165 = 0x01ffc9a7;
bytes4 constant INTERFACE_ID_ERC20 = type(IERC20).interfaceId;
bytes4 constant INTERFACE_ID_ERC721 = 0x80ac58cd;
bytes4 constant INTERFACE_ID_ERC721Metadata = 0x5b5e139f;
bytes4 constant INTERFACE_ID_ITITANONBURN = type(ITitanOnBurn).interfaceId;

File 27 of 31 : OracleLibrary.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

// Uniswap
import {IUniswapV3Pool} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";

// OpenZeppelin
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {TickMath} from "./TickMath.sol";

/**
 * @notice Adapted Uniswap V3 OracleLibrary computation to be compliant with Solidity 0.8.x and later.
 *
 * Documentation for Auditors:
 *
 * Solidity Version: Updated the Solidity version pragma to ^0.8.0. This change ensures compatibility
 * with Solidity version 0.8.x.
 *
 * Safe Arithmetic Operations: Solidity 0.8.x automatically checks for arithmetic overflows/underflows.
 * Therefore, the code no longer needs to use SafeMath library (or similar) for basic arithmetic operations.
 * This change simplifies the code and reduces the potential for errors related to manual overflow/underflow checking.
 *
 * Overflow/Underflow: With the introduction of automatic overflow/underflow checks in Solidity 0.8.x, the code is inherently
 * safer and less prone to certain types of arithmetic errors.
 *
 * Removal of SafeMath Library: Since Solidity 0.8.x handles arithmetic operations safely, the use of SafeMath library
 * is omitted in this update.
 *
 * Git-style diff for the `consult` function:
 *
 * ```diff
 * function consult(address pool, uint32 secondsAgo)
 *     internal
 *     view
 *     returns (int24 arithmeticMeanTick, uint128 harmonicMeanLiquidity)
 * {
 *     require(secondsAgo != 0, 'BP');
 *
 *     uint32[] memory secondsAgos = new uint32[](2);
 *     secondsAgos[0] = secondsAgo;
 *     secondsAgos[1] = 0;
 *
 *     (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) =
 *         IUniswapV3Pool(pool).observe(secondsAgos);
 *
 *     int56 tickCumulativesDelta = tickCumulatives[1] - tickCumulatives[0];
 *     uint160 secondsPerLiquidityCumulativesDelta =
 *         secondsPerLiquidityCumulativeX128s[1] - secondsPerLiquidityCumulativeX128s[0];
 *
 * -   arithmeticMeanTick = int24(tickCumulativesDelta / secondsAgo);
 * +   int56 secondsAgoInt56 = int56(uint56(secondsAgo));
 * +   arithmeticMeanTick = int24(tickCumulativesDelta / secondsAgoInt56);
 *     // Always round to negative infinity
 * -   if (tickCumulativesDelta < 0 && (tickCumulativesDelta % secondsAgo != 0)) arithmeticMeanTick--;
 * +   if (tickCumulativesDelta < 0 && (tickCumulativesDelta % secondsAgoInt56 != 0)) arithmeticMeanTick--;
 *
 * -   uint192 secondsAgoX160 = uint192(secondsAgo) * type(uint160).max;
 * +   uint192 secondsAgoUint192 = uint192(secondsAgo);
 * +   uint192 secondsAgoX160 = secondsAgoUint192 * type(uint160).max;
 *     harmonicMeanLiquidity = uint128(secondsAgoX160 / (uint192(secondsPerLiquidityCumulativesDelta) << 32));
 * }
 * ```
 */

/// @title Oracle library
/// @notice Provides functions to integrate with V3 pool oracle
library OracleLibrary {
    /// @notice Calculates time-weighted means of tick and liquidity for a given Uniswap V3 pool
    /// @param pool Address of the pool that we want to observe
    /// @param secondsAgo Number of seconds in the past from which to calculate the time-weighted means
    /// @return arithmeticMeanTick The arithmetic mean tick from (block.timestamp - secondsAgo) to block.timestamp
    /// @return harmonicMeanLiquidity The harmonic mean liquidity from (block.timestamp - secondsAgo) to block.timestamp
    function consult(address pool, uint32 secondsAgo)
        internal
        view
        returns (int24 arithmeticMeanTick, uint128 harmonicMeanLiquidity)
    {
        require(secondsAgo != 0, "BP");

        uint32[] memory secondsAgos = new uint32[](2);
        secondsAgos[0] = secondsAgo;
        secondsAgos[1] = 0;

        (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) =
            IUniswapV3Pool(pool).observe(secondsAgos);

        int56 tickCumulativesDelta = tickCumulatives[1] - tickCumulatives[0];
        uint160 secondsPerLiquidityCumulativesDelta =
            secondsPerLiquidityCumulativeX128s[1] - secondsPerLiquidityCumulativeX128s[0];

        // Safe casting of secondsAgo to int56 for division
        int56 secondsAgoInt56 = int56(uint56(secondsAgo));
        arithmeticMeanTick = int24(tickCumulativesDelta / secondsAgoInt56);
        // Always round to negative infinity
        if (tickCumulativesDelta < 0 && (tickCumulativesDelta % secondsAgoInt56 != 0)) arithmeticMeanTick--;

        // Safe casting of secondsAgo to uint192 for multiplication
        uint192 secondsAgoUint192 = uint192(secondsAgo);
        harmonicMeanLiquidity = uint128(
            (secondsAgoUint192 * uint192(type(uint160).max)) / (uint192(secondsPerLiquidityCumulativesDelta) << 32)
        );
    }

    /// @notice Given a tick and a token amount, calculates the amount of token received in exchange
    /// @param tick Tick value used to calculate the quote
    /// @param baseAmount Amount of token to be converted
    /// @param baseToken Address of an ERC20 token contract used as the baseAmount denomination
    /// @param quoteToken Address of an ERC20 token contract used as the quoteAmount denomination
    /// @return quoteAmount Amount of quoteToken received for baseAmount of baseToken
    function getQuoteAtTick(int24 tick, uint128 baseAmount, address baseToken, address quoteToken)
        internal
        pure
        returns (uint256 quoteAmount)
    {
        uint160 sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick);

        // Calculate quoteAmount with better precision if it doesn't overflow when multiplied by itself
        if (sqrtRatioX96 <= type(uint128).max) {
            uint256 ratioX192 = uint256(sqrtRatioX96) * sqrtRatioX96;
            quoteAmount = baseToken < quoteToken
                ? Math.mulDiv(ratioX192, baseAmount, 1 << 192)
                : Math.mulDiv(1 << 192, baseAmount, ratioX192);
        } else {
            uint256 ratioX128 = Math.mulDiv(sqrtRatioX96, sqrtRatioX96, 1 << 64);
            quoteAmount = baseToken < quoteToken
                ? Math.mulDiv(ratioX128, baseAmount, 1 << 128)
                : Math.mulDiv(1 << 128, baseAmount, ratioX128);
        }
    }

    /// @notice Given a pool, it returns the number of seconds ago of the oldest stored observation
    /// @param pool Address of Uniswap V3 pool that we want to observe
    /// @return secondsAgo The number of seconds ago of the oldest observation stored for the pool
    function getOldestObservationSecondsAgo(address pool) internal view returns (uint32 secondsAgo) {
        (,, uint16 observationIndex, uint16 observationCardinality,,,) = IUniswapV3Pool(pool).slot0();
        require(observationCardinality > 0, "NI");

        (uint32 observationTimestamp,,, bool initialized) =
            IUniswapV3Pool(pool).observations((observationIndex + 1) % observationCardinality);

        // The next index might not be initialized if the cardinality is in the process of increasing
        // In this case the oldest observation is always in index 0
        if (!initialized) {
            (observationTimestamp,,,) = IUniswapV3Pool(pool).observations(0);
        }

        secondsAgo = uint32(block.timestamp) - observationTimestamp;
    }

    /// @notice Given a tick and a token amount, calculates the amount of token received in exchange
    /// a slightly modified version of the UniSwap library getQuoteAtTick to accept a sqrtRatioX96 as input parameter
    /// @param sqrtRatioX96 The sqrt ration
    /// @param baseAmount Amount of token to be converted
    /// @param baseToken Address of an ERC20 token contract used as the baseAmount denomination
    /// @param quoteToken Address of an ERC20 token contract used as the quoteAmount denomination
    /// @return quoteAmount Amount of quoteToken received for baseAmount of baseToken
    function getQuoteForSqrtRatioX96(uint160 sqrtRatioX96, uint256 baseAmount, address baseToken, address quoteToken)
        internal
        pure
        returns (uint256 quoteAmount)
    {
        // Calculate quoteAmount with better precision if it doesn't overflow when multiplied by itself
        if (sqrtRatioX96 <= type(uint128).max) {
            uint256 ratioX192 = uint256(sqrtRatioX96) * sqrtRatioX96;
            quoteAmount = baseToken < quoteToken
                ? Math.mulDiv(ratioX192, baseAmount, 1 << 192)
                : Math.mulDiv(1 << 192, baseAmount, ratioX192);
        } else {
            uint256 ratioX128 = Math.mulDiv(sqrtRatioX96, sqrtRatioX96, 1 << 64);
            quoteAmount = baseToken < quoteToken
                ? Math.mulDiv(ratioX128, baseAmount, 1 << 128)
                : Math.mulDiv(1 << 128, baseAmount, ratioX128);
        }
    }
}

File 28 of 31 : TickMath.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

/// @title Math library for computing sqrt prices from ticks and vice versa
/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
/// prices between 2**-128 and 2**128
library TickMath {
    error T();
    error R();

    /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
    int24 internal constant MIN_TICK = -887272;
    /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
    int24 internal constant MAX_TICK = -MIN_TICK;

    /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)
    uint160 internal constant MIN_SQRT_RATIO = 4295128739;
    /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)
    uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;

    /// @notice Calculates sqrt(1.0001^tick) * 2^96
    /// @dev Throws if |tick| > max tick
    /// @param tick The input tick for the above formula
    /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)
    /// at the given tick
    function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {
        unchecked {
            uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));
            if (absTick > uint256(int256(MAX_TICK))) revert T();

            uint256 ratio =
                absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;
            if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
            if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
            if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
            if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
            if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
            if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
            if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
            if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
            if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
            if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
            if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
            if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
            if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
            if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
            if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
            if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
            if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
            if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
            if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;

            if (tick > 0) ratio = type(uint256).max / ratio;

            // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.
            // we then downcast because we know the result always fits within 160 bits due to our tick input constraint
            // we round up in the division so getTickAtSqrtRatio of the output price is always consistent
            sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));
        }
    }

    /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
    /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may
    /// ever return.
    /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96
    /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio
    function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {
        unchecked {
            // second inequality must be < because the price can never reach the price at the max tick
            if (!(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO)) revert R();
            uint256 ratio = uint256(sqrtPriceX96) << 32;

            uint256 r = ratio;
            uint256 msb = 0;

            assembly {
                let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(5, gt(r, 0xFFFFFFFF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(4, gt(r, 0xFFFF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(3, gt(r, 0xFF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(2, gt(r, 0xF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(1, gt(r, 0x3))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := gt(r, 0x1)
                msb := or(msb, f)
            }

            if (msb >= 128) r = ratio >> (msb - 127);
            else r = ratio << (127 - msb);

            int256 log_2 = (int256(msb) - 128) << 64;

            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(63, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(62, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(61, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(60, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(59, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(58, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(57, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(56, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(55, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(54, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(53, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(52, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(51, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(50, f))
            }

            int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number

            int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);
            int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);

            tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;
        }
    }
}

File 29 of 31 : Time.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

library Time {
    ///@notice Gets the current timestamp
    function blockTs() internal view returns (uint32 ts) {
        assembly {
            ts := timestamp()
        }
    }

    ///@notice Gets the the day count from a timestamp
    function dayCountByT(uint32 t) internal pure returns (uint32 dayCount) {
        assembly {
            let adjustedTime := sub(t, 61200)
            dayCount := div(adjustedTime, 86400)
        }
    }

    ///@notice Gets the week count, since a starting timestamp
    function weekSince(uint32 t) internal view returns (uint32 weeksPassed) {
        assembly {
            let currentTime := timestamp()
            let timeElapsed := sub(currentTime, t)

            weeksPassed := div(timeElapsed, 604800)
        }
    }

    function daysSince(uint32 t) public view returns (uint32 daysPassed) {
        assembly {
            // Get the current block timestamp
            let currentTime := timestamp()

            daysPassed := div(sub(currentTime, t), 86400)
        }
    }
}

File 30 of 31 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import "./IERC721A.sol";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

    // The amount of tokens minted above `_sequentialUpTo()`.
    // We call these spot mints (i.e. non-sequential mints).
    uint256 private _spotMinted;

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

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

        if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector);
    }

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

    /**
     * @dev Returns the starting token ID for sequential mints.
     *
     * Override this function to change the starting token ID for sequential mints.
     *
     * Note: The value returned must never change after any tokens have been minted.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Returns the maximum token ID (inclusive) for sequential mints.
     *
     * Override this function to return a value less than 2**256 - 1,
     * but greater than `_startTokenId()`, to enable spot (non-sequential) mints.
     *
     * Note: The value returned must never change after any tokens have been minted.
     */
    function _sequentialUpTo() internal view virtual returns (uint256) {
        return type(uint256).max;
    }

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

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256 result) {
        // Counter underflow is impossible as `_burnCounter` cannot be incremented
        // more than `_currentIndex + _spotMinted - _startTokenId()` times.
        unchecked {
            // With spot minting, the intermediate `result` can be temporarily negative,
            // and the computation must be unchecked.
            result = _currentIndex - _burnCounter - _startTokenId();
            if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;
        }
    }

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

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

    /**
     * @dev Returns the total number of tokens that are spot-minted.
     */
    function _totalSpotMinted() internal view virtual returns (uint256) {
        return _spotMinted;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Returns whether the ownership slot at `index` is initialized.
     * An uninitialized slot does not necessarily mean that the slot has no owner.
     */
    function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) {
        return _packedOwnerships[index] != 0;
    }

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

    /**
     * @dev Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {
        if (_startTokenId() <= tokenId) {
            packed = _packedOwnerships[tokenId];

            if (tokenId > _sequentialUpTo()) {
                if (_packedOwnershipExists(packed)) return packed;
                _revert(OwnerQueryForNonexistentToken.selector);
            }

            // If the data at the starting slot does not exist, start the scan.
            if (packed == 0) {
                if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector);
                // Invariant:
                // There will always be an initialized ownership slot
                // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                // before an unintialized ownership slot
                // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                // Hence, `tokenId` will not underflow.
                //
                // We can directly compare the packed value.
                // If the address is zero, packed will be zero.
                for (;;) {
                    unchecked {
                        packed = _packedOwnerships[--tokenId];
                    }
                    if (packed == 0) continue;
                    if (packed & _BITMASK_BURNED == 0) return packed;
                    // Otherwise, the token is burned, and we must revert.
                    // This handles the case of batch burned tokens, where only the burned bit
                    // of the starting slot is set, and remaining slots are left uninitialized.
                    _revert(OwnerQueryForNonexistentToken.selector);
                }
            }
            // Otherwise, the data exists and we can skip the scan.
            // This is possible because we have already achieved the target condition.
            // This saves 2143 gas on transfers of initialized tokens.
            // If the token is not burned, return `packed`. Otherwise, revert.
            if (packed & _BITMASK_BURNED == 0) return packed;
        }
        _revert(OwnerQueryForNonexistentToken.selector);
    }

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

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

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

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

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

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

        return _tokenApprovals[tokenId].value;
    }

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

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

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool result) {
        if (_startTokenId() <= tokenId) {
            if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]);

            if (tokenId < _currentIndex) {
                uint256 packed;
                while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId;
                result = packed & _BITMASK_BURNED == 0;
            }
        }
    }

    /**
     * @dev Returns whether `packed` represents a token that exists.
     */
    function _packedOwnershipExists(uint256 packed) private pure returns (bool result) {
        assembly {
            // The following is equivalent to `owner != address(0) && burned == false`.
            // Symbolically tested.
            result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_BURNED))
        }
    }

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

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

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

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

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

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

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

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

        _beforeTokenTransfers(from, to, tokenId, 1);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);

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

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

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

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

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

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

            if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);

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

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

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

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        _revert(TransferToNonERC721ReceiverImplementer.selector);
                    }
                } while (index < end);
                // This prevents reentrancy to `_safeMint`.
                // It does not prevent reentrancy to `_safeMintSpot`.
                if (_currentIndex != end) revert();
            }
        }
    }

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

    /**
     * @dev Mints a single token at `tokenId`.
     *
     * Note: A spot-minted `tokenId` that has been burned can be re-minted again.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` must be greater than `_sequentialUpTo()`.
     * - `tokenId` must not exist.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _mintSpot(address to, uint256 tokenId) internal virtual {
        if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector);
        uint256 prevOwnershipPacked = _packedOwnerships[tokenId];
        if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector);

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

        // Overflows are incredibly unrealistic.
        // The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1.
        // `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1.
        unchecked {
            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `true` (as `quantity == 1`).
            _packedOwnerships[tokenId] =
                _packOwnershipData(to, _nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked));

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

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

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

            assembly {
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    tokenId // `tokenId`.
                )
            }

            ++_spotMinted;
        }

        _afterTokenTransfers(address(0), to, tokenId, 1);
    }

    /**
     * @dev Safely mints a single token at `tokenId`.
     *
     * Note: A spot-minted `tokenId` that has been burned can be re-minted again.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}.
     * - `tokenId` must be greater than `_sequentialUpTo()`.
     * - `tokenId` must not exist.
     *
     * See {_mintSpot}.
     *
     * Emits a {Transfer} event.
     */
    function _safeMintSpot(address to, uint256 tokenId, bytes memory _data) internal virtual {
        _mintSpot(to, tokenId);

        unchecked {
            if (to.code.length != 0) {
                uint256 currentSpotMinted = _spotMinted;
                if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) {
                    _revert(TransferToNonERC721ReceiverImplementer.selector);
                }
                // This prevents reentrancy to `_safeMintSpot`.
                // It does not prevent reentrancy to `_safeMint`.
                if (_spotMinted != currentSpotMinted) revert();
            }
        }
    }

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

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

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

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

        if (approvalCheck && _msgSenderERC721A() != owner) {
            if (!isApprovedForAll(owner, _msgSenderERC721A())) {
                _revert(ApprovalCallerNotOwnerNorApproved.selector);
            }
        }

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

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

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

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

        address from = address(uint160(prevOwnershipPacked));

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 31 of 31 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * `_sequentialUpTo()` must be greater than `_startTokenId()`.
     */
    error SequentialUpToTooSmall();

    /**
     * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`.
     */
    error SequentialMintExceedsLimit();

    /**
     * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`.
     */
    error SpotMintTokenIdTooSmall();

    /**
     * Cannot mint over a token that already exists.
     */
    error TokenAlreadyExists();

    /**
     * The feature is not compatible with spot mints.
     */
    error NotCompatibleWithSpotMints();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "viaIR": true,
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {
    "contracts/lib/Time.sol": {
      "Time": "0xbbf25ca275325ef4682851a12bd8e9aa714da2f4"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_devWallet","type":"address"},{"internalType":"string","name":"_contractURI","type":"string"},{"internalType":"string","name":"_baseURI","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"DataQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"IncorrectTier","type":"error"},{"inputs":[],"name":"MathOverflowedMulDiv","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotCompatibleWithSpotMints","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"Prohibited","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"SaleInactive","type":"error"},{"inputs":[],"name":"SequentialMintExceedsLimit","type":"error"},{"inputs":[],"name":"SequentialUpToTooSmall","type":"error"},{"inputs":[],"name":"SpotMintTokenIdTooSmall","type":"error"},{"inputs":[],"name":"T","type":"error"},{"inputs":[],"name":"TWAP","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroInput","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":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","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":[],"name":"ContractURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"FluxHub","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HolderVault","outputs":[{"internalType":"address","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":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"account","type":"address"}],"name":"batchGetPackedTokenData","outputs":[{"internalType":"uint256[]","name":"data","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchGetTokenData","outputs":[{"internalType":"uint8[]","name":"tiers","type":"uint8[]"},{"internalType":"uint16[]","name":"multipliers","type":"uint16[]"},{"internalType":"uint32[]","name":"mintCycles","type":"uint32[]"},{"internalType":"uint32[]","name":"burnCycles","type":"uint32[]"},{"internalType":"address[]","name":"burnAddresses","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deviation","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"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":"uint256","name":"tokenId","type":"uint256"}],"name":"getBurnAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getBurnCycle","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentCycle777","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentE369Cycle","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"cycle777Id","type":"uint32"}],"name":"getEndCycleForCycle777","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMintCycle","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getNftTier","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"cycle777Id","type":"uint32"}],"name":"getStartCycleForCycle777","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"getTotalNftsPerTiers","outputs":[{"internalType":"uint256[]","name":"total","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8[]","name":"tieredNfts","type":"uint8[]"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"mintWithEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8[]","name":"tieredNfts","type":"uint8[]"}],"name":"mintWithTitanX","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"multiplierPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"secondsAgo","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"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":"_uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"limit","type":"uint32"}],"name":"setDeviation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"},{"internalType":"address","name":"_hub","type":"address"}],"name":"setProtocolAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"limit","type":"uint32"}],"name":"setSecondsAgo","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":"uint8","name":"tier","type":"uint8"}],"name":"tierMultipliers","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"tier","type":"uint8"}],"name":"tierPrices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"tokenIdsOf","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBurned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateMultipliersIfNecessary","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a0604052346100af57614a7880380380610019816100ca565b9283398101906080818303126100af57610032816100f4565b9061003f602082016100f4565b60408201516001600160401b0381116100af578461005e918401610108565b6060830151949092906001600160401b0386116100af57610089956100839201610108565b9261053b565b6040516141cb90816108ad8239608051818181611190015281816117540152611a2e0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b038111838210176100ef57604052565b6100b4565b51906001600160a01b03821682036100af57565b81601f820112156100af578051906001600160401b0382116100ef57610137601f8301601f19166020016100ca565b92828452602083830101116100af5760005b82811061015e57505060206000918301015290565b80602080928401015182828701015201610149565b61017d60406100ca565b90600b82526a456c656d656e742033363960a81b6020830152565b6101a260406100ca565b9060048252634533363960e01b6020830152565b90600182811c921680156101e6575b60208310146101d057565b634e487b7160e01b600052602260045260246000fd5b91607f16916101c5565b601f81116101fc575050565b60026000526020600020906020601f840160051c83019310610239575b601f0160051c01905b81811061022d575050565b60008155600101610222565b9091508190610219565b601f821161025057505050565b6000526020600020906020601f840160051c8301931061028b575b601f0160051c01905b81811061027f575050565b60008155600101610274565b909150819061026b565b80519091906001600160401b0381116100ef576102be816102b7600c546101b6565b600c610243565b602092601f8211600114610300576102f0929382916000926102f5575b50508160011b916000199060031b1c19161790565b600c55565b0151905038806102db565b600c600052601f198216937fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c79160005b868110610367575083600195961061034e575b505050811b01600c55565b015160001960f88460031b161c19169055388080610343565b91926020600181928685015181550194019201610330565b80519091906001600160401b0381116100ef576103a8816103a1600d546101b6565b600d610243565b602092601f82116001146103de576103d9929382916000926102f55750508160011b916000199060031b1c19161790565b600d55565b600d600052601f198216937fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb59160005b868110610445575083600195961061042c575b505050811b01600d55565b015160001960f88460031b161c19169055388080610421565b9192602060018192868501518155019401920161040e565b80519091906001600160401b0381116100ef576104868161047f6003546101b6565b6003610243565b602092601f82116001146104bc576104b7929382916000926102f55750508160011b916000199060031b1c19161790565b600355565b6003600052601f198216937fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9160005b868110610523575083600195961061050a575b505050811b01600355565b015160001960f88460031b161c191690553880806104ff565b919260206001819286850151815501940192016104ec565b929092610558610549610173565b610551610198565b908361073b565b61056e61012c63ffffffff19600f541617600f55565b61058c6503e80000000067ffffffff0000000019600f541617600f55565b6001600160a01b03161561072a576001600160a01b0383161561072a5781511561071957805115610719576105c36105c892610295565b61037f565b608052600160005260106020526106077f8c6065603763fec3f5742441d3833f3f43b982453612d76adb39a885e3006b5f805461ffff19166001179055565b600260005260106020526106437f853b2fefe141400fef543280f93d98bd49996069f632d0d20236afeeed8e46a2805461ffff1916600a179055565b6003600052601060205261067f7fb3edd0d534d647cffdae9f1294f11ad21f3fcf2814bea44c92bbb8d384a57d9e805461ffff19166064179055565b60116020526a52b7d2dcc80cd2e40000007f17bc176d2408558f6e4111feebc3cab4e16b63e967be91cde721f4c8a488b552556b033b2e3c9fd0803ce80000007f08037d7b151cc412d25674a4e66b334d9ae9d2e5517a7feaae5cdb828bf1c6285560036000526b204fce5e3e250261100000007f9bfbaa59f8e10e7868f8b402de9d605a390c45ddaebd8c9de3c6f31e733c87ff55565b565b63af458c0760e01b60005260046000fd5b63d92e233d60e01b60005260046000fd5b815191939290916001600160401b0381116100ef576107648161075f6002546101b6565b6101f0565b6020601f82116001146107d9579080610799926107a19596976000926102f55750508160011b916000199060031b1c19161790565b60025561045d565b6107ab6001600055565b6001600160a01b038116156107c35761071790610863565b631e4fbdf760e01b600090815260045260246000fd5b6002600052601f198216957f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace9660005b81811061084b5750916107a195969791846001959410610832575b505050811b0160025561045d565b015160001960f88460031b161c19169055388080610824565b83830151895560019098019760209384019301610809565b600980546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a356fe6080604052600436101561001257600080fd5b60003560e01c806301ffc9a71461034757806306fdde0314610342578063081812fc1461033d578063095ea7b3146103385780630c5f800b1461033357806318160ddd1461032e5780631ad7b1271461032957806323b872dd1461032457806326a245751461031f5780633c9c09e41461031a57806342842e0e14610315578063493d5dfe146103105780634b150c391461030b5780634beb7797146103065780634cdcd8d31461030157806355f804b3146102fc578063564566a8146102f75780636173b4ed146102f257806361c22a68146102ed578063633dd145146102e85780636352211e146102e3578063639097a1146102de578063651c5434146102d95780636c0360eb146102d457806370a08231146102cf578063715018a6146102ca5780637d8dbb2d146102c55780638da5cb5b146102c05780638ea5220f146102bb57806390f73d3c146102b6578063938e3d7b146102b157806395d89b41146102ac578063a22cb465146102a7578063a38d8615146102a2578063a3b261f21461029d578063adf8252d14610298578063b4fad6f814610293578063b88d4fde1461028e578063c467366a14610289578063c87b56dd14610284578063cb0a44331461027f578063d89135cd1461027a578063d9e1460014610275578063daf8c5aa14610270578063dc8e92ea1461026b578063e8a3d48514610266578063e985e9c514610261578063ebb786871461025c578063f2fde38b14610257578063f7cc662d146102525763fa7272141461024d57600080fd5b612059565b612030565b611fa2565b611f65565b611f1b565b611e73565b611be6565b611b86565b611a77565b611a59565b6119bb565b6117b3565b6116ad565b61161b565b6115e3565b6115b0565b61157c565b611563565b6114ce565b61141c565b611300565b6111e4565b61117a565b611151565b611136565b6110d9565b6110aa565b611002565b610faa565b610f84565b610f55565b610f31565b610eeb565b610e29565b610dca565b610c93565b610bca565b610a56565b610833565b610804565b6107df565b6107b6565b610781565b61076d565b6106ec565b6106b7565b61068e565b6105c9565b610565565b61048c565b610363565b6001600160e01b031981160361035e57565b600080fd5b3461035e57602036600319011261035e576103c56004356103838161034c565b6001600160e01b0319166301ffc9a760e01b8114908115908282610414575b8315610403575b83156103c9575b50506040519115158252509081906020820190565b0390f35b9250906103f2575b81156103e1575b503880806103b0565b635b5e139f60e01b149050386103d8565b6380ac58cd60e01b811491506103d1565b635b5e139f60e01b821493506103a9565b6380ac58cd60e01b821493506103a2565b600091031261035e57565b60005b8381106104435750506000910152565b8181015183820152602001610433565b9060209161046c81518092818552858086019101610430565b601f01601f1916010190565b906020610489928181520190610453565b90565b3461035e57600036600319011261035e5760405160006002546104ae81610fc8565b808452906001811690811561054157506001146104e2575b6103c5836104d681850382610870565b60405191829182610478565b600260009081527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace939250905b808210610527575090915081016020016104d66104c6565b91926001816020925483858801015201910190929161050f565b60ff191660208086019190915291151560051b840190910191506104d690506104c6565b3461035e57602036600319011261035e576004356105828161297f565b156105a7576000526006602052602060018060a01b0360406000205416604051908152f35b6333d1c03960e21b60005260046000fd5b6001600160a01b0381160361035e57565b604036600319011261035e576004356105e1816105b8565b602435906001600160a01b036105f683612a5c565b1690813303610668575b61063781610618856000526006602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b0316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4005b600082815260076020908152604080832033845290915290205460ff16610600576129cf565b3461035e57600036600319011261035e57600a546040516001600160a01b039091168152602090f35b3461035e57600036600319011261035e576000546001546040519103600019018152602090f35b63ffffffff81160361035e57565b3461035e57602036600319011261035e5763ffffffff60043561070e816106de565b610716612a33565b1680156107305763ffffffff19600f541617600f55600080f35b63af458c0760e01b60005260046000fd5b606090600319011261035e57600435610759816105b8565b90602435610766816105b8565b9060443590565b61077f61077936610741565b9161208e565b005b3461035e57602036600319011261035e576004356000526012602052602063ffffffff60406000205460381c16604051908152f35b3461035e57600036600319011261035e5760206107d161229f565b63ffffffff60405191168152f35b61077f6107eb36610741565b90604051926107fb602085610870565b6000845261283a565b3461035e57602036600319011261035e576004356000526012602052602060ff60406000205416604051908152f35b3461035e57602036600319011261035e5760206107d1600435610855816106de565b612374565b634e487b7160e01b600052604160045260246000fd5b90601f801991011681019081106001600160401b0382111761089157604052565b61085a565b604051906108a661010083610870565b565b6001600160401b0381116108915760051b60200190565b9080601f8301121561035e5781356108d6816108a8565b926108e46040519485610870565b81845260208085019260051b82010192831161035e57602001905b82821061090c5750505090565b81358152602091820191016108ff565b906020808351928381520192019060005b81811061093a5750505090565b825161ffff1684526020938401939092019160010161092d565b906020808351928381520192019060005b8181106109725750505090565b825163ffffffff16845260209384019390920191600101610965565b906020808351928381520192019060005b8181106109ac5750505090565b82516001600160a01b031684526020938401939092019160010161099f565b9391959492909560a0850160a086528751809152602060c0870198019060005b818110610a3d57505050610a2f9291610a1388610a2193886104899a9b0360208a015261091c565b908682036040880152610954565b908482036060860152610954565b91608081840391015261098e565b825160ff168a526020998a0199909201916001016109eb565b3461035e57602036600319011261035e576004356001600160401b03811161035e57610a869036906004016108bf565b610a9081516123ae565b90610a9b81516123ae565b91610aa682516123ae565b92610ab183516123ae565b610abb84516123ae565b9160005b8551811015610bab57610ae6610ad5828861243a565b516000526012602052604060002090565b5490610b0160ff8316610af9838961243a565b9060ff169052565b610b20600883901c61ffff16610b17838661243a565b9061ffff169052565b63ffffffff601883901c16918215610b9a57610b7b610b9491610b54600195610b49868e61243a565b9063ffffffff169052565b610b6c603882901c63ffffffff16610b49868a61243a565b60581c6001600160a01b031690565b610b85838861243a565b6001600160a01b039091169052565b01610abf565b6377dfd02960e11b60005260046000fd5b50946103c5939450604051958695866109cb565b60ff81160361035e57565b3461035e57602036600319011261035e5760ff600435610be981610bbf565b166000526010602052602061ffff60406000205416604051908152f35b6001600160401b03811161089157601f01601f191660200190565b929192610c2d82610c06565b91610c3b6040519384610870565b82948184528183011161035e578281602093846000960137010152565b602060031982011261035e57600435906001600160401b03821161035e578060238301121561035e5781602461048993600401359101610c21565b3461035e57610ca136610c58565b610ca9612a33565b8051156107305780516001600160401b03811161089157610cd481610ccf600d54610fc8565b61244e565b602091601f8211600114610d4957610d049260009183610d3e575b50508160011b916000199060031b1c19161790565b600d555b604080516001815260001960208201527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c9190a1005b015190503880610cef565b600d600052601f198216927fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb59160005b858110610db257508360019510610d99575b505050811b01600d55610d08565b015160001960f88460031b161c19169055388080610d8b565b91926020600181928685015181550194019201610d79565b3461035e57600036600319011261035e576020610de56124f4565b6040519015158152f35b602060408183019282815284518094520192019060005b818110610e135750505090565b8251845260209384019390920191600101610e06565b3461035e57604036600319011261035e57600435602435600054908201808311610ee65781811115610edf57505b610e5f6125ad565b915b818110610e7657604051806103c58582610def565b80610e8260019261297f565b610e8d575b01610e61565b610ebc610eb6610eb1610eaa846000526012602052604060002090565b5460ff1690565b6125cf565b60ff1690565b610ed9610ed2610ecc838861243a565b516125e2565b918661243a565b52610e87565b9050610e57565b61225b565b3461035e57602036600319011261035e576020600b63ffffffff610f21610f1c600435610f17816106de565b612271565b612327565b160463ffffffff60405191168152f35b3461035e57600036600319011261035e57602063ffffffff600f5416604051908152f35b3461035e57602036600319011261035e5760206001600160a01b03610f7b600435612a5c565b16604051908152f35b3461035e57600036600319011261035e57602063ffffffff600f54821c16604051908152f35b3461035e57600036600319011261035e576020600e54604051908152f35b90600182811c92168015610ff8575b6020831014610fe257565b634e487b7160e01b600052602260045260246000fd5b91607f1691610fd7565b3461035e57600036600319011261035e576040516000600d5461102481610fc8565b8084529060018116908115610541575060011461104b576103c5836104d681850382610870565b600d60009081527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5939250905b808210611090575090915081016020016104d66104c6565b919260018160209254838588010152019101909291611078565b3461035e57602036600319011261035e5760206110d16004356110cc816105b8565b612604565b604051908152f35b3461035e57600036600319011261035e576110f2612a33565b600980546001600160a01b031981169091556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461035e57600036600319011261035e5760206107d161263e565b3461035e57600036600319011261035e576009546040516001600160a01b039091168152602090f35b3461035e57600036600319011261035e576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b604090600319011261035e576004356111d7816105b8565b90602435610489816105b8565b3461035e576111f2366111bf565b906111fb612a33565b600b546001600160a01b03166112ef576001600160a01b038116156112de576001600160a01b038216156112de57600b80546001600160a01b0319166001600160a01b03909216919091179055600a80546001600160a01b0319166001600160a01b038316179055600b546112869061127a906001600160a01b031681565b6001600160a01b031690565b803b1561035e576040516326aac58b60e11b81526001600160a01b0383166004820152906000908290602490829084905af180156112d9576112c457005b806112d3600061077f93610870565b80610425565b61224f565b63d92e233d60e01b60005260046000fd5b632b0039c760e21b60005260046000fd5b3461035e5761130e36610c58565b611316612a33565b8051156107305780516001600160401b038111610891576113418161133c600c54610fc8565b6124a1565b602091601f821160011461139b576113709260009183610d3e5750508160011b916000199060031b1c19161790565b600c555b7fa5d4097edda6d87cb9329af83fb3712ef77eeb13738ffe43cc35a4ce305ad962600080a1005b600c600052601f198216927fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c79160005b858110611404575083600195106113eb575b505050811b01600c55611374565b015160001960f88460031b161c191690553880806113dd565b919260206001819286850151815501940192016113cb565b3461035e57600036600319011261035e57604051600060035461143e81610fc8565b80845290600181169081156105415750600114611465576103c5836104d681850382610870565b600360009081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b8082106114aa575090915081016020016104d66104c6565b919260018160209254838588010152019101909291611492565b8015150361035e57565b3461035e57604036600319011261035e576004356114eb816105b8565b602435906114f8826114c4565b3360009081526007602090815260408083206001600160a01b0385168452909152902060ff1981541660ff84151516179055604051911515825260018060a01b0316907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b3461035e57600036600319011261035e5761077f612692565b3461035e57602036600319011261035e576103c56115a460043561159f816105b8565b6127a0565b60405191829182610def565b3461035e57602036600319011261035e576004356000526012602052602061ffff60406000205460081c16604051908152f35b3461035e57602036600319011261035e5760ff60043561160281610bbf565b1660005260116020526020604060002054604051908152f35b608036600319011261035e57600435611633816105b8565b60243590611640826105b8565b604435606435926001600160401b03841161035e573660238501121561035e5761167761077f943690602481600401359101610c21565b9261283a565b9181601f8401121561035e578235916001600160401b03831161035e576020808501948460051b01011161035e57565b604036600319011261035e576004356001600160401b03811161035e576116d890369060040161167d565b6024356116e36124f4565b156117a257600a546001600160a01b0316156112de5761170e8261077f94611709612692565b612bf3565b9061177861172f6117286117218561287d565b6064900490565b9284612d17565b600a54909290611752906001600160a01b031661174c83876128c2565b90612ecb565b7f0000000000000000000000000000000000000000000000000000000000000000612ecb565b818111611788575b505033612f1e565b61179b91611795916128c2565b33612ecb565b3880611780565b630fe219dd60e21b60005260046000fd5b3461035e57602036600319011261035e576004356117d08161297f565b1561197c57600052601260205260ff604060002054168060009172184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b821015611959575b806d04ee2d6d415b85acef8100000000600a92101561193d575b662386f26fc10000811015611928575b6305f5e100811015611916575b612710811015611906575b60648110156118f7575b10156118ec575b611899602161186d60018501612fe9565b938401015b60001901916f181899199a1a9b1b9c1cb0b131b232b360811b600a82061a8353600a900490565b9081156118a95761189990611872565b6040516103c5906104d6816118de6118cd886118c7602085016128cf565b90612958565b64173539b7b760d91b815260050190565b03601f198101835282610870565b60019091019061185c565b60029060649004930192611855565b600490612710900493019261184b565b6008906305f5e1009004930192611840565b601090662386f26fc100009004930192611833565b6020906d04ee2d6d415b85acef81000000009004930192611823565b506040915072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8104611809565b630a14c4b560e41b60005260046000fd5b602060031982011261035e57600435906001600160401b03821161035e576119b79160040161167d565b9091565b3461035e576119c93661198d565b906119d26124f4565b156117a257600a546001600160a01b0316156112de57816119f591611709612692565b906064611a018361287d565b600a546001600160a01b031693919004808203918211610ee657611a2c611a539261077f9533613011565b7f000000000000000000000000000000000000000000000000000000000000000033613011565b33612f1e565b3461035e57600036600319011261035e576020600154604051908152f35b3461035e57604036600319011261035e576004356001600160401b03811161035e57611aa79036906004016108bf565b60243590611ab4826105b8565b611abe81516123ae565b9160005b8251811015611b7857611ad5818461243a565b5190611aeb826000526012602052604060002090565b5491611b05603884901c63ffffffff165b63ffffffff1690565b611b4f5761127a61127a611b1892612a5c565b6001600160a01b03848116911603611b3f576001915b611b38828761243a565b5201611ac2565b6282b42960e81b60005260046000fd5b50605882901c6001600160a01b03166001600160a01b03848116911603611b3f57600191611b2e565b604051806103c58682610def565b3461035e57602036600319011261035e57600435611ba3816106de565b611bab612a33565b63ffffffff8116801561073057612710106112ef5767ffffffff00000000600f549160201b169067ffffffff00000000191617600f55600080f35b3461035e57611bf43661198d565b90811561073057611c0361229f565b611c0b61263e565b91611c1583612374565b9163ffffffff80611c25866125f1565b94169116928184119081611e63575b5080611e53575b15611da25760009460005b818110611cb9575050600b54611c6a935061127a92506001600160a01b0316905081565b91600e5492803b1561035e576040516370677bbb60e01b815263ffffffff93909316600484015260248301939093526044820152906000908290606490829084905af180156112d9576112c457005b611cc481838661296f565b3533611cd861127a61127a61127a85612a5c565b03611b3f5783611d5182611cf36001600160401b0394613534565b60009081526012602052604090208054600160381b600160f81b0319811660388b901b67ffffffffffffffff60381b16173360581b600160581b600160f81b031617909155600881901c61ffff169160189190911c63ffffffff1690565b9092161115611d7c575b90611d76611d7161ffff60019416600e546128c2565b600e55565b01611c46565b9690611d76611d7161ffff611d96600195828d16906125a0565b9a939450505050611d5b565b5091509160005b818110611db257005b611dbd81838561296f565b359033611dd261127a61127a61127a86612a5c565b03611b3f57611e4d611d71611e45611e3e85611def600197613534565b60009081526012602052604090208054600160381b600160f81b0319811660388c901b67ffffffffffffffff60381b16173360581b600160581b600160f81b03161790915560081c61ffff1690565b61ffff1690565b600e546128c2565b01611da9565b50600463ffffffff851610611c3b565b63ffffffff915016831038611c34565b3461035e57600036600319011261035e576040516000600c54611e9581610fc8565b80845290600181169081156105415750600114611ebc576103c5836104d681850382610870565b600c60009081527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7939250905b808210611f01575090915081016020016104d66104c6565b919260018160209254838588010152019101909291611ee9565b3461035e57602060ff611f59611f30366111bf565b6001600160a01b0391821660009081526007865260408082209290931681526020919091522090565b54166040519015158152f35b3461035e57602036600319011261035e5760043560009081526012602090815260409182902054915160589290921c6001600160a01b0316825290f35b3461035e57602036600319011261035e57600435611fbf816105b8565b611fc7612a33565b6001600160a01b0316801561201a57600980546001600160a01b0319811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b631e4fbdf760e01b600052600060045260246000fd5b3461035e57600036600319011261035e57600b546040516001600160a01b039091168152602090f35b3461035e57602036600319011261035e576004356000526012602052602063ffffffff60406000205460181c16604051908152f35b919061209982612a5c565b6001600160a01b0393841693811684900361223557600083815260066020526040902080546120db6001600160a01b03871633908114908314171590565b1590565b6121ee575b6121e4575b506001600160a01b038416600090815260056020526040902080546000190190556001600160a01b0382166000908152600560205260409020805460010190556001600160a01b0382164260a01b17600160e11b1761214e846000526004602052604060002090565b55600160e11b81161561219a575b506001600160a01b03169182907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a41561219557565b612a01565b600183016121b2816000526004602052604060002090565b54156121bf575b5061215c565b60005481146121b9576121dc906000526004602052604060002090565b5538806121b9565b60009055386120e5565b61222b6120d7610eaa336122148a60018060a01b03166000526007602052604060002090565b9060018060a01b0316600052602052604060002090565b156120e0576129f0565b6129e0565b9081602091031261035e5751610489816106de565b6040513d6000823e3d90fd5b634e487b7160e01b600052601160045260246000fd5b63ffffffff60019116019063ffffffff8211610ee657565b634e487b7160e01b600052601260045260246000fd5b60405163175c979560e31b81526366f04d10600482015260208160248173bbf25ca275325ef4682851a12bd8e9aa714da2f45af480156112d9576122f363ffffffff91600b936000916122f8575b50612271565b160490565b61231a915060203d602011612320575b6123128183610870565b81019061223a565b386122ed565b503d612308565b63ffffffff16610309029063ffffffff8216918203610ee657565b63ffffffff16612710039063ffffffff8211610ee657565b9063ffffffff8091169116039063ffffffff8211610ee657565b61237d90612327565b63ffffffff61018491160163ffffffff8111610ee657600b63ffffffff91821604811660001901908111610ee65790565b906123b8826108a8565b6123c56040519182610870565b82815280926123d6601f19916108a8565b0190602036910137565b604051606091906123f18382610870565b6002815291601f1901366020840137565b634e487b7160e01b600052603260045260246000fd5b8051156124255760200190565b612402565b8051600110156124255760400190565b80518210156124255760209160051b010190565b601f811161245a575050565b600d6000526020600020906020601f840160051c83019310612497575b601f0160051c01905b81811061248b575050565b60008155600101612480565b9091508190612477565b601f81116124ad575050565b600c6000526020600020906020601f840160051c830193106124ea575b601f0160051c01905b8181106124de575050565b600081556001016124d3565b90915081906124ca565b63673f671063ffffffff4216908110908115612592575b5061258d5760405163175c979560e31b81526366f04d10600482015260208160248173bbf25ca275325ef4682851a12bd8e9aa714da2f45af480156112d95761255b916000916122f85750612271565b608463ffffffff8216111561258757612581611afc6120d79263ffffffff602c91160490565b60011690565b50600190565b600090565b90506372f16590103861250b565b91908201809211610ee657565b604051608091906125be8382610870565b6003815291601f1901366020840137565b60ff6000199116019060ff8211610ee657565b6000198114610ee65760010190565b63ffffffff6122f3610f1c600b93612271565b6001600160a01b0316801561262d5760005260056020526001600160401b036040600020541690565b6323d3ad8160e21b60005260046000fd5b60405163175c979560e31b81526366f04d10600482015260208160248173bbf25ca275325ef4682851a12bd8e9aa714da2f45af480156112d9576122f363ffffffff91610309936000916122f85750612271565b61269a61229f565b6126a261263e565b90600463ffffffff8316101561279c576126d26120d7610eaa8463ffffffff166000526013602052604060002090565b9081612780575b506126e15750565b600b546126f89061127a906001600160a01b031681565b90600e5491803b1561035e5760405163348b041f60e21b815263ffffffff8316600482015260248101939093526000908390604490829084905af19081156112d9576108a69261275e9261276b575b5063ffffffff166000526013602052604060002090565b805460ff19166001179055565b806112d3600061277a93610870565b38612747565b905063ffffffff612793611afc84612374565b911611386126d9565b5050565b906000546127ad83612604565b6127b6816123ae565b9381156128355760009060015b8481106127d1575050505050565b6127da8161297f565b80612812575b6127ed575b6001016127c3565b9180836127fd612803938a61243a565b526125e2565b918383036127e5575050505050565b506001600160a01b0361282482612a5c565b166001600160a01b038316146127e0565b505050565b92919061284882828661208e565b803b612855575b50505050565b61285e93612b42565b1561286c573880808061284f565b6368d2bf6b60e11b60005260046000fd5b908160031b9180830460081490151715610ee657565b81810292918115918404141715610ee657565b80156128b3576000190490565b612289565b81156128b3570490565b91908203918211610ee657565b600d54600092916128df82610fc8565b916001811690811561294657506001146128f7575050565b600d600090815292935090917fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb55b8382106129325750500190565b600181602092548486015201910190612925565b60ff1916825250811515909102019150565b9061296b60209282815194859201610430565b0190565b91908110156124255760051b0190565b90600091806001111561298f5750565b600054811061299b5750565b9091505b806000526004602052604060002054806129c357508015610ee6576000190161299f565b600160e01b1615919050565b6367d9dca160e11b60005260046000fd5b62a1148160e81b60005260046000fd5b632ce44b5f60e11b60005260046000fd5b633a954ecd60e21b60005260046000fd5b636f96cda160e11b60005260046000fd5b622e076360e81b60005260046000fd5b6009546001600160a01b03163303612a4757565b63118cdaa760e01b6000523360045260246000fd5b80600111612a1257612a78816000526004602052604060002090565b54908115612a8f5750600160e01b8116612a125790565b9050600054811015612a12575b60001901600081815260046020526040902054908115612ac55750600160e01b8116612a125790565b9050612a9c565b9081602091031261035e57516104898161034c565b6001600160a01b03918216815291166020820152604081019190915260806060820181905261048992910190610453565b3d15612b3d573d90612b2382610c06565b91612b316040519384610870565b82523d6000602084013e565b606090565b906020926000612b6b959360405196879586948593630a85bd0160e11b85523360048601612ae1565b03926001600160a01b03165af160009181612bb8575b50612ba257612b8e612b12565b805115612b9d57805190602001fd5b61286c565b6001600160e01b031916630a85bd0160e11b1490565b612bdb91925060203d602011612be2575b612bd38183610870565b810190612acc565b9038612b81565b503d612bc9565b3561048981610bbf565b6000929180156107305760005491612c0961229f565b9263ffffffff60009416925b808510612c23575050505050565b9091929395612c3b612c3688848761296f565b612be9565b9060ff82168015908115612cfd575b50612cec57612cdf82612ccc61ffff8b612cc28b8a86612c8f612c87612c7f60019d60ff166000526010602052604060002090565b5461ffff1690565b9586936125a0565b6affffffffffffffff00000060ff92939462ffff0092600052601260205260181b169360081b1691161717604060002055565b16600e5401600e55565b60ff166000526011602052604060002090565b5401960193929190612c15565b63f8e309e360e01b60005260046000fd5b600391501138612c4a565b9081602091031261035e575190565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23b1561035e57604051630d0e30db60e41b8152916000836004813473c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25af19182156112d957612e6093602093612eb6575b50612d7c8134613053565b612d84610896565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281529173f19308f923582a6f7c465e5ce7a9dc1bec6665b183850152612710604084015230606084015260808301523460a083015260c0820152600060e0820152612de334613314565b6040805163414bf38960e01b815282516001600160a01b0390811660048301526020840151811660248301529183015162ffffff1660448201526060830151821660648201526080830151608482015260a083015160a482015260c083015160c482015260e0909201511660e48201529182908190610104820190565b0381600073e592427a0aece92de3edee1f18e0157c058615645af19081156112d957600091612e8d575090565b610489915060203d602011612eaf575b612ea78183610870565b810190612d08565b503d612e9d565b806112d36000612ec593610870565b38612d71565b60405163a9059cbb60e01b60208201526001600160a01b03909116602482015260448101919091526108a690612f0481606481016118de565b73f19308f923582a6f7c465e5ce7a9dc1bec6665b16134c6565b600054908215612fd8576001600160a01b0381164260a01b6001851460e11b1717612f53836000526004602052604060002090565b556001600160a01b031660008181526005602052604090208054680100000000000000018502019055918215612fd3578101909260015b15612fbe575b60008484827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4612f8a565b9260010192818403612f905792509050600055565b612a23565b63b562e8dd60e01b60005260046000fd5b90612ff382610c06565b6130006040519182610870565b82815280926123d6601f1991610c06565b6040516323b872dd60e01b60208201526001600160a01b039182166024820152911660448201526064808201929092529081526108a690612f04608482610870565b600f54604051633850c7bd60e01b815263ffffffff82169060e08160048173c45a81bc23a64ea556ab4cdf08a86b61cdceea8b5afa80156112d9576130c16080916130e5936000906000926132d8575b506130bc906130b761ffff841615156136bd565b6136ee565b613702565b60405163252c09d760e01b815261ffff909116600482015291829081906024820190565b038173c45a81bc23a64ea556ab4cdf08a86b61cdceea8b5afa9081156112d9576000906000926132b3575b5090156131d7575b611afc6131a461319773f19308f923582a6f7c465e5ce7a9dc1bec6665b173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26131b7986001600160801b0361318f6131896131af9b9a6131756131a99b63ffffffff421661235a565b8163ffffffff8216106131cf575b50613976565b50613b20565b911690613ea3565b9360201c63ffffffff1690565b612342565b90612893565b612710900490565b116131be57565b63431653f160e11b60005260046000fd5b905038613183565b5060405163252c09d760e01b81526000600482015290919060808160248173c45a81bc23a64ea556ab4cdf08a86b61cdceea8b5afa80156112d9576131a461319773f19308f923582a6f7c465e5ce7a9dc1bec6665b173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26131b7986001600160801b0361318f6131896131af9b613175611afc9a6131a99c600091613281575b509b50509a9b5050505098505050505050613118565b6132a3915060803d6080116132ac575b61329b8183610870565b810190613724565b5050503861326b565b503d613291565b90506132ce915060803d6080116132ac5761329b8183610870565b9291505038613110565b6130bc92506132ff915060e03d60e01161330d575b6132f78183610870565b810190613653565b5050509392509050906130a3565b503d6132ed565b604051636eb1769f60e11b815230600482015273e592427a0aece92de3edee1f18e0157c0586156460248201529060208260448173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25afa9182156112d957600092613490575b508101809111610ee65760405163095ea7b360e01b6020820190815273e592427a0aece92de3edee1f18e0157c058615646024830181905260448084019490945292825273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290613407906133d7606485610870565b83516001600160a01b03841691600091829182855af1906133f6612b12565b8261345e575b508161345757501590565b61341057505050565b60405163095ea7b360e01b60208201526001600160a01b039093166024840152600060448401526108a6926134529061344c81606481016118de565b826134c6565b6134c6565b3b15919050565b80519192508115918215613476575b505090386133fc565b61348992506020809183010191016134b1565b388061346d565b6134aa91925060203d602011612eaf57612ea78183610870565b903861336e565b9081602091031261035e5751610489816114c4565b6000806134ef9260018060a01b03169360208151910182865af16134e8612b12565b9083614134565b8051908115159182613519575b50506135055750565b635274afe760e01b60005260045260246000fd5b61352c92506020809183010191016134b1565b1538806134fc565b600061353f82612a5c565b600083815260066020526040902080546001600160a01b03831692919061363b575b506001600160a01b038216600090815260056020526040902080546001600160801b0301905560008481526004602052604090206001600160a01b0383164260a01b17600360e01b179055600160e11b8116156135f2575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a46108a66135ed60015460010190565b600155565b6001840161360a816000526004602052604060002090565b5415613617575b506135b9565b8354811461361157613633906000526004602052604060002090565b553880613611565b83905538613561565b519061ffff8216820361035e57565b908160e091031261035e578051613669816105b8565b9160208201518060020b810361035e579161368660408201613644565b9161369360608301613644565b916136a060808201613644565b9160c060a08301516136b181610bbf565b920151610489816114c4565b156136c457565b60405162461bcd60e51b81526020600482015260026024820152614e4960f01b6044820152606490fd5b61ffff60019116019061ffff8211610ee657565b9061ffff169081156128b35761ffff160690565b51908160060b820361035e57565b919082608091031261035e57815161373b816106de565b9161374860208201613716565b91606060408301516136b1816105b8565b1561376057565b60405162461bcd60e51b8152602060048201526002602482015261042560f41b6044820152606490fd5b9080601f8301121561035e5781516137a1816108a8565b926137af6040519485610870565b81845260208085019260051b82010192831161035e57602001905b8282106137d75750505090565b6020809183516137e6816105b8565b8152019101906137ca565b91909160408184031261035e5780516001600160401b03811161035e57810183601f8201121561035e57805190613827826108a8565b916138356040519384610870565b80835260208084019160051b8301019186831161035e57602001905b828210613879575050509260208201516001600160401b03811161035e57610489920161378a565b6020809161388684613716565b815201910190613851565b906020610489928181520190610954565b600691820b910b0390667fffffffffffff198212667fffffffffffff831317610ee657565b6001600160a01b039182169082160391908211610ee657565b60060b9060060b9081156128b357667fffffffffffff198114600019831416610ee6570590565b9060060b9081156128b35760060b0790565b60020b627fffff198114610ee6576000190190565b6001600160c01b039081166001600160a01b0381810290921692918184041490151715610ee657565b6001600160c01b039091169081156128b3576001600160c01b03160490565b906139ca91600063ffffffff821691613990831515613759565b6139a561399b6123e0565b91610b4983612418565b816139af8261242a565b526040518095819263883bdbfd60e01b835260048301613891565b038173c45a81bc23a64ea556ab4cdf08a86b61cdceea8b5afa9283156112d957600090600094613af1575b50613a2281613a1c613a0f613a16613a0f613a489661242a565b5160060b90565b92612418565b906138a2565b93613a42613a35613a16613a358461242a565b516001600160a01b031690565b906138c7565b908060060b93613a61613a5b86836138e0565b60020b90565b9460008260060b129182613ad3575b5050613ab0575b61048991613a9e613a8a613aa49361392e565b9160201b640100000000600160c01b031690565b90613957565b6001600160801b031690565b9261048991613a9e613a8a613ac7613aa494613919565b96935050509150613a77565b613ae8925090613ae291613907565b60060b90565b15153880613a70565b613a229450613a489150613b17903d806000833e613b0f8183610870565b8101906137f1565b949091506139f5565b60020b6000811215613e9d5780600003905b620d89e88211613e8c576001821615613e7a576001600160881b036ffffcb933bd6fad37aa2d162d1a5940015b169160028116613e5e575b60048116613e42575b60088116613e26575b60108116613e0a575b60208116613dee575b60408116613dd2575b60808116613db6575b6101008116613d9a575b6102008116613d7e575b6104008116613d62575b6108008116613d46575b6110008116613d2a575b6120008116613d0e575b6140008116613cf2575b6180008116613cd6575b620100008116613cba575b620200008116613c9f575b620400008116613c84575b6208000016613c6b575b600012613c5d575b613c3a613c308260201c90565b9163ffffffff1690565b613c55576000905b60ff91909116016001600160a01b031690565b600190613c42565b613c66906128a6565b613c23565b6b048a170391f7dc42444e8fa290910260801c90613c1b565b6d2216e584f5fa1ea926041bedfe9890920260801c91613c11565b916e5d6af8dedb81196699c329225ee6040260801c91613c06565b916f09aa508b5b7a84e1c677de54f3e99bc90260801c91613bfb565b916f31be135f97d08fd981231505542fcfa60260801c91613bf0565b916f70d869a156d2a1b890bb3df62baf32f70260801c91613be6565b916fa9f746462d870fdf8a65dc1f90e061e50260801c91613bdc565b916fd097f3bdfd2022b8845ad8f792aa58250260801c91613bd2565b916fe7159475a2c29b7443b29c7fa6e889d90260801c91613bc8565b916ff3392b0822b70005940c7a398e4b70f30260801c91613bbe565b916ff987a7253ac413176f2b074cf7815e540260801c91613bb4565b916ffcbe86c7900a88aedcffc83b479aa3a40260801c91613baa565b916ffe5dee046a99a2a811c461f1969c30530260801c91613ba0565b916fff2ea16466c96a3843ec78b326b528610260801c91613b97565b916fff973b41fa98c081472e6896dfb254c00260801c91613b8e565b916fffcb9843d60f6159c9db58835c9266440260801c91613b85565b916fffe5caca7e10e4e61c3624eaa0941cd00260801c91613b7c565b916ffff2e50f5f656932ef12357cf3c7fdcc0260801c91613b73565b916ffff97272373d413259a46990580e213a0260801c91613b6a565b6001600160881b03600160801b613b5f565b6315e4079d60e11b60005260046000fd5b80613b32565b909291906001600160a01b03166001600160801b038111613eef5780613ec891612893565b916001600160a01b0390811691161015613ee65790610489916140e5565b61048991614060565b80613ef991613f20565b916001600160a01b0390811691161015613f17579061048991614011565b61048991613f80565b818102919060001982820991838084109303928084039314613f725782600160401b1115613f6157600160401b910990828211900360c01b910360401c1790565b63227bc15360e01b60005260046000fd5b50600160401b929150500490565b90608082901b9060001983600160801b09928280851094039380850394146140055783821115613f61578190600160801b09816000038216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b509061048992506128b8565b81810291906000198282099183808410930392808403931461405257600160801b831015613f6157600160801b910990828211900360801b910360801c1790565b50600160801b929150500490565b9060c082901b9060001983600160c01b09928280851094039380850394146140055783821115613f61578190600160c01b09816000038216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b81810291906000198282099183808410930392808403931461412657600160c01b831015613f6157600160c01b910990828211900360401b910360c01c1790565b50600160c01b929150500490565b9061415a575080511561414957805190602001fd5b630a12f52160e11b60005260046000fd5b8151158061418c575b61416b575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561416356fea2646970667358221220a19c64bc00d68502ab8cea83907d2ab0b44588854b575ea19be1f69bfe754a7f64736f6c634300081a00330000000000000000000000003408db118057909a62c805c3d38500f9e0ea601a0000000000000000000000002d28cfb0a0928ca0d29fae64275569f503fc0acc000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d556953567148425a4d4d74434b5066466a3876524b69323358746a4575525470485769344479576f6f524e7a00000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d65557248315a4275694e76416d5a71566e59553744354d63316763536a6536696a424a673254476a4c38367a2f00000000000000000000

Deployed Bytecode

0x6080604052600436101561001257600080fd5b60003560e01c806301ffc9a71461034757806306fdde0314610342578063081812fc1461033d578063095ea7b3146103385780630c5f800b1461033357806318160ddd1461032e5780631ad7b1271461032957806323b872dd1461032457806326a245751461031f5780633c9c09e41461031a57806342842e0e14610315578063493d5dfe146103105780634b150c391461030b5780634beb7797146103065780634cdcd8d31461030157806355f804b3146102fc578063564566a8146102f75780636173b4ed146102f257806361c22a68146102ed578063633dd145146102e85780636352211e146102e3578063639097a1146102de578063651c5434146102d95780636c0360eb146102d457806370a08231146102cf578063715018a6146102ca5780637d8dbb2d146102c55780638da5cb5b146102c05780638ea5220f146102bb57806390f73d3c146102b6578063938e3d7b146102b157806395d89b41146102ac578063a22cb465146102a7578063a38d8615146102a2578063a3b261f21461029d578063adf8252d14610298578063b4fad6f814610293578063b88d4fde1461028e578063c467366a14610289578063c87b56dd14610284578063cb0a44331461027f578063d89135cd1461027a578063d9e1460014610275578063daf8c5aa14610270578063dc8e92ea1461026b578063e8a3d48514610266578063e985e9c514610261578063ebb786871461025c578063f2fde38b14610257578063f7cc662d146102525763fa7272141461024d57600080fd5b612059565b612030565b611fa2565b611f65565b611f1b565b611e73565b611be6565b611b86565b611a77565b611a59565b6119bb565b6117b3565b6116ad565b61161b565b6115e3565b6115b0565b61157c565b611563565b6114ce565b61141c565b611300565b6111e4565b61117a565b611151565b611136565b6110d9565b6110aa565b611002565b610faa565b610f84565b610f55565b610f31565b610eeb565b610e29565b610dca565b610c93565b610bca565b610a56565b610833565b610804565b6107df565b6107b6565b610781565b61076d565b6106ec565b6106b7565b61068e565b6105c9565b610565565b61048c565b610363565b6001600160e01b031981160361035e57565b600080fd5b3461035e57602036600319011261035e576103c56004356103838161034c565b6001600160e01b0319166301ffc9a760e01b8114908115908282610414575b8315610403575b83156103c9575b50506040519115158252509081906020820190565b0390f35b9250906103f2575b81156103e1575b503880806103b0565b635b5e139f60e01b149050386103d8565b6380ac58cd60e01b811491506103d1565b635b5e139f60e01b821493506103a9565b6380ac58cd60e01b821493506103a2565b600091031261035e57565b60005b8381106104435750506000910152565b8181015183820152602001610433565b9060209161046c81518092818552858086019101610430565b601f01601f1916010190565b906020610489928181520190610453565b90565b3461035e57600036600319011261035e5760405160006002546104ae81610fc8565b808452906001811690811561054157506001146104e2575b6103c5836104d681850382610870565b60405191829182610478565b600260009081527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace939250905b808210610527575090915081016020016104d66104c6565b91926001816020925483858801015201910190929161050f565b60ff191660208086019190915291151560051b840190910191506104d690506104c6565b3461035e57602036600319011261035e576004356105828161297f565b156105a7576000526006602052602060018060a01b0360406000205416604051908152f35b6333d1c03960e21b60005260046000fd5b6001600160a01b0381160361035e57565b604036600319011261035e576004356105e1816105b8565b602435906001600160a01b036105f683612a5c565b1690813303610668575b61063781610618856000526006602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b0316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4005b600082815260076020908152604080832033845290915290205460ff16610600576129cf565b3461035e57600036600319011261035e57600a546040516001600160a01b039091168152602090f35b3461035e57600036600319011261035e576000546001546040519103600019018152602090f35b63ffffffff81160361035e57565b3461035e57602036600319011261035e5763ffffffff60043561070e816106de565b610716612a33565b1680156107305763ffffffff19600f541617600f55600080f35b63af458c0760e01b60005260046000fd5b606090600319011261035e57600435610759816105b8565b90602435610766816105b8565b9060443590565b61077f61077936610741565b9161208e565b005b3461035e57602036600319011261035e576004356000526012602052602063ffffffff60406000205460381c16604051908152f35b3461035e57600036600319011261035e5760206107d161229f565b63ffffffff60405191168152f35b61077f6107eb36610741565b90604051926107fb602085610870565b6000845261283a565b3461035e57602036600319011261035e576004356000526012602052602060ff60406000205416604051908152f35b3461035e57602036600319011261035e5760206107d1600435610855816106de565b612374565b634e487b7160e01b600052604160045260246000fd5b90601f801991011681019081106001600160401b0382111761089157604052565b61085a565b604051906108a661010083610870565b565b6001600160401b0381116108915760051b60200190565b9080601f8301121561035e5781356108d6816108a8565b926108e46040519485610870565b81845260208085019260051b82010192831161035e57602001905b82821061090c5750505090565b81358152602091820191016108ff565b906020808351928381520192019060005b81811061093a5750505090565b825161ffff1684526020938401939092019160010161092d565b906020808351928381520192019060005b8181106109725750505090565b825163ffffffff16845260209384019390920191600101610965565b906020808351928381520192019060005b8181106109ac5750505090565b82516001600160a01b031684526020938401939092019160010161099f565b9391959492909560a0850160a086528751809152602060c0870198019060005b818110610a3d57505050610a2f9291610a1388610a2193886104899a9b0360208a015261091c565b908682036040880152610954565b908482036060860152610954565b91608081840391015261098e565b825160ff168a526020998a0199909201916001016109eb565b3461035e57602036600319011261035e576004356001600160401b03811161035e57610a869036906004016108bf565b610a9081516123ae565b90610a9b81516123ae565b91610aa682516123ae565b92610ab183516123ae565b610abb84516123ae565b9160005b8551811015610bab57610ae6610ad5828861243a565b516000526012602052604060002090565b5490610b0160ff8316610af9838961243a565b9060ff169052565b610b20600883901c61ffff16610b17838661243a565b9061ffff169052565b63ffffffff601883901c16918215610b9a57610b7b610b9491610b54600195610b49868e61243a565b9063ffffffff169052565b610b6c603882901c63ffffffff16610b49868a61243a565b60581c6001600160a01b031690565b610b85838861243a565b6001600160a01b039091169052565b01610abf565b6377dfd02960e11b60005260046000fd5b50946103c5939450604051958695866109cb565b60ff81160361035e57565b3461035e57602036600319011261035e5760ff600435610be981610bbf565b166000526010602052602061ffff60406000205416604051908152f35b6001600160401b03811161089157601f01601f191660200190565b929192610c2d82610c06565b91610c3b6040519384610870565b82948184528183011161035e578281602093846000960137010152565b602060031982011261035e57600435906001600160401b03821161035e578060238301121561035e5781602461048993600401359101610c21565b3461035e57610ca136610c58565b610ca9612a33565b8051156107305780516001600160401b03811161089157610cd481610ccf600d54610fc8565b61244e565b602091601f8211600114610d4957610d049260009183610d3e575b50508160011b916000199060031b1c19161790565b600d555b604080516001815260001960208201527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c9190a1005b015190503880610cef565b600d600052601f198216927fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb59160005b858110610db257508360019510610d99575b505050811b01600d55610d08565b015160001960f88460031b161c19169055388080610d8b565b91926020600181928685015181550194019201610d79565b3461035e57600036600319011261035e576020610de56124f4565b6040519015158152f35b602060408183019282815284518094520192019060005b818110610e135750505090565b8251845260209384019390920191600101610e06565b3461035e57604036600319011261035e57600435602435600054908201808311610ee65781811115610edf57505b610e5f6125ad565b915b818110610e7657604051806103c58582610def565b80610e8260019261297f565b610e8d575b01610e61565b610ebc610eb6610eb1610eaa846000526012602052604060002090565b5460ff1690565b6125cf565b60ff1690565b610ed9610ed2610ecc838861243a565b516125e2565b918661243a565b52610e87565b9050610e57565b61225b565b3461035e57602036600319011261035e576020600b63ffffffff610f21610f1c600435610f17816106de565b612271565b612327565b160463ffffffff60405191168152f35b3461035e57600036600319011261035e57602063ffffffff600f5416604051908152f35b3461035e57602036600319011261035e5760206001600160a01b03610f7b600435612a5c565b16604051908152f35b3461035e57600036600319011261035e57602063ffffffff600f54821c16604051908152f35b3461035e57600036600319011261035e576020600e54604051908152f35b90600182811c92168015610ff8575b6020831014610fe257565b634e487b7160e01b600052602260045260246000fd5b91607f1691610fd7565b3461035e57600036600319011261035e576040516000600d5461102481610fc8565b8084529060018116908115610541575060011461104b576103c5836104d681850382610870565b600d60009081527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5939250905b808210611090575090915081016020016104d66104c6565b919260018160209254838588010152019101909291611078565b3461035e57602036600319011261035e5760206110d16004356110cc816105b8565b612604565b604051908152f35b3461035e57600036600319011261035e576110f2612a33565b600980546001600160a01b031981169091556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461035e57600036600319011261035e5760206107d161263e565b3461035e57600036600319011261035e576009546040516001600160a01b039091168152602090f35b3461035e57600036600319011261035e576040517f0000000000000000000000002d28cfb0a0928ca0d29fae64275569f503fc0acc6001600160a01b03168152602090f35b604090600319011261035e576004356111d7816105b8565b90602435610489816105b8565b3461035e576111f2366111bf565b906111fb612a33565b600b546001600160a01b03166112ef576001600160a01b038116156112de576001600160a01b038216156112de57600b80546001600160a01b0319166001600160a01b03909216919091179055600a80546001600160a01b0319166001600160a01b038316179055600b546112869061127a906001600160a01b031681565b6001600160a01b031690565b803b1561035e576040516326aac58b60e11b81526001600160a01b0383166004820152906000908290602490829084905af180156112d9576112c457005b806112d3600061077f93610870565b80610425565b61224f565b63d92e233d60e01b60005260046000fd5b632b0039c760e21b60005260046000fd5b3461035e5761130e36610c58565b611316612a33565b8051156107305780516001600160401b038111610891576113418161133c600c54610fc8565b6124a1565b602091601f821160011461139b576113709260009183610d3e5750508160011b916000199060031b1c19161790565b600c555b7fa5d4097edda6d87cb9329af83fb3712ef77eeb13738ffe43cc35a4ce305ad962600080a1005b600c600052601f198216927fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c79160005b858110611404575083600195106113eb575b505050811b01600c55611374565b015160001960f88460031b161c191690553880806113dd565b919260206001819286850151815501940192016113cb565b3461035e57600036600319011261035e57604051600060035461143e81610fc8565b80845290600181169081156105415750600114611465576103c5836104d681850382610870565b600360009081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b8082106114aa575090915081016020016104d66104c6565b919260018160209254838588010152019101909291611492565b8015150361035e57565b3461035e57604036600319011261035e576004356114eb816105b8565b602435906114f8826114c4565b3360009081526007602090815260408083206001600160a01b0385168452909152902060ff1981541660ff84151516179055604051911515825260018060a01b0316907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b3461035e57600036600319011261035e5761077f612692565b3461035e57602036600319011261035e576103c56115a460043561159f816105b8565b6127a0565b60405191829182610def565b3461035e57602036600319011261035e576004356000526012602052602061ffff60406000205460081c16604051908152f35b3461035e57602036600319011261035e5760ff60043561160281610bbf565b1660005260116020526020604060002054604051908152f35b608036600319011261035e57600435611633816105b8565b60243590611640826105b8565b604435606435926001600160401b03841161035e573660238501121561035e5761167761077f943690602481600401359101610c21565b9261283a565b9181601f8401121561035e578235916001600160401b03831161035e576020808501948460051b01011161035e57565b604036600319011261035e576004356001600160401b03811161035e576116d890369060040161167d565b6024356116e36124f4565b156117a257600a546001600160a01b0316156112de5761170e8261077f94611709612692565b612bf3565b9061177861172f6117286117218561287d565b6064900490565b9284612d17565b600a54909290611752906001600160a01b031661174c83876128c2565b90612ecb565b7f0000000000000000000000002d28cfb0a0928ca0d29fae64275569f503fc0acc612ecb565b818111611788575b505033612f1e565b61179b91611795916128c2565b33612ecb565b3880611780565b630fe219dd60e21b60005260046000fd5b3461035e57602036600319011261035e576004356117d08161297f565b1561197c57600052601260205260ff604060002054168060009172184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b821015611959575b806d04ee2d6d415b85acef8100000000600a92101561193d575b662386f26fc10000811015611928575b6305f5e100811015611916575b612710811015611906575b60648110156118f7575b10156118ec575b611899602161186d60018501612fe9565b938401015b60001901916f181899199a1a9b1b9c1cb0b131b232b360811b600a82061a8353600a900490565b9081156118a95761189990611872565b6040516103c5906104d6816118de6118cd886118c7602085016128cf565b90612958565b64173539b7b760d91b815260050190565b03601f198101835282610870565b60019091019061185c565b60029060649004930192611855565b600490612710900493019261184b565b6008906305f5e1009004930192611840565b601090662386f26fc100009004930192611833565b6020906d04ee2d6d415b85acef81000000009004930192611823565b506040915072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8104611809565b630a14c4b560e41b60005260046000fd5b602060031982011261035e57600435906001600160401b03821161035e576119b79160040161167d565b9091565b3461035e576119c93661198d565b906119d26124f4565b156117a257600a546001600160a01b0316156112de57816119f591611709612692565b906064611a018361287d565b600a546001600160a01b031693919004808203918211610ee657611a2c611a539261077f9533613011565b7f0000000000000000000000002d28cfb0a0928ca0d29fae64275569f503fc0acc33613011565b33612f1e565b3461035e57600036600319011261035e576020600154604051908152f35b3461035e57604036600319011261035e576004356001600160401b03811161035e57611aa79036906004016108bf565b60243590611ab4826105b8565b611abe81516123ae565b9160005b8251811015611b7857611ad5818461243a565b5190611aeb826000526012602052604060002090565b5491611b05603884901c63ffffffff165b63ffffffff1690565b611b4f5761127a61127a611b1892612a5c565b6001600160a01b03848116911603611b3f576001915b611b38828761243a565b5201611ac2565b6282b42960e81b60005260046000fd5b50605882901c6001600160a01b03166001600160a01b03848116911603611b3f57600191611b2e565b604051806103c58682610def565b3461035e57602036600319011261035e57600435611ba3816106de565b611bab612a33565b63ffffffff8116801561073057612710106112ef5767ffffffff00000000600f549160201b169067ffffffff00000000191617600f55600080f35b3461035e57611bf43661198d565b90811561073057611c0361229f565b611c0b61263e565b91611c1583612374565b9163ffffffff80611c25866125f1565b94169116928184119081611e63575b5080611e53575b15611da25760009460005b818110611cb9575050600b54611c6a935061127a92506001600160a01b0316905081565b91600e5492803b1561035e576040516370677bbb60e01b815263ffffffff93909316600484015260248301939093526044820152906000908290606490829084905af180156112d9576112c457005b611cc481838661296f565b3533611cd861127a61127a61127a85612a5c565b03611b3f5783611d5182611cf36001600160401b0394613534565b60009081526012602052604090208054600160381b600160f81b0319811660388b901b67ffffffffffffffff60381b16173360581b600160581b600160f81b031617909155600881901c61ffff169160189190911c63ffffffff1690565b9092161115611d7c575b90611d76611d7161ffff60019416600e546128c2565b600e55565b01611c46565b9690611d76611d7161ffff611d96600195828d16906125a0565b9a939450505050611d5b565b5091509160005b818110611db257005b611dbd81838561296f565b359033611dd261127a61127a61127a86612a5c565b03611b3f57611e4d611d71611e45611e3e85611def600197613534565b60009081526012602052604090208054600160381b600160f81b0319811660388c901b67ffffffffffffffff60381b16173360581b600160581b600160f81b03161790915560081c61ffff1690565b61ffff1690565b600e546128c2565b01611da9565b50600463ffffffff851610611c3b565b63ffffffff915016831038611c34565b3461035e57600036600319011261035e576040516000600c54611e9581610fc8565b80845290600181169081156105415750600114611ebc576103c5836104d681850382610870565b600c60009081527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7939250905b808210611f01575090915081016020016104d66104c6565b919260018160209254838588010152019101909291611ee9565b3461035e57602060ff611f59611f30366111bf565b6001600160a01b0391821660009081526007865260408082209290931681526020919091522090565b54166040519015158152f35b3461035e57602036600319011261035e5760043560009081526012602090815260409182902054915160589290921c6001600160a01b0316825290f35b3461035e57602036600319011261035e57600435611fbf816105b8565b611fc7612a33565b6001600160a01b0316801561201a57600980546001600160a01b0319811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b631e4fbdf760e01b600052600060045260246000fd5b3461035e57600036600319011261035e57600b546040516001600160a01b039091168152602090f35b3461035e57602036600319011261035e576004356000526012602052602063ffffffff60406000205460181c16604051908152f35b919061209982612a5c565b6001600160a01b0393841693811684900361223557600083815260066020526040902080546120db6001600160a01b03871633908114908314171590565b1590565b6121ee575b6121e4575b506001600160a01b038416600090815260056020526040902080546000190190556001600160a01b0382166000908152600560205260409020805460010190556001600160a01b0382164260a01b17600160e11b1761214e846000526004602052604060002090565b55600160e11b81161561219a575b506001600160a01b03169182907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a41561219557565b612a01565b600183016121b2816000526004602052604060002090565b54156121bf575b5061215c565b60005481146121b9576121dc906000526004602052604060002090565b5538806121b9565b60009055386120e5565b61222b6120d7610eaa336122148a60018060a01b03166000526007602052604060002090565b9060018060a01b0316600052602052604060002090565b156120e0576129f0565b6129e0565b9081602091031261035e5751610489816106de565b6040513d6000823e3d90fd5b634e487b7160e01b600052601160045260246000fd5b63ffffffff60019116019063ffffffff8211610ee657565b634e487b7160e01b600052601260045260246000fd5b60405163175c979560e31b81526366f04d10600482015260208160248173bbf25ca275325ef4682851a12bd8e9aa714da2f45af480156112d9576122f363ffffffff91600b936000916122f8575b50612271565b160490565b61231a915060203d602011612320575b6123128183610870565b81019061223a565b386122ed565b503d612308565b63ffffffff16610309029063ffffffff8216918203610ee657565b63ffffffff16612710039063ffffffff8211610ee657565b9063ffffffff8091169116039063ffffffff8211610ee657565b61237d90612327565b63ffffffff61018491160163ffffffff8111610ee657600b63ffffffff91821604811660001901908111610ee65790565b906123b8826108a8565b6123c56040519182610870565b82815280926123d6601f19916108a8565b0190602036910137565b604051606091906123f18382610870565b6002815291601f1901366020840137565b634e487b7160e01b600052603260045260246000fd5b8051156124255760200190565b612402565b8051600110156124255760400190565b80518210156124255760209160051b010190565b601f811161245a575050565b600d6000526020600020906020601f840160051c83019310612497575b601f0160051c01905b81811061248b575050565b60008155600101612480565b9091508190612477565b601f81116124ad575050565b600c6000526020600020906020601f840160051c830193106124ea575b601f0160051c01905b8181106124de575050565b600081556001016124d3565b90915081906124ca565b63673f671063ffffffff4216908110908115612592575b5061258d5760405163175c979560e31b81526366f04d10600482015260208160248173bbf25ca275325ef4682851a12bd8e9aa714da2f45af480156112d95761255b916000916122f85750612271565b608463ffffffff8216111561258757612581611afc6120d79263ffffffff602c91160490565b60011690565b50600190565b600090565b90506372f16590103861250b565b91908201809211610ee657565b604051608091906125be8382610870565b6003815291601f1901366020840137565b60ff6000199116019060ff8211610ee657565b6000198114610ee65760010190565b63ffffffff6122f3610f1c600b93612271565b6001600160a01b0316801561262d5760005260056020526001600160401b036040600020541690565b6323d3ad8160e21b60005260046000fd5b60405163175c979560e31b81526366f04d10600482015260208160248173bbf25ca275325ef4682851a12bd8e9aa714da2f45af480156112d9576122f363ffffffff91610309936000916122f85750612271565b61269a61229f565b6126a261263e565b90600463ffffffff8316101561279c576126d26120d7610eaa8463ffffffff166000526013602052604060002090565b9081612780575b506126e15750565b600b546126f89061127a906001600160a01b031681565b90600e5491803b1561035e5760405163348b041f60e21b815263ffffffff8316600482015260248101939093526000908390604490829084905af19081156112d9576108a69261275e9261276b575b5063ffffffff166000526013602052604060002090565b805460ff19166001179055565b806112d3600061277a93610870565b38612747565b905063ffffffff612793611afc84612374565b911611386126d9565b5050565b906000546127ad83612604565b6127b6816123ae565b9381156128355760009060015b8481106127d1575050505050565b6127da8161297f565b80612812575b6127ed575b6001016127c3565b9180836127fd612803938a61243a565b526125e2565b918383036127e5575050505050565b506001600160a01b0361282482612a5c565b166001600160a01b038316146127e0565b505050565b92919061284882828661208e565b803b612855575b50505050565b61285e93612b42565b1561286c573880808061284f565b6368d2bf6b60e11b60005260046000fd5b908160031b9180830460081490151715610ee657565b81810292918115918404141715610ee657565b80156128b3576000190490565b612289565b81156128b3570490565b91908203918211610ee657565b600d54600092916128df82610fc8565b916001811690811561294657506001146128f7575050565b600d600090815292935090917fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb55b8382106129325750500190565b600181602092548486015201910190612925565b60ff1916825250811515909102019150565b9061296b60209282815194859201610430565b0190565b91908110156124255760051b0190565b90600091806001111561298f5750565b600054811061299b5750565b9091505b806000526004602052604060002054806129c357508015610ee6576000190161299f565b600160e01b1615919050565b6367d9dca160e11b60005260046000fd5b62a1148160e81b60005260046000fd5b632ce44b5f60e11b60005260046000fd5b633a954ecd60e21b60005260046000fd5b636f96cda160e11b60005260046000fd5b622e076360e81b60005260046000fd5b6009546001600160a01b03163303612a4757565b63118cdaa760e01b6000523360045260246000fd5b80600111612a1257612a78816000526004602052604060002090565b54908115612a8f5750600160e01b8116612a125790565b9050600054811015612a12575b60001901600081815260046020526040902054908115612ac55750600160e01b8116612a125790565b9050612a9c565b9081602091031261035e57516104898161034c565b6001600160a01b03918216815291166020820152604081019190915260806060820181905261048992910190610453565b3d15612b3d573d90612b2382610c06565b91612b316040519384610870565b82523d6000602084013e565b606090565b906020926000612b6b959360405196879586948593630a85bd0160e11b85523360048601612ae1565b03926001600160a01b03165af160009181612bb8575b50612ba257612b8e612b12565b805115612b9d57805190602001fd5b61286c565b6001600160e01b031916630a85bd0160e11b1490565b612bdb91925060203d602011612be2575b612bd38183610870565b810190612acc565b9038612b81565b503d612bc9565b3561048981610bbf565b6000929180156107305760005491612c0961229f565b9263ffffffff60009416925b808510612c23575050505050565b9091929395612c3b612c3688848761296f565b612be9565b9060ff82168015908115612cfd575b50612cec57612cdf82612ccc61ffff8b612cc28b8a86612c8f612c87612c7f60019d60ff166000526010602052604060002090565b5461ffff1690565b9586936125a0565b6affffffffffffffff00000060ff92939462ffff0092600052601260205260181b169360081b1691161717604060002055565b16600e5401600e55565b60ff166000526011602052604060002090565b5401960193929190612c15565b63f8e309e360e01b60005260046000fd5b600391501138612c4a565b9081602091031261035e575190565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23b1561035e57604051630d0e30db60e41b8152916000836004813473c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25af19182156112d957612e6093602093612eb6575b50612d7c8134613053565b612d84610896565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281529173f19308f923582a6f7c465e5ce7a9dc1bec6665b183850152612710604084015230606084015260808301523460a083015260c0820152600060e0820152612de334613314565b6040805163414bf38960e01b815282516001600160a01b0390811660048301526020840151811660248301529183015162ffffff1660448201526060830151821660648201526080830151608482015260a083015160a482015260c083015160c482015260e0909201511660e48201529182908190610104820190565b0381600073e592427a0aece92de3edee1f18e0157c058615645af19081156112d957600091612e8d575090565b610489915060203d602011612eaf575b612ea78183610870565b810190612d08565b503d612e9d565b806112d36000612ec593610870565b38612d71565b60405163a9059cbb60e01b60208201526001600160a01b03909116602482015260448101919091526108a690612f0481606481016118de565b73f19308f923582a6f7c465e5ce7a9dc1bec6665b16134c6565b600054908215612fd8576001600160a01b0381164260a01b6001851460e11b1717612f53836000526004602052604060002090565b556001600160a01b031660008181526005602052604090208054680100000000000000018502019055918215612fd3578101909260015b15612fbe575b60008484827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4612f8a565b9260010192818403612f905792509050600055565b612a23565b63b562e8dd60e01b60005260046000fd5b90612ff382610c06565b6130006040519182610870565b82815280926123d6601f1991610c06565b6040516323b872dd60e01b60208201526001600160a01b039182166024820152911660448201526064808201929092529081526108a690612f04608482610870565b600f54604051633850c7bd60e01b815263ffffffff82169060e08160048173c45a81bc23a64ea556ab4cdf08a86b61cdceea8b5afa80156112d9576130c16080916130e5936000906000926132d8575b506130bc906130b761ffff841615156136bd565b6136ee565b613702565b60405163252c09d760e01b815261ffff909116600482015291829081906024820190565b038173c45a81bc23a64ea556ab4cdf08a86b61cdceea8b5afa9081156112d9576000906000926132b3575b5090156131d7575b611afc6131a461319773f19308f923582a6f7c465e5ce7a9dc1bec6665b173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26131b7986001600160801b0361318f6131896131af9b9a6131756131a99b63ffffffff421661235a565b8163ffffffff8216106131cf575b50613976565b50613b20565b911690613ea3565b9360201c63ffffffff1690565b612342565b90612893565b612710900490565b116131be57565b63431653f160e11b60005260046000fd5b905038613183565b5060405163252c09d760e01b81526000600482015290919060808160248173c45a81bc23a64ea556ab4cdf08a86b61cdceea8b5afa80156112d9576131a461319773f19308f923582a6f7c465e5ce7a9dc1bec6665b173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26131b7986001600160801b0361318f6131896131af9b613175611afc9a6131a99c600091613281575b509b50509a9b5050505098505050505050613118565b6132a3915060803d6080116132ac575b61329b8183610870565b810190613724565b5050503861326b565b503d613291565b90506132ce915060803d6080116132ac5761329b8183610870565b9291505038613110565b6130bc92506132ff915060e03d60e01161330d575b6132f78183610870565b810190613653565b5050509392509050906130a3565b503d6132ed565b604051636eb1769f60e11b815230600482015273e592427a0aece92de3edee1f18e0157c0586156460248201529060208260448173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25afa9182156112d957600092613490575b508101809111610ee65760405163095ea7b360e01b6020820190815273e592427a0aece92de3edee1f18e0157c058615646024830181905260448084019490945292825273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290613407906133d7606485610870565b83516001600160a01b03841691600091829182855af1906133f6612b12565b8261345e575b508161345757501590565b61341057505050565b60405163095ea7b360e01b60208201526001600160a01b039093166024840152600060448401526108a6926134529061344c81606481016118de565b826134c6565b6134c6565b3b15919050565b80519192508115918215613476575b505090386133fc565b61348992506020809183010191016134b1565b388061346d565b6134aa91925060203d602011612eaf57612ea78183610870565b903861336e565b9081602091031261035e5751610489816114c4565b6000806134ef9260018060a01b03169360208151910182865af16134e8612b12565b9083614134565b8051908115159182613519575b50506135055750565b635274afe760e01b60005260045260246000fd5b61352c92506020809183010191016134b1565b1538806134fc565b600061353f82612a5c565b600083815260066020526040902080546001600160a01b03831692919061363b575b506001600160a01b038216600090815260056020526040902080546001600160801b0301905560008481526004602052604090206001600160a01b0383164260a01b17600360e01b179055600160e11b8116156135f2575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a46108a66135ed60015460010190565b600155565b6001840161360a816000526004602052604060002090565b5415613617575b506135b9565b8354811461361157613633906000526004602052604060002090565b553880613611565b83905538613561565b519061ffff8216820361035e57565b908160e091031261035e578051613669816105b8565b9160208201518060020b810361035e579161368660408201613644565b9161369360608301613644565b916136a060808201613644565b9160c060a08301516136b181610bbf565b920151610489816114c4565b156136c457565b60405162461bcd60e51b81526020600482015260026024820152614e4960f01b6044820152606490fd5b61ffff60019116019061ffff8211610ee657565b9061ffff169081156128b35761ffff160690565b51908160060b820361035e57565b919082608091031261035e57815161373b816106de565b9161374860208201613716565b91606060408301516136b1816105b8565b1561376057565b60405162461bcd60e51b8152602060048201526002602482015261042560f41b6044820152606490fd5b9080601f8301121561035e5781516137a1816108a8565b926137af6040519485610870565b81845260208085019260051b82010192831161035e57602001905b8282106137d75750505090565b6020809183516137e6816105b8565b8152019101906137ca565b91909160408184031261035e5780516001600160401b03811161035e57810183601f8201121561035e57805190613827826108a8565b916138356040519384610870565b80835260208084019160051b8301019186831161035e57602001905b828210613879575050509260208201516001600160401b03811161035e57610489920161378a565b6020809161388684613716565b815201910190613851565b906020610489928181520190610954565b600691820b910b0390667fffffffffffff198212667fffffffffffff831317610ee657565b6001600160a01b039182169082160391908211610ee657565b60060b9060060b9081156128b357667fffffffffffff198114600019831416610ee6570590565b9060060b9081156128b35760060b0790565b60020b627fffff198114610ee6576000190190565b6001600160c01b039081166001600160a01b0381810290921692918184041490151715610ee657565b6001600160c01b039091169081156128b3576001600160c01b03160490565b906139ca91600063ffffffff821691613990831515613759565b6139a561399b6123e0565b91610b4983612418565b816139af8261242a565b526040518095819263883bdbfd60e01b835260048301613891565b038173c45a81bc23a64ea556ab4cdf08a86b61cdceea8b5afa9283156112d957600090600094613af1575b50613a2281613a1c613a0f613a16613a0f613a489661242a565b5160060b90565b92612418565b906138a2565b93613a42613a35613a16613a358461242a565b516001600160a01b031690565b906138c7565b908060060b93613a61613a5b86836138e0565b60020b90565b9460008260060b129182613ad3575b5050613ab0575b61048991613a9e613a8a613aa49361392e565b9160201b640100000000600160c01b031690565b90613957565b6001600160801b031690565b9261048991613a9e613a8a613ac7613aa494613919565b96935050509150613a77565b613ae8925090613ae291613907565b60060b90565b15153880613a70565b613a229450613a489150613b17903d806000833e613b0f8183610870565b8101906137f1565b949091506139f5565b60020b6000811215613e9d5780600003905b620d89e88211613e8c576001821615613e7a576001600160881b036ffffcb933bd6fad37aa2d162d1a5940015b169160028116613e5e575b60048116613e42575b60088116613e26575b60108116613e0a575b60208116613dee575b60408116613dd2575b60808116613db6575b6101008116613d9a575b6102008116613d7e575b6104008116613d62575b6108008116613d46575b6110008116613d2a575b6120008116613d0e575b6140008116613cf2575b6180008116613cd6575b620100008116613cba575b620200008116613c9f575b620400008116613c84575b6208000016613c6b575b600012613c5d575b613c3a613c308260201c90565b9163ffffffff1690565b613c55576000905b60ff91909116016001600160a01b031690565b600190613c42565b613c66906128a6565b613c23565b6b048a170391f7dc42444e8fa290910260801c90613c1b565b6d2216e584f5fa1ea926041bedfe9890920260801c91613c11565b916e5d6af8dedb81196699c329225ee6040260801c91613c06565b916f09aa508b5b7a84e1c677de54f3e99bc90260801c91613bfb565b916f31be135f97d08fd981231505542fcfa60260801c91613bf0565b916f70d869a156d2a1b890bb3df62baf32f70260801c91613be6565b916fa9f746462d870fdf8a65dc1f90e061e50260801c91613bdc565b916fd097f3bdfd2022b8845ad8f792aa58250260801c91613bd2565b916fe7159475a2c29b7443b29c7fa6e889d90260801c91613bc8565b916ff3392b0822b70005940c7a398e4b70f30260801c91613bbe565b916ff987a7253ac413176f2b074cf7815e540260801c91613bb4565b916ffcbe86c7900a88aedcffc83b479aa3a40260801c91613baa565b916ffe5dee046a99a2a811c461f1969c30530260801c91613ba0565b916fff2ea16466c96a3843ec78b326b528610260801c91613b97565b916fff973b41fa98c081472e6896dfb254c00260801c91613b8e565b916fffcb9843d60f6159c9db58835c9266440260801c91613b85565b916fffe5caca7e10e4e61c3624eaa0941cd00260801c91613b7c565b916ffff2e50f5f656932ef12357cf3c7fdcc0260801c91613b73565b916ffff97272373d413259a46990580e213a0260801c91613b6a565b6001600160881b03600160801b613b5f565b6315e4079d60e11b60005260046000fd5b80613b32565b909291906001600160a01b03166001600160801b038111613eef5780613ec891612893565b916001600160a01b0390811691161015613ee65790610489916140e5565b61048991614060565b80613ef991613f20565b916001600160a01b0390811691161015613f17579061048991614011565b61048991613f80565b818102919060001982820991838084109303928084039314613f725782600160401b1115613f6157600160401b910990828211900360c01b910360401c1790565b63227bc15360e01b60005260046000fd5b50600160401b929150500490565b90608082901b9060001983600160801b09928280851094039380850394146140055783821115613f61578190600160801b09816000038216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b509061048992506128b8565b81810291906000198282099183808410930392808403931461405257600160801b831015613f6157600160801b910990828211900360801b910360801c1790565b50600160801b929150500490565b9060c082901b9060001983600160c01b09928280851094039380850394146140055783821115613f61578190600160c01b09816000038216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b81810291906000198282099183808410930392808403931461412657600160c01b831015613f6157600160c01b910990828211900360401b910360c01c1790565b50600160c01b929150500490565b9061415a575080511561414957805190602001fd5b630a12f52160e11b60005260046000fd5b8151158061418c575b61416b575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561416356fea2646970667358221220a19c64bc00d68502ab8cea83907d2ab0b44588854b575ea19be1f69bfe754a7f64736f6c634300081a0033

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

0000000000000000000000003408db118057909a62c805c3d38500f9e0ea601a0000000000000000000000002d28cfb0a0928ca0d29fae64275569f503fc0acc000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d556953567148425a4d4d74434b5066466a3876524b69323358746a4575525470485769344479576f6f524e7a00000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d65557248315a4275694e76416d5a71566e59553744354d63316763536a6536696a424a673254476a4c38367a2f00000000000000000000

-----Decoded View---------------
Arg [0] : _owner (address): 0x3408Db118057909a62C805c3d38500f9E0ea601a
Arg [1] : _devWallet (address): 0x2D28cfb0a0928cA0d29FaE64275569f503Fc0Acc
Arg [2] : _contractURI (string): ipfs://QmUiSVqHBZMMtCKPfFj8vRKi23XtjEuRTpHWi4DyWooRNz
Arg [3] : _baseURI (string): ipfs://QmeUrH1ZBuiNvAmZqVnYU7D5Mc1gcSje6ijBJg2TGjL86z/

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000003408db118057909a62c805c3d38500f9e0ea601a
Arg [1] : 0000000000000000000000002d28cfb0a0928ca0d29fae64275569f503fc0acc
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000035
Arg [5] : 697066733a2f2f516d556953567148425a4d4d74434b5066466a3876524b6932
Arg [6] : 3358746a4575525470485769344479576f6f524e7a0000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000036
Arg [8] : 697066733a2f2f516d65557248315a4275694e76416d5a71566e59553744354d
Arg [9] : 63316763536a6536696a424a673254476a4c38367a2f00000000000000000000


Loading...
Loading
Loading...
Loading
[ 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.