creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable\n    struct OwnableStorage {\n        address _owner;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Ownable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;\n\n    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {\n        assembly {\n            $.slot := OwnableStorageLocation\n        }\n    }\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    function __Ownable_init(address initialOwner) internal onlyInitializing {\n        __Ownable_init_unchained(initialOwner);\n    }\n\n    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        OwnableStorage storage $ = _getOwnableStorage();\n        return $._owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        OwnableStorage storage $ = _getOwnableStorage();\n        address oldOwner = $._owner;\n        $._owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reininitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        assembly {\n            $.slot := INITIALIZABLE_STORAGE\n        }\n    }\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"
      },
      "@openzeppelin/contracts/access/Ownable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n    address private _owner;\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    constructor(address initialOwner) {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"
      },
      "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"
      },
      "@openzeppelin/contracts/token/ERC20/ERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n    mapping(address account => uint256) private _balances;\n\n    mapping(address account => mapping(address spender => uint256)) private _allowances;\n\n    uint256 private _totalSupply;\n\n    string private _name;\n    string private _symbol;\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    constructor(string memory name_, string memory symbol_) {\n        _name = name_;\n        _symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual returns (uint256) {\n        return _balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20}.\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            _totalSupply += value;\n        } else {\n            uint256 fromBalance = _balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                _balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                _totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                _balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     * ```\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        _allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner` s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance != type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"
      },
      "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"
      },
      "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"
      },
      "@openzeppelin/contracts/utils/Context.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"
      },
      "@openzeppelin/contracts/utils/ReentrancyGuard.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant NOT_ENTERED = 1;\n    uint256 private constant ENTERED = 2;\n\n    uint256 private _status;\n\n    /**\n     * @dev Unauthorized reentrant call.\n     */\n    error ReentrancyGuardReentrantCall();\n\n    constructor() {\n        _status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and making it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        _nonReentrantBefore();\n        _;\n        _nonReentrantAfter();\n    }\n\n    function _nonReentrantBefore() private {\n        // On the first call to nonReentrant, _status will be NOT_ENTERED\n        if (_status == ENTERED) {\n            revert ReentrancyGuardReentrantCall();\n        }\n\n        // Any calls to nonReentrant after this point will fail\n        _status = ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        _status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n     * `nonReentrant` function in the call stack.\n     */\n    function _reentrancyGuardEntered() internal view returns (bool) {\n        return _status == ENTERED;\n    }\n}\n"
      },
      "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n *     // Add the library methods\n *     using EnumerableSet for EnumerableSet.AddressSet;\n *\n *     // Declare a set state variable\n *     EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n    // To implement this library for multiple types with as little code\n    // repetition as possible, we write it in terms of a generic Set type with\n    // bytes32 values.\n    // The Set implementation uses private functions, and user-facing\n    // implementations (such as AddressSet) are just wrappers around the\n    // underlying Set.\n    // This means that we can only create new EnumerableSets for types that fit\n    // in bytes32.\n\n    struct Set {\n        // Storage of set values\n        bytes32[] _values;\n        // Position is the index of the value in the `values` array plus 1.\n        // Position 0 is used to mean a value is not in the set.\n        mapping(bytes32 value => uint256) _positions;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function _add(Set storage set, bytes32 value) private returns (bool) {\n        if (!_contains(set, value)) {\n            set._values.push(value);\n            // The value is stored at length-1, but we add 1 to all indexes\n            // and use 0 as a sentinel value\n            set._positions[value] = set._values.length;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function _remove(Set storage set, bytes32 value) private returns (bool) {\n        // We cache the value's position to prevent multiple reads from the same storage slot\n        uint256 position = set._positions[value];\n\n        if (position != 0) {\n            // Equivalent to contains(set, value)\n            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n            // the array, and then remove the last element (sometimes called as 'swap and pop').\n            // This modifies the order of the array, as noted in {at}.\n\n            uint256 valueIndex = position - 1;\n            uint256 lastIndex = set._values.length - 1;\n\n            if (valueIndex != lastIndex) {\n                bytes32 lastValue = set._values[lastIndex];\n\n                // Move the lastValue to the index where the value to delete is\n                set._values[valueIndex] = lastValue;\n                // Update the tracked position of the lastValue (that was just moved)\n                set._positions[lastValue] = position;\n            }\n\n            // Delete the slot where the moved value was stored\n            set._values.pop();\n\n            // Delete the tracked position for the deleted slot\n            delete set._positions[value];\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function _contains(Set storage set, bytes32 value) private view returns (bool) {\n        return set._positions[value] != 0;\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function _length(Set storage set) private view returns (uint256) {\n        return set._values.length;\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function _at(Set storage set, uint256 index) private view returns (bytes32) {\n        return set._values[index];\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function _values(Set storage set) private view returns (bytes32[] memory) {\n        return set._values;\n    }\n\n    // Bytes32Set\n\n    struct Bytes32Set {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _add(set._inner, value);\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _remove(set._inner, value);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n        return _contains(set._inner, value);\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(Bytes32Set storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n        return _at(set._inner, index);\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        bytes32[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // AddressSet\n\n    struct AddressSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(AddressSet storage set, address value) internal returns (bool) {\n        return _add(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(AddressSet storage set, address value) internal returns (bool) {\n        return _remove(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(AddressSet storage set, address value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(AddressSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(AddressSet storage set, uint256 index) internal view returns (address) {\n        return address(uint160(uint256(_at(set._inner, index))));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(AddressSet storage set) internal view returns (address[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        address[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // UintSet\n\n    struct UintSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(UintSet storage set, uint256 value) internal returns (bool) {\n        return _add(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(UintSet storage set, uint256 value) internal returns (bool) {\n        return _remove(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(UintSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n        return uint256(_at(set._inner, index));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(UintSet storage set) internal view returns (uint256[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        uint256[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n}\n"
      },
      "src/DividendTracker.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.23;\n\nimport {ERC20} from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport {IDividendTracker} from \"./interfaces/IDividendTracker.sol\";\nimport {SafeMath, SafeMathUint, SafeMathInt} from \"./libs/SafeMath.sol\";\n\nabstract contract DividendTracker is ERC20, IDividendTracker {\n    using SafeMath for uint256;\n    using SafeMathUint for uint256;\n    using SafeMathInt for int256;\n\n    // With `magnitude`, we can properly distribute dividends even if the amount of received ether is small.\n    // For more discussion about choosing the value of `magnitude`,\n    //  see https://github.com/ethereum/EIPs/issues/1726#issuecomment-472352728\n    uint256 internal constant magnitude = 2 ** 128;\n\n    uint256 internal magnifiedDividendPerShare;\n\n    // About dividendCorrection:\n    // If the token balance of a `_user` is never changed, the dividend of `_user` can be computed with:\n    //   `dividendOf(_user) = dividendPerShare * balanceOf(_user)`.\n    // When `balanceOf(_user)` is changed (via minting/burning/transferring tokens),\n    //   `dividendOf(_user)` should not be changed,\n    //   but the computed value of `dividendPerShare * balanceOf(_user)` is changed.\n    // To keep the `dividendOf(_user)` unchanged, we add a correction term:\n    //   `dividendOf(_user) = dividendPerShare * balanceOf(_user) + dividendCorrectionOf(_user)`,\n    //   where `dividendCorrectionOf(_user)` is updated whenever `balanceOf(_user)` is changed:\n    //   `dividendCorrectionOf(_user) = dividendPerShare * (old balanceOf(_user)) - (new balanceOf(_user))`.\n    // So now `dividendOf(_user)` returns the same value before and after `balanceOf(_user)` is changed.\n    mapping(address => int256) internal magnifiedDividendCorrections;\n    mapping(address => uint256) internal withdrawnDividends;\n\n    uint256 public totalDividendsDistributed;\n    uint256 public totalDividendsWithdrawn;\n\n    constructor(\n        string memory _name,\n        string memory _symbol\n    ) ERC20(_name, _symbol) {}\n\n    function _distribute(uint256 amount) internal virtual {\n        require(totalSupply() > 0);\n\n        if (amount > 0) {\n            magnifiedDividendPerShare = magnifiedDividendPerShare.add(\n                (amount).mul(magnitude) / totalSupply()\n            );\n            emit DividendsDistributed(msg.sender, amount);\n\n            totalDividendsDistributed = totalDividendsDistributed.add(amount);\n        }\n    }\n\n    /// @notice Withdraws the ether distributed to the sender.\n    /// @dev It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0.\n    function _withdrawDividendOfUser(\n        address payable user\n    ) internal returns (uint256) {\n        uint256 _withdrawableDividend = withdrawableDividendOf(user);\n        if (_withdrawableDividend > 0) {\n            withdrawnDividends[user] = withdrawnDividends[user].add(\n                _withdrawableDividend\n            );\n            totalDividendsWithdrawn += _withdrawableDividend;\n            emit DividendWithdrawn(user, _withdrawableDividend);\n\n            (bool success, ) = user.call{value: _withdrawableDividend}(\"\");\n\n            if (!success) {\n                withdrawnDividends[user] = withdrawnDividends[user].sub(\n                    _withdrawableDividend\n                );\n                totalDividendsWithdrawn -= _withdrawableDividend;\n                return 0;\n            }\n\n            return _withdrawableDividend;\n        }\n\n        return 0;\n    }\n\n    /// @notice View the amount of dividend in wei that an address can withdraw.\n    /// @param _owner The address of a token holder.\n    /// @return The amount of dividend in wei that `_owner` can withdraw.\n    function dividendOf(address _owner) public view override returns (uint256) {\n        return withdrawableDividendOf(_owner);\n    }\n\n    /// @notice View the amount of dividend in wei that an address can withdraw.\n    /// @param _owner The address of a token holder.\n    /// @return The amount of dividend in wei that `_owner` can withdraw.\n    function withdrawableDividendOf(\n        address _owner\n    ) public view override returns (uint256) {\n        return accumulativeDividendOf(_owner).sub(withdrawnDividends[_owner]);\n    }\n\n    /// @notice View the amount of dividend in wei that an address has withdrawn.\n    /// @param _owner The address of a token holder.\n    /// @return The amount of dividend in wei that `_owner` has withdrawn.\n    function withdrawnDividendOf(\n        address _owner\n    ) public view override returns (uint256) {\n        return withdrawnDividends[_owner];\n    }\n\n    /// @notice View the amount of dividend in wei that an address has earned in total.\n    /// @dev accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner)\n    /// = (magnifiedDividendPerShare * balanceOf(_owner) + magnifiedDividendCorrections[_owner]) / magnitude\n    /// @param _owner The address of a token holder.\n    /// @return The amount of dividend in wei that `_owner` has earned in total.\n    function accumulativeDividendOf(\n        address _owner\n    ) public view override returns (uint256) {\n        return\n            magnifiedDividendPerShare\n                .mul(balanceOf(_owner))\n                .toInt256Safe()\n                .add(magnifiedDividendCorrections[_owner])\n                .toUint256Safe() / magnitude;\n    }\n\n    function transfer(\n        address to,\n        uint256 value\n    ) public override returns (bool) {\n        super.transfer(to, value);\n        address from = _msgSender();\n        int256 _magCorrection = magnifiedDividendPerShare\n            .mul(value)\n            .toInt256Safe();\n        magnifiedDividendCorrections[from] = magnifiedDividendCorrections[from]\n            .add(_magCorrection);\n        magnifiedDividendCorrections[to] = magnifiedDividendCorrections[to].sub(\n            _magCorrection\n        );\n        return true;\n    }\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 value\n    ) public override returns (bool) {\n        super.transferFrom(from, to, value);\n        int256 _magCorrection = magnifiedDividendPerShare\n            .mul(value)\n            .toInt256Safe();\n        magnifiedDividendCorrections[from] = magnifiedDividendCorrections[from]\n            .add(_magCorrection);\n        magnifiedDividendCorrections[to] = magnifiedDividendCorrections[to].sub(\n            _magCorrection\n        );\n        return true;\n    }\n\n    function mint(address account, uint256 value) public virtual {\n        super._mint(account, value);\n        magnifiedDividendCorrections[account] = magnifiedDividendCorrections[\n            account\n        ].sub((magnifiedDividendPerShare.mul(value)).toInt256Safe());\n    }\n\n    function burn(address account, uint256 value) public virtual {\n        super._burn(account, value);\n        magnifiedDividendCorrections[account] = magnifiedDividendCorrections[\n            account\n        ].add((magnifiedDividendPerShare.mul(value)).toInt256Safe());\n    }\n}\n"
      },
      "src/ERC315.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\n\n// The RefinERC represents an endeavor aimed at developing the Ethereum ecosystem through the implementation of the innovative ERC-315 standard.\n\npragma solidity ^0.8.23;\n\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {IERC315} from \"./interfaces/IERC315.sol\";\nimport {ERC315LPToken} from \"./ERC315LPToken.sol\";\n\nabstract contract ERC315 is IERC315, Context {\n    uint256 private _totalSupply;\n    string private _name;\n    string private _symbol;\n    address payable public lp;\n\n    uint256 public X;\n\n    mapping(address account => uint256) private _balances;\n    mapping(address account => uint32) private lastTransaction;\n\n    constructor(\n        string memory name_,\n        string memory symbol_,\n        uint256 totalSupply_,\n        address _initTransferAddr\n    ) {\n        _name = name_;\n        _symbol = symbol_;\n        _totalSupply = totalSupply_;\n        _balances[_initTransferAddr] = totalSupply_;\n        emit Transfer(address(0), _initTransferAddr, totalSupply_);\n    }\n\n    function name() public view virtual returns (string memory) {\n        return _name;\n    }\n\n    function symbol() public view virtual returns (string memory) {\n        return _symbol;\n    }\n\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    function totalSupply() public view virtual returns (uint256) {\n        return _totalSupply;\n    }\n\n    function balanceOf(address account) public view virtual returns (uint256) {\n        return _balances[account];\n    }\n\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        require(value > 0, \"invalid amount\");\n        _transfer(_msgSender(), to, value);\n        return true;\n    }\n\n    function _transfer(\n        address from,\n        address to,\n        uint256 value\n    ) internal virtual {\n        require(\n            lastTransaction[_msgSender()] != block.number,\n            \"You can't make two transactions in the same block\"\n        );\n\n        lastTransaction[_msgSender()] = uint32(block.number);\n\n        require(\n            _balances[from] >= value,\n            \"ERC20: transfer amount exceeds balance\"\n        );\n\n        unchecked {\n            _balances[from] = _balances[from] - value;\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                _totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                _balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    function getReserves() public view returns (uint256, uint256) {\n        return (address(this).balance, _balances[address(this)]);\n    }\n\n    function _getAmountOut(\n        uint256 value,\n        bool isbuy,\n        uint256 msgValue\n    ) internal view returns (uint256) {\n        require(X > 0, \"Liquidity not init\");\n        (uint256 reserveETH, uint256 reserveToken) = getReserves();\n\n        reserveETH = reserveETH - msgValue;\n\n        if (isbuy) {\n            return (value * reserveToken) / (X * value + X * reserveETH);\n        } else {\n            return (value * X * reserveETH) / (value + reserveToken);\n        }\n    }\n\n    function _getEthLPInitAmount(\n        uint256 tokenAmount,\n        uint256 tokenEthPrice\n    ) internal pure returns (uint256) {\n        return (tokenAmount / tokenEthPrice);\n    }\n\n    function _getLPAmount(\n        uint256 amountTokenIn\n    ) internal view returns (uint256 liquidity) {\n        liquidity =\n            (amountTokenIn * ERC315LPToken(lp).totalSupply()) /\n            _balances[address(this)];\n    }\n\n    function initiateLiquidity(\n        uint256 _tokenAmount,\n        uint256 _tokenEthPrice,\n        uint256 _x\n    ) public payable virtual {\n        require(_x > 0, \"Invalid X\");\n        require(X == 0, \"Liquidity already initiated\");\n        require(_tokenAmount > 0, \"Invalid token amount\");\n        require(_tokenEthPrice > 0, \"Invalid token price\");\n\n        _transfer(_msgSender(), address(this), _tokenAmount);\n\n        X = _x;\n\n        uint256 ethAmount = _getEthLPInitAmount(_tokenAmount, _tokenEthPrice);\n\n        require(msg.value >= ethAmount, \"Invalid ETH amount\");\n\n        if (msg.value > ethAmount) {\n            _safeTransferETH(_msgSender(), msg.value - ethAmount);\n        }\n\n        lp = payable(address(new ERC315LPToken()));\n\n        ERC315LPToken(lp).mint(_msgSender(), _tokenAmount);\n    }\n\n    function getETHInputAddLP(\n        uint256 tokenAmount\n    ) public view returns (uint256) {\n        return _getETHInputAddLP(tokenAmount, 0);\n    }\n\n    function _getETHInputAddLP(\n        uint256 tokenAmount,\n        uint256 msgValue\n    ) internal view returns (uint256) {\n        (uint256 reserveETH, uint256 reserveToken) = getReserves();\n        reserveETH = reserveETH - msgValue;\n        return (tokenAmount * reserveETH) / reserveToken;\n    }\n\n    function getOutputRemoveLP(\n        uint256 lpAmount\n    ) public view returns (uint256 token, uint256 eth) {\n        (uint256 reserveETH, uint256 reserveToken) = getReserves();\n        token = (lpAmount * reserveToken) / ERC315LPToken(lp).totalSupply();\n        eth = (lpAmount * reserveETH) / ERC315LPToken(lp).totalSupply();\n    }\n\n    function addLiquidity(\n        uint256 _tokenAmount,\n        uint256 _amountOutMin\n    ) public payable virtual {\n        require(X > 0, \"Liquidity not initiated\");\n        require(_tokenAmount > 0, \"Invalid token amount\");\n\n        uint256 ethRequired = _getETHInputAddLP(_tokenAmount, msg.value);\n\n        require(\n            msg.value > 0 && msg.value >= ethRequired,\n            \"invalid ETH amount\"\n        );\n        uint256 amountLp = _getLPAmount(_tokenAmount);\n\n        _transfer(_msgSender(), address(this), _tokenAmount);\n\n        if (_amountOutMin > 0) {\n            require(amountLp >= _amountOutMin, \"Slippage limit exceeded\");\n        }\n\n        ERC315LPToken(lp).mint(_msgSender(), amountLp);\n\n        if (msg.value > ethRequired) {\n            _safeTransferETH(_msgSender(), msg.value - ethRequired);\n        }\n\n        emit RAddLiquidity(_msgSender(), _tokenAmount, ethRequired, amountLp);\n    }\n\n    function removeLiquidity(\n        uint256 _lpAmount,\n        uint256 _amountTokenMin,\n        uint256 _amountEthMin\n    ) public virtual {\n        require(X > 0, \"Liquidity not initiated\");\n        require(_lpAmount > 0, \"Invalid LP amount\");\n\n        (uint256 amountToken, uint256 amountEth) = getOutputRemoveLP(_lpAmount);\n\n        if (_amountTokenMin > 0) {\n            require(\n                amountToken >= _amountTokenMin,\n                \"Slippage limit exceeded Token amount\"\n            );\n        }\n\n        if (_amountEthMin > 0) {\n            require(\n                amountEth >= _amountEthMin,\n                \"Slippage limit exceeded ETH amount\"\n            );\n        }\n\n        ERC315LPToken(lp).burn(_msgSender(), _lpAmount);\n\n        _transfer(address(this), _msgSender(), amountToken);\n\n        _safeTransferETH(_msgSender(), amountEth);\n\n        emit RRemoveLiquidity(_msgSender(), _lpAmount, amountToken, amountEth);\n    }\n\n    function _buy(uint256 _amountEth, address _to) internal virtual {\n        require(_amountEth > 0, \"eth amount too low\");\n        uint256 token_amount = _getAmountOut(_amountEth, true, _amountEth);\n        _transfer(address(this), _to, token_amount);\n        emit RSwap(_to, _amountEth, 0, 0, token_amount);\n    }\n\n    function _sell(uint256 _amountToken, address _to) internal virtual {\n        require(_amountToken > 0, \"token amount too low\");\n        uint256 ethAmount = _getAmountOut(_amountToken, false, 0);\n        require(ethAmount > 0, \"Sell amount too low\");\n        require(\n            address(this).balance >= ethAmount,\n            \"Insufficient ETH in reserves\"\n        );\n        _transfer(_to, address(this), _amountToken);\n        _safeTransferETH(_to, ethAmount);\n        emit RSwap(_to, 0, _amountToken, ethAmount, 0);\n    }\n\n    function _safeTransferETH(address to, uint256 amount) internal {\n        (bool sent, ) = payable(to).call{value: amount}(\"\");\n        require(sent, \"Failed to send Ether\");\n    }\n}\n"
      },
      "src/ERC315LPToken.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.23;\n\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {ERC20} from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {DividendTracker} from \"./DividendTracker.sol\";\n\ncontract ERC315LPToken is DividendTracker, Ownable {\n    event Claim(address indexed account, uint256 amount);\n\n    struct AccountInfo {\n        address account;\n        uint256 withdrawableDividends;\n        uint256 totalDividends;\n        uint256 lastClaimTime;\n    }\n\n    constructor()\n        DividendTracker(\"Liquidity Provide ERC315s\", \"LP-ERC315\")\n        Ownable(_msgSender())\n    {}\n\n    mapping(address => uint256) public lastClaimTimes;\n\n    uint private unlocked = 1;\n\n    modifier lock() {\n        require(unlocked == 1, \"LPToken: LOCKED\");\n        unlocked = 0;\n        _;\n        unlocked = 1;\n    }\n\n    function claimRewards() external {\n        uint256 amount = _withdrawDividendOfUser(payable(_msgSender()));\n\n        if (amount > 0) {\n            lastClaimTimes[_msgSender()] = block.timestamp;\n            emit Claim(_msgSender(), amount);\n        }\n    }\n\n    function getAccount(\n        address account\n    ) public view returns (address, uint256, uint256, uint256, uint256) {\n        AccountInfo memory info;\n        info.account = account;\n        info.withdrawableDividends = withdrawableDividendOf(account);\n        info.totalDividends = accumulativeDividendOf(account);\n        info.lastClaimTime = lastClaimTimes[account];\n        return (\n            info.account,\n            info.withdrawableDividends,\n            info.totalDividends,\n            info.lastClaimTime,\n            totalDividendsWithdrawn\n        );\n    }\n\n    function mint(address to, uint256 amount) public override lock onlyOwner {\n        super.mint(to, amount);\n    }\n\n    function burn(address from, uint256 amount) public override lock onlyOwner {\n        super.burn(from, amount);\n    }\n\n    function burnLP(uint256 amount) public lock {\n        super.burn(_msgSender(), amount);\n    }\n\n    receive() external payable {\n        uint256 totalAmount = msg.value;\n        if (totalSupply() > 0) {\n            _distribute(totalAmount);\n        }\n    }\n}\n"
      },
      "src/ERC315Token.sol": {
        "content": "// The RefinERC represents an endeavor aimed at developing the Ethereum ecosystem through the implementation of the innovative ERC-315 standard.\n\n// Website: https://refinerc.com\n// Docs: https://docs.refinerc.com\n// Twitter: https://x.com/refinerc\n// Telegram: https://t.me/Refinerc\n// Mail: contact@refinerc.com\n\n// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.23;\n\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {ERC315} from \"./ERC315.sol\";\n\ncontract ERC315Token is ERC315, Ownable, ReentrancyGuard {\n    event FeeAddressChanged(address newAddress);\n    event LimitRemoved();\n\n    // ERC315 publicly opens the \"addLiquidity\" function to all liquidity providers (an improvement to ERC314).\n    // Liquidity providers will receive LP-ERC315 tokens when addLiquidity,\n    // it is like dividend tokens so 0.3% trading fee can be easily allocated,\n    // liquidity providers receive this fee by calling the function collect fees.\n    uint256 public constant LIQUIDITY_PROVIDE_SHARE = 300; // 0.3%\n\n    uint256 public immutable TOTAL_SUPPLY;\n    uint256 public immutable BUY_TAX;\n    uint256 public immutable SELL_TAX;\n    uint256 public MAX_WALLET;\n\n    mapping(address => bool) private _isExcludedFromFees;\n    address public feeAddress;\n\n    constructor(\n        uint256 _buyTax,\n        uint256 _sellTax,\n        string memory _name,\n        string memory _symbol,\n        uint256 _initSupply,\n        address _initOwner,\n        uint256 _maxBuyAmount\n    ) ERC315(_name, _symbol, _initSupply, _initOwner) Ownable(_initOwner) {\n        require(_buyTax <= 5, \"Buy tax too high\");\n        require(_sellTax <= 5, \"Sell tax too high\");\n        feeAddress = _initOwner;\n        BUY_TAX = _buyTax;\n        SELL_TAX = _sellTax;\n        TOTAL_SUPPLY = _initSupply;\n        MAX_WALLET = _maxBuyAmount;\n    }\n\n    function excludedFromFees(\n        address _address,\n        bool _value\n    ) external onlyOwner {\n        _isExcludedFromFees[_address] = _value;\n    }\n\n    function removeLimits() external onlyOwner {\n        require(MAX_WALLET != TOTAL_SUPPLY, \"Limits already removed\");\n        MAX_WALLET = TOTAL_SUPPLY;\n        emit LimitRemoved();\n    }\n\n    function getExcludedFromFees(address _address) public view returns (bool) {\n        return _isExcludedFromFees[_address];\n    }\n\n    function getEthLPInitAmount(\n        uint256 tokenAmount,\n        uint256 tokenEthPrice\n    ) public pure returns (uint256) {\n        return _getEthLPInitAmount(tokenAmount, tokenEthPrice);\n    }\n\n    function getAmountOut(\n        uint256 value,\n        bool isbuy\n    ) public view returns (uint256) {\n        return _getAmountOut(value, isbuy, 0);\n    }\n\n    function getLPAmount(uint256 amountTokenIn) public view returns (uint256) {\n        return _getLPAmount(amountTokenIn);\n    }\n\n    function initiateLiquidity(\n        uint256 _tokenAmount,\n        uint256 _tokenEthPrice,\n        uint256 _x\n    ) public payable override onlyOwner {\n        super.initiateLiquidity(_tokenAmount, _tokenEthPrice, _x);\n    }\n\n    function addLiquidity(\n        uint256 _tokenAmount,\n        uint256 _amountOutMin\n    ) public payable override nonReentrant {\n        super.addLiquidity(_tokenAmount, _amountOutMin);\n    }\n\n    function removeLiquidity(\n        uint256 _lpAmount,\n        uint256 _tokenAmountMin,\n        uint256 _ethAmountMin\n    ) public override nonReentrant {\n        super.removeLiquidity(_lpAmount, _tokenAmountMin, _ethAmountMin);\n    }\n\n    function sellAntiBot(\n        uint256 _amountToken,\n        uint256 _amountOutMin\n    ) external nonReentrant {\n        uint256 ethAmount = _getAmountOut(_amountToken, false, 0);\n        if (_amountOutMin > 0) {\n            require(ethAmount >= _amountOutMin, \"Slippage limit exceeded\");\n        }\n        _sell(_amountToken, _msgSender());\n    }\n\n    function buyAntiBot(uint256 _amountOutMin) external payable nonReentrant {\n        require(X > 0, \"Liquidity not initiated\");\n        uint256 token_amount = _getAmountOut(msg.value, true, msg.value);\n        if (_amountOutMin > 0) {\n            require(token_amount >= _amountOutMin, \"Slippage limit exceeded\");\n        }\n        _buy(msg.value, _msgSender());\n    }\n\n    function _transfer(\n        address from,\n        address to,\n        uint256 value\n    ) internal override {\n        if (from == address(this)) {\n            require(value + balanceOf(to) < MAX_WALLET, \"Max amount exceeded\");\n        }\n        super._transfer(from, to, value);\n    }\n\n    function _buy(uint256 ethAmount, address to) internal override {\n        if (!_isExcludedFromFees[to] && BUY_TAX > 0) {\n            uint256 fee = (ethAmount * BUY_TAX) / 100;\n            if (fee > 0) {\n                _safeTransferETH(feeAddress, fee);\n            }\n            uint256 LPS = (ethAmount * LIQUIDITY_PROVIDE_SHARE) / 100000;\n            if (LPS > 0) {\n                _safeTransferETH(lp, LPS);\n            }\n            ethAmount = ethAmount - fee - LPS;\n        }\n        super._buy(ethAmount, to);\n    }\n\n    function _sell(uint256 tokenAmount, address to) internal override {\n        require(tokenAmount > 0, \"token amount too low\");\n\n        _transfer(to, address(this), tokenAmount);\n\n        uint256 ethAmount = _getAmountOut(tokenAmount, false, 0);\n\n        require(ethAmount > 0, \"Sell amount too low\");\n\n        if (address(this).balance < ethAmount) {\n            ethAmount = address(this).balance;\n        }\n\n        emit RSwap(to, 0, tokenAmount, ethAmount, 0);\n\n        if (!_isExcludedFromFees[to] && SELL_TAX > 0) {\n            uint256 fee = (ethAmount * SELL_TAX) / 100;\n            if (fee > 0) {\n                _safeTransferETH(feeAddress, fee);\n            }\n            uint256 LPS = (ethAmount * LIQUIDITY_PROVIDE_SHARE) / 100000;\n            if (LPS > 0) {\n                _safeTransferETH(lp, LPS);\n            }\n            ethAmount = ethAmount - fee - LPS;\n        }\n        _safeTransferETH(to, ethAmount);\n    }\n\n    function transfer(\n        address to,\n        uint256 value\n    ) public override returns (bool) {\n        if (to == address(this)) {\n            _sell(value, _msgSender());\n        } else {\n            super.transfer(to, value);\n        }\n        return true;\n    }\n\n    function changeFeeAddress(address _newAddress) external {\n        require(\n            _msgSender() == owner() || _msgSender() == feeAddress,\n            \"caller is not the owner\"\n        );\n        feeAddress = _newAddress;\n        emit FeeAddressChanged(_newAddress);\n    }\n\n    receive() external payable {\n        uint256 ethAmount = msg.value;\n        _buy(ethAmount, _msgSender());\n    }\n}\n"
      },
      "src/Factory.sol": {
        "content": "// The RefinERC represents an endeavor aimed at developing the Ethereum ecosystem through the implementation of the innovative ERC-315 standard.\n\n// Website: https://refinerc.com\n// Docs: https://docs.refinerc.com\n// Twitter: https://x.com/refinerc\n// Telegram: https://t.me/Refinerc\n// Mail: contact@refinerc.com\n\n// SPDX-License-Identifier: UNLICENSED\n\nimport {OwnableUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport {EnumerableSet} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {ERC315Token} from \"./ERC315Token.sol\";\n\npragma solidity ^0.8.23;\n\ncontract Factory is OwnableUpgradeable {\n    using EnumerableSet for EnumerableSet.UintSet;\n\n    event NewToken(address indexed token, address indexed user);\n    event NewLocked(\n        address indexed token,\n        address indexed user,\n        uint256 amount,\n        uint256 unlockTime\n    );\n    event ExtendLock(uint256 indexed lockId, uint256 newUnlockTime);\n    event WithdrawLock(uint256 indexed lockId);\n\n    struct Lock {\n        address lpToken;\n        address user;\n        uint256 amount;\n        uint256 unlockTime;\n        bool claimed;\n    }\n\n    uint256 public totalTokenCreated;\n    uint256 public currentLockId;\n    uint256 public creationFee;\n    uint256 public lockFee;\n    address public feeAddress;\n\n    // lockId => Lock\n    mapping(uint256 => Lock) internal lockeds;\n\n    // userAddress => lockedIds\n    mapping(address => EnumerableSet.UintSet) private usersLockedIds;\n\n    // tokenAddress => amount\n    mapping(address => uint256) public totalAmountLocked;\n\n    function initialize() public initializer {\n        __Ownable_init(_msgSender());\n        creationFee = 0;\n        lockFee = 0;\n        feeAddress = _msgSender();\n        totalTokenCreated = 0;\n        currentLockId = 0;\n    }\n\n    function createToken(\n        string memory name,\n        string memory symbol,\n        uint256 totalSupply,\n        uint256 buyTax,\n        uint256 sellTax,\n        uint256 maxBuyAmount\n    ) external payable {\n        if (creationFee > 0) {\n            require(msg.value == creationFee, \"Factory: fee not met\");\n            _safeTransferETH(feeAddress, msg.value);\n        }\n        ERC315Token token = new ERC315Token(\n            buyTax,\n            sellTax,\n            name,\n            symbol,\n            totalSupply,\n            _msgSender(),\n            maxBuyAmount\n        );\n        totalTokenCreated++;\n        emit NewToken(address(token), _msgSender());\n    }\n\n    function lock(\n        address lpToken,\n        uint256 amount,\n        uint256 unLockTime\n    ) external payable {\n        currentLockId++;\n        require(amount > 0, \"Factory: amount not valid\");\n        require(unLockTime > block.timestamp, \"Factory: unlock time not valid\");\n\n        IERC20(lpToken).transferFrom(_msgSender(), address(this), amount);\n\n        if (lockFee > 0) {\n            require(msg.value >= lockFee, \"Factory: fee not met\");\n            _safeTransferETH(feeAddress, lockFee);\n            if (msg.value > lockFee) {\n                _safeTransferETH(_msgSender(), msg.value - lockFee);\n            }\n        }\n\n        lockeds[currentLockId] = Lock({\n            lpToken: lpToken,\n            user: _msgSender(),\n            amount: amount,\n            unlockTime: unLockTime,\n            claimed: false\n        });\n\n        usersLockedIds[_msgSender()].add(currentLockId);\n        totalAmountLocked[lpToken] += amount;\n\n        emit NewLocked(lpToken, _msgSender(), amount, unLockTime);\n    }\n\n    function extendLock(uint256 lockId, uint256 newUnlockTime) external {\n        require(lockeds[lockId].user == _msgSender(), \"Factory: not owner\");\n        require(\n            !lockeds[lockId].claimed,\n            \"Factory: already claimed, can't extend\"\n        );\n        require(\n            lockeds[lockId].unlockTime < newUnlockTime &&\n                newUnlockTime > block.timestamp,\n            \"Factory: new unlock time not valid\"\n        );\n        lockeds[lockId].unlockTime = newUnlockTime;\n\n        emit ExtendLock(lockId, newUnlockTime);\n    }\n\n    function withdrawLock(uint256 lockId) external {\n        require(lockeds[lockId].user == _msgSender(), \"Factory: not owner\");\n        require(\n            lockeds[lockId].unlockTime < block.timestamp,\n            \"Factory: not unlock yet\"\n        );\n        require(!lockeds[lockId].claimed, \"Factory: already claimed\");\n\n        lockeds[lockId].claimed = true;\n        totalAmountLocked[lockeds[lockId].lpToken] -= lockeds[lockId].amount;\n\n        IERC20(lockeds[lockId].lpToken).transfer(\n            _msgSender(),\n            lockeds[lockId].amount\n        );\n\n        emit WithdrawLock(lockId);\n    }\n\n    function setCreationFee(uint256 _fee) external onlyOwner {\n        creationFee = _fee;\n    }\n\n    function setLockFee(uint256 _fee) external onlyOwner {\n        lockFee = _fee;\n    }\n\n    function setFeeAddress(address _address) external onlyOwner {\n        feeAddress = _address;\n    }\n\n    function _safeTransferETH(address to, uint256 amount) internal {\n        (bool sent, ) = payable(to).call{value: amount}(\"\");\n        require(sent, \"Failed to send Ether\");\n    }\n\n    function getLockLength(address user) external view returns (uint256) {\n        return usersLockedIds[user].length();\n    }\n\n    function getLockId(\n        address user,\n        uint256 index\n    ) external view returns (uint256) {\n        return usersLockedIds[user].at(index);\n    }\n}\n"
      },
      "src/interfaces/IDividendTracker.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.23;\n\ninterface IDividendTracker {\n    /// @notice View the amount of dividend in wei that an address can withdraw.\n    /// @param _owner The address of a token holder.\n    /// @return The amount of dividend in wei that `_owner` can withdraw.\n    function dividendOf(address _owner) external view returns (uint256);\n\n    /// @notice View the amount of dividend in wei that an address can withdraw.\n    /// @param _owner The address of a token holder.\n    /// @return The amount of dividend in wei that `_owner` can withdraw.\n    function withdrawableDividendOf(\n        address _owner\n    ) external view returns (uint256);\n\n    /// @notice View the amount of dividend in wei that an address has withdrawn.\n    /// @param _owner The address of a token holder.\n    /// @return The amount of dividend in wei that `_owner` has withdrawn.\n    function withdrawnDividendOf(\n        address _owner\n    ) external view returns (uint256);\n\n    /// @notice View the amount of dividend in wei that an address has earned in total.\n    /// @dev accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner)\n    /// @param _owner The address of a token holder.\n    /// @return The amount of dividend in wei that `_owner` has earned in total.\n    function accumulativeDividendOf(\n        address _owner\n    ) external view returns (uint256);\n\n    /// @dev This event MUST emit when ether is distributed to token holders.\n    /// @param from The address which sends ether to this contract.\n    /// @param weiAmount The amount of distributed ether in wei.\n    event DividendsDistributed(address indexed from, uint256 weiAmount);\n\n    /// @dev This event MUST emit when an address withdraws their dividend.\n    /// @param to The address which withdraws ether from this contract.\n    /// @param weiAmount The amount of withdrawn ether in wei.\n    event DividendWithdrawn(address indexed to, uint256 weiAmount);\n}\n"
      },
      "src/interfaces/IERC315.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.8.23;\n\ninterface IERC315 {\n    event Transfer(address indexed from, address indexed to, uint256 value);\n    event RAddLiquidity(\n        address indexed from,\n        uint256 token,\n        uint256 eth,\n        uint256 liquidity\n    );\n    event RRemoveLiquidity(\n        address indexed from,\n        uint256 token,\n        uint256 eth,\n        uint256 liquidity\n    );\n    event RSwap(\n        address indexed sender,\n        uint amount0In,\n        uint amount1In,\n        uint amount0Out,\n        uint amount1Out\n    );\n}\n"
      },
      "src/libs/SafeMath.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.6;\n\nlibrary SafeMath {\n    /**\n     * @dev Returns the addition of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `+` operator.\n     *\n     * Requirements:\n     *\n     * - Addition cannot overflow.\n     */\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\n        uint256 c = a + b;\n        require(c >= a, \"SafeMath: addition overflow\");\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n        return sub(a, b, \"SafeMath: subtraction overflow\");\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(\n        uint256 a,\n        uint256 b,\n        string memory errorMessage\n    ) internal pure returns (uint256) {\n        require(b <= a, errorMessage);\n        uint256 c = a - b;\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `*` operator.\n     *\n     * Requirements:\n     *\n     * - Multiplication cannot overflow.\n     */\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n        // benefit is lost if 'b' is also tested.\n        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n        if (a == 0) {\n            return 0;\n        }\n\n        uint256 c = a * b;\n        require(c / a == b, \"SafeMath: multiplication overflow\");\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers. Reverts on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\n        return div(a, b, \"SafeMath: division by zero\");\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(\n        uint256 a,\n        uint256 b,\n        string memory errorMessage\n    ) internal pure returns (uint256) {\n        require(b > 0, errorMessage);\n        uint256 c = a / b;\n        // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * Reverts when dividing by zero.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n        return mod(a, b, \"SafeMath: modulo by zero\");\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * Reverts with custom message when dividing by zero.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(\n        uint256 a,\n        uint256 b,\n        string memory errorMessage\n    ) internal pure returns (uint256) {\n        require(b != 0, errorMessage);\n        return a % b;\n    }\n}\n\n/**\n * @title SafeMathInt\n * @dev Math operations for int256 with overflow safety checks.\n */\nlibrary SafeMathInt {\n    int256 private constant MIN_INT256 = int256(1) << 255;\n    int256 private constant MAX_INT256 = ~(int256(1) << 255);\n\n    /**\n     * @dev Multiplies two int256 variables and fails on overflow.\n     */\n    function mul(int256 a, int256 b) internal pure returns (int256) {\n        int256 c = a * b;\n\n        // Detect overflow when multiplying MIN_INT256 with -1\n        require(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256));\n        require((b == 0) || (c / b == a));\n        return c;\n    }\n\n    /**\n     * @dev Division of two int256 variables and fails on overflow.\n     */\n    function div(int256 a, int256 b) internal pure returns (int256) {\n        // Prevent overflow when dividing MIN_INT256 by -1\n        require(b != -1 || a != MIN_INT256);\n\n        // Solidity already throws when dividing by 0.\n        return a / b;\n    }\n\n    /**\n     * @dev Subtracts two int256 variables and fails on overflow.\n     */\n    function sub(int256 a, int256 b) internal pure returns (int256) {\n        int256 c = a - b;\n        require((b >= 0 && c <= a) || (b < 0 && c > a));\n        return c;\n    }\n\n    /**\n     * @dev Adds two int256 variables and fails on overflow.\n     */\n    function add(int256 a, int256 b) internal pure returns (int256) {\n        int256 c = a + b;\n        require((b >= 0 && c >= a) || (b < 0 && c < a));\n        return c;\n    }\n\n    /**\n     * @dev Converts to absolute value, and fails on overflow.\n     */\n    function abs(int256 a) internal pure returns (int256) {\n        require(a != MIN_INT256);\n        return a < 0 ? -a : a;\n    }\n\n    function toUint256Safe(int256 a) internal pure returns (uint256) {\n        require(a >= 0);\n        return uint256(a);\n    }\n}\n\n/**\n * @title SafeMathUint\n * @dev Math operations with safety checks that revert on error\n */\nlibrary SafeMathUint {\n    function toInt256Safe(uint256 a) internal pure returns (int256) {\n        int256 b = int256(a);\n        require(b >= 0);\n        return b;\n    }\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "evmVersion": "paris",
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}