{"sources":{"node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reininitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        assembly {\n            $.slot := INITIALIZABLE_STORAGE\n        }\n    }\n}\n"},"node_modules/@openzeppelin/contracts/interfaces/draft-IERC6093.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"},"node_modules/@openzeppelin/contracts/utils/Panic.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n *      using Panic for uint256;\n *\n *      // Use any of the declared internal constants\n *      function foo() { Panic.GENERIC.panic(); }\n *\n *      // Alternatively\n *      function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n    /// @dev generic / unspecified error\n    uint256 internal constant GENERIC = 0x00;\n    /// @dev used by the assert() builtin\n    uint256 internal constant ASSERT = 0x01;\n    /// @dev arithmetic underflow or overflow\n    uint256 internal constant UNDER_OVERFLOW = 0x11;\n    /// @dev division or modulo by zero\n    uint256 internal constant DIVISION_BY_ZERO = 0x12;\n    /// @dev enum conversion error\n    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n    /// @dev invalid encoding in storage\n    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n    /// @dev empty array pop\n    uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n    /// @dev array out of bounds access\n    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n    /// @dev resource error (too large allocation or too large array)\n    uint256 internal constant RESOURCE_ERROR = 0x41;\n    /// @dev calling invalid internal function\n    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n    /// @dev Reverts with a panic code. Recommended to use with\n    /// the internal constants with predefined codes.\n    function panic(uint256 code) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0x00, 0x4e487b71)\n            mstore(0x20, code)\n            revert(0x1c, 0x24)\n        }\n    }\n}\n"},"node_modules/@openzeppelin/contracts/utils/ShortStrings.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string  | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA   |\n// | length  | 0x                                                              BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n *     using ShortStrings for *;\n *\n *     ShortString private immutable _name;\n *     string private _nameFallback;\n *\n *     constructor(string memory contractName) {\n *         _name = contractName.toShortStringWithFallback(_nameFallback);\n *     }\n *\n *     function name() external view returns (string memory) {\n *         return _name.toStringWithFallback(_nameFallback);\n *     }\n * }\n * ```\n */\nlibrary ShortStrings {\n    // Used as an identifier for strings longer than 31 bytes.\n    bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n    error StringTooLong(string str);\n    error InvalidShortString();\n\n    /**\n     * @dev Encode a string of at most 31 chars into a `ShortString`.\n     *\n     * This will trigger a `StringTooLong` error is the input string is too long.\n     */\n    function toShortString(string memory str) internal pure returns (ShortString) {\n        bytes memory bstr = bytes(str);\n        if (bstr.length > 31) {\n            revert StringTooLong(str);\n        }\n        return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n    }\n\n    /**\n     * @dev Decode a `ShortString` back to a \"normal\" string.\n     */\n    function toString(ShortString sstr) internal pure returns (string memory) {\n        uint256 len = byteLength(sstr);\n        // using `new string(len)` would work locally but is not memory safe.\n        string memory str = new string(32);\n        assembly (\"memory-safe\") {\n            mstore(str, len)\n            mstore(add(str, 0x20), sstr)\n        }\n        return str;\n    }\n\n    /**\n     * @dev Return the length of a `ShortString`.\n     */\n    function byteLength(ShortString sstr) internal pure returns (uint256) {\n        uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n        if (result > 31) {\n            revert InvalidShortString();\n        }\n        return result;\n    }\n\n    /**\n     * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n     */\n    function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n        if (bytes(value).length < 32) {\n            return toShortString(value);\n        } else {\n            StorageSlot.getStringSlot(store).value = value;\n            return ShortString.wrap(FALLBACK_SENTINEL);\n        }\n    }\n\n    /**\n     * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\n     */\n    function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n            return toString(value);\n        } else {\n            return store;\n        }\n    }\n\n    /**\n     * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n     * {setWithFallback}.\n     *\n     * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n     * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n     */\n    function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n            return byteLength(value);\n        } else {\n            return bytes(store).length;\n        }\n    }\n}\n"},"node_modules/@openzeppelin/contracts/utils/StorageSlot.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\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 ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\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(newImplementation.code.length > 0);\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\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    struct Int256Slot {\n        int256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes 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        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n     */\n    function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n}\n"},"node_modules/@openzeppelin/contracts/utils/Strings.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SafeCast} from \"./math/SafeCast.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    using SafeCast for *;\n\n    bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n    uint8 private constant ADDRESS_LENGTH = 20;\n\n    /**\n     * @dev The `value` string doesn't fit in the specified `length`.\n     */\n    error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n    /**\n     * @dev The string being parsed contains characters that are not in scope of the given base.\n     */\n    error StringsInvalidChar();\n\n    /**\n     * @dev The string being parsed is not a properly formatted address.\n     */\n    error StringsInvalidAddressFormat();\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            uint256 length = Math.log10(value) + 1;\n            string memory buffer = new string(length);\n            uint256 ptr;\n            assembly (\"memory-safe\") {\n                ptr := add(buffer, add(32, length))\n            }\n            while (true) {\n                ptr--;\n                assembly (\"memory-safe\") {\n                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\n                }\n                value /= 10;\n                if (value == 0) break;\n            }\n            return buffer;\n        }\n    }\n\n    /**\n     * @dev Converts a `int256` to its ASCII `string` decimal representation.\n     */\n    function toStringSigned(int256 value) internal pure returns (string memory) {\n        return string.concat(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value)));\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            return toHexString(value, Math.log256(value) + 1);\n        }\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        uint256 localValue = value;\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = HEX_DIGITS[localValue & 0xf];\n            localValue >>= 4;\n        }\n        if (localValue != 0) {\n            revert StringsInsufficientHexLength(value, length);\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\n     * representation.\n     */\n    function toHexString(address addr) internal pure returns (string memory) {\n        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n     * representation, according to EIP-55.\n     */\n    function toChecksumHexString(address addr) internal pure returns (string memory) {\n        bytes memory buffer = bytes(toHexString(addr));\n\n        // hash the hex part of buffer (skip length + 2 bytes, length 40)\n        uint256 hashValue;\n        assembly (\"memory-safe\") {\n            hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n        }\n\n        for (uint256 i = 41; i > 1; --i) {\n            // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n            if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n                // case shift by xoring with 0x20\n                buffer[i] ^= 0x20;\n            }\n            hashValue >>= 4;\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Returns true if the two strings are equal.\n     */\n    function equal(string memory a, string memory b) internal pure returns (bool) {\n        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n    }\n\n    /**\n     * @dev Parse a decimal string and returns the value as a `uint256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `[0-9]*`\n     * - The result must fit into an `uint256` type\n     */\n    function parseUint(string memory input) internal pure returns (uint256) {\n        return parseUint(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseUint} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `[0-9]*`\n     * - The result must fit into an `uint256` type\n     */\n    function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n        (bool success, uint256 value) = tryParseUint(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {\n        return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n     * character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseUint(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, uint256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseUintUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseUint} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseUintUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, uint256 value) {\n        bytes memory buffer = bytes(input);\n\n        uint256 result = 0;\n        for (uint256 i = begin; i < end; ++i) {\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n            if (chr > 9) return (false, 0);\n            result *= 10;\n            result += chr;\n        }\n        return (true, result);\n    }\n\n    /**\n     * @dev Parse a decimal string and returns the value as a `int256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `[-+]?[0-9]*`\n     * - The result must fit in an `int256` type.\n     */\n    function parseInt(string memory input) internal pure returns (int256) {\n        return parseInt(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `[-+]?[0-9]*`\n     * - The result must fit in an `int256` type.\n     */\n    function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {\n        (bool success, int256 value) = tryParseInt(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if\n     * the result does not fit in a `int256`.\n     *\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n     */\n    function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {\n        return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    uint256 private constant ABS_MIN_INT256 = 2 ** 255;\n\n    /**\n     * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n     * character or if the result does not fit in a `int256`.\n     *\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n     */\n    function tryParseInt(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, int256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseIntUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseInt} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseIntUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, int256 value) {\n        bytes memory buffer = bytes(input);\n\n        // Check presence of a negative sign.\n        bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        bool positiveSign = sign == bytes1(\"+\");\n        bool negativeSign = sign == bytes1(\"-\");\n        uint256 offset = (positiveSign || negativeSign).toUint();\n\n        (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);\n\n        if (absSuccess && absValue < ABS_MIN_INT256) {\n            return (true, negativeSign ? -int256(absValue) : int256(absValue));\n        } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {\n            return (true, type(int256).min);\n        } else return (false, 0);\n    }\n\n    /**\n     * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as a `uint256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]*`\n     * - The result must fit in an `uint256` type.\n     */\n    function parseHexUint(string memory input) internal pure returns (uint256) {\n        return parseHexUint(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseHexUint} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]*`\n     * - The result must fit in an `uint256` type.\n     */\n    function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n        (bool success, uint256 value) = tryParseHexUint(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {\n        return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an\n     * invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseHexUint(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, uint256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseHexUintUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseHexUint} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseHexUintUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, uint256 value) {\n        bytes memory buffer = bytes(input);\n\n        // skip 0x prefix if present\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        uint256 offset = hasPrefix.toUint() * 2;\n\n        uint256 result = 0;\n        for (uint256 i = begin + offset; i < end; ++i) {\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n            if (chr > 15) return (false, 0);\n            result *= 16;\n            unchecked {\n                // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).\n                // This guaratees that adding a value < 16 will not cause an overflow, hence the unchecked.\n                result += chr;\n            }\n        }\n        return (true, result);\n    }\n\n    /**\n     * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as an `address`.\n     *\n     * Requirements:\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`\n     */\n    function parseAddress(string memory input) internal pure returns (address) {\n        return parseAddress(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseAddress} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`\n     */\n    function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {\n        (bool success, address value) = tryParseAddress(input, begin, end);\n        if (!success) revert StringsInvalidAddressFormat();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly\n     * formatted address. See {parseAddress} requirements.\n     */\n    function tryParseAddress(string memory input) internal pure returns (bool success, address value) {\n        return tryParseAddress(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly\n     * formatted address. See {parseAddress} requirements.\n     */\n    function tryParseAddress(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, address value) {\n        if (end > bytes(input).length || begin > end) return (false, address(0));\n\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        uint256 expectedLength = 40 + hasPrefix.toUint() * 2;\n\n        // check that input is the correct length\n        if (end - begin == expectedLength) {\n            // length guarantees that this does not overflow, and value is at most type(uint160).max\n            (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);\n            return (s, address(uint160(v)));\n        } else {\n            return (false, address(0));\n        }\n    }\n\n    function _tryParseChr(bytes1 chr) private pure returns (uint8) {\n        uint8 value = uint8(chr);\n\n        // Try to parse `chr`:\n        // - Case 1: [0-9]\n        // - Case 2: [a-f]\n        // - Case 3: [A-F]\n        // - otherwise not supported\n        unchecked {\n            if (value > 47 && value < 58) value -= 48;\n            else if (value > 96 && value < 103) value -= 87;\n            else if (value > 64 && value < 71) value -= 55;\n            else return type(uint8).max;\n        }\n\n        return value;\n    }\n\n    /**\n     * @dev Reads a bytes32 from a bytes array without bounds checking.\n     *\n     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\n     * assembly block as such would prevent some optimizations.\n     */\n    function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {\n        // This is not memory safe in the general case, but all calls to this private function are within bounds.\n        assembly (\"memory-safe\") {\n            value := mload(add(buffer, add(0x20, offset)))\n        }\n    }\n}\n"},"node_modules/@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing a bytes32 `messageHash` with\n     * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n     * keccak256, although any bytes32 value can be safely used because the final digest will\n     * be re-hashed.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n        }\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing an arbitrary `message` with\n     * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n        return\n            keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x00` (data with intended validator).\n     *\n     * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n     * `validator` address. Then hashing the result.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n     *\n     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n     * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            mstore(ptr, hex\"19_01\")\n            mstore(add(ptr, 0x02), domainSeparator)\n            mstore(add(ptr, 0x22), structHash)\n            digest := keccak256(ptr, 0x42)\n        }\n    }\n}\n"},"node_modules/@openzeppelin/contracts/utils/math/Math.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Floor, // Toward negative infinity\n        Ceil, // Toward positive infinity\n        Trunc, // Toward zero\n        Expand // Away from zero\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a + b;\n            if (c < a) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            if (b > a) return (false, 0);\n            return (true, a - b);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n            // benefit is lost if 'b' is also tested.\n            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n            if (a == 0) return (true, 0);\n            uint256 c = a * b;\n            if (c / a != b) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a / b);\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a % b);\n        }\n    }\n\n    /**\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * SafeCast.toUint(condition));\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a > b, a, b);\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a < b, a, b);\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds towards infinity instead\n     * of rounding towards zero.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (b == 0) {\n            // Guarantee the same behavior as in a regular Solidity division.\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n\n        // The following calculation ensures accurate ceiling division without overflow.\n        // Since a is non-zero, (a - 1) / b will not overflow.\n        // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n        // but the largest value we can obtain is type(uint256).max - 1, which happens\n        // when a = type(uint256).max and b = 1.\n        unchecked {\n            return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n        }\n    }\n\n    /**\n     * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n     * denominator == 0.\n     *\n     * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n     * Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n            // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2²⁵⁶ + prod0.\n            uint256 prod0 = x * y; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n            if (denominator <= prod1) {\n                Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n            }\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n            uint256 twos = denominator & (0 - denominator);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n            // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n            // works in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n            inverse *= 2 - denominator * inverse; // inverse mod 2³²\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\n            // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n    }\n\n    /**\n     * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n     *\n     * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n     * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n     *\n     * If the input value is not inversible, 0 is returned.\n     *\n     * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n     * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n     */\n    function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n        unchecked {\n            if (n == 0) return 0;\n\n            // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n            // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n            // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n            // ax + ny = 1\n            // ax = 1 + (-y)n\n            // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n            // If the remainder is 0 the gcd is n right away.\n            uint256 remainder = a % n;\n            uint256 gcd = n;\n\n            // Therefore the initial coefficients are:\n            // ax + ny = gcd(a, n) = n\n            // 0a + 1n = n\n            int256 x = 0;\n            int256 y = 1;\n\n            while (remainder != 0) {\n                uint256 quotient = gcd / remainder;\n\n                (gcd, remainder) = (\n                    // The old remainder is the next gcd to try.\n                    remainder,\n                    // Compute the next remainder.\n                    // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n                    // where gcd is at most n (capped to type(uint256).max)\n                    gcd - remainder * quotient\n                );\n\n                (x, y) = (\n                    // Increment the coefficient of a.\n                    y,\n                    // Decrement the coefficient of n.\n                    // Can overflow, but the result is casted to uint256 so that the\n                    // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n                    x - y * int256(quotient)\n                );\n            }\n\n            if (gcd != 1) return 0; // No inverse exists.\n            return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n        }\n    }\n\n    /**\n     * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n     *\n     * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n     * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n     * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n     *\n     * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n     */\n    function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n        unchecked {\n            return Math.modExp(a, p - 2, p);\n        }\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n     *\n     * Requirements:\n     * - modulus can't be zero\n     * - underlying staticcall to precompile must succeed\n     *\n     * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n     * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n     * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n     * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n     * interpreted as 0.\n     */\n    function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n        (bool success, uint256 result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n     * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n     * to operate modulo 0 or if the underlying precompile reverted.\n     *\n     * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n     * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n     * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n     * of a revert, but the result may be incorrectly interpreted as 0.\n     */\n    function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n        if (m == 0) return (false, 0);\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            // | Offset    | Content    | Content (Hex)                                                      |\n            // |-----------|------------|--------------------------------------------------------------------|\n            // | 0x00:0x1f | size of b  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x20:0x3f | size of e  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x40:0x5f | size of m  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n            // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n            // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n            mstore(ptr, 0x20)\n            mstore(add(ptr, 0x20), 0x20)\n            mstore(add(ptr, 0x40), 0x20)\n            mstore(add(ptr, 0x60), b)\n            mstore(add(ptr, 0x80), e)\n            mstore(add(ptr, 0xa0), m)\n\n            // Given the result < m, it's guaranteed to fit in 32 bytes,\n            // so we can use the memory scratch space located at offset 0.\n            success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n            result := mload(0x00)\n        }\n    }\n\n    /**\n     * @dev Variant of {modExp} that supports inputs of arbitrary length.\n     */\n    function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n        (bool success, bytes memory result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n     */\n    function tryModExp(\n        bytes memory b,\n        bytes memory e,\n        bytes memory m\n    ) internal view returns (bool success, bytes memory result) {\n        if (_zeroBytes(m)) return (false, new bytes(0));\n\n        uint256 mLen = m.length;\n\n        // Encode call args in result and move the free memory pointer\n        result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n        assembly (\"memory-safe\") {\n            let dataPtr := add(result, 0x20)\n            // Write result on top of args to avoid allocating extra memory.\n            success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n            // Overwrite the length.\n            // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n            mstore(result, mLen)\n            // Set the memory pointer after the returned data.\n            mstore(0x40, add(dataPtr, mLen))\n        }\n    }\n\n    /**\n     * @dev Returns whether the provided byte array is zero.\n     */\n    function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n        for (uint256 i = 0; i < byteArray.length; ++i) {\n            if (byteArray[i] != 0) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n     * towards zero.\n     *\n     * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n     * using integer operations.\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        unchecked {\n            // Take care of easy edge cases when a == 0 or a == 1\n            if (a <= 1) {\n                return a;\n            }\n\n            // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n            // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n            // the current value as `ε_n = | x_n - sqrt(a) |`.\n            //\n            // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n            // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n            // bigger than any uint256.\n            //\n            // By noticing that\n            // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n            // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n            // to the msb function.\n            uint256 aa = a;\n            uint256 xn = 1;\n\n            if (aa >= (1 << 128)) {\n                aa >>= 128;\n                xn <<= 64;\n            }\n            if (aa >= (1 << 64)) {\n                aa >>= 64;\n                xn <<= 32;\n            }\n            if (aa >= (1 << 32)) {\n                aa >>= 32;\n                xn <<= 16;\n            }\n            if (aa >= (1 << 16)) {\n                aa >>= 16;\n                xn <<= 8;\n            }\n            if (aa >= (1 << 8)) {\n                aa >>= 8;\n                xn <<= 4;\n            }\n            if (aa >= (1 << 4)) {\n                aa >>= 4;\n                xn <<= 2;\n            }\n            if (aa >= (1 << 2)) {\n                xn <<= 1;\n            }\n\n            // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n            //\n            // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n            // This is going to be our x_0 (and ε_0)\n            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n            // From here, Newton's method give us:\n            // x_{n+1} = (x_n + a / x_n) / 2\n            //\n            // One should note that:\n            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n            //              = ((x_n² + a) / (2 * x_n))² - a\n            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n            //              = (x_n² - a)² / (2 * x_n)²\n            //              = ((x_n² - a) / (2 * x_n))²\n            //              ≥ 0\n            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n            //\n            // This gives us the proof of quadratic convergence of the sequence:\n            // ε_{n+1} = | x_{n+1} - sqrt(a) |\n            //         = | (x_n + a / x_n) / 2 - sqrt(a) |\n            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n            //         = | (x_n - sqrt(a))² / (2 * x_n) |\n            //         = | ε_n² / (2 * x_n) |\n            //         = ε_n² / | (2 * x_n) |\n            //\n            // For the first iteration, we have a special case where x_0 is known:\n            // ε_1 = ε_0² / | (2 * x_0) |\n            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))\n            //     ≤ 2**(e-3) / 3\n            //     ≤ 2**(e-3-log2(3))\n            //     ≤ 2**(e-4.5)\n            //\n            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n            // ε_{n+1} = ε_n² / | (2 * x_n) |\n            //         ≤ (2**(e-k))² / (2 * 2**(e-1))\n            //         ≤ 2**(2*e-2*k) / 2**e\n            //         ≤ 2**(e-2*k)\n            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above\n            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5\n            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9\n            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18\n            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36\n            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72\n\n            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n            // sqrt(a) or sqrt(a) + 1.\n            return xn - SafeCast.toUint(xn > a / xn);\n        }\n    }\n\n    /**\n     * @dev Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        uint256 exp;\n        unchecked {\n            exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n            value >>= exp;\n            result += exp;\n\n            result += SafeCast.toUint(value > 1);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        uint256 isGt;\n        unchecked {\n            isGt = SafeCast.toUint(value > (1 << 128) - 1);\n            value >>= isGt * 128;\n            result += isGt * 16;\n\n            isGt = SafeCast.toUint(value > (1 << 64) - 1);\n            value >>= isGt * 64;\n            result += isGt * 8;\n\n            isGt = SafeCast.toUint(value > (1 << 32) - 1);\n            value >>= isGt * 32;\n            result += isGt * 4;\n\n            isGt = SafeCast.toUint(value > (1 << 16) - 1);\n            value >>= isGt * 16;\n            result += isGt * 2;\n\n            result += SafeCast.toUint(value > (1 << 8) - 1);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n        }\n    }\n\n    /**\n     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n     */\n    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n        return uint8(rounding) % 2 == 1;\n    }\n}\n"},"node_modules/@openzeppelin/contracts/utils/math/SafeCast.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n    /**\n     * @dev Value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n    /**\n     * @dev An int value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedIntToUint(int256 value);\n\n    /**\n     * @dev Value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n    /**\n     * @dev An uint value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedUintToInt(uint256 value);\n\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        if (value > type(uint248).max) {\n            revert SafeCastOverflowedUintDowncast(248, value);\n        }\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        if (value > type(uint240).max) {\n            revert SafeCastOverflowedUintDowncast(240, value);\n        }\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        if (value > type(uint232).max) {\n            revert SafeCastOverflowedUintDowncast(232, value);\n        }\n        return uint232(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint224 from uint256, reverting on\n     * overflow (when the input is greater than largest uint224).\n     *\n     * Counterpart to Solidity's `uint224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toUint224(uint256 value) internal pure returns (uint224) {\n        if (value > type(uint224).max) {\n            revert SafeCastOverflowedUintDowncast(224, value);\n        }\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        if (value > type(uint216).max) {\n            revert SafeCastOverflowedUintDowncast(216, value);\n        }\n        return uint216(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint208 from uint256, reverting on\n     * overflow (when the input is greater than largest uint208).\n     *\n     * Counterpart to Solidity's `uint208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toUint208(uint256 value) internal pure returns (uint208) {\n        if (value > type(uint208).max) {\n            revert SafeCastOverflowedUintDowncast(208, value);\n        }\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        if (value > type(uint200).max) {\n            revert SafeCastOverflowedUintDowncast(200, value);\n        }\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        if (value > type(uint192).max) {\n            revert SafeCastOverflowedUintDowncast(192, value);\n        }\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        if (value > type(uint184).max) {\n            revert SafeCastOverflowedUintDowncast(184, value);\n        }\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        if (value > type(uint176).max) {\n            revert SafeCastOverflowedUintDowncast(176, value);\n        }\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        if (value > type(uint168).max) {\n            revert SafeCastOverflowedUintDowncast(168, value);\n        }\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        if (value > type(uint160).max) {\n            revert SafeCastOverflowedUintDowncast(160, value);\n        }\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        if (value > type(uint152).max) {\n            revert SafeCastOverflowedUintDowncast(152, value);\n        }\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        if (value > type(uint144).max) {\n            revert SafeCastOverflowedUintDowncast(144, value);\n        }\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        if (value > type(uint136).max) {\n            revert SafeCastOverflowedUintDowncast(136, value);\n        }\n        return uint136(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint128 from uint256, reverting on\n     * overflow (when the input is greater than largest uint128).\n     *\n     * Counterpart to Solidity's `uint128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toUint128(uint256 value) internal pure returns (uint128) {\n        if (value > type(uint128).max) {\n            revert SafeCastOverflowedUintDowncast(128, value);\n        }\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        if (value > type(uint120).max) {\n            revert SafeCastOverflowedUintDowncast(120, value);\n        }\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        if (value > type(uint112).max) {\n            revert SafeCastOverflowedUintDowncast(112, value);\n        }\n        return uint112(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint104 from uint256, reverting on\n     * overflow (when the input is greater than largest uint104).\n     *\n     * Counterpart to Solidity's `uint104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toUint104(uint256 value) internal pure returns (uint104) {\n        if (value > type(uint104).max) {\n            revert SafeCastOverflowedUintDowncast(104, value);\n        }\n        return uint104(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint96 from uint256, reverting on\n     * overflow (when the input is greater than largest uint96).\n     *\n     * Counterpart to Solidity's `uint96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toUint96(uint256 value) internal pure returns (uint96) {\n        if (value > type(uint96).max) {\n            revert SafeCastOverflowedUintDowncast(96, value);\n        }\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        if (value > type(uint88).max) {\n            revert SafeCastOverflowedUintDowncast(88, value);\n        }\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        if (value > type(uint80).max) {\n            revert SafeCastOverflowedUintDowncast(80, value);\n        }\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        if (value > type(uint72).max) {\n            revert SafeCastOverflowedUintDowncast(72, value);\n        }\n        return uint72(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint64 from uint256, reverting on\n     * overflow (when the input is greater than largest uint64).\n     *\n     * Counterpart to Solidity's `uint64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toUint64(uint256 value) internal pure returns (uint64) {\n        if (value > type(uint64).max) {\n            revert SafeCastOverflowedUintDowncast(64, value);\n        }\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        if (value > type(uint56).max) {\n            revert SafeCastOverflowedUintDowncast(56, value);\n        }\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        if (value > type(uint48).max) {\n            revert SafeCastOverflowedUintDowncast(48, value);\n        }\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        if (value > type(uint40).max) {\n            revert SafeCastOverflowedUintDowncast(40, value);\n        }\n        return uint40(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint32 from uint256, reverting on\n     * overflow (when the input is greater than largest uint32).\n     *\n     * Counterpart to Solidity's `uint32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toUint32(uint256 value) internal pure returns (uint32) {\n        if (value > type(uint32).max) {\n            revert SafeCastOverflowedUintDowncast(32, value);\n        }\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        if (value > type(uint24).max) {\n            revert SafeCastOverflowedUintDowncast(24, value);\n        }\n        return uint24(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint16 from uint256, reverting on\n     * overflow (when the input is greater than largest uint16).\n     *\n     * Counterpart to Solidity's `uint16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toUint16(uint256 value) internal pure returns (uint16) {\n        if (value > type(uint16).max) {\n            revert SafeCastOverflowedUintDowncast(16, value);\n        }\n        return uint16(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint8 from uint256, reverting on\n     * overflow (when the input is greater than largest uint8).\n     *\n     * Counterpart to Solidity's `uint8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toUint8(uint256 value) internal pure returns (uint8) {\n        if (value > type(uint8).max) {\n            revert SafeCastOverflowedUintDowncast(8, value);\n        }\n        return uint8(value);\n    }\n\n    /**\n     * @dev Converts a signed int256 into an unsigned uint256.\n     *\n     * Requirements:\n     *\n     * - input must be greater than or equal to 0.\n     */\n    function toUint256(int256 value) internal pure returns (uint256) {\n        if (value < 0) {\n            revert SafeCastOverflowedIntToUint(value);\n        }\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(248, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(240, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(232, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(224, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(216, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(208, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(200, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(192, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(184, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(176, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(168, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(160, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(152, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(144, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(136, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int128 from int256, reverting on\n     * overflow (when the input is less than smallest int128 or\n     * greater than largest int128).\n     *\n     * Counterpart to Solidity's `int128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(128, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(120, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(112, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(104, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(96, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(88, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(80, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(72, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int64 from int256, reverting on\n     * overflow (when the input is less than smallest int64 or\n     * greater than largest int64).\n     *\n     * Counterpart to Solidity's `int64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(64, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(56, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(48, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(40, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int32 from int256, reverting on\n     * overflow (when the input is less than smallest int32 or\n     * greater than largest int32).\n     *\n     * Counterpart to Solidity's `int32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(32, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(24, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int16 from int256, reverting on\n     * overflow (when the input is less than smallest int16 or\n     * greater than largest int16).\n     *\n     * Counterpart to Solidity's `int16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(16, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int8 from int256, reverting on\n     * overflow (when the input is less than smallest int8 or\n     * greater than largest int8).\n     *\n     * Counterpart to Solidity's `int8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(8, value);\n        }\n    }\n\n    /**\n     * @dev Converts an unsigned uint256 into a signed int256.\n     *\n     * Requirements:\n     *\n     * - input must be less than or equal to maxInt256.\n     */\n    function toInt256(uint256 value) internal pure returns (int256) {\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n        if (value > uint256(type(int256).max)) {\n            revert SafeCastOverflowedUintToInt(value);\n        }\n        return int256(value);\n    }\n\n    /**\n     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n     */\n    function toUint(bool b) internal pure returns (uint256 u) {\n        assembly (\"memory-safe\") {\n            u := iszero(iszero(b))\n        }\n    }\n}\n"},"node_modules/@openzeppelin/contracts/utils/math/SignedMath.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n    /**\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two signed numbers.\n     */\n    function max(int256 a, int256 b) internal pure returns (int256) {\n        return ternary(a > b, a, b);\n    }\n\n    /**\n     * @dev Returns the smallest of two signed numbers.\n     */\n    function min(int256 a, int256 b) internal pure returns (int256) {\n        return ternary(a < b, a, b);\n    }\n\n    /**\n     * @dev Returns the average of two signed numbers without overflow.\n     * The result is rounded towards zero.\n     */\n    function average(int256 a, int256 b) internal pure returns (int256) {\n        // Formula from the book \"Hacker's Delight\"\n        int256 x = (a & b) + ((a ^ b) >> 1);\n        return x + (int256(uint256(x) >> 255) & (a ^ b));\n    }\n\n    /**\n     * @dev Returns the absolute unsigned value of a signed value.\n     */\n    function abs(int256 n) internal pure returns (uint256) {\n        unchecked {\n            // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n            // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n            // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n            // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n            // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n            int256 mask = n >> 255;\n\n            // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n            return uint256((n + mask) ^ mask);\n        }\n    }\n}\n"},"node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n *     // Add the library methods\n *     using EnumerableSet for EnumerableSet.AddressSet;\n *\n *     // Declare a set state variable\n *     EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n    // To implement this library for multiple types with as little code\n    // repetition as possible, we write it in terms of a generic Set type with\n    // bytes32 values.\n    // The Set implementation uses private functions, and user-facing\n    // implementations (such as AddressSet) are just wrappers around the\n    // underlying Set.\n    // This means that we can only create new EnumerableSets for types that fit\n    // in bytes32.\n\n    struct Set {\n        // Storage of set values\n        bytes32[] _values;\n        // Position is the index of the value in the `values` array plus 1.\n        // Position 0 is used to mean a value is not in the set.\n        mapping(bytes32 value => uint256) _positions;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function _add(Set storage set, bytes32 value) private returns (bool) {\n        if (!_contains(set, value)) {\n            set._values.push(value);\n            // The value is stored at length-1, but we add 1 to all indexes\n            // and use 0 as a sentinel value\n            set._positions[value] = set._values.length;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function _remove(Set storage set, bytes32 value) private returns (bool) {\n        // We cache the value's position to prevent multiple reads from the same storage slot\n        uint256 position = set._positions[value];\n\n        if (position != 0) {\n            // Equivalent to contains(set, value)\n            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n            // the array, and then remove the last element (sometimes called as 'swap and pop').\n            // This modifies the order of the array, as noted in {at}.\n\n            uint256 valueIndex = position - 1;\n            uint256 lastIndex = set._values.length - 1;\n\n            if (valueIndex != lastIndex) {\n                bytes32 lastValue = set._values[lastIndex];\n\n                // Move the lastValue to the index where the value to delete is\n                set._values[valueIndex] = lastValue;\n                // Update the tracked position of the lastValue (that was just moved)\n                set._positions[lastValue] = position;\n            }\n\n            // Delete the slot where the moved value was stored\n            set._values.pop();\n\n            // Delete the tracked position for the deleted slot\n            delete set._positions[value];\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function _contains(Set storage set, bytes32 value) private view returns (bool) {\n        return set._positions[value] != 0;\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function _length(Set storage set) private view returns (uint256) {\n        return set._values.length;\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function _at(Set storage set, uint256 index) private view returns (bytes32) {\n        return set._values[index];\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function _values(Set storage set) private view returns (bytes32[] memory) {\n        return set._values;\n    }\n\n    // Bytes32Set\n\n    struct Bytes32Set {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _add(set._inner, value);\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _remove(set._inner, value);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n        return _contains(set._inner, value);\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(Bytes32Set storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n        return _at(set._inner, index);\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        bytes32[] memory result;\n\n        assembly (\"memory-safe\") {\n            result := store\n        }\n\n        return result;\n    }\n\n    // AddressSet\n\n    struct AddressSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(AddressSet storage set, address value) internal returns (bool) {\n        return _add(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(AddressSet storage set, address value) internal returns (bool) {\n        return _remove(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(AddressSet storage set, address value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(AddressSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(AddressSet storage set, uint256 index) internal view returns (address) {\n        return address(uint160(uint256(_at(set._inner, index))));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(AddressSet storage set) internal view returns (address[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        address[] memory result;\n\n        assembly (\"memory-safe\") {\n            result := store\n        }\n\n        return result;\n    }\n\n    // UintSet\n\n    struct UintSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(UintSet storage set, uint256 value) internal returns (bool) {\n        return _add(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(UintSet storage set, uint256 value) internal returns (bool) {\n        return _remove(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(UintSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n        return uint256(_at(set._inner, index));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(UintSet storage set) internal view returns (uint256[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        uint256[] memory result;\n\n        assembly (\"memory-safe\") {\n            result := store\n        }\n\n        return result;\n    }\n}\n"},"node_modules/agora-contracts/src/contracts/access-control/AgoraAccessControl.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.0;\n\n// ====================================================================\n//             _        ______     ___   _______          _\n//            / \\     .' ___  |  .'   `.|_   __ \\        / \\\n//           / _ \\   / .'   \\_| /  .-.  \\ | |__) |      / _ \\\n//          / ___ \\  | |   ____ | |   | | |  __ /      / ___ \\\n//        _/ /   \\ \\_\\ `.___]  |\\  `-'  /_| |  \\ \\_  _/ /   \\ \\_\n//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|\n// ====================================================================\n// ======================== AgoraAccessControl ========================\n// ====================================================================\n\nimport { EnumerableSet } from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n/// @title AgoraAccessControl\n/// @notice An abstract contract that provides role-based access control with enumerable membership tracking\nabstract contract AgoraAccessControl {\n    using EnumerableSet for EnumerableSet.AddressSet;\n    using EnumerableSet for EnumerableSet.Bytes32Set;\n\n    string public constant ACCESS_CONTROL_MANAGER_ROLE = \"ACCESS_CONTROL_MANAGER_ROLE\";\n\n    /// @notice The AgoraAccessControlStorage struct\n    /// @param roleData A mapping of role identifier to AgoraAccessControlRoleData to store role data\n    /// @custom:storage-location erc7201:AgoraAccessControl.AgoraAccessControlStorage\n    struct AgoraAccessControlStorage {\n        EnumerableSet.Bytes32Set roles;\n        mapping(string _role => EnumerableSet.AddressSet membership) roleMembership;\n    }\n\n    //==============================================================================\n    // Initialization Functions\n    //==============================================================================\n\n    function _initializeAgoraAccessControl(address _initialAdminAddress) internal virtual {\n        _addRoleToSet({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n        _setRoleMembership({ _role: ACCESS_CONTROL_MANAGER_ROLE, _member: _initialAdminAddress, _insert: true });\n        emit RoleAssigned({ role: ACCESS_CONTROL_MANAGER_ROLE, member: _initialAdminAddress });\n    }\n\n    // ============================================================================================\n    // Procedural Functions\n    // ============================================================================================\n\n    function _addRoleToSet(string memory _role) internal virtual {\n        // Checks: Role name must be shorter than 32 bytes\n        if (bytes(_role).length > 32) revert RoleNameTooLong();\n        _getPointerToAgoraAccessControlStorage().roles.add(bytes32(bytes(_role)));\n    }\n\n    function _removeRoleFromSet(string memory _role) internal virtual {\n        if (_getPointerToAgoraAccessControlStorage().roleMembership[_role].length() > 0) {\n            revert CannotRemoveRoleWithMembers({ role: _role });\n        }\n        _getPointerToAgoraAccessControlStorage().roles.remove(bytes32(bytes(_role)));\n    }\n\n    function _assignRole(string memory _role, address _member, bool _addRole) internal virtual {\n        // Checks: Role must exist\n        _requireRoleExists({ _role: _role });\n\n        // Effects: Set the roleMembership to the new _member\n        _setRoleMembership({ _role: _role, _member: _member, _insert: _addRole });\n\n        // Emit event\n        if (_addRole) emit RoleAssigned({ role: _role, member: _member });\n        else emit RoleRevoked({ role: _role, member: _member });\n    }\n\n    /// @notice The ```grantAccessControlManagerRole``` function grants `ACCESS_CONTROL_MANAGER_ROLE` to an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be granted the role\n    function grantAccessControlManagerRole(address _member) public virtual {\n        // Checks: Only `ACCESS_CONTROL_MANAGER_ROLE` can grant the role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n        _assignRole({ _role: ACCESS_CONTROL_MANAGER_ROLE, _member: _member, _addRole: true });\n    }\n\n    /// @notice The ```revokeAccessControlManagerRole``` function revokes `ACCESS_CONTROL_MANAGER_ROLE` from an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @dev An `ACCESS_CONTROL_MANAGER_ROLE` member can't remove oneself from the role.\n    /// @param _member The address to be revoked the role\n    function revokeAccessControlManagerRole(address _member) public virtual {\n        // Checks: Only `ACCESS_CONTROL_MANAGER_ROLE` can revoke the role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        // Checks: cannot revoke oneself as `ACCESS_CONTROL_MANAGER_ROLE`\n        if (_member == msg.sender) revert CannotRevokeSelf();\n\n        _assignRole({ _role: ACCESS_CONTROL_MANAGER_ROLE, _member: _member, _addRole: false });\n    }\n\n    // ============================================================================================\n    // Internal Effects Functions\n    // ============================================================================================\n\n    /// @notice The ```_setRoleMembership``` function sets the role membership\n    /// @param _role The role identifier to transfer\n    /// @param _member The address of the new role\n    /// @param _insert Whether to add or remove the address from the role\n    function _setRoleMembership(string memory _role, address _member, bool _insert) internal virtual {\n        if (_insert) _getPointerToAgoraAccessControlStorage().roleMembership[_role].add(_member);\n        else _getPointerToAgoraAccessControlStorage().roleMembership[_role].remove(_member);\n    }\n\n    // ============================================================================================\n    // Internal Checks Functions\n    // ============================================================================================\n\n    /// @notice The ```_roleExists``` function checks if _role exists in the role set\n    /// @param _role The role identifier to check\n    /// @return Whether or not _role exists as a known role\n    function _roleExists(string memory _role) internal view virtual returns (bool) {\n        return _getPointerToAgoraAccessControlStorage().roles.contains(bytes32(bytes(_role)));\n    }\n\n    /// @notice The ```_requireRoleExists``` function revers if _role does not exist in the role set\n    /// @param _role The role identifier to check\n    function _requireRoleExists(string memory _role) internal view virtual {\n        if (!_roleExists({ _role: _role })) revert RoleDoesNotExist({ role: _role });\n    }\n\n    /// @notice The ```_isRole``` function checks if the member has the role\n    /// @param _role The role identifier to check\n    /// @param _member The address to check against the role\n    /// @return Whether or not the address has the role\n    function _isRole(string memory _role, address _member) internal view virtual returns (bool) {\n        return _getPointerToAgoraAccessControlStorage().roleMembership[_role].contains(_member);\n    }\n\n    /// @notice The ```_requireIsRole``` function reverts if member doesn't have the role\n    /// @param _role The role identifier to check\n    /// @param _member The address to check against the role\n    function _requireIsRole(string memory _role, address _member) internal view virtual {\n        if (!_isRole({ _role: _role, _member: _member })) revert AddressIsNotRole({ role: _role });\n    }\n\n    /// @notice The ```_requireSenderIsRole``` function reverts if msg.sender doesn't have the role\n    /// @dev This function is to be implemented by a public function\n    /// @param _role The role identifier to check\n    function _requireSenderIsRole(string memory _role) internal view virtual {\n        _requireIsRole({ _role: _role, _member: msg.sender });\n    }\n\n    //==============================================================================\n    // Public View Functions\n    //==============================================================================\n\n    /// @notice The ```hasRole``` function checks if _member has the role\n    /// @param _role The role identifier to check\n    /// @param _member The address to check against the role\n    /// @return Whether or not _member has the role\n    function hasRole(string memory _role, address _member) public view virtual returns (bool) {\n        return _isRole({ _role: _role, _member: _member });\n    }\n\n    /// @notice The ```getRoleMembers``` function returns the members of the role\n    /// @param _role The role identifier to check\n    /// @return The members of the role\n    function getRoleMembers(string memory _role) public view virtual returns (address[] memory) {\n        EnumerableSet.AddressSet storage _roleMembership = _getPointerToAgoraAccessControlStorage().roleMembership[\n            _role\n        ];\n        return _roleMembership.values();\n    }\n\n    /// @notice The ```getAllRoles``` function returns all roles\n    /// @return _roles The roles\n    function getAllRoles() public view virtual returns (string[] memory _roles) {\n        uint256 _length = _getPointerToAgoraAccessControlStorage().roles.length();\n        _roles = new string[](_length);\n        for (uint256 i = 0; i < _length; i++) {\n            _roles[i] = string(abi.encodePacked(_getPointerToAgoraAccessControlStorage().roles.at(i)));\n        }\n    }\n\n    /// @notice The ```getAccessControlManagerRoleMembers``` function returns the addresses holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @return The array of addresses holding `ACCESS_CONTROL_MANAGER_ROLE`\n    function getAccessControlManagerRoleMembers() public view virtual returns (address[] memory) {\n        return getRoleMembers(ACCESS_CONTROL_MANAGER_ROLE);\n    }\n\n    //==============================================================================\n    // Erc 7201: UnstructuredNamespace Storage Functions\n    //==============================================================================\n\n    /// @notice The ```AGORA_ACCESS_CONTROL_STORAGE_SLOT``` is the storage slot for the AgoraAccessControlStorage struct\n    /// @dev keccak256(abi.encode(uint256(keccak256(\"AgoraAccessControlStorage\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 public constant AGORA_ACCESS_CONTROL_STORAGE_SLOT =\n        0x8f8de9240b3899c03a31968f466af060ab1c78464aa7ae14941c20fe7917b000;\n\n    /// @notice The ```_getPointerToAgoraAccessControlStorage``` function returns a pointer to the AgoraAccessControlStorage struct\n    /// @return $ A pointer to the AgoraAccessControlStorage struct\n    function _getPointerToAgoraAccessControlStorage()\n        internal\n        pure\n        virtual\n        returns (AgoraAccessControlStorage storage $)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            $.slot := AGORA_ACCESS_CONTROL_STORAGE_SLOT\n        }\n    }\n\n    // ============================================================================================\n    // Events\n    // ============================================================================================\n\n    /// @notice The ```RoleAssigned``` event is emitted when the role is assigned\n    /// @param role The string identifier of the role that was transferred\n    /// @param member The address of the new role member\n    event RoleAssigned(string indexed role, address indexed member);\n\n    /// @notice The ```RoleRevoked``` event is emitted when the role is revoked\n    /// @param role The string identifier of the role that was transferred\n    /// @param member The address of the previous role member\n    event RoleRevoked(string indexed role, address indexed member);\n\n    // ============================================================================================\n    // Errors\n    // ============================================================================================\n\n    /// @notice Emitted when role is transferred\n    /// @param role The role identifier\n    error AddressIsNotRole(string role);\n\n    /// @notice Emitted when role name is too long\n    error RoleNameTooLong();\n\n    /// @notice Emitted when role does not exist\n    error RoleDoesNotExist(string role);\n\n    /// @notice Emitted when role still has members\n    error CannotRemoveRoleWithMembers(string role);\n\n    /// @notice Emitted when a member attempts removing oneself\n    error CannotRevokeSelf();\n}\n"},"node_modules/agora-dollar-dev/src/contracts/AgoraDollar.sol":{"content":"// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.28;\n\n// ====================================================================\n//             _        ______     ___   _______          _\n//            / \\     .' ___  |  .'   `.|_   __ \\        / \\\n//           / _ \\   / .'   \\_| /  .-.  \\ | |__) |      / _ \\\n//          / ___ \\  | |   ____ | |   | | |  __ /      / ___ \\\n//        _/ /   \\ \\_\\ `.___]  |\\  `-'  /_| |  \\ \\_  _/ /   \\ \\_\n//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|\n// ====================================================================\n// =========================== AgoraDollar ============================\n// ====================================================================\n\nimport { AgoraDollarCore, ConstructorParams, ShortStrings } from \"./AgoraDollarCore.sol\";\n\nimport { StorageLib } from \"./proxy/StorageLib.sol\";\n\n/// @title AgoraDollar\n/// @notice AgoraDollar is a digital dollar implementation\n/// @author Agora\ncontract AgoraDollar is AgoraDollarCore {\n    using StorageLib for uint256;\n    using ShortStrings for *;\n\n    /// @notice The AgoraDollar Constructor, invoked upon deployment\n    /// @param _params The constructor params for AgoraDollar\n    constructor(ConstructorParams memory _params) AgoraDollarCore(_params) {}\n\n    //==============================================================================\n    // External View Functions: Erc3009\n    //==============================================================================\n\n    // solhint-disable func-name-mixedcase\n    /// @notice The ```TRANSFER_WITH_AUTHORIZATION_TYPEHASH``` function returns the typehash for the transfer with authorization\n    function TRANSFER_WITH_AUTHORIZATION_TYPEHASH() external pure returns (bytes32) {\n        return TRANSFER_WITH_AUTHORIZATION_TYPEHASH_;\n    }\n\n    /// @notice The ```RECEIVE_WITH_AUTHORIZATION_TYPEHASH``` function returns the typehash for the receive with authorization\n    function RECEIVE_WITH_AUTHORIZATION_TYPEHASH() external pure returns (bytes32) {\n        return RECEIVE_WITH_AUTHORIZATION_TYPEHASH_;\n    }\n\n    /// @notice The ```CANCEL_AUTHORIZATION_TYPEHASH``` function returns the typehash for the cancel authorization\n    function CANCEL_AUTHORIZATION_TYPEHASH() external pure returns (bytes32) {\n        return CANCEL_AUTHORIZATION_TYPEHASH_;\n    }\n\n    /// @notice The ```authorizationState``` function returns the state of the authorization nonce for a given authorizer\n    /// @param _authorizer The account which is providing the authorization\n    /// @param _nonce The unique nonce for the authorization\n    /// @return _isNonceUsed The state of the authorization\n    function authorizationState(address _authorizer, bytes32 _nonce) external view returns (bool _isNonceUsed) {\n        _isNonceUsed = StorageLib.getPointerToEip3009Storage().isAuthorizationUsed[_authorizer][_nonce];\n    }\n\n    //==============================================================================\n    //  External View Functions: Eip712\n    //==============================================================================\n\n    /// @notice The ```hashTypedDataV4``` function hashes the typed data according to Eip712\n    /// @param _structHash The hash of the struct\n    function hashTypedDataV4(bytes32 _structHash) external view returns (bytes32) {\n        return _hashTypedDataV4({ structHash: _structHash });\n    }\n\n    /// @notice The ```domainSeparatorV4``` function returns the domain separator for Eip712\n    function domainSeparatorV4() external view returns (bytes32) {\n        return _domainSeparatorV4();\n    }\n\n    //==============================================================================\n    // External View Functions: Erc2612\n    //==============================================================================\n\n    /// @notice The ```ERC2612_STORAGE_SLOT``` function returns the storage slot for Erc2612 storage\n    function ERC2612_STORAGE_SLOT() external pure returns (bytes32) {\n        return StorageLib.ERC2612_STORAGE_SLOT_;\n    }\n\n    /// @notice The ```nonces``` function returns the nonce for a given account according to Erc2612\n    function nonces(address _account) external view returns (uint256 _nonce) {\n        _nonce = StorageLib.getPointerToErc2612Storage().nonces[_account];\n    }\n\n    //==============================================================================\n    // External View Functions: Erc20\n    //==============================================================================\n\n    /// @notice The ```name``` function returns the name of the token\n    function name() external view returns (string memory) {\n        return _name.toString();\n    }\n\n    /// @notice The ```symbol``` function returns the symbol of the token\n    function symbol() external view returns (string memory) {\n        return _symbol.toString();\n    }\n\n    /// @notice The ```balanceOf``` function returns the token balance of a given account\n    /// @param _account The account to check the balance of\n    /// @return The balance of the account\n    function balanceOf(address _account) external view returns (uint256) {\n        return StorageLib.getPointerToErc20CoreStorage().accountData[_account].balance;\n    }\n\n    /// @notice The ```allowance``` function returns the allowance a given owner has given to the spender\n    /// @param _owner The account which is giving the allowance\n    /// @param _spender The account which is being given the allowance\n    /// @return The allowance the owner has given to the spender\n    function allowance(address _owner, address _spender) external view returns (uint256) {\n        return StorageLib.getPointerToErc20CoreStorage().accountAllowances[_owner][_spender];\n    }\n\n    /// @notice The ```totalSupply``` function returns the total supply of the token\n    /// @return The total supply of the token\n    function totalSupply() external view returns (uint256) {\n        return StorageLib.getPointerToErc20CoreStorage().totalSupply;\n    }\n\n    /// @notice The ```isAccountFrozen``` function returns a boolean indicating if an account is frozen\n    /// @param _account The account whose frozen status to check\n    function isAccountFrozen(address _account) external view returns (bool) {\n        return StorageLib.getPointerToErc20CoreStorage().accountData[_account].isFrozen;\n    }\n\n    /// @notice The ```accountData``` function returns Erc20 information about a given account\n    /// @param _account The account to get the Erc20 information for\n    /// @return The Erc20 information for the account (balance, isFrozenStatus)\n    function accountData(address _account) external view returns (StorageLib.Erc20AccountData memory) {\n        return StorageLib.getPointerToErc20CoreStorage().accountData[_account];\n    }\n\n    /// @notice The ```ERC20_CORE_STORAGE_SLOT``` function returns the storage slot for Erc20 storage\n    function ERC20_CORE_STORAGE_SLOT() external pure returns (bytes32) {\n        return StorageLib.ERC20_CORE_STORAGE_SLOT_;\n    }\n\n    //==============================================================================\n    // External View Functions: AgoraDollarAccessControl\n    //==============================================================================\n\n    /// @notice The ```getMinterRoleMembers``` function returns the addresses holding `MINTER_ROLE`\n    /// @return The array of addresses holding `MINTER_ROLE`\n    function getMinterRoleMembers() external view returns (address[] memory) {\n        return getRoleMembers(MINTER_ROLE);\n    }\n\n    /// @notice The ```getBurnerRoleMembers``` function returns the addresses holding `BURNER_ROLE`\n    /// @return The array of addresses holding `BURNER_ROLE`\n    function getBurnerRoleMembers() external view returns (address[] memory) {\n        return getRoleMembers(BURNER_ROLE);\n    }\n\n    /// @notice The ```getPauserRoleMembers``` function returns the addresses holding `PAUSER_ROLE`\n    /// @return The array of addresses holding `PAUSER_ROLE`\n    function getPauserRoleMembers() external view returns (address[] memory) {\n        return getRoleMembers(PAUSER_ROLE);\n    }\n\n    /// @notice The ```getFreezerRoleMembers``` function returns the addresses holding `FREEZER_ROLE`\n    /// @return The array of addresses holding `FREEZER_ROLE`\n    function getFreezerRoleMembers() external view returns (address[] memory) {\n        return getRoleMembers(FREEZER_ROLE);\n    }\n\n    /// @notice The ```getBridgeMinterRoleMembers``` function returns the addresses holding `BRIDGE_MINTER_ROLE`\n    /// @return The array of addresses holding `BRIDGE_MINTER_ROLE`\n    function getBridgeMinterRoleMembers() external view returns (address[] memory) {\n        return getRoleMembers(BRIDGE_MINTER_ROLE);\n    }\n\n    /// @notice The ```getBridgeBurnerRoleMembers``` function returns the addresses holding `BRIDGE_BURNER_ROLE`\n    /// @return The array of addresses holding `BRIDGE_BURNER_ROLE`\n    function getBridgeBurnerRoleMembers() external view returns (address[] memory) {\n        return getRoleMembers(BRIDGE_BURNER_ROLE);\n    }\n\n    /// @notice The ```getRateLimitManagerRoleMembers``` function returns the addresses holding `RATE_LIMIT_MANAGER_ROLE`\n    /// @return The array of addresses holding `RATE_LIMIT_MANAGER_ROLE`\n    function getRateLimitManagerRoleMembers() external view returns (address[] memory) {\n        return getRoleMembers(RATE_LIMIT_MANAGER_ROLE);\n    }\n\n    //==============================================================================\n    // External View Functions: Eip712\n    //==============================================================================\n\n    /// @notice The ```eip712Domain``` function returns the Eip712 domain data\n    function eip712Domain()\n        external\n        view\n        returns (\n            bytes1 _fields,\n            string memory _name,\n            string memory _version,\n            uint256 _chainId,\n            address _verifyingContract,\n            bytes32 _salt,\n            uint256[] memory _extensions\n        )\n    {\n        return (\n            hex\"0f\", // 01111\n            _Eip712Name(),\n            _Eip712Version(),\n            block.chainid,\n            address(this),\n            bytes32(0),\n            new uint256[](0)\n        );\n    }\n\n    //==============================================================================\n    // External View Functions: AgoraDollarErc1967Proxy\n    //==============================================================================\n\n    /// @notice The ```proxyAdminAddress``` function returns the address of the proxy admin\n    /// @return The address of the proxy admin\n    function proxyAdminAddress() external view returns (address) {\n        return StorageLib.getPointerToAgoraDollarErc1967ProxyAdminStorage().proxyAdminAddress;\n    }\n\n    /// @notice The ```isMsgSenderFrozenCheckEnabled``` function returns a boolean indicating if the msg.sender frozen check is turned on\n    /// @return A boolean indicating if the msg sender frozen check is true\n    function isMsgSenderFrozenCheckEnabled() external view returns (bool) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().isMsgSenderFrozenCheckEnabled();\n    }\n\n    /// @notice The ```isTransferPaused``` function returns a boolean indicating if transfers are paused\n    /// @return A boolean indicating if transfers are paused\n    function isTransferPaused() external view returns (bool) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().isTransferPaused();\n    }\n\n    /// @notice The ```isSignatureVerificationPaused``` function returns a boolean indicating if signature verification is paused\n    /// @return A boolean indicating if signature verification is paused\n    function isSignatureVerificationPaused() external view returns (bool) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().isSignatureVerificationPaused();\n    }\n\n    /// @notice The ```isMintPaused``` function returns a boolean indicating if minting is paused\n    /// @return A boolean indicating if minting is paused\n    function isMintPaused() external view returns (bool) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().isMintPaused();\n    }\n\n    /// @notice The ```isBurnFromPaused``` function returns a boolean indicating if burnFrom is paused\n    /// @return A boolean indicating if burnFrom is paused\n    function isBurnFromPaused() external view returns (bool) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().isBurnFromPaused();\n    }\n\n    /// @notice The ```isFreezingPaused``` function returns a boolean indicating if freezing is paused\n    /// @return A boolean indicating if freezing is paused\n    function isFreezingPaused() external view returns (bool) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().isFreezingPaused();\n    }\n\n    /// @notice The ```isTransferUpgraded``` function returns a boolean indicating if the transfer function is upgraded\n    /// @return A boolean indicating if the transfer function is upgraded\n    function isTransferUpgraded() external view returns (bool) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().isTransferUpgraded();\n    }\n\n    /// @notice The ```isTransferFromUpgraded``` function returns a boolean indicating if the transferFrom function is upgraded\n    /// @return A boolean indicating if the transferFrom function is upgraded\n    function isTransferFromUpgraded() external view returns (bool) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().isTransferFromUpgraded();\n    }\n\n    /// @notice The ```isTransferWithAuthorizationUpgraded``` function returns a boolean indicating if the transferWithAuthorization function is upgraded\n    /// @return A boolean indicating if the transferWithAuthorization function is upgraded\n    function isTransferWithAuthorizationUpgraded() external view returns (bool) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().isTransferWithAuthorizationUpgraded();\n    }\n\n    /// @notice The ```isReceiveWithAuthorizationUpgraded``` function returns a boolean indicating if the receiveWithAuthorization function is upgraded\n    /// @return A boolean indicating if the receiveWithAuthorization function is upgraded\n    function isReceiveWithAuthorizationUpgraded() external view returns (bool) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().isReceiveWithAuthorizationUpgraded();\n    }\n\n    /// @notice The ```isBridgingPaused``` function returns a boolean indicating if bridging is paused\n    /// @return A boolean indicating if bridging is paused\n    function isBridgingPaused() external view returns (bool) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().isBridgingPaused();\n    }\n\n    /// @notice The ```implementation``` function returns the address of the implementation contract\n    /// @return The address of the implementation contract\n    function implementation() external view returns (address) {\n        return StorageLib.sloadImplementationSlotDataAsUint256().implementation();\n    }\n\n    //==============================================================================\n    // External View Functions: StorageLib Proxy Storage Bitmasks\n    //==============================================================================\n\n    /// @notice The ```IS_MSG_SENDER_FROZEN_CHECK_ENABLED_BIT_POSITION``` function returns a uint256 with a single bit flipped which indicates the bit position\n    /// @return A uint256 with a single bit flipped to 1\n    function IS_MSG_SENDER_FROZEN_CHECK_ENABLED_BIT_POSITION() external pure returns (uint256) {\n        return StorageLib.IS_MSG_SENDER_FROZEN_CHECK_ENABLED_BIT_POSITION_;\n    }\n\n    /// @notice The ```IS_TRANSFER_PAUSED_BIT_POSITION``` function returns a uint256 with a single bit flipped which indicates the bit position\n    /// @return A uint256 with a single bit flipped to 1\n    function IS_MINT_PAUSED_BIT_POSITION() external pure returns (uint256) {\n        return StorageLib.IS_MINT_PAUSED_BIT_POSITION_;\n    }\n\n    /// @notice The ```IS_BURN_FROM_PAUSED_BIT_POSITION``` function returns a uint256 with a single bit flipped which indicates the bit position\n    /// @return A uint256 with a single bit flipped to 1\n    function IS_BURN_FROM_PAUSED_BIT_POSITION() external pure returns (uint256) {\n        return StorageLib.IS_BURN_FROM_PAUSED_BIT_POSITION_;\n    }\n\n    /// @notice The ```IS_FREEZING_PAUSED_BIT_POSITION``` function returns a uint256 with a single bit flipped which indicates the bit position\n    /// @return A uint256 with a single bit flipped to 1\n    function IS_FREEZING_PAUSED_BIT_POSITION() external pure returns (uint256) {\n        return StorageLib.IS_FREEZING_PAUSED_BIT_POSITION_;\n    }\n\n    /// @notice The ```IS_TRANSFER_PAUSED_BIT_POSITION``` function returns a uint256 with a single bit flipped which indicates the bit position\n    /// @return A uint256 with a single bit flipped to 1\n    function IS_TRANSFER_PAUSED_BIT_POSITION() external pure returns (uint256) {\n        return StorageLib.IS_TRANSFER_PAUSED_BIT_POSITION_;\n    }\n\n    /// @notice The ```IS_SIGNATURE_VERIFICATION_PAUSED_BIT_POSITION``` function returns a uint256 with a single bit flipped which indicates the bit position\n    /// @return A uint256 with a single bit flipped to 1\n    function IS_SIGNATURE_VERIFICATION_PAUSED_BIT_POSITION() external pure returns (uint256) {\n        return StorageLib.IS_SIGNATURE_VERIFICATION_PAUSED_BIT_POSITION_;\n    }\n\n    /// @notice The ```IS_MINT_UPGRADED_BIT_POSITION``` function returns a uint256 with a single bit flipped which indicates the bit position\n    /// @return A uint256 with a single bit flipped to 1\n    function IS_TRANSFER_UPGRADED_BIT_POSITION() external pure returns (uint256) {\n        return StorageLib.IS_TRANSFER_UPGRADED_BIT_POSITION_;\n    }\n\n    /// @notice The ```IS_TRANSFER_FROM_UPGRADED_BIT_POSITION``` function returns a uint256 with a single bit flipped which indicates the bit position\n    /// @return A uint256 with a single bit flipped to 1\n    function IS_TRANSFER_FROM_UPGRADED_BIT_POSITION() external pure returns (uint256) {\n        return StorageLib.IS_TRANSFER_FROM_UPGRADED_BIT_POSITION_;\n    }\n\n    /// @notice The ```IS_TRANSFER_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION``` function returns a uint256 with a single bit flipped which indicates the bit position\n    /// @return A uint256 with a single bit flipped to 1\n    function IS_TRANSFER_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION() external pure returns (uint256) {\n        return StorageLib.IS_TRANSFER_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION_;\n    }\n\n    /// @notice The ```IS_RECEIVE_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION``` function returns a uint256 with a single bit flipped which indicates the bit position\n    /// @return A uint256 with a single bit flipped to 1\n    function IS_RECEIVE_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION() external pure returns (uint256) {\n        return StorageLib.IS_RECEIVE_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION_;\n    }\n\n    //==============================================================================\n    // Version Functions\n    //==============================================================================\n\n    /// @notice The ```Version``` struct is used to represent the version of the AgoraDollar\n    /// @param major The major version number\n    /// @param minor The minor version number\n    /// @param patch The patch version number\n    struct Version {\n        uint256 major;\n        uint256 minor;\n        uint256 patch;\n    }\n\n    /// @notice The ```version``` function returns the version of the AgoraDollar\n    /// @return _version The version of the AgoraDollar\n    function version() public pure returns (Version memory _version) {\n        _version = Version({ major: 2, minor: 1, patch: 0 });\n    }\n}\n"},"node_modules/agora-dollar-dev/src/contracts/AgoraDollarAccessControl.sol":{"content":"// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.28;\n\n// ====================================================================\n//             _        ______     ___   _______          _\n//            / \\     .' ___  |  .'   `.|_   __ \\        / \\\n//           / _ \\   / .'   \\_| /  .-.  \\ | |__) |      / _ \\\n//          / ___ \\  | |   ____ | |   | | |  __ /      / ___ \\\n//        _/ /   \\ \\_\\ `.___]  |\\  `-'  /_| |  \\ \\_  _/ /   \\ \\_\n//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|\n// ====================================================================\n// ===================== AgoraDollarAccessControl =====================\n// ====================================================================\n\nimport { AgoraAccessControl } from \"agora-contracts/access-control/AgoraAccessControl.sol\";\n\n/// @title AgoraDollarAccessControl\n/// @notice An abstract contract that manages access control for the AgoraDollar contract\n/// @author Agora\nabstract contract AgoraDollarAccessControl is AgoraAccessControl {\n    /// @notice The MINTER_ROLE identifier\n    string public constant MINTER_ROLE = \"MINTER_ROLE\";\n\n    /// @notice The BURNER_ROLE identifier\n    string public constant BURNER_ROLE = \"BURNER_ROLE\";\n\n    /// @notice The PAUSER_ROLE identifier\n    string public constant PAUSER_ROLE = \"PAUSER_ROLE\";\n\n    /// @notice The FREEZER_ROLE identifier\n    string public constant FREEZER_ROLE = \"FREEZER_ROLE\";\n\n    /// @notice The BRIDGE_MINTER_ROLE identifier\n    string public constant BRIDGE_MINTER_ROLE = \"BRIDGE_MINTER_ROLE\";\n\n    /// @notice The BRIDGE_BURNER_ROLE identifier\n    string public constant BRIDGE_BURNER_ROLE = \"BRIDGE_BURNER_ROLE\";\n\n    /// @notice The RATE_LIMIT_MANAGER_ROLE identifier\n    string public constant RATE_LIMIT_MANAGER_ROLE = \"RATE_LIMIT_MANAGER_ROLE\";\n\n    /// @notice The ```_initializeAgoraDollarAccessControl``` function initializes the AgoraDollarAccessControl contract\n    /// @dev This function adds the default roles that are required by the AgoraDollar contract\n    /// @param _initialAdminAddress The address of the initial `ACCESS_CONTROL_MANAGER_ROLE` holder\n    /// @param _initialMinter The address of the initial `MINTER_ROLE` holder\n    /// @param _initialBurner The address of the initial `BURNER_ROLE` holder\n    /// @param _initialPauser The address of the initial `PAUSER_ROLE` holder\n    /// @param _initialFreezer The address of the initial `FREEZER_ROLE` holder\n    function _initializeAgoraDollarAccessControl(\n        address _initialAdminAddress,\n        address _initialMinter,\n        address _initialBurner,\n        address _initialPauser,\n        address _initialFreezer,\n        address _initialRateLimitManager\n    ) internal {\n        _initializeAgoraAccessControl({ _initialAdminAddress: _initialAdminAddress });\n\n        // setup the minter role\n        _addRoleToSet({ _role: MINTER_ROLE });\n        _assignRole({ _role: MINTER_ROLE, _member: _initialMinter, _addRole: true });\n\n        // setup the burner role\n        _addRoleToSet({ _role: BURNER_ROLE });\n        _assignRole({ _role: BURNER_ROLE, _member: _initialBurner, _addRole: true });\n\n        // setup the pauser role\n        _addRoleToSet({ _role: PAUSER_ROLE });\n        _assignRole({ _role: PAUSER_ROLE, _member: _initialPauser, _addRole: true });\n\n        // setup the freezer role\n        _addRoleToSet({ _role: FREEZER_ROLE });\n        _assignRole({ _role: FREEZER_ROLE, _member: _initialFreezer, _addRole: true });\n\n        // setup the rate limit manager role\n        _addRoleToSet({ _role: RATE_LIMIT_MANAGER_ROLE });\n        _assignRole({ _role: RATE_LIMIT_MANAGER_ROLE, _member: _initialRateLimitManager, _addRole: true });\n\n        // setup the bridge minter role\n        _addRoleToSet({ _role: BRIDGE_MINTER_ROLE });\n\n        // setup the bridge burner role\n        _addRoleToSet({ _role: BRIDGE_BURNER_ROLE });\n    }\n\n    // ============================================================================================\n    // External Procedural Functions\n    // ============================================================================================\n\n    /// @notice The ```grantMinterRole``` function grants `MINTER_ROLE` to an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function grantMinterRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: MINTER_ROLE, _member: _member, _addRole: true });\n    }\n\n    /// @notice The ```revokeMinterRole``` function revokes `MINTER_ROLE` from an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function revokeMinterRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: MINTER_ROLE, _member: _member, _addRole: false });\n    }\n\n    /// @notice The ```grantBurnerRole``` function grants `BURNER_ROLE` to an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function grantBurnerRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: BURNER_ROLE, _member: _member, _addRole: true });\n    }\n\n    /// @notice The ```revokeBurnerRole``` function revokes `BURNER_ROLE` from an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function revokeBurnerRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: BURNER_ROLE, _member: _member, _addRole: false });\n    }\n\n    /// @notice The ```grantPauserRole``` function grants `PAUSER_ROLE` to an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function grantPauserRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: PAUSER_ROLE, _member: _member, _addRole: true });\n    }\n\n    /// @notice The ```revokePauserRole``` function revokes `PAUSER_ROLE` from an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function revokePauserRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: PAUSER_ROLE, _member: _member, _addRole: false });\n    }\n\n    /// @notice The ```grantFreezerRole``` function grants `FREEZER_ROLE` to an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function grantFreezerRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: FREEZER_ROLE, _member: _member, _addRole: true });\n    }\n\n    /// @notice The ```revokeFreezerRole``` function revokes `FREEZER_ROLE` from an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function revokeFreezerRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: FREEZER_ROLE, _member: _member, _addRole: false });\n    }\n\n    /// @notice The ```grantBridgeMinterRole``` function grants `BRIDGE_MINTER_ROLE` to an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function grantBridgeMinterRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: BRIDGE_MINTER_ROLE, _member: _member, _addRole: true });\n    }\n\n    /// @notice The ```revokeBridgeMinterRole``` function revokes `BRIDGE_MINTER_ROLE` from an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function revokeBridgeMinterRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: BRIDGE_MINTER_ROLE, _member: _member, _addRole: false });\n    }\n\n    /// @notice The ```grantBridgeBurnerRole``` function grants `BRIDGE_BURNER_ROLE` to an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function grantBridgeBurnerRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: BRIDGE_BURNER_ROLE, _member: _member, _addRole: true });\n    }\n\n    /// @notice The ```revokeBridgeBurnerRole``` function revokes `BRIDGE_BURNER_ROLE` from an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function revokeBridgeBurnerRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: BRIDGE_BURNER_ROLE, _member: _member, _addRole: false });\n    }\n\n    /// @notice The ```grantRateLimitManagerRole``` function grants `RATE_LIMIT_MANAGER_ROLE` to an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function grantRateLimitManagerRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: RATE_LIMIT_MANAGER_ROLE, _member: _member, _addRole: true });\n    }\n\n    /// @notice The ```revokeRateLimitManagerRole``` function revokes `RATE_LIMIT_MANAGER_ROLE` from an address\n    /// @dev Must be called by an address holding `ACCESS_CONTROL_MANAGER_ROLE`\n    /// @param _member The address to be assigned the role\n    function revokeRateLimitManagerRole(address _member) external {\n        // Checks: Only Admin can transfer role\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n\n        _assignRole({ _role: RATE_LIMIT_MANAGER_ROLE, _member: _member, _addRole: false });\n    }\n}\n"},"node_modules/agora-dollar-dev/src/contracts/AgoraDollarCore.sol":{"content":"// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.28;\n\n// solhint-disable func-name-mixedcase\n// ====================================================================\n//             _        ______     ___   _______          _\n//            / \\     .' ___  |  .'   `.|_   __ \\        / \\\n//           / _ \\   / .'   \\_| /  .-.  \\ | |__) |      / _ \\\n//          / ___ \\  | |   ____ | |   | | |  __ /      / ___ \\\n//        _/ /   \\ \\_\\ `.___]  |\\  `-'  /_| |  \\ \\_  _/ /   \\ \\_\n//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|\n// ====================================================================\n// ========================= AgoraDollarCore ==========================\n// ====================================================================\n\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport { ShortString, ShortStrings } from \"@openzeppelin/contracts/utils/ShortStrings.sol\";\n\nimport { Eip3009 } from \"./Eip3009.sol\";\nimport { Eip712 } from \"./Eip712.sol\";\nimport { Erc20Privileged } from \"./Erc20Privileged.sol\";\nimport { Erc2612 } from \"./Erc2612.sol\";\n\nimport { StorageLib } from \"./proxy/StorageLib.sol\";\n\n/// @notice The Constructor Params for AgoraDollarCore\n/// @param name The name of the token\n/// @param symbol The symbol of the token\n/// @param eip712Name The name of the Eip712 domain\n/// @param eip712Version The version of the Eip712 domain\n/// @param proxyAddress The address of the proxy contract\nstruct ConstructorParams {\n    string name;\n    string symbol;\n    string eip712Name;\n    string eip712Version;\n    address proxyAddress;\n}\n\n/// @notice The ```InitializeParams``` struct is used to initialize `AgoraDollarCore`\n/// @param initialAdminAddress The address of the initial admin\n/// @param initialMinterAddress The address of the initial minter\n/// @param initialBurnerAddress The address of the initial burner\n/// @param initialPauserAddress The address of the initial pauser\n/// @param initialFreezerAddress The address of the initial freezer\n/// @param initialRateLimitManagerAddress The address of the initial rate limit manager\nstruct InitializeParams {\n    address initialAdminAddress;\n    address initialMinterAddress;\n    address initialBurnerAddress;\n    address initialPauserAddress;\n    address initialFreezerAddress;\n    address initialRateLimitManagerAddress;\n}\n\n/// @title AgoraDollarCore\n/// @notice The AgoraDollarCore contract is the core implementation of the Agora Dollar token\n/// @author Agora\ncontract AgoraDollarCore is Initializable, Eip3009, Erc2612, Erc20Privileged {\n    using StorageLib for uint256;\n    using ShortStrings for *;\n\n    ShortString internal immutable _name;\n\n    ShortString internal immutable _symbol;\n\n    uint8 public immutable decimals = 6;\n\n    constructor(\n        ConstructorParams memory _params\n    ) Eip712(_params.eip712Name, _params.eip712Version, _params.proxyAddress) {\n        _name = _params.name.toShortString();\n        _symbol = _params.symbol.toShortString();\n\n        // Prevent implementation from being initialized\n        _disableInitializers();\n    }\n\n    /// @notice The ```initialize``` function initializes the AgoraDollarCore and inherited contracts\n    /// @dev Has a modifier to prevent reinitialization\n    /// @param _params The struct to define the initial addresses for role-based access control\n    function initialize(InitializeParams memory _params) external reinitializer(4) {\n        _initializeAgoraDollarAccessControl({\n            _initialAdminAddress: _params.initialAdminAddress,\n            _initialMinter: _params.initialMinterAddress,\n            _initialBurner: _params.initialBurnerAddress,\n            _initialPauser: _params.initialPauserAddress,\n            _initialFreezer: _params.initialFreezerAddress,\n            _initialRateLimitManager: _params.initialRateLimitManagerAddress\n        });\n    }\n\n    //==============================================================================\n    // External stateful Functions: Erc20\n    //==============================================================================\n\n    /// The ```approve``` function is used to approve a spender to spend a certain amount of tokens on behalf of the caller\n    /// @dev This function reverts on failure\n    /// @param _spender The address of the spender\n    /// @param _value The amount of tokens to approve for spending\n    /// @return success A boolean indicating if the approval was successful\n    function approve(address _spender, uint256 _value) external returns (bool) {\n        _approve({ _owner: msg.sender, _spender: _spender, _value: _value });\n        return true;\n    }\n\n    function transfer(address _to, uint256 _value) external returns (bool) {\n        // NOTE: implemented in proxy, here to check for signature collisions\n    }\n\n    function transferFrom(address _from, address _to, uint256 _value) external returns (bool) {\n        // NOTE: implemented in proxy, here to check for signature collisions\n    }\n\n    //==============================================================================\n    // External Stateful Functions: Erc3009\n    //==============================================================================\n\n    function transferWithAuthorization(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _validAfter,\n        uint256 _validBefore,\n        bytes32 _nonce,\n        uint8 _v,\n        bytes32 _r,\n        bytes32 _s\n    ) external {\n        // NOTE: implemented in proxy, here to check for signature collisions\n    }\n\n    function transferWithAuthorization(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _validAfter,\n        uint256 _validBefore,\n        bytes32 _nonce,\n        bytes memory _signature\n    ) public {\n        // NOTE: implemented in proxy, here to check for signature collisions\n    }\n\n    function receiveWithAuthorization(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _validAfter,\n        uint256 _validBefore,\n        bytes32 _nonce,\n        uint8 _v,\n        bytes32 _r,\n        bytes32 _s\n    ) external {\n        // NOTE: implemented in proxy, here to check for signature collisions\n    }\n\n    function receiveWithAuthorization(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _validAfter,\n        uint256 _validBefore,\n        bytes32 _nonce,\n        bytes memory _signature\n    ) public {\n        // NOTE: implemented in proxy, here to check for signature collisions\n    }\n\n    /// @notice The ```cancelAuthorization``` function cancels an authorization nonce\n    /// @dev EOA wallet signatures should be packed in the order of r, s, v\n    /// @param _authorizer    Authorizer's address\n    /// @param _nonce         Nonce of the authorization\n    /// @param _v           ECDSA signature v value\n    /// @param _r           ECDSA signature r value\n    /// @param _s           ECDSA signature s value\n    function cancelAuthorization(address _authorizer, bytes32 _nonce, uint8 _v, bytes32 _r, bytes32 _s) external {\n        cancelAuthorization({ _authorizer: _authorizer, _nonce: _nonce, _signature: abi.encodePacked(_r, _s, _v) });\n    }\n\n    /// @notice The ```cancelAuthorization``` function cancels an authorization nonce\n    /// @dev EOA wallet signatures should be packed in the order of r, s, v\n    /// @param _authorizer    Authorizer's address\n    /// @param _nonce         Nonce of the authorization\n    /// @param _signature     Signature byte array produced by an EOA wallet or a contract wallet\n    function cancelAuthorization(address _authorizer, bytes32 _nonce, bytes memory _signature) public {\n        // Effects: mark the signature as used\n        _cancelAuthorization({ _authorizer: _authorizer, _nonce: _nonce, _signature: _signature });\n    }\n\n    //==============================================================================\n    // Contract Data Setters Functions\n    //==============================================================================\n\n    /// @notice The ```setIsMsgSenderCheckEnabled``` function sets the isMsgSenderCheckEnabled state variable\n    /// @param _isEnabled The new value of the isMsgSenderCheckEnabled state variable\n    function setIsMsgSenderCheckEnabled(bool _isEnabled) external {\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n        uint256 _contractData = StorageLib.sloadImplementationSlotDataAsUint256();\n        uint256 _newContractData = _contractData.setBitWithMask({\n            _bitToSet: StorageLib.IS_MSG_SENDER_FROZEN_CHECK_ENABLED_BIT_POSITION_,\n            _setBitToOne: _isEnabled\n        });\n        _newContractData.sstoreImplementationSlotDataAsUint256();\n        emit SetIsMsgSenderCheckEnabled({ isEnabled: _isEnabled });\n    }\n\n    /// @notice The ```setIsMintPaused``` function sets the isMintPaused state variable\n    /// @param _isPaused The new value of the isMintPaused state variable\n    function setIsMintPaused(bool _isPaused) external {\n        _requireSenderIsRole({ _role: PAUSER_ROLE });\n        uint256 _contractData = StorageLib.sloadImplementationSlotDataAsUint256();\n        uint256 _newContractData = _contractData.setBitWithMask({\n            _bitToSet: StorageLib.IS_MINT_PAUSED_BIT_POSITION_,\n            _setBitToOne: _isPaused\n        });\n        _newContractData.sstoreImplementationSlotDataAsUint256();\n        emit SetIsMintPaused({ isPaused: _isPaused });\n    }\n\n    /// @notice The ```setIsBurnFromPaused``` function sets the isBurnFromPaused state variable\n    /// @param _isPaused The new value of the isBurnFromPaused state variable\n    function setIsBurnFromPaused(bool _isPaused) external {\n        _requireSenderIsRole({ _role: PAUSER_ROLE });\n        uint256 _contractData = StorageLib.sloadImplementationSlotDataAsUint256();\n        uint256 _newContractData = _contractData.setBitWithMask({\n            _bitToSet: StorageLib.IS_BURN_FROM_PAUSED_BIT_POSITION_,\n            _setBitToOne: _isPaused\n        });\n        _newContractData.sstoreImplementationSlotDataAsUint256();\n        emit SetIsBurnFromPaused({ isPaused: _isPaused });\n    }\n\n    /// @notice The ```setIsFreezingPaused``` function sets the isFreezingPaused state variable\n    /// @param _isPaused The new value of the isFreezingPaused state variable\n    function setIsFreezingPaused(bool _isPaused) external {\n        _requireSenderIsRole({ _role: PAUSER_ROLE });\n        uint256 _contractData = StorageLib.sloadImplementationSlotDataAsUint256();\n        uint256 _newContractData = _contractData.setBitWithMask({\n            _bitToSet: StorageLib.IS_FREEZING_PAUSED_BIT_POSITION_,\n            _setBitToOne: _isPaused\n        });\n        _newContractData.sstoreImplementationSlotDataAsUint256();\n        emit SetIsFreezingPaused({ isPaused: _isPaused });\n    }\n\n    /// @notice The ```setIsTransferPaused``` function sets the isTransferPaused state variable\n    /// @param _isPaused The new value of the isTransferPaused state variable\n    function setIsTransferPaused(bool _isPaused) external {\n        _requireSenderIsRole({ _role: PAUSER_ROLE });\n        uint256 _contractData = StorageLib.sloadImplementationSlotDataAsUint256();\n        uint256 _newContractData = _contractData.setBitWithMask({\n            _bitToSet: StorageLib.IS_TRANSFER_PAUSED_BIT_POSITION_,\n            _setBitToOne: _isPaused\n        });\n        _newContractData.sstoreImplementationSlotDataAsUint256();\n        emit SetIsTransferPaused({ isPaused: _isPaused });\n    }\n\n    /// @notice The ```setIsSignatureVerificationPaused``` function sets the isSignatureVerificationPaused state variable\n    /// @param _isPaused The new value of the isSignatureVerificationPaused state variable\n    function setIsSignatureVerificationPaused(bool _isPaused) external {\n        _requireSenderIsRole({ _role: PAUSER_ROLE });\n        uint256 _contractData = StorageLib.sloadImplementationSlotDataAsUint256();\n        uint256 _newContractData = _contractData.setBitWithMask({\n            _bitToSet: StorageLib.IS_SIGNATURE_VERIFICATION_PAUSED_BIT_POSITION_,\n            _setBitToOne: _isPaused\n        });\n        _newContractData.sstoreImplementationSlotDataAsUint256();\n        emit SetIsSignatureVerificationPaused({ isPaused: _isPaused });\n    }\n\n    /// @notice The ```setIsBridgingPaused``` function sets the isBridgingPaused state variable\n    /// @dev Enabling this flag prevents minting or burning from `BRIDGE_MINTER|BURNER_ROLE`\n    /// @param _isPaused The new value of the isBridgingPaused state variable\n    function setIsBridgingPaused(bool _isPaused) external {\n        _requireSenderIsRole({ _role: PAUSER_ROLE });\n        uint256 _contractData = StorageLib.sloadImplementationSlotDataAsUint256();\n        uint256 _newContractData = _contractData.setBitWithMask({\n            _bitToSet: StorageLib.IS_BRIDGING_PAUSED_BIT_POSITION_,\n            _setBitToOne: _isPaused\n        });\n        _newContractData.sstoreImplementationSlotDataAsUint256();\n        emit SetIsBridgingPaused({ isPaused: _isPaused });\n    }\n\n    /// @notice The ```setIsTransferUpgraded``` function sets the isTransferUpgraded state variable\n    /// @dev This flag forces the contract to use the implementation logic to call `transfer()`.\n    /// Ensure the implementation defines the `transfer()` function before setting this to true.\n    /// @param _isUpgraded The new value of the isTransferUpgraded state variable\n    function setIsTransferUpgraded(bool _isUpgraded) external {\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n        uint256 _contractData = StorageLib.sloadImplementationSlotDataAsUint256();\n        uint256 _newContractData = _contractData.setBitWithMask({\n            _bitToSet: StorageLib.IS_TRANSFER_UPGRADED_BIT_POSITION_,\n            _setBitToOne: _isUpgraded\n        });\n        _newContractData.sstoreImplementationSlotDataAsUint256();\n        emit SetIsTransferUpgraded({ isUpgraded: _isUpgraded });\n    }\n\n    /// @notice The ```setIsTransferFromUpgraded``` function sets the isTransferFromUpgraded state variable\n    /// @dev This flag forces the contract to use the implementation logic to call `transferFrom()`.\n    /// Ensure the implementation defines the `transferFrom()` function before setting this to true.\n    /// @param _isUpgraded The new value of the isTransferFromUpgraded state variable\n    function setIsTransferFromUpgraded(bool _isUpgraded) external {\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n        uint256 _contractData = StorageLib.sloadImplementationSlotDataAsUint256();\n        uint256 _newContractData = _contractData.setBitWithMask({\n            _bitToSet: StorageLib.IS_TRANSFER_FROM_UPGRADED_BIT_POSITION_,\n            _setBitToOne: _isUpgraded\n        });\n        _newContractData.sstoreImplementationSlotDataAsUint256();\n        emit SetIsTransferFromUpgraded({ isUpgraded: _isUpgraded });\n    }\n\n    /// @notice The ```setIsTransferWithAuthorizationUpgraded``` function sets the isTransferWithAuthorizationUpgraded state variable\n    /// @dev This flag forces the contract to use the implementation logic to call `transferWithAuthorization()`.\n    /// Ensure the implementation defines the `transferWithAuthorization()` function before setting this to true.\n    /// @param _isUpgraded The new value of the isTransferWithAuthorizationUpgraded state variable\n    function setIsTransferWithAuthorizationUpgraded(bool _isUpgraded) external {\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n        uint256 _contractData = StorageLib.sloadImplementationSlotDataAsUint256();\n        uint256 _newContractData = _contractData.setBitWithMask({\n            _bitToSet: StorageLib.IS_TRANSFER_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION_,\n            _setBitToOne: _isUpgraded\n        });\n        _newContractData.sstoreImplementationSlotDataAsUint256();\n        emit SetIsTransferWithAuthorizationUpgraded({ isUpgraded: _isUpgraded });\n    }\n\n    /// @notice The ```setIsReceiveWithAuthorizationUpgraded``` function sets the isReceiveWithAuthorizationUpgraded state variable\n    /// @dev This flag forces the contract to use the implementation logic to call `receiveWithAuthorization()`.\n    /// Ensure the implementation defines the `receiveWithAuthorization()` function before setting this to true.\n    /// @param _isUpgraded The new value of the isReceiveWithAuthorizationUpgraded state variable\n    function setIsReceiveWithAuthorizationUpgraded(bool _isUpgraded) external {\n        _requireSenderIsRole({ _role: ACCESS_CONTROL_MANAGER_ROLE });\n        uint256 _contractData = StorageLib.sloadImplementationSlotDataAsUint256();\n        uint256 _newContractData = _contractData.setBitWithMask({\n            _bitToSet: StorageLib.IS_RECEIVE_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION_,\n            _setBitToOne: _isUpgraded\n        });\n        _newContractData.sstoreImplementationSlotDataAsUint256();\n        emit SetIsReceiveWithAuthorizationUpgraded({ isUpgraded: _isUpgraded });\n    }\n\n    //==============================================================================\n    // Events\n    //==============================================================================\n\n    /// @notice The ```SetIsMsgSenderCheckEnabled``` event is emitted when the isMsgSenderCheckEnabled state variable is updated\n    /// @param isEnabled The new value of the isMsgSenderCheckEnabled state variable\n    event SetIsMsgSenderCheckEnabled(bool isEnabled);\n\n    /// @notice The ```SetIsMintPaused``` event is emitted when the isMintPaused state variable is updated\n    /// @param isPaused The new value of the isMintPaused state variable\n    event SetIsMintPaused(bool isPaused);\n\n    /// @notice The ```SetIsBurnFromPaused``` event is emitted when the isBurnFromPaused state variable is updated\n    /// @param isPaused The new value of the isBurnFromPaused state variable\n    event SetIsBurnFromPaused(bool isPaused);\n\n    /// @notice The ```SetIsFreezingPaused``` event is emitted when the isFreezingPaused state variable is updated\n    /// @param isPaused The new value of the isFreezingPaused state variable\n    event SetIsFreezingPaused(bool isPaused);\n\n    /// @notice The ```SetIsTransferPaused``` event is emitted when the isTransferPaused state variable is updated\n    /// @param isPaused The new value of the isTransferPaused state variable\n    event SetIsTransferPaused(bool isPaused);\n\n    /// @notice The ```SetIsSignatureVerificationPaused``` event is emitted when the isSignatureVerificationPaused state variable is updated\n    /// @param isPaused The new value of the isSignatureVerificationPaused state variable\n    event SetIsSignatureVerificationPaused(bool isPaused);\n\n    /// @notice The ```SetIsTransferUpgraded``` event is emitted when the isTransferUpgraded state variable is updated\n    /// @param isUpgraded The new value of the isTransferUpgraded state variable\n    event SetIsTransferUpgraded(bool isUpgraded);\n\n    /// @notice The ```SetIsTransferFromUpgraded``` event is emitted when the isTransferFromUpgraded state variable is updated\n    /// @param isUpgraded The new value of the isTransferFromUpgraded state variable\n    event SetIsTransferFromUpgraded(bool isUpgraded);\n\n    /// @notice The ```SetIsTransferWithAuthorizationUpgraded``` event is emitted when the isTransferWithAuthorizationUpgraded state variable is updated\n    /// @param isUpgraded The new value of the isTransferWithAuthorizationUpgraded state variable\n    event SetIsTransferWithAuthorizationUpgraded(bool isUpgraded);\n\n    /// @notice The ```SetIsReceiveWithAuthorizationUpgraded``` event is emitted when the isReceiveWithAuthorizationUpgraded state variable is updated\n    /// @param isUpgraded The new value of the isReceiveWithAuthorizationUpgraded state variable\n    event SetIsReceiveWithAuthorizationUpgraded(bool isUpgraded);\n\n    /// @notice The ```SetIsBridgingPaused``` event is emitted when the isBridgingPaused state variable is updated\n    /// @param isPaused The new value of the isBridgingPaused state variable\n    event SetIsBridgingPaused(bool isPaused);\n}\n"},"node_modules/agora-dollar-dev/src/contracts/AgoraDollarMintRateLimit.sol":{"content":"// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.28;\n\n// ====================================================================\n//             _        ______     ___   _______          _\n//            / \\     .' ___  |  .'   `.|_   __ \\        / \\\n//           / _ \\   / .'   \\_| /  .-.  \\ | |__) |      / _ \\\n//          / ___ \\  | |   ____ | |   | | |  __ /      / ___ \\\n//        _/ /   \\ \\_\\ `.___]  |\\  `-'  /_| |  \\ \\_  _/ /   \\ \\_\n//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|\n// ====================================================================\n// ==================== AgoraDollarMintRateLimit ======================\n// ====================================================================\n\nimport { AgoraDollarAccessControl } from \"./AgoraDollarAccessControl.sol\";\n\nimport { StorageLib } from \"./proxy/StorageLib.sol\";\n\n/// @notice The ```AgoraDollarMintRateLimit``` contract implements a linear decay rate limit for the  `_mint` functionality.\n/// @dev Inspired by the LayerZero rate limiter:\n/// https://github.com/LayerZero-Labs/devtools/blob/main/packages/oapp-evm/contracts/oapp/utils/RateLimiter.sol\nabstract contract AgoraDollarMintRateLimit is AgoraDollarAccessControl {\n    /// @notice Rate Limit Configuration struct.\n    /// @param address The address of the minter\n    /// @param limit This represents the maximum allowed amount within a given window.\n    /// @param window Defines the duration of the rate limiting window.\n    struct MintRateLimitConfig {\n        address minter;\n        uint256 limit;\n        uint256 window;\n    }\n\n    //==============================================================================\n    // Internal Procedural Functions\n    //==============================================================================\n\n    /// @notice Sets the Rate Limit.\n    /// @param _rateLimitConfig A `MintRateLimitConfig` struct representing the rate limit configuration.\n    /// - `minter`: The minter address for which the rate limit is being set.\n    /// - `limit`: This represents the maximum allowed amount within a given window.\n    /// - `window`: Defines the duration of the rate limiting window.\n    function _setMintRateLimit(MintRateLimitConfig memory _rateLimitConfig) internal {\n        StorageLib.RateLimit storage rateLimit = StorageLib.getPointerToMintRateLimitStorage().rateLimits[\n            _rateLimitConfig.minter\n        ];\n\n        // @dev Ensure we checkpoint the existing rate limit as to not retroactively apply the new decay rate.\n        _outflow({ _minter: _rateLimitConfig.minter, _amount: 0 });\n\n        // @dev Does NOT reset the amountInFlight/lastUpdated of an existing rate limit.\n        rateLimit.limit = _rateLimitConfig.limit;\n        rateLimit.window = _rateLimitConfig.window;\n        emit MintRateLimitChanged(_rateLimitConfig);\n    }\n\n    /// @notice Checks current amount in flight and amount that can be minted for a given rate limit window.\n    /// @param _amountInFlight The amount in the current window.\n    /// @param _lastUpdated Timestamp representing the last time the rate limit was checked or updated.\n    /// @param _limit This represents the maximum allowed amount within a given window.\n    /// @param _window Defines the duration of the rate limiting window.\n    /// @return currentAmountInFlight The amount in the current window.\n    /// @return amountCanBeMinted The amount that can be minted.\n    function _amountCanBeMinted(\n        uint256 _amountInFlight,\n        uint256 _lastUpdated,\n        uint256 _limit,\n        uint256 _window\n    ) internal view returns (uint256 currentAmountInFlight, uint256 amountCanBeMinted) {\n        //slither-disable-next-line timestamp\n        uint256 _timeSinceLastMint = block.timestamp - _lastUpdated;\n        // @dev Presumes linear decay.\n        uint256 _decay = (_limit * _timeSinceLastMint) / (_window > 0 ? _window : 1); // prevent division by zero\n        currentAmountInFlight = _amountInFlight <= _decay ? 0 : _amountInFlight - _decay;\n        // @dev In the event the _limit is lowered, and the 'in-flight' amount is higher than the _limit, set to 0.\n        amountCanBeMinted = _limit <= currentAmountInFlight ? 0 : _limit - currentAmountInFlight;\n    }\n\n    /// @notice Verifies whether the specified amount falls within the rate limit constraints for the targeted\n    /// minter address. On successful verification, it updates amountInFlight and lastUpdated. If the amount exceeds\n    /// the rate limit, the operation reverts.\n    /// @param _minter The address of the minter\n    /// @param _amount The amount to check for rate limit constraints.\n    function _outflow(address _minter, uint256 _amount) internal {\n        StorageLib.RateLimit storage rateLimit = StorageLib.getPointerToMintRateLimitStorage().rateLimits[_minter];\n\n        (uint256 currentAmountInFlight, uint256 amountCanBeMinted) = _amountCanBeMinted({\n            _amountInFlight: rateLimit.amountInFlight,\n            _lastUpdated: rateLimit.lastUpdated,\n            _limit: rateLimit.limit,\n            _window: rateLimit.window\n        });\n        if (_amount > amountCanBeMinted) revert RateLimitExceeded();\n\n        rateLimit.amountInFlight = currentAmountInFlight + _amount;\n        rateLimit.lastUpdated = block.timestamp;\n    }\n\n    /// @notice Get the current amount that can be sent to this destination endpoint id for the given rate limit window.\n    /// @param _minter The address of the minter\n    /// @return currentAmountInFlight The current amount in the current window.\n    /// @return amountCanBeMinted The amount that can be minted.\n    /// @dev Returns (0, 0) if _minter does not have BRIDGE_MINTER_ROLE or MINTER_ROLE\n    function getAmountCanBeMinted(\n        address _minter\n    ) external view returns (uint256 currentAmountInFlight, uint256 amountCanBeMinted) {\n        // Check if _minter has BRIDGE_MINTER_ROLE or MINTER_ROLE\n        if (\n            !_isRole({ _role: BRIDGE_MINTER_ROLE, _member: _minter }) &&\n            !_isRole({ _role: MINTER_ROLE, _member: _minter })\n        ) return (0, 0);\n\n        StorageLib.RateLimit memory rateLimit = StorageLib.getPointerToMintRateLimitStorage().rateLimits[_minter];\n        return\n            _amountCanBeMinted({\n                _amountInFlight: rateLimit.amountInFlight,\n                _lastUpdated: rateLimit.lastUpdated,\n                _limit: rateLimit.limit,\n                _window: rateLimit.window\n            });\n    }\n\n    /// @notice Gets the rate limit for a given minter address.\n    /// @param _minter The address of the minter\n    /// @return The rate limit config for the given minter address.\n    function getMintRateLimit(address _minter) external view returns (StorageLib.RateLimit memory) {\n        return StorageLib.getPointerToMintRateLimitStorage().rateLimits[_minter];\n    }\n\n    /// @notice Sets the rate limits based on MintRateLimitConfig array.\n    /// @dev Must be called by an address holding `RATE_LIMIT_MANAGER_ROLE`\n    /// @dev These values are stored in the StorageLib.RateLimit struct for each minter address.\n    /// @dev Does NOT reset the amountInFlight/lastUpdated of an existing rate limit.\n    /// @dev Disabling the rate limit should be achieved by setting it to a large value (uint128.max)\n    /// @param _rateLimitConfig structure defining the rate limits for inbound transfers.\n    function setMintRateLimit(MintRateLimitConfig calldata _rateLimitConfig) external {\n        /// Checks: Only `RATE_LIMIT_MANAGER_ROLE` can set the rate limits\n        _requireSenderIsRole(RATE_LIMIT_MANAGER_ROLE);\n\n        /// Effects: Set the rate limits\n        _setMintRateLimit(_rateLimitConfig);\n    }\n\n    //==============================================================================\n    // Errors\n    //==============================================================================\n\n    /// @notice The ```RateLimitExceeded``` error is emitted when a rate limit is exceeded during an attempted mint\n    error RateLimitExceeded();\n\n    //==============================================================================\n    // Events\n    //==============================================================================\n\n    /// @notice Emitted when _setMintRateLimit occurs\n    /// @param rateLimitConfig A `MintRateLimitConfig` struct representing the rate limit configurations set.\n    /// - `address`: The minter address for which the rate limit is being set.\n    /// - `limit`: This represents the maximum allowed amount within a given window.\n    /// - `window`: Defines the duration of the rate limiting window.\n    event MintRateLimitChanged(MintRateLimitConfig rateLimitConfig);\n}\n"},"node_modules/agora-dollar-dev/src/contracts/Eip3009.sol":{"content":"// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.28;\n\n// ====================================================================\n//             _        ______     ___   _______          _\n//            / \\     .' ___  |  .'   `.|_   __ \\        / \\\n//           / _ \\   / .'   \\_| /  .-.  \\ | |__) |      / _ \\\n//          / ___ \\  | |   ____ | |   | | |  __ /      / ___ \\\n//        _/ /   \\ \\_\\ `.___]  |\\  `-'  /_| |  \\ \\_  _/ /   \\ \\_\n//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|\n// ====================================================================\n// ============================= Eip3009 ==============================\n// ====================================================================\n\nimport { MessageHashUtils } from \"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\";\nimport { SafeCastLib } from \"solady/src/utils/SafeCastLib.sol\";\nimport { SignatureCheckerLib } from \"solady/src/utils/SignatureCheckerLib.sol\";\n\nimport { Eip712 } from \"./Eip712.sol\";\nimport { Erc20Core } from \"./Erc20Core.sol\";\n\nimport { StorageLib } from \"./proxy/StorageLib.sol\";\n\n/// @title Eip3009\n/// @notice Eip3009 provides internal implementations for gas-abstracted transfers under Eip3009 guidelines\n/// @author Agora, inspired by Circle's Eip3009 implementation\nabstract contract Eip3009 is Eip712, Erc20Core {\n    using SafeCastLib for uint256;\n    using StorageLib for uint256;\n\n    /// @notice keccak256(\"TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)\")\n    bytes32 internal constant TRANSFER_WITH_AUTHORIZATION_TYPEHASH_ =\n        0x7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a2267;\n\n    /// @notice keccak256(\"ReceiveWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)\")\n    bytes32 internal constant RECEIVE_WITH_AUTHORIZATION_TYPEHASH_ =\n        0xd099cc98ef71107a616c4f0f941f04c322d8e254fe26b3c6668db87aae413de8;\n\n    /// @notice keccak256(\"CancelAuthorization(address authorizer,bytes32 nonce)\")\n    bytes32 internal constant CANCEL_AUTHORIZATION_TYPEHASH_ =\n        0x158b0a9edf7a828aad02f63cd515c68ef2f50ba807396f6d12842833a1597429;\n\n    //==============================================================================\n    // Internal Procedural Functions\n    //==============================================================================\n\n    /// @notice The ```_transferWithAuthorization``` function executes a transfer with a signed authorization\n    /// @dev EOA wallet signatures should be packed in the order of r, s, v\n    /// @param _from Payer's address (Authorizer)\n    /// @param _to Payee's address\n    /// @param _value Amount to be transferred\n    /// @param _validAfter The time after which this is valid (unix time)\n    /// @param _validBefore The time before which this is valid (unix time)\n    /// @param _nonce Unique nonce\n    /// @param _signature Signature byte array produced by an EOA wallet or a contract wallet\n    function _transferWithAuthorization(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _validAfter,\n        uint256 _validBefore,\n        bytes32 _nonce,\n        bytes memory _signature\n    ) internal {\n        // Checks: authorization validity\n        if (block.timestamp <= _validAfter) revert InvalidAuthorization();\n        if (block.timestamp >= _validBefore) revert ExpiredAuthorization();\n        _requireUnusedAuthorization({ _authorizer: _from, _nonce: _nonce });\n\n        // Checks: valid signature\n        _requireIsValidSignatureNow({\n            _signer: _from,\n            _dataHash: keccak256(\n                abi.encode(TRANSFER_WITH_AUTHORIZATION_TYPEHASH_, _from, _to, _value, _validAfter, _validBefore, _nonce)\n            ),\n            _signature: _signature\n        });\n\n        // Effects: mark authorization as used and transfer\n        _markAuthorizationAsUsed({ _authorizer: _from, _nonce: _nonce });\n        _transfer({ _from: _from, _to: _to, _transferValue: _value.toUint248() });\n    }\n\n    /// @notice The ```_receiveWithAuthorization``` function receives a transfer with a signed authorization from the payer\n    /// @dev This has an additional check to ensure that the payee's address matches the caller of this function to prevent front-running attacks\n    /// @dev EOA wallet signatures should be packed in the order of r, s, v\n    /// @param _from Payer's address (Authorizer)\n    /// @param _to Payee's address\n    /// @param _value Amount to be transferred\n    /// @param _validAfter The block.timestamp after which the authorization is valid\n    /// @param _validBefore The block.timestamp before which the authorization is valid\n    /// @param _nonce Unique nonce\n    /// @param _signature Signature byte array produced by an EOA wallet or a contract wallet\n    function _receiveWithAuthorization(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _validAfter,\n        uint256 _validBefore,\n        bytes32 _nonce,\n        bytes memory _signature\n    ) internal {\n        // Checks: authorization validity\n        if (_to != msg.sender) revert InvalidPayee({ caller: msg.sender, payee: _to });\n        if (block.timestamp <= _validAfter) revert InvalidAuthorization();\n        if (block.timestamp >= _validBefore) revert ExpiredAuthorization();\n        _requireUnusedAuthorization({ _authorizer: _from, _nonce: _nonce });\n\n        // Checks: valid signature\n        _requireIsValidSignatureNow({\n            _signer: _from,\n            _dataHash: keccak256(\n                abi.encode(RECEIVE_WITH_AUTHORIZATION_TYPEHASH_, _from, _to, _value, _validAfter, _validBefore, _nonce)\n            ),\n            _signature: _signature\n        });\n\n        // Effects: mark authorization as used and transfer\n        _markAuthorizationAsUsed({ _authorizer: _from, _nonce: _nonce });\n        _transfer({ _from: _from, _to: _to, _transferValue: _value.toUint248() });\n    }\n\n    /// @notice The ```_cancelAuthorization``` function cancels an authorization\n    /// @dev EOA wallet signatures should be packed in the order of r, s, v\n    /// @param _authorizer Authorizer's address\n    /// @param _nonce Nonce of the authorization\n    /// @param _signature Signature byte array produced by an EOA wallet or a contract wallet\n    function _cancelAuthorization(address _authorizer, bytes32 _nonce, bytes memory _signature) internal {\n        _requireUnusedAuthorization({ _authorizer: _authorizer, _nonce: _nonce });\n        _requireIsValidSignatureNow({\n            _signer: _authorizer,\n            _dataHash: keccak256(abi.encode(CANCEL_AUTHORIZATION_TYPEHASH_, _authorizer, _nonce)),\n            _signature: _signature\n        });\n\n        StorageLib.getPointerToEip3009Storage().isAuthorizationUsed[_authorizer][_nonce] = true;\n        emit AuthorizationCanceled({ authorizer: _authorizer, nonce: _nonce });\n    }\n\n    //==============================================================================\n    // Internal Checks Functions\n    //==============================================================================\n\n    /// @notice The ```_requireIsValidSignatureNow``` function validates that signature against input data struct\n    /// @param _signer Signer's address\n    /// @param _dataHash Hash of encoded data struct\n    /// @param _signature Signature byte array produced by an EOA wallet or a contract wallet\n    function _requireIsValidSignatureNow(address _signer, bytes32 _dataHash, bytes memory _signature) private view {\n        if (\n            !SignatureCheckerLib.isValidSignatureNow({\n                signer: _signer,\n                hash: MessageHashUtils.toTypedDataHash({\n                    domainSeparator: _domainSeparatorV4(),\n                    structHash: _dataHash\n                }),\n                signature: _signature\n            })\n        ) revert InvalidSignature();\n    }\n\n    /// @notice The ```_requireUnusedAuthorization``` checks that an authorization nonce is unused\n    /// @param _authorizer    Authorizer's address\n    /// @param _nonce         Nonce of the authorization\n    function _requireUnusedAuthorization(address _authorizer, bytes32 _nonce) private view {\n        if (StorageLib.getPointerToEip3009Storage().isAuthorizationUsed[_authorizer][_nonce]) {\n            revert UsedOrCanceledAuthorization();\n        }\n    }\n\n    //==============================================================================\n    // Internal Effects Functions\n    //==============================================================================\n\n    /// @notice The ```_markAuthorizationAsUsed``` function marks an authorization nonce as used\n    /// @param _authorizer    Authorizer's address\n    /// @param _nonce         Nonce of the authorization\n    function _markAuthorizationAsUsed(address _authorizer, bytes32 _nonce) private {\n        StorageLib.getPointerToEip3009Storage().isAuthorizationUsed[_authorizer][_nonce] = true;\n        emit AuthorizationUsed({ authorizer: _authorizer, nonce: _nonce });\n    }\n\n    //==============================================================================\n    // Events\n    //==============================================================================\n\n    /// @notice ```AuthorizationUsed``` event is emitted when an authorization is used\n    /// @param authorizer Authorizer's address\n    /// @param nonce Nonce of the authorization\n    event AuthorizationUsed(address indexed authorizer, bytes32 indexed nonce);\n\n    /// @notice ```AuthorizationCanceled``` event is emitted when an authorization is canceled\n    /// @param authorizer Authorizer's address\n    /// @param nonce Nonce of the authorization\n    event AuthorizationCanceled(address indexed authorizer, bytes32 indexed nonce);\n\n    //==============================================================================\n    // Errors\n    //==============================================================================\n\n    /// @notice The ```InvalidPayee``` error is emitted when the payee does not match sender in receiveWithAuthorization\n    /// @param caller The caller of the function\n    /// @param payee The expected payee in the function\n    error InvalidPayee(address caller, address payee);\n\n    /// @notice The ```InvalidAuthorization``` error is emitted when the authorization is invalid because its too early\n    error InvalidAuthorization();\n\n    /// @notice The ```ExpiredAuthorization``` error is emitted when the authorization is expired\n    error ExpiredAuthorization();\n\n    /// @notice The ```InvalidSignature``` error is emitted when the signature is invalid\n    error InvalidSignature();\n\n    /// @notice The ```UsedOrCanceledAuthorization``` error is emitted when the authorization nonce is already used or canceled\n    error UsedOrCanceledAuthorization();\n}\n"},"node_modules/agora-dollar-dev/src/contracts/Eip712.sol":{"content":"// SPDX-License-Identifier: Apache-2.0\n\n// ***NOTE***: This file has been modified to remove external functions and storage for use in a transparent-ish proxy\n// ***NOTE***: Modified from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/dbb6104ce834628e473d2173bbc9d47f81a9eec3/contracts/utils/cryptography/EIP712.sol\n\npragma solidity 0.8.28;\n\n// ====================================================================\n//             _        ______     ___   _______          _\n//            / \\     .' ___  |  .'   `.|_   __ \\        / \\\n//           / _ \\   / .'   \\_| /  .-.  \\ | |__) |      / _ \\\n//          / ___ \\  | |   ____ | |   | | |  __ /      / ___ \\\n//        _/ /   \\ \\_\\ `.___]  |\\  `-'  /_| |  \\ \\_  _/ /   \\ \\_\n//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|\n// ====================================================================\n// ============================= Eip712 ===============================\n// ====================================================================\n\nimport { ShortString, ShortStrings } from \"@openzeppelin/contracts/utils/ShortStrings.sol\";\nimport { MessageHashUtils } from \"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n */\n\n/// @title Eip712\n/// @author Agora, modified from OpenZeppelin implementation\nabstract contract Eip712 {\n    using ShortStrings for *;\n\n    bytes32 private constant TYPE_HASH =\n        keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n    // invalidate the cached domain separator if the chain id changes.\n    bytes32 private immutable _cachedDomainSeparator;\n    uint256 private immutable _cachedChainId;\n    address private immutable _cachedThis;\n\n    bytes32 private immutable _hashedName;\n    bytes32 private immutable _hashedVersion;\n\n    ShortString private immutable _name;\n    ShortString private immutable _version;\n\n    /**\n     * @dev Initializes the domain separator and parameter caches.\n     *\n     * The meaning of `name` and `version` is specified in\n     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n     *\n     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n     * - `version`: the current major version of the signing domain.\n     */\n    constructor(string memory name, string memory version, address expectedProxyAddress) {\n        _name = name.toShortString();\n        _version = version.toShortString();\n        _hashedName = keccak256(bytes(name));\n        _hashedVersion = keccak256(bytes(version));\n\n        _cachedChainId = block.chainid;\n        _cachedDomainSeparator = keccak256(\n            abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, expectedProxyAddress)\n        );\n        _cachedThis = expectedProxyAddress;\n    }\n\n    /// @dev Returns the domain separator for the current chain\n    function _domainSeparatorV4() internal view returns (bytes32) {\n        if (address(this) == _cachedThis && block.chainid == _cachedChainId) return _cachedDomainSeparator;\n        else return _buildDomainSeparator();\n    }\n\n    function _buildDomainSeparator() private view returns (bytes32) {\n        return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n    }\n\n    /**\n     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n     * function returns the hash of the fully encoded EIP712 message for this domain.\n     *\n     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n     *\n     * ```solidity\n     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n     *     keccak256(\"Mail(address to,string contents)\"),\n     *     mailTo,\n     *     keccak256(bytes(mailContents))\n     * )));\n     * address signer = ECDSA.recover(digest, signature);\n     * ```\n     */\n    function _hashTypedDataV4(bytes32 structHash) internal view returns (bytes32) {\n        return MessageHashUtils.toTypedDataHash({ domainSeparator: _domainSeparatorV4(), structHash: structHash });\n    }\n\n    /**\n     * @dev The name parameter for the Eip712 domain.\n     *\n     * NOTE: By default this function reads _name which is an immutable value.\n     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function _Eip712Name() internal view returns (string memory) {\n        return _name.toString();\n    }\n\n    /**\n     * @dev The version parameter for the Eip712 domain.\n     *\n     * NOTE: By default this function reads _version which is an immutable value.\n     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function _Eip712Version() internal view returns (string memory) {\n        return _version.toString();\n    }\n}\n"},"node_modules/agora-dollar-dev/src/contracts/Erc20Core.sol":{"content":"// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.28;\n\n// ====================================================================\n//             _        ______     ___   _______          _\n//            / \\     .' ___  |  .'   `.|_   __ \\        / \\\n//           / _ \\   / .'   \\_| /  .-.  \\ | |__) |      / _ \\\n//          / ___ \\  | |   ____ | |   | | |  __ /      / ___ \\\n//        _/ /   \\ \\_\\ `.___]  |\\  `-'  /_| |  \\ \\_  _/ /   \\ \\_\n//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|\n// ====================================================================\n// ============================ Erc20Core =============================\n// ====================================================================\n\nimport { IERC20Errors as IErc20Errors } from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\n\nimport { SafeCastLib } from \"solady/src/utils/SafeCastLib.sol\";\n\nimport { StorageLib } from \"./proxy/StorageLib.sol\";\n\n/// @notice The ```Erc20Core``` contract is a base contract for the Erc20 standard\n/// @title Erc20Core\n/// @author Agora\nabstract contract Erc20Core is IErc20Errors {\n    using StorageLib for uint256;\n    using SafeCastLib for uint256;\n\n    //==============================================================================\n    // Internal Procedural Functions\n    //==============================================================================\n\n    /// The ```_approve``` function is used to approve a spender to spend a certain amount of tokens on behalf of the caller\n    /// @dev This function reverts on failure\n    /// @param _spender The address of the spender\n    /// @param _value The amount of tokens to approve for spending\n    function _approve(address _owner, address _spender, uint256 _value) internal {\n        StorageLib.getPointerToErc20CoreStorage().accountAllowances[_owner][_spender] = _value;\n        emit Approval({ owner: _owner, spender: _spender, value: _value });\n    }\n\n    /// @notice The ```_transfer``` function transfers tokens which belong to the caller\n    /// @dev This function reverts on failure\n    /// @param _to The address of the recipient\n    /// @param _transferValue The amount of tokens to transfer\n    function _transfer(address _from, address _to, uint248 _transferValue) internal {\n        // Checks: Ensure _from address is not frozen\n        StorageLib.Erc20AccountData memory _accountDataFrom = StorageLib.getPointerToErc20CoreStorage().accountData[\n            _from\n        ];\n        if (_accountDataFrom.isFrozen) revert AccountIsFrozen({ frozenAccount: _from });\n\n        // Checks: Ensure _from has enough balance\n        if (_accountDataFrom.balance < _transferValue) {\n            revert ERC20InsufficientBalance({\n                sender: _from,\n                balance: _accountDataFrom.balance,\n                needed: _transferValue\n            });\n        }\n\n        // Effects: update balances on the _from account\n        unchecked {\n            // Underflow not possible: _transferValue <= fromBalance asserted above\n            StorageLib.getPointerToErc20CoreStorage().accountData[_from].balance =\n                _accountDataFrom.balance -\n                _transferValue;\n        }\n\n        // NOTE: typically checks are done before effects, but in this case we need to handle the case where _to == _from and so we want to read the latest values\n        // Checks: Ensure _to address is not frozen\n        StorageLib.Erc20AccountData memory _accountDataTo = StorageLib.getPointerToErc20CoreStorage().accountData[_to];\n        if (_accountDataTo.isFrozen) revert AccountIsFrozen({ frozenAccount: _to });\n\n        // Effects: update balances on the _to account\n        unchecked {\n            // Overflow not possible: _transferValue + toBalance <= (2^248 -1) x 10^-6 [more money than atoms in the galaxy]\n            StorageLib.getPointerToErc20CoreStorage().accountData[_to].balance =\n                _accountDataTo.balance +\n                _transferValue;\n        }\n\n        emit Transfer({ from: _from, to: _to, value: _transferValue });\n    }\n\n    /// @notice The ```_spendAllowance``` function decrements a spenders allowance\n    /// @dev Treats type(uint256).max as infinite allowance and does not update balance\n    /// @param _owner The address of the owner\n    /// @param _spender The address of the spender\n    /// @param _value The amount of allowance to decrement\n    function _spendAllowance(address _owner, address _spender, uint256 _value) internal {\n        uint256 _currentAllowance = StorageLib.getPointerToErc20CoreStorage().accountAllowances[_owner][_spender];\n\n        // We treat uint256.max as infinite allowance, so we don't need to read/write storage in that case\n        if (_currentAllowance != type(uint256).max) {\n            if (_currentAllowance < _value) {\n                revert ERC20InsufficientAllowance({ spender: _spender, allowance: _currentAllowance, needed: _value });\n            }\n            unchecked {\n                StorageLib.getPointerToErc20CoreStorage().accountAllowances[_owner][_spender] =\n                    _currentAllowance -\n                    _value;\n            }\n        }\n    }\n\n    //==============================================================================\n    // Events\n    //==============================================================================\n\n    /// @notice The ```Transfer``` event is emitted when tokens are transferred from one account to another\n    /// @param from The account that is transferring tokens\n    /// @param to The account that is receiving tokens\n    /// @param value The amount of tokens being transferred\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /// @notice ```Approval``` emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}\n    /// @param owner The account that is allowing the spender to spend\n    /// @param spender The account that is allowed to spend\n    /// @param value The amount of funds that the spender is allowed to spend\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    //==============================================================================\n    // Errors\n    //==============================================================================\n\n    /// @notice ```AccountIsFrozen``` error is emitted when an account is frozen and a transfer is attempted\n    /// @param frozenAccount The account that is frozen\n    error AccountIsFrozen(address frozenAccount);\n}\n"},"node_modules/agora-dollar-dev/src/contracts/Erc20Privileged.sol":{"content":"// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.28;\n\n// ====================================================================\n//             _        ______     ___   _______          _\n//            / \\     .' ___  |  .'   `.|_   __ \\        / \\\n//           / _ \\   / .'   \\_| /  .-.  \\ | |__) |      / _ \\\n//          / ___ \\  | |   ____ | |   | | |  __ /      / ___ \\\n//        _/ /   \\ \\_\\ `.___]  |\\  `-'  /_| |  \\ \\_  _/ /   \\ \\_\n//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|\n// ====================================================================\n// ========================= Erc20Privileged ==========================\n// ====================================================================\n\nimport { SafeCastLib } from \"solady/src/utils/SafeCastLib.sol\";\n\nimport { AgoraDollarMintRateLimit } from \"./AgoraDollarMintRateLimit.sol\";\nimport { Erc20Core } from \"./Erc20Core.sol\";\n\nimport { StorageLib } from \"./proxy/StorageLib.sol\";\n\n/// @notice The ```Erc20Privileged``` contract extends the ```Erc20Core``` contract with privileged actions (mint, burn, freeze)\nabstract contract Erc20Privileged is Erc20Core, AgoraDollarMintRateLimit {\n    using SafeCastLib for uint256;\n    using StorageLib for uint256;\n\n    //==============================================================================\n    // Mint Functions\n    //==============================================================================\n\n    /// @notice Parameters for a single mint operation\n    /// @param receiverAddress The address to mint tokens to\n    /// @param value The amount of tokens to mint\n    struct BatchMintParam {\n        address receiverAddress;\n        uint256 value;\n    }\n\n    /// @notice The ```batchMint``` function mints tokens to multiple accounts in a single transaction\n    /// @dev This function must be called by an address to which the MINTER_ROLE is granted\n    /// @dev Reverts on failure\n    /// @param _mints An array of ```BatchMintParam``` structs\n    function batchMint(BatchMintParam[] memory _mints) external {\n        // Checks: sender must be minter\n        _requireSenderIsRole({ _role: MINTER_ROLE });\n\n        // Checks: minting must not be paused\n        if (StorageLib.sloadImplementationSlotDataAsUint256().isMintPaused()) revert StorageLib.MintPaused();\n\n        // Effects: add to totalSupply and account balances\n        for (uint256 i = 0; i < _mints.length; i++) {\n            _mint({ _account: _mints[i].receiverAddress, _amount: _mints[i].value });\n        }\n    }\n\n    /// @notice The ```mint``` function mints tokens to an account. It is part of IMintableBurnable\n    /// @dev This function must be called by an address with `MINTER_ROLE` or `BRIDGE_MINTER_ROLE`\n    /// @dev Reverts on failure\n    /// @param _to An address to mint to\n    /// @param _amount The amount of tokens to mint\n    /// @dev Note, this allows minting to frozen accounts. This is to allow bridge contracts to mint to frozen accounts if needed.\n    function mint(address _to, uint256 _amount) external returns (bool) {\n        // Checks: sender must be `BRIDGE_MINTER_ROLE` or `MINTER_ROLE`\n        if (\n            !_isRole({ _role: BRIDGE_MINTER_ROLE, _member: msg.sender }) &&\n            !_isRole({ _role: MINTER_ROLE, _member: msg.sender })\n        ) revert AddressIsNotMinterRole();\n\n        // Checks: minting must not be paused\n        if (StorageLib.sloadImplementationSlotDataAsUint256().isMintPaused()) revert StorageLib.MintPaused();\n\n        // Checks: bridging must not be paused\n        if (\n            _isRole({ _role: BRIDGE_MINTER_ROLE, _member: msg.sender }) &&\n            StorageLib.sloadImplementationSlotDataAsUint256().isBridgingPaused()\n        ) revert StorageLib.BridgingPaused();\n\n        _mint({ _account: _to, _amount: _amount });\n\n        return true;\n    }\n\n    /// @dev The maximum amount that can be minted is `type(uint248).max` due to storage optimization\n    function _mint(address _account, uint256 _amount) internal {\n        _outflow({ _minter: msg.sender, _amount: _amount });\n\n        // Checks: account cannot be 0 address\n        if (_account == address(0)) revert ERC20InvalidReceiver({ receiver: address(0) });\n\n        uint248 _value248 = _amount.toUint248();\n\n        // Checks: amount cannot be zero\n        if (_value248 == 0) revert ZeroAmount();\n\n        // Effects: add to totalSupply and account balance\n        StorageLib.getPointerToErc20CoreStorage().totalSupply += _value248;\n        StorageLib.getPointerToErc20CoreStorage().accountData[_account].balance += _value248;\n\n        // Emit event\n        emit Transfer({ from: address(0), to: _account, value: _amount });\n        emit Minted({ sender: msg.sender, receiver: _account, value: _amount });\n    }\n\n    //==============================================================================\n    // Burn Functions\n    //==============================================================================\n\n    /// @notice Parameters for a single burn operation\n    /// @param burnFromAddress The address to burn tokens from\n    /// @param value The amount of tokens to burn\n    struct BatchBurnFromParam {\n        address burnFromAddress;\n        uint256 value;\n    }\n\n    /// @notice The ```batchBurnFrom``` function burns tokens from multiple accounts in a single transaction\n    /// @dev This function must be called by an address to which the BURNER_ROLE is granted\n    /// @dev Reverts on failure\n    /// @param _burns An array of ```BatchBurnFromParam``` structs\n    function batchBurnFrom(BatchBurnFromParam[] memory _burns) external {\n        // Checks: sender must be burner\n        _requireSenderIsRole({ _role: BURNER_ROLE });\n\n        // Checks: burnFrom must not be paused\n        if (StorageLib.sloadImplementationSlotDataAsUint256().isBurnFromPaused()) revert StorageLib.BurnFromPaused();\n\n        for (uint256 i = 0; i < _burns.length; i++) {\n            _burn({ _account: _burns[i].burnFromAddress, _amount: _burns[i].value });\n        }\n    }\n\n    /// @notice The ```burn``` function burns tokens from an account. It is part of IMintableBurnable\n    /// @dev This function must be called by an address with `BURNER_ROLE` or `BRIDGE_BURNER_ROLE`\n    /// @dev Reverts on failure\n    /// @param _from An address to burn from\n    /// @param _amount Amount of tokens to burn\n    function burn(address _from, uint256 _amount) external returns (bool) {\n        // Checks: sender must be `BRIDGE_BURNER_ROLE` or `BURNER_ROLE`\n        if (\n            !_isRole({ _role: BRIDGE_BURNER_ROLE, _member: msg.sender }) &&\n            !_isRole({ _role: BURNER_ROLE, _member: msg.sender })\n        ) revert AddressIsNotBurnerRole();\n\n        // Checks: burnFrom must not be paused\n        if (StorageLib.sloadImplementationSlotDataAsUint256().isBurnFromPaused()) revert StorageLib.BurnFromPaused();\n\n        if (_isRole({ _role: BRIDGE_BURNER_ROLE, _member: msg.sender })) {\n            // Checks: bridging must not be paused\n            if (StorageLib.sloadImplementationSlotDataAsUint256().isBridgingPaused()) {\n                revert StorageLib.BridgingPaused();\n            }\n            // Checks: _from account must not be frozen\n            StorageLib.Erc20AccountData memory _accountDataFrom = StorageLib.getPointerToErc20CoreStorage().accountData[\n                _from\n            ];\n            if (_accountDataFrom.isFrozen) revert AccountIsFrozen({ frozenAccount: _from });\n        }\n\n        _burn({ _account: _from, _amount: _amount });\n\n        return true;\n    }\n\n    function _burn(address _account, uint256 _amount) internal {\n        uint248 _value248 = _amount.toUint248();\n\n        // Checks: amount cannot be zero\n        if (_value248 == 0) revert ZeroAmount();\n\n        // Checks: ensure _account has enough balance\n        StorageLib.Erc20AccountData memory _accountDataFrom = StorageLib.getPointerToErc20CoreStorage().accountData[\n            _account\n        ];\n        if (_accountDataFrom.balance < _value248) {\n            revert ERC20InsufficientBalance({ sender: _account, balance: _accountDataFrom.balance, needed: _value248 });\n        }\n\n        // Effects: subtract from totalSupply and account balance\n        StorageLib.getPointerToErc20CoreStorage().totalSupply -= _value248;\n        StorageLib.getPointerToErc20CoreStorage().accountData[_account].balance -= _value248;\n\n        // emit event (include Burned event to prevent spoofing of Transfer event as we don't check for 0 address in transfer)\n        emit Transfer({ from: _account, to: address(0), value: _amount });\n        emit Burned({ sender: msg.sender, burnFrom: _account, value: _amount });\n    }\n\n    //==============================================================================\n    // Freeze Functions\n    //==============================================================================\n\n    /// @notice The ```batchFreeze``` function freezes a set of accounts so that it cannot transfer tokens\n    /// @param _addresses The addresses of the accounts getting frozen\n    function batchFreeze(address[] memory _addresses) external {\n        // Checks: Only the FREEZER_ROLE can freeze addresses\n        _requireSenderIsRole({ _role: FREEZER_ROLE });\n        if (StorageLib.sloadImplementationSlotDataAsUint256().isFreezingPaused()) revert StorageLib.FreezingPaused();\n\n        for (uint256 _i = 0; _i < _addresses.length; _i++) {\n            // Effects: freeze the addresses\n            StorageLib.getPointerToErc20CoreStorage().accountData[_addresses[_i]].isFrozen = true;\n            emit AccountFrozen({ account: _addresses[_i] });\n        }\n    }\n\n    /// @notice The ```batchUnfreeze``` function unfreezes a set of accounts so that it can transfer tokens again\n    /// @param _addresses The addresses of the accounts getting unfrozen\n    function batchUnfreeze(address[] memory _addresses) external {\n        // Checks: Only the FREEZER_ROLE can unfreeze addresses\n        _requireSenderIsRole({ _role: FREEZER_ROLE });\n        if (StorageLib.sloadImplementationSlotDataAsUint256().isFreezingPaused()) revert StorageLib.FreezingPaused();\n\n        for (uint256 _i = 0; _i < _addresses.length; _i++) {\n            // Effects: unfreeze the addresses\n            StorageLib.getPointerToErc20CoreStorage().accountData[_addresses[_i]].isFrozen = false;\n            emit AccountUnfrozen({ account: _addresses[_i] });\n        }\n    }\n\n    //==============================================================================\n    // Errors\n    //==============================================================================\n\n    /// @notice Error when an amount is unexpectedly zero.\n    error ZeroAmount();\n\n    /// @notice Emitted when the caller of `burn()` does not have the necessary role.\n    error AddressIsNotBurnerRole();\n\n    /// @notice Emitted when the caller of `mint()` does not have the necessary role.\n    error AddressIsNotMinterRole();\n\n    //==============================================================================\n    // Events\n    //==============================================================================\n\n    /// @notice The ```AccountUnfrozen``` event is emitted when an account is unfrozen\n    /// @param account The account that was unfrozen\n    event AccountUnfrozen(address indexed account);\n\n    /// @notice The ```AccountFrozen``` event is emitted when an account is frozen\n    /// @param account The account that was frozen\n    event AccountFrozen(address indexed account);\n\n    /// @notice The ```Minted``` event is emitted when tokens are minted\n    /// @param sender The account that initiated the mint\n    /// @param receiver The account that received the minted tokens\n    /// @param value The amount of tokens minted\n    event Minted(address indexed sender, address indexed receiver, uint256 value);\n\n    /// @notice The ```Burned``` event is emitted when tokens are burned\n    /// @param sender The account that initiated the burn\n    /// @param burnFrom The account that burned the tokens\n    /// @param value The amount of tokens burned\n    event Burned(address indexed sender, address indexed burnFrom, uint256 value);\n}\n"},"node_modules/agora-dollar-dev/src/contracts/Erc2612.sol":{"content":"// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.28;\n\n// ====================================================================\n//             _        ______     ___   _______          _\n//            / \\     .' ___  |  .'   `.|_   __ \\        / \\\n//           / _ \\   / .'   \\_| /  .-.  \\ | |__) |      / _ \\\n//          / ___ \\  | |   ____ | |   | | |  __ /      / ___ \\\n//        _/ /   \\ \\_\\ `.___]  |\\  `-'  /_| |  \\ \\_  _/ /   \\ \\_\n//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|\n// ====================================================================\n// ============================= Erc2612 ==============================\n// ====================================================================\n\nimport { SignatureCheckerLib } from \"solady/src/utils/SignatureCheckerLib.sol\";\n\nimport { Eip712 } from \"./Eip712.sol\";\nimport { Erc20Core } from \"./Erc20Core.sol\";\n\nimport { StorageLib } from \"./proxy/StorageLib.sol\";\n\nabstract contract Erc2612 is Eip712, Erc20Core {\n    using StorageLib for uint256;\n\n    /// @notice The ```PERMIT_TYPEHASH``` stores keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\")\n    bytes32 public constant PERMIT_TYPEHASH =\n        keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n\n    //==============================================================================\n    // External Procedural Functions\n    //==============================================================================\n\n    /// @notice The ```permit``` function sets an allowance with a signature\n    /// @param _owner The account that signed the message\n    /// @param _spender The account that is allowed to spend the funds\n    /// @param _value The amount of funds that can be spent\n    /// @param _deadline The time by which the transaction must be completed\n    /// @param _v The v of the ECDSA signature\n    /// @param _r The r of the ECDSA signature\n    /// @param _s The s of the ECDSA signature\n    function permit(\n        address _owner,\n        address _spender,\n        uint256 _value,\n        uint256 _deadline,\n        uint8 _v,\n        bytes32 _r,\n        bytes32 _s\n    ) external {\n        permit({\n            _owner: _owner,\n            _spender: _spender,\n            _value: _value,\n            _deadline: _deadline,\n            _signature: abi.encodePacked(_r, _s, _v)\n        });\n    }\n    /// @notice The ```permit``` function sets an allowance with a signature\n    /// @param _owner The account that signed the message\n    /// @param _spender The account that is allowed to spend the funds\n    /// @param _value The amount of funds that can be spent\n    /// @param _deadline The time by which the transaction must be completed\n    /// @param _signature The signature of the message\n\n    function permit(\n        address _owner,\n        address _spender,\n        uint256 _value,\n        uint256 _deadline,\n        bytes memory _signature\n    ) public {\n        // Checks: contract-wide access control\n        bool _isSignatureVerificationPaused = StorageLib\n            .sloadImplementationSlotDataAsUint256()\n            .isSignatureVerificationPaused();\n        if (_isSignatureVerificationPaused) revert StorageLib.SignatureVerificationPaused();\n\n        // Checks: deadline\n        if (block.timestamp > _deadline) revert Erc2612ExpiredSignature({ deadline: _deadline });\n\n        // Effects: increment nonce\n        uint256 _nextNonce;\n        unchecked {\n            _nextNonce = StorageLib.getPointerToErc2612Storage().nonces[_owner]++;\n        }\n        bytes32 _structHash = keccak256(abi.encode(PERMIT_TYPEHASH, _owner, _spender, _value, _nextNonce, _deadline));\n\n        bytes32 _hash = _hashTypedDataV4({ structHash: _structHash });\n\n        // Checks: is valid eoa or eip1271 signature\n        bool _isValidSignature = SignatureCheckerLib.isValidSignatureNow({\n            signer: _owner,\n            hash: _hash,\n            signature: _signature\n        });\n        if (!_isValidSignature) revert Erc2612InvalidSignature();\n\n        // Effects: update bookkeeping\n        _approve({ _owner: _owner, _spender: _spender, _value: _value });\n    }\n\n    /// @notice The ```DOMAIN_SEPARATOR``` function returns the configured domain separator\n    /// @return _domainSeparator The domain separator\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32 _domainSeparator) {\n        _domainSeparator = _domainSeparatorV4();\n    }\n\n    //==============================================================================\n    // Errors\n    //==============================================================================\n\n    /// @notice The ```Erc2612ExpiredSignature``` error is emitted when the signature is expired\n    /// @param deadline the time by which the transaction must be completed\n    error Erc2612ExpiredSignature(uint256 deadline);\n\n    /// @notice The ```Erc2612InvalidSignature``` error is emitted when the signature is invalid\n    error Erc2612InvalidSignature();\n}\n"},"node_modules/agora-dollar-dev/src/contracts/proxy/StorageLib.sol":{"content":"// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.28;\n\n// ====================================================================\n//             _        ______     ___   _______          _\n//            / \\     .' ___  |  .'   `.|_   __ \\        / \\\n//           / _ \\   / .'   \\_| /  .-.  \\ | |__) |      / _ \\\n//          / ___ \\  | |   ____ | |   | | |  __ /      / ___ \\\n//        _/ /   \\ \\_\\ `.___]  |\\  `-'  /_| |  \\ \\_  _/ /   \\ \\_\n//       |____| |____|`._____.'  `.___.'|____| |___||____| |____|\n// ====================================================================\n// ============================ StorageLib ============================\n// ====================================================================\n\n/**\n * This library contains information for accessing unstructured storage following erc1967\n * and erc7201 standards.\n *\n * The erc1967 storage slots are defined using their own formula/namespace.\n * These are listed last in the contract.\n *\n * The erc7201 namespace is defined as <ContractName>.<Namespace>\n * The deriveErc7201StorageSlot() function is used to derive the storage slot for a given namespace\n * and to check that value against the hard-coded bytes32 value for the slot location in testing frameworks\n * Each inherited contract has its own struct of the form <ContractName>Storage which matches <Namespace>\n * from above. Each struct is held in a unique namespace and has a unique storage slot.\n * See: https://eips.ethereum.org/EIPS/eip-7201 for additional information regarding this standard\n */\n/// @title StorageLib\n/// @dev Implements pure functions for calculating and accessing storage slots according to eip1967 and eip7201\n/// @author Agora\nlibrary StorageLib {\n    /// @notice Global namespace for use in deriving storage slot locations\n    string internal constant GLOBAL_ERC7201_NAMESPACE = \"AgoraDollarErc1967Proxy\";\n\n    // Use this function to check hardcoded bytes32 values against the expected formula\n    function deriveErc7201StorageSlot(string memory _localNamespace) internal pure returns (bytes32) {\n        bytes memory _namespace = abi.encodePacked(GLOBAL_ERC7201_NAMESPACE, \".\", _localNamespace);\n        return keccak256(abi.encode(uint256(keccak256(_namespace)) - 1)) & ~bytes32(uint256(0xff));\n    }\n\n    //==============================================================================\n    // Eip3009 Storage Items\n    //==============================================================================\n\n    /// @notice The EIP3009 namespace\n    string internal constant EIP3009_NAMESPACE = \"Eip3009Storage\";\n\n    /// @notice The Eip3009Storage struct\n    /// @param isAuthorizationUsed A mapping of authorizer to nonce to boolean to indicate if the nonce has been used\n    /// @custom:storage-location erc7201:AgoraDollarErc1967Proxy.Eip3009Storage\n    struct Eip3009Storage {\n        mapping(address _authorizer => mapping(bytes32 _nonce => bool _isNonceUsed)) isAuthorizationUsed;\n    }\n\n    /// @notice The ```EIP3009_STORAGE_SLOT_``` is the storage slot for the Eip3009Storage struct\n    /// @dev keccak256(abi.encode(uint256(keccak256(\"AgoraDollarErc1967Proxy.Eip3009Storage\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 internal constant EIP3009_STORAGE_SLOT_ =\n        0xbb0a37da742be2e3b68bdb11d195150f4243c03fb37d3cdfa756046082a38600;\n\n    /// @notice The ```getPointerToEip3009Storage``` function returns a pointer to the Eip3009Storage struct\n    /// @return $ A pointer to the Eip3009Storage struct\n    function getPointerToEip3009Storage() internal pure returns (Eip3009Storage storage $) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            $.slot := EIP3009_STORAGE_SLOT_\n        }\n    }\n\n    //==============================================================================\n    // Erc2612 Storage Items\n    //==============================================================================\n\n    /// @notice The Erc2612 namespace\n    string internal constant ERC2612_NAMESPACE = \"Erc2612Storage\";\n\n    /// @notice The Erc2612Storage struct\n    /// @param nonces A mapping of signer address to uint256 to store the nonce\n    /// @custom:storage-location erc7201:AgoraDollarErc1967Proxy.Erc2612Storage\n    struct Erc2612Storage {\n        mapping(address _signer => uint256 _nonce) nonces;\n    }\n\n    /// @notice The ```ERC2612_STORAGE_SLOT_``` is the storage slot for the Erc2612Storage struct\n    /// @dev keccak256(abi.encode(uint256(keccak256(\"AgoraDollarErc1967Proxy.Erc2612Storage\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 internal constant ERC2612_STORAGE_SLOT_ =\n        0x69e87f5b9323740fce20cdf574dacd1d10e756da64a1f2df70fd1ace4c7cc300;\n\n    /// @notice The ```getPointerToErc2612Storage``` function returns a pointer to the Erc2612Storage struct\n    /// @return $ A pointer to the Erc2612Storage struct\n    function getPointerToErc2612Storage() internal pure returns (Erc2612Storage storage $) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            $.slot := ERC2612_STORAGE_SLOT_\n        }\n    }\n\n    //==============================================================================\n    // Erc20Core Storage Items\n    //==============================================================================\n\n    /// @notice The Erc20Core namespace\n    string internal constant ERC20_CORE_NAMESPACE = \"Erc20CoreStorage\";\n\n    /// @notice The Erc20AccountData struct\n    /// @param isFrozen A boolean to indicate if the account is frozen\n    /// @param balance A uint248 to store the balance of the account\n    struct Erc20AccountData {\n        bool isFrozen;\n        uint248 balance;\n    }\n\n    /// @notice The Erc20CoreStorage struct\n    /// @param accountData A mapping of address to Erc20AccountData to store account data\n    /// @param accountAllowances A mapping of owner to spender to uint256 to store the allowance\n    /// @param totalSupply A uint256 to store the total supply of tokens\n    /// @custom:storage-location erc7201:AgoraDollarErc1967Proxy.Erc20CoreStorage\n    struct Erc20CoreStorage {\n        /// @dev _account The account whose data we are accessing\n        /// @dev _accountData The account data for the account\n        mapping(address _account => Erc20AccountData _accountData) accountData;\n        /// @dev _owner The owner of the tokens\n        /// @dev _spender The spender of the tokens\n        /// @dev _accountAllowance The allowance of the spender\n        mapping(address _owner => mapping(address _spender => uint256 _accountAllowance)) accountAllowances;\n        /// @dev The total supply of tokens\n        uint256 totalSupply;\n    }\n\n    /// @notice The ```ERC20_CORE_STORAGE_SLOT_``` is the storage slot for the Erc20CoreStorage struct\n    /// @dev keccak256(abi.encode(uint256(keccak256(\"AgoraDollarErc1967Proxy.Erc20CoreStorage\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 internal constant ERC20_CORE_STORAGE_SLOT_ =\n        0x455730fed596673e69db1907be2e521374ba893f1a04cc5f5dd931616cd6b700;\n\n    /// @notice The ```getPointerToErc20CoreStorage``` function returns a pointer to the Erc20CoreStorage struct\n    /// @return $ A pointer to the Erc20CoreStorage struct\n    function getPointerToErc20CoreStorage() internal pure returns (Erc20CoreStorage storage $) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            $.slot := ERC20_CORE_STORAGE_SLOT_\n        }\n    }\n\n    //==============================================================================\n    // AgoraDollarErc1967 Admin Slot Items\n    //==============================================================================\n\n    /// @notice The AgoraDollarErc1967ProxyAdminStorage struct\n    /// @param proxyAdminAddress The address of the proxy admin contract\n    /// @custom:storage-location erc1967:eip1967.proxy.admin\n    struct AgoraDollarErc1967ProxyAdminStorage {\n        address proxyAdminAddress;\n    }\n\n    /// @notice The ```AGORA_DOLLAR_ERC1967_PROXY_ADMIN_STORAGE_SLOT_``` is the storage slot for the AgoraDollarErc1967ProxyAdminStorage struct\n    /// @dev NOTE: deviates from erc7201 standard because erc1967 defines its own storage slot algorithm\n    /// @dev bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1)\n    bytes32 internal constant AGORA_DOLLAR_ERC1967_PROXY_ADMIN_STORAGE_SLOT_ =\n        0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /// @notice The ```getPointerToAgoraDollarErc1967ProxyAdminStorage``` function returns a pointer to the AgoraDollarErc1967ProxyAdminStorage struct\n    /// @return adminSlot A pointer to the AgoraDollarErc1967ProxyAdminStorage struct\n    function getPointerToAgoraDollarErc1967ProxyAdminStorage()\n        internal\n        pure\n        returns (AgoraDollarErc1967ProxyAdminStorage storage adminSlot)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            adminSlot.slot := AGORA_DOLLAR_ERC1967_PROXY_ADMIN_STORAGE_SLOT_\n        }\n    }\n\n    //==============================================================================\n    // AgoraDollarErc1967Proxy Implementation Slot Items\n    //==============================================================================\n\n    /// @notice The AgoraDollarErc1967ProxyContractStorage struct\n    /// @param implementationAddress The address of the implementation contract\n    /// @param placeholder A placeholder for bits to be used as bitmask items\n    /// @custom:storage-location erc1967:eip1967.proxy.implementation\n    struct AgoraDollarErc1967ProxyContractStorage {\n        address implementationAddress; // least significant bits first\n        uint96 placeholder; // Placeholder for bitmask items defined below\n    }\n\n    /// @notice The ```AGORA_DOLLAR_ERC1967_PROXY_CONTRACT_STORAGE_SLOT_``` is the storage slot for the AgoraDollarErc1967ProxyContractStorage struct\n    /// @dev bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1)\n    bytes32 internal constant AGORA_DOLLAR_ERC1967_PROXY_CONTRACT_STORAGE_SLOT_ =\n        0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /// @notice The ```getPointerToAgoraDollarErc1967ProxyContractStorage``` function returns a pointer to the storage slot for the implementation address\n    /// @return contractData A pointer to the data in the storage slot for the implementation address and other contract data\n    function getPointerToAgoraDollarErc1967ProxyContractStorage()\n        internal\n        pure\n        returns (AgoraDollarErc1967ProxyContractStorage storage contractData)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            contractData.slot := AGORA_DOLLAR_ERC1967_PROXY_CONTRACT_STORAGE_SLOT_\n        }\n    }\n\n    /// @notice The ```sloadImplementationSlotDataAsUint256``` function returns the data at the implementation slot as a uint256\n    /// @dev Named this way to draw attention to the sload call\n    /// @return _contractData The data at the implementation slot as a uint256\n    function sloadImplementationSlotDataAsUint256() internal view returns (uint256 _contractData) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            _contractData := sload(AGORA_DOLLAR_ERC1967_PROXY_CONTRACT_STORAGE_SLOT_)\n        }\n    }\n\n    /// @notice The ```sstoreImplementationSlotDataAsUint256``` function stores the data at the implementation slot\n    /// @dev Named this way to draw attention to the sstore call\n    /// @param _contractData The data to store at the implementation slot, given as a uint256\n    function sstoreImplementationSlotDataAsUint256(uint256 _contractData) internal {\n        /// @solidity memory-safe-assembly\n        assembly {\n            sstore(AGORA_DOLLAR_ERC1967_PROXY_CONTRACT_STORAGE_SLOT_, _contractData)\n        }\n    }\n\n    // Contract Access Control masks\n    uint256 internal constant IS_MSG_SENDER_FROZEN_CHECK_ENABLED_BIT_POSITION_ = 1 << (255 - 95);\n    uint256 internal constant IS_MINT_PAUSED_BIT_POSITION_ = 1 << (255 - 94);\n    uint256 internal constant IS_BURN_FROM_PAUSED_BIT_POSITION_ = 1 << (255 - 93);\n    uint256 internal constant IS_FREEZING_PAUSED_BIT_POSITION_ = 1 << (255 - 92);\n    uint256 internal constant IS_TRANSFER_PAUSED_BIT_POSITION_ = 1 << (255 - 91);\n    uint256 internal constant IS_SIGNATURE_VERIFICATION_PAUSED_BIT_POSITION_ = 1 << (255 - 90);\n\n    // internal function upgrade masks\n    // Erc20\n    uint256 internal constant IS_TRANSFER_UPGRADED_BIT_POSITION_ = 1 << (255 - 89);\n    uint256 internal constant IS_TRANSFER_FROM_UPGRADED_BIT_POSITION_ = 1 << (255 - 88);\n\n    // Eip 3009\n    uint256 internal constant IS_TRANSFER_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION_ = 1 << (255 - 87);\n    uint256 internal constant IS_RECEIVE_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION_ = 1 << (255 - 86);\n\n    // Bridging\n    uint256 internal constant IS_BRIDGING_PAUSED_BIT_POSITION_ = 1 << (255 - 85);\n\n    //==============================================================================\n    // Bitmask Functions\n    //==============================================================================\n\n    // These function use a bitmask to check if a specific bit is set in the contract data\n    function isMsgSenderFrozenCheckEnabled(uint256 _contractData) internal pure returns (bool) {\n        return _contractData & IS_MSG_SENDER_FROZEN_CHECK_ENABLED_BIT_POSITION_ != 0;\n    }\n\n    function isMintPaused(uint256 _contractData) internal pure returns (bool) {\n        return _contractData & IS_MINT_PAUSED_BIT_POSITION_ != 0;\n    }\n\n    function isBurnFromPaused(uint256 _contractData) internal pure returns (bool) {\n        return _contractData & IS_BURN_FROM_PAUSED_BIT_POSITION_ != 0;\n    }\n\n    function isFreezingPaused(uint256 _contractData) internal pure returns (bool) {\n        return _contractData & IS_FREEZING_PAUSED_BIT_POSITION_ != 0;\n    }\n\n    function isTransferPaused(uint256 _contractData) internal pure returns (bool) {\n        return _contractData & IS_TRANSFER_PAUSED_BIT_POSITION_ != 0;\n    }\n\n    function isSignatureVerificationPaused(uint256 _contractData) internal pure returns (bool) {\n        return _contractData & IS_SIGNATURE_VERIFICATION_PAUSED_BIT_POSITION_ != 0;\n    }\n\n    function isTransferUpgraded(uint256 _contractData) internal pure returns (bool) {\n        return _contractData & IS_TRANSFER_UPGRADED_BIT_POSITION_ != 0;\n    }\n\n    function isTransferFromUpgraded(uint256 _contractData) internal pure returns (bool) {\n        return _contractData & IS_TRANSFER_FROM_UPGRADED_BIT_POSITION_ != 0;\n    }\n\n    function isTransferWithAuthorizationUpgraded(uint256 _contractData) internal pure returns (bool) {\n        return _contractData & IS_TRANSFER_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION_ != 0;\n    }\n\n    function isReceiveWithAuthorizationUpgraded(uint256 _contractData) internal pure returns (bool) {\n        return _contractData & IS_RECEIVE_WITH_AUTHORIZATION_UPGRADED_BIT_POSITION_ != 0;\n    }\n\n    function isBridgingPaused(uint256 _contractData) internal pure returns (bool) {\n        return _contractData & IS_BRIDGING_PAUSED_BIT_POSITION_ != 0;\n    }\n\n    function implementation(uint256 _contractData) internal pure returns (address) {\n        // return least significant 160 bits and cast to an address\n        return address(uint160(_contractData));\n    }\n\n    function setBitWithMask(\n        uint256 _original,\n        uint256 _bitToSet,\n        bool _setBitToOne\n    ) internal pure returns (uint256 _new) {\n        // Sets the specified bit to 1 or 0\n        _new = _setBitToOne ? _original | _bitToSet : _original & ~_bitToSet;\n    }\n\n    //==============================================================================\n    // RateLimit Slot Items\n    //==============================================================================\n\n    /// @notice Rate Limit struct.\n    /// @param amountInFlight The amount in the current window.\n    /// @param lastUpdated Timestamp representing the last time the rate limit was checked or updated.\n    /// @param limit This represents the maximum allowed amount within a given window.\n    /// @param window Defines the duration of the rate limiting window.\n    struct RateLimit {\n        uint256 amountInFlight;\n        uint256 lastUpdated;\n        uint256 limit;\n        uint256 window;\n    }\n\n    /// @notice The MintRateLimitStorage struct\n    /// @param MintRateLimitStorage Mapping from minter address to RateLimit configurations.\n    /// @custom:storage-location erc7201:AgoraDollarErc1967Proxy.MintRateLimitStorage\n    struct MintRateLimitStorage {\n        mapping(address minter => RateLimit limit) rateLimits;\n    }\n\n    /// @notice The ```MINT_RATE_LIMIT_STORAGE_SLOT``` is the storage slot for the MintRateLimitStorage struct\n    /// @dev keccak256(abi.encode(uint256(keccak256(\"AgoraDollarErc1967Proxy.MintRateLimitStorage\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 internal constant MINT_RATE_LIMIT_STORAGE_SLOT =\n        0xdbb7496039d83aff244e00691e8f456fd1760542eb35f98e0e87f449c82c5500;\n\n    /// @notice The ```getPointerToMintRateLimitStorage``` function returns a pointer to the MintRateLimitStorage struct\n    /// @return $ A pointer to the MintRateLimitStorage struct\n    function getPointerToMintRateLimitStorage() internal pure returns (MintRateLimitStorage storage $) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            $.slot := MINT_RATE_LIMIT_STORAGE_SLOT\n        }\n    }\n\n    //==============================================================================\n    // Errors\n    //==============================================================================\n\n    /// @notice The ```TransferPaused``` error is emitted when transfers are paused during an attempted transfer\n    error TransferPaused();\n\n    /// @notice The ```SignatureVerificationPaused``` error is emitted when signature verification is paused during an attempted transfer\n    error SignatureVerificationPaused();\n\n    /// @notice The ```MintPaused``` error is emitted when minting is paused during an attempted mint\n    error MintPaused();\n\n    /// @notice The ```BurnFromPaused``` error is emitted when burning is paused during an attempted burn\n    error BurnFromPaused();\n\n    /// @notice The ```FreezingPaused``` error is emitted when freezing is paused during an attempted call to freeze() or unfreeze()\n    error FreezingPaused();\n\n    /// @notice The ```BridgingPaused``` error is emitted when bridging is paused during an attempted bridge mint or burn\n    error BridgingPaused();\n}\n"},"node_modules/solady/src/utils/SafeCastLib.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Safe integer casting library that reverts on overflow.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeCastLib.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeCast.sol)\nlibrary SafeCastLib {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                       CUSTOM ERRORS                        */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    error Overflow();\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*          UNSIGNED INTEGER SAFE CASTING OPERATIONS          */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    function toUint8(uint256 x) internal pure returns (uint8) {\n        if (x >= 1 << 8) _revertOverflow();\n        return uint8(x);\n    }\n\n    function toUint16(uint256 x) internal pure returns (uint16) {\n        if (x >= 1 << 16) _revertOverflow();\n        return uint16(x);\n    }\n\n    function toUint24(uint256 x) internal pure returns (uint24) {\n        if (x >= 1 << 24) _revertOverflow();\n        return uint24(x);\n    }\n\n    function toUint32(uint256 x) internal pure returns (uint32) {\n        if (x >= 1 << 32) _revertOverflow();\n        return uint32(x);\n    }\n\n    function toUint40(uint256 x) internal pure returns (uint40) {\n        if (x >= 1 << 40) _revertOverflow();\n        return uint40(x);\n    }\n\n    function toUint48(uint256 x) internal pure returns (uint48) {\n        if (x >= 1 << 48) _revertOverflow();\n        return uint48(x);\n    }\n\n    function toUint56(uint256 x) internal pure returns (uint56) {\n        if (x >= 1 << 56) _revertOverflow();\n        return uint56(x);\n    }\n\n    function toUint64(uint256 x) internal pure returns (uint64) {\n        if (x >= 1 << 64) _revertOverflow();\n        return uint64(x);\n    }\n\n    function toUint72(uint256 x) internal pure returns (uint72) {\n        if (x >= 1 << 72) _revertOverflow();\n        return uint72(x);\n    }\n\n    function toUint80(uint256 x) internal pure returns (uint80) {\n        if (x >= 1 << 80) _revertOverflow();\n        return uint80(x);\n    }\n\n    function toUint88(uint256 x) internal pure returns (uint88) {\n        if (x >= 1 << 88) _revertOverflow();\n        return uint88(x);\n    }\n\n    function toUint96(uint256 x) internal pure returns (uint96) {\n        if (x >= 1 << 96) _revertOverflow();\n        return uint96(x);\n    }\n\n    function toUint104(uint256 x) internal pure returns (uint104) {\n        if (x >= 1 << 104) _revertOverflow();\n        return uint104(x);\n    }\n\n    function toUint112(uint256 x) internal pure returns (uint112) {\n        if (x >= 1 << 112) _revertOverflow();\n        return uint112(x);\n    }\n\n    function toUint120(uint256 x) internal pure returns (uint120) {\n        if (x >= 1 << 120) _revertOverflow();\n        return uint120(x);\n    }\n\n    function toUint128(uint256 x) internal pure returns (uint128) {\n        if (x >= 1 << 128) _revertOverflow();\n        return uint128(x);\n    }\n\n    function toUint136(uint256 x) internal pure returns (uint136) {\n        if (x >= 1 << 136) _revertOverflow();\n        return uint136(x);\n    }\n\n    function toUint144(uint256 x) internal pure returns (uint144) {\n        if (x >= 1 << 144) _revertOverflow();\n        return uint144(x);\n    }\n\n    function toUint152(uint256 x) internal pure returns (uint152) {\n        if (x >= 1 << 152) _revertOverflow();\n        return uint152(x);\n    }\n\n    function toUint160(uint256 x) internal pure returns (uint160) {\n        if (x >= 1 << 160) _revertOverflow();\n        return uint160(x);\n    }\n\n    function toUint168(uint256 x) internal pure returns (uint168) {\n        if (x >= 1 << 168) _revertOverflow();\n        return uint168(x);\n    }\n\n    function toUint176(uint256 x) internal pure returns (uint176) {\n        if (x >= 1 << 176) _revertOverflow();\n        return uint176(x);\n    }\n\n    function toUint184(uint256 x) internal pure returns (uint184) {\n        if (x >= 1 << 184) _revertOverflow();\n        return uint184(x);\n    }\n\n    function toUint192(uint256 x) internal pure returns (uint192) {\n        if (x >= 1 << 192) _revertOverflow();\n        return uint192(x);\n    }\n\n    function toUint200(uint256 x) internal pure returns (uint200) {\n        if (x >= 1 << 200) _revertOverflow();\n        return uint200(x);\n    }\n\n    function toUint208(uint256 x) internal pure returns (uint208) {\n        if (x >= 1 << 208) _revertOverflow();\n        return uint208(x);\n    }\n\n    function toUint216(uint256 x) internal pure returns (uint216) {\n        if (x >= 1 << 216) _revertOverflow();\n        return uint216(x);\n    }\n\n    function toUint224(uint256 x) internal pure returns (uint224) {\n        if (x >= 1 << 224) _revertOverflow();\n        return uint224(x);\n    }\n\n    function toUint232(uint256 x) internal pure returns (uint232) {\n        if (x >= 1 << 232) _revertOverflow();\n        return uint232(x);\n    }\n\n    function toUint240(uint256 x) internal pure returns (uint240) {\n        if (x >= 1 << 240) _revertOverflow();\n        return uint240(x);\n    }\n\n    function toUint248(uint256 x) internal pure returns (uint248) {\n        if (x >= 1 << 248) _revertOverflow();\n        return uint248(x);\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*           SIGNED INTEGER SAFE CASTING OPERATIONS           */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    function toInt8(int256 x) internal pure returns (int8) {\n        int8 y = int8(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt16(int256 x) internal pure returns (int16) {\n        int16 y = int16(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt24(int256 x) internal pure returns (int24) {\n        int24 y = int24(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt32(int256 x) internal pure returns (int32) {\n        int32 y = int32(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt40(int256 x) internal pure returns (int40) {\n        int40 y = int40(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt48(int256 x) internal pure returns (int48) {\n        int48 y = int48(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt56(int256 x) internal pure returns (int56) {\n        int56 y = int56(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt64(int256 x) internal pure returns (int64) {\n        int64 y = int64(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt72(int256 x) internal pure returns (int72) {\n        int72 y = int72(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt80(int256 x) internal pure returns (int80) {\n        int80 y = int80(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt88(int256 x) internal pure returns (int88) {\n        int88 y = int88(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt96(int256 x) internal pure returns (int96) {\n        int96 y = int96(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt104(int256 x) internal pure returns (int104) {\n        int104 y = int104(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt112(int256 x) internal pure returns (int112) {\n        int112 y = int112(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt120(int256 x) internal pure returns (int120) {\n        int120 y = int120(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt128(int256 x) internal pure returns (int128) {\n        int128 y = int128(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt136(int256 x) internal pure returns (int136) {\n        int136 y = int136(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt144(int256 x) internal pure returns (int144) {\n        int144 y = int144(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt152(int256 x) internal pure returns (int152) {\n        int152 y = int152(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt160(int256 x) internal pure returns (int160) {\n        int160 y = int160(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt168(int256 x) internal pure returns (int168) {\n        int168 y = int168(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt176(int256 x) internal pure returns (int176) {\n        int176 y = int176(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt184(int256 x) internal pure returns (int184) {\n        int184 y = int184(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt192(int256 x) internal pure returns (int192) {\n        int192 y = int192(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt200(int256 x) internal pure returns (int200) {\n        int200 y = int200(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt208(int256 x) internal pure returns (int208) {\n        int208 y = int208(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt216(int256 x) internal pure returns (int216) {\n        int216 y = int216(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt224(int256 x) internal pure returns (int224) {\n        int224 y = int224(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt232(int256 x) internal pure returns (int232) {\n        int232 y = int232(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt240(int256 x) internal pure returns (int240) {\n        int240 y = int240(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    function toInt248(int256 x) internal pure returns (int248) {\n        int248 y = int248(x);\n        if (x != y) _revertOverflow();\n        return y;\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*               OTHER SAFE CASTING OPERATIONS                */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    function toInt256(uint256 x) internal pure returns (int256) {\n        if (x >= 1 << 255) _revertOverflow();\n        return int256(x);\n    }\n\n    function toUint256(int256 x) internal pure returns (uint256) {\n        if (x < 0) _revertOverflow();\n        return uint256(x);\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                      PRIVATE HELPERS                       */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    function _revertOverflow() private pure {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Store the function selector of `Overflow()`.\n            mstore(0x00, 0x35278d12)\n            // Revert with (offset, size).\n            revert(0x1c, 0x04)\n        }\n    }\n}\n"},"node_modules/solady/src/utils/SignatureCheckerLib.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Signature verification helper that supports both ECDSA signatures from EOAs\n/// and ERC1271 signatures from smart contract wallets like Argent and Gnosis safe.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SignatureCheckerLib.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/SignatureChecker.sol)\n///\n/// @dev Note:\n/// - The signature checking functions use the ecrecover precompile (0x1).\n/// - The `bytes memory signature` variants use the identity precompile (0x4)\n///   to copy memory internally.\n/// - Unlike ECDSA signatures, contract signatures are revocable.\n/// - As of Solady version 0.0.134, all `bytes signature` variants accept both\n///   regular 65-byte `(r, s, v)` and EIP-2098 `(r, vs)` short form signatures.\n///   See: https://eips.ethereum.org/EIPS/eip-2098\n///   This is for calldata efficiency on smart accounts prevalent on L2s.\n///\n/// WARNING! Do NOT use signatures as unique identifiers:\n/// - Use a nonce in the digest to prevent replay attacks on the same contract.\n/// - Use EIP-712 for the digest to prevent replay attacks across different chains and contracts.\n///   EIP-712 also enables readable signing of typed data for better user safety.\n/// This implementation does NOT check if a signature is non-malleable.\nlibrary SignatureCheckerLib {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*               SIGNATURE CHECKING OPERATIONS                */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns whether `signature` is valid for `signer` and `hash`.\n    /// If `signer` is a smart contract, the signature is validated with ERC1271.\n    /// Otherwise, the signature is validated with `ECDSA.recover`.\n    function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature)\n        internal\n        view\n        returns (bool isValid)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Clean the upper 96 bits of `signer` in case they are dirty.\n            for { signer := shr(96, shl(96, signer)) } signer {} {\n                let m := mload(0x40)\n                mstore(0x00, hash)\n                mstore(0x40, mload(add(signature, 0x20))) // `r`.\n                if eq(mload(signature), 64) {\n                    let vs := mload(add(signature, 0x40))\n                    mstore(0x20, add(shr(255, vs), 27)) // `v`.\n                    mstore(0x60, shr(1, shl(1, vs))) // `s`.\n                    let t :=\n                        staticcall(\n                            gas(), // Amount of gas left for the transaction.\n                            1, // Address of `ecrecover`.\n                            0x00, // Start of input.\n                            0x80, // Size of input.\n                            0x01, // Start of output.\n                            0x20 // Size of output.\n                        )\n                    // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n                    if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {\n                        isValid := 1\n                        mstore(0x60, 0) // Restore the zero slot.\n                        mstore(0x40, m) // Restore the free memory pointer.\n                        break\n                    }\n                }\n                if eq(mload(signature), 65) {\n                    mstore(0x20, byte(0, mload(add(signature, 0x60)))) // `v`.\n                    mstore(0x60, mload(add(signature, 0x40))) // `s`.\n                    let t :=\n                        staticcall(\n                            gas(), // Amount of gas left for the transaction.\n                            1, // Address of `ecrecover`.\n                            0x00, // Start of input.\n                            0x80, // Size of input.\n                            0x01, // Start of output.\n                            0x20 // Size of output.\n                        )\n                    // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n                    if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {\n                        isValid := 1\n                        mstore(0x60, 0) // Restore the zero slot.\n                        mstore(0x40, m) // Restore the free memory pointer.\n                        break\n                    }\n                }\n                mstore(0x60, 0) // Restore the zero slot.\n                mstore(0x40, m) // Restore the free memory pointer.\n\n                let f := shl(224, 0x1626ba7e)\n                mstore(m, f) // `bytes4(keccak256(\"isValidSignature(bytes32,bytes)\"))`.\n                mstore(add(m, 0x04), hash)\n                let d := add(m, 0x24)\n                mstore(d, 0x40) // The offset of the `signature` in the calldata.\n                // Copy the `signature` over.\n                let n := add(0x20, mload(signature))\n                pop(staticcall(gas(), 4, signature, n, add(m, 0x44), n))\n                // forgefmt: disable-next-item\n                isValid := and(\n                    // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).\n                    eq(mload(d), f),\n                    // Whether the staticcall does not revert.\n                    // This must be placed at the end of the `and` clause,\n                    // as the arguments are evaluated from right to left.\n                    staticcall(\n                        gas(), // Remaining gas.\n                        signer, // The `signer` address.\n                        m, // Offset of calldata in memory.\n                        add(returndatasize(), 0x44), // Length of calldata in memory.\n                        d, // Offset of returndata.\n                        0x20 // Length of returndata to write.\n                    )\n                )\n                break\n            }\n        }\n    }\n\n    /// @dev Returns whether `signature` is valid for `signer` and `hash`.\n    /// If `signer` is a smart contract, the signature is validated with ERC1271.\n    /// Otherwise, the signature is validated with `ECDSA.recover`.\n    function isValidSignatureNowCalldata(address signer, bytes32 hash, bytes calldata signature)\n        internal\n        view\n        returns (bool isValid)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Clean the upper 96 bits of `signer` in case they are dirty.\n            for { signer := shr(96, shl(96, signer)) } signer {} {\n                let m := mload(0x40)\n                mstore(0x00, hash)\n                if eq(signature.length, 64) {\n                    let vs := calldataload(add(signature.offset, 0x20))\n                    mstore(0x20, add(shr(255, vs), 27)) // `v`.\n                    mstore(0x40, calldataload(signature.offset)) // `r`.\n                    mstore(0x60, shr(1, shl(1, vs))) // `s`.\n                    let t :=\n                        staticcall(\n                            gas(), // Amount of gas left for the transaction.\n                            1, // Address of `ecrecover`.\n                            0x00, // Start of input.\n                            0x80, // Size of input.\n                            0x01, // Start of output.\n                            0x20 // Size of output.\n                        )\n                    // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n                    if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {\n                        isValid := 1\n                        mstore(0x60, 0) // Restore the zero slot.\n                        mstore(0x40, m) // Restore the free memory pointer.\n                        break\n                    }\n                }\n                if eq(signature.length, 65) {\n                    mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) // `v`.\n                    calldatacopy(0x40, signature.offset, 0x40) // `r`, `s`.\n                    let t :=\n                        staticcall(\n                            gas(), // Amount of gas left for the transaction.\n                            1, // Address of `ecrecover`.\n                            0x00, // Start of input.\n                            0x80, // Size of input.\n                            0x01, // Start of output.\n                            0x20 // Size of output.\n                        )\n                    // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n                    if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {\n                        isValid := 1\n                        mstore(0x60, 0) // Restore the zero slot.\n                        mstore(0x40, m) // Restore the free memory pointer.\n                        break\n                    }\n                }\n                mstore(0x60, 0) // Restore the zero slot.\n                mstore(0x40, m) // Restore the free memory pointer.\n\n                let f := shl(224, 0x1626ba7e)\n                mstore(m, f) // `bytes4(keccak256(\"isValidSignature(bytes32,bytes)\"))`.\n                mstore(add(m, 0x04), hash)\n                let d := add(m, 0x24)\n                mstore(d, 0x40) // The offset of the `signature` in the calldata.\n                mstore(add(m, 0x44), signature.length)\n                // Copy the `signature` over.\n                calldatacopy(add(m, 0x64), signature.offset, signature.length)\n                // forgefmt: disable-next-item\n                isValid := and(\n                    // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).\n                    eq(mload(d), f),\n                    // Whether the staticcall does not revert.\n                    // This must be placed at the end of the `and` clause,\n                    // as the arguments are evaluated from right to left.\n                    staticcall(\n                        gas(), // Remaining gas.\n                        signer, // The `signer` address.\n                        m, // Offset of calldata in memory.\n                        add(signature.length, 0x64), // Length of calldata in memory.\n                        d, // Offset of returndata.\n                        0x20 // Length of returndata to write.\n                    )\n                )\n                break\n            }\n        }\n    }\n\n    /// @dev Returns whether the signature (`r`, `vs`) is valid for `signer` and `hash`.\n    /// If `signer` is a smart contract, the signature is validated with ERC1271.\n    /// Otherwise, the signature is validated with `ECDSA.recover`.\n    function isValidSignatureNow(address signer, bytes32 hash, bytes32 r, bytes32 vs)\n        internal\n        view\n        returns (bool isValid)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Clean the upper 96 bits of `signer` in case they are dirty.\n            for { signer := shr(96, shl(96, signer)) } signer {} {\n                let m := mload(0x40)\n                mstore(0x00, hash)\n                mstore(0x20, add(shr(255, vs), 27)) // `v`.\n                mstore(0x40, r) // `r`.\n                mstore(0x60, shr(1, shl(1, vs))) // `s`.\n                let t :=\n                    staticcall(\n                        gas(), // Amount of gas left for the transaction.\n                        1, // Address of `ecrecover`.\n                        0x00, // Start of input.\n                        0x80, // Size of input.\n                        0x01, // Start of output.\n                        0x20 // Size of output.\n                    )\n                // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n                if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {\n                    isValid := 1\n                    mstore(0x60, 0) // Restore the zero slot.\n                    mstore(0x40, m) // Restore the free memory pointer.\n                    break\n                }\n\n                let f := shl(224, 0x1626ba7e)\n                mstore(m, f) // `bytes4(keccak256(\"isValidSignature(bytes32,bytes)\"))`.\n                mstore(add(m, 0x04), hash)\n                let d := add(m, 0x24)\n                mstore(d, 0x40) // The offset of the `signature` in the calldata.\n                mstore(add(m, 0x44), 65) // Length of the signature.\n                mstore(add(m, 0x64), r) // `r`.\n                mstore(add(m, 0x84), mload(0x60)) // `s`.\n                mstore8(add(m, 0xa4), mload(0x20)) // `v`.\n                // forgefmt: disable-next-item\n                isValid := and(\n                    // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).\n                    eq(mload(d), f),\n                    // Whether the staticcall does not revert.\n                    // This must be placed at the end of the `and` clause,\n                    // as the arguments are evaluated from right to left.\n                    staticcall(\n                        gas(), // Remaining gas.\n                        signer, // The `signer` address.\n                        m, // Offset of calldata in memory.\n                        0xa5, // Length of calldata in memory.\n                        d, // Offset of returndata.\n                        0x20 // Length of returndata to write.\n                    )\n                )\n                mstore(0x60, 0) // Restore the zero slot.\n                mstore(0x40, m) // Restore the free memory pointer.\n                break\n            }\n        }\n    }\n\n    /// @dev Returns whether the signature (`v`, `r`, `s`) is valid for `signer` and `hash`.\n    /// If `signer` is a smart contract, the signature is validated with ERC1271.\n    /// Otherwise, the signature is validated with `ECDSA.recover`.\n    function isValidSignatureNow(address signer, bytes32 hash, uint8 v, bytes32 r, bytes32 s)\n        internal\n        view\n        returns (bool isValid)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Clean the upper 96 bits of `signer` in case they are dirty.\n            for { signer := shr(96, shl(96, signer)) } signer {} {\n                let m := mload(0x40)\n                mstore(0x00, hash)\n                mstore(0x20, and(v, 0xff)) // `v`.\n                mstore(0x40, r) // `r`.\n                mstore(0x60, s) // `s`.\n                let t :=\n                    staticcall(\n                        gas(), // Amount of gas left for the transaction.\n                        1, // Address of `ecrecover`.\n                        0x00, // Start of input.\n                        0x80, // Size of input.\n                        0x01, // Start of output.\n                        0x20 // Size of output.\n                    )\n                // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.\n                if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {\n                    isValid := 1\n                    mstore(0x60, 0) // Restore the zero slot.\n                    mstore(0x40, m) // Restore the free memory pointer.\n                    break\n                }\n\n                let f := shl(224, 0x1626ba7e)\n                mstore(m, f) // `bytes4(keccak256(\"isValidSignature(bytes32,bytes)\"))`.\n                mstore(add(m, 0x04), hash)\n                let d := add(m, 0x24)\n                mstore(d, 0x40) // The offset of the `signature` in the calldata.\n                mstore(add(m, 0x44), 65) // Length of the signature.\n                mstore(add(m, 0x64), r) // `r`.\n                mstore(add(m, 0x84), s) // `s`.\n                mstore8(add(m, 0xa4), v) // `v`.\n                // forgefmt: disable-next-item\n                isValid := and(\n                    // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).\n                    eq(mload(d), f),\n                    // Whether the staticcall does not revert.\n                    // This must be placed at the end of the `and` clause,\n                    // as the arguments are evaluated from right to left.\n                    staticcall(\n                        gas(), // Remaining gas.\n                        signer, // The `signer` address.\n                        m, // Offset of calldata in memory.\n                        0xa5, // Length of calldata in memory.\n                        d, // Offset of returndata.\n                        0x20 // Length of returndata to write.\n                    )\n                )\n                mstore(0x60, 0) // Restore the zero slot.\n                mstore(0x40, m) // Restore the free memory pointer.\n                break\n            }\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                     ERC1271 OPERATIONS                     */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns whether `signature` is valid for `hash` for an ERC1271 `signer` contract.\n    function isValidERC1271SignatureNow(address signer, bytes32 hash, bytes memory signature)\n        internal\n        view\n        returns (bool isValid)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40)\n            let f := shl(224, 0x1626ba7e)\n            mstore(m, f) // `bytes4(keccak256(\"isValidSignature(bytes32,bytes)\"))`.\n            mstore(add(m, 0x04), hash)\n            let d := add(m, 0x24)\n            mstore(d, 0x40) // The offset of the `signature` in the calldata.\n            // Copy the `signature` over.\n            let n := add(0x20, mload(signature))\n            pop(staticcall(gas(), 4, signature, n, add(m, 0x44), n))\n            // forgefmt: disable-next-item\n            isValid := and(\n                // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).\n                eq(mload(d), f),\n                // Whether the staticcall does not revert.\n                // This must be placed at the end of the `and` clause,\n                // as the arguments are evaluated from right to left.\n                staticcall(\n                    gas(), // Remaining gas.\n                    signer, // The `signer` address.\n                    m, // Offset of calldata in memory.\n                    add(returndatasize(), 0x44), // Length of calldata in memory.\n                    d, // Offset of returndata.\n                    0x20 // Length of returndata to write.\n                )\n            )\n        }\n    }\n\n    /// @dev Returns whether `signature` is valid for `hash` for an ERC1271 `signer` contract.\n    function isValidERC1271SignatureNowCalldata(\n        address signer,\n        bytes32 hash,\n        bytes calldata signature\n    ) internal view returns (bool isValid) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40)\n            let f := shl(224, 0x1626ba7e)\n            mstore(m, f) // `bytes4(keccak256(\"isValidSignature(bytes32,bytes)\"))`.\n            mstore(add(m, 0x04), hash)\n            let d := add(m, 0x24)\n            mstore(d, 0x40) // The offset of the `signature` in the calldata.\n            mstore(add(m, 0x44), signature.length)\n            // Copy the `signature` over.\n            calldatacopy(add(m, 0x64), signature.offset, signature.length)\n            // forgefmt: disable-next-item\n            isValid := and(\n                // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).\n                eq(mload(d), f),\n                // Whether the staticcall does not revert.\n                // This must be placed at the end of the `and` clause,\n                // as the arguments are evaluated from right to left.\n                staticcall(\n                    gas(), // Remaining gas.\n                    signer, // The `signer` address.\n                    m, // Offset of calldata in memory.\n                    add(signature.length, 0x64), // Length of calldata in memory.\n                    d, // Offset of returndata.\n                    0x20 // Length of returndata to write.\n                )\n            )\n        }\n    }\n\n    /// @dev Returns whether the signature (`r`, `vs`) is valid for `hash`\n    /// for an ERC1271 `signer` contract.\n    function isValidERC1271SignatureNow(address signer, bytes32 hash, bytes32 r, bytes32 vs)\n        internal\n        view\n        returns (bool isValid)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40)\n            let f := shl(224, 0x1626ba7e)\n            mstore(m, f) // `bytes4(keccak256(\"isValidSignature(bytes32,bytes)\"))`.\n            mstore(add(m, 0x04), hash)\n            let d := add(m, 0x24)\n            mstore(d, 0x40) // The offset of the `signature` in the calldata.\n            mstore(add(m, 0x44), 65) // Length of the signature.\n            mstore(add(m, 0x64), r) // `r`.\n            mstore(add(m, 0x84), shr(1, shl(1, vs))) // `s`.\n            mstore8(add(m, 0xa4), add(shr(255, vs), 27)) // `v`.\n            // forgefmt: disable-next-item\n            isValid := and(\n                // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).\n                eq(mload(d), f),\n                // Whether the staticcall does not revert.\n                // This must be placed at the end of the `and` clause,\n                // as the arguments are evaluated from right to left.\n                staticcall(\n                    gas(), // Remaining gas.\n                    signer, // The `signer` address.\n                    m, // Offset of calldata in memory.\n                    0xa5, // Length of calldata in memory.\n                    d, // Offset of returndata.\n                    0x20 // Length of returndata to write.\n                )\n            )\n        }\n    }\n\n    /// @dev Returns whether the signature (`v`, `r`, `s`) is valid for `hash`\n    /// for an ERC1271 `signer` contract.\n    function isValidERC1271SignatureNow(address signer, bytes32 hash, uint8 v, bytes32 r, bytes32 s)\n        internal\n        view\n        returns (bool isValid)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let m := mload(0x40)\n            let f := shl(224, 0x1626ba7e)\n            mstore(m, f) // `bytes4(keccak256(\"isValidSignature(bytes32,bytes)\"))`.\n            mstore(add(m, 0x04), hash)\n            let d := add(m, 0x24)\n            mstore(d, 0x40) // The offset of the `signature` in the calldata.\n            mstore(add(m, 0x44), 65) // Length of the signature.\n            mstore(add(m, 0x64), r) // `r`.\n            mstore(add(m, 0x84), s) // `s`.\n            mstore8(add(m, 0xa4), v) // `v`.\n            // forgefmt: disable-next-item\n            isValid := and(\n                // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).\n                eq(mload(d), f),\n                // Whether the staticcall does not revert.\n                // This must be placed at the end of the `and` clause,\n                // as the arguments are evaluated from right to left.\n                staticcall(\n                    gas(), // Remaining gas.\n                    signer, // The `signer` address.\n                    m, // Offset of calldata in memory.\n                    0xa5, // Length of calldata in memory.\n                    d, // Offset of returndata.\n                    0x20 // Length of returndata to write.\n                )\n            )\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                     HASHING OPERATIONS                     */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns an Ethereum Signed Message, created from a `hash`.\n    /// This produces a hash corresponding to the one signed with the\n    /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign)\n    /// JSON-RPC method as part of EIP-191.\n    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x20, hash) // Store into scratch space for keccak256.\n            mstore(0x00, \"\\x00\\x00\\x00\\x00\\x19Ethereum Signed Message:\\n32\") // 28 bytes.\n            result := keccak256(0x04, 0x3c) // `32 * 2 - (32 - 28) = 60 = 0x3c`.\n        }\n    }\n\n    /// @dev Returns an Ethereum Signed Message, created from `s`.\n    /// This produces a hash corresponding to the one signed with the\n    /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign)\n    /// JSON-RPC method as part of EIP-191.\n    /// Note: Supports lengths of `s` up to 999999 bytes.\n    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32 result) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let sLength := mload(s)\n            let o := 0x20\n            mstore(o, \"\\x19Ethereum Signed Message:\\n\") // 26 bytes, zero-right-padded.\n            mstore(0x00, 0x00)\n            // Convert the `s.length` to ASCII decimal representation: `base10(s.length)`.\n            for { let temp := sLength } 1 {} {\n                o := sub(o, 1)\n                mstore8(o, add(48, mod(temp, 10)))\n                temp := div(temp, 10)\n                if iszero(temp) { break }\n            }\n            let n := sub(0x3a, o) // Header length: `26 + 32 - o`.\n            // Throw an out-of-offset error (consumes all gas) if the header exceeds 32 bytes.\n            returndatacopy(returndatasize(), returndatasize(), gt(n, 0x20))\n            mstore(s, or(mload(0x00), mload(n))) // Temporarily store the header.\n            result := keccak256(add(s, sub(0x20, n)), add(n, sLength))\n            mstore(s, sLength) // Restore the length.\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                   EMPTY CALLDATA HELPERS                   */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns an empty calldata bytes.\n    function emptySignature() internal pure returns (bytes calldata signature) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            signature.length := 0\n        }\n    }\n}\n"}},"matchId":"43639244","creationMatch":"match","runtimeMatch":"match","verifiedAt":"2026-08-14T19:01:43Z","match":"match","chainId":"1","address":"0xc1e3C7D486d6A92fBE920232E439EeC2cEb112dA"}