ETH Price: $2,209.35 (+1.70%)

Token

Energy (EEE)
 

Overview

Max Total Supply

1,000,000,000 EEE

Holders

7

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Balance
1,650,000.007 EEE

Value
$0.00
0xb43509125b0ab1089d812c1f778bfd77b9996d53
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Energy

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2024-11-28
*/

// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol


// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

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

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

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

// File: @openzeppelin/contracts/token/ERC20/IERC20.sol


// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol


// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;


/**
 * @dev Interface for the optional metadata functions from the ERC-20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

// File: @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol


// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;

    /**
     * @dev The contract is already initialized.
     */
    error InvalidInitialization();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint64 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        // Cache values to avoid duplicated sloads
        bool isTopLevelCall = !$._initializing;
        uint64 initialized = $._initialized;

        // Allowed calls:
        // - initialSetup: the contract is not in the initializing state and no previous version was
        //                 initialized
        // - construction: the contract is initialized at version 1 (no reininitialization) and the
        //                 current contract is just being deployed
        bool initialSetup = initialized == 0 && isTopLevelCall;
        bool construction = initialized == 1 && address(this).code.length == 0;

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._initialized = 1;
        if (isTopLevelCall) {
            $._initializing = true;
        }
        _;
        if (isTopLevelCall) {
            $._initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._initialized = version;
        $._initializing = true;
        _;
        $._initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert InvalidInitialization();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint64) {
        return _getInitializableStorage()._initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _getInitializableStorage()._initializing;
    }

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        assembly {
            $.slot := INITIALIZABLE_STORAGE
        }
    }
}

// File: @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    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/interfaces/draft-IERC6093.sol


// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC-20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC-721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC-1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

// File: @openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol


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

pragma solidity ^0.8.20;






/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC-20
 * applications.
 */
abstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {
    /// @custom:storage-location erc7201:openzeppelin.storage.ERC20
    struct ERC20Storage {
        mapping(address account => uint256) _balances;

        mapping(address account => mapping(address spender => uint256)) _allowances;

        uint256 _totalSupply;

        string _name;
        string _symbol;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC20")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;

    function _getERC20Storage() private pure returns (ERC20Storage storage $) {
        assembly {
            $.slot := ERC20StorageLocation
        }
    }

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC20_init_unchained(name_, symbol_);
    }

    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        ERC20Storage storage $ = _getERC20Storage();
        $._name = name_;
        $._symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        ERC20Storage storage $ = _getERC20Storage();
        return $._name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        ERC20Storage storage $ = _getERC20Storage();
        return $._symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual returns (uint256) {
        ERC20Storage storage $ = _getERC20Storage();
        return $._totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual returns (uint256) {
        ERC20Storage storage $ = _getERC20Storage();
        return $._balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `value`.
     */
    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, value);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual returns (uint256) {
        ERC20Storage storage $ = _getERC20Storage();
        return $._allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, value);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Skips emitting an {Approval} event indicating an allowance update. This is not
     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `value`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `value`.
     */
    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _transfer(from, to, value);
        return true;
    }

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
     * this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        ERC20Storage storage $ = _getERC20Storage();
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            $._totalSupply += value;
        } else {
            uint256 fromBalance = $._balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                $._balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                $._totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                $._balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
     * true using the following override:
     *
     * ```solidity
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        ERC20Storage storage $ = _getERC20Storage();
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        $._allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `value`.
     *
     * Does not update the allowance value in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Does not emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }
}

// File: @openzeppelin/contracts/utils/cryptography/ECDSA.sol


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

pragma solidity ^0.8.20;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS
    }

    /**
     * @dev The signature derives the `address(0)`.
     */
    error ECDSAInvalidSignature();

    /**
     * @dev The signature has an invalid length.
     */
    error ECDSAInvalidSignatureLength(uint256 length);

    /**
     * @dev The signature has an S value that is in the upper half order.
     */
    error ECDSAInvalidSignatureS(bytes32 s);

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
     * return address(0) without also returning an error description. Errors are documented using an enum (error type)
     * and a bytes32 providing additional information about the error.
     *
     * If no error is returned, then the address can be used for verification purposes.
     *
     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     */
    function tryRecover(
        bytes32 hash,
        bytes memory signature
    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly ("memory-safe") {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {
        unchecked {
            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
            // We do not check for an overflow here since the shift operation results in 0 or 1.
            uint8 v = uint8((uint256(vs) >> 255) + 27);
            return tryRecover(hash, v, r, s);
        }
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS, s);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature, bytes32(0));
        }

        return (signer, RecoverError.NoError, bytes32(0));
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
     */
    function _throwError(RecoverError error, bytes32 errorArg) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert ECDSAInvalidSignature();
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert ECDSAInvalidSignatureLength(uint256(errorArg));
        } else if (error == RecoverError.InvalidSignatureS) {
            revert ECDSAInvalidSignatureS(errorArg);
        }
    }
}

// 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/utils/cryptography/MessageHashUtils.sol


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

pragma solidity ^0.8.20;


/**
 * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
 *
 * The library provides methods for generating a hash of a message that conforms to the
 * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
 * specifications.
 */
library MessageHashUtils {
    /**
     * @dev Returns the keccak256 digest of an ERC-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing a bytes32 `messageHash` with
     * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
     * keccak256, although any bytes32 value can be safely used because the final digest will
     * be re-hashed.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
        assembly ("memory-safe") {
            mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
        }
    }

    /**
     * @dev Returns the keccak256 digest of an ERC-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing an arbitrary `message` with
     * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
        return
            keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
    }

    /**
     * @dev Returns the keccak256 digest of an ERC-191 signed data with version
     * `0x00` (data with intended validator).
     *
     * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
     * `validator` address. Then hashing the result.
     *
     * See {ECDSA-recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(hex"19_00", validator, data));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).
     *
     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
     * `\x19\x01` and hashing the result. It corresponds to the hash signed by the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
     *
     * See {ECDSA-recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
        assembly ("memory-safe") {
            let ptr := mload(0x40)
            mstore(ptr, hex"19_01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            digest := keccak256(ptr, 0x42)
        }
    }
}

// File: @openzeppelin/contracts/interfaces/IERC5267.sol


// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)

pragma solidity ^0.8.20;

interface IERC5267 {
    /**
     * @dev MAY be emitted to signal that the domain could have changed.
     */
    event EIP712DomainChanged();

    /**
     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
     * signature.
     */
    function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );
}

// File: @openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol


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

pragma solidity ^0.8.20;




/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose
 * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract
 * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to
 * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
 * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
 * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
 */
abstract contract EIP712Upgradeable is Initializable, IERC5267 {
    bytes32 private constant TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    /// @custom:storage-location erc7201:openzeppelin.storage.EIP712
    struct EIP712Storage {
        /// @custom:oz-renamed-from _HASHED_NAME
        bytes32 _hashedName;
        /// @custom:oz-renamed-from _HASHED_VERSION
        bytes32 _hashedVersion;

        string _name;
        string _version;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.EIP712")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant EIP712StorageLocation = 0xa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100;

    function _getEIP712Storage() private pure returns (EIP712Storage storage $) {
        assembly {
            $.slot := EIP712StorageLocation
        }
    }

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    function __EIP712_init(string memory name, string memory version) internal onlyInitializing {
        __EIP712_init_unchained(name, version);
    }

    function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {
        EIP712Storage storage $ = _getEIP712Storage();
        $._name = name;
        $._version = version;

        // Reset prior values in storage if upgrading
        $._hashedName = 0;
        $._hashedVersion = 0;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        return _buildDomainSeparator();
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);
    }

    /**
     * @dev See {IERC-5267}.
     */
    function eip712Domain()
        public
        view
        virtual
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        EIP712Storage storage $ = _getEIP712Storage();
        // If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized
        // and the EIP712 domain is not reliable, as it will be missing name and version.
        require($._hashedName == 0 && $._hashedVersion == 0, "EIP712: Uninitialized");

        return (
            hex"0f", // 01111
            _EIP712Name(),
            _EIP712Version(),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }

    /**
     * @dev The name parameter for the EIP712 domain.
     *
     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
     * are a concern.
     */
    function _EIP712Name() internal view virtual returns (string memory) {
        EIP712Storage storage $ = _getEIP712Storage();
        return $._name;
    }

    /**
     * @dev The version parameter for the EIP712 domain.
     *
     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
     * are a concern.
     */
    function _EIP712Version() internal view virtual returns (string memory) {
        EIP712Storage storage $ = _getEIP712Storage();
        return $._version;
    }

    /**
     * @dev The hash of the name parameter for the EIP712 domain.
     *
     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.
     */
    function _EIP712NameHash() internal view returns (bytes32) {
        EIP712Storage storage $ = _getEIP712Storage();
        string memory name = _EIP712Name();
        if (bytes(name).length > 0) {
            return keccak256(bytes(name));
        } else {
            // If the name is empty, the contract may have been upgraded without initializing the new storage.
            // We return the name hash in storage if non-zero, otherwise we assume the name is empty by design.
            bytes32 hashedName = $._hashedName;
            if (hashedName != 0) {
                return hashedName;
            } else {
                return keccak256("");
            }
        }
    }

    /**
     * @dev The hash of the version parameter for the EIP712 domain.
     *
     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.
     */
    function _EIP712VersionHash() internal view returns (bytes32) {
        EIP712Storage storage $ = _getEIP712Storage();
        string memory version = _EIP712Version();
        if (bytes(version).length > 0) {
            return keccak256(bytes(version));
        } else {
            // If the version is empty, the contract may have been upgraded without initializing the new storage.
            // We return the version hash in storage if non-zero, otherwise we assume the version is empty by design.
            bytes32 hashedVersion = $._hashedVersion;
            if (hashedVersion != 0) {
                return hashedVersion;
            } else {
                return keccak256("");
            }
        }
    }
}

// File: @openzeppelin/contracts-upgradeable/utils/NoncesUpgradeable.sol


// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)
pragma solidity ^0.8.20;


/**
 * @dev Provides tracking nonces for addresses. Nonces will only increment.
 */
abstract contract NoncesUpgradeable is Initializable {
    /**
     * @dev The nonce used for an `account` is not the expected current nonce.
     */
    error InvalidAccountNonce(address account, uint256 currentNonce);

    /// @custom:storage-location erc7201:openzeppelin.storage.Nonces
    struct NoncesStorage {
        mapping(address account => uint256) _nonces;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Nonces")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant NoncesStorageLocation = 0x5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb00;

    function _getNoncesStorage() private pure returns (NoncesStorage storage $) {
        assembly {
            $.slot := NoncesStorageLocation
        }
    }

    function __Nonces_init() internal onlyInitializing {
    }

    function __Nonces_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev Returns the next unused nonce for an address.
     */
    function nonces(address owner) public view virtual returns (uint256) {
        NoncesStorage storage $ = _getNoncesStorage();
        return $._nonces[owner];
    }

    /**
     * @dev Consumes a nonce.
     *
     * Returns the current value and increments nonce.
     */
    function _useNonce(address owner) internal virtual returns (uint256) {
        NoncesStorage storage $ = _getNoncesStorage();
        // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be
        // decremented or reset. This guarantees that the nonce never overflows.
        unchecked {
            // It is important to do x++ and not ++x here.
            return $._nonces[owner]++;
        }
    }

    /**
     * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.
     */
    function _useCheckedNonce(address owner, uint256 nonce) internal virtual {
        uint256 current = _useNonce(owner);
        if (nonce != current) {
            revert InvalidAccountNonce(owner, current);
        }
    }
}

// File: @openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol


// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/ERC20Permit.sol)

pragma solidity ^0.8.20;







/**
 * @dev Implementation of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
abstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20Permit, EIP712Upgradeable, NoncesUpgradeable {
    bytes32 private constant PERMIT_TYPEHASH =
        keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");

    /**
     * @dev Permit deadline has expired.
     */
    error ERC2612ExpiredSignature(uint256 deadline);

    /**
     * @dev Mismatched signature.
     */
    error ERC2612InvalidSigner(address signer, address owner);

    /**
     * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`.
     *
     * It's a good idea to use the same `name` that is defined as the ERC-20 token name.
     */
    function __ERC20Permit_init(string memory name) internal onlyInitializing {
        __EIP712_init_unchained(name, "1");
    }

    function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}

    /**
     * @inheritdoc IERC20Permit
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        if (block.timestamp > deadline) {
            revert ERC2612ExpiredSignature(deadline);
        }

        bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));

        bytes32 hash = _hashTypedDataV4(structHash);

        address signer = ECDSA.recover(hash, v, r, s);
        if (signer != owner) {
            revert ERC2612InvalidSigner(signer, owner);
        }

        _approve(owner, spender, value);
    }

    /**
     * @inheritdoc IERC20Permit
     */
    function nonces(address owner) public view virtual override(IERC20Permit, NoncesUpgradeable) returns (uint256) {
        return super.nonces(owner);
    }

    /**
     * @inheritdoc IERC20Permit
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view virtual returns (bytes32) {
        return _domainSeparatorV4();
    }
}

// File: @openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol


// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-ERC20Permit.sol)

pragma solidity ^0.8.0;

// EIP-2612 is Final as of 2022-11-01. This file is deprecated.


// File: @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable
    struct OwnableStorage {
        address _owner;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;

    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
        assembly {
            $.slot := OwnableStorageLocation
        }
    }

    /**
     * @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.
     */
    function __Ownable_init(address initialOwner) internal onlyInitializing {
        __Ownable_init_unchained(initialOwner);
    }

    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
        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) {
        OwnableStorage storage $ = _getOwnableStorage();
        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 {
        OwnableStorage storage $ = _getOwnableStorage();
        address oldOwner = $._owner;
        $._owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// File: EEEv4.sol


pragma solidity ^0.8.20;




contract Energy is Initializable, ERC20PermitUpgradeable, OwnableUpgradeable {
    uint256 public constant MAX_SUPPLY = 1_500_000_000 * 10**18; // 1.5 Billion tokens with 18 decimals
    bool public mintingPaused;
    bool public paused;
    address public recoveryAddress;
    address public treasury;
    uint256 public feePercentage; // In basis points (e.g., 100 = 1%)

    event TreasuryUpdated(address indexed previousTreasury, address indexed newTreasury);
    event FeePercentageUpdated(uint256 previousFee, uint256 newFee);

    /// @dev Initializes the contract with initial supply and owner.
    function initialize(address owner, uint256 initialSupply, address _recoveryAddress) public initializer {
        __ERC20_init("Energy", "EEE");
        __ERC20Permit_init("Energy");
        __Ownable_init(0x6aD7Ed2B9d0C64b1aFe846191a4A95c44FAa0CDC);

        _mint(owner, initialSupply * 10**18); // Mint initial supply to owner with 18 decimals
        recoveryAddress = _recoveryAddress; // Set recovery address
        feePercentage = 0; // Default fee set to 0%
    }

    modifier whenNotPaused() {
        require(!paused, "Token operations are paused");
        _;
    }

    /// @dev Mint new tokens to the specified address. Only callable by the owner.
    function mint(address to, uint256 amount) external onlyOwner whenNotPaused {
        require(!mintingPaused, "Minting is paused");
        require(totalSupply() + amount <= MAX_SUPPLY, "Exceeds MAX_SUPPLY");
        _mint(to, amount);
    }

    /// @dev Burn tokens from the caller's balance.
    function burn(uint256 amount) external whenNotPaused {
        _burn(msg.sender, amount);
    }

    /// @dev Toggles the minting pause state.
    function toggleMintingPause() external onlyOwner {
        mintingPaused = !mintingPaused;
    }

    /// @dev Pauses all token operations.
    function pause() external onlyOwner {
        paused = true;
    }

    /// @dev Resumes all token operations.
    function unpause() external onlyOwner {
        paused = false;
    }

    /// @dev Sets the recovery address for emergency fund recovery.
    function setRecoveryAddress(address newRecoveryAddress) external onlyOwner {
        require(newRecoveryAddress != address(0), "Invalid address");
        recoveryAddress = newRecoveryAddress;
    }

    /// @dev Sets the treasury address for fee collection.
    function setTreasury(address newTreasury) external onlyOwner {
        require(newTreasury != address(0), "Invalid treasury address");
        emit TreasuryUpdated(treasury, newTreasury);
        treasury = newTreasury;
    }

    /// @dev Sets the fee percentage for transfers.
    function setFeePercentage(uint256 newFeePercentage) external onlyOwner {
        require(newFeePercentage <= 500, "Fee cannot exceed 5%"); // Max fee is 5%
        emit FeePercentageUpdated(feePercentage, newFeePercentage);
        feePercentage = newFeePercentage;
    }

    /// @dev Overrides the transfer function to implement fee and pause logic.
    function transfer(address recipient, uint256 amount) public virtual override whenNotPaused returns (bool) {
        uint256 fee = (amount * feePercentage) / 10000; // Calculate fee
        uint256 amountAfterFee = amount - fee;

        if (fee > 0 && treasury != address(0)) {
            _transfer(_msgSender(), treasury, fee); // Transfer fee to treasury
        }

        _transfer(_msgSender(), recipient, amountAfterFee); // Transfer remaining amount to recipient
        return true;
    }

    /// @dev Overrides the transferFrom function to implement fee and pause logic.
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override whenNotPaused returns (bool) {
        uint256 fee = (amount * feePercentage) / 10000; // Calculate fee
        uint256 amountAfterFee = amount - fee;

        if (fee > 0 && treasury != address(0)) {
            _transfer(sender, treasury, fee); // Transfer fee to treasury
        }

        _transfer(sender, recipient, amountAfterFee); // Transfer remaining amount to recipient

        uint256 currentAllowance = allowance(sender, _msgSender());
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        _approve(sender, _msgSender(), currentAllowance - amount);
        return true;
    }

    /// @dev Recovers funds (ETH or ERC20 tokens) sent to the contract.
    function recoverFunds(address tokenAddress) external onlyOwner {
        require(recoveryAddress != address(0), "Recovery address not set");
        if (tokenAddress == address(0)) {
            payable(recoveryAddress).transfer(address(this).balance);
        } else {
            ERC20Upgradeable(tokenAddress).transfer(recoveryAddress, ERC20Upgradeable(tokenAddress).balanceOf(address(this)));
        }
    }

    /// @dev Allows the contract to receive ETH.
    receive() external payable {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"ERC2612ExpiredSignature","type":"error"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC2612InvalidSigner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"currentNonce","type":"uint256"}],"name":"InvalidAccountNonce","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","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":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"FeePercentageUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","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":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousTreasury","type":"address"},{"indexed":true,"internalType":"address","name":"newTreasury","type":"address"}],"name":"TreasuryUpdated","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"address","name":"_recoveryAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintingPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"recoverFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"recoveryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFeePercentage","type":"uint256"}],"name":"setFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRecoveryAddress","type":"address"}],"name":"setRecoveryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTreasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleMintingPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052348015600e575f5ffd5b50611fda8061001c5f395ff3fe6080604052600436106101de575f3560e01c80637ecebe00116100fd578063c189e64311610092578063e1a283d611610062578063e1a283d614610578578063e72f6e3014610590578063f0f44260146105af578063f2fde38b146105ce575f5ffd5b8063c189e64314610507578063c350a1b51461051b578063d505accf1461053a578063dd62ed3e14610559575f5ffd5b806395d89b41116100cd57806395d89b41146104a0578063a001ecdd146104b4578063a9059cbb146104c9578063ae06c1b7146104e8575f5ffd5b80637ecebe001461040a5780638456cb591461042957806384b0196e1461043d5780638da5cb5b14610464575f5ffd5b806340c10f191161017357806361d027b31161014357806361d027b31461037c57806370a08231146103b3578063710eb26c146103d2578063715018a6146103f6575f5ffd5b806340c10f191461030257806342966c681461032157806349efe5ae146103405780635c975abb1461035f575f5ffd5b8063313ce567116101ae578063313ce5671461029e57806332cb6b0c146102b95780633644e515146102d85780633f4ba83a146102ec575f5ffd5b806306fdde03146101e9578063095ea7b31461021357806318160ddd1461024257806323b872dd1461027f575f5ffd5b366101e557005b5f5ffd5b3480156101f4575f5ffd5b506101fd6105ed565b60405161020a9190611af5565b60405180910390f35b34801561021e575f5ffd5b5061023261022d366004611b29565b610692565b604051901515815260200161020a565b34801561024d575f5ffd5b507f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02545b60405190815260200161020a565b34801561028a575f5ffd5b50610232610299366004611b51565b6106ab565b3480156102a9575f5ffd5b506040516012815260200161020a565b3480156102c4575f5ffd5b506102716b04d8c55aefb8c05b5c00000081565b3480156102e3575f5ffd5b506102716107d7565b3480156102f7575f5ffd5b506103006107e5565b005b34801561030d575f5ffd5b5061030061031c366004611b29565b6107f9565b34801561032c575f5ffd5b5061030061033b366004611b8b565b6108ff565b34801561034b575f5ffd5b5061030061035a366004611ba2565b610933565b34801561036a575f5ffd5b505f5461023290610100900460ff1681565b348015610387575f5ffd5b5060015461039b906001600160a01b031681565b6040516001600160a01b03909116815260200161020a565b3480156103be575f5ffd5b506102716103cd366004611ba2565b6109ac565b3480156103dd575f5ffd5b505f5461039b906201000090046001600160a01b031681565b348015610401575f5ffd5b506103006109dc565b348015610415575f5ffd5b50610271610424366004611ba2565b6109ef565b348015610434575f5ffd5b506103006109f9565b348015610448575f5ffd5b50610451610a11565b60405161020a9796959493929190611bbb565b34801561046f575f5ffd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031661039b565b3480156104ab575f5ffd5b506101fd610aba565b3480156104bf575f5ffd5b5061027160025481565b3480156104d4575f5ffd5b506102326104e3366004611b29565b610af8565b3480156104f3575f5ffd5b50610300610502366004611b8b565b610b95565b348015610512575f5ffd5b50610300610c27565b348015610526575f5ffd5b50610300610535366004611c51565b610c42565b348015610545575f5ffd5b50610300610554366004611c8a565b610e0f565b348015610564575f5ffd5b50610271610573366004611cf7565b610f64565b348015610583575f5ffd5b505f546102329060ff1681565b34801561059b575f5ffd5b506103006105aa366004611ba2565b610fad565b3480156105ba575f5ffd5b506103006105c9366004611ba2565b611147565b3480156105d9575f5ffd5b506103006105e8366004611ba2565b611200565b60605f5f516020611f655f395f51905f525b905080600301805461061090611d28565b80601f016020809104026020016040519081016040528092919081815260200182805461063c90611d28565b80156106875780601f1061065e57610100808354040283529160200191610687565b820191905f5260205f20905b81548152906001019060200180831161066a57829003601f168201915b505050505091505090565b5f3361069f81858561123a565b60019150505b92915050565b5f8054610100900460ff16156106dc5760405162461bcd60e51b81526004016106d390611d60565b60405180910390fd5b5f612710600254846106ee9190611dab565b6106f89190611dc2565b90505f6107058285611de1565b90505f8211801561072057506001546001600160a01b031615155b1561073d5760015461073d9087906001600160a01b03168461124c565b61074886868361124c565b5f6107538733610f64565b9050848110156107b65760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016106d3565b6107ca87336107c58885611de1565b61123a565b5060019695505050505050565b5f6107e06112a9565b905090565b6107ed6112b2565b5f805461ff0019169055565b6108016112b2565b5f54610100900460ff16156108285760405162461bcd60e51b81526004016106d390611d60565b5f5460ff161561086e5760405162461bcd60e51b8152602060048201526011602482015270135a5b9d1a5b99c81a5cc81c185d5cd959607a1b60448201526064016106d3565b6b04d8c55aefb8c05b5c000000816108a47f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace025490565b6108ae9190611df4565b11156108f15760405162461bcd60e51b815260206004820152601260248201527145786365656473204d41585f535550504c5960701b60448201526064016106d3565b6108fb828261130d565b5050565b5f54610100900460ff16156109265760405162461bcd60e51b81526004016106d390611d60565b6109303382611341565b50565b61093b6112b2565b6001600160a01b0381166109835760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016106d3565b5f80546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b5f805f516020611f655f395f51905f525b6001600160a01b039093165f9081526020939093525050604090205490565b6109e46112b2565b6109ed5f611375565b565b5f6106a5826113e5565b610a016112b2565b5f805461ff001916610100179055565b5f60608082808083815f516020611f855f395f51905f528054909150158015610a3c57506001810154155b610a805760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016106d3565b610a8861140d565b610a9061144b565b604080515f80825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0480546060915f516020611f655f395f51905f529161061090611d28565b5f8054610100900460ff1615610b205760405162461bcd60e51b81526004016106d390611d60565b5f61271060025484610b329190611dab565b610b3c9190611dc2565b90505f610b498285611de1565b90505f82118015610b6457506001546001600160a01b031615155b15610b7f57610b7f336001546001600160a01b03168461124c565b610b8a33868361124c565b506001949350505050565b610b9d6112b2565b6101f4811115610be65760405162461bcd60e51b81526020600482015260146024820152734665652063616e6e6f742065786365656420352560601b60448201526064016106d3565b60025460408051918252602082018390527fb27c12a91635e11c22bffa7bd8e0a8735da52b94aaefd7f249776c7590ba7894910160405180910390a1600255565b610c2f6112b2565b5f805460ff19811660ff90911615179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff165f81158015610c875750825b90505f8267ffffffffffffffff166001148015610ca35750303b155b905081158015610cb1575080155b15610ccf5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610cf957845460ff60401b1916600160401b1785555b610d3c60405180604001604052806006815260200165456e6572677960d01b8152506040518060400160405280600381526020016245454560e81b815250611461565b610d6360405180604001604052806006815260200165456e6572677960d01b815250611473565b610d80736ad7ed2b9d0c64b1afe846191a4a95c44faa0cdc61149e565b610d9b88610d9689670de0b6b3a7640000611dab565b61130d565b5f805462010000600160b01b031916620100006001600160a01b038916021781556002558315610e0557845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050565b83421115610e335760405163313c898160e11b8152600481018590526024016106d3565b5f7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610e9d8c6001600160a01b03165f9081527f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb006020526040902080546001810190915590565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090505f610ef7826114af565b90505f610f06828787876114db565b9050896001600160a01b0316816001600160a01b031614610f4d576040516325c0072360e11b81526001600160a01b0380831660048301528b1660248201526044016106d3565b610f588a8a8a61123a565b50505050505050505050565b6001600160a01b039182165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020908152604080832093909416825291909152205490565b610fb56112b2565b5f546201000090046001600160a01b03166110125760405162461bcd60e51b815260206004820152601860248201527f5265636f766572792061646472657373206e6f7420736574000000000000000060448201526064016106d3565b6001600160a01b03811661105f575f80546040516001600160a01b036201000090920491909116914780156108fc02929091818181858888f193505050501580156108fb573d5f5f3e3d5ffd5b5f546040516370a0823160e01b81523060048201526001600160a01b038381169263a9059cbb92620100009091049091169083906370a0823190602401602060405180830381865afa1580156110b7573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110db9190611e1b565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303815f875af1158015611123573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108fb9190611e32565b61114f6112b2565b6001600160a01b0381166111a55760405162461bcd60e51b815260206004820152601860248201527f496e76616c69642074726561737572792061646472657373000000000000000060448201526064016106d3565b6001546040516001600160a01b038084169216907f4ab5be82436d353e61ca18726e984e561f5c1cc7c6d38b29d2553c790434705a905f90a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6112086112b2565b6001600160a01b03811661123157604051631e4fbdf760e01b81525f60048201526024016106d3565b61093081611375565b6112478383836001611507565b505050565b6001600160a01b03831661127557604051634b637e8f60e11b81525f60048201526024016106d3565b6001600160a01b03821661129e5760405163ec442f0560e01b81525f60048201526024016106d3565b6112478383836115eb565b5f6107e0611724565b336112e47f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146109ed5760405163118cdaa760e01b81523360048201526024016106d3565b6001600160a01b0382166113365760405163ec442f0560e01b81525f60048201526024016106d3565b6108fb5f83836115eb565b6001600160a01b03821661136a57604051634b637e8f60e11b81525f60048201526024016106d3565b6108fb825f836115eb565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b5f807f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb006109bd565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10280546060915f516020611f855f395f51905f529161061090611d28565b60605f5f516020611f855f395f51905f526105ff565b611469611797565b6108fb82826117e0565b61147b611797565b61093081604051806040016040528060018152602001603160f81b815250611836565b6114a6611797565b61093081611895565b5f6106a56114bb6112a9565b8360405161190160f01b8152600281019290925260228201526042902090565b5f5f5f5f6114eb8888888861189d565b9250925092506114fb8282611965565b50909695505050505050565b5f516020611f655f395f51905f526001600160a01b03851661153e5760405163e602df0560e01b81525f60048201526024016106d3565b6001600160a01b03841661156757604051634a1406b160e11b81525f60048201526024016106d3565b6001600160a01b038086165f908152600183016020908152604080832093881683529290522083905581156115e457836001600160a01b0316856001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040516115db91815260200190565b60405180910390a35b5050505050565b5f516020611f655f395f51905f526001600160a01b0384166116255781816002015f82825461161a9190611df4565b909155506116959050565b6001600160a01b0384165f90815260208290526040902054828110156116775760405163391434e360e21b81526001600160a01b038616600482015260248101829052604481018490526064016106d3565b6001600160a01b0385165f9081526020839052604090209083900390555b6001600160a01b0383166116b35760028101805483900390556116d1565b6001600160a01b0383165f9081526020829052604090208054830190555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161171691815260200190565b60405180910390a350505050565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61174e611a1d565b611756611a85565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166109ed57604051631afcd79f60e31b815260040160405180910390fd5b6117e8611797565b5f516020611f655f395f51905f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace036118218482611e95565b50600481016118308382611e95565b50505050565b61183e611797565b5f516020611f855f395f51905f527fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1026118778482611e95565b50600381016118868382611e95565b505f8082556001909101555050565b611208611797565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156118d657505f9150600390508261195b565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611927573d5f5f3e3d5ffd5b5050604051601f1901519150506001600160a01b03811661195257505f92506001915082905061195b565b92505f91508190505b9450945094915050565b5f82600381111561197857611978611f50565b03611981575050565b600182600381111561199557611995611f50565b036119b35760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156119c7576119c7611f50565b036119e85760405163fce698f760e01b8152600481018290526024016106d3565b60038260038111156119fc576119fc611f50565b036108fb576040516335e2f38360e21b8152600481018290526024016106d3565b5f5f516020611f855f395f51905f5281611a3561140d565b805190915015611a4d57805160209091012092915050565b81548015611a5c579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b5f5f516020611f855f395f51905f5281611a9d61144b565b805190915015611ab557805160209091012092915050565b60018201548015611a5c579392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611b076020830184611ac7565b9392505050565b80356001600160a01b0381168114611b24575f5ffd5b919050565b5f5f60408385031215611b3a575f5ffd5b611b4383611b0e565b946020939093013593505050565b5f5f5f60608486031215611b63575f5ffd5b611b6c84611b0e565b9250611b7a60208501611b0e565b929592945050506040919091013590565b5f60208284031215611b9b575f5ffd5b5035919050565b5f60208284031215611bb2575f5ffd5b611b0782611b0e565b60ff60f81b8816815260e060208201525f611bd960e0830189611ac7565b8281036040840152611beb8189611ac7565b606084018890526001600160a01b038716608085015260a0840186905283810360c0850152845180825260208087019350909101905f5b81811015611c40578351835260209384019390920191600101611c22565b50909b9a5050505050505050505050565b5f5f5f60608486031215611c63575f5ffd5b611c6c84611b0e565b925060208401359150611c8160408501611b0e565b90509250925092565b5f5f5f5f5f5f5f60e0888a031215611ca0575f5ffd5b611ca988611b0e565b9650611cb760208901611b0e565b95506040880135945060608801359350608088013560ff81168114611cda575f5ffd5b9699959850939692959460a0840135945060c09093013592915050565b5f5f60408385031215611d08575f5ffd5b611d1183611b0e565b9150611d1f60208401611b0e565b90509250929050565b600181811c90821680611d3c57607f821691505b602082108103611d5a57634e487b7160e01b5f52602260045260245ffd5b50919050565b6020808252601b908201527f546f6b656e206f7065726174696f6e7320617265207061757365640000000000604082015260600190565b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176106a5576106a5611d97565b5f82611ddc57634e487b7160e01b5f52601260045260245ffd5b500490565b818103818111156106a5576106a5611d97565b808201808211156106a5576106a5611d97565b634e487b7160e01b5f52604160045260245ffd5b5f60208284031215611e2b575f5ffd5b5051919050565b5f60208284031215611e42575f5ffd5b81518015158114611b07575f5ffd5b601f82111561124757805f5260205f20601f840160051c81016020851015611e765750805b601f840160051c820191505b818110156115e4575f8155600101611e82565b815167ffffffffffffffff811115611eaf57611eaf611e07565b611ec381611ebd8454611d28565b84611e51565b6020601f821160018114611ef5575f8315611ede5750848201515b5f19600385901b1c1916600184901b1784556115e4565b5f84815260208120601f198516915b82811015611f245787850151825560209485019460019092019101611f04565b5084821015611f4157868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b634e487b7160e01b5f52602160045260245ffdfe52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100a2646970667358221220a4f372ab9b9dabce6c9ed6f716854b7b635ec2e5a241e7b3b80b6b85e35c6b2164736f6c634300081c0033

Deployed Bytecode

0x6080604052600436106101de575f3560e01c80637ecebe00116100fd578063c189e64311610092578063e1a283d611610062578063e1a283d614610578578063e72f6e3014610590578063f0f44260146105af578063f2fde38b146105ce575f5ffd5b8063c189e64314610507578063c350a1b51461051b578063d505accf1461053a578063dd62ed3e14610559575f5ffd5b806395d89b41116100cd57806395d89b41146104a0578063a001ecdd146104b4578063a9059cbb146104c9578063ae06c1b7146104e8575f5ffd5b80637ecebe001461040a5780638456cb591461042957806384b0196e1461043d5780638da5cb5b14610464575f5ffd5b806340c10f191161017357806361d027b31161014357806361d027b31461037c57806370a08231146103b3578063710eb26c146103d2578063715018a6146103f6575f5ffd5b806340c10f191461030257806342966c681461032157806349efe5ae146103405780635c975abb1461035f575f5ffd5b8063313ce567116101ae578063313ce5671461029e57806332cb6b0c146102b95780633644e515146102d85780633f4ba83a146102ec575f5ffd5b806306fdde03146101e9578063095ea7b31461021357806318160ddd1461024257806323b872dd1461027f575f5ffd5b366101e557005b5f5ffd5b3480156101f4575f5ffd5b506101fd6105ed565b60405161020a9190611af5565b60405180910390f35b34801561021e575f5ffd5b5061023261022d366004611b29565b610692565b604051901515815260200161020a565b34801561024d575f5ffd5b507f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02545b60405190815260200161020a565b34801561028a575f5ffd5b50610232610299366004611b51565b6106ab565b3480156102a9575f5ffd5b506040516012815260200161020a565b3480156102c4575f5ffd5b506102716b04d8c55aefb8c05b5c00000081565b3480156102e3575f5ffd5b506102716107d7565b3480156102f7575f5ffd5b506103006107e5565b005b34801561030d575f5ffd5b5061030061031c366004611b29565b6107f9565b34801561032c575f5ffd5b5061030061033b366004611b8b565b6108ff565b34801561034b575f5ffd5b5061030061035a366004611ba2565b610933565b34801561036a575f5ffd5b505f5461023290610100900460ff1681565b348015610387575f5ffd5b5060015461039b906001600160a01b031681565b6040516001600160a01b03909116815260200161020a565b3480156103be575f5ffd5b506102716103cd366004611ba2565b6109ac565b3480156103dd575f5ffd5b505f5461039b906201000090046001600160a01b031681565b348015610401575f5ffd5b506103006109dc565b348015610415575f5ffd5b50610271610424366004611ba2565b6109ef565b348015610434575f5ffd5b506103006109f9565b348015610448575f5ffd5b50610451610a11565b60405161020a9796959493929190611bbb565b34801561046f575f5ffd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031661039b565b3480156104ab575f5ffd5b506101fd610aba565b3480156104bf575f5ffd5b5061027160025481565b3480156104d4575f5ffd5b506102326104e3366004611b29565b610af8565b3480156104f3575f5ffd5b50610300610502366004611b8b565b610b95565b348015610512575f5ffd5b50610300610c27565b348015610526575f5ffd5b50610300610535366004611c51565b610c42565b348015610545575f5ffd5b50610300610554366004611c8a565b610e0f565b348015610564575f5ffd5b50610271610573366004611cf7565b610f64565b348015610583575f5ffd5b505f546102329060ff1681565b34801561059b575f5ffd5b506103006105aa366004611ba2565b610fad565b3480156105ba575f5ffd5b506103006105c9366004611ba2565b611147565b3480156105d9575f5ffd5b506103006105e8366004611ba2565b611200565b60605f5f516020611f655f395f51905f525b905080600301805461061090611d28565b80601f016020809104026020016040519081016040528092919081815260200182805461063c90611d28565b80156106875780601f1061065e57610100808354040283529160200191610687565b820191905f5260205f20905b81548152906001019060200180831161066a57829003601f168201915b505050505091505090565b5f3361069f81858561123a565b60019150505b92915050565b5f8054610100900460ff16156106dc5760405162461bcd60e51b81526004016106d390611d60565b60405180910390fd5b5f612710600254846106ee9190611dab565b6106f89190611dc2565b90505f6107058285611de1565b90505f8211801561072057506001546001600160a01b031615155b1561073d5760015461073d9087906001600160a01b03168461124c565b61074886868361124c565b5f6107538733610f64565b9050848110156107b65760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016106d3565b6107ca87336107c58885611de1565b61123a565b5060019695505050505050565b5f6107e06112a9565b905090565b6107ed6112b2565b5f805461ff0019169055565b6108016112b2565b5f54610100900460ff16156108285760405162461bcd60e51b81526004016106d390611d60565b5f5460ff161561086e5760405162461bcd60e51b8152602060048201526011602482015270135a5b9d1a5b99c81a5cc81c185d5cd959607a1b60448201526064016106d3565b6b04d8c55aefb8c05b5c000000816108a47f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace025490565b6108ae9190611df4565b11156108f15760405162461bcd60e51b815260206004820152601260248201527145786365656473204d41585f535550504c5960701b60448201526064016106d3565b6108fb828261130d565b5050565b5f54610100900460ff16156109265760405162461bcd60e51b81526004016106d390611d60565b6109303382611341565b50565b61093b6112b2565b6001600160a01b0381166109835760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016106d3565b5f80546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b5f805f516020611f655f395f51905f525b6001600160a01b039093165f9081526020939093525050604090205490565b6109e46112b2565b6109ed5f611375565b565b5f6106a5826113e5565b610a016112b2565b5f805461ff001916610100179055565b5f60608082808083815f516020611f855f395f51905f528054909150158015610a3c57506001810154155b610a805760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016106d3565b610a8861140d565b610a9061144b565b604080515f80825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0480546060915f516020611f655f395f51905f529161061090611d28565b5f8054610100900460ff1615610b205760405162461bcd60e51b81526004016106d390611d60565b5f61271060025484610b329190611dab565b610b3c9190611dc2565b90505f610b498285611de1565b90505f82118015610b6457506001546001600160a01b031615155b15610b7f57610b7f336001546001600160a01b03168461124c565b610b8a33868361124c565b506001949350505050565b610b9d6112b2565b6101f4811115610be65760405162461bcd60e51b81526020600482015260146024820152734665652063616e6e6f742065786365656420352560601b60448201526064016106d3565b60025460408051918252602082018390527fb27c12a91635e11c22bffa7bd8e0a8735da52b94aaefd7f249776c7590ba7894910160405180910390a1600255565b610c2f6112b2565b5f805460ff19811660ff90911615179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff165f81158015610c875750825b90505f8267ffffffffffffffff166001148015610ca35750303b155b905081158015610cb1575080155b15610ccf5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610cf957845460ff60401b1916600160401b1785555b610d3c60405180604001604052806006815260200165456e6572677960d01b8152506040518060400160405280600381526020016245454560e81b815250611461565b610d6360405180604001604052806006815260200165456e6572677960d01b815250611473565b610d80736ad7ed2b9d0c64b1afe846191a4a95c44faa0cdc61149e565b610d9b88610d9689670de0b6b3a7640000611dab565b61130d565b5f805462010000600160b01b031916620100006001600160a01b038916021781556002558315610e0557845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050565b83421115610e335760405163313c898160e11b8152600481018590526024016106d3565b5f7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610e9d8c6001600160a01b03165f9081527f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb006020526040902080546001810190915590565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090505f610ef7826114af565b90505f610f06828787876114db565b9050896001600160a01b0316816001600160a01b031614610f4d576040516325c0072360e11b81526001600160a01b0380831660048301528b1660248201526044016106d3565b610f588a8a8a61123a565b50505050505050505050565b6001600160a01b039182165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020908152604080832093909416825291909152205490565b610fb56112b2565b5f546201000090046001600160a01b03166110125760405162461bcd60e51b815260206004820152601860248201527f5265636f766572792061646472657373206e6f7420736574000000000000000060448201526064016106d3565b6001600160a01b03811661105f575f80546040516001600160a01b036201000090920491909116914780156108fc02929091818181858888f193505050501580156108fb573d5f5f3e3d5ffd5b5f546040516370a0823160e01b81523060048201526001600160a01b038381169263a9059cbb92620100009091049091169083906370a0823190602401602060405180830381865afa1580156110b7573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110db9190611e1b565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303815f875af1158015611123573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108fb9190611e32565b61114f6112b2565b6001600160a01b0381166111a55760405162461bcd60e51b815260206004820152601860248201527f496e76616c69642074726561737572792061646472657373000000000000000060448201526064016106d3565b6001546040516001600160a01b038084169216907f4ab5be82436d353e61ca18726e984e561f5c1cc7c6d38b29d2553c790434705a905f90a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6112086112b2565b6001600160a01b03811661123157604051631e4fbdf760e01b81525f60048201526024016106d3565b61093081611375565b6112478383836001611507565b505050565b6001600160a01b03831661127557604051634b637e8f60e11b81525f60048201526024016106d3565b6001600160a01b03821661129e5760405163ec442f0560e01b81525f60048201526024016106d3565b6112478383836115eb565b5f6107e0611724565b336112e47f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146109ed5760405163118cdaa760e01b81523360048201526024016106d3565b6001600160a01b0382166113365760405163ec442f0560e01b81525f60048201526024016106d3565b6108fb5f83836115eb565b6001600160a01b03821661136a57604051634b637e8f60e11b81525f60048201526024016106d3565b6108fb825f836115eb565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b5f807f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb006109bd565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10280546060915f516020611f855f395f51905f529161061090611d28565b60605f5f516020611f855f395f51905f526105ff565b611469611797565b6108fb82826117e0565b61147b611797565b61093081604051806040016040528060018152602001603160f81b815250611836565b6114a6611797565b61093081611895565b5f6106a56114bb6112a9565b8360405161190160f01b8152600281019290925260228201526042902090565b5f5f5f5f6114eb8888888861189d565b9250925092506114fb8282611965565b50909695505050505050565b5f516020611f655f395f51905f526001600160a01b03851661153e5760405163e602df0560e01b81525f60048201526024016106d3565b6001600160a01b03841661156757604051634a1406b160e11b81525f60048201526024016106d3565b6001600160a01b038086165f908152600183016020908152604080832093881683529290522083905581156115e457836001600160a01b0316856001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040516115db91815260200190565b60405180910390a35b5050505050565b5f516020611f655f395f51905f526001600160a01b0384166116255781816002015f82825461161a9190611df4565b909155506116959050565b6001600160a01b0384165f90815260208290526040902054828110156116775760405163391434e360e21b81526001600160a01b038616600482015260248101829052604481018490526064016106d3565b6001600160a01b0385165f9081526020839052604090209083900390555b6001600160a01b0383166116b35760028101805483900390556116d1565b6001600160a01b0383165f9081526020829052604090208054830190555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161171691815260200190565b60405180910390a350505050565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61174e611a1d565b611756611a85565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166109ed57604051631afcd79f60e31b815260040160405180910390fd5b6117e8611797565b5f516020611f655f395f51905f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace036118218482611e95565b50600481016118308382611e95565b50505050565b61183e611797565b5f516020611f855f395f51905f527fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1026118778482611e95565b50600381016118868382611e95565b505f8082556001909101555050565b611208611797565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156118d657505f9150600390508261195b565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611927573d5f5f3e3d5ffd5b5050604051601f1901519150506001600160a01b03811661195257505f92506001915082905061195b565b92505f91508190505b9450945094915050565b5f82600381111561197857611978611f50565b03611981575050565b600182600381111561199557611995611f50565b036119b35760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156119c7576119c7611f50565b036119e85760405163fce698f760e01b8152600481018290526024016106d3565b60038260038111156119fc576119fc611f50565b036108fb576040516335e2f38360e21b8152600481018290526024016106d3565b5f5f516020611f855f395f51905f5281611a3561140d565b805190915015611a4d57805160209091012092915050565b81548015611a5c579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b5f5f516020611f855f395f51905f5281611a9d61144b565b805190915015611ab557805160209091012092915050565b60018201548015611a5c579392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611b076020830184611ac7565b9392505050565b80356001600160a01b0381168114611b24575f5ffd5b919050565b5f5f60408385031215611b3a575f5ffd5b611b4383611b0e565b946020939093013593505050565b5f5f5f60608486031215611b63575f5ffd5b611b6c84611b0e565b9250611b7a60208501611b0e565b929592945050506040919091013590565b5f60208284031215611b9b575f5ffd5b5035919050565b5f60208284031215611bb2575f5ffd5b611b0782611b0e565b60ff60f81b8816815260e060208201525f611bd960e0830189611ac7565b8281036040840152611beb8189611ac7565b606084018890526001600160a01b038716608085015260a0840186905283810360c0850152845180825260208087019350909101905f5b81811015611c40578351835260209384019390920191600101611c22565b50909b9a5050505050505050505050565b5f5f5f60608486031215611c63575f5ffd5b611c6c84611b0e565b925060208401359150611c8160408501611b0e565b90509250925092565b5f5f5f5f5f5f5f60e0888a031215611ca0575f5ffd5b611ca988611b0e565b9650611cb760208901611b0e565b95506040880135945060608801359350608088013560ff81168114611cda575f5ffd5b9699959850939692959460a0840135945060c09093013592915050565b5f5f60408385031215611d08575f5ffd5b611d1183611b0e565b9150611d1f60208401611b0e565b90509250929050565b600181811c90821680611d3c57607f821691505b602082108103611d5a57634e487b7160e01b5f52602260045260245ffd5b50919050565b6020808252601b908201527f546f6b656e206f7065726174696f6e7320617265207061757365640000000000604082015260600190565b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176106a5576106a5611d97565b5f82611ddc57634e487b7160e01b5f52601260045260245ffd5b500490565b818103818111156106a5576106a5611d97565b808201808211156106a5576106a5611d97565b634e487b7160e01b5f52604160045260245ffd5b5f60208284031215611e2b575f5ffd5b5051919050565b5f60208284031215611e42575f5ffd5b81518015158114611b07575f5ffd5b601f82111561124757805f5260205f20601f840160051c81016020851015611e765750805b601f840160051c820191505b818110156115e4575f8155600101611e82565b815167ffffffffffffffff811115611eaf57611eaf611e07565b611ec381611ebd8454611d28565b84611e51565b6020601f821160018114611ef5575f8315611ede5750848201515b5f19600385901b1c1916600184901b1784556115e4565b5f84815260208120601f198516915b82811015611f245787850151825560209485019460019092019101611f04565b5084821015611f4157868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b634e487b7160e01b5f52602160045260245ffdfe52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100a2646970667358221220a4f372ab9b9dabce6c9ed6f716854b7b635ec2e5a241e7b3b80b6b85e35c6b2164736f6c634300081c0033

Deployed Bytecode Sourcemap

141748:5030:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27135:147;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;29708:190;;;;;;;;;;-1:-1:-1;29708:190:0;;;;;:::i;:::-;;:::i;:::-;;;1181:14:1;;1174:22;1156:41;;1144:2;1129:18;29708:190:0;1016:187:1;28349:155:0;;;;;;;;;;-1:-1:-1;28482:14:0;;28349:155;;;1354:25:1;;;1342:2;1327:18;28349:155:0;1208:177:1;145444:744:0;;;;;;;;;;-1:-1:-1;145444:744:0;;;;;:::i;:::-;;:::i;28200:84::-;;;;;;;;;;-1:-1:-1;28200:84:0;;28274:2;1911:36:1;;1899:2;1884:18;28200:84:0;1769:184:1;141832:59:0;;;;;;;;;;;;141869:22;141832:59;;137208:114;;;;;;;;;;;;;:::i;143775:71::-;;;;;;;;;;;;;:::i;:::-;;143049:244;;;;;;;;;;-1:-1:-1;143049:244:0;;;;;:::i;:::-;;:::i;143354:97::-;;;;;;;;;;-1:-1:-1;143354:97:0;;;;;:::i;:::-;;:::i;143923:201::-;;;;;;;;;;-1:-1:-1;143923:201:0;;;;;:::i;:::-;;:::i;141969:18::-;;;;;;;;;;-1:-1:-1;141969:18:0;;;;;;;;;;;142031:23;;;;;;;;;;-1:-1:-1;142031:23:0;;;;-1:-1:-1;;;;;142031:23:0;;;;;;-1:-1:-1;;;;;2726:32:1;;;2708:51;;2696:2;2681:18;142031:23:0;2562:203:1;28567:174:0;;;;;;;;;;-1:-1:-1;28567:174:0;;;;;:::i;:::-;;:::i;141994:30::-;;;;;;;;;;-1:-1:-1;141994:30:0;;;;;;;-1:-1:-1;;;;;141994:30:0;;;140792:103;;;;;;;;;;;;;:::i;136939:156::-;;;;;;;;;;-1:-1:-1;136939:156:0;;;;;:::i;:::-;;:::i;143655:68::-;;;;;;;;;;;;;:::i;128431:931::-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;:::i;140057:147::-;;;;;;;;;;-1:-1:-1;138888:22:0;140188:8;-1:-1:-1;;;;;140188:8:0;140057:147;;27401:151;;;;;;;;;;;;;:::i;142061:28::-;;;;;;;;;;;;;;;;144845:507;;;;;;;;;;-1:-1:-1;144845:507:0;;;;;:::i;:::-;;:::i;144482:275::-;;;;;;;;;;-1:-1:-1;144482:275:0;;;;;:::i;:::-;;:::i;143506:98::-;;;;;;;;;;;;;:::i;142367:479::-;;;;;;;;;;-1:-1:-1;142367:479:0;;;;;:::i;:::-;;:::i;136185:695::-;;;;;;;;;;-1:-1:-1;136185:695:0;;;;;:::i;:::-;;:::i;29191:198::-;;;;;;;;;;-1:-1:-1;29191:198:0;;;;;:::i;:::-;;:::i;141937:25::-;;;;;;;;;;-1:-1:-1;141937:25:0;;;;;;;;146269:419;;;;;;;;;;-1:-1:-1;146269:419:0;;;;;:::i;:::-;;:::i;144192:229::-;;;;;;;;;;-1:-1:-1;144192:229:0;;;;;:::i;:::-;;:::i;141050:220::-;;;;;;;;;;-1:-1:-1;141050:220:0;;;;;:::i;:::-;;:::i;27135:147::-;27180:13;27206:22;-1:-1:-1;;;;;;;;;;;27231:18:0;27206:43;;27267:1;:7;;27260:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27135:147;:::o;29708:190::-;29781:4;17710:10;29837:31;17710:10;29853:7;29862:5;29837:8;:31::i;:::-;29886:4;29879:11;;;29708:190;;;;;:::o;145444:744::-;145564:4;142899:6;;;;;;;142898:7;142890:47;;;;-1:-1:-1;;;142890:47:0;;;;;;;:::i;:::-;;;;;;;;;145581:11:::1;145622:5;145605:13;;145596:6;:22;;;;:::i;:::-;145595:32;;;;:::i;:::-;145581:46:::0;-1:-1:-1;145655:22:0::1;145680:12;145581:46:::0;145680:6;:12:::1;:::i;:::-;145655:37;;145715:1;145709:3;:7;:33;;;;-1:-1:-1::0;145720:8:0::1;::::0;-1:-1:-1;;;;;145720:8:0::1;:22:::0;::::1;145709:33;145705:126;;;145777:8;::::0;145759:32:::1;::::0;145769:6;;-1:-1:-1;;;;;145777:8:0::1;145787:3:::0;145759:9:::1;:32::i;:::-;145843:44;145853:6;145861:9;145872:14;145843:9;:44::i;:::-;145942:24;145969:31;145979:6:::0;17710:10;29191:198;:::i;145969:31::-:1;145942:58;;146039:6;146019:16;:26;;146011:79;;;::::0;-1:-1:-1;;;146011:79:0;;7168:2:1;146011:79:0::1;::::0;::::1;7150:21:1::0;7207:2;7187:18;;;7180:30;7246:34;7226:18;;;7219:62;-1:-1:-1;;;7297:18:1;;;7290:38;7345:19;;146011:79:0::1;6966:404:1::0;146011:79:0::1;146101:57;146110:6:::0;17710:10;146132:25:::1;146151:6:::0;146132:16;:25:::1;:::i;:::-;146101:8;:57::i;:::-;-1:-1:-1::0;146176:4:0::1;::::0;145444:744;-1:-1:-1;;;;;;145444:744:0:o;137208:114::-;137267:7;137294:20;:18;:20::i;:::-;137287:27;;137208:114;:::o;143775:71::-;139943:13;:11;:13::i;:::-;143833:5:::1;143824:14:::0;;-1:-1:-1;;143824:14:0::1;::::0;;143775:71::o;143049:244::-;139943:13;:11;:13::i;:::-;142899:6:::1;::::0;::::1;::::0;::::1;;;142898:7;142890:47;;;;-1:-1:-1::0;;;142890:47:0::1;;;;;;;:::i;:::-;143144:13:::2;::::0;::::2;;143143:14;143135:44;;;::::0;-1:-1:-1;;;143135:44:0;;7577:2:1;143135:44:0::2;::::0;::::2;7559:21:1::0;7616:2;7596:18;;;7589:30;-1:-1:-1;;;7635:18:1;;;7628:47;7692:18;;143135:44:0::2;7375:341:1::0;143135:44:0::2;141869:22;143214:6;143198:13;28482:14:::0;;;28349:155;143198:13:::2;:22;;;;:::i;:::-;:36;;143190:67;;;::::0;-1:-1:-1;;;143190:67:0;;8053:2:1;143190:67:0::2;::::0;::::2;8035:21:1::0;8092:2;8072:18;;;8065:30;-1:-1:-1;;;8111:18:1;;;8104:48;8169:18;;143190:67:0::2;7851:342:1::0;143190:67:0::2;143268:17;143274:2;143278:6;143268:5;:17::i;:::-;143049:244:::0;;:::o;143354:97::-;142899:6;;;;;;;142898:7;142890:47;;;;-1:-1:-1;;;142890:47:0;;;;;;;:::i;:::-;143418:25:::1;143424:10;143436:6;143418:5;:25::i;:::-;143354:97:::0;:::o;143923:201::-;139943:13;:11;:13::i;:::-;-1:-1:-1;;;;;144017:32:0;::::1;144009:60;;;::::0;-1:-1:-1;;;144009:60:0;;8400:2:1;144009:60:0::1;::::0;::::1;8382:21:1::0;8439:2;8419:18;;;8412:30;-1:-1:-1;;;8458:18:1;;;8451:45;8513:18;;144009:60:0::1;8198:339:1::0;144009:60:0::1;144080:15;:36:::0;;-1:-1:-1;;;;;144080:36:0;;::::1;::::0;::::1;-1:-1:-1::0;;;;;;144080:36:0;;::::1;::::0;;;::::1;::::0;;143923:201::o;28567:174::-;28632:7;;-1:-1:-1;;;;;;;;;;;28677:18:0;-1:-1:-1;;;;;28713:20:0;;;:11;:20;;;;;;;;-1:-1:-1;;28713:20:0;;;;;28567:174::o;140792:103::-;139943:13;:11;:13::i;:::-;140857:30:::1;140884:1;140857:18;:30::i;:::-;140792:103::o:0;136939:156::-;137041:7;137068:19;137081:5;137068:12;:19::i;143655:68::-;139943:13;:11;:13::i;:::-;143702:6:::1;:13:::0;;-1:-1:-1;;143702:13:0::1;;;::::0;;143655:68::o;128431:931::-;128534:13;128562:18;;128534:13;;;128562:18;128534:13;-1:-1:-1;;;;;;;;;;;129052:13:0;;128783:45;;-1:-1:-1;129052:18:0;:43;;;;-1:-1:-1;129074:16:0;;;;:21;129052:43;129044:77;;;;-1:-1:-1;;;129044:77:0;;8744:2:1;129044:77:0;;;8726:21:1;8783:2;8763:18;;;8756:30;-1:-1:-1;;;8802:18:1;;;8795:51;8863:18;;129044:77:0;8542:345:1;129044:77:0;129187:13;:11;:13::i;:::-;129215:16;:14;:16::i;:::-;129327;;;129310:1;129327:16;;;;;;;;;-1:-1:-1;;;129134:220:0;;;-1:-1:-1;129134:220:0;;-1:-1:-1;129246:13:0;;-1:-1:-1;129282:4:0;;-1:-1:-1;129310:1:0;-1:-1:-1;129327:16:0;-1:-1:-1;129134:220:0;-1:-1:-1;;128431:931:0:o;27401:151::-;27535:9;27528:16;;27448:13;;-1:-1:-1;;;;;;;;;;;26460:20:0;27528:16;;;:::i;144845:507::-;144945:4;142899:6;;;;;;;142898:7;142890:47;;;;-1:-1:-1;;;142890:47:0;;;;;;;:::i;:::-;144962:11:::1;145003:5;144986:13;;144977:6;:22;;;;:::i;:::-;144976:32;;;;:::i;:::-;144962:46:::0;-1:-1:-1;145036:22:0::1;145061:12;144962:46:::0;145061:6;:12:::1;:::i;:::-;145036:37;;145096:1;145090:3;:7;:33;;;;-1:-1:-1::0;145101:8:0::1;::::0;-1:-1:-1;;;;;145101:8:0::1;:22:::0;::::1;145090:33;145086:132;;;145140:38;17710:10:::0;145164:8:::1;::::0;-1:-1:-1;;;;;145164:8:0::1;145174:3:::0;145140:9:::1;:38::i;:::-;145230:50;17710:10:::0;145254:9:::1;145265:14;145230:9;:50::i;:::-;-1:-1:-1::0;145340:4:0::1;::::0;144845:507;-1:-1:-1;;;;144845:507:0:o;144482:275::-;139943:13;:11;:13::i;:::-;144592:3:::1;144572:16;:23;;144564:56;;;::::0;-1:-1:-1;;;144564:56:0;;9226:2:1;144564:56:0::1;::::0;::::1;9208:21:1::0;9265:2;9245:18;;;9238:30;-1:-1:-1;;;9284:18:1;;;9277:50;9344:18;;144564:56:0::1;9024:344:1::0;144564:56:0::1;144674:13;::::0;144653:53:::1;::::0;;9547:25:1;;;9603:2;9588:18;;9581:34;;;144653:53:0::1;::::0;9520:18:1;144653:53:0::1;;;;;;;144717:13;:32:::0;144482:275::o;143506:98::-;139943:13;:11;:13::i;:::-;143583::::1;::::0;;-1:-1:-1;;143566:30:0;::::1;143583:13;::::0;;::::1;143582:14;143566:30;::::0;;143506:98::o;142367:479::-;16692:21;12008:15;;-1:-1:-1;;;12008:15:0;;;;12007:16;;12055:14;;11861:30;12440:16;;:34;;;;;12460:14;12440:34;12420:54;;12485:17;12505:11;:16;;12520:1;12505:16;:50;;;;-1:-1:-1;12533:4:0;12525:25;:30;12505:50;12485:70;;12573:12;12572:13;:30;;;;;12590:12;12589:13;12572:30;12568:93;;;12626:23;;-1:-1:-1;;;12626:23:0;;;;;;;;;;;12568:93;12671:18;;-1:-1:-1;;12671:18:0;12688:1;12671:18;;;12700:69;;;;12735:22;;-1:-1:-1;;;;12735:22:0;-1:-1:-1;;;12735:22:0;;;12700:69;142481:29:::1;;;;;;;;;;;;;;-1:-1:-1::0;;;142481:29:0::1;;::::0;::::1;;;;;;;;;;;;;-1:-1:-1::0;;;142481:29:0::1;;::::0;:12:::1;:29::i;:::-;142521:28;;;;;;;;;;;;;;-1:-1:-1::0;;;142521:28:0::1;;::::0;:18:::1;:28::i;:::-;142560:58;142575:42;142560:14;:58::i;:::-;142631:36;142637:5:::0;142644:22:::1;:13:::0;142660:6:::1;142644:22;:::i;:::-;142631:5;:36::i;:::-;142727:15;:34:::0;;-1:-1:-1;;;;;;142727:34:0::1;::::0;-1:-1:-1;;;;;142727:34:0;::::1;;;::::0;;:15:::1;142796:17:::0;12791:104;;;;12826:23;;-1:-1:-1;;;;12826:23:0;;;12869:14;;-1:-1:-1;9779:50:1;;12869:14:0;;9767:2:1;9752:18;12869:14:0;;;;;;;12791:104;11793:1109;;;;;142367:479;;;:::o;136185:695::-;136415:8;136397:15;:26;136393:99;;;136447:33;;-1:-1:-1;;;136447:33:0;;;;;1354:25:1;;;1327:18;;136447:33:0;1208:177:1;136393:99:0;136504:18;135340:95;136563:5;136570:7;136579:5;136586:16;136596:5;-1:-1:-1;;;;;134036:16:0;133673:7;134036:16;;;133059:21;134036:16;;;;;:18;;;;;;;;;133613:460;136586:16;136535:78;;;;;;10127:25:1;;;;-1:-1:-1;;;;;10188:32:1;;;10168:18;;;10161:60;10257:32;;;;10237:18;;;10230:60;10306:18;;;10299:34;10349:19;;;10342:35;10393:19;;;10386:35;;;10099:19;;136535:78:0;;;;;;;;;;;;136525:89;;;;;;136504:110;;136627:12;136642:28;136659:10;136642:16;:28::i;:::-;136627:43;;136683:14;136700:28;136714:4;136720:1;136723;136726;136700:13;:28::i;:::-;136683:45;;136753:5;-1:-1:-1;;;;;136743:15:0;:6;-1:-1:-1;;;;;136743:15:0;;136739:90;;136782:35;;-1:-1:-1;;;136782:35:0;;-1:-1:-1;;;;;10624:32:1;;;136782:35:0;;;10606:51:1;10693:32;;10673:18;;;10666:60;10579:18;;136782:35:0;10432:300:1;136739:90:0;136841:31;136850:5;136857:7;136866:5;136841:8;:31::i;:::-;136382:498;;;136185:695;;;;;;;:::o;29191:198::-;-1:-1:-1;;;;;29352:20:0;;;29271:7;29352:20;;;:13;:20;;;;;;;;:29;;;;;;;;;;;;;29191:198::o;146269:419::-;139943:13;:11;:13::i;:::-;146378:1:::1;146351:15:::0;;;::::1;-1:-1:-1::0;;;;;146351:15:0::1;146343:66;;;::::0;-1:-1:-1;;;146343:66:0;;10939:2:1;146343:66:0::1;::::0;::::1;10921:21:1::0;10978:2;10958:18;;;10951:30;11017:26;10997:18;;;10990:54;11061:18;;146343:66:0::1;10737:348:1::0;146343:66:0::1;-1:-1:-1::0;;;;;146424:26:0;::::1;146420:261;;146475:15;::::0;;146467:56:::1;::::0;-1:-1:-1;;;;;146475:15:0;;;::::1;::::0;;;::::1;::::0;146501:21:::1;146467:56:::0;::::1;;;::::0;146501:21;;146467:56;146475:15;146467:56;146501:21;146475:15;146467:56;::::1;;;;;;;;;;;;;;;;;;146420:261;146596:15;::::0;146613:55:::1;::::0;-1:-1:-1;;;146613:55:0;;146662:4:::1;146613:55;::::0;::::1;2708:51:1::0;-1:-1:-1;;;;;146556:39:0;;::::1;::::0;::::1;::::0;146596:15;;;::::1;::::0;;::::1;::::0;146556:39;;146613:40:::1;::::0;2681:18:1;;146613:55:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;146556:113;::::0;-1:-1:-1;;;;;;146556:113:0::1;::::0;;;;;;-1:-1:-1;;;;;11471:32:1;;;146556:113:0::1;::::0;::::1;11453:51:1::0;11520:18;;;11513:34;11426:18;;146556:113:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;144192:229::-:0;139943:13;:11;:13::i;:::-;-1:-1:-1;;;;;144272:25:0;::::1;144264:62;;;::::0;-1:-1:-1;;;144264:62:0;;12042:2:1;144264:62:0::1;::::0;::::1;12024:21:1::0;12081:2;12061:18;;;12054:30;12120:26;12100:18;;;12093:54;12164:18;;144264:62:0::1;11840:348:1::0;144264:62:0::1;144358:8;::::0;144342:38:::1;::::0;-1:-1:-1;;;;;144342:38:0;;::::1;::::0;144358:8:::1;::::0;144342:38:::1;::::0;144358:8:::1;::::0;144342:38:::1;144391:8;:22:::0;;-1:-1:-1;;;;;;144391:22:0::1;-1:-1:-1::0;;;;;144391:22:0;;;::::1;::::0;;;::::1;::::0;;144192:229::o;141050:220::-;139943:13;:11;:13::i;:::-;-1:-1:-1;;;;;141135:22:0;::::1;141131:93;;141181:31;::::0;-1:-1:-1;;;141181:31:0;;141209:1:::1;141181:31;::::0;::::1;2708:51:1::0;2681:18;;141181:31:0::1;2562:203:1::0;141131:93:0::1;141234:28;141253:8;141234:18;:28::i;34631:130::-:0;34716:37;34725:5;34732:7;34741:5;34748:4;34716:8;:37::i;:::-;34631:130;;;:::o;31142:308::-;-1:-1:-1;;;;;31226:18:0;;31222:88;;31268:30;;-1:-1:-1;;;31268:30:0;;31295:1;31268:30;;;2708:51:1;2681:18;;31268:30:0;2562:203:1;31222:88:0;-1:-1:-1;;;;;31324:16:0;;31320:88;;31364:32;;-1:-1:-1;;;31364:32:0;;31393:1;31364:32;;;2708:51:1;2681:18;;31364:32:0;2562:203:1;31320:88:0;31418:24;31426:4;31432:2;31436:5;31418:7;:24::i;127243:111::-;127296:7;127323:23;:21;:23::i;140282:166::-;17710:10;140342:7;138888:22;140188:8;-1:-1:-1;;;;;140188:8:0;;140057:147;140342:7;-1:-1:-1;;;;;140342:23:0;;140338:103;;140389:40;;-1:-1:-1;;;140389:40:0;;17710:10;140389:40;;;2708:51:1;2681:18;;140389:40:0;2562:203:1;33326:213:0;-1:-1:-1;;;;;33397:21:0;;33393:93;;33442:32;;-1:-1:-1;;;33442:32:0;;33471:1;33442:32;;;2708:51:1;2681:18;;33442:32:0;2562:203:1;33393:93:0;33496:35;33512:1;33516:7;33525:5;33496:7;:35::i;33867:211::-;-1:-1:-1;;;;;33938:21:0;;33934:91;;33983:30;;-1:-1:-1;;;33983:30:0;;34010:1;33983:30;;;2708:51:1;2681:18;;33983:30:0;2562:203:1;33934:91:0;34035:35;34043:7;34060:1;34064:5;34035:7;:35::i;141430:253::-;138888:22;141581:8;;-1:-1:-1;;;;;;141600:19:0;;-1:-1:-1;;;;;141600:19:0;;;;;;;;141635:40;;141581:8;;;;;141635:40;;141504:24;;141635:40;141493:190;;141430:253;:::o;133325:167::-;133385:7;;133059:21;133431:19;132938:160;129594:158;129737:7;129730:14;;129648:13;;-1:-1:-1;;;;;;;;;;;126034:21:0;129730:14;;;:::i;129987:164::-;130044:13;130070:23;-1:-1:-1;;;;;;;;;;;130096:19:0;125913:160;26688:149;14699:20;:18;:20::i;:::-;26791:38:::1;26814:5;26821:7;26791:22;:38::i;135910:127::-:0;14699:20;:18;:20::i;:::-;135995:34:::1;136019:4;135995:34;;;;;;;;;;;;;-1:-1:-1::0;;;135995:34:0::1;;::::0;:23:::1;:34::i;139441:129::-:0;14699:20;:18;:20::i;:::-;139524:38:::1;139549:12;139524:24;:38::i;128197:178::-:0;128274:7;128301:66;128334:20;:18;:20::i;:::-;128356:10;122314:4;122308:11;-1:-1:-1;;;122333:23:0;;122386:4;122377:14;;122370:39;;;;122439:4;122430:14;;122423:34;122496:4;122481:20;;;122137:382;43993:264;44078:7;44099:17;44118:18;44138:16;44158:25;44169:4;44175:1;44178;44181;44158:10;:25::i;:::-;44098:85;;;;;;44194:28;44206:5;44213:8;44194:11;:28::i;:::-;-1:-1:-1;44240:9:0;;43993:264;-1:-1:-1;;;;;;43993:264:0:o;35628:499::-;-1:-1:-1;;;;;;;;;;;;;;;;35795:19:0;;35791:91;;35838:32;;-1:-1:-1;;;35838:32:0;;35867:1;35838:32;;;2708:51:1;2681:18;;35838:32:0;2562:203:1;35791:91:0;-1:-1:-1;;;;;35896:21:0;;35892:92;;35941:31;;-1:-1:-1;;;35941:31:0;;35969:1;35941:31;;;2708:51:1;2681:18;;35941:31:0;2562:203:1;35892:92:0;-1:-1:-1;;;;;35994:20:0;;;;;;;:13;;;:20;;;;;;;;:29;;;;;;;;;:37;;;36042:78;;;;36093:7;-1:-1:-1;;;;;36077:31:0;36086:5;-1:-1:-1;;;;;36077:31:0;;36102:5;36077:31;;;;1354:25:1;;1342:2;1327:18;;1208:177;36077:31:0;;;;;;;;36042:78;35726:401;35628:499;;;;:::o;31774:1199::-;-1:-1:-1;;;;;;;;;;;;;;;;31918:18:0;;31914:558;;32074:5;32056:1;:14;;;:23;;;;;;;:::i;:::-;;;;-1:-1:-1;31914:558:0;;-1:-1:-1;31914:558:0;;-1:-1:-1;;;;;32134:17:0;;32112:19;32134:17;;;;;;;;;;;32170:19;;;32166:117;;;32217:50;;-1:-1:-1;;;32217:50:0;;-1:-1:-1;;;;;12413:32:1;;32217:50:0;;;12395:51:1;12462:18;;;12455:34;;;12505:18;;;12498:34;;;12368:18;;32217:50:0;12193:345:1;32166:117:0;-1:-1:-1;;;;;32406:17:0;;:11;:17;;;;;;;;;;32426:19;;;;32406:39;;31914:558;-1:-1:-1;;;;;32488:16:0;;32484:439;;32654:14;;;:23;;;;;;;32484:439;;;-1:-1:-1;;;;;32872:15:0;;:11;:15;;;;;;;;;;:24;;;;;;32484:439;32955:2;-1:-1:-1;;;;;32940:25:0;32949:4;-1:-1:-1;;;;;32940:25:0;;32959:5;32940:25;;;;1354::1;;1342:2;1327:18;;1208:177;32940:25:0;;;;;;;;31849:1124;31774:1199;;;:::o;127362:193::-;127417:7;125250:95;127476:17;:15;:17::i;:::-;127495:20;:18;:20::i;:::-;127454:92;;;;;;12802:25:1;;;;12843:18;;12836:34;;;;12886:18;;;12879:34;127517:13:0;12929:18:1;;;12922:34;127540:4:0;12972:19:1;;;12965:61;12774:19;;127454:92:0;;;;;;;;;;;;127444:103;;;;;;127437:110;;127362:193;:::o;14859:145::-;16692:21;16373:40;-1:-1:-1;;;16373:40:0;;;;14922:75;;14968:17;;-1:-1:-1;;;14968:17:0;;;;;;;;;;;26845:220;14699:20;:18;:20::i;:::-;-1:-1:-1;;;;;;;;;;;27012:7:0;:15:::1;27022:5:::0;27012:7;:15:::1;:::i;:::-;-1:-1:-1::0;27038:9:0::1;::::0;::::1;:19;27050:7:::0;27038:9;:19:::1;:::i;:::-;;26947:118;26845:220:::0;;:::o;126814:338::-;14699:20;:18;:20::i;:::-;-1:-1:-1;;;;;;;;;;;126983:7:0;:14:::1;126993:4:::0;126983:7;:14:::1;:::i;:::-;-1:-1:-1::0;127008:10:0::1;::::0;::::1;:20;127021:7:::0;127008:10;:20:::1;:::i;:::-;-1:-1:-1::0;127112:1:0::1;127096:17:::0;;;127124:16:::1;::::0;;::::1;:20:::0;-1:-1:-1;;126814:338:0:o;139578:240::-;14699:20;:18;:20::i;42277:1577::-;42408:17;;;43372:66;43359:79;;43355:166;;;-1:-1:-1;43471:1:0;;-1:-1:-1;43475:30:0;;-1:-1:-1;43507:1:0;43455:54;;43355:166;43635:24;;;43618:14;43635:24;;;;;;;;;15388:25:1;;;15461:4;15449:17;;15429:18;;;15422:45;;;;15483:18;;;15476:34;;;15526:18;;;15519:34;;;43635:24:0;;15360:19:1;;43635:24:0;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;43635:24:0;;-1:-1:-1;;43635:24:0;;;-1:-1:-1;;;;;;;43674:20:0;;43670:115;;-1:-1:-1;43727:1:0;;-1:-1:-1;43731:29:0;;-1:-1:-1;43727:1:0;;-1:-1:-1;43711:62:0;;43670:115;43805:6;-1:-1:-1;43813:20:0;;-1:-1:-1;43813:20:0;;-1:-1:-1;42277:1577:0;;;;;;;;;:::o;44395:542::-;44491:20;44482:5;:29;;;;;;;;:::i;:::-;;44478:452;;44395:542;;:::o;44478:452::-;44589:29;44580:5;:38;;;;;;;;:::i;:::-;;44576:354;;44642:23;;-1:-1:-1;;;44642:23:0;;;;;;;;;;;44576:354;44696:35;44687:5;:44;;;;;;;;:::i;:::-;;44683:247;;44755:46;;-1:-1:-1;;;44755:46:0;;;;;1354:25:1;;;1327:18;;44755:46:0;1208:177:1;44683:247:0;44832:30;44823:5;:39;;;;;;;;:::i;:::-;;44819:111;;44886:32;;-1:-1:-1;;;44886:32:0;;;;;1354:25:1;;;1327:18;;44886:32:0;1208:177:1;130373:702:0;130423:7;-1:-1:-1;;;;;;;;;;;130423:7:0;130520:13;:11;:13::i;:::-;130548:18;;130499:34;;-1:-1:-1;130548:22:0;130544:524;;130594:22;;;;;;;;130373:702;-1:-1:-1;;130373:702:0:o;130544:524::-;130895:13;;130927:15;;130923:134;;130970:10;130373:702;-1:-1:-1;;;130373:702:0:o;130923:134::-;131028:13;131021:20;;;;;130373:702;:::o;131303:738::-;131356:7;-1:-1:-1;;;;;;;;;;;131356:7:0;131456:16;:14;:16::i;:::-;131487:21;;131432:40;;-1:-1:-1;131487:25:0;131483:551;;131536:25;;;;;;;;131303:738;-1:-1:-1;;131303:738:0:o;131483:551::-;131852:16;;;;131887:18;;131883:140;;131933:13;131303:738;-1:-1:-1;;;131303:738:0:o;14:289:1:-;56:3;94:5;88:12;121:6;116:3;109:19;177:6;170:4;163:5;159:16;152:4;147:3;143:14;137:47;229:1;222:4;213:6;208:3;204:16;200:27;193:38;292:4;285:2;281:7;276:2;268:6;264:15;260:29;255:3;251:39;247:50;240:57;;;14:289;;;;:::o;308:220::-;457:2;446:9;439:21;420:4;477:45;518:2;507:9;503:18;495:6;477:45;:::i;:::-;469:53;308:220;-1:-1:-1;;;308:220:1:o;533:173::-;601:20;;-1:-1:-1;;;;;650:31:1;;640:42;;630:70;;696:1;693;686:12;630:70;533:173;;;:::o;711:300::-;779:6;787;840:2;828:9;819:7;815:23;811:32;808:52;;;856:1;853;846:12;808:52;879:29;898:9;879:29;:::i;:::-;869:39;977:2;962:18;;;;949:32;;-1:-1:-1;;;711:300:1:o;1390:374::-;1467:6;1475;1483;1536:2;1524:9;1515:7;1511:23;1507:32;1504:52;;;1552:1;1549;1542:12;1504:52;1575:29;1594:9;1575:29;:::i;:::-;1565:39;;1623:38;1657:2;1646:9;1642:18;1623:38;:::i;:::-;1390:374;;1613:48;;-1:-1:-1;;;1730:2:1;1715:18;;;;1702:32;;1390:374::o;2140:226::-;2199:6;2252:2;2240:9;2231:7;2227:23;2223:32;2220:52;;;2268:1;2265;2258:12;2220:52;-1:-1:-1;2313:23:1;;2140:226;-1:-1:-1;2140:226:1:o;2371:186::-;2430:6;2483:2;2471:9;2462:7;2458:23;2454:32;2451:52;;;2499:1;2496;2489:12;2451:52;2522:29;2541:9;2522:29;:::i;2770:1238::-;3176:3;3171;3167:13;3159:6;3155:26;3144:9;3137:45;3218:3;3213:2;3202:9;3198:18;3191:31;3118:4;3245:46;3286:3;3275:9;3271:19;3263:6;3245:46;:::i;:::-;3339:9;3331:6;3327:22;3322:2;3311:9;3307:18;3300:50;3373:33;3399:6;3391;3373:33;:::i;:::-;3437:2;3422:18;;3415:34;;;-1:-1:-1;;;;;3486:32:1;;3480:3;3465:19;;3458:61;3506:3;3535:19;;3528:35;;;3600:22;;;3594:3;3579:19;;3572:51;3672:13;;3694:22;;;3744:2;3770:15;;;;-1:-1:-1;3732:15:1;;;;-1:-1:-1;3813:169:1;3827:6;3824:1;3821:13;3813:169;;;3888:13;;3876:26;;3931:2;3957:15;;;;3922:12;;;;3849:1;3842:9;3813:169;;;-1:-1:-1;3999:3:1;;2770:1238;-1:-1:-1;;;;;;;;;;;2770:1238:1:o;4013:374::-;4090:6;4098;4106;4159:2;4147:9;4138:7;4134:23;4130:32;4127:52;;;4175:1;4172;4165:12;4127:52;4198:29;4217:9;4198:29;:::i;:::-;4188:39;-1:-1:-1;4296:2:1;4281:18;;4268:32;;-1:-1:-1;4343:38:1;4377:2;4362:18;;4343:38;:::i;:::-;4333:48;;4013:374;;;;;:::o;4392:903::-;4503:6;4511;4519;4527;4535;4543;4551;4604:3;4592:9;4583:7;4579:23;4575:33;4572:53;;;4621:1;4618;4611:12;4572:53;4644:29;4663:9;4644:29;:::i;:::-;4634:39;;4692:38;4726:2;4715:9;4711:18;4692:38;:::i;:::-;4682:48;-1:-1:-1;4799:2:1;4784:18;;4771:32;;-1:-1:-1;4900:2:1;4885:18;;4872:32;;-1:-1:-1;4982:3:1;4967:19;;4954:33;5031:4;5018:18;;5006:31;;4996:59;;5051:1;5048;5041:12;4996:59;4392:903;;;;-1:-1:-1;4392:903:1;;;;5074:7;5154:3;5139:19;;5126:33;;-1:-1:-1;5258:3:1;5243:19;;;5230:33;;4392:903;-1:-1:-1;;4392:903:1:o;5300:260::-;5368:6;5376;5429:2;5417:9;5408:7;5404:23;5400:32;5397:52;;;5445:1;5442;5435:12;5397:52;5468:29;5487:9;5468:29;:::i;:::-;5458:39;;5516:38;5550:2;5539:9;5535:18;5516:38;:::i;:::-;5506:48;;5300:260;;;;;:::o;5565:380::-;5644:1;5640:12;;;;5687;;;5708:61;;5762:4;5754:6;5750:17;5740:27;;5708:61;5815:2;5807:6;5804:14;5784:18;5781:38;5778:161;;5861:10;5856:3;5852:20;5849:1;5842:31;5896:4;5893:1;5886:15;5924:4;5921:1;5914:15;5778:161;;5565:380;;;:::o;5950:351::-;6152:2;6134:21;;;6191:2;6171:18;;;6164:30;6230:29;6225:2;6210:18;;6203:57;6292:2;6277:18;;5950:351::o;6306:127::-;6367:10;6362:3;6358:20;6355:1;6348:31;6398:4;6395:1;6388:15;6422:4;6419:1;6412:15;6438:168;6511:9;;;6542;;6559:15;;;6553:22;;6539:37;6529:71;;6580:18;;:::i;6611:217::-;6651:1;6677;6667:132;;6721:10;6716:3;6712:20;6709:1;6702:31;6756:4;6753:1;6746:15;6784:4;6781:1;6774:15;6667:132;-1:-1:-1;6813:9:1;;6611:217::o;6833:128::-;6900:9;;;6921:11;;;6918:37;;;6935:18;;:::i;7721:125::-;7786:9;;;7807:10;;;7804:36;;;7820:18;;:::i;8892:127::-;8953:10;8948:3;8944:20;8941:1;8934:31;8984:4;8981:1;8974:15;9008:4;9005:1;8998:15;11090:184;11160:6;11213:2;11201:9;11192:7;11188:23;11184:32;11181:52;;;11229:1;11226;11219:12;11181:52;-1:-1:-1;11252:16:1;;11090:184;-1:-1:-1;11090:184:1:o;11558:277::-;11625:6;11678:2;11666:9;11657:7;11653:23;11649:32;11646:52;;;11694:1;11691;11684:12;11646:52;11726:9;11720:16;11779:5;11772:13;11765:21;11758:5;11755:32;11745:60;;11801:1;11798;11791:12;13163:518;13265:2;13260:3;13257:11;13254:421;;;13301:5;13298:1;13291:16;13345:4;13342:1;13332:18;13415:2;13403:10;13399:19;13396:1;13392:27;13386:4;13382:38;13451:4;13439:10;13436:20;13433:47;;;-1:-1:-1;13474:4:1;13433:47;13529:2;13524:3;13520:12;13517:1;13513:20;13507:4;13503:31;13493:41;;13584:81;13602:2;13595:5;13592:13;13584:81;;;13661:1;13647:16;;13628:1;13617:13;13584:81;;13857:1299;13983:3;13977:10;14010:18;14002:6;13999:30;13996:56;;;14032:18;;:::i;:::-;14061:97;14151:6;14111:38;14143:4;14137:11;14111:38;:::i;:::-;14105:4;14061:97;:::i;:::-;14207:4;14238:2;14227:14;;14255:1;14250:649;;;;14943:1;14960:6;14957:89;;;-1:-1:-1;15012:19:1;;;15006:26;14957:89;-1:-1:-1;;13814:1:1;13810:11;;;13806:24;13802:29;13792:40;13838:1;13834:11;;;13789:57;15059:81;;14220:930;;14250:649;13110:1;13103:14;;;13147:4;13134:18;;-1:-1:-1;;14286:20:1;;;14404:222;14418:7;14415:1;14412:14;14404:222;;;14500:19;;;14494:26;14479:42;;14607:4;14592:20;;;;14560:1;14548:14;;;;14434:12;14404:222;;;14408:3;14654:6;14645:7;14642:19;14639:201;;;14715:19;;;14709:26;-1:-1:-1;;14798:1:1;14794:14;;;14810:3;14790:24;14786:37;14782:42;14767:58;14752:74;;14639:201;-1:-1:-1;;;;14886:1:1;14870:14;;;14866:22;14853:36;;-1:-1:-1;13857:1299:1:o;15564:127::-;15625:10;15620:3;15616:20;15613:1;15606:31;15656:4;15653:1;15646:15;15680:4;15677:1;15670:15

Swarm Source

ipfs://a4f372ab9b9dabce6c9ed6f716854b7b635ec2e5a241e7b3b80b6b85e35c6b21
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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