{"sources":{"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\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 Indicates that the contract has been initialized.\n     * @custom:oz-retyped-from bool\n     */\n    uint8 private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint8 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 functions marked with `initializer` can be nested in the context of a\n     * constructor.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        bool isTopLevelCall = !_initializing;\n        require(\n            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n            \"Initializable: contract is already initialized\"\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 255 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint8 version) {\n        require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\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        require(_initializing, \"Initializable: contract is not initializing\");\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        require(!_initializing, \"Initializable: contract is initializing\");\n        if (_initialized != type(uint8).max) {\n            _initialized = type(uint8).max;\n            emit Initialized(type(uint8).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint8) {\n        return _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 _initializing;\n    }\n}\n"},"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     *\n     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"},"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n *     doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n *     token.safeTransferFrom(msg.sender, address(this), value);\n *     ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     *\n     * CAUTION: See Security Considerations above.\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"},"@openzeppelin/contracts/token/ERC20/IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\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 amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` 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 amount) 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 `amount` as the allowance of `spender` over the 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 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` 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 amount) external returns (bool);\n}\n"},"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/IERC20Permit.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using Address for address;\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(IERC20 token, address spender, uint256 value) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        unchecked {\n            uint256 oldAllowance = token.allowance(address(this), spender);\n            require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n     * Revert on invalid signature.\n     */\n    function safePermit(\n        IERC20Permit token,\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal {\n        uint256 nonceBefore = token.nonces(owner);\n        token.permit(owner, spender, value, deadline, v, r, s);\n        uint256 nonceAfter = token.nonces(owner);\n        require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n        // and not revert is the subcall reverts.\n\n        (bool success, bytes memory returndata) = address(token).call(data);\n        return\n            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n    }\n}\n"},"@openzeppelin/contracts/utils/Address.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     *\n     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"},"contracts/src/Minting/MinterManagerInterface.sol":{"content":"//SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.11;\n\n/**\n * @title MinterManagementInterface\n * @notice Interface that defines external functions for managing minters and their allowances.\n * @dev Implementing contracts should provide functionality for adding, removing, and configuring minters.\n */\ninterface MinterManagementInterface {\n    /**\n     * @notice Checks if an account is a registered minter.\n     * @param _account The address to check.\n     * @return A boolean indicating whether the address is a minter.\n     */\n    function isMinter(address _account) external view returns (bool);\n\n    /**\n     * @notice Gets the allowance of a minter.\n     * @param _minter The address of the minter.\n     * @return The amount of tokens the minter is allowed to mint.\n     */\n    function getMinterAllowance(address _minter) external view returns (uint256);\n\n    /**\n     * @notice Configures a new minter or updates the allowance of an existing minter.\n     * @param _minter The address of the minter.\n     * @param _minterAllowedAmount The new allowance for the minter.\n     * @return A boolean indicating whether the configuration was successful.\n     */\n    function configureMinter(address _minter, uint256 _minterAllowedAmount) external returns (bool);\n\n    /**\n     * @notice Removes a minter.\n     * @param _minter The address of the minter to remove.\n     * @return A boolean indicating whether the removal was successful.\n     */\n    function removeMinter(address _minter) external returns (bool);\n}\n"},"contracts/src/TokenContracts/AbstractTokenV1.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.11;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/**\n * @title AbstractTokenV1\n * @dev Abstract contract for ERC20 token operations. Defines internal functions for approving and transferring tokens.\n * Inherits from the IERC20 interface.\n */\nabstract contract AbstractTokenV1 is IERC20 {\n    /**\n     * @notice Internal function to set the allowance for a spender over the owner's tokens.\n     * @param owner The address of the token owner.\n     * @param spender The address of the spender.\n     * @param value The amount of tokens the spender is allowed to spend.\n     * @dev This function must be overridden in the derived contract.\n     */\n    function _approve(address owner, address spender, uint256 value) internal virtual;\n\n    /**\n     * @notice Internal function to transfer tokens from one address to another.\n     * @param from The address of the token sender.\n     * @param to The address of the token recipient.\n     * @param value The amount of tokens to transfer.\n     * @dev This function must be overridden in the derived contract.\n     */\n    function _transfer(address from, address to, uint256 value) internal virtual;\n\n    // Storage Gap for future upgrades\n    uint256[49] private __gap;\n}\n"},"contracts/src/TokenContracts/Blacklistable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.11;\n\nimport {PermissionAdmin} from \"./PermissionAdmin.sol\";\n\n/**\n * @title Blacklistable\n * @notice Contract that allows accounts to be blacklisted by a \"blacklister\" role.\n * @dev Inherits from PermissionAdmin to manage blacklister permissions.\n */\nabstract contract Blacklistable is PermissionAdmin {\n    address internal _blacklister;\n    mapping(address => bool) public blacklisted;\n\n    /// @notice Emitted when an account is blacklisted.\n    /// @param _account The address of the blacklisted account.\n    event Blacklisted(address indexed _account);\n\n    /// @notice Emitted when an account is removed from the blacklist.\n    /// @param _account The address of the unblacklisted account.\n    event UnBlacklisted(address indexed _account);\n\n    /// @notice Emitted when the blacklister is changed.\n    /// @param newBlacklister The address of the new blacklister.\n    event BlacklisterChanged(address indexed newBlacklister);\n\n    /// @notice Error thrown when the caller is not the blacklister.\n    error Blacklistable__CallerNotBlacklister();\n\n    /// @notice Error thrown when trying to perform an operation with the zero address, which is prohibited.\n    error Blacklistable__NoZeroAddress();\n\n    /// @notice Error thrown when the account is already blacklisted.\n    /// @param account The address that is already blacklisted.\n    error Blacklistable__AccountBlacklisted(address account);\n\n    /// @notice Error thrown when the blacklister tries to blacklist themselves.\n    error Blacklistable__BlacklisterSelfBlacklist();\n\n    /// @notice Error thrown when trying to unblacklist an address that is already non blacklisted.\n    error Blacklistable__NotBlacklisted(address account);\n\n    /**\n     * @dev Modifier to make a function callable only by the blacklister.\n     */\n    modifier onlyBlacklister() {\n        if (msg.sender != _blacklister) revert Blacklistable__CallerNotBlacklister();\n        _;\n    }\n\n    /**\n    * @dev Ensures the specified account is not blacklisted and the blacklister is properly set.\n    * @param _account The address to check for blacklisting.\n    * @custom:revert Blacklistable__NoZeroAddress if the blacklister address has not been set (is zero).\n    * @custom:revert Blacklistable__AccountBlacklisted if the account is blacklisted.\n    */\n    modifier notBlacklisted(address _account) {\n        if (_blacklister == address(0)) revert Blacklistable__NoZeroAddress();\n        if (blacklisted[_account]) revert Blacklistable__AccountBlacklisted(_account);\n        _;\n    }\n\n    /**\n     * @notice Returns the current blacklister.\n     * @return The address of the current blacklister.\n     */\n    function getBlacklister() external view returns (address) {\n        return _blacklister;\n    }\n\n    /**\n     * @notice Checks if an account is blacklisted.\n     * @param _account The address to check.\n     * @return True if the account is blacklisted, false otherwise.\n     */\n    function isBlacklisted(address _account) external view returns (bool) {\n        return blacklisted[_account];\n    }\n\n    /**\n     * @notice Adds an account to the blacklist.\n     * @param _account The address to blacklist.\n     * @dev Emits a {Blacklisted} event.\n     * @dev Can only be called by the current blacklister.\n     * @dev The address cannot be the zero address or the blacklister's own address.\n     */\n    function blacklist(address _account) external onlyBlacklister {\n        if (blacklisted[_account]) revert Blacklistable__AccountBlacklisted(_account);\n        if (_account == _blacklister) revert Blacklistable__BlacklisterSelfBlacklist();\n        if (_account == address(0)) revert Blacklistable__NoZeroAddress();\n        blacklisted[_account] = true;\n        emit Blacklisted(_account);\n    }\n\n    /**\n     * @notice Removes an account from the blacklist.\n     * @param _account The address to remove from the blacklist.\n     * @dev Emits an {UnBlacklisted} event.\n     * @dev Can only be called by the current blacklister.\n     */\n    function unBlacklist(address _account) external onlyBlacklister {\n         if (!blacklisted[_account]) revert Blacklistable__NotBlacklisted(_account);\n        blacklisted[_account] = false;\n        emit UnBlacklisted(_account);\n    }\n\n    /**\n     * @notice Updates the blacklister role to a new address.\n     * @param _newBlacklister The address of the new blacklister.\n     * @dev Emits a {BlacklisterChanged} event.\n     * @dev Can only be called by the permission admin.\n     * @dev The new blacklister address cannot be the zero address.\n     */\n    function updateBlacklister(address _newBlacklister) external onlyPermissionAdmin {\n        if (_newBlacklister == address(0)) revert Blacklistable__NoZeroAddress();\n        _blacklister = _newBlacklister;\n        emit BlacklisterChanged(_blacklister);\n    }\n\n    // Storage Gap for future upgrades\n    uint256[49] private __gap;\n}\n"},"contracts/src/TokenContracts/Ownable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.11;\n\nimport {Initializable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * @title Ownable\n * @dev The Ownable contract has an owner address and provides basic authorization control functions.\n * Inherits from Initializable for upgradeable contract pattern.\n */\ncontract Ownable is Initializable {\n    // Address of the contract owner\n    address private _owner;\n\n    // Address of the pending owner\n    address private _pendingOwner;\n\n    /**\n     * @notice Error thrown when a zero address is provided.\n     */\n    error Ownable__NoZeroAddress();\n\n    /**\n     * @notice Error thrown when a caller is not the owner.\n     */\n    error Ownable__CallerNotOwner();\n\n    /**\n     * @notice Error thrown when a caller is not the pending owner.\n     */\n    error Ownable__CallerNotPendingOwner();\n\n    /**\n     * @dev Event emitted when ownership is transferred.\n     * @param previousOwner The address of the previous owner.\n     * @param newOwner The address of the new owner.\n     */\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Event emitted when ownership transfer is started.\n     * @param previousOwner The address of the previous owner.\n     * @param newOwner The address of the new owner.\n     */\n    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Modifier to check if the caller is the owner.\n     */\n    modifier onlyOwner() {\n        if (msg.sender != _owner) revert Ownable__CallerNotOwner();\n        _;\n    }\n\n    /**\n     * @dev Modifier to check if the caller is the pending owner.\n     */\n    modifier onlyPendingOwner() {\n        if (msg.sender != _pendingOwner) revert Ownable__CallerNotPendingOwner();\n        _;\n    }\n\n    /**\n     * @notice Initializes the contract setting the deployer as the initial owner.\n     * @param owner The address of the initial owner.\n     */\n    function initialize(address owner) public onlyInitializing {\n        setOwner(owner);\n    }\n\n    /**\n     * @notice Returns the address of the current owner.\n     * @return The address of the owner.\n     */\n    function getOwner() external view returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @notice Returns the address of the pending owner.\n     * @return The address of the pending owner.\n     */\n    function getPendingOwner() external view returns (address) {\n        return _pendingOwner;\n    }\n\n    /**\n     * @dev Sets a new owner address internally.\n     * @param newOwner The address to set as the new owner.\n     */\n    function setOwner(address newOwner) internal {\n        _owner = newOwner;\n    }\n\n    /**\n     * @notice Starts the ownership transfer of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     * @param newOwner The address to transfer ownership to.\n     */\n    function transferOwnership(address newOwner) external onlyOwner {\n        if (newOwner == address(0)) revert Ownable__NoZeroAddress();\n        _pendingOwner = newOwner;\n        emit OwnershipTransferStarted(_owner, newOwner);\n    }\n\n    /**\n     * @notice The new owner accepts the ownership transfer.\n     * Can only be called by the pending owner.\n     */\n    function acceptOwnership() external onlyPendingOwner {\n        address oldOwner = _owner;\n        setOwner(_pendingOwner);\n        _pendingOwner = address(0);\n        emit OwnershipTransferred(oldOwner, _owner);\n    }\n\n    // Storage Gap for future upgrades\n    uint256[49] private __gap;\n}"},"contracts/src/TokenContracts/Pausable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.11;\n\nimport {PermissionAdmin} from \"./PermissionAdmin.sol\";\n\n/**\n * @title Pausable\n * @notice Base contract which allows children to implement an emergency stop mechanism.\n * @dev Inherits from PermissionAdmin to manage pauser permissions.\n */\nabstract contract Pausable is PermissionAdmin {\n    address internal _pauser;\n    bool public paused;\n\n    /// @notice Emitted when the contract is paused.\n    event Paused();\n\n    /// @notice Emitted when the contract is unpaused.\n    event Unpaused();\n\n    /// @notice Emitted when the pauser is changed.\n    /// @param newPauser The address of the new pauser.\n    event PauserChanged(address indexed newPauser);\n\n    /// @notice Error thrown when trying to perform an action while the contract is paused.\n    error Pausable__Paused();\n\n    /// @notice Error thrown when the caller is not the pauser.\n    error Pausable__CallerNotPauser();\n\n    /// @notice Error thrown when trying to pause the contract when it is already paused.\n    error Pausable__AlreadyPaused();\n\n    /// @notice Error thrown when trying to unpause the contract when it is not paused.\n    error Pausable__AlreadyUnpaused();\n\n    /// @notice Error thrown when trying to set the pauser to the zero address.\n    error Pausable__NoZeroAddress();\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     */\n    modifier whenNotPaused() {\n        if (paused) revert Pausable__Paused();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only by the pauser.\n     */\n    modifier onlyPauser() {\n        if (msg.sender != _pauser) revert Pausable__CallerNotPauser();\n        _;\n    }\n\n    /**\n     * @notice Returns the current pauser.\n     * @return The address of the current pauser.\n     */\n    function getPauser() external view returns (address) {\n        return _pauser;\n    }\n\n    /**\n     * @notice Called by the pauser to pause the contract, triggering the stopped state.\n     * @dev Emits a {Paused} event.\n     * @dev Can only be called by the current pauser.\n     */\n    function pause() external onlyPauser {\n        if (paused) revert Pausable__AlreadyPaused();\n        paused = true;\n        emit Paused();\n    }\n\n    /**\n     * @notice Initializes the contract in an unpaused state.\n     * @dev This function should be called during contract initialization.\n     */\n    function initializePausable() public onlyInitializing {\n        paused = false;\n    }\n\n    /**\n     * @notice Called by the pauser to unpause the contract, returning to normal state.\n     * @dev Emits an {Unpaused} event.\n     * @dev Can only be called by the current pauser.\n     */\n    function unpause() external onlyPauser {\n        if (!paused) revert Pausable__AlreadyUnpaused();\n        paused = false;\n        emit Unpaused();\n    }\n\n    /**\n     * @notice Updates the pauser role to a new address.\n     * @param _newPauser The address of the new pauser.\n     * @dev Emits a {PauserChanged} event.\n     * @dev Can only be called by the permission admin.\n     * @dev The new pauser address cannot be the zero address.\n     */\n    function updatePauser(address _newPauser) external onlyPermissionAdmin {\n        if (_newPauser == address(0)) revert Pausable__NoZeroAddress();\n        _pauser = _newPauser;\n        emit PauserChanged(_pauser);\n    }\n\n    // Storage Gap for future upgrades\n    uint256[49] private __gap;\n}\n"},"contracts/src/TokenContracts/PermissionAdmin.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.11;\n\nimport {Ownable} from \"./Ownable.sol\";\n\n/**\n * @title PermissionAdmin\n * @notice Base contract which allows the owner to set an admin with the ability to select the pauser, blacklister, and rescuer.\n * @dev Only the contract owner can modify the admin. The admin has special permissions defined by this contract.\n */\nabstract contract PermissionAdmin is Ownable {\n    address private _permissionAdmin;\n\n    /// @notice Emitted when the permission admin is changed.\n    /// @param admin The new permission admin.\n    event PermissionAdminChanged(address indexed admin);\n\n    /// @notice Error thrown when the caller is not the permission admin.\n    error PermissionAdmin__CallerNotPermissionAdmin();\n\n    /// @notice Error thrown when trying to set the permission admin to the zero address.\n    error PermissionAdmin__NoZeroAddress();\n    \n    /**\n     * @dev Modifier to make a function callable only by the permission admin.\n     */\n    modifier onlyPermissionAdmin() {\n        if (msg.sender != _permissionAdmin) {\n            revert PermissionAdmin__CallerNotPermissionAdmin();\n        }\n        _;\n    }\n\n    /**\n     * @notice Returns the current permission admin.\n     * @return The address of the current permission admin.\n     */\n    function getPermissionAdmin() external view returns (address) {\n        return _permissionAdmin;\n    }\n\n    /**\n     * @notice Sets a new permission admin.\n     * @param _newAdmin The address of the new permission admin.\n     * @dev Only the contract owner can call this function. The new admin address cannot be the zero address.\n     */\n    function setPermissionAdmin(address _newAdmin) external onlyOwner {\n        if (_newAdmin == address(0)) revert PermissionAdmin__NoZeroAddress();\n        _permissionAdmin = _newAdmin;\n        emit PermissionAdminChanged(_permissionAdmin);\n    }\n\n    // Storage Gap for future upgrades\n    uint256[49] private __gap;\n}\n"},"contracts/src/TokenContracts/Rescuable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.11;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {PermissionAdmin} from \"./PermissionAdmin.sol\";\n\n/**\n * @title Rescuable\n * @notice Contract that allows rescuing ERC20 tokens locked up in this contract by a \"rescuer\" role.\n * @dev Inherits from PermissionAdmin to manage rescuer permissions.\n */\nabstract contract Rescuable is PermissionAdmin {\n    using SafeERC20 for IERC20;\n\n    address internal _rescuer;\n\n    /// @notice Error thrown when the caller is not the rescuer.\n    error Rescuable__CallerNotRescuer();\n\n    /// @notice Error thrown when trying to set the rescuer to the zero address.\n    error Rescuable__NoZeroAddress();\n\n    /// @notice Emitted when the rescuer is changed.\n    /// @param newRescuer The address of the new rescuer.\n    event RescuerChanged(address indexed newRescuer);\n\n    /**\n     * @notice Returns the current rescuer.\n     * @return The address of the current rescuer.\n     */\n    function rescuer() external view returns (address) {\n        return _rescuer;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only by the rescuer.\n     */\n    modifier onlyRescuer() {\n        if (msg.sender != _rescuer) revert Rescuable__CallerNotRescuer();\n        _;\n    }\n\n    /**\n     * @notice Rescue ERC20 tokens locked up in this contract.\n     * @param tokenContract The address of the ERC20 token contract.\n     * @param to The recipient address to receive the rescued tokens.\n     * @param amount The amount of tokens to withdraw.\n     * @dev Can only be called by the current rescuer.\n     */\n    function rescueERC20(\n        IERC20 tokenContract,\n        address to,\n        uint256 amount\n    ) external onlyRescuer {\n        tokenContract.safeTransfer(to, amount);\n    }\n\n    /**\n     * @notice Assign the rescuer role to a given address.\n     * @param newRescuer The address of the new rescuer.\n     * @dev Emits a {RescuerChanged} event.\n     * @dev Can only be called by the permission admin.\n     * @dev The new rescuer address cannot be the zero address.\n     */\n    function updateRescuer(address newRescuer) external onlyPermissionAdmin {\n        if (newRescuer == address(0)) revert Rescuable__NoZeroAddress();\n        _rescuer = newRescuer;\n        emit RescuerChanged(newRescuer);\n    }\n\n    // Storage Gap for future upgrades\n    uint256[49] private __gap;\n}\n"},"contracts/src/TokenContracts/TokenV1.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.11;\n\nimport {AbstractTokenV1} from \"./AbstractTokenV1.sol\";\nimport {Ownable} from \"./Ownable.sol\";\nimport {Pausable} from \"./Pausable.sol\";\nimport {Blacklistable} from \"./Blacklistable.sol\";\nimport {Rescuable} from \"./Rescuable.sol\";\nimport {MinterManagementInterface} from \"../Minting/MinterManagerInterface.sol\";\n\n/**\n * @title TokenV1\n * @dev ERC20 Token backed by fiat reserves with additional functionality for minting, burning, pausing, blacklisting, and rescuing tokens.\n * Inherits MinterManagementInterface to comply with minter management specifications.\n */\ncontract TokenV1 is AbstractTokenV1, Ownable, Pausable, Blacklistable, Rescuable, MinterManagementInterface {\n    string private _name;\n    string private _symbol;\n    uint8 private _decimals;\n    string public currency;\n    address public masterMinter;\n\n    uint256 internal _totalSupply;\n\n    mapping(address => uint256) internal balances;\n    mapping(address => mapping(address => uint256)) internal allowed;\n    mapping(address => bool) public isMinter;\n    mapping(address => uint256) public minterAllowance; // Allowance set by approval\n\n    /**\n     * @dev Emitted when tokens are minted.\n     * @param minter The address of the minter.\n     * @param to The address of the recipient.\n     * @param amount The amount of tokens minted.\n     */\n    event Mint(address indexed minter, address indexed to, uint256 amount);\n\n    /**\n     * @dev Emitted when tokens are burned.\n     * @param burner The address of the burner.\n     * @param amount The amount of tokens burned.\n     */\n    event Burn(address indexed burner, uint256 amount);\n\n    /**\n     * @dev Emitted when a minter is configured.\n     * @param minter The address of the minter.\n     * @param minterAllowedAmount The allowance of the minter.\n     */\n    event MinterConfigured(address indexed minter, uint256 minterAllowedAmount);\n\n    /**\n     * @dev Emitted when a minter is removed.\n     * @param oldMinter The address of the removed minter.\n     */\n    event MinterRemoved(address indexed oldMinter);\n\n    /**\n     * @dev Emitted when the master minter is changed.\n     * @param newMasterMinter The address of the new master minter.\n     */\n    event MasterMinterChanged(address indexed newMasterMinter);\n\n    /**\n     * @dev Emitted when the token decimals are set.\n     * @param decimals The number of decimals set.\n     */\n    event TokenDecimalsSet(uint8 decimals);\n\n    /**\n     * @dev Emitted when a new master minter is set.\n     * @param newMasterMinter The address of the new master minter.\n     */\n    event NewMasterMinter(address indexed newMasterMinter);\n\n    /**\n     * @dev Emitted when a new pauser is set.\n     * @param newPauser The address of the new pauser.\n     */\n    event NewPauser(address indexed newPauser);\n\n    /**\n     * @dev Emitted when a new blacklister is set.\n     * @param newBlacklister The address of the new blacklister.\n     */\n    event NewBlacklister(address indexed newBlacklister);\n\n    /**\n     * @dev Error thrown when the caller is not a minter.\n     */\n    error NotMinter();\n\n    /**\n     * @dev Error thrown when the caller is not the master minter.\n     */\n    error NotMasterMinter();\n\n    /**\n     * @dev Error thrown when a zero address is provided.\n     */\n    error NoZeroAddress();\n\n    /**\n     * @dev Error thrown when the mint amount is zero.\n     */\n    error MintMustBeGreaterThanZero();\n\n    /**\n     * @dev Error thrown when the amount exceeds the balance.\n     */\n    error AmountExceedsBalance();\n\n    /**\n     * @dev Error thrown when the burn amount is not greater than zero.\n     */\n    error BurnAmountNotGreaterThanZero();\n\n    /**\n     * @dev Error thrown when the allowance is exceeded.\n     */\n    error AllowanceExceeded();\n\n    /**\n     * @dev Error thrown when a minter tries to mint to a different address.\n     */\n    error NotSelfMinting();\n\n    /**\n     * @dev Error thrown when an attempt to decrease the allowance fails.\n     * @param owner The owner address.\n     * @param spender The spender address.\n     * @param currentAllowance The current allowance.\n     * @param decrement The decrement amount.\n     */\n    error FailedDecreaseAllowance(address owner, address spender, uint256 currentAllowance, uint256 decrement);\n\n    /**\n     * @dev Error thrown when an address is not blacklisted.\n     */\n    error NotBlacklisted();\n\n    /**\n     * @dev Error thrown when an address has zero balance.\n     */\n    error ZeroBalance();\n\n    /**\n     * @dev Modifier to make a function callable only by a minter.\n     */\n    modifier onlyMinter() {\n        if (!isMinter[msg.sender]) revert NotMinter();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only by the master minter.\n     */\n    modifier onlyMasterMinter() {\n        if (msg.sender != masterMinter) revert NotMasterMinter();\n        _;\n    }\n\n    /**\n     * @notice Initializes the token with given parameters at most once.\n     * @param tokenName The name of the token.\n     * @param tokenSymbol The symbol of the token.\n     * @param tokenCurrency The currency of the token.\n     * @param tokenDecimals The number of decimals the token uses.\n     * @param newMasterMinter The address of the new master minter.\n     * @param newPauser The address of the new pauser.\n     * @param newBlacklister The address of the new blacklister.\n     * @param newRescuer The address of the new rescuer.\n     */\n    function initializeToken(\n        string calldata tokenName,\n        string calldata tokenSymbol,\n        string calldata tokenCurrency,\n        uint8 tokenDecimals,\n        address newMasterMinter,\n        address newPauser,\n        address newBlacklister,\n        address newRescuer\n    ) public initializer {\n        Ownable.initialize(msg.sender);\n        Pausable.initializePausable();\n\n        if (newMasterMinter == address(0)) revert NoZeroAddress();\n        if (newPauser == address(0)) revert NoZeroAddress();\n        if (newBlacklister == address(0)) revert NoZeroAddress();\n        if (newRescuer == address(0)) revert NoZeroAddress();\n\n        _name = tokenName;\n        _symbol = tokenSymbol;\n        currency = tokenCurrency;\n        _decimals = tokenDecimals;\n        masterMinter = newMasterMinter;\n        _pauser = newPauser;\n        _blacklister = newBlacklister;\n        _rescuer = newRescuer;\n\n        emit NewMasterMinter(newMasterMinter);\n        emit NewPauser(newPauser);\n        emit NewBlacklister(newBlacklister);\n        emit TokenDecimalsSet(tokenDecimals);\n        emit RescuerChanged(newRescuer);\n    }\n\n    /**\n     * @notice Returns the name of the token.\n     * @return The name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @notice Returns the symbol of the token.\n     * @return The symbol of the token.\n     */\n    function symbol() public view virtual returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @notice Returns the number of decimals used to get its user representation.\n     * @return The number of decimals used by the token.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return _decimals;\n    }\n\n    /**\n     * @notice Returns the minting allowance of a minter.\n     * @param minter The address of the minter.\n     * @return The minting allowance of the minter.\n     */\n    function getMinterAllowance(address minter) external view override returns (uint256) {\n        return minterAllowance[minter];\n    }\n\n    /**\n     * @notice Returns the amount of tokens that spender is allowed to transfer on behalf of owner.\n     * @param owner Token owner's address.\n     * @param spender Spender's address.\n     * @return The allowance amount.\n     */\n    function allowance(address owner, address spender) external view override returns (uint256) {\n        return allowed[owner][spender];\n    }\n\n    /**\n     * @notice Returns the total supply of the token.\n     * @return The total supply.\n     */\n    function totalSupply() external view override returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @notice Returns the token balance of an account.\n     * @param account The address of the account.\n     * @return The token balance of the account.\n     */\n    function balanceOf(address account) external view override returns (uint256) {\n        return balances[account];\n    }\n\n    /**\n     * @notice Sets spender's allowance over the caller's tokens to be a given value.\n     * @param spender Spender's address.\n     * @param value Allowance amount.\n     * @return True if the operation was successful.\n     */\n    function approve(\n        address spender,\n        uint256 value\n    )\n        external\n        override\n        whenNotPaused\n        notBlacklisted(msg.sender)\n        notBlacklisted(spender)\n        returns (bool)\n    {\n        _approve(msg.sender, spender, value);\n        return true;\n    }\n\n    /**\n     * @notice Internal function to set allowance.\n     * @param owner Token owner's address.\n     * @param spender Spender's address.\n     * @param value Allowance amount.\n     */\n    function _approve(address owner, address spender, uint256 value) internal override {\n        if (owner == address(0)) revert NoZeroAddress();\n        if (spender == address(0)) revert NoZeroAddress();\n        allowed[owner][spender] = value;\n        emit Approval(owner, spender, value);\n    }\n\n    /**\n     * @notice Transfers tokens from one address to another using allowance.\n     * @param from Payer's address.\n     * @param to Payee's address.\n     * @param value Transfer amount.\n     * @return True if the operation was successful.\n     */\n    function transferFrom(\n    address from,\n    address to,\n    uint256 value\n    )\n        external\n        override\n        whenNotPaused\n        notBlacklisted(msg.sender)\n        notBlacklisted(from)\n        notBlacklisted(to)\n        returns (bool)\n    {\n        if (value > allowed[from][msg.sender]) revert AllowanceExceeded();\n        _transfer(from, to, value);\n        allowed[from][msg.sender] -= value;\n        return true;\n    }\n\n    /**\n     * @notice Transfers tokens from the caller to another address.\n     * @param to Payee's address.\n     * @param value Transfer amount.\n     * @return True if the operation was successful.\n     */\n    function transfer(\n        address to,\n        uint256 value\n    )\n        external\n        override\n        whenNotPaused\n        notBlacklisted(msg.sender)\n        notBlacklisted(to)\n        returns (bool)\n    {\n        _transfer(msg.sender, to, value);\n        return true;\n    }\n\n    /**\n     * @notice Internal function to process token transfers.\n     * @param from Payer's address.\n     * @param to Payee's address.\n     * @param value Transfer amount.\n     */\n    function _transfer(address from, address to, uint256 value) internal override {\n        if (from == address(0)) revert NoZeroAddress();\n        if (to == address(0)) revert NoZeroAddress();\n        if (value > balances[from]) revert AmountExceedsBalance();\n\n        balances[from] -= value;\n        balances[to] += value;\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @notice Configures a new minter or updates the allowance of an existing minter.\n     * @param minter The address of the minter.\n     * @param _minterAllowedAmount The minting allowance for the minter.\n     * @return True if the operation was successful.\n     */\n    function configureMinter(\n        address minter,\n        uint256 _minterAllowedAmount\n    ) external override whenNotPaused onlyMasterMinter returns (bool) {\n        isMinter[minter] = true;\n        minterAllowance[minter] = _minterAllowedAmount;\n\n        emit MinterConfigured(minter, _minterAllowedAmount);\n        return true;\n    }\n\n    /**\n     * @notice Removes a minter.\n     * @param minter The address of the minter to remove.\n     * @return True if the operation was successful.\n     */\n    function removeMinter(address minter) external override onlyMasterMinter returns (bool) {\n        isMinter[minter] = false;\n        minterAllowance[minter] = 0;\n        emit MinterRemoved(minter);\n        return true;\n    }\n\n    /**\n     * @notice Allows a minter to burn some of its own tokens.\n     * @param _amount The amount of tokens to be burned.\n     */\n    function burn(uint256 _amount) external whenNotPaused onlyMinter notBlacklisted(msg.sender) {\n        uint256 balance = balances[msg.sender];\n        if (_amount <= 0) revert BurnAmountNotGreaterThanZero();\n        if (balance < _amount) revert AmountExceedsBalance();\n\n        _totalSupply -= _amount;\n        balances[msg.sender] -= _amount;\n        emit Burn(msg.sender, _amount);\n        emit Transfer(msg.sender, address(0), _amount);\n    }\n\n    /**\n     * @notice Allows a minter to minter some of its tokens from allowance.\n     * @param _to The address to receive the minted tokens.\n     * @param _amount The amount of tokens to mint.\n     * @return True if the operation was successful.\n     */\n    function mint(\n        address _to,\n        uint256 _amount\n    ) public whenNotPaused onlyMinter notBlacklisted(msg.sender) notBlacklisted(_to) returns (bool) {\n        if (_to == address(0)) revert NoZeroAddress();\n        if (_amount <= 0) revert MintMustBeGreaterThanZero();\n        if (msg.sender != _to) revert NotSelfMinting();\n        if (minterAllowance[_to] < _amount) revert AllowanceExceeded();\n\n        _totalSupply += _amount;\n        balances[_to] += _amount;\n        minterAllowance[_to] -= _amount;\n        emit Mint(msg.sender, _to, _amount);\n        emit Transfer(address(0), _to, _amount);\n        return true;\n    }\n\n    /**\n     * @notice Updates the master minter address.\n     * @param _newMasterMinter The address of the new master minter.\n     */\n    function updateMasterMinter(address _newMasterMinter) external onlyOwner {\n        if (_newMasterMinter == address(0)) revert NoZeroAddress();\n        masterMinter = _newMasterMinter;\n        emit MasterMinterChanged(masterMinter);\n    }\n\n    /**\n     * @notice Increases the allowance by a given increment.\n     * @param spender Spender's address.\n     * @param increment The amount to increase the allowance by.\n     * @return True if the operation was successful.\n     */\n    function increaseAllowance(\n        address spender,\n        uint256 increment\n    ) external whenNotPaused notBlacklisted(msg.sender) notBlacklisted(spender) returns (bool) {\n        address owner = msg.sender;\n        _approve(owner, spender, allowed[owner][spender] + increment);\n\n        return true;\n    }\n\n    /**\n     * @notice Decreases the allowance by a given decrement.\n     * @param spender Spender's address.\n     * @param decrement The amount to decrease the allowance by.\n     * @return True if the operation was successful.\n     */\n    function decreaseAllowance(\n        address spender,\n        uint256 decrement\n    ) external whenNotPaused notBlacklisted(msg.sender) notBlacklisted(spender) returns (bool) {\n        address owner = msg.sender;\n        uint256 currentAllowance = allowed[owner][spender];\n        if (currentAllowance < decrement) {\n            revert FailedDecreaseAllowance(owner, spender, currentAllowance, decrement);\n        }\n\n        _approve(owner, spender, currentAllowance - decrement);\n        return true;\n    }\n\n    /**\n     * @notice Wipes the balance of a blacklisted address, decreasing the totalSupply.\n     * @dev Only the owner can call this function, and the address must be blacklisted.\n     * @param _account The address to wipe.\n     */\n    function wipeBlacklistedAddress(address _account) external onlyOwner {\n        if (!blacklisted[_account]) revert NotBlacklisted();\n        uint256 balance = balances[_account];\n        if (balance == 0) revert ZeroBalance();\n        _totalSupply -= balance;\n        balances[_account] = 0;\n        \n        emit Transfer(_account, address(0), balance);\n    }\n\n    // Storage Gap for future upgrades\n    uint256[49] private __gap;\n}\n"}},"matchId":"39577033","creationMatch":"exact_match","runtimeMatch":"exact_match","verifiedAt":"2026-07-02T19:38:24Z","match":"exact_match","chainId":"1","address":"0x7Df0b1F63E0A467B6aa95b4ed6D299daB9f73750"}