APE Price: $1.17 (+5.89%)

Contract

0xbE4148451D38bf96F7141F797De1C3b1f3394D23

Overview

APE Balance

Apechain LogoApechain LogoApechain Logo0 APE

APE Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Approval For...48707882024-11-21 10:47:273 hrs ago1732186047IN
0xbE414845...1f3394D23
0 APE0.000618425.42069
Set Approval For...48696362024-11-21 10:30:413 hrs ago1732185041IN
0xbE414845...1f3394D23
0 APE0.001175425.42069
Set Approval For...48363522024-11-21 1:55:0912 hrs ago1732154109IN
0xbE414845...1f3394D23
0 APE0.001175425.42069
Set Approval For...47529182024-11-20 9:41:1328 hrs ago1732095673IN
0xbE414845...1f3394D23
0 APE0.001175425.42069
Set Approval For...47338122024-11-20 3:47:3034 hrs ago1732074450IN
0xbE414845...1f3394D23
0 APE0.001175425.42069
Set Approval For...44061672024-11-16 11:30:125 days ago1731756612IN
0xbE414845...1f3394D23
0 APE0.0011754225.42069
Set Approval For...43449712024-11-15 19:01:105 days ago1731697270IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43448282024-11-15 18:59:515 days ago1731697191IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43446182024-11-15 18:58:125 days ago1731697092IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Safe Transfer Fr...43444382024-11-15 18:55:345 days ago1731696934IN
0xbE414845...1f3394D23
0 APE0.0012263125.42069
Safe Transfer Fr...43444282024-11-15 18:55:275 days ago1731696927IN
0xbE414845...1f3394D23
0 APE0.0016610125.42069
Set Approval For...43444102024-11-15 18:55:155 days ago1731696915IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43443382024-11-15 18:54:075 days ago1731696847IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43441902024-11-15 18:52:095 days ago1731696729IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43440812024-11-15 18:50:375 days ago1731696637IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43440162024-11-15 18:49:405 days ago1731696580IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43439872024-11-15 18:48:585 days ago1731696538IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43438602024-11-15 18:47:215 days ago1731696441IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43437602024-11-15 18:46:315 days ago1731696391IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43437092024-11-15 18:45:355 days ago1731696335IN
0xbE414845...1f3394D23
0 APE0.0011754225.42069
Set Approval For...43436722024-11-15 18:44:535 days ago1731696293IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43436082024-11-15 18:43:515 days ago1731696231IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43435372024-11-15 18:42:215 days ago1731696141IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43434852024-11-15 18:41:095 days ago1731696069IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
Set Approval For...43433232024-11-15 18:37:305 days ago1731695850IN
0xbE414845...1f3394D23
0 APE0.0006695525.42069
View all transactions

Latest 1 internal transaction

Parent Transaction Hash Block From To
39788862024-11-10 7:33:4611 days ago1731224026
0xbE414845...1f3394D23
6,900 APE

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CryptoPonks

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU LGPLv3 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at apescan.io on 2024-11-09
*/

// File: @openzeppelin/contracts/utils/Context.sol


// 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: @openzeppelin/contracts/access/Ownable.sol


// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;


/**
 * @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: @openzeppelin/contracts/utils/introspection/IERC165.sol


// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * 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[ERC 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: @openzeppelin/contracts/interfaces/IERC2981.sol


// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.20;


/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     *
     * NOTE: ERC-2981 allows setting the royalty to 100% of the price. In that case all the price would be sent to the
     * royalty receiver and 0 tokens to the seller. Contracts dealing with royalty should consider empty transfers.
     */
    function royaltyInfo(
        uint256 tokenId,
        uint256 salePrice
    ) external view returns (address receiver, uint256 royaltyAmount);
}

// File: @openzeppelin/contracts/utils/introspection/ERC165.sol


// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;


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

// File: @openzeppelin/contracts/token/common/ERC2981.sol


// OpenZeppelin Contracts (last updated v5.1.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.20;



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

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

    /**
     * @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1).
     */
    error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator);

    /**
     * @dev The default royalty receiver is invalid.
     */
    error ERC2981InvalidDefaultRoyaltyReceiver(address receiver);

    /**
     * @dev The royalty set for an specific `tokenId` is invalid (eg. (numerator / denominator) >= 1).
     */
    error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator);

    /**
     * @dev The royalty receiver for `tokenId` is invalid.
     */
    error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver);

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

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(
        uint256 tokenId,
        uint256 salePrice
    ) public view virtual returns (address receiver, uint256 amount) {
        RoyaltyInfo storage _royaltyInfo = _tokenRoyaltyInfo[tokenId];
        address royaltyReceiver = _royaltyInfo.receiver;
        uint96 royaltyFraction = _royaltyInfo.royaltyFraction;

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

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

        return (royaltyReceiver, royaltyAmount);
    }

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

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        uint256 denominator = _feeDenominator();
        if (feeNumerator > denominator) {
            // Royalty fee will exceed the sale price
            revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator);
        }
        if (receiver == address(0)) {
            revert ERC2981InvalidDefaultRoyaltyReceiver(address(0));
        }

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

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

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {
        uint256 denominator = _feeDenominator();
        if (feeNumerator > denominator) {
            // Royalty fee will exceed the sale price
            revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator);
        }
        if (receiver == address(0)) {
            revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0));
        }

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

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

// File: @openzeppelin/contracts/utils/Panic.sol


// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)

pragma solidity ^0.8.20;

/**
 * @dev Helper library for emitting standardized panic codes.
 *
 * ```solidity
 * contract Example {
 *      using Panic for uint256;
 *
 *      // Use any of the declared internal constants
 *      function foo() { Panic.GENERIC.panic(); }
 *
 *      // Alternatively
 *      function foo() { Panic.panic(Panic.GENERIC); }
 * }
 * ```
 *
 * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].
 *
 * _Available since v5.1._
 */
// slither-disable-next-line unused-state
library Panic {
    /// @dev generic / unspecified error
    uint256 internal constant GENERIC = 0x00;
    /// @dev used by the assert() builtin
    uint256 internal constant ASSERT = 0x01;
    /// @dev arithmetic underflow or overflow
    uint256 internal constant UNDER_OVERFLOW = 0x11;
    /// @dev division or modulo by zero
    uint256 internal constant DIVISION_BY_ZERO = 0x12;
    /// @dev enum conversion error
    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;
    /// @dev invalid encoding in storage
    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;
    /// @dev empty array pop
    uint256 internal constant EMPTY_ARRAY_POP = 0x31;
    /// @dev array out of bounds access
    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;
    /// @dev resource error (too large allocation or too large array)
    uint256 internal constant RESOURCE_ERROR = 0x41;
    /// @dev calling invalid internal function
    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;

    /// @dev Reverts with a panic code. Recommended to use with
    /// the internal constants with predefined codes.
    function panic(uint256 code) internal pure {
        assembly ("memory-safe") {
            mstore(0x00, 0x4e487b71)
            mstore(0x20, code)
            revert(0x1c, 0x24)
        }
    }
}

// File: @openzeppelin/contracts/utils/math/SafeCast.sol


// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.

pragma solidity ^0.8.20;

/**
 * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeCast {
    /**
     * @dev Value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);

    /**
     * @dev An int value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedIntToUint(int256 value);

    /**
     * @dev Value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);

    /**
     * @dev An uint value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedUintToInt(uint256 value);

    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        if (value > type(uint248).max) {
            revert SafeCastOverflowedUintDowncast(248, value);
        }
        return uint248(value);
    }

    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        if (value > type(uint240).max) {
            revert SafeCastOverflowedUintDowncast(240, value);
        }
        return uint240(value);
    }

    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        if (value > type(uint232).max) {
            revert SafeCastOverflowedUintDowncast(232, value);
        }
        return uint232(value);
    }

    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        if (value > type(uint224).max) {
            revert SafeCastOverflowedUintDowncast(224, value);
        }
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        if (value > type(uint216).max) {
            revert SafeCastOverflowedUintDowncast(216, value);
        }
        return uint216(value);
    }

    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        if (value > type(uint208).max) {
            revert SafeCastOverflowedUintDowncast(208, value);
        }
        return uint208(value);
    }

    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        if (value > type(uint200).max) {
            revert SafeCastOverflowedUintDowncast(200, value);
        }
        return uint200(value);
    }

    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        if (value > type(uint192).max) {
            revert SafeCastOverflowedUintDowncast(192, value);
        }
        return uint192(value);
    }

    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        if (value > type(uint184).max) {
            revert SafeCastOverflowedUintDowncast(184, value);
        }
        return uint184(value);
    }

    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        if (value > type(uint176).max) {
            revert SafeCastOverflowedUintDowncast(176, value);
        }
        return uint176(value);
    }

    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        if (value > type(uint168).max) {
            revert SafeCastOverflowedUintDowncast(168, value);
        }
        return uint168(value);
    }

    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        if (value > type(uint160).max) {
            revert SafeCastOverflowedUintDowncast(160, value);
        }
        return uint160(value);
    }

    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        if (value > type(uint152).max) {
            revert SafeCastOverflowedUintDowncast(152, value);
        }
        return uint152(value);
    }

    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        if (value > type(uint144).max) {
            revert SafeCastOverflowedUintDowncast(144, value);
        }
        return uint144(value);
    }

    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        if (value > type(uint136).max) {
            revert SafeCastOverflowedUintDowncast(136, value);
        }
        return uint136(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        if (value > type(uint128).max) {
            revert SafeCastOverflowedUintDowncast(128, value);
        }
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        if (value > type(uint120).max) {
            revert SafeCastOverflowedUintDowncast(120, value);
        }
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        if (value > type(uint112).max) {
            revert SafeCastOverflowedUintDowncast(112, value);
        }
        return uint112(value);
    }

    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        if (value > type(uint104).max) {
            revert SafeCastOverflowedUintDowncast(104, value);
        }
        return uint104(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        if (value > type(uint96).max) {
            revert SafeCastOverflowedUintDowncast(96, value);
        }
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        if (value > type(uint88).max) {
            revert SafeCastOverflowedUintDowncast(88, value);
        }
        return uint88(value);
    }

    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        if (value > type(uint80).max) {
            revert SafeCastOverflowedUintDowncast(80, value);
        }
        return uint80(value);
    }

    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        if (value > type(uint72).max) {
            revert SafeCastOverflowedUintDowncast(72, value);
        }
        return uint72(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        if (value > type(uint64).max) {
            revert SafeCastOverflowedUintDowncast(64, value);
        }
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint56 from uint256, reverting on
     * overflow (when the input is greater than largest uint56).
     *
     * Counterpart to Solidity's `uint56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     */
    function toUint56(uint256 value) internal pure returns (uint56) {
        if (value > type(uint56).max) {
            revert SafeCastOverflowedUintDowncast(56, value);
        }
        return uint56(value);
    }

    /**
     * @dev Returns the downcasted uint48 from uint256, reverting on
     * overflow (when the input is greater than largest uint48).
     *
     * Counterpart to Solidity's `uint48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     */
    function toUint48(uint256 value) internal pure returns (uint48) {
        if (value > type(uint48).max) {
            revert SafeCastOverflowedUintDowncast(48, value);
        }
        return uint48(value);
    }

    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        if (value > type(uint40).max) {
            revert SafeCastOverflowedUintDowncast(40, value);
        }
        return uint40(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        if (value > type(uint32).max) {
            revert SafeCastOverflowedUintDowncast(32, value);
        }
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint24 from uint256, reverting on
     * overflow (when the input is greater than largest uint24).
     *
     * Counterpart to Solidity's `uint24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     */
    function toUint24(uint256 value) internal pure returns (uint24) {
        if (value > type(uint24).max) {
            revert SafeCastOverflowedUintDowncast(24, value);
        }
        return uint24(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        if (value > type(uint16).max) {
            revert SafeCastOverflowedUintDowncast(16, value);
        }
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        if (value > type(uint8).max) {
            revert SafeCastOverflowedUintDowncast(8, value);
        }
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        if (value < 0) {
            revert SafeCastOverflowedIntToUint(value);
        }
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int248 from int256, reverting on
     * overflow (when the input is less than smallest int248 or
     * greater than largest int248).
     *
     * Counterpart to Solidity's `int248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     */
    function toInt248(int256 value) internal pure returns (int248 downcasted) {
        downcasted = int248(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(248, value);
        }
    }

    /**
     * @dev Returns the downcasted int240 from int256, reverting on
     * overflow (when the input is less than smallest int240 or
     * greater than largest int240).
     *
     * Counterpart to Solidity's `int240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     */
    function toInt240(int256 value) internal pure returns (int240 downcasted) {
        downcasted = int240(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(240, value);
        }
    }

    /**
     * @dev Returns the downcasted int232 from int256, reverting on
     * overflow (when the input is less than smallest int232 or
     * greater than largest int232).
     *
     * Counterpart to Solidity's `int232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     */
    function toInt232(int256 value) internal pure returns (int232 downcasted) {
        downcasted = int232(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(232, value);
        }
    }

    /**
     * @dev Returns the downcasted int224 from int256, reverting on
     * overflow (when the input is less than smallest int224 or
     * greater than largest int224).
     *
     * Counterpart to Solidity's `int224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toInt224(int256 value) internal pure returns (int224 downcasted) {
        downcasted = int224(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(224, value);
        }
    }

    /**
     * @dev Returns the downcasted int216 from int256, reverting on
     * overflow (when the input is less than smallest int216 or
     * greater than largest int216).
     *
     * Counterpart to Solidity's `int216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     */
    function toInt216(int256 value) internal pure returns (int216 downcasted) {
        downcasted = int216(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(216, value);
        }
    }

    /**
     * @dev Returns the downcasted int208 from int256, reverting on
     * overflow (when the input is less than smallest int208 or
     * greater than largest int208).
     *
     * Counterpart to Solidity's `int208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     */
    function toInt208(int256 value) internal pure returns (int208 downcasted) {
        downcasted = int208(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(208, value);
        }
    }

    /**
     * @dev Returns the downcasted int200 from int256, reverting on
     * overflow (when the input is less than smallest int200 or
     * greater than largest int200).
     *
     * Counterpart to Solidity's `int200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     */
    function toInt200(int256 value) internal pure returns (int200 downcasted) {
        downcasted = int200(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(200, value);
        }
    }

    /**
     * @dev Returns the downcasted int192 from int256, reverting on
     * overflow (when the input is less than smallest int192 or
     * greater than largest int192).
     *
     * Counterpart to Solidity's `int192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     */
    function toInt192(int256 value) internal pure returns (int192 downcasted) {
        downcasted = int192(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(192, value);
        }
    }

    /**
     * @dev Returns the downcasted int184 from int256, reverting on
     * overflow (when the input is less than smallest int184 or
     * greater than largest int184).
     *
     * Counterpart to Solidity's `int184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     */
    function toInt184(int256 value) internal pure returns (int184 downcasted) {
        downcasted = int184(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(184, value);
        }
    }

    /**
     * @dev Returns the downcasted int176 from int256, reverting on
     * overflow (when the input is less than smallest int176 or
     * greater than largest int176).
     *
     * Counterpart to Solidity's `int176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     */
    function toInt176(int256 value) internal pure returns (int176 downcasted) {
        downcasted = int176(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(176, value);
        }
    }

    /**
     * @dev Returns the downcasted int168 from int256, reverting on
     * overflow (when the input is less than smallest int168 or
     * greater than largest int168).
     *
     * Counterpart to Solidity's `int168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     */
    function toInt168(int256 value) internal pure returns (int168 downcasted) {
        downcasted = int168(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(168, value);
        }
    }

    /**
     * @dev Returns the downcasted int160 from int256, reverting on
     * overflow (when the input is less than smallest int160 or
     * greater than largest int160).
     *
     * Counterpart to Solidity's `int160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     */
    function toInt160(int256 value) internal pure returns (int160 downcasted) {
        downcasted = int160(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(160, value);
        }
    }

    /**
     * @dev Returns the downcasted int152 from int256, reverting on
     * overflow (when the input is less than smallest int152 or
     * greater than largest int152).
     *
     * Counterpart to Solidity's `int152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     */
    function toInt152(int256 value) internal pure returns (int152 downcasted) {
        downcasted = int152(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(152, value);
        }
    }

    /**
     * @dev Returns the downcasted int144 from int256, reverting on
     * overflow (when the input is less than smallest int144 or
     * greater than largest int144).
     *
     * Counterpart to Solidity's `int144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     */
    function toInt144(int256 value) internal pure returns (int144 downcasted) {
        downcasted = int144(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(144, value);
        }
    }

    /**
     * @dev Returns the downcasted int136 from int256, reverting on
     * overflow (when the input is less than smallest int136 or
     * greater than largest int136).
     *
     * Counterpart to Solidity's `int136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     */
    function toInt136(int256 value) internal pure returns (int136 downcasted) {
        downcasted = int136(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(136, value);
        }
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toInt128(int256 value) internal pure returns (int128 downcasted) {
        downcasted = int128(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(128, value);
        }
    }

    /**
     * @dev Returns the downcasted int120 from int256, reverting on
     * overflow (when the input is less than smallest int120 or
     * greater than largest int120).
     *
     * Counterpart to Solidity's `int120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     */
    function toInt120(int256 value) internal pure returns (int120 downcasted) {
        downcasted = int120(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(120, value);
        }
    }

    /**
     * @dev Returns the downcasted int112 from int256, reverting on
     * overflow (when the input is less than smallest int112 or
     * greater than largest int112).
     *
     * Counterpart to Solidity's `int112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     */
    function toInt112(int256 value) internal pure returns (int112 downcasted) {
        downcasted = int112(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(112, value);
        }
    }

    /**
     * @dev Returns the downcasted int104 from int256, reverting on
     * overflow (when the input is less than smallest int104 or
     * greater than largest int104).
     *
     * Counterpart to Solidity's `int104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     */
    function toInt104(int256 value) internal pure returns (int104 downcasted) {
        downcasted = int104(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(104, value);
        }
    }

    /**
     * @dev Returns the downcasted int96 from int256, reverting on
     * overflow (when the input is less than smallest int96 or
     * greater than largest int96).
     *
     * Counterpart to Solidity's `int96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toInt96(int256 value) internal pure returns (int96 downcasted) {
        downcasted = int96(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(96, value);
        }
    }

    /**
     * @dev Returns the downcasted int88 from int256, reverting on
     * overflow (when the input is less than smallest int88 or
     * greater than largest int88).
     *
     * Counterpart to Solidity's `int88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     */
    function toInt88(int256 value) internal pure returns (int88 downcasted) {
        downcasted = int88(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(88, value);
        }
    }

    /**
     * @dev Returns the downcasted int80 from int256, reverting on
     * overflow (when the input is less than smallest int80 or
     * greater than largest int80).
     *
     * Counterpart to Solidity's `int80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     */
    function toInt80(int256 value) internal pure returns (int80 downcasted) {
        downcasted = int80(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(80, value);
        }
    }

    /**
     * @dev Returns the downcasted int72 from int256, reverting on
     * overflow (when the input is less than smallest int72 or
     * greater than largest int72).
     *
     * Counterpart to Solidity's `int72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     */
    function toInt72(int256 value) internal pure returns (int72 downcasted) {
        downcasted = int72(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(72, value);
        }
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toInt64(int256 value) internal pure returns (int64 downcasted) {
        downcasted = int64(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(64, value);
        }
    }

    /**
     * @dev Returns the downcasted int56 from int256, reverting on
     * overflow (when the input is less than smallest int56 or
     * greater than largest int56).
     *
     * Counterpart to Solidity's `int56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     */
    function toInt56(int256 value) internal pure returns (int56 downcasted) {
        downcasted = int56(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(56, value);
        }
    }

    /**
     * @dev Returns the downcasted int48 from int256, reverting on
     * overflow (when the input is less than smallest int48 or
     * greater than largest int48).
     *
     * Counterpart to Solidity's `int48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     */
    function toInt48(int256 value) internal pure returns (int48 downcasted) {
        downcasted = int48(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(48, value);
        }
    }

    /**
     * @dev Returns the downcasted int40 from int256, reverting on
     * overflow (when the input is less than smallest int40 or
     * greater than largest int40).
     *
     * Counterpart to Solidity's `int40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     */
    function toInt40(int256 value) internal pure returns (int40 downcasted) {
        downcasted = int40(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(40, value);
        }
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toInt32(int256 value) internal pure returns (int32 downcasted) {
        downcasted = int32(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(32, value);
        }
    }

    /**
     * @dev Returns the downcasted int24 from int256, reverting on
     * overflow (when the input is less than smallest int24 or
     * greater than largest int24).
     *
     * Counterpart to Solidity's `int24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     */
    function toInt24(int256 value) internal pure returns (int24 downcasted) {
        downcasted = int24(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(24, value);
        }
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toInt16(int256 value) internal pure returns (int16 downcasted) {
        downcasted = int16(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(16, value);
        }
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     */
    function toInt8(int256 value) internal pure returns (int8 downcasted) {
        downcasted = int8(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(8, value);
        }
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        if (value > uint256(type(int256).max)) {
            revert SafeCastOverflowedUintToInt(value);
        }
        return int256(value);
    }

    /**
     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.
     */
    function toUint(bool b) internal pure returns (uint256 u) {
        assembly ("memory-safe") {
            u := iszero(iszero(b))
        }
    }
}

// File: @openzeppelin/contracts/utils/math/Math.sol


// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;



/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

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

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

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

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

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

    /**
     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
     *
     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
     * one branch when needed, making this function more expensive.
     */
    function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {
        unchecked {
            // branchless ternary works because:
            // b ^ (a ^ b) == a
            // b ^ 0 == b
            return b ^ ((a ^ b) * SafeCast.toUint(condition));
        }
    }

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

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

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

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

        // The following calculation ensures accurate ceiling division without overflow.
        // Since a is non-zero, (a - 1) / b will not overflow.
        // The largest possible result occurs when (a - 1) / b is type(uint256).max,
        // but the largest value we can obtain is type(uint256).max - 1, which happens
        // when a = type(uint256).max and b = 1.
        unchecked {
            return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);
        }
    }

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

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

            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.
            if (denominator <= prod1) {
                Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));
            }

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

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

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

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

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

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

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

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

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

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2⁸
            inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶
            inverse *= 2 - denominator * inverse; // inverse mod 2³²
            inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴
            inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸
            inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶

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

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

    /**
     * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.
     *
     * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.
     * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.
     *
     * If the input value is not inversible, 0 is returned.
     *
     * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the
     * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.
     */
    function invMod(uint256 a, uint256 n) internal pure returns (uint256) {
        unchecked {
            if (n == 0) return 0;

            // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)
            // Used to compute integers x and y such that: ax + ny = gcd(a, n).
            // When the gcd is 1, then the inverse of a modulo n exists and it's x.
            // ax + ny = 1
            // ax = 1 + (-y)n
            // ax ≡ 1 (mod n) # x is the inverse of a modulo n

            // If the remainder is 0 the gcd is n right away.
            uint256 remainder = a % n;
            uint256 gcd = n;

            // Therefore the initial coefficients are:
            // ax + ny = gcd(a, n) = n
            // 0a + 1n = n
            int256 x = 0;
            int256 y = 1;

            while (remainder != 0) {
                uint256 quotient = gcd / remainder;

                (gcd, remainder) = (
                    // The old remainder is the next gcd to try.
                    remainder,
                    // Compute the next remainder.
                    // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd
                    // where gcd is at most n (capped to type(uint256).max)
                    gcd - remainder * quotient
                );

                (x, y) = (
                    // Increment the coefficient of a.
                    y,
                    // Decrement the coefficient of n.
                    // Can overflow, but the result is casted to uint256 so that the
                    // next value of y is "wrapped around" to a value between 0 and n - 1.
                    x - y * int256(quotient)
                );
            }

            if (gcd != 1) return 0; // No inverse exists.
            return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.
        }
    }

    /**
     * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.
     *
     * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is
     * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that
     * `a**(p-2)` is the modular multiplicative inverse of a in Fp.
     *
     * NOTE: this function does NOT check that `p` is a prime greater than `2`.
     */
    function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {
        unchecked {
            return Math.modExp(a, p - 2, p);
        }
    }

    /**
     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)
     *
     * Requirements:
     * - modulus can't be zero
     * - underlying staticcall to precompile must succeed
     *
     * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make
     * sure the chain you're using it on supports the precompiled contract for modular exponentiation
     * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,
     * the underlying function will succeed given the lack of a revert, but the result may be incorrectly
     * interpreted as 0.
     */
    function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {
        (bool success, uint256 result) = tryModExp(b, e, m);
        if (!success) {
            Panic.panic(Panic.DIVISION_BY_ZERO);
        }
        return result;
    }

    /**
     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).
     * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying
     * to operate modulo 0 or if the underlying precompile reverted.
     *
     * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain
     * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in
     * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack
     * of a revert, but the result may be incorrectly interpreted as 0.
     */
    function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {
        if (m == 0) return (false, 0);
        assembly ("memory-safe") {
            let ptr := mload(0x40)
            // | Offset    | Content    | Content (Hex)                                                      |
            // |-----------|------------|--------------------------------------------------------------------|
            // | 0x00:0x1f | size of b  | 0x0000000000000000000000000000000000000000000000000000000000000020 |
            // | 0x20:0x3f | size of e  | 0x0000000000000000000000000000000000000000000000000000000000000020 |
            // | 0x40:0x5f | size of m  | 0x0000000000000000000000000000000000000000000000000000000000000020 |
            // | 0x60:0x7f | value of b | 0x<.............................................................b> |
            // | 0x80:0x9f | value of e | 0x<.............................................................e> |
            // | 0xa0:0xbf | value of m | 0x<.............................................................m> |
            mstore(ptr, 0x20)
            mstore(add(ptr, 0x20), 0x20)
            mstore(add(ptr, 0x40), 0x20)
            mstore(add(ptr, 0x60), b)
            mstore(add(ptr, 0x80), e)
            mstore(add(ptr, 0xa0), m)

            // Given the result < m, it's guaranteed to fit in 32 bytes,
            // so we can use the memory scratch space located at offset 0.
            success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)
            result := mload(0x00)
        }
    }

    /**
     * @dev Variant of {modExp} that supports inputs of arbitrary length.
     */
    function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {
        (bool success, bytes memory result) = tryModExp(b, e, m);
        if (!success) {
            Panic.panic(Panic.DIVISION_BY_ZERO);
        }
        return result;
    }

    /**
     * @dev Variant of {tryModExp} that supports inputs of arbitrary length.
     */
    function tryModExp(
        bytes memory b,
        bytes memory e,
        bytes memory m
    ) internal view returns (bool success, bytes memory result) {
        if (_zeroBytes(m)) return (false, new bytes(0));

        uint256 mLen = m.length;

        // Encode call args in result and move the free memory pointer
        result = abi.encodePacked(b.length, e.length, mLen, b, e, m);

        assembly ("memory-safe") {
            let dataPtr := add(result, 0x20)
            // Write result on top of args to avoid allocating extra memory.
            success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)
            // Overwrite the length.
            // result.length > returndatasize() is guaranteed because returndatasize() == m.length
            mstore(result, mLen)
            // Set the memory pointer after the returned data.
            mstore(0x40, add(dataPtr, mLen))
        }
    }

    /**
     * @dev Returns whether the provided byte array is zero.
     */
    function _zeroBytes(bytes memory byteArray) private pure returns (bool) {
        for (uint256 i = 0; i < byteArray.length; ++i) {
            if (byteArray[i] != 0) {
                return false;
            }
        }
        return true;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * This method is based on Newton's method for computing square roots; the algorithm is restricted to only
     * using integer operations.
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        unchecked {
            // Take care of easy edge cases when a == 0 or a == 1
            if (a <= 1) {
                return a;
            }

            // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a
            // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between
            // the current value as `ε_n = | x_n - sqrt(a) |`.
            //
            // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root
            // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is
            // bigger than any uint256.
            //
            // By noticing that
            // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`
            // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar
            // to the msb function.
            uint256 aa = a;
            uint256 xn = 1;

            if (aa >= (1 << 128)) {
                aa >>= 128;
                xn <<= 64;
            }
            if (aa >= (1 << 64)) {
                aa >>= 64;
                xn <<= 32;
            }
            if (aa >= (1 << 32)) {
                aa >>= 32;
                xn <<= 16;
            }
            if (aa >= (1 << 16)) {
                aa >>= 16;
                xn <<= 8;
            }
            if (aa >= (1 << 8)) {
                aa >>= 8;
                xn <<= 4;
            }
            if (aa >= (1 << 4)) {
                aa >>= 4;
                xn <<= 2;
            }
            if (aa >= (1 << 2)) {
                xn <<= 1;
            }

            // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).
            //
            // We can refine our estimation by noticing that the middle of that interval minimizes the error.
            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).
            // This is going to be our x_0 (and ε_0)
            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)

            // From here, Newton's method give us:
            // x_{n+1} = (x_n + a / x_n) / 2
            //
            // One should note that:
            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a
            //              = ((x_n² + a) / (2 * x_n))² - a
            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a
            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)
            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)
            //              = (x_n² - a)² / (2 * x_n)²
            //              = ((x_n² - a) / (2 * x_n))²
            //              ≥ 0
            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n
            //
            // This gives us the proof of quadratic convergence of the sequence:
            // ε_{n+1} = | x_{n+1} - sqrt(a) |
            //         = | (x_n + a / x_n) / 2 - sqrt(a) |
            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |
            //         = | (x_n - sqrt(a))² / (2 * x_n) |
            //         = | ε_n² / (2 * x_n) |
            //         = ε_n² / | (2 * x_n) |
            //
            // For the first iteration, we have a special case where x_0 is known:
            // ε_1 = ε_0² / | (2 * x_0) |
            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))
            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))
            //     ≤ 2**(e-3) / 3
            //     ≤ 2**(e-3-log2(3))
            //     ≤ 2**(e-4.5)
            //
            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:
            // ε_{n+1} = ε_n² / | (2 * x_n) |
            //         ≤ (2**(e-k))² / (2 * 2**(e-1))
            //         ≤ 2**(2*e-2*k) / 2**e
            //         ≤ 2**(e-2*k)
            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above
            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5
            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9
            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18
            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36
            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72

            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision
            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either
            // sqrt(a) or sqrt(a) + 1.
            return xn - SafeCast.toUint(xn > a / xn);
        }
    }

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

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        uint256 exp;
        unchecked {
            exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);
            value >>= exp;
            result += exp;

            exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);
            value >>= exp;
            result += exp;

            exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);
            value >>= exp;
            result += exp;

            exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);
            value >>= exp;
            result += exp;

            exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);
            value >>= exp;
            result += exp;

            exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);
            value >>= exp;
            result += exp;

            exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);
            value >>= exp;
            result += exp;

            result += SafeCast.toUint(value > 1);
        }
        return result;
    }

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

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

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

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

            isGt = SafeCast.toUint(value > (1 << 64) - 1);
            value >>= isGt * 64;
            result += isGt * 8;

            isGt = SafeCast.toUint(value > (1 << 32) - 1);
            value >>= isGt * 32;
            result += isGt * 4;

            isGt = SafeCast.toUint(value > (1 << 16) - 1);
            value >>= isGt * 16;
            result += isGt * 2;

            result += SafeCast.toUint(value > (1 << 8) - 1);
        }
        return result;
    }

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

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

// File: @openzeppelin/contracts/utils/math/SignedMath.sol


// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;


/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
     *
     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
     * one branch when needed, making this function more expensive.
     */
    function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {
        unchecked {
            // branchless ternary works because:
            // b ^ (a ^ b) == a
            // b ^ 0 == b
            return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));
        }
    }

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

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

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

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson.
            // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,
            // taking advantage of the most significant (or "sign" bit) in two's complement representation.
            // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,
            // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).
            int256 mask = n >> 255;

            // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.
            return uint256((n + mask) ^ mask);
        }
    }
}

// File: @openzeppelin/contracts/utils/Strings.sol


// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)

pragma solidity ^0.8.20;



/**
 * @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;
            assembly ("memory-safe") {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                assembly ("memory-safe") {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

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

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

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

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

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal
     * representation, according to EIP-55.
     */
    function toChecksumHexString(address addr) internal pure returns (string memory) {
        bytes memory buffer = bytes(toHexString(addr));

        // hash the hex part of buffer (skip length + 2 bytes, length 40)
        uint256 hashValue;
        assembly ("memory-safe") {
            hashValue := shr(96, keccak256(add(buffer, 0x22), 40))
        }

        for (uint256 i = 41; i > 1; --i) {
            // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)
            if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {
                // case shift by xoring with 0x20
                buffer[i] ^= 0x20;
            }
            hashValue >>= 4;
        }
        return string(buffer);
    }

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

// File: @openzeppelin/contracts/token/ERC721/IERC721.sol


// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;


/**
 * @dev Required interface of an ERC-721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @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`.
     *
     * 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 calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC-721 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 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) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * 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;

    /**
     * @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;

    /**
     * @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 address zero.
     *
     * 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);
}

// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol


// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.20;

/**
 * @title ERC-721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC-721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be
     * reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol


// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.20;


/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @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);
}

// File: @openzeppelin/contracts/utils/Errors.sol


// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of common custom errors used in multiple contracts
 *
 * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
 * It is recommended to avoid relying on the error API for critical functionality.
 *
 * _Available since v5.1._
 */
library Errors {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error InsufficientBalance(uint256 balance, uint256 needed);

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

    /**
     * @dev The deployment failed.
     */
    error FailedDeployment();

    /**
     * @dev A necessary precompile is missing.
     */
    error MissingPrecompile(address);
}

// File: @openzeppelin/contracts/utils/Address.sol


// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)

pragma solidity ^0.8.20;


/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @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 Errors.InsufficientBalance(address(this).balance, amount);
        }

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

    /**
     * @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
     * {Errors.FailedCall} 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 Errors.InsufficientBalance(address(this).balance, value);
        }
        (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 {Errors.FailedCall}) 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 {Errors.FailedCall} 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 {Errors.FailedCall}.
     */
    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
            assembly ("memory-safe") {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert Errors.FailedCall();
        }
    }
}

// File: contracts/ERC721R.sol



pragma solidity ^0.8.28;








/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension. This does random batch minting.
 */
abstract contract ERC721R is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    mapping(uint => uint) private _availableTokens;
    uint256 private _numAvailableTokens;
    uint256 immutable _maxSupply;
    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

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

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

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_, uint maxSupply_) {
        _name = name_;
        _symbol = symbol_;
        _maxSupply = maxSupply_;
        _numAvailableTokens = maxSupply_;
    }

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

    function totalSupply() public view virtual returns (uint256) {
        return _maxSupply - _numAvailableTokens;
    }

    function maxSupply() public view virtual returns (uint256) {
        return _maxSupply;
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

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

    /**
     * @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, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721R.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @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 (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721R.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    function _mintIdWithoutBalanceUpdate(address to, uint256 tokenId) private {
        _beforeTokenTransfer(address(0), to, tokenId);

        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId);
    }

    function _mintRandom(address to, uint _numToMint) internal virtual {
        require(_msgSender() == tx.origin, "Contracts cannot mint");
        require(to != address(0), "ERC721: mint to the zero address");
        require(_numToMint > 0, "ERC721R: need to mint at least one token");

        // TODO: Probably don't need this as it will underflow and revert automatically in this case
        require(_numAvailableTokens >= _numToMint, "ERC721R: minting more tokens than available");

        uint updatedNumAvailableTokens = _numAvailableTokens;
        for (uint256 i; i < _numToMint; ++i) {// Do this ++ unchecked?
            uint256 tokenId = getRandomAvailableTokenId(to, updatedNumAvailableTokens);

            _mintIdWithoutBalanceUpdate(to, tokenId);

            --updatedNumAvailableTokens;
        }

        _numAvailableTokens = updatedNumAvailableTokens;
        _balances[to] += _numToMint;
    }

    function getRandomAvailableTokenId(address to, uint updatedNumAvailableTokens)
    internal
    returns (uint256)
    {
        uint256 randomNum = uint256(
            keccak256(
                abi.encode(
                    to,
                    tx.gasprice,
                    block.number,
                    block.timestamp,
                    blockhash(block.number - 1),
                    address(this),
                    updatedNumAvailableTokens
                )
            )
        );
        uint256 randomIndex = randomNum % updatedNumAvailableTokens;
        return getAvailableTokenAtIndex(randomIndex, updatedNumAvailableTokens);
    }

    // Implements https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle. Code taken from CryptoPhunksV2
    function getAvailableTokenAtIndex(uint256 indexToUse, uint updatedNumAvailableTokens)
    internal
    returns (uint256)
    {
        uint256 valAtIndex = _availableTokens[indexToUse];
        uint256 result;
        if (valAtIndex == 0) {
            // This means the index itself is still an available token
            result = indexToUse;
        } else {
            // This means the index itself is not an available token, but the val at that index is.
            result = valAtIndex;
        }

        uint256 lastIndex = updatedNumAvailableTokens - 1;
        uint256 lastValInArray = _availableTokens[lastIndex];
        if (indexToUse != lastIndex) {
            // Replace the value at indexToUse, now that it's been used.
            // Replace it with the data from the last index in the array, since we are going to decrease the array size afterwards.
            if (lastValInArray == 0) {
                // This means the index itself is still an available token
                _availableTokens[indexToUse] = lastIndex;
            } else {
                // This means the index itself is not an available token, but the val at that index is.
                _availableTokens[indexToUse] = lastValInArray;
            }
        }
        if (lastValInArray != 0) {
            // Gas refund courtsey of @dievardump
            delete _availableTokens[lastIndex];
        }

        return result;
    }

    // Not as good as minting a specific tokenId, but will behave the same at the start
    // allowing you to explicitly mint some tokens at launch.
    function _mintAtIndex(address to, uint index) internal virtual {
        require(_msgSender() == tx.origin, "Contracts cannot mint");
        require(to != address(0), "ERC721: mint to the zero address");
        require(_numAvailableTokens >= 1, "ERC721R: minting more tokens than available");

        uint tokenId = getAvailableTokenAtIndex(index, _numAvailableTokens);
        --_numAvailableTokens;

        _mintIdWithoutBalanceUpdate(to, tokenId);

        _balances[to] += 1;
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721R.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721R.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
    * Check if the address is contract
    */
    function isContract(
        address addr
    ) public view returns (bool){
        if(addr.code.length==0) {
            return false;
        }
        return true;
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (isContract(to)) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * 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, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    function _burn(uint256 tokenId) internal virtual {
        address owner = _ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        _balances[owner] -= 1;

        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId);
    }
}
// File: contracts/CryptoPonks.sol

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.28;






contract CryptoPonks is ERC721R, ERC2981, Ownable {
    using Strings for uint256;

    uint256 public price = 0.69 ether;

    string private baseURI;
    bool public mintEnabled = false;

    constructor() ERC721R("CryptoPonks", "PONKS", 10_000) Ownable(msg.sender) {
        _setDefaultRoyalty(0x77EAAfc2a99D643dBcf6F7654FbBfEa5B1ecC0b9, 690);
    }

    function mint(uint256 _amount) public payable {
        require(mintEnabled, "Sale is not enabled");
        require(price * _amount <= msg.value, "Not enough APE");
        _mintRandomly(msg.sender, _amount);
    }

    /// ============ INTERNAL ============
    function _mintRandomly(address to, uint256 amount) internal {
        _mintRandom(to, amount);
    }

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

    /// ============ ONLY OWNER ============
    function setBaseURI(string calldata _newBaseURI) external onlyOwner {
        baseURI = _newBaseURI;
    }

    function toggleSale() external onlyOwner {
        mintEnabled = !mintEnabled;
    }

    function setPrice(uint256 price_) external onlyOwner {
        price = price_;
    }

    function setRoyalty(address wallet, uint96 perc) external onlyOwner {
        _setDefaultRoyalty(wallet, perc);
    }

    function devMint(uint256 _amount) external onlyOwner {
        _mintRandomly(msg.sender, _amount);
    }

    function withdraw() external onlyOwner {
        (bool success, ) = msg.sender.call{value: address(this).balance}("");
        require(success, "Transfer failed.");
    }

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

    /**
     * @dev See {ERC721-_burn}. This override additionally clears the royalty information for the token.
     */
    function _burn(uint256 tokenId) internal virtual override {
        ERC721R._burn(tokenId);
        _resetTokenRoyalty(tokenId);
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidDefaultRoyalty","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidDefaultRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidTokenRoyalty","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidTokenRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"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":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"devMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","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":"nonpayable","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":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price_","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint96","name":"perc","type":"uint96"}],"name":"setRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040526709935f581f050000600b55600d805460ff19169055348015610025575f5ffd5b50336040518060400160405280600b81526020016a43727970746f506f6e6b7360a81b81525060405180604001604052806005815260200164504f4e4b5360d81b815250612710825f908161007a919061027a565b506001610087838261027a565b50608081905260035550506001600160a01b0381166100c057604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6100c9816100ef565b506100ea7377eaafc2a99d643dbcf6f7654fbbfea5b1ecc0b96102b2610140565b610334565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6127106001600160601b03821681101561017f57604051636f483d0960e01b81526001600160601b0383166004820152602481018290526044016100b7565b6001600160a01b0383166101a857604051635b6cc80560e11b81525f60048201526024016100b7565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600855565b634e487b7160e01b5f52604160045260245ffd5b600181811c9082168061020a57607f821691505b60208210810361022857634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561027557805f5260205f20601f840160051c810160208510156102535750805b601f840160051c820191505b81811015610272575f815560010161025f565b50505b505050565b81516001600160401b03811115610293576102936101e2565b6102a7816102a184546101f6565b8461022e565b6020601f8211600181146102d9575f83156102c25750848201515b5f19600385901b1c1916600184901b178455610272565b5f84815260208120601f198516915b8281101561030857878501518255602094850194600190920191016102e8565b508482101561032557868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b608051611ead6103535f395f81816104fb01526107cf0152611ead5ff3fe6080604052600436106101ba575f3560e01c8063715018a6116100f2578063a0712d6811610092578063d123973011610062578063d1239730146104d4578063d5abeb01146104ed578063e985e9c51461051f578063f2fde38b1461053e575f5ffd5b8063a0712d6814610464578063a22cb46514610477578063b88d4fde14610496578063c87b56dd146104b5575f5ffd5b80638f2fc60b116100cd5780638f2fc60b146103fd57806391b7f5ed1461041c57806395d89b411461043b578063a035b1fe1461044f575f5ffd5b8063715018a6146103b85780637d8966e4146103cc5780638da5cb5b146103e0575f5ffd5b80632a55205a1161015d57806342842e0e1161013857806342842e0e1461033c57806355f804b31461035b5780636352211e1461037a57806370a0823114610399575f5ffd5b80632a55205a146102cb578063375a069a146103095780633ccfd60b14610328575f5ffd5b8063095ea7b311610198578063095ea7b31461024a578063162790551461026b57806318160ddd1461028a57806323b872dd146102ac575f5ffd5b806301ffc9a7146101be57806306fdde03146101f2578063081812fc14610213575b5f5ffd5b3480156101c9575f5ffd5b506101dd6101d8366004611839565b61055d565b60405190151581526020015b60405180910390f35b3480156101fd575f5ffd5b5061020661056d565b6040516101e99190611882565b34801561021e575f5ffd5b5061023261022d366004611894565b6105fc565b6040516001600160a01b0390911681526020016101e9565b348015610255575f5ffd5b506102696102643660046118c6565b610694565b005b348015610276575f5ffd5b506101dd6102853660046118ee565b6107a8565b348015610295575f5ffd5b5061029e6107c9565b6040519081526020016101e9565b3480156102b7575f5ffd5b506102696102c6366004611907565b6107fd565b3480156102d6575f5ffd5b506102ea6102e5366004611941565b61082e565b604080516001600160a01b0390931683526020830191909152016101e9565b348015610314575f5ffd5b50610269610323366004611894565b6108b1565b348015610333575f5ffd5b506102696108c6565b348015610347575f5ffd5b50610269610356366004611907565b610956565b348015610366575f5ffd5b50610269610375366004611961565b610970565b348015610385575f5ffd5b50610232610394366004611894565b610985565b3480156103a4575f5ffd5b5061029e6103b33660046118ee565b6109fb565b3480156103c3575f5ffd5b50610269610a80565b3480156103d7575f5ffd5b50610269610a93565b3480156103eb575f5ffd5b50600a546001600160a01b0316610232565b348015610408575f5ffd5b506102696104173660046119cf565b610aaf565b348015610427575f5ffd5b50610269610436366004611894565b610ac5565b348015610446575f5ffd5b50610206610ad2565b34801561045a575f5ffd5b5061029e600b5481565b610269610472366004611894565b610ae1565b348015610482575f5ffd5b50610269610491366004611a0f565b610b77565b3480156104a1575f5ffd5b506102696104b0366004611a51565b610b82565b3480156104c0575f5ffd5b506102066104cf366004611894565b610bba565b3480156104df575f5ffd5b50600d546101dd9060ff1681565b3480156104f8575f5ffd5b507f000000000000000000000000000000000000000000000000000000000000000061029e565b34801561052a575f5ffd5b506101dd610539366004611b2e565b610c91565b348015610549575f5ffd5b506102696105583660046118ee565b610cbe565b5f61056782610cf8565b92915050565b60605f805461057b90611b5f565b80601f01602080910402602001604051908101604052809291908181526020018280546105a790611b5f565b80156105f25780601f106105c9576101008083540402835291602001916105f2565b820191905f5260205f20905b8154815290600101906020018083116105d557829003601f168201915b5050505050905090565b5f818152600460205260408120546001600160a01b03166106795760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b505f908152600660205260409020546001600160a01b031690565b5f61069e82610985565b9050806001600160a01b0316836001600160a01b03160361070b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610670565b336001600160a01b038216148061072757506107278133610c91565b6107995760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610670565b6107a38383610d1c565b505050565b5f816001600160a01b03163b5f036107c157505f919050565b506001919050565b5f6003547f00000000000000000000000000000000000000000000000000000000000000006107f89190611bab565b905090565b6108073382610d89565b6108235760405162461bcd60e51b815260040161067090611bbe565b6107a3838383610e5e565b5f82815260096020526040812080548291906001600160a01b03811690600160a01b90046001600160601b0316816108815750506008546001600160a01b03811690600160a01b90046001600160601b03165b5f6127106108986001600160601b03841689611c0f565b6108a29190611c3a565b92989297509195505050505050565b6108b9610ff6565b6108c33382611023565b50565b6108ce610ff6565b6040515f90339047908381818185875af1925050503d805f811461090d576040519150601f19603f3d011682016040523d82523d5f602084013e610912565b606091505b50509050806108c35760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606401610670565b6107a383838360405180602001604052805f815250610b82565b610978610ff6565b600c6107a3828483611c98565b5f818152600460205260408120546001600160a01b0316806105675760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610670565b5f6001600160a01b038216610a655760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610670565b506001600160a01b03165f9081526005602052604090205490565b610a88610ff6565b610a915f61102d565b565b610a9b610ff6565b600d805460ff19811660ff90911615179055565b610ab7610ff6565b610ac1828261107e565b5050565b610acd610ff6565b600b55565b60606001805461057b90611b5f565b600d5460ff16610b295760405162461bcd60e51b815260206004820152601360248201527214d85b19481a5cc81b9bdd08195b98589b1959606a1b6044820152606401610670565b3481600b54610b389190611c0f565b11156108b95760405162461bcd60e51b815260206004820152600e60248201526d4e6f7420656e6f7567682041504560901b6044820152606401610670565b610ac1338383611120565b610b8c3383610d89565b610ba85760405162461bcd60e51b815260040161067090611bbe565b610bb4848484846111ed565b50505050565b5f818152600460205260409020546060906001600160a01b0316610c385760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610670565b5f610c41611220565b90505f815111610c5f5760405180602001604052805f815250610c8a565b80610c698461122f565b604051602001610c7a929190611d69565b6040516020818303038152906040525b9392505050565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b610cc6610ff6565b6001600160a01b038116610cef57604051631e4fbdf760e01b81525f6004820152602401610670565b6108c38161102d565b5f6001600160e01b0319821663152a902d60e11b14806105675750610567826112bf565b5f81815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610d5082610985565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b5f818152600460205260408120546001600160a01b0316610e015760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610670565b5f610e0b83610985565b9050806001600160a01b0316846001600160a01b03161480610e465750836001600160a01b0316610e3b846105fc565b6001600160a01b0316145b80610e565750610e568185610c91565b949350505050565b826001600160a01b0316610e7182610985565b6001600160a01b031614610ed55760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610670565b6001600160a01b038216610f375760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610670565b610f415f82610d1c565b6001600160a01b0383165f908152600560205260408120805460019290610f69908490611bab565b90915550506001600160a01b0382165f908152600560205260408120805460019290610f96908490611d93565b90915550505f8181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a546001600160a01b03163314610a915760405163118cdaa760e01b8152336004820152602401610670565b610ac1828261130e565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6127106001600160601b0382168110156110bd57604051636f483d0960e01b81526001600160601b038316600482015260248101829052604401610670565b6001600160a01b0383166110e657604051635b6cc80560e11b81525f6004820152602401610670565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600855565b816001600160a01b0316836001600160a01b0316036111815760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610670565b6001600160a01b038381165f81815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6111f8848484610e5e565b611204848484846114e0565b610bb45760405162461bcd60e51b815260040161067090611da6565b6060600c805461057b90611b5f565b60605f61123b836115db565b60010190505f8167ffffffffffffffff81111561125a5761125a611a3d565b6040519080825280601f01601f191660200182016040528015611284576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461128e57509392505050565b5f6001600160e01b031982166380ac58cd60e01b14806112ef57506001600160e01b03198216635b5e139f60e01b145b8061056757506301ffc9a760e01b6001600160e01b0319831614610567565b3332146113555760405162461bcd60e51b815260206004820152601560248201527410dbdb9d1c9858dd1cc818d85b9b9bdd081b5a5b9d605a1b6044820152606401610670565b6001600160a01b0382166113ab5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610670565b5f811161140b5760405162461bcd60e51b815260206004820152602860248201527f455243373231523a206e65656420746f206d696e74206174206c65617374206f6044820152673732903a37b5b2b760c11b6064820152608401610670565b8060035410156114715760405162461bcd60e51b815260206004820152602b60248201527f455243373231523a206d696e74696e67206d6f726520746f6b656e732074686160448201526a6e20617661696c61626c6560a81b6064820152608401610670565b6003545f5b828110156114a9575f61148985846116b2565b9050611495858261173b565b61149e83611df8565b925050600101611476565b5060038190556001600160a01b0383165f90815260056020526040812080548492906114d6908490611d93565b9091555050505050565b5f6114ea846107a8565b156115d057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611521903390899088908890600401611e0d565b6020604051808303815f875af192505050801561155b575060408051601f3d908101601f1916820190925261155891810190611e49565b60015b6115b6573d808015611588576040519150601f19603f3d011682016040523d82523d5f602084013e61158d565b606091505b5080515f036115ae5760405162461bcd60e51b815260040161067090611da6565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610e56565b506001949350505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106116195772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611645576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061166357662386f26fc10000830492506010015b6305f5e100831061167b576305f5e100830492506008015b612710831061168f57612710830492506004015b606483106116a1576064830492506002015b600a83106105675760010192915050565b5f80833a43426116c3600183611bab565b604080516001600160a01b039096166020870152850193909352606084019190915260808301524060a08201523060c082015260e081018490526101000160408051601f19818403018152919052805160209091012090505f6117268483611e64565b90506117328185611793565b95945050505050565b5f8181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b5f82815260026020526040812054818181036117b05750836117b3565b50805b5f6117bf600186611bab565b5f8181526002602052604090205490915086821461180457805f036117f3575f878152600260205260409020829055611804565b5f8781526002602052604090208190555b8015611819575f828152600260205260408120555b509095945050505050565b6001600160e01b0319811681146108c3575f5ffd5b5f60208284031215611849575f5ffd5b8135610c8a81611824565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f610c8a6020830184611854565b5f602082840312156118a4575f5ffd5b5035919050565b80356001600160a01b03811681146118c1575f5ffd5b919050565b5f5f604083850312156118d7575f5ffd5b6118e0836118ab565b946020939093013593505050565b5f602082840312156118fe575f5ffd5b610c8a826118ab565b5f5f5f60608486031215611919575f5ffd5b611922846118ab565b9250611930602085016118ab565b929592945050506040919091013590565b5f5f60408385031215611952575f5ffd5b50508035926020909101359150565b5f5f60208385031215611972575f5ffd5b823567ffffffffffffffff811115611988575f5ffd5b8301601f81018513611998575f5ffd5b803567ffffffffffffffff8111156119ae575f5ffd5b8560208284010111156119bf575f5ffd5b6020919091019590945092505050565b5f5f604083850312156119e0575f5ffd5b6119e9836118ab565b915060208301356001600160601b0381168114611a04575f5ffd5b809150509250929050565b5f5f60408385031215611a20575f5ffd5b611a29836118ab565b915060208301358015158114611a04575f5ffd5b634e487b7160e01b5f52604160045260245ffd5b5f5f5f5f60808587031215611a64575f5ffd5b611a6d856118ab565b9350611a7b602086016118ab565b925060408501359150606085013567ffffffffffffffff811115611a9d575f5ffd5b8501601f81018713611aad575f5ffd5b803567ffffffffffffffff811115611ac757611ac7611a3d565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715611af657611af6611a3d565b604052818152828201602001891015611b0d575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b5f5f60408385031215611b3f575f5ffd5b611b48836118ab565b9150611b56602084016118ab565b90509250929050565b600181811c90821680611b7357607f821691505b602082108103611b9157634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561056757610567611b97565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b808202811582820484141761056757610567611b97565b634e487b7160e01b5f52601260045260245ffd5b5f82611c4857611c48611c26565b500490565b601f8211156107a357805f5260205f20601f840160051c81016020851015611c725750805b601f840160051c820191505b81811015611c91575f8155600101611c7e565b5050505050565b67ffffffffffffffff831115611cb057611cb0611a3d565b611cc483611cbe8354611b5f565b83611c4d565b5f601f841160018114611cf5575f8515611cde5750838201355b5f19600387901b1c1916600186901b178355611c91565b5f83815260208120601f198716915b82811015611d245786850135825560209485019460019092019101611d04565b5086821015611d40575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f81518060208401855e5f93019283525090919050565b5f611d7d611d778386611d52565b84611d52565b64173539b7b760d91b8152600501949350505050565b8082018082111561056757610567611b97565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b5f81611e0657611e06611b97565b505f190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90611e3f90830184611854565b9695505050505050565b5f60208284031215611e59575f5ffd5b8151610c8a81611824565b5f82611e7257611e72611c26565b50069056fea2646970667358221220f1506aaa26ca6fac8eeb851dda451b6278f7ad030664504e0a0b6a84be84143a64736f6c634300081c0033

Deployed Bytecode

0x6080604052600436106101ba575f3560e01c8063715018a6116100f2578063a0712d6811610092578063d123973011610062578063d1239730146104d4578063d5abeb01146104ed578063e985e9c51461051f578063f2fde38b1461053e575f5ffd5b8063a0712d6814610464578063a22cb46514610477578063b88d4fde14610496578063c87b56dd146104b5575f5ffd5b80638f2fc60b116100cd5780638f2fc60b146103fd57806391b7f5ed1461041c57806395d89b411461043b578063a035b1fe1461044f575f5ffd5b8063715018a6146103b85780637d8966e4146103cc5780638da5cb5b146103e0575f5ffd5b80632a55205a1161015d57806342842e0e1161013857806342842e0e1461033c57806355f804b31461035b5780636352211e1461037a57806370a0823114610399575f5ffd5b80632a55205a146102cb578063375a069a146103095780633ccfd60b14610328575f5ffd5b8063095ea7b311610198578063095ea7b31461024a578063162790551461026b57806318160ddd1461028a57806323b872dd146102ac575f5ffd5b806301ffc9a7146101be57806306fdde03146101f2578063081812fc14610213575b5f5ffd5b3480156101c9575f5ffd5b506101dd6101d8366004611839565b61055d565b60405190151581526020015b60405180910390f35b3480156101fd575f5ffd5b5061020661056d565b6040516101e99190611882565b34801561021e575f5ffd5b5061023261022d366004611894565b6105fc565b6040516001600160a01b0390911681526020016101e9565b348015610255575f5ffd5b506102696102643660046118c6565b610694565b005b348015610276575f5ffd5b506101dd6102853660046118ee565b6107a8565b348015610295575f5ffd5b5061029e6107c9565b6040519081526020016101e9565b3480156102b7575f5ffd5b506102696102c6366004611907565b6107fd565b3480156102d6575f5ffd5b506102ea6102e5366004611941565b61082e565b604080516001600160a01b0390931683526020830191909152016101e9565b348015610314575f5ffd5b50610269610323366004611894565b6108b1565b348015610333575f5ffd5b506102696108c6565b348015610347575f5ffd5b50610269610356366004611907565b610956565b348015610366575f5ffd5b50610269610375366004611961565b610970565b348015610385575f5ffd5b50610232610394366004611894565b610985565b3480156103a4575f5ffd5b5061029e6103b33660046118ee565b6109fb565b3480156103c3575f5ffd5b50610269610a80565b3480156103d7575f5ffd5b50610269610a93565b3480156103eb575f5ffd5b50600a546001600160a01b0316610232565b348015610408575f5ffd5b506102696104173660046119cf565b610aaf565b348015610427575f5ffd5b50610269610436366004611894565b610ac5565b348015610446575f5ffd5b50610206610ad2565b34801561045a575f5ffd5b5061029e600b5481565b610269610472366004611894565b610ae1565b348015610482575f5ffd5b50610269610491366004611a0f565b610b77565b3480156104a1575f5ffd5b506102696104b0366004611a51565b610b82565b3480156104c0575f5ffd5b506102066104cf366004611894565b610bba565b3480156104df575f5ffd5b50600d546101dd9060ff1681565b3480156104f8575f5ffd5b507f000000000000000000000000000000000000000000000000000000000000271061029e565b34801561052a575f5ffd5b506101dd610539366004611b2e565b610c91565b348015610549575f5ffd5b506102696105583660046118ee565b610cbe565b5f61056782610cf8565b92915050565b60605f805461057b90611b5f565b80601f01602080910402602001604051908101604052809291908181526020018280546105a790611b5f565b80156105f25780601f106105c9576101008083540402835291602001916105f2565b820191905f5260205f20905b8154815290600101906020018083116105d557829003601f168201915b5050505050905090565b5f818152600460205260408120546001600160a01b03166106795760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b505f908152600660205260409020546001600160a01b031690565b5f61069e82610985565b9050806001600160a01b0316836001600160a01b03160361070b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610670565b336001600160a01b038216148061072757506107278133610c91565b6107995760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610670565b6107a38383610d1c565b505050565b5f816001600160a01b03163b5f036107c157505f919050565b506001919050565b5f6003547f00000000000000000000000000000000000000000000000000000000000027106107f89190611bab565b905090565b6108073382610d89565b6108235760405162461bcd60e51b815260040161067090611bbe565b6107a3838383610e5e565b5f82815260096020526040812080548291906001600160a01b03811690600160a01b90046001600160601b0316816108815750506008546001600160a01b03811690600160a01b90046001600160601b03165b5f6127106108986001600160601b03841689611c0f565b6108a29190611c3a565b92989297509195505050505050565b6108b9610ff6565b6108c33382611023565b50565b6108ce610ff6565b6040515f90339047908381818185875af1925050503d805f811461090d576040519150601f19603f3d011682016040523d82523d5f602084013e610912565b606091505b50509050806108c35760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606401610670565b6107a383838360405180602001604052805f815250610b82565b610978610ff6565b600c6107a3828483611c98565b5f818152600460205260408120546001600160a01b0316806105675760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610670565b5f6001600160a01b038216610a655760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610670565b506001600160a01b03165f9081526005602052604090205490565b610a88610ff6565b610a915f61102d565b565b610a9b610ff6565b600d805460ff19811660ff90911615179055565b610ab7610ff6565b610ac1828261107e565b5050565b610acd610ff6565b600b55565b60606001805461057b90611b5f565b600d5460ff16610b295760405162461bcd60e51b815260206004820152601360248201527214d85b19481a5cc81b9bdd08195b98589b1959606a1b6044820152606401610670565b3481600b54610b389190611c0f565b11156108b95760405162461bcd60e51b815260206004820152600e60248201526d4e6f7420656e6f7567682041504560901b6044820152606401610670565b610ac1338383611120565b610b8c3383610d89565b610ba85760405162461bcd60e51b815260040161067090611bbe565b610bb4848484846111ed565b50505050565b5f818152600460205260409020546060906001600160a01b0316610c385760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610670565b5f610c41611220565b90505f815111610c5f5760405180602001604052805f815250610c8a565b80610c698461122f565b604051602001610c7a929190611d69565b6040516020818303038152906040525b9392505050565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b610cc6610ff6565b6001600160a01b038116610cef57604051631e4fbdf760e01b81525f6004820152602401610670565b6108c38161102d565b5f6001600160e01b0319821663152a902d60e11b14806105675750610567826112bf565b5f81815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610d5082610985565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b5f818152600460205260408120546001600160a01b0316610e015760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610670565b5f610e0b83610985565b9050806001600160a01b0316846001600160a01b03161480610e465750836001600160a01b0316610e3b846105fc565b6001600160a01b0316145b80610e565750610e568185610c91565b949350505050565b826001600160a01b0316610e7182610985565b6001600160a01b031614610ed55760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610670565b6001600160a01b038216610f375760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610670565b610f415f82610d1c565b6001600160a01b0383165f908152600560205260408120805460019290610f69908490611bab565b90915550506001600160a01b0382165f908152600560205260408120805460019290610f96908490611d93565b90915550505f8181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a546001600160a01b03163314610a915760405163118cdaa760e01b8152336004820152602401610670565b610ac1828261130e565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6127106001600160601b0382168110156110bd57604051636f483d0960e01b81526001600160601b038316600482015260248101829052604401610670565b6001600160a01b0383166110e657604051635b6cc80560e11b81525f6004820152602401610670565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600855565b816001600160a01b0316836001600160a01b0316036111815760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610670565b6001600160a01b038381165f81815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6111f8848484610e5e565b611204848484846114e0565b610bb45760405162461bcd60e51b815260040161067090611da6565b6060600c805461057b90611b5f565b60605f61123b836115db565b60010190505f8167ffffffffffffffff81111561125a5761125a611a3d565b6040519080825280601f01601f191660200182016040528015611284576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461128e57509392505050565b5f6001600160e01b031982166380ac58cd60e01b14806112ef57506001600160e01b03198216635b5e139f60e01b145b8061056757506301ffc9a760e01b6001600160e01b0319831614610567565b3332146113555760405162461bcd60e51b815260206004820152601560248201527410dbdb9d1c9858dd1cc818d85b9b9bdd081b5a5b9d605a1b6044820152606401610670565b6001600160a01b0382166113ab5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610670565b5f811161140b5760405162461bcd60e51b815260206004820152602860248201527f455243373231523a206e65656420746f206d696e74206174206c65617374206f6044820152673732903a37b5b2b760c11b6064820152608401610670565b8060035410156114715760405162461bcd60e51b815260206004820152602b60248201527f455243373231523a206d696e74696e67206d6f726520746f6b656e732074686160448201526a6e20617661696c61626c6560a81b6064820152608401610670565b6003545f5b828110156114a9575f61148985846116b2565b9050611495858261173b565b61149e83611df8565b925050600101611476565b5060038190556001600160a01b0383165f90815260056020526040812080548492906114d6908490611d93565b9091555050505050565b5f6114ea846107a8565b156115d057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611521903390899088908890600401611e0d565b6020604051808303815f875af192505050801561155b575060408051601f3d908101601f1916820190925261155891810190611e49565b60015b6115b6573d808015611588576040519150601f19603f3d011682016040523d82523d5f602084013e61158d565b606091505b5080515f036115ae5760405162461bcd60e51b815260040161067090611da6565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610e56565b506001949350505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106116195772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611645576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061166357662386f26fc10000830492506010015b6305f5e100831061167b576305f5e100830492506008015b612710831061168f57612710830492506004015b606483106116a1576064830492506002015b600a83106105675760010192915050565b5f80833a43426116c3600183611bab565b604080516001600160a01b039096166020870152850193909352606084019190915260808301524060a08201523060c082015260e081018490526101000160408051601f19818403018152919052805160209091012090505f6117268483611e64565b90506117328185611793565b95945050505050565b5f8181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b5f82815260026020526040812054818181036117b05750836117b3565b50805b5f6117bf600186611bab565b5f8181526002602052604090205490915086821461180457805f036117f3575f878152600260205260409020829055611804565b5f8781526002602052604090208190555b8015611819575f828152600260205260408120555b509095945050505050565b6001600160e01b0319811681146108c3575f5ffd5b5f60208284031215611849575f5ffd5b8135610c8a81611824565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f610c8a6020830184611854565b5f602082840312156118a4575f5ffd5b5035919050565b80356001600160a01b03811681146118c1575f5ffd5b919050565b5f5f604083850312156118d7575f5ffd5b6118e0836118ab565b946020939093013593505050565b5f602082840312156118fe575f5ffd5b610c8a826118ab565b5f5f5f60608486031215611919575f5ffd5b611922846118ab565b9250611930602085016118ab565b929592945050506040919091013590565b5f5f60408385031215611952575f5ffd5b50508035926020909101359150565b5f5f60208385031215611972575f5ffd5b823567ffffffffffffffff811115611988575f5ffd5b8301601f81018513611998575f5ffd5b803567ffffffffffffffff8111156119ae575f5ffd5b8560208284010111156119bf575f5ffd5b6020919091019590945092505050565b5f5f604083850312156119e0575f5ffd5b6119e9836118ab565b915060208301356001600160601b0381168114611a04575f5ffd5b809150509250929050565b5f5f60408385031215611a20575f5ffd5b611a29836118ab565b915060208301358015158114611a04575f5ffd5b634e487b7160e01b5f52604160045260245ffd5b5f5f5f5f60808587031215611a64575f5ffd5b611a6d856118ab565b9350611a7b602086016118ab565b925060408501359150606085013567ffffffffffffffff811115611a9d575f5ffd5b8501601f81018713611aad575f5ffd5b803567ffffffffffffffff811115611ac757611ac7611a3d565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715611af657611af6611a3d565b604052818152828201602001891015611b0d575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b5f5f60408385031215611b3f575f5ffd5b611b48836118ab565b9150611b56602084016118ab565b90509250929050565b600181811c90821680611b7357607f821691505b602082108103611b9157634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561056757610567611b97565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b808202811582820484141761056757610567611b97565b634e487b7160e01b5f52601260045260245ffd5b5f82611c4857611c48611c26565b500490565b601f8211156107a357805f5260205f20601f840160051c81016020851015611c725750805b601f840160051c820191505b81811015611c91575f8155600101611c7e565b5050505050565b67ffffffffffffffff831115611cb057611cb0611a3d565b611cc483611cbe8354611b5f565b83611c4d565b5f601f841160018114611cf5575f8515611cde5750838201355b5f19600387901b1c1916600186901b178355611c91565b5f83815260208120601f198716915b82811015611d245786850135825560209485019460019092019101611d04565b5086821015611d40575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f81518060208401855e5f93019283525090919050565b5f611d7d611d778386611d52565b84611d52565b64173539b7b760d91b8152600501949350505050565b8082018082111561056757610567611b97565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b5f81611e0657611e06611b97565b505f190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90611e3f90830184611854565b9695505050505050565b5f60208284031215611e59575f5ffd5b8151610c8a81611824565b5f82611e7257611e72611c26565b50069056fea2646970667358221220f1506aaa26ca6fac8eeb851dda451b6278f7ad030664504e0a0b6a84be84143a64736f6c634300081c0033

Deployed Bytecode Sourcemap

118071:2189:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;119817:171;;;;;;;;;;-1:-1:-1;119817:171:0;;;;;:::i;:::-;;:::i;:::-;;;565:14:1;;558:22;540:41;;528:2;513:18;119817:171:0;;;;;;;;103118:100;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;104688:221::-;;;;;;;;;;-1:-1:-1;104688:221:0;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;1528:32:1;;;1510:51;;1498:2;1483:18;104688:221:0;1364:203:1;104210:412:0;;;;;;;;;;-1:-1:-1;104210:412:0;;;;;:::i;:::-;;:::i;:::-;;114648:179;;;;;;;;;;-1:-1:-1;114648:179:0;;;;;:::i;:::-;;:::i;102255:119::-;;;;;;;;;;;;;:::i;:::-;;;2392:25:1;;;2380:2;2365:18;102255:119:0;2246:177:1;105438:339:0;;;;;;;;;;-1:-1:-1;105438:339:0;;;;;:::i;:::-;;:::i;9521:673::-;;;;;;;;;;-1:-1:-1;9521:673:0;;;;;:::i;:::-;;:::i;:::-;;;;-1:-1:-1;;;;;3350:32:1;;;3332:51;;3414:2;3399:18;;3392:34;;;;3305:18;9521:673:0;3158:274:1;119415:106:0;;;;;;;;;;-1:-1:-1;119415:106:0;;;;;:::i;:::-;;:::i;119529:173::-;;;;;;;;;;;;;:::i;105848:185::-;;;;;;;;;;-1:-1:-1;105848:185:0;;;;;:::i;:::-;;:::i;118984:108::-;;;;;;;;;;-1:-1:-1;118984:108:0;;;;;:::i;:::-;;:::i;102811:240::-;;;;;;;;;;-1:-1:-1;102811:240:0;;;;;:::i;:::-;;:::i;102541:208::-;;;;;;;;;;-1:-1:-1;102541:208:0;;;;;:::i;:::-;;:::i;3361:103::-;;;;;;;;;;;;;:::i;119100:86::-;;;;;;;;;;;;;:::i;2686:87::-;;;;;;;;;;-1:-1:-1;2759:6:0;;-1:-1:-1;;;;;2759:6:0;2686:87;;119288:119;;;;;;;;;;-1:-1:-1;119288:119:0;;;;;:::i;:::-;;:::i;119194:86::-;;;;;;;;;;-1:-1:-1;119194:86:0;;;;;:::i;:::-;;:::i;103287:104::-;;;;;;;;;;;;;:::i;118162:33::-;;;;;;;;;;;;;;;;118441:219;;;;;;:::i;:::-;;:::i;104981:155::-;;;;;;;;;;-1:-1:-1;104981:155:0;;;;;:::i;:::-;;:::i;106104:328::-;;;;;;;;;;-1:-1:-1;106104:328:0;;;;;:::i;:::-;;:::i;103462:343::-;;;;;;;;;;-1:-1:-1;103462:343:0;;;;;:::i;:::-;;:::i;118233:31::-;;;;;;;;;;-1:-1:-1;118233:31:0;;;;;;;;102382:95;;;;;;;;;;-1:-1:-1;102459:10:0;102382:95;;105207:164;;;;;;;;;;-1:-1:-1;105207:164:0;;;;;:::i;:::-;;:::i;3619:220::-;;;;;;;;;;-1:-1:-1;3619:220:0;;;;;:::i;:::-;;:::i;119817:171::-;119920:4;119944:36;119968:11;119944:23;:36::i;:::-;119937:43;119817:171;-1:-1:-1;;119817:171:0:o;103118:100::-;103172:13;103205:5;103198:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;103118:100;:::o;104688:221::-;104764:7;108156:16;;;:7;:16;;;;;;-1:-1:-1;;;;;108156:16:0;104784:73;;;;-1:-1:-1;;;104784:73:0;;6948:2:1;104784:73:0;;;6930:21:1;6987:2;6967:18;;;6960:30;7026:34;7006:18;;;6999:62;-1:-1:-1;;;7077:18:1;;;7070:42;7129:19;;104784:73:0;;;;;;;;;-1:-1:-1;104877:24:0;;;;:15;:24;;;;;;-1:-1:-1;;;;;104877:24:0;;104688:221::o;104210:412::-;104291:13;104307:24;104323:7;104307:15;:24::i;:::-;104291:40;;104356:5;-1:-1:-1;;;;;104350:11:0;:2;-1:-1:-1;;;;;104350:11:0;;104342:57;;;;-1:-1:-1;;;104342:57:0;;7361:2:1;104342:57:0;;;7343:21:1;7400:2;7380:18;;;7373:30;7439:34;7419:18;;;7412:62;-1:-1:-1;;;7490:18:1;;;7483:31;7531:19;;104342:57:0;7159:397:1;104342:57:0;775:10;-1:-1:-1;;;;;104434:21:0;;;;:62;;-1:-1:-1;104459:37:0;104476:5;775:10;105207:164;:::i;104459:37::-;104412:168;;;;-1:-1:-1;;;104412:168:0;;7763:2:1;104412:168:0;;;7745:21:1;7802:2;7782:18;;;7775:30;7841:34;7821:18;;;7814:62;7912:26;7892:18;;;7885:54;7956:19;;104412:168:0;7561:420:1;104412:168:0;104593:21;104602:2;104606:7;104593:8;:21::i;:::-;104280:342;104210:412;;:::o;114648:179::-;114719:4;114738;-1:-1:-1;;;;;114738:16:0;;114756:1;114738:19;114735:63;;-1:-1:-1;114781:5:0;;114648:179;-1:-1:-1;114648:179:0:o;114735:63::-;-1:-1:-1;114815:4:0;;114648:179;-1:-1:-1;114648:179:0:o;102255:119::-;102307:7;102347:19;;102334:10;:32;;;;:::i;:::-;102327:39;;102255:119;:::o;105438:339::-;105633:41;775:10;105666:7;105633:18;:41::i;:::-;105625:103;;;;-1:-1:-1;;;105625:103:0;;;;;;;:::i;:::-;105741:28;105751:4;105757:2;105761:7;105741:9;:28::i;9521:673::-;9632:16;9712:26;;;:17;:26;;;;;9775:21;;9632:16;;9712:26;-1:-1:-1;;;;;9775:21:0;;;-1:-1:-1;;;9832:28:0;;-1:-1:-1;;;;;9832:28:0;9775:21;9873:176;;-1:-1:-1;;9941:19:0;:28;-1:-1:-1;;;;;9941:28:0;;;-1:-1:-1;;;10002:35:0;;-1:-1:-1;;;;;10002:35:0;9873:176;10061:21;10560:5;10086:27;-1:-1:-1;;;;;10086:27:0;;:9;:27;:::i;:::-;10085:49;;;;:::i;:::-;10155:15;;;;-1:-1:-1;9521:673:0;;-1:-1:-1;;;;;;9521:673:0:o;119415:106::-;2572:13;:11;:13::i;:::-;119479:34:::1;119493:10;119505:7;119479:13;:34::i;:::-;119415:106:::0;:::o;119529:173::-;2572:13;:11;:13::i;:::-;119598:49:::1;::::0;119580:12:::1;::::0;119598:10:::1;::::0;119621:21:::1;::::0;119580:12;119598:49;119580:12;119598:49;119621:21;119598:10;:49:::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;119579:68;;;119666:7;119658:36;;;::::0;-1:-1:-1;;;119658:36:0;;9511:2:1;119658:36:0::1;::::0;::::1;9493:21:1::0;9550:2;9530:18;;;9523:30;-1:-1:-1;;;9569:18:1;;;9562:46;9625:18;;119658:36:0::1;9309:340:1::0;105848:185:0;105986:39;106003:4;106009:2;106013:7;105986:39;;;;;;;;;;;;:16;:39::i;118984:108::-;2572:13;:11;:13::i;:::-;119063:7:::1;:21;119073:11:::0;;119063:7;:21:::1;:::i;102811:240::-:0;102883:7;106533:16;;;:7;:16;;;;;;-1:-1:-1;;;;;106533:16:0;;102947:73;;;;-1:-1:-1;;;102947:73:0;;11879:2:1;102947:73:0;;;11861:21:1;11918:2;11898:18;;;11891:30;11957:34;11937:18;;;11930:62;-1:-1:-1;;;12008:18:1;;;12001:39;12057:19;;102947:73:0;11677:405:1;102541:208:0;102613:7;-1:-1:-1;;;;;102641:19:0;;102633:74;;;;-1:-1:-1;;;102633:74:0;;12289:2:1;102633:74:0;;;12271:21:1;12328:2;12308:18;;;12301:30;12367:34;12347:18;;;12340:62;-1:-1:-1;;;12418:18:1;;;12411:40;12468:19;;102633:74:0;12087:406:1;102633:74:0;-1:-1:-1;;;;;;102725:16:0;;;;;:9;:16;;;;;;;102541:208::o;3361:103::-;2572:13;:11;:13::i;:::-;3426:30:::1;3453:1;3426:18;:30::i;:::-;3361:103::o:0;119100:86::-;2572:13;:11;:13::i;:::-;119167:11:::1;::::0;;-1:-1:-1;;119152:26:0;::::1;119167:11;::::0;;::::1;119166:12;119152:26;::::0;;119100:86::o;119288:119::-;2572:13;:11;:13::i;:::-;119367:32:::1;119386:6;119394:4;119367:18;:32::i;:::-;119288:119:::0;;:::o;119194:86::-;2572:13;:11;:13::i;:::-;119258:5:::1;:14:::0;119194:86::o;103287:104::-;103343:13;103376:7;103369:14;;;;;:::i;118441:219::-;118506:11;;;;118498:43;;;;-1:-1:-1;;;118498:43:0;;12700:2:1;118498:43:0;;;12682:21:1;12739:2;12719:18;;;12712:30;-1:-1:-1;;;12758:18:1;;;12751:49;12817:18;;118498:43:0;12498:343:1;118498:43:0;118579:9;118568:7;118560:5;;:15;;;;:::i;:::-;:28;;118552:55;;;;-1:-1:-1;;;118552:55:0;;13048:2:1;118552:55:0;;;13030:21:1;13087:2;13067:18;;;13060:30;-1:-1:-1;;;13106:18:1;;;13099:44;13160:18;;118552:55:0;12846:338:1;104981:155:0;105076:52;775:10;105109:8;105119;105076:18;:52::i;106104:328::-;106279:41;775:10;106312:7;106279:18;:41::i;:::-;106271:103;;;;-1:-1:-1;;;106271:103:0;;;;;;;:::i;:::-;106385:39;106399:4;106405:2;106409:7;106418:5;106385:13;:39::i;:::-;106104:328;;;;:::o;103462:343::-;108132:4;108156:16;;;:7;:16;;;;;;103535:13;;-1:-1:-1;;;;;108156:16:0;103561:76;;;;-1:-1:-1;;;103561:76:0;;13391:2:1;103561:76:0;;;13373:21:1;13430:2;13410:18;;;13403:30;13469:34;13449:18;;;13442:62;-1:-1:-1;;;13520:18:1;;;13513:45;13575:19;;103561:76:0;13189:411:1;103561:76:0;103650:21;103674:10;:8;:10::i;:::-;103650:34;;103726:1;103708:7;103702:21;:25;:95;;;;;;;;;;;;;;;;;103754:7;103763:18;:7;:16;:18::i;:::-;103737:54;;;;;;;;;:::i;:::-;;;;;;;;;;;;;103702:95;103695:102;103462:343;-1:-1:-1;;;103462:343:0:o;105207:164::-;-1:-1:-1;;;;;105328:25:0;;;105304:4;105328:25;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;;;105207:164::o;3619:220::-;2572:13;:11;:13::i;:::-;-1:-1:-1;;;;;3704:22:0;::::1;3700:93;;3750:31;::::0;-1:-1:-1;;;3750:31:0;;3778:1:::1;3750:31;::::0;::::1;1510:51:1::0;1483:18;;3750:31:0::1;1364:203:1::0;3700:93:0::1;3803:28;3822:8;3803:18;:28::i;9251:215::-:0;9353:4;-1:-1:-1;;;;;;9377:41:0;;-1:-1:-1;;;9377:41:0;;:81;;;9422:36;9446:11;9422:23;:36::i;113951:175::-;114026:24;;;;:15;:24;;;;;:29;;-1:-1:-1;;;;;;114026:29:0;-1:-1:-1;;;;;114026:29:0;;;;;;;;:24;;114080;114026;114080:15;:24::i;:::-;-1:-1:-1;;;;;114071:47:0;;;;;;;;;;;113951:175;;:::o;108361:349::-;108454:4;108156:16;;;:7;:16;;;;;;-1:-1:-1;;;;;108156:16:0;108471:73;;;;-1:-1:-1;;;108471:73:0;;14454:2:1;108471:73:0;;;14436:21:1;14493:2;14473:18;;;14466:30;14532:34;14512:18;;;14505:62;-1:-1:-1;;;14583:18:1;;;14576:42;14635:19;;108471:73:0;14252:408:1;108471:73:0;108555:13;108571:24;108587:7;108571:15;:24::i;:::-;108555:40;;108625:5;-1:-1:-1;;;;;108614:16:0;:7;-1:-1:-1;;;;;108614:16:0;;:51;;;;108658:7;-1:-1:-1;;;;;108634:31:0;:20;108646:7;108634:11;:20::i;:::-;-1:-1:-1;;;;;108634:31:0;;108614:51;:87;;;;108669:32;108686:5;108693:7;108669:16;:32::i;:::-;108606:96;108361:349;-1:-1:-1;;;;108361:349:0:o;113207:626::-;113367:4;-1:-1:-1;;;;;113339:32:0;:24;113355:7;113339:15;:24::i;:::-;-1:-1:-1;;;;;113339:32:0;;113331:82;;;;-1:-1:-1;;;113331:82:0;;14867:2:1;113331:82:0;;;14849:21:1;14906:2;14886:18;;;14879:30;14945:34;14925:18;;;14918:62;-1:-1:-1;;;14996:18:1;;;14989:35;15041:19;;113331:82:0;14665:401:1;113331:82:0;-1:-1:-1;;;;;113432:16:0;;113424:65;;;;-1:-1:-1;;;113424:65:0;;15273:2:1;113424:65:0;;;15255:21:1;15312:2;15292:18;;;15285:30;15351:34;15331:18;;;15324:62;-1:-1:-1;;;15402:18:1;;;15395:34;15446:19;;113424:65:0;15071:400:1;113424:65:0;113606:29;113623:1;113627:7;113606:8;:29::i;:::-;-1:-1:-1;;;;;113648:15:0;;;;;;:9;:15;;;;;:20;;113667:1;;113648:15;:20;;113667:1;;113648:20;:::i;:::-;;;;-1:-1:-1;;;;;;;113679:13:0;;;;;;:9;:13;;;;;:18;;113696:1;;113679:13;:18;;113696:1;;113679:18;:::i;:::-;;;;-1:-1:-1;;113708:16:0;;;;:7;:16;;;;;;:21;;-1:-1:-1;;;;;;113708:21:0;-1:-1:-1;;;;;113708:21:0;;;;;;;;;113747:27;;113708:16;;113747:27;;;;;;;104280:342;104210:412;;:::o;2851:166::-;2759:6;;-1:-1:-1;;;;;2759:6:0;775:10;2911:23;2907:103;;2958:40;;-1:-1:-1;;;2958:40:0;;775:10;2958:40;;;1510:51:1;1483:18;;2958:40:0;1364:203:1;118712:102:0;118783:23;118795:2;118799:6;118783:11;:23::i;3999:191::-;4092:6;;;-1:-1:-1;;;;;4109:17:0;;;-1:-1:-1;;;;;;4109:17:0;;;;;;;4142:40;;4092:6;;;4109:17;4092:6;;4142:40;;4073:16;;4142:40;4062:128;3999:191;:::o;10844:518::-;10560:5;-1:-1:-1;;;;;10993:26:0;;;-1:-1:-1;10989:176:0;;;11098:55;;-1:-1:-1;;;11098:55:0;;-1:-1:-1;;;;;15797:39:1;;11098:55:0;;;15779:58:1;15853:18;;;15846:34;;;15752:18;;11098:55:0;15606:280:1;10989:176:0;-1:-1:-1;;;;;11179:22:0;;11175:110;;11225:48;;-1:-1:-1;;;11225:48:0;;11270:1;11225:48;;;1510:51:1;1483:18;;11225:48:0;1364:203:1;11175:110:0;-1:-1:-1;11319:35:0;;;;;;;;;-1:-1:-1;;;;;11319:35:0;;;;;;-1:-1:-1;;;;;11319:35:0;;;;;;;;;;-1:-1:-1;;;11297:57:0;;;;:19;:57;10844:518::o;114268:315::-;114423:8;-1:-1:-1;;;;;114414:17:0;:5;-1:-1:-1;;;;;114414:17:0;;114406:55;;;;-1:-1:-1;;;114406:55:0;;16093:2:1;114406:55:0;;;16075:21:1;16132:2;16112:18;;;16105:30;16171:27;16151:18;;;16144:55;16216:18;;114406:55:0;15891:349:1;114406:55:0;-1:-1:-1;;;;;114472:25:0;;;;;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;:46;;-1:-1:-1;;114472:46:0;;;;;;;;;;114534:41;;540::1;;;114534::0;;513:18:1;114534:41:0;;;;;;;114268:315;;;:::o;107439:::-;107596:28;107606:4;107612:2;107616:7;107596:9;:28::i;:::-;107643:48;107666:4;107672:2;107676:7;107685:5;107643:22;:48::i;:::-;107635:111;;;;-1:-1:-1;;;107635:111:0;;;;;;;:::i;118822:108::-;118882:13;118915:7;118908:14;;;;;:::i;82998:650::-;83054:13;83105:14;83122:17;83133:5;83122:10;:17::i;:::-;83142:1;83122:21;83105:38;;83158:20;83192:6;83181:18;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;83181:18:0;-1:-1:-1;83158:41:0;-1:-1:-1;83291:28:0;;;83307:2;83291:28;83348:254;-1:-1:-1;;83380:5:0;-1:-1:-1;;;83481:2:0;83470:14;;83465:32;83380:5;83452:46;83544:2;83535:11;;;-1:-1:-1;83565:21:0;83348:254;83565:21;-1:-1:-1;83623:6:0;82998:650;-1:-1:-1;;;82998:650:0:o;101954:293::-;102056:4;-1:-1:-1;;;;;;102089:40:0;;-1:-1:-1;;;102089:40:0;;:101;;-1:-1:-1;;;;;;;102142:48:0;;-1:-1:-1;;;102142:48:0;102089:101;:150;;;-1:-1:-1;;;;;;;;;;7123:40:0;;;102203:36;7023:148;109006:935;775:10;109108:9;109092:25;109084:59;;;;-1:-1:-1;;;109084:59:0;;16866:2:1;109084:59:0;;;16848:21:1;16905:2;16885:18;;;16878:30;-1:-1:-1;;;16924:18:1;;;16917:51;16985:18;;109084:59:0;16664:345:1;109084:59:0;-1:-1:-1;;;;;109162:16:0;;109154:61;;;;-1:-1:-1;;;109154:61:0;;17216:2:1;109154:61:0;;;17198:21:1;;;17235:18;;;17228:30;17294:34;17274:18;;;17267:62;17346:18;;109154:61:0;17014:356:1;109154:61:0;109247:1;109234:10;:14;109226:67;;;;-1:-1:-1;;;109226:67:0;;17577:2:1;109226:67:0;;;17559:21:1;17616:2;17596:18;;;17589:30;17655:34;17635:18;;;17628:62;-1:-1:-1;;;17706:18:1;;;17699:38;17754:19;;109226:67:0;17375:404:1;109226:67:0;109439:10;109416:19;;:33;;109408:89;;;;-1:-1:-1;;;109408:89:0;;17986:2:1;109408:89:0;;;17968:21:1;18025:2;18005:18;;;17998:30;18064:34;18044:18;;;18037:62;-1:-1:-1;;;18115:18:1;;;18108:41;18166:19;;109408:89:0;17784:407:1;109408:89:0;109543:19;;109510:30;109573:263;109593:10;109589:1;:14;109573:263;;;109649:15;109667:56;109693:2;109697:25;109667;:56::i;:::-;109649:74;;109740:40;109768:2;109772:7;109740:27;:40::i;:::-;109797:27;;;:::i;:::-;;-1:-1:-1;;109605:3:0;;109573:263;;;-1:-1:-1;109848:19:0;:47;;;-1:-1:-1;;;;;109906:13:0;;;;;;:9;:13;;;;;:27;;109923:10;;109906:13;:27;;109923:10;;109906:27;:::i;:::-;;;;-1:-1:-1;;;;;109006:935:0:o;115392:798::-;115547:4;115568:14;115579:2;115568:10;:14::i;:::-;115564:619;;;115603:72;;-1:-1:-1;;;115603:72:0;;-1:-1:-1;;;;;115603:36:0;;;;;:72;;775:10;;115654:4;;115660:7;;115669:5;;115603:72;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;-1:-1:-1;115603:72:0;;;;;;;;-1:-1:-1;;115603:72:0;;;;;;;;;;;;:::i;:::-;;;115599:529;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;115845:6;:13;115862:1;115845:18;115841:272;;115888:60;;-1:-1:-1;;;115888:60:0;;;;;;;:::i;115841:272::-;116063:6;116057:13;116048:6;116044:2;116040:15;116033:38;115599:529;-1:-1:-1;;;;;;115726:51:0;-1:-1:-1;;;115726:51:0;;-1:-1:-1;115719:58:0;;115564:619;-1:-1:-1;116167:4:0;115392:798;;;;;;:::o;76643:948::-;76696:7;;-1:-1:-1;;;76774:17:0;;76770:106;;-1:-1:-1;;;76812:17:0;;;-1:-1:-1;76858:2:0;76848:12;76770:106;76903:8;76894:5;:17;76890:106;;76941:8;76932:17;;;-1:-1:-1;76978:2:0;76968:12;76890:106;77023:8;77014:5;:17;77010:106;;77061:8;77052:17;;;-1:-1:-1;77098:2:0;77088:12;77010:106;77143:7;77134:5;:16;77130:103;;77180:7;77171:16;;;-1:-1:-1;77216:1:0;77206:11;77130:103;77260:7;77251:5;:16;77247:103;;77297:7;77288:16;;;-1:-1:-1;77333:1:0;77323:11;77247:103;77377:7;77368:5;:16;77364:103;;77414:7;77405:16;;;-1:-1:-1;77450:1:0;77440:11;77364:103;77494:7;77485:5;:16;77481:68;;77532:1;77522:11;77577:6;76643:948;-1:-1:-1;;76643:948:0:o;109949:683::-;110056:7;;110184:2;110209:11;110243:12;110278:15;110326:16;110341:1;110243:12;110326:16;:::i;:::-;110151:295;;;-1:-1:-1;;;;;19425:32:1;;;110151:295:0;;;19407:51:1;19474:18;;19467:34;;;;19517:18;;;19510:34;;;;19560:18;;;19553:34;110316:27:0;19603:19:1;;;19596:35;110374:4:0;19647:19:1;;;19640:61;19717:19;;;19710:35;;;19379:19;;110151:295:0;;;-1:-1:-1;;110151:295:0;;;;;;;;;110123:338;;110151:295;110123:338;;;;;-1:-1:-1;110101:371:0;110505:37;110517:25;110123:338;110505:37;:::i;:::-;110483:59;;110560:64;110585:11;110598:25;110560:24;:64::i;:::-;110553:71;109949:683;-1:-1:-1;;;;;109949:683:0:o;108718:280::-;108861:16;;;;:7;:16;;;;;;:21;;-1:-1:-1;;;;;;108861:21:0;-1:-1:-1;;;;;108861:21:0;;;;;;;;108900:33;;108861:16;;;108900:33;;108861:16;;108900:33;119288:119;;:::o;110750:1460::-;110864:7;110910:28;;;:16;:28;;;;;;110864:7;110978:15;;;110974:292;;-1:-1:-1;111091:10:0;110974:292;;;-1:-1:-1;111244:10:0;110974:292;111278:17;111298:29;111326:1;111298:25;:29;:::i;:::-;111338:22;111363:27;;;:16;:27;;;;;;111278:49;;-1:-1:-1;111405:23:0;;;111401:629;;111656:14;111674:1;111656:19;111652:367;;111772:28;;;;:16;:28;;;;;:40;;;111652:367;;;111958:28;;;;:16;:28;;;;;:45;;;111652:367;112044:19;;112040:137;;112138:27;;;;:16;:27;;;;;112131:34;112040:137;-1:-1:-1;112196:6:0;;110750:1460;-1:-1:-1;;;;;110750:1460:0:o;14:131:1:-;-1:-1:-1;;;;;;88:32:1;;78:43;;68:71;;135:1;132;125:12;150:245;208:6;261:2;249:9;240:7;236:23;232:32;229:52;;;277:1;274;267:12;229:52;316:9;303:23;335:30;359:5;335:30;:::i;592:300::-;645:3;683:5;677:12;710:6;705:3;698:19;766:6;759:4;752:5;748:16;741:4;736:3;732:14;726:47;818:1;811:4;802:6;797:3;793:16;789:27;782:38;881:4;874:2;870:7;865:2;857:6;853:15;849:29;844:3;840:39;836:50;829:57;;;592:300;;;;:::o;897:231::-;1046:2;1035:9;1028:21;1009:4;1066:56;1118:2;1107:9;1103:18;1095:6;1066:56;:::i;1133:226::-;1192:6;1245:2;1233:9;1224:7;1220:23;1216:32;1213:52;;;1261:1;1258;1251:12;1213:52;-1:-1:-1;1306:23:1;;1133:226;-1:-1:-1;1133:226:1:o;1572:173::-;1640:20;;-1:-1:-1;;;;;1689:31:1;;1679:42;;1669:70;;1735:1;1732;1725:12;1669:70;1572:173;;;:::o;1750:300::-;1818:6;1826;1879:2;1867:9;1858:7;1854:23;1850:32;1847:52;;;1895:1;1892;1885:12;1847:52;1918:29;1937:9;1918:29;:::i;:::-;1908:39;2016:2;2001:18;;;;1988:32;;-1:-1:-1;;;1750:300:1:o;2055:186::-;2114:6;2167:2;2155:9;2146:7;2142:23;2138:32;2135:52;;;2183:1;2180;2173:12;2135:52;2206:29;2225:9;2206:29;:::i;2428:374::-;2505:6;2513;2521;2574:2;2562:9;2553:7;2549:23;2545:32;2542:52;;;2590:1;2587;2580:12;2542:52;2613:29;2632:9;2613:29;:::i;:::-;2603:39;;2661:38;2695:2;2684:9;2680:18;2661:38;:::i;:::-;2428:374;;2651:48;;-1:-1:-1;;;2768:2:1;2753:18;;;;2740:32;;2428:374::o;2807:346::-;2875:6;2883;2936:2;2924:9;2915:7;2911:23;2907:32;2904:52;;;2952:1;2949;2942:12;2904:52;-1:-1:-1;;2997:23:1;;;3117:2;3102:18;;;3089:32;;-1:-1:-1;2807:346:1:o;3437:587::-;3508:6;3516;3569:2;3557:9;3548:7;3544:23;3540:32;3537:52;;;3585:1;3582;3575:12;3537:52;3625:9;3612:23;3658:18;3650:6;3647:30;3644:50;;;3690:1;3687;3680:12;3644:50;3713:22;;3766:4;3758:13;;3754:27;-1:-1:-1;3744:55:1;;3795:1;3792;3785:12;3744:55;3835:2;3822:16;3861:18;3853:6;3850:30;3847:50;;;3893:1;3890;3883:12;3847:50;3938:7;3933:2;3924:6;3920:2;3916:15;3912:24;3909:37;3906:57;;;3959:1;3956;3949:12;3906:57;3990:2;3982:11;;;;;4012:6;;-1:-1:-1;3437:587:1;-1:-1:-1;;;3437:587:1:o;4029:366::-;4096:6;4104;4157:2;4145:9;4136:7;4132:23;4128:32;4125:52;;;4173:1;4170;4163:12;4125:52;4196:29;4215:9;4196:29;:::i;:::-;4186:39;;4275:2;4264:9;4260:18;4247:32;-1:-1:-1;;;;;4312:5:1;4308:38;4301:5;4298:49;4288:77;;4361:1;4358;4351:12;4288:77;4384:5;4374:15;;;4029:366;;;;;:::o;4400:347::-;4465:6;4473;4526:2;4514:9;4505:7;4501:23;4497:32;4494:52;;;4542:1;4539;4532:12;4494:52;4565:29;4584:9;4565:29;:::i;:::-;4555:39;;4644:2;4633:9;4629:18;4616:32;4691:5;4684:13;4677:21;4670:5;4667:32;4657:60;;4713:1;4710;4703:12;4752:127;4813:10;4808:3;4804:20;4801:1;4794:31;4844:4;4841:1;4834:15;4868:4;4865:1;4858:15;4884:1207;4979:6;4987;4995;5003;5056:3;5044:9;5035:7;5031:23;5027:33;5024:53;;;5073:1;5070;5063:12;5024:53;5096:29;5115:9;5096:29;:::i;:::-;5086:39;;5144:38;5178:2;5167:9;5163:18;5144:38;:::i;:::-;5134:48;-1:-1:-1;5251:2:1;5236:18;;5223:32;;-1:-1:-1;5330:2:1;5315:18;;5302:32;5357:18;5346:30;;5343:50;;;5389:1;5386;5379:12;5343:50;5412:22;;5465:4;5457:13;;5453:27;-1:-1:-1;5443:55:1;;5494:1;5491;5484:12;5443:55;5534:2;5521:16;5560:18;5552:6;5549:30;5546:56;;;5582:18;;:::i;:::-;5631:2;5625:9;5723:2;5685:17;;-1:-1:-1;;5681:31:1;;;5714:2;5677:40;5673:54;5661:67;;5758:18;5743:34;;5779:22;;;5740:62;5737:88;;;5805:18;;:::i;:::-;5841:2;5834:22;5865;;;5906:15;;;5923:2;5902:24;5899:37;-1:-1:-1;5896:57:1;;;5949:1;5946;5939:12;5896:57;6005:6;6000:2;5996;5992:11;5987:2;5979:6;5975:15;5962:50;6058:1;6053:2;6044:6;6036;6032:19;6028:28;6021:39;6079:6;6069:16;;;;;4884:1207;;;;;;;:::o;6096:260::-;6164:6;6172;6225:2;6213:9;6204:7;6200:23;6196:32;6193:52;;;6241:1;6238;6231:12;6193:52;6264:29;6283:9;6264:29;:::i;:::-;6254:39;;6312:38;6346:2;6335:9;6331:18;6312:38;:::i;:::-;6302:48;;6096:260;;;;;:::o;6361:380::-;6440:1;6436:12;;;;6483;;;6504:61;;6558:4;6550:6;6546:17;6536:27;;6504:61;6611:2;6603:6;6600:14;6580:18;6577:38;6574:161;;6657:10;6652:3;6648:20;6645:1;6638:31;6692:4;6689:1;6682:15;6720:4;6717:1;6710:15;6574:161;;6361:380;;;:::o;7986:127::-;8047:10;8042:3;8038:20;8035:1;8028:31;8078:4;8075:1;8068:15;8102:4;8099:1;8092:15;8118:128;8185:9;;;8206:11;;;8203:37;;;8220:18;;:::i;8251:413::-;8453:2;8435:21;;;8492:2;8472:18;;;8465:30;8531:34;8526:2;8511:18;;8504:62;-1:-1:-1;;;8597:2:1;8582:18;;8575:47;8654:3;8639:19;;8251:413::o;8669:168::-;8742:9;;;8773;;8790:15;;;8784:22;;8770:37;8760:71;;8811:18;;:::i;8842:127::-;8903:10;8898:3;8894:20;8891:1;8884:31;8934:4;8931:1;8924:15;8958:4;8955:1;8948:15;8974:120;9014:1;9040;9030:35;;9045:18;;:::i;:::-;-1:-1:-1;9079:9:1;;8974:120::o;9780:518::-;9882:2;9877:3;9874:11;9871:421;;;9918:5;9915:1;9908:16;9962:4;9959:1;9949:18;10032:2;10020:10;10016:19;10013:1;10009:27;10003:4;9999:38;10068:4;10056:10;10053:20;10050:47;;;-1:-1:-1;10091:4:1;10050:47;10146:2;10141:3;10137:12;10134:1;10130:20;10124:4;10120:31;10110:41;;10201:81;10219:2;10212:5;10209:13;10201:81;;;10278:1;10264:16;;10245:1;10234:13;10201:81;;;10205:3;;9780:518;;;:::o;10474:1198::-;10598:18;10593:3;10590:27;10587:53;;;10620:18;;:::i;:::-;10649:94;10739:3;10699:38;10731:4;10725:11;10699:38;:::i;:::-;10693:4;10649:94;:::i;:::-;10769:1;10794:2;10789:3;10786:11;10811:1;10806:608;;;;11458:1;11475:3;11472:93;;;-1:-1:-1;11531:19:1;;;11518:33;11472:93;-1:-1:-1;;10431:1:1;10427:11;;;10423:24;10419:29;10409:40;10455:1;10451:11;;;10406:57;11578:78;;10779:887;;10806:608;9727:1;9720:14;;;9764:4;9751:18;;-1:-1:-1;;10842:17:1;;;10957:229;10971:7;10968:1;10965:14;10957:229;;;11060:19;;;11047:33;11032:49;;11167:4;11152:20;;;;11120:1;11108:14;;;;10987:12;10957:229;;;10961:3;11214;11205:7;11202:16;11199:159;;;11338:1;11334:6;11328:3;11322;11319:1;11315:11;11311:21;11307:34;11303:39;11290:9;11285:3;11281:19;11268:33;11264:79;11256:6;11249:95;11199:159;;;11401:1;11395:3;11392:1;11388:11;11384:19;11378:4;11371:33;10779:887;;10474:1198;;;:::o;13605:212::-;13647:3;13685:5;13679:12;13729:6;13722:4;13715:5;13711:16;13706:3;13700:36;13791:1;13755:16;;13780:13;;;-1:-1:-1;13755:16:1;;13605:212;-1:-1:-1;13605:212:1:o;13822:425::-;14102:3;14130:57;14156:30;14182:3;14174:6;14156:30;:::i;:::-;14148:6;14130:57;:::i;:::-;-1:-1:-1;;;14196:19:1;;14239:1;14231:10;;13822:425;-1:-1:-1;;;;13822:425:1:o;15476:125::-;15541:9;;;15562:10;;;15559:36;;;15575:18;;:::i;16245:414::-;16447:2;16429:21;;;16486:2;16466:18;;;16459:30;16525:34;16520:2;16505:18;;16498:62;-1:-1:-1;;;16591:2:1;16576:18;;16569:48;16649:3;16634:19;;16245:414::o;18196:136::-;18235:3;18263:5;18253:39;;18272:18;;:::i;:::-;-1:-1:-1;;;18308:18:1;;18196:136::o;18337:496::-;-1:-1:-1;;;;;18568:32:1;;;18550:51;;18637:32;;18632:2;18617:18;;18610:60;18701:2;18686:18;;18679:34;;;18749:3;18744:2;18729:18;;18722:31;;;-1:-1:-1;;18770:57:1;;18807:19;;18799:6;18770:57;:::i;:::-;18762:65;18337:496;-1:-1:-1;;;;;;18337:496:1:o;18838:249::-;18907:6;18960:2;18948:9;18939:7;18935:23;18931:32;18928:52;;;18976:1;18973;18966:12;18928:52;19008:9;19002:16;19027:30;19051:5;19027:30;:::i;19756:112::-;19788:1;19814;19804:35;;19819:18;;:::i;:::-;-1:-1:-1;19853:9:1;;19756:112::o

Swarm Source

ipfs://f1506aaa26ca6fac8eeb851dda451b6278f7ad030664504e0a0b6a84be84143a

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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