creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/interfaces/IERC1967Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.3) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.9._\n */\ninterface IERC1967Upgradeable {\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Emitted when the beacon is changed.\n     */\n    event BeaconUpgraded(address indexed beacon);\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {BeaconProxy} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.3) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/IERC1967Upgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {\n    function __ERC1967Upgrade_init() internal onlyInitializing {\n    }\n\n    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n    }\n    // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function _getImplementation() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Perform implementation upgrade\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeTo(address newImplementation) internal {\n        _setImplementation(newImplementation);\n        emit Upgraded(newImplementation);\n    }\n\n    /**\n     * @dev Perform implementation upgrade with additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCall(\n        address newImplementation,\n        bytes memory data,\n        bool forceCall\n    ) internal {\n        _upgradeTo(newImplementation);\n        if (data.length > 0 || forceCall) {\n            _functionDelegateCall(newImplementation, data);\n        }\n    }\n\n    /**\n     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(\n        address newImplementation,\n        bytes memory data,\n        bool forceCall\n    ) internal {\n        // Upgrades from old implementations will perform a rollback test. This test requires the new\n        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n        // this special case will break upgrade paths from old UUPS implementation to new ones.\n        if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n            _setImplementation(newImplementation);\n        } else {\n            try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n                require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n            } catch {\n                revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n            }\n            _upgradeToAndCall(newImplementation, data, forceCall);\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Returns the current admin.\n     */\n    function _getAdmin() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {AdminChanged} event.\n     */\n    function _changeAdmin(address newAdmin) internal {\n        emit AdminChanged(_getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n     */\n    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function _getBeacon() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the EIP1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n        require(\n            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n            \"ERC1967: beacon implementation is not a contract\"\n        );\n        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n    }\n\n    /**\n     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n     *\n     * Emits a {BeaconUpgraded} event.\n     */\n    function _upgradeBeaconToAndCall(\n        address newBeacon,\n        bytes memory data,\n        bool forceCall\n    ) internal {\n        _setBeacon(newBeacon);\n        emit BeaconUpgraded(newBeacon);\n        if (data.length > 0 || forceCall) {\n            _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n        }\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(address target, bytes memory data) private returns (bytes memory) {\n        require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.1) (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 * ```\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\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/proxy/utils/UUPSUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n    function __UUPSUpgradeable_init() internal onlyInitializing {\n    }\n\n    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n    }\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n    address private immutable __self = address(this);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        require(address(this) != __self, \"Function must be called through delegatecall\");\n        require(_getImplementation() == __self, \"Function must be called through active proxy\");\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n        _;\n    }\n\n    /**\n     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n        return _IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function upgradeTo(address newImplementation) external virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data, true);\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeTo} and {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal override onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 * For a generic mechanism see {ERC20PresetMinterPauser}.\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 * 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 *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\n    mapping(address => uint256) private _balances;\n\n    mapping(address => mapping(address => 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     * The default value of {decimals} is 18. To select a different value for\n     * {decimals} you should overload it.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n        __ERC20_init_unchained(name_, symbol_);\n    }\n\n    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n        _name = name_;\n        _symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual override 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 override 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 value {ERC20} uses, unless this function is\n     * 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 override returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual override returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual override 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 `amount`.\n     */\n    function transfer(address to, uint256 amount) public virtual override returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, amount);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual override returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `amount` 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 amount) public virtual override returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, amount);\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 `amount`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `amount`.\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 amount\n    ) public virtual override returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, amount);\n        _transfer(from, to, amount);\n        return true;\n    }\n\n    /**\n     * @dev Atomically increases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, allowance(owner, spender) + addedValue);\n        return true;\n    }\n\n    /**\n     * @dev Atomically decreases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `spender` must have allowance for the caller of at least\n     * `subtractedValue`.\n     */\n    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n        address owner = _msgSender();\n        uint256 currentAllowance = allowance(owner, spender);\n        require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n        unchecked {\n            _approve(owner, spender, currentAllowance - subtractedValue);\n        }\n\n        return true;\n    }\n\n    /**\n     * @dev Moves `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     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `from` must have a balance of at least `amount`.\n     */\n    function _transfer(\n        address from,\n        address to,\n        uint256 amount\n    ) internal virtual {\n        require(from != address(0), \"ERC20: transfer from the zero address\");\n        require(to != address(0), \"ERC20: transfer to the zero address\");\n\n        _beforeTokenTransfer(from, to, amount);\n\n        uint256 fromBalance = _balances[from];\n        require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n        unchecked {\n            _balances[from] = fromBalance - amount;\n            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n            // decrementing then incrementing.\n            _balances[to] += amount;\n        }\n\n        emit Transfer(from, to, amount);\n\n        _afterTokenTransfer(from, to, amount);\n    }\n\n    /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n     * the total supply.\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     */\n    function _mint(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: mint to the zero address\");\n\n        _beforeTokenTransfer(address(0), account, amount);\n\n        _totalSupply += amount;\n        unchecked {\n            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n            _balances[account] += amount;\n        }\n        emit Transfer(address(0), account, amount);\n\n        _afterTokenTransfer(address(0), account, amount);\n    }\n\n    /**\n     * @dev Destroys `amount` tokens from `account`, reducing the\n     * total supply.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     * - `account` must have at least `amount` tokens.\n     */\n    function _burn(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: burn from the zero address\");\n\n        _beforeTokenTransfer(account, address(0), amount);\n\n        uint256 accountBalance = _balances[account];\n        require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n        unchecked {\n            _balances[account] = accountBalance - amount;\n            // Overflow not possible: amount <= accountBalance <= totalSupply.\n            _totalSupply -= amount;\n        }\n\n        emit Transfer(account, address(0), amount);\n\n        _afterTokenTransfer(account, address(0), amount);\n    }\n\n    /**\n     * @dev Sets `amount` 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    function _approve(\n        address owner,\n        address spender,\n        uint256 amount\n    ) internal virtual {\n        require(owner != address(0), \"ERC20: approve from the zero address\");\n        require(spender != address(0), \"ERC20: approve to the zero address\");\n\n        _allowances[owner][spender] = amount;\n        emit Approval(owner, spender, amount);\n    }\n\n    /**\n     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n     *\n     * Does not update the allowance amount in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Might emit an {Approval} event.\n     */\n    function _spendAllowance(\n        address owner,\n        address spender,\n        uint256 amount\n    ) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance != type(uint256).max) {\n            require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n            unchecked {\n                _approve(owner, spender, currentAllowance - amount);\n            }\n        }\n    }\n\n    /**\n     * @dev Hook that is called before any transfer of tokens. This includes\n     * minting and burning.\n     *\n     * Calling conditions:\n     *\n     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n     * will be transferred to `to`.\n     * - when `from` is zero, `amount` tokens will be minted for `to`.\n     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n     * - `from` and `to` are never both zero.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _beforeTokenTransfer(\n        address from,\n        address to,\n        uint256 amount\n    ) internal virtual {}\n\n    /**\n     * @dev Hook that is called after any transfer of tokens. This includes\n     * minting and burning.\n     *\n     * Calling conditions:\n     *\n     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n     * has been transferred to `to`.\n     * - when `from` is zero, `amount` tokens have been minted for `to`.\n     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n     * - `from` and `to` are never both zero.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _afterTokenTransfer(\n        address from,\n        address to,\n        uint256 amount\n    ) internal virtual {}\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[45] private __gap;\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\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-upgradeable/token/ERC20/IERC20Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.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 IERC20Upgradeable {\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(\n        address from,\n        address to,\n        uint256 amount\n    ) external returns (bool);\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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     *\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://diligence.consensys.net/posts/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.5.11/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(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) 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 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-upgradeable/utils/ContextUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n}\n"
      },
      "contracts/libraries/EncodingUtils.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity 0.8.17;\n\nlibrary EncodingUtils {\n    /**\n     * @dev Computes the hash of a transfer request\n     * Enables to index requests in mappings\n     * NB : block timestamp is included in the computation\n     */\n    function encodeRequest(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 counter\n    ) internal view returns (bytes32) {\n        return\n            // solhint-disable-next-line not-rely-on-time\n            keccak256(abi.encode(block.timestamp, _from, _to, _value, counter));\n    }\n}\n"
      },
      "contracts/smartCoin/AccessControlDataLayout.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity 0.8.17;\n\n/**\n * @dev This contract contains the storage part of the AccessControlUpgradeable contract.\n * It includes a __gap field that enables adding new fields without messing up the layout\n * and keeping compatibility accross UUPS updates (see field description for details)\n */\nabstract contract AccessControlDataLayout {\n\n    /// @custom:oz-renamed-from whitelist\n     mapping(address => bool) private whitelist_deprecated;\n    /**\n     * @dev Address of the future new registrar operator\n     */\n    address internal newRegistrar;\n    /**\n     * @dev Address of the future new operations operator\n     */\n    address internal newOperations;\n    /**\n     * @dev Address of the future new technical operator\n     */\n    address internal newTechnical;\n    /**\n     * @dev Structure that keeps track of whether the future operators have accepted their future role\n     */\n    mapping(address => bool) internal hasAcceptedRole;\n    /**\n     * @dev Address of the future new implementation contract\n     */\n    address public newImplementation;\n\n     /**\n     * @dev  Structure containing all frozen addresses\n     */\n    mapping(address => bool) public isFrozen;\n    /**\n     * @dev  The state of the contract\n     */\n    bool public paused;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[28] private __gap;\n}\n"
      },
      "contracts/smartCoin/AccessControlUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"./ISmartCoin.sol\";\nimport \"./IAccessControl.sol\";\nimport \"./AccessControlDataLayout.sol\";\n\nabstract contract AccessControlUpgradeable is\n    AccessControlDataLayout,\n    IAccessControl,\n    Initializable\n{\n    /**\n     * @dev Used when a method reserved to the registrar operator is called by some other address\n     */\n    error UnauthorizedRegistrar();\n    /**\n     * @dev Used when the registar operator's address is used as parameter where it's not allowed\n     */\n    error ForbiddenForRegistrar();\n    /**\n     * @dev Used when the registar operator's address is used as parameter where it's not allowed\n     */\n    error ForbiddenForOperations();\n    /**\n     * @dev Used when `addr` address is not authorized to perform an action\n     */\n    error Unauthorized(address addr);\n    /**\n     * @dev Used when the zero address is used as parameter where it's not allowed\n     */\n    error ZeroAddressCheck();\n    /**\n     * @dev Used when trying to freeze an address and the address is already in the frozen list\n     */\n    error AddressAlreadyFrozen(address addr);\n    /**\n     * @dev Used when a method reserved to the technical operator is called by some other address\n     */\n    error UnauthorizedTechnical();\n    /**\n     * @dev Used when a method reserved to the operations operator is called by some other address\n     */\n    error UnauthorizedOperations();\n    /**\n     * @dev Used when trying to unfreeze an address and the address is not frozen\n     */\n    error AddressNotFrozen(address addr);\n    /**\n     * @dev Used when trying to update to an unauthorized implementation\n     */\n    error UnauthorizedImplementation(address implementation);\n    /**\n     * @dev Used when contract already paused\n     */\n    error ContractPaused();\n    /**\n     * @dev Used when contract already not paused\n     */\n    error ContractNotPaused();\n\n    /**\n     * @dev Used when operators have same addresses\n     */\n    error InconsistentOperators();\n    /**\n     * @dev Current registrar operator's address\n     */\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n    address public immutable registrar;\n    /**\n     * @dev Current operations operator's address\n     */\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n    address public immutable operations;\n    /**\n     * @dev Current technical operator's address\n     */\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n    address public immutable technical;\n\n    /**\n     * @dev Throws if called by any account that's frozen.\n     */\n    modifier onlyNotFrozen(address _addr) {\n        if (isFrozen[_addr]) revert Unauthorized(_addr);\n        _;\n    }\n    /**\n     * @dev Throws if called by any account that's not frozen.\n     */\n    modifier onlyFrozen(address _addr) {\n        if (!isFrozen[_addr]) revert AddressNotFrozen(_addr);\n        _;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the registrar.\n     */\n    modifier onlyRegistrar() {\n        if (msg.sender != registrar) revert UnauthorizedRegistrar();\n        _;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the technical.\n     */\n    modifier onlyTechnical() {\n        if (msg.sender != technical) revert UnauthorizedTechnical();\n        _;\n    }\n    modifier OnlyWhenOperatorsHaveDifferentAddress(\n        address _registrar,\n        address _operations,\n        address _technical\n    ) {\n        if (\n            _registrar == _operations ||\n            _operations == _technical ||\n            _registrar == _technical\n        ) revert InconsistentOperators();\n        _;\n    }\n    /**\n     * @dev Throws if addr is registrar\n     */\n    modifier forbiddenForRegistrar(address _addr) {\n        if (_addr == registrar) revert ForbiddenForRegistrar();\n        _;\n    }\n\n    /**\n     * @dev Throws if addr is operations\n     */\n    modifier forbiddenForOperations(address _addr) {\n        if (_addr == operations) revert ForbiddenForOperations();\n        _;\n    }\n\n    /**\n     * @dev Consumes the authorization to update to this `_newImplementation`, that was given by the current registrar\n     * Throws if `_newImplementation` has not been previously authorized\n     */\n    modifier consumeAuthorizeImplementation(address _newImplementation) {\n        if (newImplementation != _newImplementation)\n            revert UnauthorizedImplementation(_newImplementation);\n        _;\n        newImplementation = address(0);\n    }\n    /**\n     * @dev Throws if `_registrar`, `_operations` and `_technical` have not all accepted their respective future role\n     * and (still) match the values for new contract\n     */\n    modifier onlyWhenOperatorsMatchAndAcceptedRole(ISmartCoin newSmartCoin) {\n        (\n            address _registar,\n            address _operations,\n            address _technical\n        ) = newSmartCoin.getOperators();\n        if (_registar != newRegistrar || !hasAcceptedRole[_registar])\n            revert UnauthorizedRegistrar();\n        if (_operations != newOperations || !hasAcceptedRole[_operations])\n            revert UnauthorizedOperations();\n        if (_technical != newTechnical || !hasAcceptedRole[_technical])\n            revert UnauthorizedTechnical();\n        _;\n    }\n    /**\n     * @dev Throws if `addr` is the zero address\n     */\n    modifier onlyNotZeroAddress(address addr) {\n        if (addr == address(0)) revert ZeroAddressCheck();\n        _;\n    }\n    /**\n     * @dev Throws if the contract is not paused.\n     */\n    modifier onlyWhenNotPaused() {\n        if (paused) revert ContractPaused();\n        _;\n    }\n\n    /**\n     * @dev Throws if the contract is paused.\n     */\n    modifier onlyWhenPaused() {\n        if (!paused) revert ContractNotPaused();\n        _;\n    }\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor(address _registrar, address _operations, address _technical) {\n        registrar = _registrar;\n        operations = _operations;\n        technical = _technical;\n    }\n\n    /**\n     * @dev Freeze a list of  addresses\n     * NB : only the registrar operator can call this method\n     */\n    function freeze(\n        address[] calldata _addrs\n    ) external onlyRegistrar returns (bool) {\n        for (uint256 i = 0; i < _addrs.length; i++) {\n            if (isFrozen[_addrs[i]]) revert AddressAlreadyFrozen(_addrs[i]);\n            isFrozen[_addrs[i]] = true;\n        }\n        emit AddressesFrozen(_addrs);\n        return true;\n    }\n\n    /**\n     * @dev Unfreeze a list of  addresses\n     * NB : only the registrar operator can call this method\n     */\n    function unfreeze(\n        address[] calldata _addrs\n    ) external onlyRegistrar returns (bool) {\n        for (uint256 i = 0; i < _addrs.length; i++) {\n            if (!isFrozen[_addrs[i]]) revert AddressNotFrozen(_addrs[i]);\n            isFrozen[_addrs[i]] = false;\n        }\n        emit AddressesUnFrozen(_addrs);\n        return true;\n    }\n\n    /**\n     * @dev Name the operators for the next implementation\n     * and emits a corresponding `NamedNewOperators` event\n     * The operators will have to accept their future roles before the update to the new implementation can take place\n     * NB : only the registrar operator can call this method\n     */\n    function nameNewOperators(\n        address _registrar,\n        address _operations,\n        address _technical\n    )\n        external\n        onlyRegistrar\n        onlyNotZeroAddress(_registrar)\n        onlyNotZeroAddress(_operations)\n        onlyNotZeroAddress(_technical)\n        OnlyWhenOperatorsHaveDifferentAddress(\n            _registrar,\n            _operations,\n            _technical\n        )\n    {\n        _resetNewOperators();\n        newRegistrar = _registrar;\n        newOperations = _operations;\n        newTechnical = _technical;\n        emit NamedNewOperators(_registrar, _operations, _technical);\n    }\n\n    /**\n     * @dev Accepts the future registrar role\n     * and emits a corresponding `AcceptedRegistrarRole` event\n     * NB: only the future registrar operator can call this method\n     */\n    function acceptRegistrarRole() external {\n        if (newRegistrar != msg.sender) revert UnauthorizedRegistrar();\n        hasAcceptedRole[newRegistrar] = true;\n        emit AcceptedRegistrarRole(newRegistrar);\n    }\n\n    /**\n     * @dev Accepts the future operations role\n     * and emits a corresponding `AcceptedOperationsRole` event\n     * NB: only the future operations operator can call this method\n     */\n    function acceptOperationsRole() external {\n        if (newOperations != msg.sender) revert UnauthorizedOperations();\n        hasAcceptedRole[newOperations] = true;\n        emit AcceptedOperationsRole(newOperations);\n    }\n\n    /**\n     * @dev Accepts the future technical role\n     * and emits a corresponding `AcceptedTechnicalRole` event\n     * NB: only the future technical operator can call this method\n     */\n    function acceptTechnicalRole() external {\n        if (newTechnical != msg.sender) revert UnauthorizedTechnical();\n        hasAcceptedRole[newTechnical] = true;\n        emit AcceptedTechnicalRole(newTechnical);\n    }\n\n    /**\n     * @dev Authorizes the future new implementation contract\n     * and emits a corresponding `ImplementationAuthorized` event\n     * NB: only the (current) registrar operator can call this method\n     * NB: fails if all future operators have not previously accepted their role using the acceptXXXRole() methods\n     */\n    function authorizeImplementation(\n        address _implementation\n    )\n        external\n        onlyRegistrar\n        onlyNotZeroAddress(_implementation)\n        onlyWhenOperatorsMatchAndAcceptedRole(ISmartCoin(_implementation))\n    {\n        newImplementation = _implementation;\n        emit ImplementationAuthorized(newImplementation);\n    }\n\n    function __AccessControl_init() internal onlyInitializing {\n        paused = false;\n    }\n\n    /**\n     * @dev Internal method that resets new operators' acceptation statuses\n     */\n    function _resetNewOperators() internal {\n        hasAcceptedRole[newRegistrar] = false;\n        hasAcceptedRole[newOperations] = false;\n        hasAcceptedRole[newTechnical] = false;\n    }\n\n    /**\n     * @dev called by the owner to pause, triggers stopped state\n     */\n    function pause() external onlyRegistrar onlyWhenNotPaused {\n        paused = true;\n        emit Paused();\n    }\n\n    /**\n     * @dev called by the owner to unpause, returns to normal state\n     */\n    function unpause() external onlyRegistrar onlyWhenPaused {\n        paused = false;\n        emit UnPaused();\n    }\n\n    /**\n     * @dev find not frozen addresses\n     */\n    function findNotFrozen(\n        address[] calldata addrs\n    ) external view returns (address[] memory) {\n        address[] memory notFrozenAddresses = new address[](getNumberOfNotFrozenAddresses(addrs));\n        uint16 count = 0;\n        for (uint i = 0; i < addrs.length; i++) {\n            if (!isFrozen[addrs[i]]) {\n                notFrozenAddresses[count] = addrs[i];\n                count++;\n            }\n        }\n        return notFrozenAddresses;\n    }\n\n    /**\n     * @dev get number of not frozen addresses\n     */\n    function getNumberOfNotFrozenAddresses(\n        address[] calldata addrs\n    ) internal view returns (uint16) {\n        uint16 count = 0;\n        for (uint i = 0; i < addrs.length; i++) {\n            if (!isFrozen[addrs[i]]) {\n                count++;\n            }\n        }\n        return count;\n    }\n}\n"
      },
      "contracts/smartCoin/IAccessControl.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity 0.8.17;\n\ninterface IAccessControl {\n    /**\n     * @dev Emitted when addresses is added to the frozen list\n     */\n    event AddressesFrozen(address[] addrs);\n    /**\n     * @dev Emitted when addresses is removed from the frozen list\n     */\n    event AddressesUnFrozen(address[] addrs);\n    /**\n     * @dev Emitted when new operators are named by the registrar operator\n     */\n    event NamedNewOperators(\n        address registrar,\n        address operations,\n        address technical\n    );\n    /**\n     * @dev Emitted when the future new registrar operator has accepted the role\n     */\n    event AcceptedRegistrarRole(address registrar);\n    /**\n     * @dev Emitted when the future new operations operator has accepted the role\n     */\n    event AcceptedOperationsRole(address operations);\n    /**\n     * @dev Emitted when the future new technical operator has accepted the role\n     */\n    event AcceptedTechnicalRole(address technical);\n    /**\n     * @dev Emitted when the future new implementation contract has been authorized by the registrar\n     */\n    event ImplementationAuthorized(address implementation);\n    /**\n     * @dev Emitted when the contract is  paused\n     */\n    event Paused();\n    /**\n     * @dev Emitted when the contract is unpaused\n     */\n    event UnPaused();\n\n    /**\n     * @dev Freeze a list of  addresses\n     */\n    function freeze(address[] calldata addrs) external returns (bool);\n\n    /**\n     * @dev Unfreeze a list of  addresses\n     */\n    function unfreeze(address[] calldata addrs) external returns (bool);\n\n    /**\n     * @dev Accepts the future registrar role\n     * NB: only the future registrar operator can call this method\n     */\n    function acceptRegistrarRole() external;\n\n    /**\n     * @dev Accepts the future operations role\n     * NB: only the future operations operator can call this method\n     */\n    function acceptOperationsRole() external;\n\n    /**\n     * @dev Accepts the future technical role\n     * NB: only the future technical operator can call this method\n     */\n    function acceptTechnicalRole() external;\n\n    /**\n     * @dev Authorizes the future new implementation contract\n     * NB: only the (current) registrar operator can call this method\n     */\n    function authorizeImplementation(address implementation) external;\n    /**\n     * @dev pause the contract except for regitrar actions mint and burn\n     * NB: only the (current) registrar operator can call this method\n     */\n    function pause() external;\n    /**\n     * @dev unpause the contract\n     * NB: only the (current) registrar operator can call this method\n     */\n    function unpause() external;\n        /**\n     * @dev find not frozen addresses\n     */\n    function findNotFrozen(\n        address[] calldata addrs\n    ) external view returns (address[] memory);\n}\n"
      },
      "contracts/smartCoin/ISmartCoin.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity 0.8.17;\n\n/**\n * @dev This interface is a slightly modified version of the IERC20 standard interface\n * Transfers to the registrar operator or the operations operator will occur\n * once validated by the registrar operator using the validateTransfer method\n */\ninterface ISmartCoin {\n    /**\n     * @dev Emitted when a transfer request is initiated\n     */\n    event TransferRequested(\n        bytes32 transferHash,\n        address indexed from,\n        address indexed to,\n        uint256 value\n    );\n    /**\n     * @dev Emitted when a transfer request is rejected\n     */\n    event TransferRejected(bytes32 transferHash);\n    /**\n     * @dev Emitted when a transfer request is validated\n     */\n    event TransferValidated(bytes32 transferHash);\n\n    /**\n     * @dev Burns a `amount` amount of tokens from the caller.\n     */\n    function burn(uint256 amount) external returns (bool);\n\n    /**\n     * @dev Mints a `amount` amount of tokens on `to` address\n     */\n    function mint(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Transfer the balance of `_addr` to registrar address\n     * The tokens are transferred then burned\n     *\n     * NB: This method is reserved to the registrar operator.\n     */\n    function wipeFrozenAddress(address _addr) external returns (bool);\n\n    /**\n     * @dev Same semantic as ERC20's transfer function although there are 2 cases :\n     * 1- if the destination address is neither the registar operator's nor the operations operator's,\n     * then the transfer will occur right away\n     * 2 - if the destination is either the registrar operator's or the operations operator's\n     * then the transfer will only actually occur once validated by the registrar operator\n     * using the validateTransfer method\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.     *\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Atomically decreases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `spender` must have allowance for the caller of at least\n     * `requestedDecrease`.\n     *\n     * NOTE: Although this function is designed to avoid double spending with {approval},\n     * it can still be frontrunned, preventing any attempt of allowance reduction.\n     */\n    function decreaseAllowance(\n        address spender,\n        uint256 subtractedValue\n    ) external returns (bool);\n\n    /**\n     * @dev Atomically increases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function increaseAllowance(\n        address spender,\n        uint256 addedValue\n    ) external returns (bool);\n\n    /**\n     * @dev Same semantic as ERC20's transferFrom function(no validation needed)\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 value\n    ) external returns (bool);\n\n    /**\n     * @dev Actually performs the transfer request corresponding to the given `transferHash`\n     * NB: only for transfers whose destination is either the registrar operator's address or the operations operator's\n     * Called by the registrar operator\n     */\n    function validateTransfer(bytes32 transferHash) external returns (bool);\n\n    /**\n     * @dev Rejects(and thus, actually cancels) the transfer request corresponding to the given `transferHash`\n     * NB: only for transfers whose destination is either the registrar operator's address or the operations operator's\n     * Called by the registrar operator\n     */\n    function rejectTransfer(bytes32 transferHash) external returns (bool);\n\n    /**\n     * @dev Returns the balance of `addr` account\n     */\n    function balanceOf(address addr) external view returns (uint256);\n\n    /**\n     * @dev Returns current amount engaged in transfer requests for `addr` account\n     */\n    function engagedAmount(address addr) external view returns (uint256);\n\n    /**\n     * @dev Returns the contract's operators' addresses\n     */\n    function getOperators()\n        external\n        view\n        returns (address registrar, address operations, address technical);\n\n    /* start performed by openzeppelin ERC20 \n     * function allowance(address owner, address spender)                            \n     *        external                                                               \n     *        view                                                                   \n     *        returns (uint256);                                                     \n     * function totalSupply(address) external view returns (uint256);                \n     * event Transfer(address indexed from, address indexed to, uint256 value);      \n     * event Approval(                                                               \n     *   address indexed owner,                                                      \n     *   address indexed spender,                                                    \n     *   uint256 value                                                               \n     * );                                                                            \n    end performed by openzeppelin ERC20 */\n}\n"
      },
      "contracts/smartCoin/SmartCoin.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity 0.8.17;\n\nimport \"./ISmartCoin.sol\";\nimport \"../libraries/EncodingUtils.sol\";\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"./AccessControlUpgradeable.sol\";\nimport \"./SmartCoinDataLayout.sol\";\n\n/**\n * @dev Used when trying to validate an unknown transfer request\n */\nerror TransferRequestNotFound();\n/**\n * @dev Used when trying to validate an already validated transfer request\n */\nerror InvalidTransferRequestStatus();\nerror SpenderLockedForApproval();\n/**\n * @dev Used when \"available\" balance is insufficient\n */\nerror InsufficientBalance(uint256 current, uint256 required);\n\n/**\n * @dev Used when generated hash already exists\n */\nerror HashCollision();\n/**\n * @dev The `SmartCoin` contract is basically an ERC20 with a few specifics\n * It uses the UUPS upgrade mechanism\n * It has a set of operators with specific rights :\n * - the registrar operator :\n *      - manages the blacklisting of users\n *      - reviews(and either validates or rejects) transfers of tokens back to the registrar or the operations address\n *      - names the operators for next implementation contract upgrade (AccessControlUpgradeable.nameNewOperators)\n *      - authorises upgrade to next implementation contract (AccessControlUpgradeable.authorizeImplementation)\n * - the operations operator is a special address used when token owners want to 'cash out' of the SmartCoin\n * (i.e. sell their tokens to the issuer in exchange for cash) :\n *      - it is not possible to use the operations operator's address as spender or destination of a transferFrom\n *      - transfers to the operations address have to be reviewed by the registrar operator before being performed.\n * - the technical operator :\n *      - only the technical operator can launch a (previously authorised) upgrade of the implementation contract (upgradeTo/upgradeToAndCall)\n */\ncontract SmartCoin is\n    SmartCoinDataLayout,\n    AccessControlUpgradeable,\n    ERC20Upgradeable,\n    UUPSUpgradeable,\n    ISmartCoin\n{\n    /**\n     * @dev Performs balance checks based on the \"available\" balance instead of total balance\n     * The \"available\" balance excludes tokens currently engaged in a transfer request,\n     * which is a two-step transfer back to the registrar operator or the operations operator\n     * (initiated with the transfer() method)\n     */\n    modifier onlyWhenBalanceAvailable(address _from, uint256 _value) {\n        uint256 availableBalance = _availableBalance(_from);\n        if (_value > availableBalance)\n            revert InsufficientBalance({\n                current: availableBalance,\n                required: _value\n            });\n        _;\n    }\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor(\n        address _registrar,\n        address _operations,\n        address _technical\n    )\n        onlyNotZeroAddress(_registrar)\n        onlyNotZeroAddress(_operations)\n        onlyNotZeroAddress(_technical)\n        OnlyWhenOperatorsHaveDifferentAddress(\n            _registrar,\n            _operations,\n            _technical\n        )\n        AccessControlUpgradeable(_registrar, _operations, _technical)\n    {\n        // https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#potentially-unsafe-operations\n        // https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract\n        _disableInitializers();\n    }\n\n    /**\n     * @dev Burns the balance of `_addr` address\n     *\n     * NB: This method is reserved to the registrar operator.\n     */\n    function wipeFrozenAddress(\n        address _addr\n    ) external override onlyRegistrar onlyFrozen(_addr) returns (bool) {\n        super._burn(_addr, balanceOf(_addr));\n        return true;\n    }\n\n    /**\n     * @dev Burns a `amount` amount of tokens from the caller.\n     * NB: only the registrar operator is allowed to burn their tokens\n     */\n    function burn(\n        uint256 _amount\n    )\n        external\n        override\n        onlyRegistrar\n        onlyWhenBalanceAvailable(registrar, _amount)\n        returns (bool)\n    {\n        super._burn(registrar, _amount);\n        return true;\n    }\n\n    /**\n     * @dev Mints a `amount` amount of tokens on `to` address\n     * NB: only the registrar operator is allowed to mint new tokens\n     * NB: the `_to` address has to be unfrozen\n     */\n    function mint(\n        address _to,\n        uint256 _amount\n    ) external override onlyRegistrar onlyNotFrozen(_to) returns (bool) {\n        super._mint(_to, _amount);\n        return true;\n    }\n\n    function upgradeTo(\n        address _newImplementation\n    )\n        external\n        virtual\n        override\n        onlyProxy\n        consumeAuthorizeImplementation(_newImplementation)\n    {\n        _authorizeUpgrade(_newImplementation);\n        _upgradeToAndCallUUPS(_newImplementation, new bytes(0), false);\n        _resetNewOperators();\n    }\n\n    function upgradeToAndCall(\n        address _newImplementation,\n        bytes memory data\n    )\n        external\n        payable\n        virtual\n        override\n        onlyProxy\n        consumeAuthorizeImplementation(_newImplementation)\n    {\n        _authorizeUpgrade(_newImplementation);\n        _upgradeToAndCallUUPS(_newImplementation, data, true);\n        _resetNewOperators();\n    }\n\n    /**\n     * @dev Actually performs the transfer request corresponding to the given `transferHash`\n     * NB: only for transfers whose destination is either the registrar operator's address or the operations operator's\n     * Called by the registrar operator\n     */\n    function validateTransfer(\n        bytes32 transferHash\n    ) external onlyRegistrar returns (bool) {\n        TransferRequest memory _transferRequest = _transfers[transferHash];\n\n        if (_transferRequest.status == TransferStatus.Undefined) {\n            revert TransferRequestNotFound();\n        }\n\n        if (_transferRequest.status != TransferStatus.Created) {\n            revert InvalidTransferRequestStatus();\n        }\n        _transfers[transferHash].status = TransferStatus.Validated;\n        _engagedAmount[_transferRequest.from] -= _transferRequest.value;\n        _safeTransfer(\n            _transferRequest.from,\n            _transferRequest.to,\n            _transferRequest.value\n        );\n\n        emit TransferValidated(transferHash);\n        return true;\n    }\n\n    /**\n     * @dev Rejects(and thus, actually cancels) the transfer request corresponding to the given `transferHash`\n     * NB: only for transfers whose destination is either the registrar operator's address or the operations operator's\n     * Called by the registrar operator\n     */\n    function rejectTransfer(\n        bytes32 transferHash\n    ) external onlyRegistrar returns (bool) {\n        TransferRequest memory transferRequest = _transfers[transferHash];\n\n        if (transferRequest.status == TransferStatus.Undefined) {\n            revert TransferRequestNotFound();\n        }\n\n        if (transferRequest.status != TransferStatus.Created) {\n            revert InvalidTransferRequestStatus();\n        }\n        _engagedAmount[transferRequest.from] -= transferRequest.value;\n        _transfers[transferHash].status = TransferStatus.Rejected;\n\n        emit TransferRejected(transferHash);\n\n        return true;\n    }\n\n    /**\n     * @dev Returns the contract's operators' addresses\n     */\n    function getOperators() external view returns (address, address, address) {\n        return (registrar, operations, technical);\n    }\n\n    /**\n     * @dev Returns the version number of this contract\n     */\n    function version() external pure virtual returns (string memory) {\n        return \"V2\";\n    }\n\n    /**\n     * @dev UUPS initializer that initializes the token's name and symbol\n     */\n    function initialize(\n        string memory _name,\n        string memory _symbol\n    ) public initializer {\n        __ERC20_init(_name, _symbol);\n        __AccessControl_init();\n        __UUPSUpgradeable_init();\n    }\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     * NB: both the owner(msg.sender) and the spender have to be not frozen\n     * NB: Will fail if the spender is either the registar operator or the operations operator\n     */\n    function approve(\n        address _spender,\n        uint256 _value\n    )\n        public\n        override(ERC20Upgradeable, ISmartCoin)\n        onlyWhenNotPaused\n        onlyNotFrozen(_msgSender())\n        onlyNotFrozen(_spender)\n        forbiddenForRegistrar(_spender)\n        forbiddenForOperations(_spender)\n        returns (bool)\n    {\n        super._approve(_msgSender(), _spender, _value);\n        return true;\n    }\n\n    /**\n     * @dev Atomically decreases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `spender` must have allowance for the caller of at least\n     * `requestedDecrease`.\n     * - `spender` and msg.sender have to be unfrozen\n     *\n     * NOTE: Although this function is designed to avoid double spending with {approval},\n     * it can still be frontrunned, preventing any attempt of allowance reduction.\n     */\n    function decreaseAllowance(\n        address _spender,\n        uint256 _subtractedValue\n    )\n        public\n        override(ERC20Upgradeable, ISmartCoin)\n        onlyWhenNotPaused\n        onlyNotFrozen(_spender)\n        onlyNotFrozen(_msgSender())\n        returns (bool)\n    {\n        return super.decreaseAllowance(_spender, _subtractedValue);\n    }\n\n    /**\n     * @dev Atomically increases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `spender` and msg.sender have to be unfrozen\n     * - `spender` cannot be either the registar operator or the operations operator\n     */\n    function increaseAllowance(\n        address _spender,\n        uint256 _addedValue\n    )\n        public\n        override(ERC20Upgradeable, ISmartCoin)\n        onlyWhenNotPaused\n        onlyNotFrozen(_spender)\n        onlyNotFrozen(_msgSender())\n        forbiddenForRegistrar(_spender)\n        forbiddenForOperations(_spender)\n        returns (bool)\n    {\n        return super.increaseAllowance(_spender, _addedValue);\n    }\n\n    /**\n     * @dev Same semantic as ERC20's transferFrom function(no validation needed)\n     * NB: the owner(_from),the spender(msg.sender) and the destination have to be unfrozen\n     * NB: Will fail if the destination is either the registar operator or the operations operator\n     */\n    function transferFrom(\n        address _from,\n        address _to,\n        uint256 _value\n    )\n        public\n        override(ERC20Upgradeable, ISmartCoin)\n        onlyWhenNotPaused\n        onlyNotFrozen(_msgSender())\n        onlyNotFrozen(_from)\n        onlyNotFrozen(_to)\n        forbiddenForRegistrar(_to)\n        forbiddenForOperations(_to)\n        onlyWhenBalanceAvailable(_from, _value)\n        returns (bool)\n    {\n        return super.transferFrom(_from, _to, _value);\n    }\n\n    /**\n     * @dev Same semantic as ERC20's transfer function although there are 2 cases :\n     * 1- if the destination address is neither the registar operator's nor the operations operator's,\n     * then the transfer will occur right away\n     * 2 - if the destination is either the registrar operator's or the operations operator's\n     * then the transfer will only actually occur once validated by the registrar operator\n     * using the validateTransfer method\n     *\n     * NB: both the source(msg.sender) and the destination have to be unfrozen\n     */\n    function transfer(\n        address _to,\n        uint256 _value\n    )\n        public\n        override(ISmartCoin, ERC20Upgradeable)\n        onlyWhenNotPaused\n        onlyNotFrozen(_msgSender())\n        onlyNotFrozen(_to)\n        onlyWhenBalanceAvailable(_msgSender(), _value)\n        returns (bool)\n    {\n        if (_to != registrar && _to != operations) {\n            _safeTransfer(_msgSender(), _to, _value);\n        } else {\n            _initiateTransferRequest(_msgSender(), _to, _value);\n        }\n\n        return true;\n    }\n\n    /**\n     * @dev Returns the balance of `addr` account.\n     * NB: The returned balance is the \"available\" balance, which excludes tokens engaged in a transfer request\n     * (i.e. a transfer back to the registrar operator or the operations operator)\n     */\n    function balanceOf(\n        address _addr\n    ) public view override(ERC20Upgradeable, ISmartCoin) returns (uint256) {\n        return _availableBalance(_addr);\n    }\n\n    /**\n     * @dev Returns current amount engaged in transfer requests for `addr` account\n     */\n    function engagedAmount(address _addr) public view returns (uint256) {\n        return _engagedAmount[_addr];\n    }\n\n    /**\n     * @dev Internal method initiating a two-step transfer request.\n     * and emits a corresponding `TransferRequested` event\n     * Used when the destination of the transfer is either the registrar operator or the operations operator.\n     *\n     * NB : to comply with the ERC20 standard, this method emits a Transfer event with 0 value\n     * another Transfer event with the correct value will occur if the transfer request is validated through a call to validateTransfer()\n     */\n    function _initiateTransferRequest(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal {\n        _engagedAmount[_from] += _value;\n        bytes32 transferHash = EncodingUtils.encodeRequest(\n            _from,\n            _to,\n            _value,\n            _requestCounter\n        );\n        if(_transfers[transferHash].status != TransferStatus.Undefined) revert HashCollision();\n        _transfers[transferHash] = TransferRequest(\n            _from,\n            _to,\n            _value,\n            TransferStatus.Created\n        );\n\n        _requestCounter += 1;\n\n        emit Transfer(_from, _to, 0); // Required by https://eips.ethereum.org/EIPS/eip-20#transfer\n        emit TransferRequested(transferHash, _from, _to, _value);\n    }\n\n    function _safeTransfer(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal onlyNotFrozen(_from) onlyNotFrozen(_to) {\n        super._transfer(_from, _to, _value);\n    }\n\n    // solhint-disable-next-line no-empty-blocks\n    function _authorizeUpgrade(\n        address newImplementation\n    ) internal override onlyTechnical {}\n\n    /**\n     * @dev Internal method that computes the available(i.e. not engaged) balance\n     */\n    function _availableBalance(address _addr) internal view returns (uint256) {\n        unchecked {\n            return super.balanceOf(_addr) - _engagedAmount[_addr]; // No overflow since balance >= engagedAmount\n        }\n    }\n}\n"
      },
      "contracts/smartCoin/SmartCoinDataLayout.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity 0.8.17;\n\n/**\n * @dev This contract contains the storage part of the SmartCoin contract.\n * It includes a __gap field that enables adding new fields without messing up the layout\n * and keeping compatibility accross UUPS updates (see field description for details)\n */\nabstract contract SmartCoinDataLayout {\n    /**\n     * @dev The different status a transfer request can have\n     * Transfer requests are initially in the `Created` state\n     * If validated by the registrar operator they move to the `Validated` state, which is a final state\n     * If rejected by the registrar operator  they move to the `Rejected` state, which is a final state\n     *\n     */\n    enum TransferStatus {\n        Undefined,\n        Created,\n        Validated,\n        Rejected\n    }\n    /**\n     * @dev The details of a transfer request\n     */\n    struct TransferRequest {\n        /**\n         * @dev The source address of the transfer\n         */\n        address from;\n        /**\n         * @dev The destination address of the transfer\n         */\n        address to;\n        /**\n         * @dev The number of tokens to transfer\n         */\n        uint256 value;\n        /**\n         * @dev The status of the transfer request\n         */\n        TransferStatus status;\n    }\n\n    /**\n     * @dev Structure containing all ongoing transfer requests\n     * Requests are indexed by the hash of their content\n     */\n    mapping(bytes32 => TransferRequest) internal _transfers;\n    uint256 internal _requestCounter;\n\n    /**\n     * @dev Structure containing all amounts currently engaged(i.e. \"locked\") in transfer requests\n     */\n    mapping(address => uint256) internal _engagedAmount; // _engagedAmount amount in transfer\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}