creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "@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"
      },
      "src/Airdrop.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.23;\n\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {ERC315} from \"./ERC315.sol\";\n\ncontract Airdrop is Ownable {\n    event ClaimAirdrop(address indexed account, uint256 amount);\n\n    ERC315 public token;\n    bool public airdropActive = false;\n    address adminAddress;\n    mapping(address => bool) public claimed;\n\n    constructor(address _admin) Ownable(_msgSender()) {\n        adminAddress = _admin;\n    }\n\n    modifier onlyActive() {\n        require(airdropActive, \"Airdrop: Airdrop is not active\");\n        _;\n    }\n\n    function setAirdropActive(bool _active) external onlyOwner {\n        airdropActive = _active;\n    }\n\n    function setAdmin(address _admin) external onlyOwner {\n        adminAddress = _admin;\n    }\n\n    function setToken(address _token) external onlyOwner {\n        token = ERC315(_token);\n    }\n\n    function claimAirdrop(\n        uint256 _amount,\n        bytes memory _signature\n    ) external onlyActive {\n        require(!claimed[_msgSender()], \"claimed\");\n        require(\n            verify(adminAddress, _msgSender(), _amount, _signature),\n            \"Airdrop: Invalid signature\"\n        );\n        claimed[_msgSender()] = true;\n        token.transfer(_msgSender(), _amount);\n        emit ClaimAirdrop(_msgSender(), _amount);\n    }\n\n    function safuToken(address _token, uint256 _amount) external onlyOwner {\n        if (_token == address(0)) {\n            payable(_msgSender()).transfer(_amount);\n        } else {\n            token.transfer(_msgSender(), _amount);\n        }\n    }\n\n    function getMessageHash(\n        address _to,\n        uint256 _amount\n    ) public pure returns (bytes32) {\n        return keccak256(abi.encodePacked(_to, _amount));\n    }\n\n    function getEthSignedMessageHash(\n        bytes32 _messageHash\n    ) public pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encodePacked(\n                    \"\\x19Ethereum Signed Message:\\n32\",\n                    _messageHash\n                )\n            );\n    }\n\n    function verify(\n        address _signer,\n        address _to,\n        uint256 _amount,\n        bytes memory signature\n    ) public pure returns (bool) {\n        bytes32 messageHash = getMessageHash(_to, _amount);\n        bytes32 ethSignedMessageHash = getEthSignedMessageHash(messageHash);\n        return recoverSigner(ethSignedMessageHash, signature) == _signer;\n    }\n\n    function recoverSigner(\n        bytes32 _ethSignedMessageHash,\n        bytes memory _signature\n    ) public pure returns (address) {\n        (bytes32 r, bytes32 s, uint8 v) = splitSignature(_signature);\n\n        return ecrecover(_ethSignedMessageHash, v, r, s);\n    }\n\n    function splitSignature(\n        bytes memory sig\n    ) public pure returns (bytes32 r, bytes32 s, uint8 v) {\n        require(sig.length == 65, \"invalid signature length\");\n\n        assembly {\n            r := mload(add(sig, 32))\n            s := mload(add(sig, 64))\n            v := byte(0, mload(add(sig, 96)))\n        }\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/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": {}
    }
  }}