From f5544fdaaece4f481411a9b62d96ec6837d07074 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:00:12 -0600 Subject: [PATCH 001/110] Add Account framework --- contracts/account/Account.sol | 142 +++++ contracts/account/README.adoc | 24 +- .../account/extensions/AccountERC7579.sol | 404 +++++++++++++ .../extensions/AccountERC7579Hooked.sol | 106 ++++ contracts/account/extensions/ERC7821.sol | 67 +++ .../modules/ERC7579FallbackHandlerMock.sol | 36 ++ contracts/account/modules/ERC7579HookMock.sol | 24 + .../account/modules/ERC7579ModuleMock.sol | 28 + .../account/modules/ERC7579ValidatorMock.sol | 45 ++ contracts/mocks/CallReceiverMock.sol | 5 + contracts/mocks/account/AccountECDSAMock.sol | 25 + .../mocks/account/AccountERC7702Mock.sol | 21 + contracts/mocks/account/AccountMock.sol | 27 + contracts/mocks/account/AccountP256Mock.sol | 25 + contracts/mocks/account/AccountRSAMock.sol | 25 + contracts/utils/README.adoc | 21 + .../utils/cryptography/AbstractSigner.sol | 20 + contracts/utils/cryptography/ERC7739.sol | 99 +++ contracts/utils/cryptography/ERC7739Utils.sol | 207 +++++++ contracts/utils/cryptography/SignerECDSA.sol | 52 ++ .../utils/cryptography/SignerERC7702.sol | 22 + contracts/utils/cryptography/SignerP256.sol | 60 ++ contracts/utils/cryptography/SignerRSA.sol | 61 ++ foundry.toml | 2 +- package.json | 4 +- test/account/Account.behavior.js | 149 +++++ test/account/Account.test.js | 48 ++ test/account/AccountECDSA.test.js | 52 ++ test/account/AccountERC7702.t.sol | 100 ++++ test/account/AccountERC7702.test.js | 52 ++ test/account/AccountP256.test.js | 58 ++ test/account/AccountRSA.test.js | 58 ++ .../AccountERC7702WithModulesMock.test.js | 99 +++ .../extensions/AccountERC7579.behavior.js | 563 ++++++++++++++++++ .../account/extensions/AccountERC7579.test.js | 60 ++ .../extensions/AccountERC7579Hooked.test.js | 60 ++ test/account/extensions/ERC7821.behavior.js | 145 +++++ test/helpers/eip712-types.js | 52 +- test/helpers/erc4337.js | 124 ++++ test/helpers/erc7739.js | 118 ++++ test/helpers/signers.js | 147 +++++ test/utils/cryptography/ERC1271.behavior.js | 111 ++++ test/utils/cryptography/ERC7739.test.js | 38 ++ test/utils/cryptography/ERC7739Utils.test.js | 211 +++++++ 44 files changed, 3766 insertions(+), 31 deletions(-) create mode 100644 contracts/account/Account.sol create mode 100644 contracts/account/extensions/AccountERC7579.sol create mode 100644 contracts/account/extensions/AccountERC7579Hooked.sol create mode 100644 contracts/account/extensions/ERC7821.sol create mode 100644 contracts/account/modules/ERC7579FallbackHandlerMock.sol create mode 100644 contracts/account/modules/ERC7579HookMock.sol create mode 100644 contracts/account/modules/ERC7579ModuleMock.sol create mode 100644 contracts/account/modules/ERC7579ValidatorMock.sol create mode 100644 contracts/mocks/account/AccountECDSAMock.sol create mode 100644 contracts/mocks/account/AccountERC7702Mock.sol create mode 100644 contracts/mocks/account/AccountMock.sol create mode 100644 contracts/mocks/account/AccountP256Mock.sol create mode 100644 contracts/mocks/account/AccountRSAMock.sol create mode 100644 contracts/utils/cryptography/AbstractSigner.sol create mode 100644 contracts/utils/cryptography/ERC7739.sol create mode 100644 contracts/utils/cryptography/ERC7739Utils.sol create mode 100644 contracts/utils/cryptography/SignerECDSA.sol create mode 100644 contracts/utils/cryptography/SignerERC7702.sol create mode 100644 contracts/utils/cryptography/SignerP256.sol create mode 100644 contracts/utils/cryptography/SignerRSA.sol create mode 100644 test/account/Account.behavior.js create mode 100644 test/account/Account.test.js create mode 100644 test/account/AccountECDSA.test.js create mode 100644 test/account/AccountERC7702.t.sol create mode 100644 test/account/AccountERC7702.test.js create mode 100644 test/account/AccountP256.test.js create mode 100644 test/account/AccountRSA.test.js create mode 100644 test/account/examples/AccountERC7702WithModulesMock.test.js create mode 100644 test/account/extensions/AccountERC7579.behavior.js create mode 100644 test/account/extensions/AccountERC7579.test.js create mode 100644 test/account/extensions/AccountERC7579Hooked.test.js create mode 100644 test/account/extensions/ERC7821.behavior.js create mode 100644 test/helpers/erc7739.js create mode 100644 test/helpers/signers.js create mode 100644 test/utils/cryptography/ERC1271.behavior.js create mode 100644 test/utils/cryptography/ERC7739.test.js create mode 100644 test/utils/cryptography/ERC7739Utils.test.js diff --git a/contracts/account/Account.sol b/contracts/account/Account.sol new file mode 100644 index 00000000000..56c18c8bfa9 --- /dev/null +++ b/contracts/account/Account.sol @@ -0,0 +1,142 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {PackedUserOperation, IAccount, IEntryPoint} from "../interfaces/draft-IERC4337.sol"; +import {ERC4337Utils} from "./utils/draft-ERC4337Utils.sol"; +import {AbstractSigner} from "../utils/cryptography/AbstractSigner.sol"; + +/** + * @dev A simple ERC4337 account implementation. This base implementation only includes the minimal logic to process + * user operations. + * + * Developers must implement the {AbstractSigner-_rawSignatureValidation} function to define the account's validation logic. + * + * NOTE: This core account doesn't include any mechanism for performing arbitrary external calls. This is an essential + * feature that all Account should have. We leave it up to the developers to implement the mechanism of their choice. + * Common choices include ERC-6900, ERC-7579 and ERC-7821 (among others). + * + * IMPORTANT: Implementing a mechanism to validate signatures is a security-sensitive operation as it may allow an + * attacker to bypass the account's security measures. Check out {SignerECDSA}, {SignerP256}, or {SignerRSA} for + * digital signature validation implementations. + */ +abstract contract Account is AbstractSigner, IAccount { + /** + * @dev Unauthorized call to the account. + */ + error AccountUnauthorized(address sender); + + /** + * @dev Revert if the caller is not the entry point or the account itself. + */ + modifier onlyEntryPointOrSelf() { + _checkEntryPointOrSelf(); + _; + } + + /** + * @dev Revert if the caller is not the entry point. + */ + modifier onlyEntryPoint() { + _checkEntryPoint(); + _; + } + + /** + * @dev Canonical entry point for the account that forwards and validates user operations. + */ + function entryPoint() public view virtual returns (IEntryPoint) { + return ERC4337Utils.ENTRYPOINT_V08; + } + + /** + * @dev Return the account nonce for the canonical sequence. + */ + function getNonce() public view virtual returns (uint256) { + return getNonce(0); + } + + /** + * @dev Return the account nonce for a given sequence (key). + */ + function getNonce(uint192 key) public view virtual returns (uint256) { + return entryPoint().getNonce(address(this), key); + } + + /** + * @inheritdoc IAccount + */ + function validateUserOp( + PackedUserOperation calldata userOp, + bytes32 userOpHash, + uint256 missingAccountFunds + ) public virtual onlyEntryPoint returns (uint256) { + uint256 validationData = _validateUserOp(userOp, userOpHash); + _payPrefund(missingAccountFunds); + return validationData; + } + + /** + * @dev Returns the validationData for a given user operation. By default, this checks the signature of the + * signable hash (produced by {_signableUserOpHash}) using the abstract signer ({AbstractSigner-_rawSignatureValidation}). + * + * NOTE: The userOpHash is assumed to be correct. Calling this function with a userOpHash that does not match the + * userOp will result in undefined behavior. + */ + function _validateUserOp( + PackedUserOperation calldata userOp, + bytes32 userOpHash + ) internal virtual returns (uint256) { + return + _rawSignatureValidation(_signableUserOpHash(userOp, userOpHash), userOp.signature) + ? ERC4337Utils.SIG_VALIDATION_SUCCESS + : ERC4337Utils.SIG_VALIDATION_FAILED; + } + + /** + * @dev Virtual function that returns the signable hash for a user operations. Since v0.8.0 of the entrypoint, + * `userOpHash` is an EIP-712 hash that can be signed directly. + */ + function _signableUserOpHash( + PackedUserOperation calldata /*userOp*/, + bytes32 userOpHash + ) internal view virtual returns (bytes32) { + return userOpHash; + } + + /** + * @dev Sends the missing funds for executing the user operation to the {entrypoint}. + * The `missingAccountFunds` must be defined by the entrypoint when calling {validateUserOp}. + */ + function _payPrefund(uint256 missingAccountFunds) internal virtual { + if (missingAccountFunds > 0) { + (bool success, ) = payable(msg.sender).call{value: missingAccountFunds}(""); + success; // Silence warning. The entrypoint should validate the result. + } + } + + /** + * @dev Ensures the caller is the {entrypoint}. + */ + function _checkEntryPoint() internal view virtual { + address sender = msg.sender; + if (sender != address(entryPoint())) { + revert AccountUnauthorized(sender); + } + } + + /** + * @dev Ensures the caller is the {entrypoint} or the account itself. + */ + function _checkEntryPointOrSelf() internal view virtual { + address sender = msg.sender; + if (sender != address(this) && sender != address(entryPoint())) { + revert AccountUnauthorized(sender); + } + } + + /** + * @dev Receive Ether. + */ + receive() external payable virtual {} +} diff --git a/contracts/account/README.adoc b/contracts/account/README.adoc index d2eb9db5ee9..714087666fa 100644 --- a/contracts/account/README.adoc +++ b/contracts/account/README.adoc @@ -1,9 +1,27 @@ = Account - [.readme-notice] -NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/account +NOTE: This document is better viewed at https://docs.openzeppelin.com/community-contracts/api/account + +This directory includes contracts to build accounts for ERC-4337. These include: + + * {Account}: An ERC-4337 smart account implementation that includes the core logic to process user operations. + * {AccountERC7579}: An extension of `Account` that implements support for ERC-7579 modules. + * {AccountERC7579Hooked}: An extension of `AccountERC7579` with support for a single hook module (type 4). + * {ERC7821}: Minimal batch executor implementation contracts. Useful to enable easy batch execution for smart contracts. + * {ERC4337Utils}: Utility functions for working with ERC-4337 user operations. + * {ERC7579Utils}: Utility functions for working with ERC-7579 modules and account modularity. + +== Core + +{{Account}} + +== Extensions + +{{AccountERC7579}} + +{{AccountERC7579Hooked}} -This directory includes contracts to build accounts for ERC-4337. +{{ERC7821}} == Utilities diff --git a/contracts/account/extensions/AccountERC7579.sol b/contracts/account/extensions/AccountERC7579.sol new file mode 100644 index 00000000000..e554bb96b0f --- /dev/null +++ b/contracts/account/extensions/AccountERC7579.sol @@ -0,0 +1,404 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.27; + +import {PackedUserOperation} from "../../interfaces/draft-IERC4337.sol"; +import {IERC1271} from "../../interfaces/IERC1271.sol"; +import {IERC7579Module, IERC7579Validator, IERC7579Execution, IERC7579AccountConfig, IERC7579ModuleConfig, MODULE_TYPE_VALIDATOR, MODULE_TYPE_EXECUTOR, MODULE_TYPE_FALLBACK} from "../../interfaces/draft-IERC7579.sol"; +import {ERC7579Utils, Mode, CallType, ExecType} from "../../account/utils/draft-ERC7579Utils.sol"; +import {EnumerableSet} from "../../utils/structs/EnumerableSet.sol"; +import {Bytes} from "../../utils/Bytes.sol"; +import {Packing} from "../../utils/Packing.sol"; +import {Address} from "../../utils/Address.sol"; +import {Calldata} from "../../utils/Calldata.sol"; +import {Account} from "../Account.sol"; + +/** + * @dev Extension of {Account} that implements support for ERC-7579 modules. + * + * To comply with the ERC-1271 support requirement, this contract defers signature validation to + * installed validator modules by calling {IERC7579Validator-isValidSignatureWithSender}. + * + * This contract does not implement validation logic for user operations since this functionality + * is often delegated to self-contained validation modules. Developers must install a validator module + * upon initialization (or any other mechanism to enable execution from the account): + * + * ```solidity + * contract MyAccountERC7579 is AccountERC7579, Initializable { + * function initializeAccount(address validator, bytes calldata validatorData) public initializer { + * _installModule(MODULE_TYPE_VALIDATOR, validator, validatorData); + * } + * } + * ``` + * + * [NOTE] + * ==== + * * Hook support is not included. See {AccountERC7579Hooked} for a version that hooks to execution. + * * Validator selection, when verifying either ERC-1271 signature or ERC-4337 UserOperation is implemented in + * internal virtual functions {_extractUserOpValidator} and {_extractSignatureValidator}. Both are implemented + * following common practices. However, this part is not standardized in ERC-7579 (or in any follow-up ERC). Some + * accounts may want to override these internal functions. + * * When combined with {ERC7739}, resolution ordering of {isValidSignature} may have an impact ({ERC7739} does not + * call super). Manual resolution might be necessary. + * * Static calls (using callType `0xfe`) are currently NOT supported. + * ==== + * + * WARNING: Removing all validator modules will render the account inoperable, as no user operations can be validated thereafter. + */ +abstract contract AccountERC7579 is Account, IERC1271, IERC7579Execution, IERC7579AccountConfig, IERC7579ModuleConfig { + using Bytes for *; + using ERC7579Utils for *; + using EnumerableSet for *; + using Packing for bytes32; + + EnumerableSet.AddressSet private _validators; + EnumerableSet.AddressSet private _executors; + mapping(bytes4 selector => address) private _fallbacks; + + /// @dev The account's {fallback} was called with a selector that doesn't have an installed handler. + error ERC7579MissingFallbackHandler(bytes4 selector); + + /// @dev Modifier that checks if the caller is an installed module of the given type. + modifier onlyModule(uint256 moduleTypeId, bytes calldata additionalContext) { + _checkModule(moduleTypeId, msg.sender, additionalContext); + _; + } + + /// @dev See {_fallback}. + fallback(bytes calldata) external payable virtual returns (bytes memory) { + return _fallback(); + } + + /// @inheritdoc IERC7579AccountConfig + function accountId() public view virtual returns (string memory) { + // vendorname.accountname.semver + return "@openzeppelin/community-contracts.AccountERC7579.v0.0.0"; + } + + /** + * @inheritdoc IERC7579AccountConfig + * + * @dev Supported call types: + * * Single (`0x00`): A single transaction execution. + * * Batch (`0x01`): A batch of transactions execution. + * * Delegate (`0xff`): A delegate call execution. + * + * Supported exec types: + * * Default (`0x00`): Default execution type (revert on failure). + * * Try (`0x01`): Try execution type (emits ERC7579TryExecuteFail on failure). + */ + function supportsExecutionMode(bytes32 encodedMode) public view virtual returns (bool) { + (CallType callType, ExecType execType, , ) = Mode.wrap(encodedMode).decodeMode(); + return + (callType == ERC7579Utils.CALLTYPE_SINGLE || + callType == ERC7579Utils.CALLTYPE_BATCH || + callType == ERC7579Utils.CALLTYPE_DELEGATECALL) && + (execType == ERC7579Utils.EXECTYPE_DEFAULT || execType == ERC7579Utils.EXECTYPE_TRY); + } + + /** + * @inheritdoc IERC7579AccountConfig + * + * @dev Supported module types: + * + * * Validator: A module used during the validation phase to determine if a transaction is valid and + * should be executed on the account. + * * Executor: A module that can execute transactions on behalf of the smart account via a callback. + * * Fallback Handler: A module that can extend the fallback functionality of a smart account. + */ + function supportsModule(uint256 moduleTypeId) public view virtual returns (bool) { + return + moduleTypeId == MODULE_TYPE_VALIDATOR || + moduleTypeId == MODULE_TYPE_EXECUTOR || + moduleTypeId == MODULE_TYPE_FALLBACK; + } + + /// @inheritdoc IERC7579ModuleConfig + function installModule( + uint256 moduleTypeId, + address module, + bytes calldata initData + ) public virtual onlyEntryPointOrSelf { + _installModule(moduleTypeId, module, initData); + } + + /// @inheritdoc IERC7579ModuleConfig + function uninstallModule( + uint256 moduleTypeId, + address module, + bytes calldata deInitData + ) public virtual onlyEntryPointOrSelf { + _uninstallModule(moduleTypeId, module, deInitData); + } + + /// @inheritdoc IERC7579ModuleConfig + function isModuleInstalled( + uint256 moduleTypeId, + address module, + bytes calldata additionalContext + ) public view virtual returns (bool) { + if (moduleTypeId == MODULE_TYPE_VALIDATOR) return _validators.contains(module); + if (moduleTypeId == MODULE_TYPE_EXECUTOR) return _executors.contains(module); + if (moduleTypeId == MODULE_TYPE_FALLBACK) return _fallbacks[bytes4(additionalContext[0:4])] == module; + return false; + } + + /// @inheritdoc IERC7579Execution + function execute(bytes32 mode, bytes calldata executionCalldata) public payable virtual onlyEntryPointOrSelf { + _execute(Mode.wrap(mode), executionCalldata); + } + + /// @inheritdoc IERC7579Execution + function executeFromExecutor( + bytes32 mode, + bytes calldata executionCalldata + ) + public + payable + virtual + onlyModule(MODULE_TYPE_EXECUTOR, Calldata.emptyBytes()) + returns (bytes[] memory returnData) + { + return _execute(Mode.wrap(mode), executionCalldata); + } + + /** + * @dev Implement ERC-1271 through IERC7579Validator modules. If module based validation fails, fallback to + * "native" validation by the abstract signer. + * + * NOTE: when combined with {ERC7739}, resolution ordering may have an impact ({ERC7739} does not call super). + * Manual resolution might be necessary. + */ + function isValidSignature(bytes32 hash, bytes calldata signature) public view virtual returns (bytes4) { + // check signature length is enough for extraction + if (signature.length >= 20) { + (address module, bytes calldata innerSignature) = _extractSignatureValidator(signature); + // if module is not installed, skip + if (isModuleInstalled(MODULE_TYPE_VALIDATOR, module, Calldata.emptyBytes())) { + // try validation, skip any revert + try IERC7579Validator(module).isValidSignatureWithSender(msg.sender, hash, innerSignature) returns ( + bytes4 magic + ) { + return magic; + } catch {} + } + } + return bytes4(0xffffffff); + } + + /** + * @dev Validates a user operation with {_signableUserOpHash} and returns the validation data + * if the module specified by the first 20 bytes of the nonce key is installed. Falls back to + * {Account-_validateUserOp} otherwise. + * + * See {_extractUserOpValidator} for the module extraction logic. + */ + function _validateUserOp( + PackedUserOperation calldata userOp, + bytes32 userOpHash + ) internal virtual override returns (uint256) { + address module = _extractUserOpValidator(userOp); + return + isModuleInstalled(MODULE_TYPE_VALIDATOR, module, Calldata.emptyBytes()) + ? IERC7579Validator(module).validateUserOp(userOp, _signableUserOpHash(userOp, userOpHash)) + : super._validateUserOp(userOp, userOpHash); + } + + /** + * @dev ERC-7579 execution logic. See {supportsExecutionMode} for supported modes. + * + * Reverts if the call type is not supported. + */ + function _execute( + Mode mode, + bytes calldata executionCalldata + ) internal virtual returns (bytes[] memory returnData) { + (CallType callType, ExecType execType, , ) = mode.decodeMode(); + if (callType == ERC7579Utils.CALLTYPE_SINGLE) return executionCalldata.execSingle(execType); + if (callType == ERC7579Utils.CALLTYPE_BATCH) return executionCalldata.execBatch(execType); + if (callType == ERC7579Utils.CALLTYPE_DELEGATECALL) return executionCalldata.execDelegateCall(execType); + revert ERC7579Utils.ERC7579UnsupportedCallType(callType); + } + + /** + * @dev Installs a module of the given type with the given initialization data. + * + * For the fallback module type, the `initData` is expected to be the (packed) concatenation of a 4-byte + * selector and the rest of the data to be sent to the handler when calling {IERC7579Module-onInstall}. + * + * Requirements: + * + * * Module type must be supported. See {supportsModule}. Reverts with {ERC7579UnsupportedModuleType}. + * * Module must be of the given type. Reverts with {ERC7579MismatchedModuleTypeId}. + * * Module must not be already installed. Reverts with {ERC7579AlreadyInstalledModule}. + * + * Emits a {ModuleInstalled} event. + */ + function _installModule(uint256 moduleTypeId, address module, bytes memory initData) internal virtual { + require(supportsModule(moduleTypeId), ERC7579Utils.ERC7579UnsupportedModuleType(moduleTypeId)); + require( + IERC7579Module(module).isModuleType(moduleTypeId), + ERC7579Utils.ERC7579MismatchedModuleTypeId(moduleTypeId, module) + ); + + if (moduleTypeId == MODULE_TYPE_VALIDATOR) { + require(_validators.add(module), ERC7579Utils.ERC7579AlreadyInstalledModule(moduleTypeId, module)); + } else if (moduleTypeId == MODULE_TYPE_EXECUTOR) { + require(_executors.add(module), ERC7579Utils.ERC7579AlreadyInstalledModule(moduleTypeId, module)); + } else if (moduleTypeId == MODULE_TYPE_FALLBACK) { + bytes4 selector; + (selector, initData) = _decodeFallbackData(initData); + require( + _fallbacks[selector] == address(0), + ERC7579Utils.ERC7579AlreadyInstalledModule(moduleTypeId, module) + ); + _fallbacks[selector] = module; + } + + IERC7579Module(module).onInstall(initData); + emit ModuleInstalled(moduleTypeId, module); + } + + /** + * @dev Uninstalls a module of the given type with the given de-initialization data. + * + * For the fallback module type, the `deInitData` is expected to be the (packed) concatenation of a 4-byte + * selector and the rest of the data to be sent to the handler when calling {IERC7579Module-onUninstall}. + * + * Requirements: + * + * * Module must be already installed. Reverts with {ERC7579UninstalledModule} otherwise. + */ + function _uninstallModule(uint256 moduleTypeId, address module, bytes memory deInitData) internal virtual { + require(supportsModule(moduleTypeId), ERC7579Utils.ERC7579UnsupportedModuleType(moduleTypeId)); + + if (moduleTypeId == MODULE_TYPE_VALIDATOR) { + require(_validators.remove(module), ERC7579Utils.ERC7579UninstalledModule(moduleTypeId, module)); + } else if (moduleTypeId == MODULE_TYPE_EXECUTOR) { + require(_executors.remove(module), ERC7579Utils.ERC7579UninstalledModule(moduleTypeId, module)); + } else if (moduleTypeId == MODULE_TYPE_FALLBACK) { + bytes4 selector; + (selector, deInitData) = _decodeFallbackData(deInitData); + require( + _fallbackHandler(selector) == module && module != address(0), + ERC7579Utils.ERC7579UninstalledModule(moduleTypeId, module) + ); + delete _fallbacks[selector]; + } + + IERC7579Module(module).onUninstall(deInitData); + emit ModuleUninstalled(moduleTypeId, module); + } + + /** + * @dev Fallback function that delegates the call to the installed handler for the given selector. + * + * Reverts with {ERC7579MissingFallbackHandler} if the handler is not installed. + * + * Calls the handler with the original `msg.sender` appended at the end of the calldata following + * the ERC-2771 format. + */ + function _fallback() internal virtual returns (bytes memory) { + address handler = _fallbackHandler(msg.sig); + require(handler != address(0), ERC7579MissingFallbackHandler(msg.sig)); + + // From https://eips.ethereum.org/EIPS/eip-7579#fallback[ERC-7579 specifications]: + // - MUST utilize ERC-2771 to add the original msg.sender to the calldata sent to the fallback handler + // - MUST use call to invoke the fallback handler + (bool success, bytes memory returndata) = handler.call{value: msg.value}( + abi.encodePacked(msg.data, msg.sender) + ); + + if (success) return returndata; + + assembly ("memory-safe") { + revert(add(returndata, 0x20), mload(returndata)) + } + } + + /// @dev Returns the fallback handler for the given selector. Returns `address(0)` if not installed. + function _fallbackHandler(bytes4 selector) internal view virtual returns (address) { + return _fallbacks[selector]; + } + + /// @dev Checks if the module is installed. Reverts if the module is not installed. + function _checkModule( + uint256 moduleTypeId, + address module, + bytes calldata additionalContext + ) internal view virtual { + require( + isModuleInstalled(moduleTypeId, module, additionalContext), + ERC7579Utils.ERC7579UninstalledModule(moduleTypeId, module) + ); + } + + /** + * @dev Extracts the nonce validator from the user operation. + * + * To construct a nonce key, set nonce as follows: + * + * ``` + * | | + * ``` + * NOTE: The default behavior of this function replicates the behavior of + * https://github.com/rhinestonewtf/safe7579/blob/bb29e8b1a66658790c4169e72608e27d220f79be/src/Safe7579.sol#L266[Safe adapter], + * https://github.com/etherspot/etherspot-prime-contracts/blob/cfcdb48c4172cea0d66038324c0bae3288aa8caa/src/modular-etherspot-wallet/wallet/ModularEtherspotWallet.sol#L227[Etherspot's Prime Account], and + * https://github.com/erc7579/erc7579-implementation/blob/16138d1afd4e9711f6c1425133538837bd7787b5/src/MSAAdvanced.sol#L247[ERC7579 reference implementation]. + * + * This is not standardized in ERC-7579 (or in any follow-up ERC). Some accounts may want to override these internal functions. + * + * For example, https://github.com/bcnmy/nexus/blob/54f4e19baaff96081a8843672977caf712ef19f4/contracts/lib/NonceLib.sol#L17[Biconomy's Nexus] + * uses a similar yet incompatible approach (the validator address is also part of the nonce, but not at the same location) + */ + function _extractUserOpValidator(PackedUserOperation calldata userOp) internal pure virtual returns (address) { + return address(bytes32(userOp.nonce).extract_32_20(0)); + } + + /** + * @dev Extracts the signature validator from the signature. + * + * To construct a signature, set the first 20 bytes as the module address and the remaining bytes as the + * signature data: + * + * ``` + * | + * ``` + * + * NOTE: The default behavior of this function replicates the behavior of + * https://github.com/rhinestonewtf/safe7579/blob/bb29e8b1a66658790c4169e72608e27d220f79be/src/Safe7579.sol#L350[Safe adapter], + * https://github.com/bcnmy/nexus/blob/54f4e19baaff96081a8843672977caf712ef19f4/contracts/Nexus.sol#L239[Biconomy's Nexus], + * https://github.com/etherspot/etherspot-prime-contracts/blob/cfcdb48c4172cea0d66038324c0bae3288aa8caa/src/modular-etherspot-wallet/wallet/ModularEtherspotWallet.sol#L252[Etherspot's Prime Account], and + * https://github.com/erc7579/erc7579-implementation/blob/16138d1afd4e9711f6c1425133538837bd7787b5/src/MSAAdvanced.sol#L296[ERC7579 reference implementation]. + * + * This is not standardized in ERC-7579 (or in any follow-up ERC). Some accounts may want to override these internal functions. + */ + function _extractSignatureValidator( + bytes calldata signature + ) internal pure virtual returns (address module, bytes calldata innerSignature) { + return (address(bytes20(signature[0:20])), signature[20:]); + } + + /** + * @dev Extract the function selector from initData/deInitData for MODULE_TYPE_FALLBACK + * + * NOTE: If we had calldata here, we could use calldata slice which are cheaper to manipulate and don't require + * actual copy. However, this would require `_installModule` to get a calldata bytes object instead of a memory + * bytes object. This would prevent calling `_installModule` from a contract constructor and would force the use + * of external initializers. That may change in the future, as most accounts will probably be deployed as + * clones/proxy/ERC-7702 delegates and therefore rely on initializers anyway. + */ + function _decodeFallbackData( + bytes memory data + ) internal pure virtual returns (bytes4 selector, bytes memory remaining) { + return (bytes4(data), data.slice(4)); + } + + /// @dev By default, only use the modules for validation of userOp and signature. Disable raw signatures. + function _rawSignatureValidation( + bytes32 /*hash*/, + bytes calldata /*signature*/ + ) internal view virtual override returns (bool) { + return false; + } +} diff --git a/contracts/account/extensions/AccountERC7579Hooked.sol b/contracts/account/extensions/AccountERC7579Hooked.sol new file mode 100644 index 00000000000..9666f3cdae7 --- /dev/null +++ b/contracts/account/extensions/AccountERC7579Hooked.sol @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.27; + +import {IERC7579Hook, MODULE_TYPE_HOOK} from "../../interfaces/draft-IERC7579.sol"; +import {ERC7579Utils, Mode} from "../../account/utils/draft-ERC7579Utils.sol"; +import {AccountERC7579} from "./AccountERC7579.sol"; + +/** + * @dev Extension of {AccountERC7579} with support for a single hook module (type 4). + * + * If installed, this extension will call the hook module's {IERC7579Hook-preCheck} before executing any operation + * with {_execute} (including {execute} and {executeFromExecutor} by default) and {IERC7579Hook-postCheck} thereafter. + * + * NOTE: Hook modules break the check-effect-interaction pattern. In particular, the {IERC7579Hook-preCheck} hook can + * lead to potentially dangerous reentrancy. Using the `withHook()` modifier is safe if no effect is performed + * before the preHook or after the postHook. That is the case on all functions here, but it may not be the case if + * functions that have this modifier are overridden. Developers should be extremely careful when implementing hook + * modules or further overriding functions that involve hooks. + */ +abstract contract AccountERC7579Hooked is AccountERC7579 { + address private _hook; + + /// @dev A hook module is already present. This contract only supports one hook module. + error ERC7579HookModuleAlreadyPresent(address hook); + + /** + * @dev Calls {IERC7579Hook-preCheck} before executing the modified function and {IERC7579Hook-postCheck} + * thereafter. + */ + modifier withHook() { + address hook_ = hook(); + bytes memory hookData; + + // slither-disable-next-line reentrancy-no-eth + if (hook_ != address(0)) hookData = IERC7579Hook(hook_).preCheck(msg.sender, msg.value, msg.data); + _; + if (hook_ != address(0)) IERC7579Hook(hook_).postCheck(hookData); + } + + /// @inheritdoc AccountERC7579 + function accountId() public view virtual override returns (string memory) { + // vendorname.accountname.semver + return "@openzeppelin/community-contracts.AccountERC7579Hooked.v0.0.0"; + } + + /// @dev Returns the hook module address if installed, or `address(0)` otherwise. + function hook() public view virtual returns (address) { + return _hook; + } + + /// @dev Supports hook modules. See {AccountERC7579-supportsModule} + function supportsModule(uint256 moduleTypeId) public view virtual override returns (bool) { + return moduleTypeId == MODULE_TYPE_HOOK || super.supportsModule(moduleTypeId); + } + + /// @inheritdoc AccountERC7579 + function isModuleInstalled( + uint256 moduleTypeId, + address module, + bytes calldata data + ) public view virtual override returns (bool) { + return + (moduleTypeId == MODULE_TYPE_HOOK && module == hook()) || + super.isModuleInstalled(moduleTypeId, module, data); + } + + /// @dev Installs a module with support for hook modules. See {AccountERC7579-_installModule} + function _installModule( + uint256 moduleTypeId, + address module, + bytes memory initData + ) internal virtual override withHook { + if (moduleTypeId == MODULE_TYPE_HOOK) { + require(_hook == address(0), ERC7579HookModuleAlreadyPresent(_hook)); + _hook = module; + } + super._installModule(moduleTypeId, module, initData); + } + + /// @dev Uninstalls a module with support for hook modules. See {AccountERC7579-_uninstallModule} + function _uninstallModule( + uint256 moduleTypeId, + address module, + bytes memory deInitData + ) internal virtual override withHook { + if (moduleTypeId == MODULE_TYPE_HOOK) { + require(_hook == module, ERC7579Utils.ERC7579UninstalledModule(moduleTypeId, module)); + _hook = address(0); + } + super._uninstallModule(moduleTypeId, module, deInitData); + } + + /// @dev Hooked version of {AccountERC7579-_execute}. + function _execute( + Mode mode, + bytes calldata executionCalldata + ) internal virtual override withHook returns (bytes[] memory) { + return super._execute(mode, executionCalldata); + } + + /// @dev Hooked version of {AccountERC7579-_fallback}. + function _fallback() internal virtual override withHook returns (bytes memory) { + return super._fallback(); + } +} diff --git a/contracts/account/extensions/ERC7821.sol b/contracts/account/extensions/ERC7821.sol new file mode 100644 index 00000000000..a8f7c09e5d1 --- /dev/null +++ b/contracts/account/extensions/ERC7821.sol @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {ERC7579Utils, Mode, CallType, ExecType, ModeSelector} from "../utils/draft-ERC7579Utils.sol"; +import {IERC7821} from "../../interfaces/IERC7821.sol"; +import {Account} from "../Account.sol"; + +/** + * @dev Minimal batch executor following ERC-7821. + * + * Only supports supports single batch mode (`0x01000000000000000000`). Does not support optional "opData". + */ +abstract contract ERC7821 is IERC7821 { + using ERC7579Utils for *; + + error UnsupportedExecutionMode(); + + /** + * @dev Executes the calls in `executionData` with no optional `opData` support. + * + * NOTE: Access to this function is controlled by {_erc7821AuthorizedExecutor}. Changing access permissions, for + * example to approve calls by the ERC-4337 entrypoint, should be implemented by overriding it. + * + * Reverts and bubbles up error if any call fails. + */ + function execute(bytes32 mode, bytes calldata executionData) public payable virtual { + if (!_erc7821AuthorizedExecutor(msg.sender, mode, executionData)) + revert Account.AccountUnauthorized(msg.sender); + if (!supportsExecutionMode(mode)) revert UnsupportedExecutionMode(); + executionData.execBatch(ERC7579Utils.EXECTYPE_DEFAULT); + } + + /// @inheritdoc IERC7821 + function supportsExecutionMode(bytes32 mode) public view virtual returns (bool result) { + (CallType callType, ExecType execType, ModeSelector modeSelector, ) = Mode.wrap(mode).decodeMode(); + return + callType == ERC7579Utils.CALLTYPE_BATCH && + execType == ERC7579Utils.EXECTYPE_DEFAULT && + modeSelector == ModeSelector.wrap(0x00000000); + } + + /** + * @dev Access control mechanism for the {execute} function. + * By default, only the contract itself is allowed to execute. + * + * Override this function to implement custom access control, for example to allow the + * ERC-4337 entrypoint to execute. + * + * ```solidity + * function _erc7821AuthorizedExecutor( + * address caller, + * bytes32 mode, + * bytes calldata executionData + * ) internal view virtual override returns (bool) { + * return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + * } + * ``` + */ + function _erc7821AuthorizedExecutor( + address caller, + bytes32 /* mode */, + bytes calldata /* executionData */ + ) internal view virtual returns (bool) { + return caller == address(this); + } +} diff --git a/contracts/account/modules/ERC7579FallbackHandlerMock.sol b/contracts/account/modules/ERC7579FallbackHandlerMock.sol new file mode 100644 index 00000000000..b82325bd384 --- /dev/null +++ b/contracts/account/modules/ERC7579FallbackHandlerMock.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; +import {MODULE_TYPE_FALLBACK} from "../../interfaces/draft-IERC7579.sol"; + +abstract contract ERC7579FallbackHandlerMock is ERC7579ModuleMock(MODULE_TYPE_FALLBACK) { + event ERC7579FallbackHandlerMockCalled(address account, address sender, uint256 value, bytes data); + + error ERC7579FallbackHandlerMockRevert(); + + function _msgAccount() internal view returns (address) { + return msg.sender; + } + + function _msgSender() internal pure returns (address) { + return address(bytes20(msg.data[msg.data.length - 20:])); + } + + function _msgData() internal pure returns (bytes calldata) { + return msg.data[:msg.data.length - 20]; + } + + function callPayable() public payable { + emit ERC7579FallbackHandlerMockCalled(_msgAccount(), _msgSender(), msg.value, _msgData()); + } + + function callView() public view returns (address, address) { + return (_msgAccount(), _msgSender()); + } + + function callRevert() public pure { + revert ERC7579FallbackHandlerMockRevert(); + } +} diff --git a/contracts/account/modules/ERC7579HookMock.sol b/contracts/account/modules/ERC7579HookMock.sol new file mode 100644 index 00000000000..375b1f17844 --- /dev/null +++ b/contracts/account/modules/ERC7579HookMock.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; +import {MODULE_TYPE_HOOK, IERC7579Hook} from "../../interfaces/draft-IERC7579.sol"; + +abstract contract ERC7579HookMock is ERC7579ModuleMock(MODULE_TYPE_HOOK), IERC7579Hook { + event PreCheck(address sender, uint256 value, bytes data); + event PostCheck(bytes hookData); + + function preCheck( + address msgSender, + uint256 value, + bytes calldata msgData + ) external returns (bytes memory hookData) { + emit PreCheck(msgSender, value, msgData); + return msgData; + } + + function postCheck(bytes calldata hookData) external { + emit PostCheck(hookData); + } +} diff --git a/contracts/account/modules/ERC7579ModuleMock.sol b/contracts/account/modules/ERC7579ModuleMock.sol new file mode 100644 index 00000000000..f55ac34403d --- /dev/null +++ b/contracts/account/modules/ERC7579ModuleMock.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {IERC7579Module} from "../../interfaces/draft-IERC7579.sol"; + +abstract contract ERC7579ModuleMock is IERC7579Module { + uint256 private _moduleTypeId; + + event ModuleInstalledReceived(address account, bytes data); + event ModuleUninstalledReceived(address account, bytes data); + + constructor(uint256 moduleTypeId) { + _moduleTypeId = moduleTypeId; + } + + function onInstall(bytes calldata data) public virtual { + emit ModuleInstalledReceived(msg.sender, data); + } + + function onUninstall(bytes calldata data) public virtual { + emit ModuleUninstalledReceived(msg.sender, data); + } + + function isModuleType(uint256 moduleTypeId) external view returns (bool) { + return moduleTypeId == _moduleTypeId; + } +} diff --git a/contracts/account/modules/ERC7579ValidatorMock.sol b/contracts/account/modules/ERC7579ValidatorMock.sol new file mode 100644 index 00000000000..ef8691ac7de --- /dev/null +++ b/contracts/account/modules/ERC7579ValidatorMock.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {SignatureChecker} from "../../utils/cryptography/SignatureChecker.sol"; +import {IERC1271} from "../../interfaces/IERC1271.sol"; +import {PackedUserOperation} from "../../interfaces/draft-IERC4337.sol"; +import {IERC7579Module, IERC7579Validator, MODULE_TYPE_VALIDATOR} from "../../interfaces/draft-IERC7579.sol"; +import {ERC4337Utils} from "../../account/utils/draft-ERC4337Utils.sol"; +import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; + +abstract contract ERC7579ValidatorMock is ERC7579ModuleMock(MODULE_TYPE_VALIDATOR), IERC7579Validator { + mapping(address sender => address signer) private _associatedSigners; + + function onInstall(bytes calldata data) public virtual override(IERC7579Module, ERC7579ModuleMock) { + _associatedSigners[msg.sender] = address(bytes20(data[0:20])); + super.onInstall(data); + } + + function onUninstall(bytes calldata data) public virtual override(IERC7579Module, ERC7579ModuleMock) { + delete _associatedSigners[msg.sender]; + super.onUninstall(data); + } + + function validateUserOp( + PackedUserOperation calldata userOp, + bytes32 userOpHash + ) public view virtual returns (uint256) { + return + SignatureChecker.isValidSignatureNow(_associatedSigners[msg.sender], userOpHash, userOp.signature) + ? ERC4337Utils.SIG_VALIDATION_SUCCESS + : ERC4337Utils.SIG_VALIDATION_FAILED; + } + + function isValidSignatureWithSender( + address /*sender*/, + bytes32 hash, + bytes calldata signature + ) public view virtual returns (bytes4) { + return + SignatureChecker.isValidSignatureNow(_associatedSigners[msg.sender], hash, signature) + ? IERC1271.isValidSignature.selector + : bytes4(0xffffffff); + } +} diff --git a/contracts/mocks/CallReceiverMock.sol b/contracts/mocks/CallReceiverMock.sol index e371c7db800..8b5ec7adb0f 100644 --- a/contracts/mocks/CallReceiverMock.sol +++ b/contracts/mocks/CallReceiverMock.sol @@ -5,6 +5,7 @@ pragma solidity ^0.8.20; contract CallReceiverMock { event MockFunctionCalled(); event MockFunctionCalledWithArgs(uint256 a, uint256 b); + event MockFunctionCalledExtra(address caller, uint256 value); uint256[] private _array; @@ -58,6 +59,10 @@ contract CallReceiverMock { } return "0x1234"; } + + function mockFunctionExtra() public payable { + emit MockFunctionCalledExtra(msg.sender, msg.value); + } } contract CallReceiverMockTrustingForwarder is CallReceiverMock { diff --git a/contracts/mocks/account/AccountECDSAMock.sol b/contracts/mocks/account/AccountECDSAMock.sol new file mode 100644 index 00000000000..b822d5b3808 --- /dev/null +++ b/contracts/mocks/account/AccountECDSAMock.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {Account} from "../../account/Account.sol"; +import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; +import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; +import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; +import {ERC7821} from "../../account/extensions/ERC7821.sol"; +import {SignerECDSA} from "../../utils/cryptography/SignerECDSA.sol"; + +abstract contract AccountECDSAMock is Account, SignerECDSA, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { + constructor(address signerAddr) { + _setSigner(signerAddr); + } + + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} diff --git a/contracts/mocks/account/AccountERC7702Mock.sol b/contracts/mocks/account/AccountERC7702Mock.sol new file mode 100644 index 00000000000..c8602771ef8 --- /dev/null +++ b/contracts/mocks/account/AccountERC7702Mock.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {Account} from "../../account/Account.sol"; +import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; +import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; +import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; +import {ERC7821} from "../../account/extensions/ERC7821.sol"; +import {SignerERC7702} from "../../utils/cryptography/SignerERC7702.sol"; + +abstract contract AccountERC7702Mock is Account, SignerERC7702, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} diff --git a/contracts/mocks/account/AccountMock.sol b/contracts/mocks/account/AccountMock.sol new file mode 100644 index 00000000000..b21c4ee8f25 --- /dev/null +++ b/contracts/mocks/account/AccountMock.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {Account} from "../../account/Account.sol"; +import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; +import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; +import {ERC4337Utils} from "../../account/utils/draft-ERC4337Utils.sol"; +import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; +import {ERC7821} from "../../account/extensions/ERC7821.sol"; +import {PackedUserOperation} from "../../interfaces/draft-IERC4337.sol"; + +abstract contract AccountMock is Account, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { + /// Validates a user operation with a boolean signature. + function _rawSignatureValidation(bytes32 hash, bytes calldata signature) internal pure override returns (bool) { + return signature.length >= 32 && bytes32(signature) == hash; + } + + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} diff --git a/contracts/mocks/account/AccountP256Mock.sol b/contracts/mocks/account/AccountP256Mock.sol new file mode 100644 index 00000000000..5d2b3b3e2da --- /dev/null +++ b/contracts/mocks/account/AccountP256Mock.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {Account} from "../../account/Account.sol"; +import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; +import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; +import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; +import {ERC7821} from "../../account/extensions/ERC7821.sol"; +import {SignerP256} from "../../utils/cryptography/SignerP256.sol"; + +abstract contract AccountP256Mock is Account, SignerP256, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { + constructor(bytes32 qx, bytes32 qy) { + _setSigner(qx, qy); + } + + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} diff --git a/contracts/mocks/account/AccountRSAMock.sol b/contracts/mocks/account/AccountRSAMock.sol new file mode 100644 index 00000000000..7322789a12b --- /dev/null +++ b/contracts/mocks/account/AccountRSAMock.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {Account} from "../../account/Account.sol"; +import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; +import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; +import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; +import {ERC7821} from "../../account/extensions/ERC7821.sol"; +import {SignerRSA} from "../../utils/cryptography/SignerRSA.sol"; + +abstract contract AccountRSAMock is Account, SignerRSA, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { + constructor(bytes memory e, bytes memory n) { + _setSigner(e, n); + } + + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} diff --git a/contracts/utils/README.adoc b/contracts/utils/README.adoc index 74b26b236cc..2810a5772bf 100644 --- a/contracts/utils/README.adoc +++ b/contracts/utils/README.adoc @@ -46,6 +46,11 @@ Miscellaneous contracts and libraries containing utility functions you can use t * {Comparators}: A library that contains comparator functions to use with the {Heap} library. * {CAIP2}, {CAIP10}: Libraries for formatting and parsing CAIP-2 and CAIP-10 identifiers. * {Blockhash}: A library for accessing historical block hashes beyond the standard 256 block limit utilizing EIP-2935's historical blockhash functionality. + * {AbstractSigner}: Abstract contract for internal signature validation in smart contracts. + * {ERC7739}: An abstract contract to validate signatures following the rehashing scheme from `ERC7739Utils`. + * {ERC7739Utils}: Utilities library that implements a defensive rehashing mechanism to prevent replayability of smart contract signatures based on ERC-7739. + * {SignerECDSA}, {SignerP256}, {SignerRSA}: Implementations of an {AbstractSigner} with specific signature validation algorithms. + * {SignerERC7702}: Implementation of {AbstractSigner} that validates signatures using the contract's own address as the signer, useful for delegated accounts following EIP-7702. [NOTE] ==== @@ -78,6 +83,22 @@ Because Solidity does not support generic types, {EnumerableMap} and {Enumerable {{MerkleProof}} +{{ERC7739}} + +{{ERC7739Utils}} + +=== Abstract Signers + +{{AbstractSigner}} + +{{SignerECDSA}} + +{{SignerP256}} + +{{SignerERC7702}} + +{{SignerRSA}} + == Security {{ReentrancyGuard}} diff --git a/contracts/utils/cryptography/AbstractSigner.sol b/contracts/utils/cryptography/AbstractSigner.sol new file mode 100644 index 00000000000..6f109f39086 --- /dev/null +++ b/contracts/utils/cryptography/AbstractSigner.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +/** + * @dev Abstract contract for signature validation. + * + * Developers must implement {_rawSignatureValidation} and use it as the lowest-level signature validation mechanism. + */ +abstract contract AbstractSigner { + /** + * @dev Signature validation algorithm. + * + * WARNING: Implementing a signature validation algorithm is a security-sensitive operation as it involves + * cryptographic verification. It is important to review and test thoroughly before deployment. Consider + * using one of the signature verification libraries (https://docs.openzeppelin.com/contracts/api/utils#ECDSA[ECDSA], + * https://docs.openzeppelin.com/contracts/api/utils#P256[P256] or https://docs.openzeppelin.com/contracts/api/utils#RSA[RSA]). + */ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature) internal view virtual returns (bool); +} diff --git a/contracts/utils/cryptography/ERC7739.sol b/contracts/utils/cryptography/ERC7739.sol new file mode 100644 index 00000000000..555a1367040 --- /dev/null +++ b/contracts/utils/cryptography/ERC7739.sol @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {IERC1271} from "../../interfaces/IERC1271.sol"; +import {EIP712} from "../cryptography/EIP712.sol"; +import {MessageHashUtils} from "../cryptography/MessageHashUtils.sol"; +import {ShortStrings} from "../ShortStrings.sol"; +import {AbstractSigner} from "./AbstractSigner.sol"; +import {ERC7739Utils} from "./ERC7739Utils.sol"; + +/** + * @dev Validates signatures wrapping the message hash in a nested EIP712 type. See {ERC7739Utils}. + * + * Linking the signature to the EIP-712 domain separator is a security measure to prevent signature replay across different + * EIP-712 domains (e.g. a single offchain owner of multiple contracts). + * + * This contract requires implementing the {_rawSignatureValidation} function, which passes the wrapped message hash, + * which may be either an typed data or a personal sign nested type. + * + * NOTE: https://docs.openzeppelin.com/contracts/api/utils#EIP712[EIP-712] uses + * https://docs.openzeppelin.com/contracts/api/utils#ShortStrings[ShortStrings] to optimize gas costs for + * short strings (up to 31 characters). Consider that strings longer than that will use storage, which + * may limit the ability of the signer to be used within the ERC-4337 validation phase (due to + * https://eips.ethereum.org/EIPS/eip-7562#storage-rules[ERC-7562 storage access rules]). + */ +abstract contract ERC7739 is AbstractSigner, EIP712, IERC1271 { + using ERC7739Utils for *; + using MessageHashUtils for bytes32; + + /** + * @dev Attempts validating the signature in a nested EIP-712 type. + * + * A nested EIP-712 type might be presented in 2 different ways: + * + * - As a nested EIP-712 typed data + * - As a _personal_ signature (an EIP-712 mimic of the `eth_personalSign` for a smart contract) + */ + function isValidSignature(bytes32 hash, bytes calldata signature) public view virtual returns (bytes4 result) { + // For the hash `0x7739773977397739773977397739773977397739773977397739773977397739` and an empty signature, + // we return the magic value `0x77390001` as it's assumed impossible to find a preimage for it that can be used + // maliciously. Useful for simulation purposes and to validate whether the contract supports ERC-7739. + return + (_isValidNestedTypedDataSignature(hash, signature) || _isValidNestedPersonalSignSignature(hash, signature)) + ? IERC1271.isValidSignature.selector + : (hash == 0x7739773977397739773977397739773977397739773977397739773977397739 && signature.length == 0) + ? bytes4(0x77390001) + : bytes4(0xffffffff); + } + + /** + * @dev Nested personal signature verification. + */ + function _isValidNestedPersonalSignSignature(bytes32 hash, bytes calldata signature) private view returns (bool) { + return _rawSignatureValidation(_domainSeparatorV4().toTypedDataHash(hash.personalSignStructHash()), signature); + } + + /** + * @dev Nested EIP-712 typed data verification. + */ + function _isValidNestedTypedDataSignature( + bytes32 hash, + bytes calldata encodedSignature + ) private view returns (bool) { + // decode signature + ( + bytes calldata signature, + bytes32 appSeparator, + bytes32 contentsHash, + string calldata contentsDescr + ) = encodedSignature.decodeTypedDataSig(); + + ( + , + string memory name, + string memory version, + uint256 chainId, + address verifyingContract, + bytes32 salt, + + ) = eip712Domain(); + + // Check that contentHash and separator are correct + // Rebuild nested hash + return + hash == appSeparator.toTypedDataHash(contentsHash) && + bytes(contentsDescr).length != 0 && + _rawSignatureValidation( + appSeparator.toTypedDataHash( + ERC7739Utils.typedDataSignStructHash( + contentsDescr, + contentsHash, + abi.encode(keccak256(bytes(name)), keccak256(bytes(version)), chainId, verifyingContract, salt) + ) + ), + signature + ); + } +} diff --git a/contracts/utils/cryptography/ERC7739Utils.sol b/contracts/utils/cryptography/ERC7739Utils.sol new file mode 100644 index 00000000000..f4ed63b48fc --- /dev/null +++ b/contracts/utils/cryptography/ERC7739Utils.sol @@ -0,0 +1,207 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {Calldata} from "../Calldata.sol"; + +/** + * @dev Utilities to process https://ercs.ethereum.org/ERCS/erc-7739[ERC-7739] typed data signatures + * that are specific to an EIP-712 domain. + * + * This library provides methods to wrap, unwrap and operate over typed data signatures with a defensive + * rehashing mechanism that includes the application's + * https://docs.openzeppelin.com/contracts/api/utils#EIP712-_domainSeparatorV4[EIP-712] + * and preserves readability of the signed content using an EIP-712 nested approach. + * + * A smart contract domain can validate a signature for a typed data structure in two ways: + * + * - As an application validating a typed data signature. See {typedDataSignStructHash}. + * - As a smart contract validating a raw message signature. See {personalSignStructHash}. + * + * NOTE: A provider for a smart contract wallet would need to return this signature as the + * result of a call to `personal_sign` or `eth_signTypedData`, and this may be unsupported by + * API clients that expect a return value of 129 bytes, or specifically the `r,s,v` parameters + * of an https://docs.openzeppelin.com/contracts/api/utils#ECDSA[ECDSA] signature, as is for + * example specified for https://docs.openzeppelin.com/contracts/api/utils#EIP712[EIP-712]. + */ +library ERC7739Utils { + /** + * @dev An EIP-712 type to represent "personal" signatures + * (i.e. mimic of `personal_sign` for smart contracts). + */ + bytes32 private constant PERSONAL_SIGN_TYPEHASH = keccak256("PersonalSign(bytes prefixed)"); + + /** + * @dev Nest a signature for a given EIP-712 type into a nested signature for the domain of the app. + * + * Counterpart of {decodeTypedDataSig} to extract the original signature and the nested components. + */ + function encodeTypedDataSig( + bytes memory signature, + bytes32 appSeparator, + bytes32 contentsHash, + string memory contentsDescr + ) internal pure returns (bytes memory) { + return + abi.encodePacked(signature, appSeparator, contentsHash, contentsDescr, uint16(bytes(contentsDescr).length)); + } + + /** + * @dev Parses a nested signature into its components. + * + * Constructed as follows: + * + * `signature ‖ APP_DOMAIN_SEPARATOR ‖ contentsHash ‖ contentsDescr ‖ uint16(contentsDescr.length)` + * + * - `signature` is the signature for the (ERC-7739) nested struct hash. This signature indirectly signs over the + * original "contents" hash (from the app) and the account's domain separator. + * - `APP_DOMAIN_SEPARATOR` is the EIP-712 {EIP712-_domainSeparatorV4} of the application smart contract that is + * requesting the signature verification (though ERC-1271). + * - `contentsHash` is the hash of the underlying data structure or message. + * - `contentsDescr` is a descriptor of the "contents" part of the the EIP-712 type of the nested signature. + * + * NOTE: This function returns empty if the input format is invalid instead of reverting. + * data instead. + */ + function decodeTypedDataSig( + bytes calldata encodedSignature + ) + internal + pure + returns (bytes calldata signature, bytes32 appSeparator, bytes32 contentsHash, string calldata contentsDescr) + { + unchecked { + uint256 sigLength = encodedSignature.length; + + // 66 bytes = contentsDescrLength (2 bytes) + contentsHash (32 bytes) + APP_DOMAIN_SEPARATOR (32 bytes). + if (sigLength < 66) return (Calldata.emptyBytes(), 0, 0, Calldata.emptyString()); + + uint256 contentsDescrEnd = sigLength - 2; // Last 2 bytes + uint256 contentsDescrLength = uint16(bytes2(encodedSignature[contentsDescrEnd:])); + + // Check for space for `contentsDescr` in addition to the 66 bytes documented above + if (sigLength < 66 + contentsDescrLength) return (Calldata.emptyBytes(), 0, 0, Calldata.emptyString()); + + uint256 contentsHashEnd = contentsDescrEnd - contentsDescrLength; + uint256 separatorEnd = contentsHashEnd - 32; + uint256 signatureEnd = separatorEnd - 32; + + signature = encodedSignature[:signatureEnd]; + appSeparator = bytes32(encodedSignature[signatureEnd:separatorEnd]); + contentsHash = bytes32(encodedSignature[separatorEnd:contentsHashEnd]); + contentsDescr = string(encodedSignature[contentsHashEnd:contentsDescrEnd]); + } + } + + /** + * @dev Nests an `ERC-191` digest into a `PersonalSign` EIP-712 struct, and returns the corresponding struct hash. + * This struct hash must be combined with a domain separator, using {MessageHashUtils-toTypedDataHash} before + * being verified/recovered. + * + * This is used to simulates the `personal_sign` RPC method in the context of smart contracts. + */ + function personalSignStructHash(bytes32 contents) internal pure returns (bytes32) { + return keccak256(abi.encode(PERSONAL_SIGN_TYPEHASH, contents)); + } + + /** + * @dev Nests an `EIP-712` hash (`contents`) into a `TypedDataSign` EIP-712 struct, and returns the corresponding + * struct hash. This struct hash must be combined with a domain separator, using {MessageHashUtils-toTypedDataHash} + * before being verified/recovered. + */ + function typedDataSignStructHash( + string calldata contentsName, + string calldata contentsType, + bytes32 contentsHash, + bytes memory domainBytes + ) internal pure returns (bytes32 result) { + return + bytes(contentsName).length == 0 + ? bytes32(0) + : keccak256( + abi.encodePacked(typedDataSignTypehash(contentsName, contentsType), contentsHash, domainBytes) + ); + } + + /** + * @dev Variant of {typedDataSignStructHash-string-string-bytes32-bytes} that takes a content descriptor + * and decodes the `contentsName` and `contentsType` out of it. + */ + function typedDataSignStructHash( + string calldata contentsDescr, + bytes32 contentsHash, + bytes memory domainBytes + ) internal pure returns (bytes32 result) { + (string calldata contentsName, string calldata contentsType) = decodeContentsDescr(contentsDescr); + + return typedDataSignStructHash(contentsName, contentsType, contentsHash, domainBytes); + } + + /** + * @dev Compute the EIP-712 typehash of the `TypedDataSign` structure for a given type (and typename). + */ + function typedDataSignTypehash( + string calldata contentsName, + string calldata contentsType + ) internal pure returns (bytes32) { + return + keccak256( + abi.encodePacked( + "TypedDataSign(", + contentsName, + " contents,string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)", + contentsType + ) + ); + } + + /** + * @dev Parse the type name out of the ERC-7739 contents type description. Supports both the implicit and explicit + * modes. + * + * Following ERC-7739 specifications, a `contentsName` is considered invalid if it's empty or it contains + * any of the following bytes , )\x00 + * + * If the `contentsType` is invalid, this returns an empty string. Otherwise, the return string has non-zero + * length. + */ + function decodeContentsDescr( + string calldata contentsDescr + ) internal pure returns (string calldata contentsName, string calldata contentsType) { + bytes calldata buffer = bytes(contentsDescr); + if (buffer.length == 0) { + // pass through (fail) + } else if (buffer[buffer.length - 1] == bytes1(")")) { + // Implicit mode: read contentsName from the beginning, and keep the complete descr + for (uint256 i = 0; i < buffer.length; ++i) { + bytes1 current = buffer[i]; + if (current == bytes1("(")) { + // if name is empty - passthrough (fail) + if (i == 0) break; + // we found the end of the contentsName + return (string(buffer[:i]), contentsDescr); + } else if (_isForbiddenChar(current)) { + // we found an invalid character (forbidden) - passthrough (fail) + break; + } + } + } else { + // Explicit mode: read contentsName from the end, and remove it from the descr + for (uint256 i = buffer.length; i > 0; --i) { + bytes1 current = buffer[i - 1]; + if (current == bytes1(")")) { + // we found the end of the contentsName + return (string(buffer[i:]), string(buffer[:i])); + } else if (_isForbiddenChar(current)) { + // we found an invalid character (forbidden) - passthrough (fail) + break; + } + } + } + return (Calldata.emptyString(), Calldata.emptyString()); + } + + function _isForbiddenChar(bytes1 char) private pure returns (bool) { + return char == 0x00 || char == bytes1(" ") || char == bytes1(",") || char == bytes1("(") || char == bytes1(")"); + } +} diff --git a/contracts/utils/cryptography/SignerECDSA.sol b/contracts/utils/cryptography/SignerECDSA.sol new file mode 100644 index 00000000000..320940ecc61 --- /dev/null +++ b/contracts/utils/cryptography/SignerECDSA.sol @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {ECDSA} from "../cryptography/ECDSA.sol"; +import {AbstractSigner} from "./AbstractSigner.sol"; + +/** + * @dev Implementation of {AbstractSigner} using + * https://docs.openzeppelin.com/contracts/api/utils#ECDSA[ECDSA] signatures. + * + * For {Account} usage, a {_setSigner} function is provided to set the {signer} address. + * Doing so is easier for a factory, who is likely to use initializable clones of this contract. + * + * Example of usage: + * + * ```solidity + * contract MyAccountECDSA is Account, SignerECDSA, Initializable { + * function initialize(address signerAddr) public initializer { + * _setSigner(signerAddr); + * } + * } + * ``` + * + * IMPORTANT: Failing to call {_setSigner} either during construction (if used standalone) + * or during initialization (if used as a clone) may leave the signer either front-runnable or unusable. + */ +abstract contract SignerECDSA is AbstractSigner { + address private _signer; + + /** + * @dev Sets the signer with the address of the native signer. This function should be called during construction + * or through an initializer. + */ + function _setSigner(address signerAddr) internal { + _signer = signerAddr; + } + + /// @dev Return the signer's address. + function signer() public view virtual returns (address) { + return _signer; + } + + /// @inheritdoc AbstractSigner + function _rawSignatureValidation( + bytes32 hash, + bytes calldata signature + ) internal view virtual override returns (bool) { + (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature); + return signer() == recovered && err == ECDSA.RecoverError.NoError; + } +} diff --git a/contracts/utils/cryptography/SignerERC7702.sol b/contracts/utils/cryptography/SignerERC7702.sol new file mode 100644 index 00000000000..b413decbf59 --- /dev/null +++ b/contracts/utils/cryptography/SignerERC7702.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {ECDSA} from "./ECDSA.sol"; +import {AbstractSigner} from "./AbstractSigner.sol"; + +/** + * @dev Implementation of {AbstractSigner} for implementation for an EOA. Useful for ERC-7702 accounts. + */ +abstract contract SignerERC7702 is AbstractSigner { + /** + * @dev Validates the signature using the EOA's address (i.e. `address(this)`). + */ + function _rawSignatureValidation( + bytes32 hash, + bytes calldata signature + ) internal view virtual override returns (bool) { + (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature); + return address(this) == recovered && err == ECDSA.RecoverError.NoError; + } +} diff --git a/contracts/utils/cryptography/SignerP256.sol b/contracts/utils/cryptography/SignerP256.sol new file mode 100644 index 00000000000..591c9996ffb --- /dev/null +++ b/contracts/utils/cryptography/SignerP256.sol @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {P256} from "./P256.sol"; +import {AbstractSigner} from "./AbstractSigner.sol"; + +/** + * @dev Implementation of {AbstractSigner} using + * https://docs.openzeppelin.com/contracts/api/utils#P256[P256] signatures. + * + * For {Account} usage, a {_setSigner} function is provided to set the {signer} public key. + * Doing so is easier for a factory, who is likely to use initializable clones of this contract. + * + * Example of usage: + * + * ```solidity + * contract MyAccountP256 is Account, SignerP256, Initializable { + * function initialize(bytes32 qx, bytes32 qy) public initializer { + * _setSigner(qx, qy); + * } + * } + * ``` + * + * IMPORTANT: Failing to call {_setSigner} either during construction (if used standalone) + * or during initialization (if used as a clone) may leave the signer either front-runnable or unusable. + */ +abstract contract SignerP256 is AbstractSigner { + bytes32 private _qx; + bytes32 private _qy; + + error SignerP256InvalidPublicKey(bytes32 qx, bytes32 qy); + + /** + * @dev Sets the signer with a P256 public key. This function should be called during construction + * or through an initializer. + */ + function _setSigner(bytes32 qx, bytes32 qy) internal { + if (!P256.isValidPublicKey(qx, qy)) revert SignerP256InvalidPublicKey(qx, qy); + _qx = qx; + _qy = qy; + } + + /// @dev Return the signer's P256 public key. + function signer() public view virtual returns (bytes32 qx, bytes32 qy) { + return (_qx, _qy); + } + + /// @inheritdoc AbstractSigner + function _rawSignatureValidation( + bytes32 hash, + bytes calldata signature + ) internal view virtual override returns (bool) { + if (signature.length < 0x40) return false; + bytes32 r = bytes32(signature[0x00:0x20]); + bytes32 s = bytes32(signature[0x20:0x40]); + (bytes32 qx, bytes32 qy) = signer(); + return P256.verify(hash, r, s, qx, qy); + } +} diff --git a/contracts/utils/cryptography/SignerRSA.sol b/contracts/utils/cryptography/SignerRSA.sol new file mode 100644 index 00000000000..d8182156f3d --- /dev/null +++ b/contracts/utils/cryptography/SignerRSA.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {RSA} from "./RSA.sol"; +import {AbstractSigner} from "./AbstractSigner.sol"; + +/** + * @dev Implementation of {AbstractSigner} using + * https://docs.openzeppelin.com/contracts/api/utils#RSA[RSA] signatures. + * + * For {Account} usage, a {_setSigner} function is provided to set the {signer} public key. + * Doing so is easier for a factory, who is likely to use initializable clones of this contract. + * + * Example of usage: + * + * ```solidity + * contract MyAccountRSA is Account, SignerRSA, Initializable { + * function initialize(bytes memory e, bytes memory n) public initializer { + * _setSigner(e, n); + * } + * } + * ``` + * + * IMPORTANT: Failing to call {_setSigner} either during construction (if used standalone) + * or during initialization (if used as a clone) may leave the signer either front-runnable or unusable. + */ +abstract contract SignerRSA is AbstractSigner { + bytes private _e; + bytes private _n; + + /** + * @dev Sets the signer with a RSA public key. This function should be called during construction + * or through an initializer. + */ + function _setSigner(bytes memory e, bytes memory n) internal { + _e = e; + _n = n; + } + + /// @dev Return the signer's RSA public key. + function signer() public view virtual returns (bytes memory e, bytes memory n) { + return (_e, _n); + } + + /** + * @dev See {AbstractSigner-_rawSignatureValidation}. Verifies a PKCSv1.5 signature by calling + * xref:api:utils.adoc#RSA-pkcs1Sha256-bytes-bytes-bytes-bytes-[RSA.pkcs1Sha256]. + * + * IMPORTANT: Following the RSASSA-PKCS1-V1_5-VERIFY procedure outlined in RFC8017 (section 8.2.2), the + * provided `hash` is used as the `M` (message) and rehashed using SHA256 according to EMSA-PKCS1-v1_5 + * encoding as per section 9.2 (step 1) of the RFC. + */ + function _rawSignatureValidation( + bytes32 hash, + bytes calldata signature + ) internal view virtual override returns (bool) { + (bytes memory e, bytes memory n) = signer(); + return RSA.pkcs1Sha256(abi.encodePacked(hash), signature, e, n); + } +} diff --git a/foundry.toml b/foundry.toml index 7a2e8a60942..ea8b1fadd88 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,5 +1,5 @@ [profile.default] -solc_version = '0.8.24' +solc_version = '0.8.27' evm_version = 'prague' optimizer = true optimizer-runs = 200 diff --git a/package.json b/package.json index 80b1543a29f..423e1a5a9c7 100644 --- a/package.json +++ b/package.json @@ -66,11 +66,11 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.4", + "ethers": "^6.13.6-beta.1", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", - "hardhat": "^2.22.7", + "hardhat": "^2.23.0", "hardhat-exposed": "^0.3.15", "hardhat-gas-reporter": "^2.1.0", "hardhat-ignore-warnings": "^0.2.11", diff --git a/test/account/Account.behavior.js b/test/account/Account.behavior.js new file mode 100644 index 00000000000..f5648d0de37 --- /dev/null +++ b/test/account/Account.behavior.js @@ -0,0 +1,149 @@ +const { ethers, entrypoint } = require('hardhat'); +const { expect } = require('chai'); +const { impersonate } = require('../helpers/account'); +const { SIG_VALIDATION_SUCCESS, SIG_VALIDATION_FAILURE } = require('../helpers/erc4337'); +const { + shouldSupportInterfaces, +} = require('../utils/introspection/SupportsInterface.behavior'); + +function shouldBehaveLikeAccountCore() { + describe('entryPoint', function () { + it('should return the canonical entrypoint', async function () { + await this.mock.deploy(); + await expect(this.mock.entryPoint()).to.eventually.equal(entrypoint.v08); + }); + }); + + describe('validateUserOp', function () { + beforeEach(async function () { + await this.other.sendTransaction({ to: this.mock.target, value: ethers.parseEther('1') }); + await this.mock.deploy(); + this.userOp ??= {}; + }); + + it('should revert if the caller is not the canonical entrypoint', async function () { + // empty operation (does nothing) + const operation = await this.mock.createUserOp(this.userOp).then(op => this.signUserOp(op)); + + await expect(this.mock.connect(this.other).validateUserOp(operation.packed, operation.hash(), 0)) + .to.be.revertedWithCustomError(this.mock, 'AccountUnauthorized') + .withArgs(this.other); + }); + + describe('when the caller is the canonical entrypoint', function () { + beforeEach(async function () { + this.mockFromEntrypoint = this.mock.connect(await impersonate(entrypoint.v08.target)); + }); + + it('should return SIG_VALIDATION_SUCCESS if the signature is valid', async function () { + // empty operation (does nothing) + const operation = await this.mock.createUserOp(this.userOp).then(op => this.signUserOp(op)); + + expect(await this.mockFromEntrypoint.validateUserOp.staticCall(operation.packed, operation.hash(), 0)).to.eq( + SIG_VALIDATION_SUCCESS, + ); + }); + + it('should return SIG_VALIDATION_FAILURE if the signature is invalid', async function () { + // empty operation (does nothing) + const operation = await this.mock.createUserOp(this.userOp); + operation.signature = (await this.invalidSig?.()) ?? '0x00'; + + expect(await this.mockFromEntrypoint.validateUserOp.staticCall(operation.packed, operation.hash(), 0)).to.eq( + SIG_VALIDATION_FAILURE, + ); + }); + + it('should pay missing account funds for execution', async function () { + // empty operation (does nothing) + const operation = await this.mock.createUserOp(this.userOp).then(op => this.signUserOp(op)); + const value = 42n; + + await expect( + this.mockFromEntrypoint.validateUserOp(operation.packed, operation.hash(), value), + ).to.changeEtherBalances([this.mock, entrypoint.v08], [-value, value]); + }); + }); + }); + + describe('fallback', function () { + it('should receive ether', async function () { + await this.mock.deploy(); + const value = 42n; + + await expect(this.other.sendTransaction({ to: this.mock, value })).to.changeEtherBalances( + [this.other, this.mock], + [-value, value], + ); + }); + }); +} + +function shouldBehaveLikeAccountHolder() { + describe('onReceived', function () { + beforeEach(async function () { + await this.mock.deploy(); + }); + + shouldSupportInterfaces(['ERC1155Receiver']); + + describe('onERC1155Received', function () { + const ids = [1n, 2n, 3n]; + const values = [1000n, 2000n, 3000n]; + const data = '0x12345678'; + + beforeEach(async function () { + this.token = await ethers.deployContract('$ERC1155', ['https://somedomain.com/{id}.json']); + await this.token.$_mintBatch(this.other, ids, values, '0x'); + }); + + it('receives ERC1155 tokens from a single ID', async function () { + await this.token.connect(this.other).safeTransferFrom(this.other, this.mock, ids[0], values[0], data); + + await expect( + this.token.balanceOfBatch( + ids.map(() => this.mock), + ids, + ), + ).to.eventually.deep.equal(values.map((v, i) => (i == 0 ? v : 0n))); + }); + + it('receives ERC1155 tokens from a multiple IDs', async function () { + await expect( + this.token.balanceOfBatch( + ids.map(() => this.mock), + ids, + ), + ).to.eventually.deep.equal(ids.map(() => 0n)); + + await this.token.connect(this.other).safeBatchTransferFrom(this.other, this.mock, ids, values, data); + await expect( + this.token.balanceOfBatch( + ids.map(() => this.mock), + ids, + ), + ).to.eventually.deep.equal(values); + }); + }); + + describe('onERC721Received', function () { + const tokenId = 1n; + + beforeEach(async function () { + this.token = await ethers.deployContract('$ERC721', ['Some NFT', 'SNFT']); + await this.token.$_mint(this.other, tokenId); + }); + + it('receives an ERC721 token', async function () { + await this.token.connect(this.other).safeTransferFrom(this.other, this.mock, tokenId); + + await expect(this.token.ownerOf(tokenId)).to.eventually.equal(this.mock); + }); + }); + }); +} + +module.exports = { + shouldBehaveLikeAccountCore, + shouldBehaveLikeAccountHolder, +}; diff --git a/test/account/Account.test.js b/test/account/Account.test.js new file mode 100644 index 00000000000..2ccb81ff72f --- /dev/null +++ b/test/account/Account.test.js @@ -0,0 +1,48 @@ +const { ethers, entrypoint } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { getDomain } = require('../helpers/eip712'); +const { ERC4337Helper } = require('../helpers/erc4337'); +const { PackedUserOperation } = require('../helpers/eip712-types'); +const { NonNativeSigner } = require('../helpers/signers'); + +const { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder } = require('./Account.behavior'); +const { shouldBehaveLikeERC1271 } = require('../utils/cryptography/ERC1271.behavior'); +const { shouldBehaveLikeERC7821 } = require('./extensions/ERC7821.behavior'); + +async function fixture() { + // EOAs and environment + const [beneficiary, other] = await ethers.getSigners(); + const target = await ethers.deployContract('CallReceiverMock'); + + // ERC-4337 signer + const signer = new NonNativeSigner({ sign: hash => ({ serialized: hash }) }); + + // ERC-4337 account + const helper = new ERC4337Helper(); + const mock = await helper.newAccount('$AccountMock', ['Account', '1']); + + // ERC-4337 Entrypoint domain + const entrypointDomain = await getDomain(entrypoint.v08); + + // domain cannot be fetched using getDomain(mock) before the mock is deployed + const domain = { name: 'Account', version: '1', chainId: entrypointDomain.chainId, verifyingContract: mock.address }; + + const signUserOp = async userOp => + signer + .signTypedData(entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + + return { helper, mock, domain, signer, target, beneficiary, other, signUserOp }; +} + +describe('Account', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); +}); diff --git a/test/account/AccountECDSA.test.js b/test/account/AccountECDSA.test.js new file mode 100644 index 00000000000..d85cc7137f7 --- /dev/null +++ b/test/account/AccountECDSA.test.js @@ -0,0 +1,52 @@ +const { ethers, entrypoint } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { getDomain } = require('../helpers/eip712'); +const { ERC4337Helper } = require('../helpers/erc4337'); +const { PackedUserOperation } = require('../helpers/eip712-types'); + +const { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder } = require('./Account.behavior'); +const { shouldBehaveLikeERC1271 } = require('../utils/cryptography/ERC1271.behavior'); +const { shouldBehaveLikeERC7821 } = require('./extensions/ERC7821.behavior'); + +async function fixture() { + // EOAs and environment + const [beneficiary, other] = await ethers.getSigners(); + const target = await ethers.deployContract('CallReceiverMock'); + + // ERC-4337 signer + const signer = ethers.Wallet.createRandom(); + + // ERC-4337 account + const helper = new ERC4337Helper(); + const mock = await helper.newAccount('$AccountECDSAMock', ['AccountECDSA', '1', signer]); + + // ERC-4337 Entrypoint domain + const entrypointDomain = await getDomain(entrypoint.v08); + + // domain cannot be fetched using getDomain(mock) before the mock is deployed + const domain = { + name: 'AccountECDSA', + version: '1', + chainId: entrypointDomain.chainId, + verifyingContract: mock.address, + }; + + const signUserOp = userOp => + signer + .signTypedData(entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + + return { helper, mock, domain, signer, target, beneficiary, other, signUserOp }; +} + +describe('AccountECDSA', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); +}); diff --git a/test/account/AccountERC7702.t.sol b/test/account/AccountERC7702.t.sol new file mode 100644 index 00000000000..1aac3427716 --- /dev/null +++ b/test/account/AccountERC7702.t.sol @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {Test} from "forge-std/Test.sol"; +import {AccountERC7702Mock} from "@openzeppelin/contracts/mocks/account/AccountERC7702Mock.sol"; +import {CallReceiverMock} from "@openzeppelin/contracts/mocks/CallReceiverMock.sol"; +import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; +import {ERC7579Utils, Execution, Mode, ModeSelector, ModePayload} from "@openzeppelin/contracts/account/utils/draft-ERC7579Utils.sol"; +import {ERC4337Utils, IEntryPointExtra} from "@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol"; +import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; +import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol"; +import {ERC7821} from "@openzeppelin/contracts/account/extensions/ERC7821.sol"; + +contract AccountERC7702MockConstructor is AccountERC7702Mock { + constructor() EIP712("MyAccount", "1") {} +} + +contract AccountERC7702Test is Test { + using ERC7579Utils for *; + using ERC4337Utils for PackedUserOperation; + using Strings for *; + + uint256 private constant MAX_ETH = type(uint128).max; + + // Test accounts + CallReceiverMock private _target; + + // ERC-4337 signer + uint256 private _signerPrivateKey; + AccountERC7702MockConstructor private _signer; + + function setUp() public { + // Deploy target contract + _target = new CallReceiverMock(); + + // Setup signer + _signerPrivateKey = 0x1234; + _signer = AccountERC7702MockConstructor(payable(vm.addr(_signerPrivateKey))); + vm.deal(address(_signer), MAX_ETH); + + // Sign and attach delegation + vm.signAndAttachDelegation(address(new AccountERC7702MockConstructor()), _signerPrivateKey); + + // Setup entrypoint + vm.deal(address(ERC4337Utils.ENTRYPOINT_V08), MAX_ETH); + vm.etch( + address(ERC4337Utils.ENTRYPOINT_V08), + vm.readFileBinary("./lib/@openzeppelin-contracts/test/bin/EntryPoint070.bytecode") + ); + } + + function testExecuteBatch(uint256 argA, uint256 argB) public { + // Create the mode for batch execution + Mode mode = ERC7579Utils.CALLTYPE_BATCH.encodeMode( + ERC7579Utils.EXECTYPE_DEFAULT, + ModeSelector.wrap(0x00000000), + ModePayload.wrap(0x00000000) + ); + + Execution[] memory execution = new Execution[](2); + execution[0] = Execution({ + target: address(_target), + value: 1 ether, + callData: abi.encodeCall(CallReceiverMock.mockFunctionExtra, ()) + }); + execution[1] = Execution({ + target: address(_target), + value: 0, + callData: abi.encodeCall(CallReceiverMock.mockFunctionWithArgs, (argA, argB)) + }); + + // Pack the batch within a PackedUserOperation + PackedUserOperation[] memory ops = new PackedUserOperation[](1); + ops[0] = PackedUserOperation({ + sender: address(_signer), + nonce: 0, + initCode: bytes(""), + callData: abi.encodeCall(ERC7821.execute, (Mode.unwrap(mode), execution.encodeBatch())), + preVerificationGas: 100000, + accountGasLimits: bytes32(abi.encodePacked(uint128(100000), uint128(100000))), + gasFees: bytes32(abi.encodePacked(uint128(1000000), uint128(1000000))), + paymasterAndData: bytes(""), + signature: bytes("") + }); + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + _signerPrivateKey, + IEntryPointExtra(address(ERC4337Utils.ENTRYPOINT_V08)).getUserOpHash(ops[0]) + ); + ops[0].signature = abi.encodePacked(r, s, v); + + // Expect the events to be emitted + vm.expectEmit(true, true, true, true); + emit CallReceiverMock.MockFunctionCalledExtra(address(_signer), 1 ether); + vm.expectEmit(true, true, true, true); + emit CallReceiverMock.MockFunctionCalledWithArgs(argA, argB); + + // Execute the batch + _signer.entryPoint().handleOps(ops, payable(makeAddr("beneficiary"))); + } +} diff --git a/test/account/AccountERC7702.test.js b/test/account/AccountERC7702.test.js new file mode 100644 index 00000000000..d08a522095f --- /dev/null +++ b/test/account/AccountERC7702.test.js @@ -0,0 +1,52 @@ +const { ethers, entrypoint } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { getDomain } = require('../helpers/eip712'); +const { ERC4337Helper } = require('../helpers/erc4337'); +const { PackedUserOperation } = require('../helpers/eip712-types'); + +const { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder } = require('./Account.behavior'); +const { shouldBehaveLikeERC1271 } = require('../utils/cryptography/ERC1271.behavior'); +const { shouldBehaveLikeERC7821 } = require('./extensions/ERC7821.behavior'); + +async function fixture() { + // EOAs and environment + const [beneficiary, other] = await ethers.getSigners(); + const target = await ethers.deployContract('CallReceiverMock'); + + // ERC-4337 signer + const signer = ethers.Wallet.createRandom(ethers.provider); + + // ERC-4337 account + const helper = new ERC4337Helper(); + const mock = await helper.newAccount('$AccountERC7702Mock', ['AccountERC7702Mock', '1'], { erc7702signer: signer }); + + // ERC-4337 Entrypoint domain + const entrypointDomain = await getDomain(entrypoint.v08); + + // domain cannot be fetched using getDomain(mock) before the mock is deployed + const domain = { + name: 'AccountERC7702Mock', + version: '1', + chainId: entrypointDomain.chainId, + verifyingContract: mock.address, + }; + + const signUserOp = userOp => + signer + .signTypedData(entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + + return { helper, mock, domain, signer, target, beneficiary, other, signUserOp }; +} + +describe('AccountERC7702', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821({ deployable: false }); +}); diff --git a/test/account/AccountP256.test.js b/test/account/AccountP256.test.js new file mode 100644 index 00000000000..a4f7759db2e --- /dev/null +++ b/test/account/AccountP256.test.js @@ -0,0 +1,58 @@ +const { ethers, entrypoint } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { getDomain } = require('../helpers/eip712'); +const { ERC4337Helper } = require('../helpers/erc4337'); +const { NonNativeSigner, P256SigningKey } = require('../helpers/signers'); +const { PackedUserOperation } = require('../helpers/eip712-types'); + +const { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder } = require('./Account.behavior'); +const { shouldBehaveLikeERC1271 } = require('../utils/cryptography/ERC1271.behavior'); +const { shouldBehaveLikeERC7821 } = require('./extensions/ERC7821.behavior'); + +async function fixture() { + // EOAs and environment + const [beneficiary, other] = await ethers.getSigners(); + const target = await ethers.deployContract('CallReceiverMock'); + + // ERC-4337 signer + const signer = new NonNativeSigner(P256SigningKey.random()); + + // ERC-4337 account + const helper = new ERC4337Helper(); + const mock = await helper.newAccount('$AccountP256Mock', [ + 'AccountP256', + '1', + signer.signingKey.publicKey.qx, + signer.signingKey.publicKey.qy, + ]); + + // ERC-4337 Entrypoint domain + const entrypointDomain = await getDomain(entrypoint.v08); + + // domain cannot be fetched using getDomain(mock) before the mock is deployed + const domain = { + name: 'AccountP256', + version: '1', + chainId: entrypointDomain.chainId, + verifyingContract: mock.address, + }; + + const signUserOp = userOp => + signer + .signTypedData(entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + + return { helper, mock, domain, signer, target, beneficiary, other, signUserOp }; +} + +describe('AccountP256', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); +}); diff --git a/test/account/AccountRSA.test.js b/test/account/AccountRSA.test.js new file mode 100644 index 00000000000..b8cad78025a --- /dev/null +++ b/test/account/AccountRSA.test.js @@ -0,0 +1,58 @@ +const { ethers, entrypoint } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { getDomain } = require('../helpers/eip712'); +const { ERC4337Helper } = require('../helpers/erc4337'); +const { NonNativeSigner, RSASHA256SigningKey } = require('../helpers/signers'); +const { PackedUserOperation } = require('../helpers/eip712-types'); + +const { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder } = require('./Account.behavior'); +const { shouldBehaveLikeERC1271 } = require('../utils/cryptography/ERC1271.behavior'); +const { shouldBehaveLikeERC7821 } = require('./extensions/ERC7821.behavior'); + +async function fixture() { + // EOAs and environment + const [beneficiary, other] = await ethers.getSigners(); + const target = await ethers.deployContract('CallReceiverMock'); + + // ERC-4337 signer + const signer = new NonNativeSigner(RSASHA256SigningKey.random()); + + // ERC-4337 account + const helper = new ERC4337Helper(); + const mock = await helper.newAccount('$AccountRSAMock', [ + 'AccountRSA', + '1', + signer.signingKey.publicKey.e, + signer.signingKey.publicKey.n, + ]); + + // ERC-4337 Entrypoint domain + const entrypointDomain = await getDomain(entrypoint.v08); + + // domain cannot be fetched using getDomain(mock) before the mock is deployed + const domain = { + name: 'AccountRSA', + version: '1', + chainId: entrypointDomain.chainId, + verifyingContract: mock.address, + }; + + const signUserOp = userOp => + signer + .signTypedData(entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + + return { helper, mock, domain, signer, target, beneficiary, other, signUserOp }; +} + +describe('AccountRSA', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); +}); diff --git a/test/account/examples/AccountERC7702WithModulesMock.test.js b/test/account/examples/AccountERC7702WithModulesMock.test.js new file mode 100644 index 00000000000..9ee5f917738 --- /dev/null +++ b/test/account/examples/AccountERC7702WithModulesMock.test.js @@ -0,0 +1,99 @@ +const { ethers, entrypoint } = require('hardhat'); +const { loadFixture, setBalance } = require('@nomicfoundation/hardhat-network-helpers'); + +const { getDomain } = require('../../helpers/eip712'); +const { ERC4337Helper } = require('../../helpers/erc4337'); +const { PackedUserOperation } = require('../../helpers/eip712-types'); + +const { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder } = require('../Account.behavior'); +const { shouldBehaveLikeAccountERC7579 } = require('../extensions/AccountERC7579.behavior'); +const { shouldBehaveLikeERC1271 } = require('../../utils/cryptography/ERC1271.behavior'); +const { shouldBehaveLikeERC7821 } = require('../extensions/ERC7821.behavior'); + +const { MODULE_TYPE_VALIDATOR } = require('../../helpers/erc7579'); + +async function fixture() { + // EOAs and environment + const [beneficiary, other] = await ethers.getSigners(); + const target = await ethers.deployContract('CallReceiverMock'); + const anotherTarget = await ethers.deployContract('CallReceiverMock'); + + // Signer with EIP-7702 support + funding + const eoa = ethers.Wallet.createRandom(ethers.provider); + await setBalance(eoa.address, ethers.WeiPerEther); + + // ERC-7579 validator module + const validator = await ethers.deployContract('$ERC7579ValidatorMock'); + + // ERC-4337 account + const helper = new ERC4337Helper(); + const mock = await helper.newAccount('$AccountERC7702WithModulesMock', ['AccountERC7702WithModulesMock', '1'], { + erc7702signer: eoa, + }); + + // ERC-4337 Entrypoint domain + const entrypointDomain = await getDomain(entrypoint.v08); + + // domain cannot be fetched using getDomain(mock) before the mock is deployed + const domain = { + name: 'AccountERC7702WithModulesMock', + version: '1', + chainId: entrypointDomain.chainId, + verifyingContract: mock.address, + }; + + return { helper, validator, mock, domain, entrypointDomain, eoa, target, anotherTarget, beneficiary, other }; +} + +describe('AccountERC7702WithModules: ERC-7702 account with ERC-7579 modules supports', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + describe('using ERC-7702 signer', function () { + beforeEach(async function () { + this.signer = this.eoa; + this.signUserOp = userOp => + this.signer + .signTypedData(this.entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC7821({ deployable: false }); + shouldBehaveLikeERC1271({ erc7739: true }); + }); + + describe('using ERC-7579 validator', function () { + beforeEach(async function () { + // signer that adds a prefix to all signatures (except the userOp ones) + this.signer = ethers.Wallet.createRandom(); + this.signer.signMessage = message => + ethers.Wallet.prototype.signMessage + .bind(this.signer)(message) + .then(sign => ethers.concat([this.validator.target, sign])); + this.signer.signTypedData = (domain, types, values) => + ethers.Wallet.prototype.signTypedData + .bind(this.signer)(domain, types, values) + .then(sign => ethers.concat([this.validator.target, sign])); + + this.signUserOp = userOp => + ethers.Wallet.prototype.signTypedData + .bind(this.signer)(this.entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + + // Use the first 20 bytes from the nonce key (24 bytes) to identify the validator module + this.userOp = { nonce: ethers.zeroPadBytes(ethers.hexlify(this.validator.target), 32) }; + + // Deploy (using ERC-7702) and add the validator module using EOA + await this.mock.deploy(); + await this.mock.connect(this.eoa).installModule(MODULE_TYPE_VALIDATOR, this.validator, this.signer.address); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeAccountERC7579(); + shouldBehaveLikeERC1271({ erc7739: false }); + }); +}); diff --git a/test/account/extensions/AccountERC7579.behavior.js b/test/account/extensions/AccountERC7579.behavior.js new file mode 100644 index 00000000000..1b702fc7727 --- /dev/null +++ b/test/account/extensions/AccountERC7579.behavior.js @@ -0,0 +1,563 @@ +const { ethers, entrypoint } = require('hardhat'); +const { expect } = require('chai'); +const { impersonate } = require('../../helpers/account'); +const { selector } = require('../../helpers/methods'); +const { zip } = require('../../helpers/iterate'); +const { + encodeMode, + encodeBatch, + encodeSingle, + encodeDelegate, + MODULE_TYPE_VALIDATOR, + MODULE_TYPE_EXECUTOR, + MODULE_TYPE_FALLBACK, + MODULE_TYPE_HOOK, + CALL_TYPE_CALL, + CALL_TYPE_BATCH, + CALL_TYPE_DELEGATE, + EXEC_TYPE_DEFAULT, + EXEC_TYPE_TRY, +} = require('../../helpers/erc7579'); + +const CALL_TYPE_INVALID = '0x42'; +const EXEC_TYPE_INVALID = '0x17'; +const MODULE_TYPE_INVALID = 999n; + +const coder = ethers.AbiCoder.defaultAbiCoder(); + +function shouldBehaveLikeAccountERC7579({ withHooks = false } = {}) { + describe('AccountERC7579', function () { + beforeEach(async function () { + await this.mock.deploy(); + await this.other.sendTransaction({ to: this.mock.target, value: ethers.parseEther('1') }); + + this.modules = {}; + this.modules[MODULE_TYPE_VALIDATOR] = await ethers.deployContract('$ERC7579ModuleMock', [MODULE_TYPE_VALIDATOR]); + this.modules[MODULE_TYPE_EXECUTOR] = await ethers.deployContract('$ERC7579ModuleMock', [MODULE_TYPE_EXECUTOR]); + this.modules[MODULE_TYPE_FALLBACK] = await ethers.deployContract('$ERC7579ModuleMock', [MODULE_TYPE_FALLBACK]); + this.modules[MODULE_TYPE_HOOK] = await ethers.deployContract('$ERC7579HookMock'); + + this.mockFromEntrypoint = this.mock.connect(await impersonate(entrypoint.v08.target)); + this.mockFromExecutor = this.mock.connect(await impersonate(this.modules[MODULE_TYPE_EXECUTOR].target)); + }); + + describe('accountId', function () { + it('should return the account ID', async function () { + await expect(this.mock.accountId()).to.eventually.equal( + withHooks + ? '@openzeppelin/community-contracts.AccountERC7579Hooked.v0.0.0' + : '@openzeppelin/community-contracts.AccountERC7579.v0.0.0', + ); + }); + }); + + describe('supportsExecutionMode', function () { + for (const [callType, execType] of zip( + [CALL_TYPE_CALL, CALL_TYPE_BATCH, CALL_TYPE_DELEGATE, CALL_TYPE_INVALID], + [EXEC_TYPE_DEFAULT, EXEC_TYPE_TRY, EXEC_TYPE_INVALID], + )) { + const result = callType != CALL_TYPE_INVALID && execType != EXEC_TYPE_INVALID; + + it(`${ + result ? 'does not support' : 'supports' + } CALL_TYPE=${callType} and EXEC_TYPE=${execType} execution mode`, async function () { + await expect(this.mock.supportsExecutionMode(encodeMode({ callType, execType }))).to.eventually.equal(result); + }); + } + }); + + describe('supportsModule', function () { + it('supports MODULE_TYPE_VALIDATOR module type', async function () { + await expect(this.mock.supportsModule(MODULE_TYPE_VALIDATOR)).to.eventually.equal(true); + }); + + it('supports MODULE_TYPE_EXECUTOR module type', async function () { + await expect(this.mock.supportsModule(MODULE_TYPE_EXECUTOR)).to.eventually.equal(true); + }); + + it('supports MODULE_TYPE_FALLBACK module type', async function () { + await expect(this.mock.supportsModule(MODULE_TYPE_FALLBACK)).to.eventually.equal(true); + }); + + it( + withHooks ? 'supports MODULE_TYPE_HOOK module type' : 'does not support MODULE_TYPE_HOOK module type', + async function () { + await expect(this.mock.supportsModule(MODULE_TYPE_HOOK)).to.eventually.equal(withHooks); + }, + ); + + it('does not support invalid module type', async function () { + await expect(this.mock.supportsModule(MODULE_TYPE_INVALID)).to.eventually.equal(false); + }); + }); + + describe('module installation', function () { + it('should revert if the caller is not the canonical entrypoint or the account itself', async function () { + await expect(this.mock.connect(this.other).installModule(MODULE_TYPE_VALIDATOR, this.mock, '0x')) + .to.be.revertedWithCustomError(this.mock, 'AccountUnauthorized') + .withArgs(this.other); + }); + + it('should revert if the module type is not supported', async function () { + await expect(this.mockFromEntrypoint.installModule(MODULE_TYPE_INVALID, this.mock, '0x')) + .to.be.revertedWithCustomError(this.mock, 'ERC7579UnsupportedModuleType') + .withArgs(MODULE_TYPE_INVALID); + }); + + it('should revert if the module is not the provided type', async function () { + const instance = this.modules[MODULE_TYPE_EXECUTOR]; + await expect(this.mockFromEntrypoint.installModule(MODULE_TYPE_VALIDATOR, instance, '0x')) + .to.be.revertedWithCustomError(this.mock, 'ERC7579MismatchedModuleTypeId') + .withArgs(MODULE_TYPE_VALIDATOR, instance); + }); + + for (const moduleTypeId of [ + MODULE_TYPE_VALIDATOR, + MODULE_TYPE_EXECUTOR, + MODULE_TYPE_FALLBACK, + withHooks && MODULE_TYPE_HOOK, + ].filter(Boolean)) { + const prefix = moduleTypeId == MODULE_TYPE_FALLBACK ? '0x12345678' : '0x'; + const initData = ethers.hexlify(ethers.randomBytes(256)); + const fullData = ethers.concat([prefix, initData]); + + it(`should install a module of type ${moduleTypeId}`, async function () { + const instance = this.modules[moduleTypeId]; + + await expect(this.mock.isModuleInstalled(moduleTypeId, instance, fullData)).to.eventually.equal(false); + + await expect(this.mockFromEntrypoint.installModule(moduleTypeId, instance, fullData)) + .to.emit(this.mock, 'ModuleInstalled') + .withArgs(moduleTypeId, instance) + .to.emit(instance, 'ModuleInstalledReceived') + .withArgs(this.mock, initData); // After decoding MODULE_TYPE_FALLBACK, it should remove the fnSig + + await expect(this.mock.isModuleInstalled(moduleTypeId, instance, fullData)).to.eventually.equal(true); + }); + + it(`does not allow to install a module of ${moduleTypeId} id twice`, async function () { + const instance = this.modules[moduleTypeId]; + + await this.mockFromEntrypoint.installModule(moduleTypeId, instance, fullData); + + await expect(this.mock.isModuleInstalled(moduleTypeId, instance, fullData)).to.eventually.equal(true); + + await expect(this.mockFromEntrypoint.installModule(moduleTypeId, instance, fullData)) + .to.be.revertedWithCustomError( + this.mock, + moduleTypeId == MODULE_TYPE_HOOK ? 'ERC7579HookModuleAlreadyPresent' : 'ERC7579AlreadyInstalledModule', + ) + .withArgs(...[moduleTypeId != MODULE_TYPE_HOOK && moduleTypeId, instance].filter(Boolean)); + }); + } + + withHooks && + describe('with hook', function () { + beforeEach(async function () { + await this.mockFromEntrypoint.$_installModule(MODULE_TYPE_HOOK, this.modules[MODULE_TYPE_HOOK], '0x'); + }); + + it('should call the hook of the installed module when performing an module install', async function () { + const instance = this.modules[MODULE_TYPE_EXECUTOR]; + const initData = ethers.hexlify(ethers.randomBytes(256)); + + const precheckData = this.mock.interface.encodeFunctionData('installModule', [ + MODULE_TYPE_EXECUTOR, + instance.target, + initData, + ]); + + await expect(this.mockFromEntrypoint.installModule(MODULE_TYPE_EXECUTOR, instance, initData)) + .to.emit(this.modules[MODULE_TYPE_HOOK], 'PreCheck') + .withArgs(entrypoint.v08, 0n, precheckData) + .to.emit(this.modules[MODULE_TYPE_HOOK], 'PostCheck') + .withArgs(precheckData); + }); + }); + }); + + describe('module uninstallation', function () { + it('should revert if the caller is not the canonical entrypoint or the account itself', async function () { + await expect(this.mock.connect(this.other).uninstallModule(MODULE_TYPE_VALIDATOR, this.mock, '0x')) + .to.be.revertedWithCustomError(this.mock, 'AccountUnauthorized') + .withArgs(this.other); + }); + + it('should revert if the module type is not supported', async function () { + await expect(this.mockFromEntrypoint.uninstallModule(MODULE_TYPE_INVALID, this.mock, '0x')) + .to.be.revertedWithCustomError(this.mock, 'ERC7579UnsupportedModuleType') + .withArgs(MODULE_TYPE_INVALID); + }); + + for (const moduleTypeId of [ + MODULE_TYPE_VALIDATOR, + MODULE_TYPE_EXECUTOR, + MODULE_TYPE_FALLBACK, + withHooks && MODULE_TYPE_HOOK, + ].filter(Boolean)) { + const prefix = moduleTypeId == MODULE_TYPE_FALLBACK ? '0x12345678' : '0x'; + const initData = ethers.hexlify(ethers.randomBytes(256)); + const fullData = ethers.concat([prefix, initData]); + + it(`should uninstall a module of type ${moduleTypeId}`, async function () { + const instance = this.modules[moduleTypeId]; + + await this.mock.$_installModule(moduleTypeId, instance, fullData); + + await expect(this.mock.isModuleInstalled(moduleTypeId, instance, fullData)).to.eventually.equal(true); + + await expect(this.mockFromEntrypoint.uninstallModule(moduleTypeId, instance, fullData)) + .to.emit(this.mock, 'ModuleUninstalled') + .withArgs(moduleTypeId, instance) + .to.emit(instance, 'ModuleUninstalledReceived') + .withArgs(this.mock, initData); // After decoding MODULE_TYPE_FALLBACK, it should remove the fnSig + + await expect(this.mock.isModuleInstalled(moduleTypeId, instance, fullData)).to.eventually.equal(false); + }); + + it(`should revert uninstalling a module of type ${moduleTypeId} if it was not installed`, async function () { + const instance = this.modules[moduleTypeId]; + + await expect(this.mockFromEntrypoint.uninstallModule(moduleTypeId, instance, fullData)) + .to.be.revertedWithCustomError(this.mock, 'ERC7579UninstalledModule') + .withArgs(moduleTypeId, instance); + }); + } + + it('should revert uninstalling a module of type MODULE_TYPE_FALLBACK if a different module was installed for the provided selector', async function () { + const instance = this.modules[MODULE_TYPE_FALLBACK]; + const anotherInstance = await ethers.deployContract('$ERC7579ModuleMock', [MODULE_TYPE_FALLBACK]); + const initData = '0x12345678abcdef'; + + await this.mockFromEntrypoint.$_installModule(MODULE_TYPE_FALLBACK, instance, initData); + await expect(this.mockFromEntrypoint.uninstallModule(MODULE_TYPE_FALLBACK, anotherInstance, initData)) + .to.be.revertedWithCustomError(this.mock, 'ERC7579UninstalledModule') + .withArgs(MODULE_TYPE_FALLBACK, anotherInstance); + }); + + withHooks && + describe('with hook', function () { + beforeEach(async function () { + await this.mockFromEntrypoint.$_installModule(MODULE_TYPE_HOOK, this.modules[MODULE_TYPE_HOOK], '0x'); + }); + + it('should call the hook of the installed module when performing a module uninstall', async function () { + const instance = this.modules[MODULE_TYPE_EXECUTOR]; + const initData = ethers.hexlify(ethers.randomBytes(256)); + + const precheckData = this.mock.interface.encodeFunctionData('uninstallModule', [ + MODULE_TYPE_EXECUTOR, + instance.target, + initData, + ]); + + await this.mock.$_installModule(MODULE_TYPE_EXECUTOR, instance, initData); + await expect(this.mockFromEntrypoint.uninstallModule(MODULE_TYPE_EXECUTOR, instance, initData)) + .to.emit(this.modules[MODULE_TYPE_HOOK], 'PreCheck') + .withArgs(entrypoint.v08, 0n, precheckData) + .to.emit(this.modules[MODULE_TYPE_HOOK], 'PostCheck') + .withArgs(precheckData); + }); + }); + }); + + describe('execution', function () { + beforeEach(async function () { + await this.mock.$_installModule(MODULE_TYPE_EXECUTOR, this.modules[MODULE_TYPE_EXECUTOR], '0x'); + }); + + for (const [execFn, mock] of [ + ['execute', 'mockFromEntrypoint'], + ['executeFromExecutor', 'mockFromExecutor'], + ]) { + describe(`executing with ${execFn}`, function () { + it('should revert if the call type is not supported', async function () { + await expect( + this[mock][execFn](encodeMode({ callType: CALL_TYPE_INVALID }), encodeSingle(this.other, 0, '0x')), + ) + .to.be.revertedWithCustomError(this.mock, 'ERC7579UnsupportedCallType') + .withArgs(ethers.solidityPacked(['bytes1'], [CALL_TYPE_INVALID])); + }); + + it('should revert if the caller is not authorized / installed', async function () { + const error = execFn == 'execute' ? 'AccountUnauthorized' : 'ERC7579UninstalledModule'; + const args = execFn == 'execute' ? [this.other] : [MODULE_TYPE_EXECUTOR, this.other]; + + await expect( + this[mock] + .connect(this.other) + [execFn](encodeMode({ callType: CALL_TYPE_CALL }), encodeSingle(this.other, 0, '0x')), + ) + .to.be.revertedWithCustomError(this.mock, error) + .withArgs(...args); + }); + + describe('single execution', function () { + it('calls the target with value and args', async function () { + const value = 0x432; + const data = encodeSingle( + this.target, + value, + this.target.interface.encodeFunctionData('mockFunctionWithArgs', [42, '0x1234']), + ); + + const tx = this[mock][execFn](encodeMode({ callType: CALL_TYPE_CALL }), data); + + await expect(tx).to.emit(this.target, 'MockFunctionCalledWithArgs').withArgs(42, '0x1234'); + await expect(tx).to.changeEtherBalances([this.mock, this.target], [-value, value]); + }); + + it('reverts when target reverts in default ExecType', async function () { + const value = 0x012; + const data = encodeSingle( + this.target, + value, + this.target.interface.encodeFunctionData('mockFunctionRevertsReason'), + ); + + await expect(this[mock][execFn](encodeMode({ callType: CALL_TYPE_CALL }), data)).to.be.revertedWith( + 'CallReceiverMock: reverting', + ); + }); + + it('emits ERC7579TryExecuteFail event when target reverts in try ExecType', async function () { + const value = 0x012; + const data = encodeSingle( + this.target, + value, + this.target.interface.encodeFunctionData('mockFunctionRevertsReason'), + ); + + await expect(this[mock][execFn](encodeMode({ callType: CALL_TYPE_CALL, execType: EXEC_TYPE_TRY }), data)) + .to.emit(this.mock, 'ERC7579TryExecuteFail') + .withArgs( + CALL_TYPE_CALL, + ethers.solidityPacked( + ['bytes4', 'bytes'], + [selector('Error(string)'), coder.encode(['string'], ['CallReceiverMock: reverting'])], + ), + ); + }); + }); + + describe('batch execution', function () { + it('calls the targets with value and args', async function () { + const value1 = 0x012; + const value2 = 0x234; + const data = encodeBatch( + [this.target, value1, this.target.interface.encodeFunctionData('mockFunctionWithArgs', [42, '0x1234'])], + [ + this.anotherTarget, + value2, + this.anotherTarget.interface.encodeFunctionData('mockFunctionWithArgs', [42, '0x1234']), + ], + ); + + const tx = this[mock][execFn](encodeMode({ callType: CALL_TYPE_BATCH }), data); + await expect(tx) + .to.emit(this.target, 'MockFunctionCalledWithArgs') + .to.emit(this.anotherTarget, 'MockFunctionCalledWithArgs'); + await expect(tx).to.changeEtherBalances( + [this.mock, this.target, this.anotherTarget], + [-value1 - value2, value1, value2], + ); + }); + + it('reverts when any target reverts in default ExecType', async function () { + const value1 = 0x012; + const value2 = 0x234; + const data = encodeBatch( + [this.target, value1, this.target.interface.encodeFunctionData('mockFunction')], + [ + this.anotherTarget, + value2, + this.anotherTarget.interface.encodeFunctionData('mockFunctionRevertsReason'), + ], + ); + + await expect(this[mock][execFn](encodeMode({ callType: CALL_TYPE_BATCH }), data)).to.be.revertedWith( + 'CallReceiverMock: reverting', + ); + }); + + it('emits ERC7579TryExecuteFail event when any target reverts in try ExecType', async function () { + const value1 = 0x012; + const value2 = 0x234; + const data = encodeBatch( + [this.target, value1, this.target.interface.encodeFunctionData('mockFunction')], + [ + this.anotherTarget, + value2, + this.anotherTarget.interface.encodeFunctionData('mockFunctionRevertsReason'), + ], + ); + + const tx = this[mock][execFn](encodeMode({ callType: CALL_TYPE_BATCH, execType: EXEC_TYPE_TRY }), data); + + await expect(tx) + .to.emit(this.mock, 'ERC7579TryExecuteFail') + .withArgs( + CALL_TYPE_BATCH, + ethers.solidityPacked( + ['bytes4', 'bytes'], + [selector('Error(string)'), coder.encode(['string'], ['CallReceiverMock: reverting'])], + ), + ); + + await expect(tx).to.changeEtherBalances( + [this.mock, this.target, this.anotherTarget], + [-value1, value1, 0], + ); + }); + }); + + describe('delegate call execution', function () { + it('delegate calls the target', async function () { + const slot = ethers.hexlify(ethers.randomBytes(32)); + const value = ethers.hexlify(ethers.randomBytes(32)); + const data = encodeDelegate( + this.target, + this.target.interface.encodeFunctionData('mockFunctionWritesStorage', [slot, value]), + ); + + await expect(ethers.provider.getStorage(this.mock.target, slot)).to.eventually.equal(ethers.ZeroHash); + await this[mock][execFn](encodeMode({ callType: CALL_TYPE_DELEGATE }), data); + await expect(ethers.provider.getStorage(this.mock.target, slot)).to.eventually.equal(value); + }); + + it('reverts when target reverts in default ExecType', async function () { + const data = encodeDelegate( + this.target, + this.target.interface.encodeFunctionData('mockFunctionRevertsReason'), + ); + await expect(this[mock][execFn](encodeMode({ callType: CALL_TYPE_DELEGATE }), data)).to.be.revertedWith( + 'CallReceiverMock: reverting', + ); + }); + + it('emits ERC7579TryExecuteFail event when target reverts in try ExecType', async function () { + const data = encodeDelegate( + this.target, + this.target.interface.encodeFunctionData('mockFunctionRevertsReason'), + ); + await expect( + this[mock][execFn](encodeMode({ callType: CALL_TYPE_DELEGATE, execType: EXEC_TYPE_TRY }), data), + ) + .to.emit(this.mock, 'ERC7579TryExecuteFail') + .withArgs( + CALL_TYPE_CALL, + ethers.solidityPacked( + ['bytes4', 'bytes'], + [selector('Error(string)'), coder.encode(['string'], ['CallReceiverMock: reverting'])], + ), + ); + }); + }); + + withHooks && + describe('with hook', function () { + beforeEach(async function () { + await this.mockFromEntrypoint.$_installModule(MODULE_TYPE_HOOK, this.modules[MODULE_TYPE_HOOK], '0x'); + }); + + it(`should call the hook of the installed module when executing ${execFn}`, async function () { + const caller = execFn === 'execute' ? entrypoint.v08 : this.modules[MODULE_TYPE_EXECUTOR]; + const value = 17; + const data = this.target.interface.encodeFunctionData('mockFunctionWithArgs', [42, '0x1234']); + + const mode = encodeMode({ callType: CALL_TYPE_CALL }); + const call = encodeSingle(this.target, value, data); + const precheckData = this[mock].interface.encodeFunctionData(execFn, [mode, call]); + + const tx = this[mock][execFn](mode, call, { value }); + + await expect(tx) + .to.emit(this.modules[MODULE_TYPE_HOOK], 'PreCheck') + .withArgs(caller, value, precheckData) + .to.emit(this.modules[MODULE_TYPE_HOOK], 'PostCheck') + .withArgs(precheckData); + await expect(tx).to.changeEtherBalances([caller, this.mock, this.target], [-value, 0n, value]); + }); + }); + }); + } + }); + + describe('fallback', function () { + beforeEach(async function () { + this.fallbackHandler = await ethers.deployContract('$ERC7579FallbackHandlerMock'); + }); + + it('reverts if there is no fallback module installed', async function () { + const { selector } = this.fallbackHandler.callPayable.getFragment(); + + await expect(this.fallbackHandler.attach(this.mock).callPayable()) + .to.be.revertedWithCustomError(this.mock, 'ERC7579MissingFallbackHandler') + .withArgs(selector); + }); + + describe('with a fallback module installed', function () { + beforeEach(async function () { + await Promise.all( + [ + this.fallbackHandler.callPayable.getFragment().selector, + this.fallbackHandler.callView.getFragment().selector, + this.fallbackHandler.callRevert.getFragment().selector, + ].map(selector => + this.mock.$_installModule( + MODULE_TYPE_FALLBACK, + this.fallbackHandler, + coder.encode(['bytes4', 'bytes'], [selector, '0x']), + ), + ), + ); + }); + + it('forwards the call to the fallback handler', async function () { + const calldata = this.fallbackHandler.interface.encodeFunctionData('callPayable'); + const value = 17n; + + await expect(this.fallbackHandler.attach(this.mock).connect(this.other).callPayable({ value })) + .to.emit(this.fallbackHandler, 'ERC7579FallbackHandlerMockCalled') + .withArgs(this.mock, this.other, value, calldata); + }); + + it('returns answer from the fallback handler', async function () { + await expect(this.fallbackHandler.attach(this.mock).connect(this.other).callView()).to.eventually.deep.equal([ + this.mock.target, + this.other.address, + ]); + }); + + it('bubble up reverts from the fallback handler', async function () { + await expect( + this.fallbackHandler.attach(this.mock).connect(this.other).callRevert(), + ).to.be.revertedWithCustomError(this.fallbackHandler, 'ERC7579FallbackHandlerMockRevert'); + }); + + withHooks && + describe('with hook', function () { + beforeEach(async function () { + await this.mockFromEntrypoint.$_installModule(MODULE_TYPE_HOOK, this.modules[MODULE_TYPE_HOOK], '0x'); + }); + + it('should call the hook of the installed module when performing a callback', async function () { + const precheckData = this.fallbackHandler.interface.encodeFunctionData('callPayable'); + const value = 17n; + + // call with interface: decode returned data + await expect(this.fallbackHandler.attach(this.mock).connect(this.other).callPayable({ value })) + .to.emit(this.modules[MODULE_TYPE_HOOK], 'PreCheck') + .withArgs(this.other, value, precheckData) + .to.emit(this.modules[MODULE_TYPE_HOOK], 'PostCheck') + .withArgs(precheckData); + }); + }); + }); + }); + }); +} + +module.exports = { + shouldBehaveLikeAccountERC7579, +}; diff --git a/test/account/extensions/AccountERC7579.test.js b/test/account/extensions/AccountERC7579.test.js new file mode 100644 index 00000000000..7903c91aecc --- /dev/null +++ b/test/account/extensions/AccountERC7579.test.js @@ -0,0 +1,60 @@ +const { ethers, entrypoint } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { getDomain } = require('../../helpers/eip712'); +const { ERC4337Helper } = require('../../helpers/erc4337'); +const { PackedUserOperation } = require('../../helpers/eip712-types'); + +const { shouldBehaveLikeAccountCore } = require('../Account.behavior'); +const { shouldBehaveLikeAccountERC7579 } = require('./AccountERC7579.behavior'); +const { shouldBehaveLikeERC1271 } = require('../../utils/cryptography/ERC1271.behavior'); + +async function fixture() { + // EOAs and environment + const [other] = await ethers.getSigners(); + const target = await ethers.deployContract('CallReceiverMock'); + const anotherTarget = await ethers.deployContract('CallReceiverMock'); + + // ERC-7579 validator + const validator = await ethers.deployContract('$ERC7579ValidatorMock'); + + // ERC-4337 signer + const signer = ethers.Wallet.createRandom(); + + // ERC-4337 account + const helper = new ERC4337Helper(); + const mock = await helper.newAccount('$AccountERC7579Mock', [ + validator, + ethers.solidityPacked(['address'], [signer.address]), + ]); + + // ERC-4337 Entrypoint domain + const entrypointDomain = await getDomain(entrypoint.v08); + + return { helper, validator, mock, entrypointDomain, signer, target, anotherTarget, other }; +} + +describe('AccountERC7579', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + + this.signer.signMessage = message => + ethers.Wallet.prototype.signMessage + .bind(this.signer)(message) + .then(sign => ethers.concat([this.validator.target, sign])); + this.signer.signTypedData = (domain, types, values) => + ethers.Wallet.prototype.signTypedData + .bind(this.signer)(domain, types, values) + .then(sign => ethers.concat([this.validator.target, sign])); + this.signUserOp = userOp => + ethers.Wallet.prototype.signTypedData + .bind(this.signer)(this.entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + + this.userOp = { nonce: ethers.zeroPadBytes(ethers.hexlify(this.validator.target), 32) }; + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountERC7579(); + shouldBehaveLikeERC1271(); +}); diff --git a/test/account/extensions/AccountERC7579Hooked.test.js b/test/account/extensions/AccountERC7579Hooked.test.js new file mode 100644 index 00000000000..6db8fe9b691 --- /dev/null +++ b/test/account/extensions/AccountERC7579Hooked.test.js @@ -0,0 +1,60 @@ +const { ethers, entrypoint } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { getDomain } = require('../../helpers/eip712'); +const { ERC4337Helper } = require('../../helpers/erc4337'); +const { PackedUserOperation } = require('../../helpers/eip712-types'); + +const { shouldBehaveLikeAccountCore } = require('../Account.behavior'); +const { shouldBehaveLikeAccountERC7579 } = require('./AccountERC7579.behavior'); +const { shouldBehaveLikeERC1271 } = require('../../utils/cryptography/ERC1271.behavior'); + +async function fixture() { + // EOAs and environment + const [other] = await ethers.getSigners(); + const target = await ethers.deployContract('CallReceiverMock'); + const anotherTarget = await ethers.deployContract('CallReceiverMock'); + + // ERC-7579 validator + const validator = await ethers.deployContract('$ERC7579ValidatorMock'); + + // ERC-4337 signer + const signer = ethers.Wallet.createRandom(); + + // ERC-4337 account + const helper = new ERC4337Helper(); + const mock = await helper.newAccount('$AccountERC7579HookedMock', [ + validator, + ethers.solidityPacked(['address'], [signer.address]), + ]); + + // ERC-4337 Entrypoint domain + const entrypointDomain = await getDomain(entrypoint.v08); + + return { helper, validator, mock, entrypointDomain, signer, target, anotherTarget, other }; +} + +describe('AccountERC7579Hooked', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + + this.signer.signMessage = message => + ethers.Wallet.prototype.signMessage + .bind(this.signer)(message) + .then(sign => ethers.concat([this.validator.target, sign])); + this.signer.signTypedData = (domain, types, values) => + ethers.Wallet.prototype.signTypedData + .bind(this.signer)(domain, types, values) + .then(sign => ethers.concat([this.validator.target, sign])); + this.signUserOp = userOp => + ethers.Wallet.prototype.signTypedData + .bind(this.signer)(this.entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + + this.userOp = { nonce: ethers.zeroPadBytes(ethers.hexlify(this.validator.target), 32) }; + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountERC7579({ withHooks: true }); + shouldBehaveLikeERC1271(); +}); diff --git a/test/account/extensions/ERC7821.behavior.js b/test/account/extensions/ERC7821.behavior.js new file mode 100644 index 00000000000..d6bff8b15a2 --- /dev/null +++ b/test/account/extensions/ERC7821.behavior.js @@ -0,0 +1,145 @@ +const { ethers, entrypoint } = require('hardhat'); +const { expect } = require('chai'); + +const { CALL_TYPE_BATCH, encodeMode, encodeBatch } = require('../../helpers/erc7579'); + +function shouldBehaveLikeERC7821({ deployable = true } = {}) { + describe('supports ERC-7821', function () { + beforeEach(async function () { + // give eth to the account (before deployment) + await this.other.sendTransaction({ to: this.mock.target, value: ethers.parseEther('1') }); + + // account is not initially deployed + await expect(ethers.provider.getCode(this.mock)).to.eventually.equal('0x'); + + this.encodeUserOpCalldata = (...calls) => + this.mock.interface.encodeFunctionData('execute', [ + encodeMode({ callType: CALL_TYPE_BATCH }), + encodeBatch(...calls), + ]); + }); + + it('should revert if the caller is not the canonical entrypoint or the account itself', async function () { + await this.mock.deploy(); + + await expect( + this.mock.connect(this.other).execute( + encodeMode({ callType: CALL_TYPE_BATCH }), + encodeBatch({ + target: this.target, + data: this.target.interface.encodeFunctionData('mockFunctionExtra'), + }), + ), + ) + .to.be.revertedWithCustomError(this.mock, 'AccountUnauthorized') + .withArgs(this.other); + }); + + if (deployable) { + describe('when not deployed', function () { + it('should be created with handleOps and increase nonce', async function () { + const operation = await this.mock + .createUserOp({ + callData: this.encodeUserOpCalldata({ + target: this.target, + value: 17, + data: this.target.interface.encodeFunctionData('mockFunctionExtra'), + }), + }) + .then(op => op.addInitCode()) + .then(op => this.signUserOp(op)); + + // Can't call the account to get its nonce before it's deployed + await expect(entrypoint.v08.getNonce(this.mock.target, 0)).to.eventually.equal(0); + await expect(entrypoint.v08.handleOps([operation.packed], this.beneficiary)) + .to.emit(entrypoint.v08, 'AccountDeployed') + .withArgs(operation.hash(), this.mock, this.helper.factory, ethers.ZeroAddress) + .to.emit(this.target, 'MockFunctionCalledExtra') + .withArgs(this.mock, 17); + await expect(this.mock.getNonce()).to.eventually.equal(1); + }); + + it('should revert if the signature is invalid', async function () { + const operation = await this.mock + .createUserOp({ + callData: this.encodeUserOpCalldata({ + target: this.target, + value: 17, + data: this.target.interface.encodeFunctionData('mockFunctionExtra'), + }), + }) + .then(op => op.addInitCode()); + + operation.signature = '0x00'; + + await expect(entrypoint.v08.handleOps([operation.packed], this.beneficiary)).to.be.reverted; + }); + }); + } + + describe('when deployed', function () { + beforeEach(async function () { + await this.mock.deploy(); + }); + + it('should increase nonce and call target', async function () { + const operation = await this.mock + .createUserOp({ + callData: this.encodeUserOpCalldata({ + target: this.target, + value: 42, + data: this.target.interface.encodeFunctionData('mockFunctionExtra'), + }), + }) + .then(op => this.signUserOp(op)); + + await expect(this.mock.getNonce()).to.eventually.equal(0); + await expect(entrypoint.v08.handleOps([operation.packed], this.beneficiary)) + .to.emit(this.target, 'MockFunctionCalledExtra') + .withArgs(this.mock, 42); + await expect(this.mock.getNonce()).to.eventually.equal(1); + }); + + it('should support sending eth to an EOA', async function () { + const operation = await this.mock + .createUserOp({ callData: this.encodeUserOpCalldata({ target: this.other, value: 42 }) }) + .then(op => this.signUserOp(op)); + + await expect(this.mock.getNonce()).to.eventually.equal(0); + await expect(entrypoint.v08.handleOps([operation.packed], this.beneficiary)).to.changeEtherBalance( + this.other, + 42, + ); + await expect(this.mock.getNonce()).to.eventually.equal(1); + }); + + it('should support batch execution', async function () { + const value1 = 43374337n; + const value2 = 69420n; + + const operation = await this.mock + .createUserOp({ + callData: this.encodeUserOpCalldata( + { target: this.other, value: value1 }, + { + target: this.target, + value: value2, + data: this.target.interface.encodeFunctionData('mockFunctionExtra'), + }, + ), + }) + .then(op => this.signUserOp(op)); + + await expect(this.mock.getNonce()).to.eventually.equal(0); + const tx = entrypoint.v08.handleOps([operation.packed], this.beneficiary); + await expect(tx).to.changeEtherBalances([this.other, this.target], [value1, value2]); + await expect(tx).to.emit(this.target, 'MockFunctionCalledExtra').withArgs(this.mock, value2); + await expect(this.mock.getNonce()).to.eventually.equal(1); + }); + }); + }); +} + +module.exports = { + shouldBehaveLikeERC7821, +}; diff --git a/test/helpers/eip712-types.js b/test/helpers/eip712-types.js index d04969e442b..fb6fe3aebaf 100644 --- a/test/helpers/eip712-types.js +++ b/test/helpers/eip712-types.js @@ -11,19 +11,8 @@ module.exports = mapValues( verifyingContract: 'address', salt: 'bytes32', }, - Permit: { - owner: 'address', - spender: 'address', - value: 'uint256', - nonce: 'uint256', - deadline: 'uint256', - }, - Ballot: { - proposalId: 'uint256', - support: 'uint8', - voter: 'address', - nonce: 'uint256', - }, + Permit: { owner: 'address', spender: 'address', value: 'uint256', nonce: 'uint256', deadline: 'uint256' }, + Ballot: { proposalId: 'uint256', support: 'uint8', voter: 'address', nonce: 'uint256' }, ExtendedBallot: { proposalId: 'uint256', support: 'uint8', @@ -32,18 +21,8 @@ module.exports = mapValues( reason: 'string', params: 'bytes', }, - OverrideBallot: { - proposalId: 'uint256', - support: 'uint8', - voter: 'address', - nonce: 'uint256', - reason: 'string', - }, - Delegation: { - delegatee: 'address', - nonce: 'uint256', - expiry: 'uint256', - }, + OverrideBallot: { proposalId: 'uint256', support: 'uint8', voter: 'address', nonce: 'uint256', reason: 'string' }, + Delegation: { delegatee: 'address', nonce: 'uint256', expiry: 'uint256' }, ForwardRequest: { from: 'address', to: 'address', @@ -53,6 +32,29 @@ module.exports = mapValues( deadline: 'uint48', data: 'bytes', }, + PackedUserOperation: { + sender: 'address', + nonce: 'uint256', + initCode: 'bytes', + callData: 'bytes', + accountGasLimits: 'bytes32', + preVerificationGas: 'uint256', + gasFees: 'bytes32', + paymasterAndData: 'bytes', + }, + UserOperationRequest: { + sender: 'address', + nonce: 'uint256', + initCode: 'bytes', + callData: 'bytes', + accountGasLimits: 'bytes32', + preVerificationGas: 'uint256', + gasFees: 'bytes32', + paymasterVerificationGasLimit: 'uint256', + paymasterPostOpGasLimit: 'uint256', + validAfter: 'uint48', + validUntil: 'uint48', + }, }, formatType, ); diff --git a/test/helpers/erc4337.js b/test/helpers/erc4337.js index 2d5cbe1a0bf..a33fa3c4e75 100644 --- a/test/helpers/erc4337.js +++ b/test/helpers/erc4337.js @@ -83,6 +83,129 @@ class UserOperation { } } +const parseInitCode = initCode => ({ + factory: '0x' + initCode.replace(/0x/, '').slice(0, 40), + factoryData: '0x' + initCode.replace(/0x/, '').slice(40), +}); + +/// Global ERC-4337 environment helper. +class ERC4337Helper { + constructor() { + this.factoryAsPromise = ethers.deployContract('$Create2'); + } + + async wait() { + this.factory = await this.factoryAsPromise; + return this; + } + + async newAccount(name, extraArgs = [], params = {}) { + const env = { + entrypoint: params.entrypoint ?? entrypoint.v08, + senderCreator: params.senderCreator ?? senderCreator.v08, + }; + + const { factory } = await this.wait(); + + const accountFactory = await ethers.getContractFactory(name); + + if (params.erc7702signer) { + const delegate = await accountFactory.deploy(...extraArgs); + const instance = await params.erc7702signer.getAddress().then(address => accountFactory.attach(address)); + const authorization = await params.erc7702signer.authorize({ address: delegate.target }); + return new ERC7702SmartAccount(instance, authorization, env); + } else { + const initCode = await accountFactory + .getDeployTransaction(...extraArgs) + .then(tx => + factory.interface.encodeFunctionData('$deploy', [0, params.salt ?? ethers.randomBytes(32), tx.data]), + ) + .then(deployCode => ethers.concat([factory.target, deployCode])); + + const instance = await ethers.provider + .call({ + from: env.entrypoint, + to: env.senderCreator, + data: env.senderCreator.interface.encodeFunctionData('createSender', [initCode]), + }) + .then(result => ethers.getAddress(ethers.hexlify(ethers.getBytes(result).slice(-20)))) + .then(address => accountFactory.attach(address)); + + return new SmartAccount(instance, initCode, env); + } + } +} + +/// Represent one ERC-4337 account contract. +class SmartAccount extends ethers.BaseContract { + constructor(instance, initCode, env) { + super(instance.target, instance.interface, instance.runner, instance.deployTx); + this.address = instance.target; + this.initCode = initCode; + this._env = env; + } + + async deploy(account = this.runner) { + const { factory: to, factoryData: data } = parseInitCode(this.initCode); + this.deployTx = await account.sendTransaction({ to, data }); + return this; + } + + async createUserOp(userOp = {}) { + userOp.sender ??= this; + userOp.nonce ??= await this._env.entrypoint.getNonce(userOp.sender, 0); + if (ethers.isAddressable(userOp.paymaster)) { + userOp.paymaster = await ethers.resolveAddress(userOp.paymaster); + userOp.paymasterVerificationGasLimit ??= 100_000n; + userOp.paymasterPostOpGasLimit ??= 100_000n; + } + return new UserOperationWithContext(userOp, this._env); + } +} + +class ERC7702SmartAccount extends SmartAccount { + constructor(instance, authorization, env) { + super(instance, undefined, env); + this.authorization = authorization; + } + + async deploy() { + // hardhat signers from @nomicfoundation/hardhat-ethers do not support type 4 txs. + // so we rebuild it using "native" ethers + await ethers.Wallet.fromPhrase(config.networks.hardhat.accounts.mnemonic, ethers.provider).sendTransaction({ + to: ethers.ZeroAddress, + authorizationList: [this.authorization], + gasLimit: 46_000n, // 21,000 base + PER_EMPTY_ACCOUNT_COST + }); + + return this; + } +} + +class UserOperationWithContext extends UserOperation { + constructor(userOp, env) { + super(userOp); + this._sender = userOp.sender; + this._env = env; + } + + addInitCode() { + if (this._sender?.initCode) { + return Object.assign(this, parseInitCode(this._sender.initCode)); + } else throw new Error('No init code available for the sender of this user operation'); + } + + getAuthorization() { + if (this._sender?.authorization) { + return this._sender.authorization; + } else throw new Error('No EIP-7702 authorization available for the sender of this user operation'); + } + + hash() { + return super.hash(this._env.entrypoint); + } +} + module.exports = { SIG_VALIDATION_SUCCESS, SIG_VALIDATION_FAILURE, @@ -90,4 +213,5 @@ module.exports = { packInitCode, packPaymasterAndData, UserOperation, + ERC4337Helper, }; diff --git a/test/helpers/erc7739.js b/test/helpers/erc7739.js new file mode 100644 index 00000000000..5a489de71e9 --- /dev/null +++ b/test/helpers/erc7739.js @@ -0,0 +1,118 @@ +const { ethers } = require('hardhat'); +const { formatType } = require('./eip712'); + +const PersonalSign = formatType({ prefixed: 'bytes' }); +const TypedDataSign = contentsTypeName => + formatType({ + contents: contentsTypeName, + name: 'string', + version: 'string', + chainId: 'uint256', + verifyingContract: 'address', + salt: 'bytes32', + }); + +class ERC7739Signer extends ethers.AbstractSigner { + #signer; + #domain; + + constructor(signer, domain) { + super(signer.provider); + this.#signer = signer; + this.#domain = domain; + } + + static from(signer, domain) { + return new this(signer, domain); + } + + get signingKey() { + return this.#signer.signingKey; + } + + get privateKey() { + return this.#signer.privateKey; + } + + async getAddress() { + return this.#signer.getAddress(); + } + + connect(provider) { + this.#signer.connect(provider); + } + + async signTransaction(tx) { + return this.#signer.signTransaction(tx); + } + + async signMessage(message) { + return this.#signer.signTypedData(this.#domain, { PersonalSign }, ERC4337Utils.preparePersonalSign(message)); + } + + async signTypedData(domain, types, value) { + const { allTypes, contentsTypeName, contentsDescr } = ERC4337Utils.getContentsDetail(types); + + return Promise.resolve( + this.#signer.signTypedData(domain, allTypes, ERC4337Utils.prepareSignTypedData(value, this.#domain)), + ).then(signature => + ethers.concat([ + signature, + ethers.TypedDataEncoder.hashDomain(domain), // appDomainSeparator + ethers.TypedDataEncoder.hashStruct(contentsTypeName, types, value), // contentsHash + ethers.toUtf8Bytes(contentsDescr), + ethers.toBeHex(contentsDescr.length, 2), + ]), + ); + } +} + +class ERC4337Utils { + static preparePersonalSign(message) { + return { + prefixed: ethers.concat([ + ethers.toUtf8Bytes(ethers.MessagePrefix), + ethers.toUtf8Bytes(String(message.length)), + typeof message === 'string' ? ethers.toUtf8Bytes(message) : message, + ]), + }; + } + + static prepareSignTypedData(contents, signerDomain) { + return { + name: signerDomain.name ?? '', + version: signerDomain.version ?? '', + chainId: signerDomain.chainId ?? 0, + verifyingContract: signerDomain.verifyingContract ?? ethers.ZeroAddress, + salt: signerDomain.salt ?? ethers.ZeroHash, + contents, + }; + } + + static getContentsDetail(contentsTypes, contentsTypeName = Object.keys(contentsTypes).at(0)) { + // Examples values + // + // contentsTypeName B + // typedDataSignType TypedDataSign(B contents,...)A(uint256 v)B(Z z)Z(A a) + // contentsType A(uint256 v)B(Z z)Z(A a) + // contentsDescr A(uint256 v)B(Z z)Z(A a)B + const allTypes = { TypedDataSign: TypedDataSign(contentsTypeName), ...contentsTypes }; + const typedDataSignType = ethers.TypedDataEncoder.from(allTypes).encodeType('TypedDataSign'); + const contentsType = typedDataSignType.slice(typedDataSignType.indexOf(')') + 1); // Remove TypedDataSign (first object) + const contentsDescr = contentsType + (contentsType.startsWith(contentsTypeName) ? '' : contentsTypeName); + + return { + allTypes, + contentsTypes, + contentsTypeName, + contentsDescr, + }; + } +} + +module.exports = { + ERC7739Signer, + ERC4337Utils, + PersonalSign, + TypedDataSign, +}; diff --git a/test/helpers/signers.js b/test/helpers/signers.js new file mode 100644 index 00000000000..d807d592f0d --- /dev/null +++ b/test/helpers/signers.js @@ -0,0 +1,147 @@ +const { + AbstractSigner, + Signature, + TypedDataEncoder, + assert, + assertArgument, + concat, + dataLength, + decodeBase64, + getBytes, + getBytesCopy, + hashMessage, + hexlify, + sha256, + toBeHex, +} = require('ethers'); +const { secp256r1 } = require('@noble/curves/p256'); +const { generateKeyPairSync, privateEncrypt } = require('crypto'); + +// Lightweight version of BaseWallet +class NonNativeSigner extends AbstractSigner { + #signingKey; + + constructor(privateKey, provider) { + super(provider); + assertArgument( + privateKey && typeof privateKey.sign === 'function', + 'invalid private key', + 'privateKey', + '[ REDACTED ]', + ); + this.#signingKey = privateKey; + } + + get signingKey() { + return this.#signingKey; + } + get privateKey() { + return this.signingKey.privateKey; + } + + async getAddress() { + throw new Error("NonNativeSigner doesn't have an address"); + } + + connect(provider) { + return new NonNativeSigner(this.#signingKey, provider); + } + + async signTransaction(/*tx: TransactionRequest*/) { + throw new Error('NonNativeSigner cannot send transactions'); + } + + async signMessage(message /*: string | Uint8Array*/) /*: Promise*/ { + return this.signingKey.sign(hashMessage(message)).serialized; + } + + async signTypedData( + domain /*: TypedDataDomain*/, + types /*: Record>*/, + value /*: Record*/, + ) /*: Promise*/ { + // Populate any ENS names + const populated = await TypedDataEncoder.resolveNames(domain, types, value, async name => { + assert(this.provider != null, 'cannot resolve ENS names without a provider', 'UNSUPPORTED_OPERATION', { + operation: 'resolveName', + info: { name }, + }); + const address = await this.provider.resolveName(name); + assert(address != null, 'unconfigured ENS name', 'UNCONFIGURED_NAME', { value: name }); + return address; + }); + + return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)).serialized; + } +} + +class P256SigningKey { + #privateKey; + + constructor(privateKey) { + this.#privateKey = getBytes(privateKey); + } + + static random() { + return new this(secp256r1.utils.randomPrivateKey()); + } + + get privateKey() { + return hexlify(this.#privateKey); + } + + get publicKey() { + const publicKeyBytes = secp256r1.getPublicKey(this.#privateKey, false); + return { qx: hexlify(publicKeyBytes.slice(0x01, 0x21)), qy: hexlify(publicKeyBytes.slice(0x21, 0x41)) }; + } + + sign(digest /*: BytesLike*/) /*: Signature*/ { + assertArgument(dataLength(digest) === 32, 'invalid digest length', 'digest', digest); + + const sig = secp256r1.sign(getBytesCopy(digest), getBytesCopy(this.#privateKey), { lowS: true }); + + return Signature.from({ r: toBeHex(sig.r, 32), s: toBeHex(sig.s, 32), v: sig.recovery ? 0x1c : 0x1b }); + } +} + +class RSASigningKey { + #privateKey; + #publicKey; + + constructor(keyPair) { + const jwk = keyPair.publicKey.export({ format: 'jwk' }); + this.#privateKey = keyPair.privateKey; + this.#publicKey = { e: decodeBase64(jwk.e), n: decodeBase64(jwk.n) }; + } + + static random(modulusLength = 2048) { + return new this(generateKeyPairSync('rsa', { modulusLength })); + } + + get privateKey() { + return hexlify(this.#privateKey); + } + + get publicKey() { + return { e: hexlify(this.#publicKey.e), n: hexlify(this.#publicKey.n) }; + } + + sign(digest /*: BytesLike*/) /*: Signature*/ { + assertArgument(dataLength(digest) === 32, 'invalid digest length', 'digest', digest); + // SHA256 OID = 608648016503040201 (9 bytes) | NULL = 0500 (2 bytes) (explicit) | OCTET_STRING length (0x20) = 0420 (2 bytes) + return { + serialized: hexlify( + privateEncrypt(this.#privateKey, getBytes(concat(['0x3031300d060960864801650304020105000420', digest]))), + ), + }; + } +} + +class RSASHA256SigningKey extends RSASigningKey { + sign(digest /*: BytesLike*/) /*: Signature*/ { + assertArgument(dataLength(digest) === 32, 'invalid digest length', 'digest', digest); + return super.sign(sha256(getBytes(digest))); + } +} + +module.exports = { NonNativeSigner, P256SigningKey, RSASigningKey, RSASHA256SigningKey }; diff --git a/test/utils/cryptography/ERC1271.behavior.js b/test/utils/cryptography/ERC1271.behavior.js new file mode 100644 index 00000000000..ef3e668028e --- /dev/null +++ b/test/utils/cryptography/ERC1271.behavior.js @@ -0,0 +1,111 @@ +const { ethers } = require('hardhat'); +const { expect } = require('chai'); +const { Permit, formatType, getDomain } = require('../../helpers/eip712'); +const { ERC7739Signer } = require('../../helpers/erc7739'); + +function shouldBehaveLikeERC1271({ erc7739 = false } = {}) { + const MAGIC_VALUE = '0x1626ba7e'; + + describe(`supports ERC-${erc7739 ? 7739 : 1271}`, function () { + beforeEach(async function () { + // if deploy function is present, check that code is already in place + if (this.mock.deploy) { + await ethers.provider.getCode(this.mock.address).then(code => code != '0x' || this.mock.deploy()); + } + this._signer = erc7739 + ? new ERC7739Signer(this.signer, this.domain ?? (await getDomain(this.mock))) + : this.signer; + }); + + describe('PersonalSign', function () { + it('returns true for a valid personal signature', async function () { + const text = 'Hello, world!'; + + const hash = ethers.hashMessage(text); + const signature = await this._signer.signMessage(text); + + await expect(this.mock.isValidSignature(hash, signature)).to.eventually.equal(MAGIC_VALUE); + }); + + it('returns false for an invalid personal signature', async function () { + const message = 'Message the app expects'; + const otherMessage = 'Message signed is different'; + + const hash = ethers.hashMessage(message); + const signature = await this._signer.signMessage(otherMessage); + + await expect(this.mock.isValidSignature(hash, signature)).to.eventually.not.equal(MAGIC_VALUE); + }); + }); + + describe('TypedDataSign', function () { + beforeEach(async function () { + // Dummy app domain, different from the ERC7739's domain + // Note the difference of format (signer domain doesn't include a salt, but app domain does) + this.appDomain = { + name: 'SomeApp', + version: '1', + chainId: await ethers.provider.getNetwork().then(({ chainId }) => chainId), + verifyingContract: '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512', + salt: '0x02cb3d8cb5e8928c9c6de41e935e16a4e28b2d54e7e7ba47e99f16071efab785', + }; + }); + + it('returns true for a valid typed data signature', async function () { + const contents = { + owner: '0x1ab5E417d9AF00f1ca9d159007e12c401337a4bb', + spender: '0xD68E96620804446c4B1faB3103A08C98d4A8F55f', + value: 1_000_000n, + nonce: 0n, + deadline: ethers.MaxUint256, + }; + + const hash = ethers.TypedDataEncoder.hash(this.appDomain, { Permit }, contents); + const signature = await this._signer.signTypedData(this.appDomain, { Permit }, contents); + + await expect(this.mock.isValidSignature(hash, signature)).to.eventually.equal(MAGIC_VALUE); + }); + + it('returns true for valid typed data signature (nested types)', async function () { + const contentsTypes = { + B: formatType({ z: 'Z' }), + Z: formatType({ a: 'A' }), + A: formatType({ v: 'uint256' }), + }; + + const contents = { z: { a: { v: 1n } } }; + + const hash = ethers.TypedDataEncoder.hash(this.appDomain, contentsTypes, contents); + const signature = await this._signer.signTypedData(this.appDomain, contentsTypes, contents); + + await expect(this.mock.isValidSignature(hash, signature)).to.eventually.equal(MAGIC_VALUE); + }); + + it('returns false for an invalid typed data signature', async function () { + const contents = { + owner: '0x1ab5E417d9AF00f1ca9d159007e12c401337a4bb', + spender: '0xD68E96620804446c4B1faB3103A08C98d4A8F55f', + value: 1_000_000n, + nonce: 0n, + deadline: ethers.MaxUint256, + }; + + const hash = ethers.TypedDataEncoder.hash(this.appDomain, { Permit }, contents); + // message signed by the user is for a lower amount. + const signature = await this._signer.signTypedData(this.appDomain, { Permit }, { ...contents, value: 1_000n }); + + await expect(this.mock.isValidSignature(hash, signature)).to.eventually.not.equal(MAGIC_VALUE); + }); + }); + + erc7739 && + it('support ERC-7739 detection', async function () { + const hash = '0x7739773977397739773977397739773977397739773977397739773977397739'; + await expect(this.mock.isValidSignature(hash, '0x')).to.eventually.equal('0x77390001'); + }); + }); +} + +module.exports = { + shouldBehaveLikeERC1271, +}; diff --git a/test/utils/cryptography/ERC7739.test.js b/test/utils/cryptography/ERC7739.test.js new file mode 100644 index 00000000000..c7e9c009145 --- /dev/null +++ b/test/utils/cryptography/ERC7739.test.js @@ -0,0 +1,38 @@ +const { ethers } = require('hardhat'); +const { shouldBehaveLikeERC1271 } = require('./ERC1271.behavior'); +const { NonNativeSigner, P256SigningKey, RSASHA256SigningKey } = require('../../helpers/signers'); + +describe('ERC7739', function () { + describe('for an ECDSA signer', function () { + before(async function () { + this.signer = ethers.Wallet.createRandom(); + this.mock = await ethers.deployContract('ERC7739ECDSAMock', [this.signer.address]); + }); + + shouldBehaveLikeERC1271({ erc7739: true }); + }); + + describe('for a P256 signer', function () { + before(async function () { + this.signer = new NonNativeSigner(P256SigningKey.random()); + this.mock = await ethers.deployContract('ERC7739P256Mock', [ + this.signer.signingKey.publicKey.qx, + this.signer.signingKey.publicKey.qy, + ]); + }); + + shouldBehaveLikeERC1271({ erc7739: true }); + }); + + describe('for an RSA signer', function () { + before(async function () { + this.signer = new NonNativeSigner(RSASHA256SigningKey.random()); + this.mock = await ethers.deployContract('ERC7739RSAMock', [ + this.signer.signingKey.publicKey.e, + this.signer.signingKey.publicKey.n, + ]); + }); + + shouldBehaveLikeERC1271({ erc7739: true }); + }); +}); diff --git a/test/utils/cryptography/ERC7739Utils.test.js b/test/utils/cryptography/ERC7739Utils.test.js new file mode 100644 index 00000000000..758215e0851 --- /dev/null +++ b/test/utils/cryptography/ERC7739Utils.test.js @@ -0,0 +1,211 @@ +const { expect } = require('chai'); +const { ethers } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { Permit } = require('../../helpers/eip712'); +const { ERC4337Utils, PersonalSign } = require('../../helpers/erc7739'); + +const details = ERC4337Utils.getContentsDetail({ Permit }); + +const fixture = async () => { + const mock = await ethers.deployContract('$ERC7739Utils'); + const domain = { + name: 'SomeDomain', + version: '1', + chainId: await ethers.provider.getNetwork().then(({ chainId }) => chainId), + verifyingContract: '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512', + }; + const otherDomain = { + name: 'SomeOtherDomain', + version: '2', + chainId: await ethers.provider.getNetwork().then(({ chainId }) => chainId), + verifyingContract: '0x92C32cadBc39A15212505B5530aA765c441F306f', + }; + const permit = { + owner: '0x1ab5E417d9AF00f1ca9d159007e12c401337a4bb', + spender: '0xD68E96620804446c4B1faB3103A08C98d4A8F55f', + value: 1_000_000n, + nonce: 0n, + deadline: ethers.MaxUint256, + }; + return { mock, domain, otherDomain, permit }; +}; + +describe('ERC7739Utils', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + describe('encodeTypedDataSig', function () { + it('wraps a typed data signature', async function () { + const signature = ethers.randomBytes(65); + const appSeparator = ethers.id('SomeApp'); + const contentsHash = ethers.id('SomeData'); + const contentsDescr = 'SomeType()'; + const encoded = ethers.concat([ + signature, + appSeparator, + contentsHash, + ethers.toUtf8Bytes(contentsDescr), + ethers.toBeHex(contentsDescr.length, 2), + ]); + + await expect( + this.mock.$encodeTypedDataSig(signature, appSeparator, contentsHash, contentsDescr), + ).to.eventually.equal(encoded); + }); + }); + + describe('decodeTypedDataSig', function () { + it('unwraps a typed data signature', async function () { + const signature = ethers.randomBytes(65); + const appSeparator = ethers.id('SomeApp'); + const contentsHash = ethers.id('SomeData'); + const contentsDescr = 'SomeType()'; + const encoded = ethers.concat([ + signature, + appSeparator, + contentsHash, + ethers.toUtf8Bytes(contentsDescr), + ethers.toBeHex(contentsDescr.length, 2), + ]); + + await expect(this.mock.$decodeTypedDataSig(encoded)).to.eventually.deep.equal([ + ethers.hexlify(signature), + appSeparator, + contentsHash, + contentsDescr, + ]); + }); + + it('returns default empty values if the signature is too short', async function () { + const encoded = ethers.randomBytes(65); // DOMAIN_SEPARATOR (32 bytes) + CONTENTS (32 bytes) + CONTENTS_TYPE_LENGTH (2 bytes) - 1 + await expect(this.mock.$decodeTypedDataSig(encoded)).to.eventually.deep.equal([ + '0x', + ethers.ZeroHash, + ethers.ZeroHash, + '', + ]); + }); + + it('returns default empty values if the length is invalid', async function () { + const encoded = ethers.concat([ethers.randomBytes(64), '0x3f']); // Can't be less than 64 bytes + await expect(this.mock.$decodeTypedDataSig(encoded)).to.eventually.deep.equal([ + '0x', + ethers.ZeroHash, + ethers.ZeroHash, + '', + ]); + }); + }); + + describe('personalSignStructhash', function () { + it('should produce a personal signature EIP-712 nested type', async function () { + const text = 'Hello, world!'; + + await expect(this.mock.$personalSignStructHash(ethers.hashMessage(text))).to.eventually.equal( + ethers.TypedDataEncoder.hashStruct('PersonalSign', { PersonalSign }, ERC4337Utils.preparePersonalSign(text)), + ); + }); + }); + + describe('typedDataSignStructHash', function () { + it('should match the typed data nested struct hash', async function () { + const message = ERC4337Utils.prepareSignTypedData(this.permit, this.domain); + + const contentsHash = ethers.TypedDataEncoder.hashStruct('Permit', { Permit }, this.permit); + const hash = ethers.TypedDataEncoder.hashStruct('TypedDataSign', details.allTypes, message); + + const domainBytes = ethers.AbiCoder.defaultAbiCoder().encode( + ['bytes32', 'bytes32', 'uint256', 'address', 'bytes32'], + [ + ethers.id(this.domain.name), + ethers.id(this.domain.version), + this.domain.chainId, + this.domain.verifyingContract, + ethers.ZeroHash, + ], + ); + + await expect( + this.mock.$typedDataSignStructHash( + details.contentsTypeName, + ethers.Typed.string(details.contentsDescr), + contentsHash, + domainBytes, + ), + ).to.eventually.equal(hash); + await expect( + this.mock.$typedDataSignStructHash(details.contentsDescr, contentsHash, domainBytes), + ).to.eventually.equal(hash); + }); + }); + + describe('typedDataSignTypehash', function () { + it('should match', async function () { + const typedDataSignType = ethers.TypedDataEncoder.from(details.allTypes).encodeType('TypedDataSign'); + + await expect( + this.mock.$typedDataSignTypehash( + details.contentsTypeName, + typedDataSignType.slice(typedDataSignType.indexOf(')') + 1), + ), + ).to.eventually.equal(ethers.keccak256(ethers.toUtf8Bytes(typedDataSignType))); + }); + }); + + describe('decodeContentsDescr', function () { + const forbiddenChars = ', )\x00'; + + for (const { descr, contentsDescr, contentTypeName, contentType } of [].concat( + { + descr: 'should parse a valid descriptor (implicit)', + contentsDescr: 'SomeType(address foo,uint256 bar)', + contentTypeName: 'SomeType', + }, + { + descr: 'should parse a valid descriptor (explicit)', + contentsDescr: 'A(C c)B(A a)C(uint256 v)B', + contentTypeName: 'B', + contentType: 'A(C c)B(A a)C(uint256 v)', + }, + { + descr: 'should return nothing for an empty descriptor', + contentsDescr: '', + contentTypeName: null, + }, + { + descr: 'should return nothing if no [(] is present', + contentsDescr: 'SomeType', + contentTypeName: null, + }, + { + descr: 'should return nothing if starts with [(] (implicit)', + contentsDescr: '(SomeType(address foo,uint256 bar)', + contentTypeName: null, + }, + { + descr: 'should return nothing if starts with [(] (explicit)', + contentsDescr: '(SomeType(address foo,uint256 bar)(SomeType', + contentTypeName: null, + }, + forbiddenChars.split('').map(char => ({ + descr: `should return nothing if contains [${char}] (implicit)`, + contentsDescr: `SomeType${char}(address foo,uint256 bar)`, + contentTypeName: null, + })), + forbiddenChars.split('').map(char => ({ + descr: `should return nothing if contains [${char}] (explicit)`, + contentsDescr: `SomeType${char}(address foo,uint256 bar)SomeType${char}`, + contentTypeName: null, + })), + )) { + it(descr, async function () { + await expect(this.mock.$decodeContentsDescr(contentsDescr)).to.eventually.deep.equal([ + contentTypeName ?? '', + contentTypeName ? contentType ?? contentsDescr : '', + ]); + }); + } + }); +}); From 40dfd20ed675c52678751f4027f8c655831ce52b Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:03:25 -0600 Subject: [PATCH 002/110] Add missing mocks --- .../mocks/account/AccountERC7579Mock.sol | 19 ++++++++ .../account/AccountERC7702WithModulesMock.sol | 47 +++++++++++++++++++ .../modules/ERC7579FallbackHandlerMock.sol | 36 ++++++++++++++ .../mocks/account/modules/ERC7579HookMock.sol | 24 ++++++++++ .../account/modules/ERC7579ModuleMock.sol | 28 +++++++++++ .../account/modules/ERC7579ValidatorMock.sol | 45 ++++++++++++++++++ 6 files changed, 199 insertions(+) create mode 100644 contracts/mocks/account/AccountERC7579Mock.sol create mode 100644 contracts/mocks/account/AccountERC7702WithModulesMock.sol create mode 100644 contracts/mocks/account/modules/ERC7579FallbackHandlerMock.sol create mode 100644 contracts/mocks/account/modules/ERC7579HookMock.sol create mode 100644 contracts/mocks/account/modules/ERC7579ModuleMock.sol create mode 100644 contracts/mocks/account/modules/ERC7579ValidatorMock.sol diff --git a/contracts/mocks/account/AccountERC7579Mock.sol b/contracts/mocks/account/AccountERC7579Mock.sol new file mode 100644 index 00000000000..d7fb8850181 --- /dev/null +++ b/contracts/mocks/account/AccountERC7579Mock.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.27; + +import {MODULE_TYPE_VALIDATOR} from "../../interfaces/draft-IERC7579.sol"; +import {AccountERC7579} from "../../account/extensions/AccountERC7579.sol"; +import {AccountERC7579Hooked} from "../../account/extensions/AccountERC7579Hooked.sol"; + +abstract contract AccountERC7579Mock is AccountERC7579 { + constructor(address validator, bytes memory initData) { + _installModule(MODULE_TYPE_VALIDATOR, validator, initData); + } +} + +abstract contract AccountERC7579HookedMock is AccountERC7579Hooked { + constructor(address validator, bytes memory initData) { + _installModule(MODULE_TYPE_VALIDATOR, validator, initData); + } +} diff --git a/contracts/mocks/account/AccountERC7702WithModulesMock.sol b/contracts/mocks/account/AccountERC7702WithModulesMock.sol new file mode 100644 index 00000000000..3610cd7e129 --- /dev/null +++ b/contracts/mocks/account/AccountERC7702WithModulesMock.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.27; + +import {AbstractSigner} from "../../utils/cryptography/AbstractSigner.sol"; +import {Account} from "../../account/Account.sol"; +import {AccountERC7579} from "../../account/extensions/AccountERC7579.sol"; +import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; +import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; +import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; +import {PackedUserOperation} from "../../interfaces/draft-IERC4337.sol"; +import {SignerERC7702} from "../../utils/cryptography/SignerERC7702.sol"; + +abstract contract AccountERC7702WithModulesMock is + Account, + AccountERC7579, + SignerERC7702, + ERC7739, + ERC721Holder, + ERC1155Holder +{ + function _validateUserOp( + PackedUserOperation calldata userOp, + bytes32 userOpHash + ) internal virtual override(Account, AccountERC7579) returns (uint256) { + return super._validateUserOp(userOp, userOpHash); + } + + /// @dev Resolve implementation of ERC-1271 by both ERC7739 and AccountERC7579 to support both schemes. + function isValidSignature( + bytes32 hash, + bytes calldata signature + ) public view virtual override(ERC7739, AccountERC7579) returns (bytes4) { + // ERC-7739 can return the fn selector (success), 0xffffffff (invalid) or 0x77390001 (detection). + // If the return is 0xffffffff, we fallback to validation using ERC-7579 modules. + bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature); + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic; + } + + /// @dev Enable signature using the ERC-7702 signer. + function _rawSignatureValidation( + bytes32 hash, + bytes calldata signature + ) internal view virtual override(AbstractSigner, AccountERC7579, SignerERC7702) returns (bool) { + return SignerERC7702._rawSignatureValidation(hash, signature); + } +} diff --git a/contracts/mocks/account/modules/ERC7579FallbackHandlerMock.sol b/contracts/mocks/account/modules/ERC7579FallbackHandlerMock.sol new file mode 100644 index 00000000000..0f1864407a3 --- /dev/null +++ b/contracts/mocks/account/modules/ERC7579FallbackHandlerMock.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; +import {MODULE_TYPE_FALLBACK} from "../../../interfaces/draft-IERC7579.sol"; + +abstract contract ERC7579FallbackHandlerMock is ERC7579ModuleMock(MODULE_TYPE_FALLBACK) { + event ERC7579FallbackHandlerMockCalled(address account, address sender, uint256 value, bytes data); + + error ERC7579FallbackHandlerMockRevert(); + + function _msgAccount() internal view returns (address) { + return msg.sender; + } + + function _msgSender() internal pure returns (address) { + return address(bytes20(msg.data[msg.data.length - 20:])); + } + + function _msgData() internal pure returns (bytes calldata) { + return msg.data[:msg.data.length - 20]; + } + + function callPayable() public payable { + emit ERC7579FallbackHandlerMockCalled(_msgAccount(), _msgSender(), msg.value, _msgData()); + } + + function callView() public view returns (address, address) { + return (_msgAccount(), _msgSender()); + } + + function callRevert() public pure { + revert ERC7579FallbackHandlerMockRevert(); + } +} diff --git a/contracts/mocks/account/modules/ERC7579HookMock.sol b/contracts/mocks/account/modules/ERC7579HookMock.sol new file mode 100644 index 00000000000..930eceaf46a --- /dev/null +++ b/contracts/mocks/account/modules/ERC7579HookMock.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; +import {MODULE_TYPE_HOOK, IERC7579Hook} from "../../../interfaces/draft-IERC7579.sol"; + +abstract contract ERC7579HookMock is ERC7579ModuleMock(MODULE_TYPE_HOOK), IERC7579Hook { + event PreCheck(address sender, uint256 value, bytes data); + event PostCheck(bytes hookData); + + function preCheck( + address msgSender, + uint256 value, + bytes calldata msgData + ) external returns (bytes memory hookData) { + emit PreCheck(msgSender, value, msgData); + return msgData; + } + + function postCheck(bytes calldata hookData) external { + emit PostCheck(hookData); + } +} diff --git a/contracts/mocks/account/modules/ERC7579ModuleMock.sol b/contracts/mocks/account/modules/ERC7579ModuleMock.sol new file mode 100644 index 00000000000..d9d14245bde --- /dev/null +++ b/contracts/mocks/account/modules/ERC7579ModuleMock.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {IERC7579Module} from "../../../interfaces/draft-IERC7579.sol"; + +abstract contract ERC7579ModuleMock is IERC7579Module { + uint256 private _moduleTypeId; + + event ModuleInstalledReceived(address account, bytes data); + event ModuleUninstalledReceived(address account, bytes data); + + constructor(uint256 moduleTypeId) { + _moduleTypeId = moduleTypeId; + } + + function onInstall(bytes calldata data) public virtual { + emit ModuleInstalledReceived(msg.sender, data); + } + + function onUninstall(bytes calldata data) public virtual { + emit ModuleUninstalledReceived(msg.sender, data); + } + + function isModuleType(uint256 moduleTypeId) external view returns (bool) { + return moduleTypeId == _moduleTypeId; + } +} diff --git a/contracts/mocks/account/modules/ERC7579ValidatorMock.sol b/contracts/mocks/account/modules/ERC7579ValidatorMock.sol new file mode 100644 index 00000000000..3c9bde3ec44 --- /dev/null +++ b/contracts/mocks/account/modules/ERC7579ValidatorMock.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {SignatureChecker} from "../../../utils/cryptography/SignatureChecker.sol"; +import {IERC1271} from "../../../interfaces/IERC1271.sol"; +import {PackedUserOperation} from "../../../interfaces/draft-IERC4337.sol"; +import {IERC7579Module, IERC7579Validator, MODULE_TYPE_VALIDATOR} from "../../../interfaces/draft-IERC7579.sol"; +import {ERC4337Utils} from "../../../account/utils/draft-ERC4337Utils.sol"; +import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; + +abstract contract ERC7579ValidatorMock is ERC7579ModuleMock(MODULE_TYPE_VALIDATOR), IERC7579Validator { + mapping(address sender => address signer) private _associatedSigners; + + function onInstall(bytes calldata data) public virtual override(IERC7579Module, ERC7579ModuleMock) { + _associatedSigners[msg.sender] = address(bytes20(data[0:20])); + super.onInstall(data); + } + + function onUninstall(bytes calldata data) public virtual override(IERC7579Module, ERC7579ModuleMock) { + delete _associatedSigners[msg.sender]; + super.onUninstall(data); + } + + function validateUserOp( + PackedUserOperation calldata userOp, + bytes32 userOpHash + ) public view virtual returns (uint256) { + return + SignatureChecker.isValidSignatureNow(_associatedSigners[msg.sender], userOpHash, userOp.signature) + ? ERC4337Utils.SIG_VALIDATION_SUCCESS + : ERC4337Utils.SIG_VALIDATION_FAILED; + } + + function isValidSignatureWithSender( + address /*sender*/, + bytes32 hash, + bytes calldata signature + ) public view virtual returns (bytes4) { + return + SignatureChecker.isValidSignatureNow(_associatedSigners[msg.sender], hash, signature) + ? IERC1271.isValidSignature.selector + : bytes4(0xffffffff); + } +} From 0bcc52186fb1e39974d81fbd66fefb230855e93e Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:03:59 -0600 Subject: [PATCH 003/110] Adding missing hardhat config --- hardhat.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hardhat.config.js b/hardhat.config.js index 30c19ca6d5b..17ebf45eeb7 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -18,7 +18,7 @@ const { argv } = require('yargs/yargs')() compiler: { alias: 'compileVersion', type: 'string', - default: '0.8.24', + default: '0.8.27', }, src: { alias: 'source', @@ -38,7 +38,7 @@ const { argv } = require('yargs/yargs')() evm: { alias: 'evmVersion', type: 'string', - default: 'cancun', + default: 'prague', }, // Extra modules coverage: { From 7e7502600fdfb8c65ec19a8bf79c76f7add871c2 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:09:04 -0600 Subject: [PATCH 004/110] up --- .../modules/ERC7579FallbackHandlerMock.sol | 36 --------------- contracts/account/modules/ERC7579HookMock.sol | 24 ---------- .../account/modules/ERC7579ModuleMock.sol | 28 ------------ .../account/modules/ERC7579ValidatorMock.sol | 45 ------------------- test/account/Account.behavior.js | 9 +--- 5 files changed, 2 insertions(+), 140 deletions(-) delete mode 100644 contracts/account/modules/ERC7579FallbackHandlerMock.sol delete mode 100644 contracts/account/modules/ERC7579HookMock.sol delete mode 100644 contracts/account/modules/ERC7579ModuleMock.sol delete mode 100644 contracts/account/modules/ERC7579ValidatorMock.sol diff --git a/contracts/account/modules/ERC7579FallbackHandlerMock.sol b/contracts/account/modules/ERC7579FallbackHandlerMock.sol deleted file mode 100644 index b82325bd384..00000000000 --- a/contracts/account/modules/ERC7579FallbackHandlerMock.sol +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; -import {MODULE_TYPE_FALLBACK} from "../../interfaces/draft-IERC7579.sol"; - -abstract contract ERC7579FallbackHandlerMock is ERC7579ModuleMock(MODULE_TYPE_FALLBACK) { - event ERC7579FallbackHandlerMockCalled(address account, address sender, uint256 value, bytes data); - - error ERC7579FallbackHandlerMockRevert(); - - function _msgAccount() internal view returns (address) { - return msg.sender; - } - - function _msgSender() internal pure returns (address) { - return address(bytes20(msg.data[msg.data.length - 20:])); - } - - function _msgData() internal pure returns (bytes calldata) { - return msg.data[:msg.data.length - 20]; - } - - function callPayable() public payable { - emit ERC7579FallbackHandlerMockCalled(_msgAccount(), _msgSender(), msg.value, _msgData()); - } - - function callView() public view returns (address, address) { - return (_msgAccount(), _msgSender()); - } - - function callRevert() public pure { - revert ERC7579FallbackHandlerMockRevert(); - } -} diff --git a/contracts/account/modules/ERC7579HookMock.sol b/contracts/account/modules/ERC7579HookMock.sol deleted file mode 100644 index 375b1f17844..00000000000 --- a/contracts/account/modules/ERC7579HookMock.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; -import {MODULE_TYPE_HOOK, IERC7579Hook} from "../../interfaces/draft-IERC7579.sol"; - -abstract contract ERC7579HookMock is ERC7579ModuleMock(MODULE_TYPE_HOOK), IERC7579Hook { - event PreCheck(address sender, uint256 value, bytes data); - event PostCheck(bytes hookData); - - function preCheck( - address msgSender, - uint256 value, - bytes calldata msgData - ) external returns (bytes memory hookData) { - emit PreCheck(msgSender, value, msgData); - return msgData; - } - - function postCheck(bytes calldata hookData) external { - emit PostCheck(hookData); - } -} diff --git a/contracts/account/modules/ERC7579ModuleMock.sol b/contracts/account/modules/ERC7579ModuleMock.sol deleted file mode 100644 index f55ac34403d..00000000000 --- a/contracts/account/modules/ERC7579ModuleMock.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {IERC7579Module} from "../../interfaces/draft-IERC7579.sol"; - -abstract contract ERC7579ModuleMock is IERC7579Module { - uint256 private _moduleTypeId; - - event ModuleInstalledReceived(address account, bytes data); - event ModuleUninstalledReceived(address account, bytes data); - - constructor(uint256 moduleTypeId) { - _moduleTypeId = moduleTypeId; - } - - function onInstall(bytes calldata data) public virtual { - emit ModuleInstalledReceived(msg.sender, data); - } - - function onUninstall(bytes calldata data) public virtual { - emit ModuleUninstalledReceived(msg.sender, data); - } - - function isModuleType(uint256 moduleTypeId) external view returns (bool) { - return moduleTypeId == _moduleTypeId; - } -} diff --git a/contracts/account/modules/ERC7579ValidatorMock.sol b/contracts/account/modules/ERC7579ValidatorMock.sol deleted file mode 100644 index ef8691ac7de..00000000000 --- a/contracts/account/modules/ERC7579ValidatorMock.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {SignatureChecker} from "../../utils/cryptography/SignatureChecker.sol"; -import {IERC1271} from "../../interfaces/IERC1271.sol"; -import {PackedUserOperation} from "../../interfaces/draft-IERC4337.sol"; -import {IERC7579Module, IERC7579Validator, MODULE_TYPE_VALIDATOR} from "../../interfaces/draft-IERC7579.sol"; -import {ERC4337Utils} from "../../account/utils/draft-ERC4337Utils.sol"; -import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; - -abstract contract ERC7579ValidatorMock is ERC7579ModuleMock(MODULE_TYPE_VALIDATOR), IERC7579Validator { - mapping(address sender => address signer) private _associatedSigners; - - function onInstall(bytes calldata data) public virtual override(IERC7579Module, ERC7579ModuleMock) { - _associatedSigners[msg.sender] = address(bytes20(data[0:20])); - super.onInstall(data); - } - - function onUninstall(bytes calldata data) public virtual override(IERC7579Module, ERC7579ModuleMock) { - delete _associatedSigners[msg.sender]; - super.onUninstall(data); - } - - function validateUserOp( - PackedUserOperation calldata userOp, - bytes32 userOpHash - ) public view virtual returns (uint256) { - return - SignatureChecker.isValidSignatureNow(_associatedSigners[msg.sender], userOpHash, userOp.signature) - ? ERC4337Utils.SIG_VALIDATION_SUCCESS - : ERC4337Utils.SIG_VALIDATION_FAILED; - } - - function isValidSignatureWithSender( - address /*sender*/, - bytes32 hash, - bytes calldata signature - ) public view virtual returns (bytes4) { - return - SignatureChecker.isValidSignatureNow(_associatedSigners[msg.sender], hash, signature) - ? IERC1271.isValidSignature.selector - : bytes4(0xffffffff); - } -} diff --git a/test/account/Account.behavior.js b/test/account/Account.behavior.js index f5648d0de37..eb10fbb0a85 100644 --- a/test/account/Account.behavior.js +++ b/test/account/Account.behavior.js @@ -2,9 +2,7 @@ const { ethers, entrypoint } = require('hardhat'); const { expect } = require('chai'); const { impersonate } = require('../helpers/account'); const { SIG_VALIDATION_SUCCESS, SIG_VALIDATION_FAILURE } = require('../helpers/erc4337'); -const { - shouldSupportInterfaces, -} = require('../utils/introspection/SupportsInterface.behavior'); +const { shouldSupportInterfaces } = require('../utils/introspection/SupportsInterface.behavior'); function shouldBehaveLikeAccountCore() { describe('entryPoint', function () { @@ -143,7 +141,4 @@ function shouldBehaveLikeAccountHolder() { }); } -module.exports = { - shouldBehaveLikeAccountCore, - shouldBehaveLikeAccountHolder, -}; +module.exports = { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder }; From 5fb074c2a18a937520ddedcab63e7d37747ac362 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:13:00 -0600 Subject: [PATCH 005/110] Remove unnecessary files for mocks --- contracts/mocks/account/AccountECDSAMock.sol | 25 ---- .../mocks/account/AccountERC7579Mock.sol | 19 --- .../mocks/account/AccountERC7702Mock.sol | 21 ---- .../account/AccountERC7702WithModulesMock.sol | 47 -------- contracts/mocks/account/AccountMock.sol | 111 ++++++++++++++++++ contracts/mocks/account/AccountP256Mock.sol | 25 ---- contracts/mocks/account/AccountRSAMock.sol | 25 ---- 7 files changed, 111 insertions(+), 162 deletions(-) delete mode 100644 contracts/mocks/account/AccountECDSAMock.sol delete mode 100644 contracts/mocks/account/AccountERC7579Mock.sol delete mode 100644 contracts/mocks/account/AccountERC7702Mock.sol delete mode 100644 contracts/mocks/account/AccountERC7702WithModulesMock.sol delete mode 100644 contracts/mocks/account/AccountP256Mock.sol delete mode 100644 contracts/mocks/account/AccountRSAMock.sol diff --git a/contracts/mocks/account/AccountECDSAMock.sol b/contracts/mocks/account/AccountECDSAMock.sol deleted file mode 100644 index b822d5b3808..00000000000 --- a/contracts/mocks/account/AccountECDSAMock.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {Account} from "../../account/Account.sol"; -import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; -import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; -import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; -import {ERC7821} from "../../account/extensions/ERC7821.sol"; -import {SignerECDSA} from "../../utils/cryptography/SignerECDSA.sol"; - -abstract contract AccountECDSAMock is Account, SignerECDSA, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { - constructor(address signerAddr) { - _setSigner(signerAddr); - } - - /// @inheritdoc ERC7821 - function _erc7821AuthorizedExecutor( - address caller, - bytes32 mode, - bytes calldata executionData - ) internal view virtual override returns (bool) { - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); - } -} diff --git a/contracts/mocks/account/AccountERC7579Mock.sol b/contracts/mocks/account/AccountERC7579Mock.sol deleted file mode 100644 index d7fb8850181..00000000000 --- a/contracts/mocks/account/AccountERC7579Mock.sol +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.27; - -import {MODULE_TYPE_VALIDATOR} from "../../interfaces/draft-IERC7579.sol"; -import {AccountERC7579} from "../../account/extensions/AccountERC7579.sol"; -import {AccountERC7579Hooked} from "../../account/extensions/AccountERC7579Hooked.sol"; - -abstract contract AccountERC7579Mock is AccountERC7579 { - constructor(address validator, bytes memory initData) { - _installModule(MODULE_TYPE_VALIDATOR, validator, initData); - } -} - -abstract contract AccountERC7579HookedMock is AccountERC7579Hooked { - constructor(address validator, bytes memory initData) { - _installModule(MODULE_TYPE_VALIDATOR, validator, initData); - } -} diff --git a/contracts/mocks/account/AccountERC7702Mock.sol b/contracts/mocks/account/AccountERC7702Mock.sol deleted file mode 100644 index c8602771ef8..00000000000 --- a/contracts/mocks/account/AccountERC7702Mock.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {Account} from "../../account/Account.sol"; -import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; -import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; -import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; -import {ERC7821} from "../../account/extensions/ERC7821.sol"; -import {SignerERC7702} from "../../utils/cryptography/SignerERC7702.sol"; - -abstract contract AccountERC7702Mock is Account, SignerERC7702, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { - /// @inheritdoc ERC7821 - function _erc7821AuthorizedExecutor( - address caller, - bytes32 mode, - bytes calldata executionData - ) internal view virtual override returns (bool) { - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); - } -} diff --git a/contracts/mocks/account/AccountERC7702WithModulesMock.sol b/contracts/mocks/account/AccountERC7702WithModulesMock.sol deleted file mode 100644 index 3610cd7e129..00000000000 --- a/contracts/mocks/account/AccountERC7702WithModulesMock.sol +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.27; - -import {AbstractSigner} from "../../utils/cryptography/AbstractSigner.sol"; -import {Account} from "../../account/Account.sol"; -import {AccountERC7579} from "../../account/extensions/AccountERC7579.sol"; -import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; -import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; -import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; -import {PackedUserOperation} from "../../interfaces/draft-IERC4337.sol"; -import {SignerERC7702} from "../../utils/cryptography/SignerERC7702.sol"; - -abstract contract AccountERC7702WithModulesMock is - Account, - AccountERC7579, - SignerERC7702, - ERC7739, - ERC721Holder, - ERC1155Holder -{ - function _validateUserOp( - PackedUserOperation calldata userOp, - bytes32 userOpHash - ) internal virtual override(Account, AccountERC7579) returns (uint256) { - return super._validateUserOp(userOp, userOpHash); - } - - /// @dev Resolve implementation of ERC-1271 by both ERC7739 and AccountERC7579 to support both schemes. - function isValidSignature( - bytes32 hash, - bytes calldata signature - ) public view virtual override(ERC7739, AccountERC7579) returns (bytes4) { - // ERC-7739 can return the fn selector (success), 0xffffffff (invalid) or 0x77390001 (detection). - // If the return is 0xffffffff, we fallback to validation using ERC-7579 modules. - bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature); - return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic; - } - - /// @dev Enable signature using the ERC-7702 signer. - function _rawSignatureValidation( - bytes32 hash, - bytes calldata signature - ) internal view virtual override(AbstractSigner, AccountERC7579, SignerERC7702) returns (bool) { - return SignerERC7702._rawSignatureValidation(hash, signature); - } -} diff --git a/contracts/mocks/account/AccountMock.sol b/contracts/mocks/account/AccountMock.sol index b21c4ee8f25..d7abd906691 100644 --- a/contracts/mocks/account/AccountMock.sol +++ b/contracts/mocks/account/AccountMock.sol @@ -3,12 +3,20 @@ pragma solidity ^0.8.20; import {Account} from "../../account/Account.sol"; +import {AccountERC7579} from "../../account/extensions/AccountERC7579.sol"; +import {AccountERC7579Hooked} from "../../account/extensions/AccountERC7579Hooked.sol"; import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; import {ERC4337Utils} from "../../account/utils/draft-ERC4337Utils.sol"; import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; import {ERC7821} from "../../account/extensions/ERC7821.sol"; +import {MODULE_TYPE_VALIDATOR} from "../../interfaces/draft-IERC7579.sol"; import {PackedUserOperation} from "../../interfaces/draft-IERC4337.sol"; +import {AbstractSigner} from "../../utils/cryptography/AbstractSigner.sol"; +import {SignerECDSA} from "../../utils/cryptography/SignerECDSA.sol"; +import {SignerP256} from "../../utils/cryptography/SignerP256.sol"; +import {SignerRSA} from "../../utils/cryptography/SignerRSA.sol"; +import {SignerERC7702} from "../../utils/cryptography/SignerERC7702.sol"; abstract contract AccountMock is Account, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { /// Validates a user operation with a boolean signature. @@ -25,3 +33,106 @@ abstract contract AccountMock is Account, ERC7739, ERC7821, ERC721Holder, ERC115 return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); } } + +abstract contract AccountECDSAMock is Account, SignerECDSA, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { + constructor(address signerAddr) { + _setSigner(signerAddr); + } + + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} + +abstract contract AccountP256Mock is Account, SignerP256, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { + constructor(bytes32 qx, bytes32 qy) { + _setSigner(qx, qy); + } + + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} + +abstract contract AccountRSAMock is Account, SignerRSA, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { + constructor(bytes memory e, bytes memory n) { + _setSigner(e, n); + } + + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} + +abstract contract AccountERC7702Mock is Account, SignerERC7702, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} + +abstract contract AccountERC7702WithModulesMock is + Account, + AccountERC7579, + SignerERC7702, + ERC7739, + ERC721Holder, + ERC1155Holder +{ + function _validateUserOp( + PackedUserOperation calldata userOp, + bytes32 userOpHash + ) internal virtual override(Account, AccountERC7579) returns (uint256) { + return super._validateUserOp(userOp, userOpHash); + } + + /// @dev Resolve implementation of ERC-1271 by both ERC7739 and AccountERC7579 to support both schemes. + function isValidSignature( + bytes32 hash, + bytes calldata signature + ) public view virtual override(ERC7739, AccountERC7579) returns (bytes4) { + // ERC-7739 can return the fn selector (success), 0xffffffff (invalid) or 0x77390001 (detection). + // If the return is 0xffffffff, we fallback to validation using ERC-7579 modules. + bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature); + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic; + } + + /// @dev Enable signature using the ERC-7702 signer. + function _rawSignatureValidation( + bytes32 hash, + bytes calldata signature + ) internal view virtual override(AbstractSigner, AccountERC7579, SignerERC7702) returns (bool) { + return SignerERC7702._rawSignatureValidation(hash, signature); + } +} + +abstract contract AccountERC7579Mock is AccountERC7579 { + constructor(address validator, bytes memory initData) { + _installModule(MODULE_TYPE_VALIDATOR, validator, initData); + } +} + +abstract contract AccountERC7579HookedMock is AccountERC7579Hooked { + constructor(address validator, bytes memory initData) { + _installModule(MODULE_TYPE_VALIDATOR, validator, initData); + } +} diff --git a/contracts/mocks/account/AccountP256Mock.sol b/contracts/mocks/account/AccountP256Mock.sol deleted file mode 100644 index 5d2b3b3e2da..00000000000 --- a/contracts/mocks/account/AccountP256Mock.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {Account} from "../../account/Account.sol"; -import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; -import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; -import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; -import {ERC7821} from "../../account/extensions/ERC7821.sol"; -import {SignerP256} from "../../utils/cryptography/SignerP256.sol"; - -abstract contract AccountP256Mock is Account, SignerP256, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { - constructor(bytes32 qx, bytes32 qy) { - _setSigner(qx, qy); - } - - /// @inheritdoc ERC7821 - function _erc7821AuthorizedExecutor( - address caller, - bytes32 mode, - bytes calldata executionData - ) internal view virtual override returns (bool) { - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); - } -} diff --git a/contracts/mocks/account/AccountRSAMock.sol b/contracts/mocks/account/AccountRSAMock.sol deleted file mode 100644 index 7322789a12b..00000000000 --- a/contracts/mocks/account/AccountRSAMock.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {Account} from "../../account/Account.sol"; -import {ERC721Holder} from "../../token/ERC721/utils/ERC721Holder.sol"; -import {ERC1155Holder} from "../../token/ERC1155/utils/ERC1155Holder.sol"; -import {ERC7739} from "../../utils/cryptography/ERC7739.sol"; -import {ERC7821} from "../../account/extensions/ERC7821.sol"; -import {SignerRSA} from "../../utils/cryptography/SignerRSA.sol"; - -abstract contract AccountRSAMock is Account, SignerRSA, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { - constructor(bytes memory e, bytes memory n) { - _setSigner(e, n); - } - - /// @inheritdoc ERC7821 - function _erc7821AuthorizedExecutor( - address caller, - bytes32 mode, - bytes calldata executionData - ) internal view virtual override returns (bool) { - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); - } -} From e5df541acb343e3c908c6d7f7fcd3cbf0f0adb9d Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:16:26 -0600 Subject: [PATCH 006/110] Remove more unnecessary mock files --- .../modules/ERC7579FallbackHandlerMock.sol | 36 ------ .../mocks/account/modules/ERC7579HookMock.sol | 24 ---- .../mocks/account/modules/ERC7579Mock.sol | 115 ++++++++++++++++++ .../account/modules/ERC7579ModuleMock.sol | 28 ----- .../account/modules/ERC7579ValidatorMock.sol | 45 ------- 5 files changed, 115 insertions(+), 133 deletions(-) delete mode 100644 contracts/mocks/account/modules/ERC7579FallbackHandlerMock.sol delete mode 100644 contracts/mocks/account/modules/ERC7579HookMock.sol create mode 100644 contracts/mocks/account/modules/ERC7579Mock.sol delete mode 100644 contracts/mocks/account/modules/ERC7579ModuleMock.sol delete mode 100644 contracts/mocks/account/modules/ERC7579ValidatorMock.sol diff --git a/contracts/mocks/account/modules/ERC7579FallbackHandlerMock.sol b/contracts/mocks/account/modules/ERC7579FallbackHandlerMock.sol deleted file mode 100644 index 0f1864407a3..00000000000 --- a/contracts/mocks/account/modules/ERC7579FallbackHandlerMock.sol +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; -import {MODULE_TYPE_FALLBACK} from "../../../interfaces/draft-IERC7579.sol"; - -abstract contract ERC7579FallbackHandlerMock is ERC7579ModuleMock(MODULE_TYPE_FALLBACK) { - event ERC7579FallbackHandlerMockCalled(address account, address sender, uint256 value, bytes data); - - error ERC7579FallbackHandlerMockRevert(); - - function _msgAccount() internal view returns (address) { - return msg.sender; - } - - function _msgSender() internal pure returns (address) { - return address(bytes20(msg.data[msg.data.length - 20:])); - } - - function _msgData() internal pure returns (bytes calldata) { - return msg.data[:msg.data.length - 20]; - } - - function callPayable() public payable { - emit ERC7579FallbackHandlerMockCalled(_msgAccount(), _msgSender(), msg.value, _msgData()); - } - - function callView() public view returns (address, address) { - return (_msgAccount(), _msgSender()); - } - - function callRevert() public pure { - revert ERC7579FallbackHandlerMockRevert(); - } -} diff --git a/contracts/mocks/account/modules/ERC7579HookMock.sol b/contracts/mocks/account/modules/ERC7579HookMock.sol deleted file mode 100644 index 930eceaf46a..00000000000 --- a/contracts/mocks/account/modules/ERC7579HookMock.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; -import {MODULE_TYPE_HOOK, IERC7579Hook} from "../../../interfaces/draft-IERC7579.sol"; - -abstract contract ERC7579HookMock is ERC7579ModuleMock(MODULE_TYPE_HOOK), IERC7579Hook { - event PreCheck(address sender, uint256 value, bytes data); - event PostCheck(bytes hookData); - - function preCheck( - address msgSender, - uint256 value, - bytes calldata msgData - ) external returns (bytes memory hookData) { - emit PreCheck(msgSender, value, msgData); - return msgData; - } - - function postCheck(bytes calldata hookData) external { - emit PostCheck(hookData); - } -} diff --git a/contracts/mocks/account/modules/ERC7579Mock.sol b/contracts/mocks/account/modules/ERC7579Mock.sol new file mode 100644 index 00000000000..bacaf26d8f5 --- /dev/null +++ b/contracts/mocks/account/modules/ERC7579Mock.sol @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {MODULE_TYPE_HOOK, MODULE_TYPE_FALLBACK, MODULE_TYPE_VALIDATOR, IERC7579Hook, IERC7579Module, IERC7579Validator} from "../../../interfaces/draft-IERC7579.sol"; +import {SignatureChecker} from "../../../utils/cryptography/SignatureChecker.sol"; +import {PackedUserOperation} from "../../../interfaces/draft-IERC4337.sol"; +import {IERC1271} from "../../../interfaces/IERC1271.sol"; +import {ERC4337Utils} from "../../../account/utils/draft-ERC4337Utils.sol"; + +abstract contract ERC7579ModuleMock is IERC7579Module { + uint256 private _moduleTypeId; + + event ModuleInstalledReceived(address account, bytes data); + event ModuleUninstalledReceived(address account, bytes data); + + constructor(uint256 moduleTypeId) { + _moduleTypeId = moduleTypeId; + } + + function onInstall(bytes calldata data) public virtual { + emit ModuleInstalledReceived(msg.sender, data); + } + + function onUninstall(bytes calldata data) public virtual { + emit ModuleUninstalledReceived(msg.sender, data); + } + + function isModuleType(uint256 moduleTypeId) external view returns (bool) { + return moduleTypeId == _moduleTypeId; + } +} + +abstract contract ERC7579HookMock is ERC7579ModuleMock(MODULE_TYPE_HOOK), IERC7579Hook { + event PreCheck(address sender, uint256 value, bytes data); + event PostCheck(bytes hookData); + + function preCheck( + address msgSender, + uint256 value, + bytes calldata msgData + ) external returns (bytes memory hookData) { + emit PreCheck(msgSender, value, msgData); + return msgData; + } + + function postCheck(bytes calldata hookData) external { + emit PostCheck(hookData); + } +} + +abstract contract ERC7579FallbackHandlerMock is ERC7579ModuleMock(MODULE_TYPE_FALLBACK) { + event ERC7579FallbackHandlerMockCalled(address account, address sender, uint256 value, bytes data); + + error ERC7579FallbackHandlerMockRevert(); + + function _msgAccount() internal view returns (address) { + return msg.sender; + } + + function _msgSender() internal pure returns (address) { + return address(bytes20(msg.data[msg.data.length - 20:])); + } + + function _msgData() internal pure returns (bytes calldata) { + return msg.data[:msg.data.length - 20]; + } + + function callPayable() public payable { + emit ERC7579FallbackHandlerMockCalled(_msgAccount(), _msgSender(), msg.value, _msgData()); + } + + function callView() public view returns (address, address) { + return (_msgAccount(), _msgSender()); + } + + function callRevert() public pure { + revert ERC7579FallbackHandlerMockRevert(); + } +} + +abstract contract ERC7579ValidatorMock is ERC7579ModuleMock(MODULE_TYPE_VALIDATOR), IERC7579Validator { + mapping(address sender => address signer) private _associatedSigners; + + function onInstall(bytes calldata data) public virtual override(IERC7579Module, ERC7579ModuleMock) { + _associatedSigners[msg.sender] = address(bytes20(data[0:20])); + super.onInstall(data); + } + + function onUninstall(bytes calldata data) public virtual override(IERC7579Module, ERC7579ModuleMock) { + delete _associatedSigners[msg.sender]; + super.onUninstall(data); + } + + function validateUserOp( + PackedUserOperation calldata userOp, + bytes32 userOpHash + ) public view virtual returns (uint256) { + return + SignatureChecker.isValidSignatureNow(_associatedSigners[msg.sender], userOpHash, userOp.signature) + ? ERC4337Utils.SIG_VALIDATION_SUCCESS + : ERC4337Utils.SIG_VALIDATION_FAILED; + } + + function isValidSignatureWithSender( + address /*sender*/, + bytes32 hash, + bytes calldata signature + ) public view virtual returns (bytes4) { + return + SignatureChecker.isValidSignatureNow(_associatedSigners[msg.sender], hash, signature) + ? IERC1271.isValidSignature.selector + : bytes4(0xffffffff); + } +} diff --git a/contracts/mocks/account/modules/ERC7579ModuleMock.sol b/contracts/mocks/account/modules/ERC7579ModuleMock.sol deleted file mode 100644 index d9d14245bde..00000000000 --- a/contracts/mocks/account/modules/ERC7579ModuleMock.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {IERC7579Module} from "../../../interfaces/draft-IERC7579.sol"; - -abstract contract ERC7579ModuleMock is IERC7579Module { - uint256 private _moduleTypeId; - - event ModuleInstalledReceived(address account, bytes data); - event ModuleUninstalledReceived(address account, bytes data); - - constructor(uint256 moduleTypeId) { - _moduleTypeId = moduleTypeId; - } - - function onInstall(bytes calldata data) public virtual { - emit ModuleInstalledReceived(msg.sender, data); - } - - function onUninstall(bytes calldata data) public virtual { - emit ModuleUninstalledReceived(msg.sender, data); - } - - function isModuleType(uint256 moduleTypeId) external view returns (bool) { - return moduleTypeId == _moduleTypeId; - } -} diff --git a/contracts/mocks/account/modules/ERC7579ValidatorMock.sol b/contracts/mocks/account/modules/ERC7579ValidatorMock.sol deleted file mode 100644 index 3c9bde3ec44..00000000000 --- a/contracts/mocks/account/modules/ERC7579ValidatorMock.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {SignatureChecker} from "../../../utils/cryptography/SignatureChecker.sol"; -import {IERC1271} from "../../../interfaces/IERC1271.sol"; -import {PackedUserOperation} from "../../../interfaces/draft-IERC4337.sol"; -import {IERC7579Module, IERC7579Validator, MODULE_TYPE_VALIDATOR} from "../../../interfaces/draft-IERC7579.sol"; -import {ERC4337Utils} from "../../../account/utils/draft-ERC4337Utils.sol"; -import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; - -abstract contract ERC7579ValidatorMock is ERC7579ModuleMock(MODULE_TYPE_VALIDATOR), IERC7579Validator { - mapping(address sender => address signer) private _associatedSigners; - - function onInstall(bytes calldata data) public virtual override(IERC7579Module, ERC7579ModuleMock) { - _associatedSigners[msg.sender] = address(bytes20(data[0:20])); - super.onInstall(data); - } - - function onUninstall(bytes calldata data) public virtual override(IERC7579Module, ERC7579ModuleMock) { - delete _associatedSigners[msg.sender]; - super.onUninstall(data); - } - - function validateUserOp( - PackedUserOperation calldata userOp, - bytes32 userOpHash - ) public view virtual returns (uint256) { - return - SignatureChecker.isValidSignatureNow(_associatedSigners[msg.sender], userOpHash, userOp.signature) - ? ERC4337Utils.SIG_VALIDATION_SUCCESS - : ERC4337Utils.SIG_VALIDATION_FAILED; - } - - function isValidSignatureWithSender( - address /*sender*/, - bytes32 hash, - bytes calldata signature - ) public view virtual returns (bytes4) { - return - SignatureChecker.isValidSignatureNow(_associatedSigners[msg.sender], hash, signature) - ? IERC1271.isValidSignature.selector - : bytes4(0xffffffff); - } -} From 5ad9788aedb0f4181f4f5a44b4813b8f862ad646 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:19:55 -0600 Subject: [PATCH 007/110] replace hardcoded links --- contracts/utils/cryptography/AbstractSigner.sol | 4 ++-- contracts/utils/cryptography/ERC7739.sol | 7 +++---- contracts/utils/cryptography/ERC7739Utils.sol | 7 +++---- contracts/utils/cryptography/SignerECDSA.sol | 3 +-- contracts/utils/cryptography/SignerP256.sol | 3 +-- contracts/utils/cryptography/SignerRSA.sol | 3 +-- 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/contracts/utils/cryptography/AbstractSigner.sol b/contracts/utils/cryptography/AbstractSigner.sol index 6f109f39086..a85fdefe851 100644 --- a/contracts/utils/cryptography/AbstractSigner.sol +++ b/contracts/utils/cryptography/AbstractSigner.sol @@ -13,8 +13,8 @@ abstract contract AbstractSigner { * * WARNING: Implementing a signature validation algorithm is a security-sensitive operation as it involves * cryptographic verification. It is important to review and test thoroughly before deployment. Consider - * using one of the signature verification libraries (https://docs.openzeppelin.com/contracts/api/utils#ECDSA[ECDSA], - * https://docs.openzeppelin.com/contracts/api/utils#P256[P256] or https://docs.openzeppelin.com/contracts/api/utils#RSA[RSA]). + * using one of the signature verification libraries (xref:api:utils#ECDSA[ECDSA], xref:api:utils#P256[P256] + * or xref:api:utils#RSA[RSA]). */ function _rawSignatureValidation(bytes32 hash, bytes calldata signature) internal view virtual returns (bool); } diff --git a/contracts/utils/cryptography/ERC7739.sol b/contracts/utils/cryptography/ERC7739.sol index 555a1367040..749c0b6aca9 100644 --- a/contracts/utils/cryptography/ERC7739.sol +++ b/contracts/utils/cryptography/ERC7739.sol @@ -18,10 +18,9 @@ import {ERC7739Utils} from "./ERC7739Utils.sol"; * This contract requires implementing the {_rawSignatureValidation} function, which passes the wrapped message hash, * which may be either an typed data or a personal sign nested type. * - * NOTE: https://docs.openzeppelin.com/contracts/api/utils#EIP712[EIP-712] uses - * https://docs.openzeppelin.com/contracts/api/utils#ShortStrings[ShortStrings] to optimize gas costs for - * short strings (up to 31 characters). Consider that strings longer than that will use storage, which - * may limit the ability of the signer to be used within the ERC-4337 validation phase (due to + * NOTE: xref:api:utils#EIP712[EIP-712] uses xref:api:utils#ShortStrings[ShortStrings] to optimize gas + * costs for short strings (up to 31 characters). Consider that strings longer than that will use storage, + * which may limit the ability of the signer to be used within the ERC-4337 validation phase (due to * https://eips.ethereum.org/EIPS/eip-7562#storage-rules[ERC-7562 storage access rules]). */ abstract contract ERC7739 is AbstractSigner, EIP712, IERC1271 { diff --git a/contracts/utils/cryptography/ERC7739Utils.sol b/contracts/utils/cryptography/ERC7739Utils.sol index f4ed63b48fc..e15749a7a02 100644 --- a/contracts/utils/cryptography/ERC7739Utils.sol +++ b/contracts/utils/cryptography/ERC7739Utils.sol @@ -9,8 +9,7 @@ import {Calldata} from "../Calldata.sol"; * that are specific to an EIP-712 domain. * * This library provides methods to wrap, unwrap and operate over typed data signatures with a defensive - * rehashing mechanism that includes the application's - * https://docs.openzeppelin.com/contracts/api/utils#EIP712-_domainSeparatorV4[EIP-712] + * rehashing mechanism that includes the application's xref:api:utils#EIP712-_domainSeparatorV4[EIP-712] * and preserves readability of the signed content using an EIP-712 nested approach. * * A smart contract domain can validate a signature for a typed data structure in two ways: @@ -21,8 +20,8 @@ import {Calldata} from "../Calldata.sol"; * NOTE: A provider for a smart contract wallet would need to return this signature as the * result of a call to `personal_sign` or `eth_signTypedData`, and this may be unsupported by * API clients that expect a return value of 129 bytes, or specifically the `r,s,v` parameters - * of an https://docs.openzeppelin.com/contracts/api/utils#ECDSA[ECDSA] signature, as is for - * example specified for https://docs.openzeppelin.com/contracts/api/utils#EIP712[EIP-712]. + * of an xref:api:utils#ECDSA[ECDSA] signature, as is for example specified for + * xref:api:utils#EIP712[EIP-712]. */ library ERC7739Utils { /** diff --git a/contracts/utils/cryptography/SignerECDSA.sol b/contracts/utils/cryptography/SignerECDSA.sol index 320940ecc61..ca6442c6277 100644 --- a/contracts/utils/cryptography/SignerECDSA.sol +++ b/contracts/utils/cryptography/SignerECDSA.sol @@ -6,8 +6,7 @@ import {ECDSA} from "../cryptography/ECDSA.sol"; import {AbstractSigner} from "./AbstractSigner.sol"; /** - * @dev Implementation of {AbstractSigner} using - * https://docs.openzeppelin.com/contracts/api/utils#ECDSA[ECDSA] signatures. + * @dev Implementation of {AbstractSigner} using xref:api:utils#ECDSA[ECDSA] signatures. * * For {Account} usage, a {_setSigner} function is provided to set the {signer} address. * Doing so is easier for a factory, who is likely to use initializable clones of this contract. diff --git a/contracts/utils/cryptography/SignerP256.sol b/contracts/utils/cryptography/SignerP256.sol index 591c9996ffb..b28e90ad857 100644 --- a/contracts/utils/cryptography/SignerP256.sol +++ b/contracts/utils/cryptography/SignerP256.sol @@ -6,8 +6,7 @@ import {P256} from "./P256.sol"; import {AbstractSigner} from "./AbstractSigner.sol"; /** - * @dev Implementation of {AbstractSigner} using - * https://docs.openzeppelin.com/contracts/api/utils#P256[P256] signatures. + * @dev Implementation of {AbstractSigner} using xref:api:utils#P256[P256] signatures. * * For {Account} usage, a {_setSigner} function is provided to set the {signer} public key. * Doing so is easier for a factory, who is likely to use initializable clones of this contract. diff --git a/contracts/utils/cryptography/SignerRSA.sol b/contracts/utils/cryptography/SignerRSA.sol index d8182156f3d..481bb182518 100644 --- a/contracts/utils/cryptography/SignerRSA.sol +++ b/contracts/utils/cryptography/SignerRSA.sol @@ -6,8 +6,7 @@ import {RSA} from "./RSA.sol"; import {AbstractSigner} from "./AbstractSigner.sol"; /** - * @dev Implementation of {AbstractSigner} using - * https://docs.openzeppelin.com/contracts/api/utils#RSA[RSA] signatures. + * @dev Implementation of {AbstractSigner} using xref:api:utils#RSA[RSA] signatures. * * For {Account} usage, a {_setSigner} function is provided to set the {signer} public key. * Doing so is easier for a factory, who is likely to use initializable clones of this contract. From 7090f6784cb66d674918eb207b0775dd2a8da918 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:23:36 -0600 Subject: [PATCH 008/110] lockfile --- package-lock.json | 609 +++++++++++++++++++++++++--------------------- 1 file changed, 330 insertions(+), 279 deletions(-) diff --git a/package-lock.json b/package-lock.json index 759adde2c5e..b0d21cd683a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,11 +24,11 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.4", + "ethers": "^6.13.6-beta.1", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", - "hardhat": "^2.22.7", + "hardhat": "^2.23.0", "hardhat-exposed": "^0.3.15", "hardhat-gas-reporter": "^2.1.0", "hardhat-ignore-warnings": "^0.2.11", @@ -1441,46 +1441,6 @@ "node": ">=6 <7 || >=8" } }, - "node_modules/@metamask/eth-sig-util": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", - "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", - "dev": true, - "dependencies": { - "ethereumjs-abi": "^0.6.8", - "ethereumjs-util": "^6.2.1", - "ethjs-util": "^0.1.6", - "tweetnacl": "^1.0.3", - "tweetnacl-util": "^0.15.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@metamask/eth-sig-util/node_modules/@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@metamask/eth-sig-util/node_modules/ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "dev": true, - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, "node_modules/@noble/curves": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", @@ -1553,159 +1513,86 @@ } }, "node_modules/@nomicfoundation/edr": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.5.2.tgz", - "integrity": "sha512-hW/iLvUQZNTVjFyX/I40rtKvvDOqUEyIi96T28YaLfmPL+3LW2lxmYLUXEJ6MI14HzqxDqrLyhf6IbjAa2r3Dw==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.10.0.tgz", + "integrity": "sha512-ed9qHSNssgh+0hYUx4ilDoMxxgf/sNT8SjnzgmA5A/LSXHaq2ax68bkdQ8otLYTlxHCO9BS5Nhb8bfajV4FZeA==", "dev": true, - "license": "MIT", "dependencies": { - "@nomicfoundation/edr-darwin-arm64": "0.5.2", - "@nomicfoundation/edr-darwin-x64": "0.5.2", - "@nomicfoundation/edr-linux-arm64-gnu": "0.5.2", - "@nomicfoundation/edr-linux-arm64-musl": "0.5.2", - "@nomicfoundation/edr-linux-x64-gnu": "0.5.2", - "@nomicfoundation/edr-linux-x64-musl": "0.5.2", - "@nomicfoundation/edr-win32-x64-msvc": "0.5.2" + "@nomicfoundation/edr-darwin-arm64": "0.10.0", + "@nomicfoundation/edr-darwin-x64": "0.10.0", + "@nomicfoundation/edr-linux-arm64-gnu": "0.10.0", + "@nomicfoundation/edr-linux-arm64-musl": "0.10.0", + "@nomicfoundation/edr-linux-x64-gnu": "0.10.0", + "@nomicfoundation/edr-linux-x64-musl": "0.10.0", + "@nomicfoundation/edr-win32-x64-msvc": "0.10.0" }, "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-darwin-arm64": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.5.2.tgz", - "integrity": "sha512-Gm4wOPKhbDjGTIRyFA2QUAPfCXA1AHxYOKt3yLSGJkQkdy9a5WW+qtqKeEKHc/+4wpJSLtsGQfpzyIzggFfo/A==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.10.0.tgz", + "integrity": "sha512-n0N+CVM4LKN9QeGZ5irr94Q4vwSs4u7W6jfuhNLmx1cpUxwE9RpeW+ym93JXDv62iVsbekeI5VsUEBHy0hymtA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-darwin-x64": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.5.2.tgz", - "integrity": "sha512-ClyABq2dFCsrYEED3/UIO0c7p4H1/4vvlswFlqUyBpOkJccr75qIYvahOSJRM62WgUFRhbSS0OJXFRwc/PwmVg==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.10.0.tgz", + "integrity": "sha512-nmImWM/3qWopYzOmicMzK/MF3rFKpm2Biuc8GpQYTLjdXhmItpP9JwEPyjbAWv/1HI09C2pRzgNzKfTxoIgJ6w==", "dev": true, - "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-linux-arm64-gnu": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.5.2.tgz", - "integrity": "sha512-HWMTVk1iOabfvU2RvrKLDgtFjJZTC42CpHiw2h6rfpsgRqMahvIlx2jdjWYzFNy1jZKPTN1AStQ/91MRrg5KnA==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.10.0.tgz", + "integrity": "sha512-B/N1IyrCU7J6H4QckkQ1cSWAq1jSrJcXpO8GzRaQD1bgOOvg8wrUOrCD+Mfw7MLa6+X9vdZoXtPZOaaOQ9LmhA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-linux-arm64-musl": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.5.2.tgz", - "integrity": "sha512-CwsQ10xFx/QAD5y3/g5alm9+jFVuhc7uYMhrZAu9UVF+KtVjeCvafj0PaVsZ8qyijjqVuVsJ8hD1x5ob7SMcGg==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.10.0.tgz", + "integrity": "sha512-NA9DFLB0LzcKy9mTCUzgnRDbmmSfW0CdO22ySwOy+MKt4Cr9eJi+XR5ZH933Rxpi6BWNkSPeS2ECETE25sJT3w==", "dev": true, - "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-linux-x64-gnu": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.5.2.tgz", - "integrity": "sha512-CWVCEdhWJ3fmUpzWHCRnC0/VLBDbqtqTGTR6yyY1Ep3S3BOrHEAvt7h5gx85r2vLcztisu2vlDq51auie4IU1A==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.10.0.tgz", + "integrity": "sha512-bDrbRTA9qZ9wSw5mqa8VpLFbf6ue2Z4qmRd08404eKm8RyBEFxjdHflFzCx46gz/Td0e+GLXy6KTVDj5D29r8w==", "dev": true, - "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-linux-x64-musl": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.5.2.tgz", - "integrity": "sha512-+aJDfwhkddy2pP5u1ISg3IZVAm0dO836tRlDTFWtvvSMQ5hRGqPcWwlsbobhDQsIxhPJyT7phL0orCg5W3WMeA==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.10.0.tgz", + "integrity": "sha512-wx7yOlC/hx4N1xuIeh5cAebpzCTx8ZH8/z0IyYMf2t4v52KHERz4IyzBz5OLfd+0IqTRg8ZU5EnFBacIoPeP/g==", "dev": true, - "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-win32-x64-msvc": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.5.2.tgz", - "integrity": "sha512-CcvvuA3sAv7liFNPsIR/68YlH6rrybKzYttLlMr80d4GKJjwJ5OKb3YgE6FdZZnOfP19HEHhsLcE0DPLtY3r0w==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.10.0.tgz", + "integrity": "sha512-DpBdVMimb+BUEs0E+nLGQ5JFHdGHyxQQNA+nh9V1eKtgarsV21S6br/d1vlQBMLQqkIzwmc6n+/O9Zjk2KfB3g==", "dev": true, - "license": "MIT", "engines": { "node": ">= 18" } }, - "node_modules/@nomicfoundation/ethereumjs-common": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz", - "integrity": "sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-util": "9.0.4" - } - }, - "node_modules/@nomicfoundation/ethereumjs-rlp": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz", - "integrity": "sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw==", - "dev": true, - "bin": { - "rlp": "bin/rlp.cjs" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@nomicfoundation/ethereumjs-tx": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz", - "integrity": "sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-common": "4.0.4", - "@nomicfoundation/ethereumjs-rlp": "5.0.4", - "@nomicfoundation/ethereumjs-util": "9.0.4", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "c-kzg": "^2.1.2" - }, - "peerDependenciesMeta": { - "c-kzg": { - "optional": true - } - } - }, - "node_modules/@nomicfoundation/ethereumjs-util": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz", - "integrity": "sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "5.0.4", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "c-kzg": "^2.1.2" - }, - "peerDependenciesMeta": { - "c-kzg": { - "optional": true - } - } - }, "node_modules/@nomicfoundation/hardhat-chai-matchers": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.6.tgz", @@ -4676,40 +4563,6 @@ "setimmediate": "^1.0.5" } }, - "node_modules/ethereumjs-abi": { - "version": "0.6.8", - "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", - "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", - "dev": true, - "dependencies": { - "bn.js": "^4.11.8", - "ethereumjs-util": "^6.0.0" - } - }, - "node_modules/ethereumjs-abi/node_modules/@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/ethereumjs-abi/node_modules/ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "dev": true, - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, "node_modules/ethereumjs-util": { "version": "7.1.5", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", @@ -4733,9 +4586,9 @@ "dev": true }, "node_modules/ethers": { - "version": "6.13.4", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.4.tgz", - "integrity": "sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA==", + "version": "6.13.6-beta.1", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.6-beta.1.tgz", + "integrity": "sha512-sJZklf+m7QrlzYnOFbR0qHPqgYHeevbY98VIhzvnSdzhJVN/nNV/skKc/4wjyxbWRhK9t7r6ENcwUwLPjfxTLw==", "dev": true, "funding": [ { @@ -4747,7 +4600,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@adraffy/ens-normalize": "1.10.1", "@noble/curves": "1.2.0", @@ -4842,20 +4694,6 @@ "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==", "dev": true }, - "node_modules/ethjs-util": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", - "dev": true, - "dependencies": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, "node_modules/eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", @@ -5544,18 +5382,14 @@ } }, "node_modules/hardhat": { - "version": "2.22.7", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.22.7.tgz", - "integrity": "sha512-nrXQAl+qUr75TsCLDo8P41YXLc+5U7qQMMCIrbbmy1/uQaVPncdjDrD5BR0CENvHRj7EBqO+JkofpozXoIfJKg==", + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.23.0.tgz", + "integrity": "sha512-xnORx1LgX46TxylOFme96JmSAIjXuHUVpOlUnaCt8MKMGsgy0NGsfPo5rJI/ncCBPLFLURGfZUQ2Uc6ZYN4kYg==", "dev": true, - "license": "MIT", "dependencies": { + "@ethereumjs/util": "^9.1.0", "@ethersproject/abi": "^5.1.2", - "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/edr": "^0.5.0", - "@nomicfoundation/ethereumjs-common": "4.0.4", - "@nomicfoundation/ethereumjs-tx": "5.0.4", - "@nomicfoundation/ethereumjs-util": "9.0.4", + "@nomicfoundation/edr": "^0.10.0", "@nomicfoundation/solidity-analyzer": "^0.1.0", "@sentry/node": "^5.18.1", "@types/bn.js": "^5.1.0", @@ -5564,31 +5398,32 @@ "aggregate-error": "^3.0.0", "ansi-escapes": "^4.3.0", "boxen": "^5.1.2", - "chalk": "^2.4.2", - "chokidar": "^3.4.0", + "chokidar": "^4.0.0", "ci-info": "^2.0.0", "debug": "^4.1.1", "enquirer": "^2.3.0", "env-paths": "^2.2.0", "ethereum-cryptography": "^1.0.3", - "ethereumjs-abi": "^0.6.8", - "find-up": "^2.1.0", + "find-up": "^5.0.0", "fp-ts": "1.19.3", "fs-extra": "^7.0.1", - "glob": "7.2.0", "immutable": "^4.0.0-rc.12", "io-ts": "1.10.4", + "json-stream-stringify": "^3.1.4", "keccak": "^3.0.2", "lodash": "^4.17.11", + "micro-eth-signer": "^0.14.0", "mnemonist": "^0.38.0", "mocha": "^10.0.0", "p-map": "^4.0.0", + "picocolors": "^1.1.0", "raw-body": "^2.4.1", "resolve": "1.17.0", "semver": "^6.3.0", "solc": "0.8.26", "source-map-support": "^0.5.13", "stacktrace-parser": "^0.1.10", + "tinyglobby": "^0.2.6", "tsort": "0.0.1", "undici": "^5.14.0", "uuid": "^8.3.2", @@ -5953,6 +5788,106 @@ "node": ">=10" } }, + "node_modules/hardhat/node_modules/@ethereumjs/rlp": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz", + "integrity": "sha512-DziebCdg4JpGlEqEdGgXmjqcFoJi+JGulUXwEjsZGAscAQ7MyD/7LE/GVCP29vEQxKc7AAwjT3A2ywHp2xfoCA==", + "dev": true, + "bin": { + "rlp": "bin/rlp.cjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/hardhat/node_modules/@ethereumjs/util": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-9.1.0.tgz", + "integrity": "sha512-XBEKsYqLGXLah9PNJbgdkigthkG7TAGvlD/sH12beMXEyHDyigfcbdvHhmLyDWgDyOJn4QwiQUaF7yeuhnjdog==", + "dev": true, + "dependencies": { + "@ethereumjs/rlp": "^5.0.2", + "ethereum-cryptography": "^2.2.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/hardhat/node_modules/@ethereumjs/util/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/hardhat/node_modules/@ethereumjs/util/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "dev": true, + "dependencies": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/hardhat/node_modules/@ethereumjs/util/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dev": true, + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/hardhat/node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "dev": true, + "dependencies": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } + }, + "node_modules/hardhat/node_modules/@noble/curves": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", + "dev": true, + "dependencies": { + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/hardhat/node_modules/@noble/curves/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/hardhat/node_modules/@noble/hashes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", @@ -5998,6 +5933,21 @@ "@scure/base": "~1.1.0" } }, + "node_modules/hardhat/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/hardhat/node_modules/ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", @@ -6017,92 +5967,77 @@ } }, "node_modules/hardhat/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hardhat/node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, - "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": "*" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hardhat/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hardhat/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "p-try": "^1.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hardhat/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { - "p-limit": "^1.1.0" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=4" - } - }, - "node_modules/hardhat/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "dev": true, - "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/hardhat/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "node_modules/hardhat/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true, "engines": { - "node": ">=4" + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/hardhat/node_modules/semver": { @@ -6126,6 +6061,18 @@ "node": ">=14.0" } }, + "node_modules/hardhat/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -6910,6 +6857,15 @@ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, + "node_modules/json-stream-stringify": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/json-stream-stringify/-/json-stream-stringify-3.1.6.tgz", + "integrity": "sha512-x7fpwxOkbhFCaJDJ8vb1fBY3DdSa4AlITaz+HHILQJzdPMnHEFjxPwVUi1ALIbcIxDE0PNe/0i7frnY8QnBQog==", + "dev": true, + "engines": { + "node": ">=7.10.1" + } + }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -7554,12 +7510,71 @@ "node": ">= 8" } }, + "node_modules/micro-eth-signer": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/micro-eth-signer/-/micro-eth-signer-0.14.0.tgz", + "integrity": "sha512-5PLLzHiVYPWClEvZIXXFu5yutzpadb73rnQCpUqIHu3No3coFuWQNfE5tkBQJ7djuLYl6aRLaS0MgWJYGoqiBw==", + "dev": true, + "dependencies": { + "@noble/curves": "~1.8.1", + "@noble/hashes": "~1.7.1", + "micro-packed": "~0.7.2" + } + }, + "node_modules/micro-eth-signer/node_modules/@noble/curves": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.2.tgz", + "integrity": "sha512-vnI7V6lFNe0tLAuJMu+2sX+FcL14TaCWy1qiczg1VwRmPrpQCdq5ESXQMqUc2tluRNf6irBXrWbl1mGN8uaU/g==", + "dev": true, + "dependencies": { + "@noble/hashes": "1.7.2" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/micro-eth-signer/node_modules/@noble/hashes": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.2.tgz", + "integrity": "sha512-biZ0NUSxyjLLqo6KxEJ1b+C2NAx0wtDoFvCaXHGgUkeHzf3Xc1xKumFKREuT7f7DARNZ/slvYUwFG6B0f2b6hQ==", + "dev": true, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/micro-ftch": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/micro-ftch/-/micro-ftch-0.3.1.tgz", "integrity": "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==", "dev": true }, + "node_modules/micro-packed": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/micro-packed/-/micro-packed-0.7.3.tgz", + "integrity": "sha512-2Milxs+WNC00TRlem41oRswvw31146GiSaoCT7s3Xi2gMUglW5QBeqlQaZeHr5tJx9nm3i57LNXPqxOOaWtTYg==", + "dev": true, + "dependencies": { + "@scure/base": "~1.2.5" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/micro-packed/node_modules/@scure/base": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.5.tgz", + "integrity": "sha512-9rE6EOVeIQzt5TSu4v+K523F8u6DhBsoZWPGKlnCshhlDhy0kJzUX4V+tr2dWmzF1GdekvThABoEQBGBQI7xZw==", + "dev": true, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -8562,6 +8577,12 @@ "node": ">=0.12" } }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -10746,6 +10767,48 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "node_modules/tinyglobby": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", + "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", + "dev": true, + "dependencies": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "dev": true, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -10953,18 +11016,6 @@ "node": ">=8" } }, - "node_modules/tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", - "dev": true - }, - "node_modules/tweetnacl-util": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", - "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", - "dev": true - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", From c4af1d7c6caad81a36a5c929a647bcfca7045a44 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:26:08 -0600 Subject: [PATCH 009/110] update ethers --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b0d21cd683a..634bca783d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4586,9 +4586,9 @@ "dev": true }, "node_modules/ethers": { - "version": "6.13.6-beta.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.6-beta.1.tgz", - "integrity": "sha512-sJZklf+m7QrlzYnOFbR0qHPqgYHeevbY98VIhzvnSdzhJVN/nNV/skKc/4wjyxbWRhK9t7r6ENcwUwLPjfxTLw==", + "version": "6.13.7", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.7.tgz", + "integrity": "sha512-qbaJ0uIrjh+huP1Lad2f2QtzW5dcqSVjIzVH6yWB4dKoMuj2WqYz5aMeeQTCNpAKgTJBM5J9vcc2cYJ23UAimQ==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index 423e1a5a9c7..636236c1288 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.6-beta.1", + "ethers": "^6.13.7", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", From aa8f29bcf7d5a2c0934447999371923e3748617a Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:27:11 -0600 Subject: [PATCH 010/110] add missing interface --- contracts/interfaces/IERC7821.sol | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 contracts/interfaces/IERC7821.sol diff --git a/contracts/interfaces/IERC7821.sol b/contracts/interfaces/IERC7821.sol new file mode 100644 index 00000000000..1607caa5038 --- /dev/null +++ b/contracts/interfaces/IERC7821.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +/** + * @dev Interface for minimal batch executor. + */ +interface IERC7821 { + /** + * @dev Executes the calls in `executionData`. + * Reverts and bubbles up error if any call fails. + * + * `executionData` encoding: + * - If `opData` is empty, `executionData` is simply `abi.encode(calls)`. + * - Else, `executionData` is `abi.encode(calls, opData)`. + * See: https://eips.ethereum.org/EIPS/eip-7579 + * + * Supported modes: + * - `bytes32(0x01000000000000000000...)`: does not support optional `opData`. + * - `bytes32(0x01000000000078210001...)`: supports optional `opData`. + * + * Authorization checks: + * - If `opData` is empty, the implementation SHOULD require that + * `msg.sender == address(this)`. + * - If `opData` is not empty, the implementation SHOULD use the signature + * encoded in `opData` to determine if the caller can perform the execution. + * + * `opData` may be used to store additional data for authentication, + * paymaster data, gas limits, etc. + */ + function execute(bytes32 mode, bytes calldata executionData) external payable; + + /** + * @dev This function is provided for frontends to detect support. + * Only returns true for: + * - `bytes32(0x01000000000000000000...)`: does not support optional `opData`. + * - `bytes32(0x01000000000078210001...)`: supports optional `opData`. + */ + function supportsExecutionMode(bytes32 mode) external view returns (bool); +} From 415c00d1642bab5921c83bce64aedabbfb654f9c Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:36:22 -0600 Subject: [PATCH 011/110] Add changesets --- .changeset/clean-ways-push.md | 5 ++++ .changeset/funny-years-yawn.md | 5 ++++ .changeset/lazy-poets-cheer.md | 5 ++++ .changeset/lucky-donuts-scream.md | 5 ++++ .changeset/proud-tables-sip.md | 5 ++++ .changeset/rotten-apes-lie.md | 5 ++++ .changeset/strong-points-change.md | 5 ++++ .changeset/tame-bears-mix.md | 5 ++++ .../mocks/utils/cryptography/ERC7739Mock.sol | 28 +++++++++++++++++++ 9 files changed, 68 insertions(+) create mode 100644 .changeset/clean-ways-push.md create mode 100644 .changeset/funny-years-yawn.md create mode 100644 .changeset/lazy-poets-cheer.md create mode 100644 .changeset/lucky-donuts-scream.md create mode 100644 .changeset/proud-tables-sip.md create mode 100644 .changeset/rotten-apes-lie.md create mode 100644 .changeset/strong-points-change.md create mode 100644 .changeset/tame-bears-mix.md create mode 100644 contracts/mocks/utils/cryptography/ERC7739Mock.sol diff --git a/.changeset/clean-ways-push.md b/.changeset/clean-ways-push.md new file mode 100644 index 00000000000..1f33ae16bdb --- /dev/null +++ b/.changeset/clean-ways-push.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`AccountERC7579`: Extension of `AccountCore` that implements support for ERC-7579 modules of type executor, validator, and fallback handler. diff --git a/.changeset/funny-years-yawn.md b/.changeset/funny-years-yawn.md new file mode 100644 index 00000000000..981f722e312 --- /dev/null +++ b/.changeset/funny-years-yawn.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`Account`: Added a simple ERC-4337 account implementation with minimal logic to process user operations. diff --git a/.changeset/lazy-poets-cheer.md b/.changeset/lazy-poets-cheer.md new file mode 100644 index 00000000000..99804cca94b --- /dev/null +++ b/.changeset/lazy-poets-cheer.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`SignerERC7702`: Implementation of `AbstractSigner` for Externally Owned Accounts (EOAs). Useful with ERC-7702. diff --git a/.changeset/lucky-donuts-scream.md b/.changeset/lucky-donuts-scream.md new file mode 100644 index 00000000000..2f56b7c83b2 --- /dev/null +++ b/.changeset/lucky-donuts-scream.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`ERC7739Signer`: An abstract contract to validate signatures following the rehashing scheme from `ERC7739Utils`. diff --git a/.changeset/proud-tables-sip.md b/.changeset/proud-tables-sip.md new file mode 100644 index 00000000000..5a199d0ef41 --- /dev/null +++ b/.changeset/proud-tables-sip.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`ERC7739Utils`: Add a library that implements a defensive rehashing mechanism to prevent replayability of smart contract signatures based on the ERC-7739. diff --git a/.changeset/rotten-apes-lie.md b/.changeset/rotten-apes-lie.md new file mode 100644 index 00000000000..324d39314b0 --- /dev/null +++ b/.changeset/rotten-apes-lie.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`IERC7821`, `ERC7821`: Interface and logic for minimal batch execution. No support for additional `opData` is included. diff --git a/.changeset/strong-points-change.md b/.changeset/strong-points-change.md new file mode 100644 index 00000000000..8f37f38e2e3 --- /dev/null +++ b/.changeset/strong-points-change.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`AccountERC7579Hooked`: Extension of `AccountERC7579` that implements support for ERC-7579 hook modules. diff --git a/.changeset/tame-bears-mix.md b/.changeset/tame-bears-mix.md new file mode 100644 index 00000000000..4a52e7bb13e --- /dev/null +++ b/.changeset/tame-bears-mix.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`AbstractSigner`, `SignerECDSA`, `SignerP256`, and `SignerRSA`: Add an abstract contract, and various implementations, for contracts that deal with signature verification. Used by AccountCore and `ERC7739Utils. diff --git a/contracts/mocks/utils/cryptography/ERC7739Mock.sol b/contracts/mocks/utils/cryptography/ERC7739Mock.sol new file mode 100644 index 00000000000..1f2416df2c6 --- /dev/null +++ b/contracts/mocks/utils/cryptography/ERC7739Mock.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {ECDSA} from "../../../utils/cryptography/ECDSA.sol"; +import {EIP712} from "../../../utils/cryptography/EIP712.sol"; +import {ERC7739} from "../../../utils/cryptography/ERC7739.sol"; +import {SignerECDSA} from "../../../utils/cryptography/SignerECDSA.sol"; +import {SignerP256} from "../../../utils/cryptography/SignerP256.sol"; +import {SignerRSA} from "../../../utils/cryptography/SignerRSA.sol"; + +contract ERC7739ECDSAMock is ERC7739, SignerECDSA { + constructor(address signerAddr) EIP712("ERC7739ECDSA", "1") { + _setSigner(signerAddr); + } +} + +contract ERC7739P256Mock is ERC7739, SignerP256 { + constructor(bytes32 qx, bytes32 qy) EIP712("ERC7739P256", "1") { + _setSigner(qx, qy); + } +} + +contract ERC7739RSAMock is ERC7739, SignerRSA { + constructor(bytes memory e, bytes memory n) EIP712("ERC7739RSA", "1") { + _setSigner(e, n); + } +} From f60aa3ad18a6db319e4e533ec577a9c1081e5c81 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:40:09 -0600 Subject: [PATCH 012/110] up --- package-lock.json | 2 +- test/account/AccountERC7702.t.sol | 2 +- test/helpers/erc4337.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 634bca783d1..2259e065b18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.6-beta.1", + "ethers": "^6.13.7", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", diff --git a/test/account/AccountERC7702.t.sol b/test/account/AccountERC7702.t.sol index 1aac3427716..dd58668cefe 100644 --- a/test/account/AccountERC7702.t.sol +++ b/test/account/AccountERC7702.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; import {Test} from "forge-std/Test.sol"; -import {AccountERC7702Mock} from "@openzeppelin/contracts/mocks/account/AccountERC7702Mock.sol"; +import {AccountERC7702Mock} from "@openzeppelin/contracts/mocks/account/AccountMock.sol"; import {CallReceiverMock} from "@openzeppelin/contracts/mocks/CallReceiverMock.sol"; import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; import {ERC7579Utils, Execution, Mode, ModeSelector, ModePayload} from "@openzeppelin/contracts/account/utils/draft-ERC7579Utils.sol"; diff --git a/test/helpers/erc4337.js b/test/helpers/erc4337.js index a33fa3c4e75..0d5421bec75 100644 --- a/test/helpers/erc4337.js +++ b/test/helpers/erc4337.js @@ -1,4 +1,4 @@ -const { ethers } = require('hardhat'); +const { ethers, config, entrypoint, senderCreator } = require('hardhat'); const SIG_VALIDATION_SUCCESS = '0x0000000000000000000000000000000000000000'; const SIG_VALIDATION_FAILURE = '0x0000000000000000000000000000000000000001'; From 087a844adc3e0e30d059ee6b271fe4cd26663971 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:43:29 -0600 Subject: [PATCH 013/110] up --- contracts/utils/cryptography/ERC7739.sol | 4 +- contracts/utils/cryptography/ERC7913Utils.sol | 82 +++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 contracts/utils/cryptography/ERC7913Utils.sol diff --git a/contracts/utils/cryptography/ERC7739.sol b/contracts/utils/cryptography/ERC7739.sol index 749c0b6aca9..eb4f47f37c3 100644 --- a/contracts/utils/cryptography/ERC7739.sol +++ b/contracts/utils/cryptography/ERC7739.sol @@ -18,8 +18,8 @@ import {ERC7739Utils} from "./ERC7739Utils.sol"; * This contract requires implementing the {_rawSignatureValidation} function, which passes the wrapped message hash, * which may be either an typed data or a personal sign nested type. * - * NOTE: xref:api:utils#EIP712[EIP-712] uses xref:api:utils#ShortStrings[ShortStrings] to optimize gas - * costs for short strings (up to 31 characters). Consider that strings longer than that will use storage, + * NOTE: xref:api:utils#EIP712[EIP-712] uses xref:api:utils#ShortStrings[ShortStrings] to optimize gas + * costs for short strings (up to 31 characters). Consider that strings longer than that will use storage, * which may limit the ability of the signer to be used within the ERC-4337 validation phase (due to * https://eips.ethereum.org/EIPS/eip-7562#storage-rules[ERC-7562 storage access rules]). */ diff --git a/contracts/utils/cryptography/ERC7913Utils.sol b/contracts/utils/cryptography/ERC7913Utils.sol new file mode 100644 index 00000000000..285d3895ff7 --- /dev/null +++ b/contracts/utils/cryptography/ERC7913Utils.sol @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.24; + +import {SignatureChecker} from "./SignatureChecker.sol"; +import {Bytes} from "../Bytes.sol"; +import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol"; + +/** + * @dev Library that provides common ERC-7913 utility functions. + * + * This library extends the functionality of xref:api:utils#SignatureChecker[SignatureChecker] + * to support signature verification for keys that do not have an Ethereum address of their own + * as with ERC-1271. + * + * See https://eips.ethereum.org/EIPS/eip-7913[ERC-7913]. + */ +library ERC7913Utils { + using Bytes for bytes; + + /** + * @dev Verifies a signature for a given signer and hash. + * + * The signer is a `bytes` object that is the concatenation of an address and optionally a key: + * `verifier || key`. A signer must be at least 20 bytes long. + * + * Verification is done as follows: + * - If `signer.length < 20`: verification fails + * - If `signer.length == 20`: verification is done using {SignatureChecker} + * - Otherwise: verification is done using {IERC7913SignatureVerifier} + */ + function isValidSignatureNow( + bytes memory signer, + bytes32 hash, + bytes memory signature + ) internal view returns (bool) { + if (signer.length < 20) { + return false; + } else if (signer.length == 20) { + return SignatureChecker.isValidSignatureNow(address(bytes20(signer)), hash, signature); + } else { + (bool success, bytes memory result) = address(bytes20(signer)).staticcall( + abi.encodeCall(IERC7913SignatureVerifier.verify, (signer.slice(20), hash, signature)) + ); + return (success && + result.length >= 32 && + abi.decode(result, (bytes32)) == bytes32(IERC7913SignatureVerifier.verify.selector)); + } + } + + /** + * @dev Verifies multiple `signatures` for a given hash using a set of `signers`. + * + * The signers must be ordered by their `keccak256` hash to ensure no duplicates and to optimize + * the verification process. The function will return `false` if the signers are not properly ordered. + * + * Requirements: + * + * * The `signatures` array must be at least the `signers` array's length. + */ + function areValidSignaturesNow( + bytes32 hash, + bytes[] memory signers, + bytes[] memory signatures + ) internal view returns (bool) { + bytes32 previousId = bytes32(0); + + uint256 signersLength = signers.length; + for (uint256 i = 0; i < signersLength; i++) { + bytes memory signer = signers[i]; + // Signers must ordered by id to ensure no duplicates + bytes32 id = keccak256(signer); + if (previousId >= id || !isValidSignatureNow(signer, hash, signatures[i])) { + return false; + } + + previousId = id; + } + + return true; + } +} From 79629b76b3fe07446a7b4f023e611970e44b87ae Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:48:00 -0600 Subject: [PATCH 014/110] up --- contracts/utils/cryptography/ERC7913Utils.sol | 82 ------------------- 1 file changed, 82 deletions(-) delete mode 100644 contracts/utils/cryptography/ERC7913Utils.sol diff --git a/contracts/utils/cryptography/ERC7913Utils.sol b/contracts/utils/cryptography/ERC7913Utils.sol deleted file mode 100644 index 285d3895ff7..00000000000 --- a/contracts/utils/cryptography/ERC7913Utils.sol +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.24; - -import {SignatureChecker} from "./SignatureChecker.sol"; -import {Bytes} from "../Bytes.sol"; -import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol"; - -/** - * @dev Library that provides common ERC-7913 utility functions. - * - * This library extends the functionality of xref:api:utils#SignatureChecker[SignatureChecker] - * to support signature verification for keys that do not have an Ethereum address of their own - * as with ERC-1271. - * - * See https://eips.ethereum.org/EIPS/eip-7913[ERC-7913]. - */ -library ERC7913Utils { - using Bytes for bytes; - - /** - * @dev Verifies a signature for a given signer and hash. - * - * The signer is a `bytes` object that is the concatenation of an address and optionally a key: - * `verifier || key`. A signer must be at least 20 bytes long. - * - * Verification is done as follows: - * - If `signer.length < 20`: verification fails - * - If `signer.length == 20`: verification is done using {SignatureChecker} - * - Otherwise: verification is done using {IERC7913SignatureVerifier} - */ - function isValidSignatureNow( - bytes memory signer, - bytes32 hash, - bytes memory signature - ) internal view returns (bool) { - if (signer.length < 20) { - return false; - } else if (signer.length == 20) { - return SignatureChecker.isValidSignatureNow(address(bytes20(signer)), hash, signature); - } else { - (bool success, bytes memory result) = address(bytes20(signer)).staticcall( - abi.encodeCall(IERC7913SignatureVerifier.verify, (signer.slice(20), hash, signature)) - ); - return (success && - result.length >= 32 && - abi.decode(result, (bytes32)) == bytes32(IERC7913SignatureVerifier.verify.selector)); - } - } - - /** - * @dev Verifies multiple `signatures` for a given hash using a set of `signers`. - * - * The signers must be ordered by their `keccak256` hash to ensure no duplicates and to optimize - * the verification process. The function will return `false` if the signers are not properly ordered. - * - * Requirements: - * - * * The `signatures` array must be at least the `signers` array's length. - */ - function areValidSignaturesNow( - bytes32 hash, - bytes[] memory signers, - bytes[] memory signatures - ) internal view returns (bool) { - bytes32 previousId = bytes32(0); - - uint256 signersLength = signers.length; - for (uint256 i = 0; i < signersLength; i++) { - bytes memory signer = signers[i]; - // Signers must ordered by id to ensure no duplicates - bytes32 id = keccak256(signer); - if (previousId >= id || !isValidSignatureNow(signer, hash, signatures[i])) { - return false; - } - - previousId = id; - } - - return true; - } -} From f47cab7e1157aa9d21371ac58caa0ece08e162c7 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:52:24 -0600 Subject: [PATCH 015/110] up --- contracts/utils/cryptography/ERC7739Utils.sol | 206 ------------------ 1 file changed, 206 deletions(-) delete mode 100644 contracts/utils/cryptography/ERC7739Utils.sol diff --git a/contracts/utils/cryptography/ERC7739Utils.sol b/contracts/utils/cryptography/ERC7739Utils.sol deleted file mode 100644 index e15749a7a02..00000000000 --- a/contracts/utils/cryptography/ERC7739Utils.sol +++ /dev/null @@ -1,206 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {Calldata} from "../Calldata.sol"; - -/** - * @dev Utilities to process https://ercs.ethereum.org/ERCS/erc-7739[ERC-7739] typed data signatures - * that are specific to an EIP-712 domain. - * - * This library provides methods to wrap, unwrap and operate over typed data signatures with a defensive - * rehashing mechanism that includes the application's xref:api:utils#EIP712-_domainSeparatorV4[EIP-712] - * and preserves readability of the signed content using an EIP-712 nested approach. - * - * A smart contract domain can validate a signature for a typed data structure in two ways: - * - * - As an application validating a typed data signature. See {typedDataSignStructHash}. - * - As a smart contract validating a raw message signature. See {personalSignStructHash}. - * - * NOTE: A provider for a smart contract wallet would need to return this signature as the - * result of a call to `personal_sign` or `eth_signTypedData`, and this may be unsupported by - * API clients that expect a return value of 129 bytes, or specifically the `r,s,v` parameters - * of an xref:api:utils#ECDSA[ECDSA] signature, as is for example specified for - * xref:api:utils#EIP712[EIP-712]. - */ -library ERC7739Utils { - /** - * @dev An EIP-712 type to represent "personal" signatures - * (i.e. mimic of `personal_sign` for smart contracts). - */ - bytes32 private constant PERSONAL_SIGN_TYPEHASH = keccak256("PersonalSign(bytes prefixed)"); - - /** - * @dev Nest a signature for a given EIP-712 type into a nested signature for the domain of the app. - * - * Counterpart of {decodeTypedDataSig} to extract the original signature and the nested components. - */ - function encodeTypedDataSig( - bytes memory signature, - bytes32 appSeparator, - bytes32 contentsHash, - string memory contentsDescr - ) internal pure returns (bytes memory) { - return - abi.encodePacked(signature, appSeparator, contentsHash, contentsDescr, uint16(bytes(contentsDescr).length)); - } - - /** - * @dev Parses a nested signature into its components. - * - * Constructed as follows: - * - * `signature ‖ APP_DOMAIN_SEPARATOR ‖ contentsHash ‖ contentsDescr ‖ uint16(contentsDescr.length)` - * - * - `signature` is the signature for the (ERC-7739) nested struct hash. This signature indirectly signs over the - * original "contents" hash (from the app) and the account's domain separator. - * - `APP_DOMAIN_SEPARATOR` is the EIP-712 {EIP712-_domainSeparatorV4} of the application smart contract that is - * requesting the signature verification (though ERC-1271). - * - `contentsHash` is the hash of the underlying data structure or message. - * - `contentsDescr` is a descriptor of the "contents" part of the the EIP-712 type of the nested signature. - * - * NOTE: This function returns empty if the input format is invalid instead of reverting. - * data instead. - */ - function decodeTypedDataSig( - bytes calldata encodedSignature - ) - internal - pure - returns (bytes calldata signature, bytes32 appSeparator, bytes32 contentsHash, string calldata contentsDescr) - { - unchecked { - uint256 sigLength = encodedSignature.length; - - // 66 bytes = contentsDescrLength (2 bytes) + contentsHash (32 bytes) + APP_DOMAIN_SEPARATOR (32 bytes). - if (sigLength < 66) return (Calldata.emptyBytes(), 0, 0, Calldata.emptyString()); - - uint256 contentsDescrEnd = sigLength - 2; // Last 2 bytes - uint256 contentsDescrLength = uint16(bytes2(encodedSignature[contentsDescrEnd:])); - - // Check for space for `contentsDescr` in addition to the 66 bytes documented above - if (sigLength < 66 + contentsDescrLength) return (Calldata.emptyBytes(), 0, 0, Calldata.emptyString()); - - uint256 contentsHashEnd = contentsDescrEnd - contentsDescrLength; - uint256 separatorEnd = contentsHashEnd - 32; - uint256 signatureEnd = separatorEnd - 32; - - signature = encodedSignature[:signatureEnd]; - appSeparator = bytes32(encodedSignature[signatureEnd:separatorEnd]); - contentsHash = bytes32(encodedSignature[separatorEnd:contentsHashEnd]); - contentsDescr = string(encodedSignature[contentsHashEnd:contentsDescrEnd]); - } - } - - /** - * @dev Nests an `ERC-191` digest into a `PersonalSign` EIP-712 struct, and returns the corresponding struct hash. - * This struct hash must be combined with a domain separator, using {MessageHashUtils-toTypedDataHash} before - * being verified/recovered. - * - * This is used to simulates the `personal_sign` RPC method in the context of smart contracts. - */ - function personalSignStructHash(bytes32 contents) internal pure returns (bytes32) { - return keccak256(abi.encode(PERSONAL_SIGN_TYPEHASH, contents)); - } - - /** - * @dev Nests an `EIP-712` hash (`contents`) into a `TypedDataSign` EIP-712 struct, and returns the corresponding - * struct hash. This struct hash must be combined with a domain separator, using {MessageHashUtils-toTypedDataHash} - * before being verified/recovered. - */ - function typedDataSignStructHash( - string calldata contentsName, - string calldata contentsType, - bytes32 contentsHash, - bytes memory domainBytes - ) internal pure returns (bytes32 result) { - return - bytes(contentsName).length == 0 - ? bytes32(0) - : keccak256( - abi.encodePacked(typedDataSignTypehash(contentsName, contentsType), contentsHash, domainBytes) - ); - } - - /** - * @dev Variant of {typedDataSignStructHash-string-string-bytes32-bytes} that takes a content descriptor - * and decodes the `contentsName` and `contentsType` out of it. - */ - function typedDataSignStructHash( - string calldata contentsDescr, - bytes32 contentsHash, - bytes memory domainBytes - ) internal pure returns (bytes32 result) { - (string calldata contentsName, string calldata contentsType) = decodeContentsDescr(contentsDescr); - - return typedDataSignStructHash(contentsName, contentsType, contentsHash, domainBytes); - } - - /** - * @dev Compute the EIP-712 typehash of the `TypedDataSign` structure for a given type (and typename). - */ - function typedDataSignTypehash( - string calldata contentsName, - string calldata contentsType - ) internal pure returns (bytes32) { - return - keccak256( - abi.encodePacked( - "TypedDataSign(", - contentsName, - " contents,string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)", - contentsType - ) - ); - } - - /** - * @dev Parse the type name out of the ERC-7739 contents type description. Supports both the implicit and explicit - * modes. - * - * Following ERC-7739 specifications, a `contentsName` is considered invalid if it's empty or it contains - * any of the following bytes , )\x00 - * - * If the `contentsType` is invalid, this returns an empty string. Otherwise, the return string has non-zero - * length. - */ - function decodeContentsDescr( - string calldata contentsDescr - ) internal pure returns (string calldata contentsName, string calldata contentsType) { - bytes calldata buffer = bytes(contentsDescr); - if (buffer.length == 0) { - // pass through (fail) - } else if (buffer[buffer.length - 1] == bytes1(")")) { - // Implicit mode: read contentsName from the beginning, and keep the complete descr - for (uint256 i = 0; i < buffer.length; ++i) { - bytes1 current = buffer[i]; - if (current == bytes1("(")) { - // if name is empty - passthrough (fail) - if (i == 0) break; - // we found the end of the contentsName - return (string(buffer[:i]), contentsDescr); - } else if (_isForbiddenChar(current)) { - // we found an invalid character (forbidden) - passthrough (fail) - break; - } - } - } else { - // Explicit mode: read contentsName from the end, and remove it from the descr - for (uint256 i = buffer.length; i > 0; --i) { - bytes1 current = buffer[i - 1]; - if (current == bytes1(")")) { - // we found the end of the contentsName - return (string(buffer[i:]), string(buffer[:i])); - } else if (_isForbiddenChar(current)) { - // we found an invalid character (forbidden) - passthrough (fail) - break; - } - } - } - return (Calldata.emptyString(), Calldata.emptyString()); - } - - function _isForbiddenChar(bytes1 char) private pure returns (bool) { - return char == 0x00 || char == bytes1(" ") || char == bytes1(",") || char == bytes1("(") || char == bytes1(")"); - } -} From 8f5819798ee33df48081476eef3415f6180cb75f Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:53:20 -0600 Subject: [PATCH 016/110] up --- contracts/utils/cryptography/ERC7739Utils.sol | 206 ++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 contracts/utils/cryptography/ERC7739Utils.sol diff --git a/contracts/utils/cryptography/ERC7739Utils.sol b/contracts/utils/cryptography/ERC7739Utils.sol new file mode 100644 index 00000000000..e15749a7a02 --- /dev/null +++ b/contracts/utils/cryptography/ERC7739Utils.sol @@ -0,0 +1,206 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {Calldata} from "../Calldata.sol"; + +/** + * @dev Utilities to process https://ercs.ethereum.org/ERCS/erc-7739[ERC-7739] typed data signatures + * that are specific to an EIP-712 domain. + * + * This library provides methods to wrap, unwrap and operate over typed data signatures with a defensive + * rehashing mechanism that includes the application's xref:api:utils#EIP712-_domainSeparatorV4[EIP-712] + * and preserves readability of the signed content using an EIP-712 nested approach. + * + * A smart contract domain can validate a signature for a typed data structure in two ways: + * + * - As an application validating a typed data signature. See {typedDataSignStructHash}. + * - As a smart contract validating a raw message signature. See {personalSignStructHash}. + * + * NOTE: A provider for a smart contract wallet would need to return this signature as the + * result of a call to `personal_sign` or `eth_signTypedData`, and this may be unsupported by + * API clients that expect a return value of 129 bytes, or specifically the `r,s,v` parameters + * of an xref:api:utils#ECDSA[ECDSA] signature, as is for example specified for + * xref:api:utils#EIP712[EIP-712]. + */ +library ERC7739Utils { + /** + * @dev An EIP-712 type to represent "personal" signatures + * (i.e. mimic of `personal_sign` for smart contracts). + */ + bytes32 private constant PERSONAL_SIGN_TYPEHASH = keccak256("PersonalSign(bytes prefixed)"); + + /** + * @dev Nest a signature for a given EIP-712 type into a nested signature for the domain of the app. + * + * Counterpart of {decodeTypedDataSig} to extract the original signature and the nested components. + */ + function encodeTypedDataSig( + bytes memory signature, + bytes32 appSeparator, + bytes32 contentsHash, + string memory contentsDescr + ) internal pure returns (bytes memory) { + return + abi.encodePacked(signature, appSeparator, contentsHash, contentsDescr, uint16(bytes(contentsDescr).length)); + } + + /** + * @dev Parses a nested signature into its components. + * + * Constructed as follows: + * + * `signature ‖ APP_DOMAIN_SEPARATOR ‖ contentsHash ‖ contentsDescr ‖ uint16(contentsDescr.length)` + * + * - `signature` is the signature for the (ERC-7739) nested struct hash. This signature indirectly signs over the + * original "contents" hash (from the app) and the account's domain separator. + * - `APP_DOMAIN_SEPARATOR` is the EIP-712 {EIP712-_domainSeparatorV4} of the application smart contract that is + * requesting the signature verification (though ERC-1271). + * - `contentsHash` is the hash of the underlying data structure or message. + * - `contentsDescr` is a descriptor of the "contents" part of the the EIP-712 type of the nested signature. + * + * NOTE: This function returns empty if the input format is invalid instead of reverting. + * data instead. + */ + function decodeTypedDataSig( + bytes calldata encodedSignature + ) + internal + pure + returns (bytes calldata signature, bytes32 appSeparator, bytes32 contentsHash, string calldata contentsDescr) + { + unchecked { + uint256 sigLength = encodedSignature.length; + + // 66 bytes = contentsDescrLength (2 bytes) + contentsHash (32 bytes) + APP_DOMAIN_SEPARATOR (32 bytes). + if (sigLength < 66) return (Calldata.emptyBytes(), 0, 0, Calldata.emptyString()); + + uint256 contentsDescrEnd = sigLength - 2; // Last 2 bytes + uint256 contentsDescrLength = uint16(bytes2(encodedSignature[contentsDescrEnd:])); + + // Check for space for `contentsDescr` in addition to the 66 bytes documented above + if (sigLength < 66 + contentsDescrLength) return (Calldata.emptyBytes(), 0, 0, Calldata.emptyString()); + + uint256 contentsHashEnd = contentsDescrEnd - contentsDescrLength; + uint256 separatorEnd = contentsHashEnd - 32; + uint256 signatureEnd = separatorEnd - 32; + + signature = encodedSignature[:signatureEnd]; + appSeparator = bytes32(encodedSignature[signatureEnd:separatorEnd]); + contentsHash = bytes32(encodedSignature[separatorEnd:contentsHashEnd]); + contentsDescr = string(encodedSignature[contentsHashEnd:contentsDescrEnd]); + } + } + + /** + * @dev Nests an `ERC-191` digest into a `PersonalSign` EIP-712 struct, and returns the corresponding struct hash. + * This struct hash must be combined with a domain separator, using {MessageHashUtils-toTypedDataHash} before + * being verified/recovered. + * + * This is used to simulates the `personal_sign` RPC method in the context of smart contracts. + */ + function personalSignStructHash(bytes32 contents) internal pure returns (bytes32) { + return keccak256(abi.encode(PERSONAL_SIGN_TYPEHASH, contents)); + } + + /** + * @dev Nests an `EIP-712` hash (`contents`) into a `TypedDataSign` EIP-712 struct, and returns the corresponding + * struct hash. This struct hash must be combined with a domain separator, using {MessageHashUtils-toTypedDataHash} + * before being verified/recovered. + */ + function typedDataSignStructHash( + string calldata contentsName, + string calldata contentsType, + bytes32 contentsHash, + bytes memory domainBytes + ) internal pure returns (bytes32 result) { + return + bytes(contentsName).length == 0 + ? bytes32(0) + : keccak256( + abi.encodePacked(typedDataSignTypehash(contentsName, contentsType), contentsHash, domainBytes) + ); + } + + /** + * @dev Variant of {typedDataSignStructHash-string-string-bytes32-bytes} that takes a content descriptor + * and decodes the `contentsName` and `contentsType` out of it. + */ + function typedDataSignStructHash( + string calldata contentsDescr, + bytes32 contentsHash, + bytes memory domainBytes + ) internal pure returns (bytes32 result) { + (string calldata contentsName, string calldata contentsType) = decodeContentsDescr(contentsDescr); + + return typedDataSignStructHash(contentsName, contentsType, contentsHash, domainBytes); + } + + /** + * @dev Compute the EIP-712 typehash of the `TypedDataSign` structure for a given type (and typename). + */ + function typedDataSignTypehash( + string calldata contentsName, + string calldata contentsType + ) internal pure returns (bytes32) { + return + keccak256( + abi.encodePacked( + "TypedDataSign(", + contentsName, + " contents,string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)", + contentsType + ) + ); + } + + /** + * @dev Parse the type name out of the ERC-7739 contents type description. Supports both the implicit and explicit + * modes. + * + * Following ERC-7739 specifications, a `contentsName` is considered invalid if it's empty or it contains + * any of the following bytes , )\x00 + * + * If the `contentsType` is invalid, this returns an empty string. Otherwise, the return string has non-zero + * length. + */ + function decodeContentsDescr( + string calldata contentsDescr + ) internal pure returns (string calldata contentsName, string calldata contentsType) { + bytes calldata buffer = bytes(contentsDescr); + if (buffer.length == 0) { + // pass through (fail) + } else if (buffer[buffer.length - 1] == bytes1(")")) { + // Implicit mode: read contentsName from the beginning, and keep the complete descr + for (uint256 i = 0; i < buffer.length; ++i) { + bytes1 current = buffer[i]; + if (current == bytes1("(")) { + // if name is empty - passthrough (fail) + if (i == 0) break; + // we found the end of the contentsName + return (string(buffer[:i]), contentsDescr); + } else if (_isForbiddenChar(current)) { + // we found an invalid character (forbidden) - passthrough (fail) + break; + } + } + } else { + // Explicit mode: read contentsName from the end, and remove it from the descr + for (uint256 i = buffer.length; i > 0; --i) { + bytes1 current = buffer[i - 1]; + if (current == bytes1(")")) { + // we found the end of the contentsName + return (string(buffer[i:]), string(buffer[:i])); + } else if (_isForbiddenChar(current)) { + // we found an invalid character (forbidden) - passthrough (fail) + break; + } + } + } + return (Calldata.emptyString(), Calldata.emptyString()); + } + + function _isForbiddenChar(bytes1 char) private pure returns (bool) { + return char == 0x00 || char == bytes1(" ") || char == bytes1(",") || char == bytes1("(") || char == bytes1(")"); + } +} From ecede7f672735fefe3ac9febd384c594aeba8d1b Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:54:31 -0600 Subject: [PATCH 017/110] up --- contracts/utils/cryptography/ERC7739Utils.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/utils/cryptography/ERC7739Utils.sol b/contracts/utils/cryptography/ERC7739Utils.sol index e15749a7a02..e7b720ea0c9 100644 --- a/contracts/utils/cryptography/ERC7739Utils.sol +++ b/contracts/utils/cryptography/ERC7739Utils.sol @@ -20,7 +20,7 @@ import {Calldata} from "../Calldata.sol"; * NOTE: A provider for a smart contract wallet would need to return this signature as the * result of a call to `personal_sign` or `eth_signTypedData`, and this may be unsupported by * API clients that expect a return value of 129 bytes, or specifically the `r,s,v` parameters - * of an xref:api:utils#ECDSA[ECDSA] signature, as is for example specified for + * of an xref:api:utils#ECDSA[ECDSA] signature, as is for example specified for * xref:api:utils#EIP712[EIP-712]. */ library ERC7739Utils { From 68bd96a77a05073f01b55d8c8de1e1003ad37b77 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:56:07 -0600 Subject: [PATCH 018/110] up --- contracts/utils/cryptography/ERC7739.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/utils/cryptography/ERC7739.sol b/contracts/utils/cryptography/ERC7739.sol index eb4f47f37c3..06c66354375 100644 --- a/contracts/utils/cryptography/ERC7739.sol +++ b/contracts/utils/cryptography/ERC7739.sol @@ -43,8 +43,8 @@ abstract contract ERC7739 is AbstractSigner, EIP712, IERC1271 { (_isValidNestedTypedDataSignature(hash, signature) || _isValidNestedPersonalSignSignature(hash, signature)) ? IERC1271.isValidSignature.selector : (hash == 0x7739773977397739773977397739773977397739773977397739773977397739 && signature.length == 0) - ? bytes4(0x77390001) - : bytes4(0xffffffff); + ? bytes4(0x77390001) + : bytes4(0xffffffff); } /** From d5cb119e09923c637916217b1d6ba5557555d218 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 00:57:55 -0600 Subject: [PATCH 019/110] chore: empty commit From 6a0ae8a08d261cbe20bdfad0a640a10be1a25a1b Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 01:01:48 -0600 Subject: [PATCH 020/110] change read permissions --- test/account/AccountERC7702.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/account/AccountERC7702.t.sol b/test/account/AccountERC7702.t.sol index dd58668cefe..e2302049c31 100644 --- a/test/account/AccountERC7702.t.sol +++ b/test/account/AccountERC7702.t.sol @@ -45,7 +45,7 @@ contract AccountERC7702Test is Test { vm.deal(address(ERC4337Utils.ENTRYPOINT_V08), MAX_ETH); vm.etch( address(ERC4337Utils.ENTRYPOINT_V08), - vm.readFileBinary("./lib/@openzeppelin-contracts/test/bin/EntryPoint070.bytecode") + vm.readFileBinary("test/bin/EntryPoint070.bytecode") ); } From a49a15710fbc1c8db7b3f53783b8354a0adc44c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Garc=C3=ADa?= Date: Fri, 2 May 2025 01:04:21 -0600 Subject: [PATCH 021/110] Update lucky-donuts-scream.md --- .changeset/lucky-donuts-scream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/lucky-donuts-scream.md b/.changeset/lucky-donuts-scream.md index 2f56b7c83b2..aaeb29a5e35 100644 --- a/.changeset/lucky-donuts-scream.md +++ b/.changeset/lucky-donuts-scream.md @@ -2,4 +2,4 @@ 'openzeppelin-solidity': minor --- -`ERC7739Signer`: An abstract contract to validate signatures following the rehashing scheme from `ERC7739Utils`. +`ERC7739`: An abstract contract to validate signatures following the rehashing scheme from `ERC7739Utils`. From a634278cdae2fef5ab0c9ae71123d8064d251a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Garc=C3=ADa?= Date: Fri, 2 May 2025 01:04:52 -0600 Subject: [PATCH 022/110] Update clean-ways-push.md --- .changeset/clean-ways-push.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/clean-ways-push.md b/.changeset/clean-ways-push.md index 1f33ae16bdb..3b214f46458 100644 --- a/.changeset/clean-ways-push.md +++ b/.changeset/clean-ways-push.md @@ -2,4 +2,4 @@ 'openzeppelin-solidity': minor --- -`AccountERC7579`: Extension of `AccountCore` that implements support for ERC-7579 modules of type executor, validator, and fallback handler. +`AccountERC7579`: Extension of `Account` that implements support for ERC-7579 modules of type executor, validator, and fallback handler. From 8b6501a926d2379f4b20f377bca7296f8dc15c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Garc=C3=ADa?= Date: Fri, 2 May 2025 01:05:51 -0600 Subject: [PATCH 023/110] Update tame-bears-mix.md --- .changeset/tame-bears-mix.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/tame-bears-mix.md b/.changeset/tame-bears-mix.md index 4a52e7bb13e..5c9bcfa0b17 100644 --- a/.changeset/tame-bears-mix.md +++ b/.changeset/tame-bears-mix.md @@ -2,4 +2,4 @@ 'openzeppelin-solidity': minor --- -`AbstractSigner`, `SignerECDSA`, `SignerP256`, and `SignerRSA`: Add an abstract contract, and various implementations, for contracts that deal with signature verification. Used by AccountCore and `ERC7739Utils. +`AbstractSigner`, `SignerECDSA`, `SignerP256`, and `SignerRSA`: Add an abstract contract and various implementations for contracts that deal with signature verification. From 39a102670bd7aeb27228bfa3936717b23824c499 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 01:11:53 -0600 Subject: [PATCH 024/110] reset package-lock.json --- package-lock.json | 6941 ++++++++++++++++----------------------------- 1 file changed, 2468 insertions(+), 4473 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2259e065b18..92314bf0cf5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,81 +50,61 @@ "yargs": "^17.0.0" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@adraffy/ens-normalize": { "version": "1.10.1", "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/runtime": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", - "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz", + "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==", "dev": true, - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@bytecodealliance/preview2-shim": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@bytecodealliance/preview2-shim/-/preview2-shim-0.17.0.tgz", + "integrity": "sha512-JorcEwe4ud0x5BS/Ar2aQWOQoFzjq/7jcnxYXCvSMh0oRm0dQXzOA+hqLDBnOMks1LLBA7dmiLLsEBl09Yd6iQ==", + "dev": true + }, "node_modules/@changesets/apply-release-plan": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.4.tgz", - "integrity": "sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==", + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-7.0.12.tgz", + "integrity": "sha512-EaET7As5CeuhTzvXTQCRZeBUcisoYPDDcXvgTE/2jmmypKp0RC7LxKj/yzqeh/1qFTZI7oDGFcL1PHRuQuketQ==", "dev": true, "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/config": "^2.3.1", - "@changesets/get-version-range-type": "^0.3.2", - "@changesets/git": "^2.0.0", - "@changesets/types": "^5.2.1", + "@changesets/config": "^3.1.1", + "@changesets/get-version-range-type": "^0.4.0", + "@changesets/git": "^3.0.4", + "@changesets/should-skip-package": "^0.1.2", + "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3", "detect-indent": "^6.0.0", "fs-extra": "^7.0.1", @@ -151,118 +131,78 @@ } }, "node_modules/@changesets/assemble-release-plan": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.4.tgz", - "integrity": "sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==", + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-6.0.6.tgz", + "integrity": "sha512-Frkj8hWJ1FRZiY3kzVCKzS0N5mMwWKwmv9vpam7vt8rZjLL1JMthdh6pSDVSPumHPshTTkKZ0VtNbE0cJHZZUg==", "dev": true, "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.1.3", + "@changesets/should-skip-package": "^0.1.2", + "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3", "semver": "^7.5.3" } }, "node_modules/@changesets/changelog-git": { - "version": "0.1.14", - "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.1.14.tgz", - "integrity": "sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.2.1.tgz", + "integrity": "sha512-x/xEleCFLH28c3bQeQIyeZf8lFXyDFVn1SgcBiR2Tw/r4IAWlk1fzxCEZ6NxQAjF2Nwtczoen3OA2qR+UawQ8Q==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1" + "@changesets/types": "^6.1.0" } }, "node_modules/@changesets/changelog-github": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.5.0.tgz", - "integrity": "sha512-zoeq2LJJVcPJcIotHRJEEA2qCqX0AQIeFE+L21L8sRLPVqDhSXY8ZWAt2sohtBpFZkBwu+LUwMSKRr2lMy3LJA==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.5.1.tgz", + "integrity": "sha512-BVuHtF+hrhUScSoHnJwTELB4/INQxVFc+P/Qdt20BLiBFIHFJDDUaGsZw+8fQeJTRP5hJZrzpt3oZWh0G19rAQ==", "dev": true, "dependencies": { "@changesets/get-github-info": "^0.6.0", - "@changesets/types": "^6.0.0", + "@changesets/types": "^6.1.0", "dotenv": "^8.1.0" } }, - "node_modules/@changesets/changelog-github/node_modules/@changesets/types": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@changesets/types/-/types-6.0.0.tgz", - "integrity": "sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ==", - "dev": true - }, "node_modules/@changesets/cli": { - "version": "2.26.2", - "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.2.tgz", - "integrity": "sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/apply-release-plan": "^6.1.4", - "@changesets/assemble-release-plan": "^5.2.4", - "@changesets/changelog-git": "^0.1.14", - "@changesets/config": "^2.3.1", - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/get-release-plan": "^3.0.17", - "@changesets/git": "^2.0.0", - "@changesets/logger": "^0.0.5", - "@changesets/pre": "^1.0.14", - "@changesets/read": "^0.5.9", - "@changesets/types": "^5.2.1", - "@changesets/write": "^0.2.3", + "version": "2.29.2", + "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.29.2.tgz", + "integrity": "sha512-vwDemKjGYMOc0l6WUUTGqyAWH3AmueeyoJa1KmFRtCYiCoY5K3B68ErYpDB6H48T4lLI4czum4IEjh6ildxUeg==", + "dev": true, + "dependencies": { + "@changesets/apply-release-plan": "^7.0.12", + "@changesets/assemble-release-plan": "^6.0.6", + "@changesets/changelog-git": "^0.2.1", + "@changesets/config": "^3.1.1", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.1.3", + "@changesets/get-release-plan": "^4.0.10", + "@changesets/git": "^3.0.4", + "@changesets/logger": "^0.1.1", + "@changesets/pre": "^2.0.2", + "@changesets/read": "^0.6.5", + "@changesets/should-skip-package": "^0.1.2", + "@changesets/types": "^6.1.0", + "@changesets/write": "^0.4.0", "@manypkg/get-packages": "^1.1.3", - "@types/is-ci": "^3.0.0", - "@types/semver": "^7.5.0", "ansi-colors": "^4.1.3", - "chalk": "^2.1.0", - "enquirer": "^2.3.0", + "ci-info": "^3.7.0", + "enquirer": "^2.4.1", "external-editor": "^3.1.0", "fs-extra": "^7.0.1", - "human-id": "^1.0.2", - "is-ci": "^3.0.1", - "meow": "^6.0.0", - "outdent": "^0.5.0", + "mri": "^1.2.0", "p-limit": "^2.2.0", - "preferred-pm": "^3.0.0", + "package-manager-detector": "^0.2.0", + "picocolors": "^1.1.0", "resolve-from": "^5.0.0", "semver": "^7.5.3", - "spawndamnit": "^2.0.0", - "term-size": "^2.1.0", - "tty-table": "^4.1.5" + "spawndamnit": "^3.0.1", + "term-size": "^2.1.0" }, "bin": { "changeset": "bin.js" } }, - "node_modules/@changesets/cli/node_modules/@changesets/pre": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.14.tgz", - "integrity": "sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/types": "^5.2.1", - "@manypkg/get-packages": "^1.1.3", - "fs-extra": "^7.0.1" - } - }, - "node_modules/@changesets/cli/node_modules/@changesets/read": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.5.9.tgz", - "integrity": "sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/git": "^2.0.0", - "@changesets/logger": "^0.0.5", - "@changesets/parse": "^0.3.16", - "@changesets/types": "^5.2.1", - "chalk": "^2.1.0", - "fs-extra": "^7.0.1", - "p-filter": "^2.1.0" - } - }, "node_modules/@changesets/cli/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -279,39 +219,38 @@ } }, "node_modules/@changesets/config": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@changesets/config/-/config-2.3.1.tgz", - "integrity": "sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@changesets/config/-/config-3.1.1.tgz", + "integrity": "sha512-bd+3Ap2TKXxljCggI0mKPfzCQKeV/TU4yO2h2C6vAihIo8tzseAn2e7klSuiyYYXvgu53zMN1OeYMIQkaQoWnA==", "dev": true, "dependencies": { - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/logger": "^0.0.5", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.1.3", + "@changesets/logger": "^0.1.1", + "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1", - "micromatch": "^4.0.2" + "micromatch": "^4.0.8" } }, "node_modules/@changesets/errors": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", - "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.2.0.tgz", + "integrity": "sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==", "dev": true, "dependencies": { "extendable-error": "^0.1.5" } }, "node_modules/@changesets/get-dependents-graph": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.6.tgz", - "integrity": "sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-2.1.3.tgz", + "integrity": "sha512-gphr+v0mv2I3Oxt19VdWRRUxq3sseyUpX9DaHpTUmLj92Y10AGy+XOtV+kbM6L/fDcpx7/ISDFK6T8A/P3lOdQ==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3", - "chalk": "^2.1.0", - "fs-extra": "^7.0.1", + "picocolors": "^1.1.0", "semver": "^7.5.3" } }, @@ -326,198 +265,109 @@ } }, "node_modules/@changesets/get-release-plan": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.17.tgz", - "integrity": "sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-4.0.10.tgz", + "integrity": "sha512-CCJ/f3edYaA3MqoEnWvGGuZm0uMEMzNJ97z9hdUR34AOvajSwySwsIzC/bBu3+kuGDsB+cny4FljG8UBWAa7jg==", "dev": true, "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/assemble-release-plan": "^5.2.4", - "@changesets/config": "^2.3.1", - "@changesets/pre": "^1.0.14", - "@changesets/read": "^0.5.9", - "@changesets/types": "^5.2.1", + "@changesets/assemble-release-plan": "^6.0.6", + "@changesets/config": "^3.1.1", + "@changesets/pre": "^2.0.2", + "@changesets/read": "^0.6.5", + "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3" } }, - "node_modules/@changesets/get-release-plan/node_modules/@changesets/pre": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.14.tgz", - "integrity": "sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/types": "^5.2.1", - "@manypkg/get-packages": "^1.1.3", - "fs-extra": "^7.0.1" - } - }, - "node_modules/@changesets/get-release-plan/node_modules/@changesets/read": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.5.9.tgz", - "integrity": "sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/git": "^2.0.0", - "@changesets/logger": "^0.0.5", - "@changesets/parse": "^0.3.16", - "@changesets/types": "^5.2.1", - "chalk": "^2.1.0", - "fs-extra": "^7.0.1", - "p-filter": "^2.1.0" - } - }, "node_modules/@changesets/get-version-range-type": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz", - "integrity": "sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.4.0.tgz", + "integrity": "sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==", "dev": true }, "node_modules/@changesets/git": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@changesets/git/-/git-2.0.0.tgz", - "integrity": "sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@changesets/git/-/git-3.0.4.tgz", + "integrity": "sha512-BXANzRFkX+XcC1q/d27NKvlJ1yf7PSAgi8JG6dt8EfbHFHi4neau7mufcSca5zRhwOL8j9s6EqsxmT+s+/E6Sw==", "dev": true, "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", "@manypkg/get-packages": "^1.1.3", "is-subdir": "^1.1.1", - "micromatch": "^4.0.2", - "spawndamnit": "^2.0.0" + "micromatch": "^4.0.8", + "spawndamnit": "^3.0.1" } }, "node_modules/@changesets/logger": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz", - "integrity": "sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.1.1.tgz", + "integrity": "sha512-OQtR36ZlnuTxKqoW4Sv6x5YIhOmClRd5pWsjZsddYxpWs517R0HkyiefQPIytCVh4ZcC5x9XaG8KTdd5iRQUfg==", "dev": true, "dependencies": { - "chalk": "^2.1.0" + "picocolors": "^1.1.0" } }, "node_modules/@changesets/parse": { - "version": "0.3.16", - "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.3.16.tgz", - "integrity": "sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.4.1.tgz", + "integrity": "sha512-iwksMs5Bf/wUItfcg+OXrEpravm5rEd9Bf4oyIPL4kVTmJQ7PNDSd6MDYkpSJR1pn7tz/k8Zf2DhTCqX08Ou+Q==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.1.0", "js-yaml": "^3.13.1" } }, "node_modules/@changesets/pre": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.0.tgz", - "integrity": "sha512-HLTNYX/A4jZxc+Sq8D1AMBsv+1qD6rmmJtjsCJa/9MSRybdxh0mjbTvE6JYZQ/ZiQ0mMlDOlGPXTm9KLTU3jyw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.2.tgz", + "integrity": "sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==", "dev": true, "dependencies": { - "@babel/runtime": "^7.20.1", "@changesets/errors": "^0.2.0", - "@changesets/types": "^6.0.0", + "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1" } }, - "node_modules/@changesets/pre/node_modules/@changesets/errors": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.2.0.tgz", - "integrity": "sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==", - "dev": true, - "dependencies": { - "extendable-error": "^0.1.5" - } - }, - "node_modules/@changesets/pre/node_modules/@changesets/types": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@changesets/types/-/types-6.0.0.tgz", - "integrity": "sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ==", - "dev": true - }, "node_modules/@changesets/read": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.0.tgz", - "integrity": "sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw==", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.5.tgz", + "integrity": "sha512-UPzNGhsSjHD3Veb0xO/MwvasGe8eMyNrR/sT9gR8Q3DhOQZirgKhhXv/8hVsI0QpPjR004Z9iFxoJU6in3uGMg==", "dev": true, "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/git": "^3.0.0", - "@changesets/logger": "^0.1.0", - "@changesets/parse": "^0.4.0", - "@changesets/types": "^6.0.0", - "chalk": "^2.1.0", + "@changesets/git": "^3.0.4", + "@changesets/logger": "^0.1.1", + "@changesets/parse": "^0.4.1", + "@changesets/types": "^6.1.0", "fs-extra": "^7.0.1", - "p-filter": "^2.1.0" - } - }, - "node_modules/@changesets/read/node_modules/@changesets/errors": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.2.0.tgz", - "integrity": "sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==", - "dev": true, - "dependencies": { - "extendable-error": "^0.1.5" - } - }, - "node_modules/@changesets/read/node_modules/@changesets/git": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@changesets/git/-/git-3.0.0.tgz", - "integrity": "sha512-vvhnZDHe2eiBNRFHEgMiGd2CT+164dfYyrJDhwwxTVD/OW0FUD6G7+4DIx1dNwkwjHyzisxGAU96q0sVNBns0w==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.2.0", - "@changesets/types": "^6.0.0", - "@manypkg/get-packages": "^1.1.3", - "is-subdir": "^1.1.1", - "micromatch": "^4.0.2", - "spawndamnit": "^2.0.0" - } - }, - "node_modules/@changesets/read/node_modules/@changesets/logger": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.1.0.tgz", - "integrity": "sha512-pBrJm4CQm9VqFVwWnSqKEfsS2ESnwqwH+xR7jETxIErZcfd1u2zBSqrHbRHR7xjhSgep9x2PSKFKY//FAshA3g==", - "dev": true, - "dependencies": { - "chalk": "^2.1.0" + "p-filter": "^2.1.0", + "picocolors": "^1.1.0" } }, - "node_modules/@changesets/read/node_modules/@changesets/parse": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.4.0.tgz", - "integrity": "sha512-TS/9KG2CdGXS27S+QxbZXgr8uPsP4yNJYb4BC2/NeFUj80Rni3TeD2qwWmabymxmrLo7JEsytXH1FbpKTbvivw==", + "node_modules/@changesets/should-skip-package": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@changesets/should-skip-package/-/should-skip-package-0.1.2.tgz", + "integrity": "sha512-qAK/WrqWLNCP22UDdBTMPH5f41elVDlsNyat180A33dWxuUDyNpg6fPi/FyTZwRriVjg0L8gnjJn2F9XAoF0qw==", "dev": true, "dependencies": { - "@changesets/types": "^6.0.0", - "js-yaml": "^3.13.1" + "@changesets/types": "^6.1.0", + "@manypkg/get-packages": "^1.1.3" } }, - "node_modules/@changesets/read/node_modules/@changesets/types": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@changesets/types/-/types-6.0.0.tgz", - "integrity": "sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ==", - "dev": true - }, "node_modules/@changesets/types": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", - "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-6.1.0.tgz", + "integrity": "sha512-rKQcJ+o1nKNgeoYRHKOS07tAMNd3YSN0uHaJOZYjBAgxfV7TUE7JE+z4BzZdQwb5hKaYbayKN5KrYV7ODb2rAA==", "dev": true }, "node_modules/@changesets/write": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.2.3.tgz", - "integrity": "sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.4.0.tgz", + "integrity": "sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==", "dev": true, "dependencies": { - "@babel/runtime": "^7.20.1", - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.1.0", "fs-extra": "^7.0.1", - "human-id": "^1.0.2", + "human-id": "^4.1.1", "prettier": "^2.7.1" } }, @@ -546,51 +396,50 @@ "node": ">=0.1.90" } }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "node_modules/@eslint-community/eslint-utils": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.6.1.tgz", + "integrity": "sha512-KTsJMmobmbrFLe3LDh0PC2FXpcSYJt/MLjlkh/9LEnmKYLSYmT/0EW9JWANjeoemiuZrmogti0tW5Ch+qNUYDw==", "dev": true, - "optional": true, - "peer": true, "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": ">=12" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@eslint-community/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/compat": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.1.tgz", - "integrity": "sha512-JbHG2TWuCeNzh87fXo+/46Z1LEo9DBA9T188d0fZgGxAD+cNyS6sx9fdiyxjGPBMyQVRlCutTByZ6a5+YMkF7g==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.9.tgz", + "integrity": "sha512-gCdSY54n7k+driCadyMNv8JSPzYLeDVM/ikZRtvtROBpRdFSkS8W9A82MqsaY7lZuwL0wiapgD0NT1xT0hyJsA==", "dev": true, - "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -604,13 +453,12 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz", + "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.4", + "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -618,22 +466,54 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.2.tgz", + "integrity": "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/core": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", - "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz", + "integrity": "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==", "dev": true, - "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, - "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -652,12 +532,38 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/@eslint/eslintrc/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", @@ -682,39 +588,65 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@eslint/js": { - "version": "9.13.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz", - "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==", + "version": "9.25.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.25.1.tgz", + "integrity": "sha512-dEIwmjntEx8u3Uvv+kr3PDeeArL8Hw07H9kyYxCjnM9pBjfEhk6uLXSchxxzgiwtRhhzVzqmUSDFBOi1TuZ7qg==", "dev": true, - "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/object-schema": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", "dev": true, - "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.1.tgz", - "integrity": "sha512-HFZ4Mp26nbWk9d/BpvP0YNL6W4UoZF0VFcTw/aPPA8RpOxeFQgK+ClABGgAUXs9Y/RGX/l1vOmrqz1MQt9MNuw==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz", + "integrity": "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==", "dev": true, - "license": "Apache-2.0", "dependencies": { + "@eslint/core": "^0.13.0", "levn": "^0.4.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@ethereumjs/common": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-3.2.0.tgz", + "integrity": "sha512-pksvzI0VyLgmuEF2FA/JR/4/y6hcPq8OUail3/AvycBaW1d5VSauOZzqGvJ3RTmR4MU35lWE8KseKOsEhrFRBA==", + "dev": true, + "dependencies": { + "@ethereumjs/util": "^8.1.0", + "crc-32": "^1.2.0" + } + }, "node_modules/@ethereumjs/rlp": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", @@ -727,63 +659,210 @@ "node": ">=14" } }, - "node_modules/@ethereumjs/util": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", - "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", + "node_modules/@ethereumjs/tx": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-4.2.0.tgz", + "integrity": "sha512-1nc6VO4jtFd172BbSnTnDQVr9IYBFl1y4xPzZdtkrkKIncBCkdbgfdRV+MiTkJYAtTxvV12GRZLqBFT1PNK6Yw==", "dev": true, "dependencies": { + "@ethereumjs/common": "^3.2.0", "@ethereumjs/rlp": "^4.0.1", - "ethereum-cryptography": "^2.0.0", - "micro-ftch": "^0.3.1" + "@ethereumjs/util": "^8.1.0", + "ethereum-cryptography": "^2.0.0" }, "engines": { "node": ">=14" } }, - "node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", - "integrity": "sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==", + "node_modules/@ethereumjs/tx/node_modules/@noble/curves": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", "dev": true, "dependencies": { - "@noble/curves": "1.1.0", - "@noble/hashes": "1.3.1", - "@scure/bip32": "1.3.1", - "@scure/bip39": "1.2.1" + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/@ethersproject/abi": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", - "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "node_modules/@ethereumjs/tx/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/tx/node_modules/@scure/base": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", + "dev": true, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/tx/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "dev": true, + "dependencies": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/tx/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dev": true, + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/tx/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "dev": true, + "dependencies": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } + }, + "node_modules/@ethereumjs/util": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", + "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", + "dev": true, + "dependencies": { + "@ethereumjs/rlp": "^4.0.1", + "ethereum-cryptography": "^2.0.0", + "micro-ftch": "^0.3.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@ethereumjs/util/node_modules/@noble/curves": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", + "dev": true, + "dependencies": { + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/@scure/base": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", + "dev": true, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "dev": true, + "dependencies": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dev": true, + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "dev": true, + "dependencies": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } + }, + "node_modules/@ethersproject/abi": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.8.0.tgz", + "integrity": "sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/hash": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/strings": "^5.8.0" + } }, "node_modules/@ethersproject/abstract-provider": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", - "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.8.0.tgz", + "integrity": "sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg==", "dev": true, "funding": [ { @@ -796,19 +875,19 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/networks": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/web": "^5.7.0" + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/networks": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/transactions": "^5.8.0", + "@ethersproject/web": "^5.8.0" } }, "node_modules/@ethersproject/abstract-signer": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", - "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.8.0.tgz", + "integrity": "sha512-N0XhZTswXcmIZQdYtUnd79VJzvEwXQw6PK0dTl9VoYrEBxxCPXqS0Eod7q5TNKRxe1/5WUMuR0u0nqTF/avdCA==", "dev": true, "funding": [ { @@ -821,17 +900,17 @@ } ], "dependencies": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0" + "@ethersproject/abstract-provider": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0" } }, "node_modules/@ethersproject/address": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", - "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.8.0.tgz", + "integrity": "sha512-GhH/abcC46LJwshoN+uBNoKVFPxUuZm6dA257z0vZkKmU1+t8xTn8oK7B9qrj8W2rFRMch4gbJl6PmVxjxBEBA==", "dev": true, "funding": [ { @@ -844,17 +923,17 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/rlp": "^5.7.0" + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/rlp": "^5.8.0" } }, "node_modules/@ethersproject/base64": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", - "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.8.0.tgz", + "integrity": "sha512-lN0oIwfkYj9LbPx4xEkie6rAMJtySbpOAFXSDVQaBnAzYfB4X2Qr+FXJGxMoc3Bxp2Sm8OwvzMrywxyw0gLjIQ==", "dev": true, "funding": [ { @@ -867,13 +946,13 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.7.0" + "@ethersproject/bytes": "^5.8.0" } }, "node_modules/@ethersproject/bignumber": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", - "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.8.0.tgz", + "integrity": "sha512-ZyaT24bHaSeJon2tGPKIiHszWjD/54Sz8t57Toch475lCLljC6MgPmxk7Gtzz+ddNN5LuHea9qhAe0x3D+uYPA==", "dev": true, "funding": [ { @@ -886,21 +965,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", "bn.js": "^5.2.1" } }, - "node_modules/@ethersproject/bignumber/node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "dev": true - }, "node_modules/@ethersproject/bytes": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", - "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.8.0.tgz", + "integrity": "sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A==", "dev": true, "funding": [ { @@ -913,13 +986,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.7.0" + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/constants": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", - "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.8.0.tgz", + "integrity": "sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg==", "dev": true, "funding": [ { @@ -932,13 +1005,13 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.7.0" + "@ethersproject/bignumber": "^5.8.0" } }, "node_modules/@ethersproject/hash": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", - "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.8.0.tgz", + "integrity": "sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA==", "dev": true, "funding": [ { @@ -951,21 +1024,21 @@ } ], "dependencies": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/base64": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/address": "^5.8.0", + "@ethersproject/base64": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/strings": "^5.8.0" } }, "node_modules/@ethersproject/keccak256": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", - "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.8.0.tgz", + "integrity": "sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng==", "dev": true, "funding": [ { @@ -978,14 +1051,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.7.0", + "@ethersproject/bytes": "^5.8.0", "js-sha3": "0.8.0" } }, "node_modules/@ethersproject/logger": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", - "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.8.0.tgz", + "integrity": "sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA==", "dev": true, "funding": [ { @@ -999,9 +1072,9 @@ ] }, "node_modules/@ethersproject/networks": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", - "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.8.0.tgz", + "integrity": "sha512-egPJh3aPVAzbHwq8DD7Po53J4OUSsA1MjQp8Vf/OZPav5rlmWUaFLiq8cvQiGK0Z5K6LYzm29+VA/p4RL1FzNg==", "dev": true, "funding": [ { @@ -1014,13 +1087,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.7.0" + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/properties": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", - "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.8.0.tgz", + "integrity": "sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw==", "dev": true, "funding": [ { @@ -1033,13 +1106,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.7.0" + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/rlp": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", - "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.8.0.tgz", + "integrity": "sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==", "dev": true, "funding": [ { @@ -1052,14 +1125,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0" + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/signing-key": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", - "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.8.0.tgz", + "integrity": "sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w==", "dev": true, "funding": [ { @@ -1072,24 +1145,18 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", "bn.js": "^5.2.1", - "elliptic": "6.5.4", + "elliptic": "6.6.1", "hash.js": "1.1.7" } }, - "node_modules/@ethersproject/signing-key/node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "dev": true - }, "node_modules/@ethersproject/strings": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", - "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.8.0.tgz", + "integrity": "sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg==", "dev": true, "funding": [ { @@ -1102,15 +1169,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0" + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/transactions": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", - "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.8.0.tgz", + "integrity": "sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg==", "dev": true, "funding": [ { @@ -1123,21 +1190,21 @@ } ], "dependencies": { - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/rlp": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0" + "@ethersproject/address": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/rlp": "^5.8.0", + "@ethersproject/signing-key": "^5.8.0" } }, "node_modules/@ethersproject/units": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", - "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.8.0.tgz", + "integrity": "sha512-lxq0CAnc5kMGIiWW4Mr041VT8IhNM+Pn5T3haO74XZWFulk7wH1Gv64HqE96hT4a7iiNMdOCFEBgaxWuk8ETKQ==", "dev": true, "funding": [ { @@ -1150,15 +1217,15 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0" + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/web": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", - "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.8.0.tgz", + "integrity": "sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw==", "dev": true, "funding": [ { @@ -1171,17 +1238,17 @@ } ], "dependencies": { - "@ethersproject/base64": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" + "@ethersproject/base64": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/strings": "^5.8.0" } }, "node_modules/@fastify/busboy": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", - "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", "dev": true, "engines": { "node": ">=14" @@ -1198,29 +1265,40 @@ } }, "node_modules/@humanfs/core": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.0.tgz", - "integrity": "sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=18.18.0" } }, "node_modules/@humanfs/node": { - "version": "0.16.5", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.5.tgz", - "integrity": "sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==", + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "@humanfs/core": "^0.19.0", + "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.3.0" }, "engines": { "node": ">=18.18.0" } }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -1235,11 +1313,10 @@ } }, "node_modules/@humanwhocodes/retry": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", + "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=18.18" }, @@ -1266,9 +1343,9 @@ } }, "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "engines": { "node": ">=12" @@ -1344,37 +1421,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true, - "optional": true, - "peer": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, "node_modules/@manypkg/find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@manypkg/find-root/-/find-root-1.1.0.tgz", @@ -1387,12 +1433,6 @@ "fs-extra": "^8.1.0" } }, - "node_modules/@manypkg/find-root/node_modules/@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", - "dev": true - }, "node_modules/@manypkg/find-root/node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -1441,25 +1481,82 @@ "node": ">=6 <7 || >=8" } }, + "node_modules/@metamask/abi-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@metamask/abi-utils/-/abi-utils-2.0.4.tgz", + "integrity": "sha512-StnIgUB75x7a7AgUhiaUZDpCsqGp7VkNnZh2XivXkJ6mPkE83U8ARGQj5MbRis7VJY8BC5V1AbB1fjdh0hupPQ==", + "dev": true, + "dependencies": { + "@metamask/superstruct": "^3.1.0", + "@metamask/utils": "^9.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@metamask/superstruct": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@metamask/superstruct/-/superstruct-3.2.1.tgz", + "integrity": "sha512-fLgJnDOXFmuVlB38rUN5SmU7hAFQcCjrg3Vrxz67KTY7YHFnSNEKvX4avmEBdOI0yTCxZjwMCFEqsC8k2+Wd3g==", + "dev": true, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@metamask/utils": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@metamask/utils/-/utils-9.3.0.tgz", + "integrity": "sha512-w8CVbdkDrVXFJbfBSlDfafDR6BAkpDmv1bC1UJVCoVny5tW2RKAdn9i68Xf7asYT4TnUhl/hN4zfUiKQq9II4g==", + "dev": true, + "dependencies": { + "@ethereumjs/tx": "^4.2.0", + "@metamask/superstruct": "^3.1.0", + "@noble/hashes": "^1.3.1", + "@scure/base": "^1.1.3", + "@types/debug": "^4.1.7", + "debug": "^4.3.4", + "pony-cause": "^2.1.10", + "semver": "^7.5.4", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@noble/ciphers": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz", + "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==", + "dev": true, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@noble/curves": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", - "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.0.tgz", + "integrity": "sha512-7YDlXiNMdO1YZeH6t/kvopHHbIZzlxrCV9WLqCY6QhcXOoXiNCMDqJIglZ9Yjx5+w7Dz30TITFrlTjnRg7sKEg==", "dev": true, "dependencies": { - "@noble/hashes": "1.3.1" + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@noble/hashes": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", - "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", "dev": true, "engines": { - "node": ">= 16" + "node": "^14.21.3 || >=16" }, "funding": { "url": "https://paulmillr.com/funding/" @@ -1594,9 +1691,9 @@ } }, "node_modules/@nomicfoundation/hardhat-chai-matchers": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.6.tgz", - "integrity": "sha512-Te1Uyo9oJcTCF0Jy9dztaLpshmlpjLf2yPtWXlXuLjMt3RRSmJLm/+rKVTW6gfadAEs12U/it6D0ZRnnRGiICQ==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.8.tgz", + "integrity": "sha512-Z5PiCXH4xhNLASROlSUOADfhfpfhYO6D7Hn9xp8PddmHey0jq704cr6kfU8TRrQ4PUZbpfsZadPj+pCfZdjPIg==", "dev": true, "dependencies": { "@types/chai-as-promised": "^7.1.3", @@ -1612,9 +1709,9 @@ } }, "node_modules/@nomicfoundation/hardhat-ethers": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.4.tgz", - "integrity": "sha512-k9qbLoY7qn6C6Y1LI0gk2kyHXil2Tauj4kGzQ8pgxYXIGw8lWn8tuuL72E11CrlKaXRUvOgF0EXrv/msPI2SbA==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.8.tgz", + "integrity": "sha512-zhOZ4hdRORls31DTOqg+GmEZM0ujly8GGIuRY7t7szEk2zW/arY1qDug/py8AEktT00v5K+b6RvbVog+va51IA==", "dev": true, "dependencies": { "debug": "^4.1.1", @@ -1626,9 +1723,9 @@ } }, "node_modules/@nomicfoundation/hardhat-network-helpers": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.9.tgz", - "integrity": "sha512-OXWCv0cHpwLUO2u7bFxBna6dQtCC2Gg/aN/KtJLO7gmuuA28vgmVKYFRCDUqrbjujzgfwQ2aKyZ9Y3vSmDqS7Q==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.12.tgz", + "integrity": "sha512-xTNQNI/9xkHvjmCJnJOTyqDSl8uq1rKb2WOVmixQxFtRd7Oa3ecO8zM0cyC2YmOK+jHB9WPZ+F/ijkHg1CoORA==", "dev": true, "dependencies": { "ethereumjs-util": "^7.1.4" @@ -1637,162 +1734,137 @@ "hardhat": "^2.9.5" } }, + "node_modules/@nomicfoundation/slang": { + "version": "0.18.3", + "resolved": "https://registry.npmjs.org/@nomicfoundation/slang/-/slang-0.18.3.tgz", + "integrity": "sha512-YqAWgckqbHM0/CZxi9Nlf4hjk9wUNLC9ngWCWBiqMxPIZmzsVKYuChdlrfeBPQyvQQBoOhbx+7C1005kLVQDZQ==", + "dev": true, + "dependencies": { + "@bytecodealliance/preview2-shim": "0.17.0" + } + }, "node_modules/@nomicfoundation/solidity-analyzer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz", - "integrity": "sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg==", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.2.tgz", + "integrity": "sha512-q4n32/FNKIhQ3zQGGw5CvPF6GTvDCpYwIf7bEY/dZTZbgfDsHyjJwURxUJf3VQuuJj+fDIFl4+KkBVbw4Ef6jA==", "dev": true, "engines": { "node": ">= 12" }, "optionalDependencies": { - "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.1", - "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.1", - "@nomicfoundation/solidity-analyzer-freebsd-x64": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.1", - "@nomicfoundation/solidity-analyzer-win32-arm64-msvc": "0.1.1", - "@nomicfoundation/solidity-analyzer-win32-ia32-msvc": "0.1.1", - "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.1" + "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.2", + "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.2", + "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.2" } }, - "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-gnu": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz", - "integrity": "sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA==", - "cpu": [ - "x64" - ], + "node_modules/@nomicfoundation/solidity-analyzer-darwin-arm64": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.2.tgz", + "integrity": "sha512-JaqcWPDZENCvm++lFFGjrDd8mxtf+CtLd2MiXvMNTBD33dContTZ9TWETwNFwg7JTJT5Q9HEecH7FA+HTSsIUw==", "dev": true, "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">= 10" + "node": ">= 12" } }, - "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-musl": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz", - "integrity": "sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w==", - "cpu": [ - "x64" - ], + "node_modules/@nomicfoundation/solidity-analyzer-darwin-x64": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.2.tgz", + "integrity": "sha512-fZNmVztrSXC03e9RONBT+CiksSeYcxI1wlzqyr0L7hsQlK1fzV+f04g2JtQ1c/Fe74ZwdV6aQBdd6Uwl1052sw==", "dev": true, "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">= 10" + "node": ">= 12" } }, - "node_modules/@openzeppelin/docs-utils": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@openzeppelin/docs-utils/-/docs-utils-0.1.5.tgz", - "integrity": "sha512-GfqXArKmdq8rv+hsP+g8uS1VEkvMIzWs31dCONffzmqFwJ+MOsaNQNZNXQnLRgUkzk8i5mTNDjJuxDy+aBZImQ==", + "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-gnu": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.2.tgz", + "integrity": "sha512-3d54oc+9ZVBuB6nbp8wHylk4xh0N0Gc+bk+/uJae+rUgbOBwQSfuGIbAZt1wBXs5REkSmynEGcqx6DutoK0tPA==", "dev": true, - "dependencies": { - "@frangio/servbot": "^0.2.5", - "chalk": "^3.0.0", - "chokidar": "^3.5.3", - "env-paths": "^2.2.0", - "find-up": "^4.1.0", - "is-port-reachable": "^3.0.0", - "js-yaml": "^3.13.1", - "lodash.startcase": "^4.4.0", - "minimist": "^1.2.0" - }, - "bin": { - "oz-docs": "oz-docs.js" + "optional": true, + "engines": { + "node": ">= 12" } }, - "node_modules/@openzeppelin/docs-utils/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-musl": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.2.tgz", + "integrity": "sha512-iDJfR2qf55vgsg7BtJa7iPiFAsYf2d0Tv/0B+vhtnI16+wfQeTbP7teookbGvAo0eJo7aLLm0xfS/GTkvHIucA==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, + "optional": true, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">= 12" } }, - "node_modules/@openzeppelin/docs-utils/node_modules/chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-gnu": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.2.tgz", + "integrity": "sha512-9dlHMAt5/2cpWyuJ9fQNOUXFB/vgSFORg1jpjX1Mh9hJ/MfZXlDdHQ+DpFCs32Zk5pxRBb07yGvSHk9/fezL+g==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, + "optional": true, "engines": { - "node": ">=8" + "node": ">= 12" } }, - "node_modules/@openzeppelin/docs-utils/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-musl": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.2.tgz", + "integrity": "sha512-GzzVeeJob3lfrSlDKQw2bRJ8rBf6mEYaWY+gW0JnTDHINA0s2gPR4km5RLIj1xeZZOYz4zRw+AEeYgLRqB2NXg==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, + "optional": true, "engines": { - "node": ">=7.0.0" + "node": ">= 12" } }, - "node_modules/@openzeppelin/docs-utils/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/@openzeppelin/docs-utils/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/@nomicfoundation/solidity-analyzer-win32-x64-msvc": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.2.tgz", + "integrity": "sha512-Fdjli4DCcFHb4Zgsz0uEJXZ2K7VEO+w5KVv7HmT7WO10iODdU9csC2az4jrhEsRtiR9Gfd74FlG0NYlw1BMdyA==", "dev": true, + "optional": true, "engines": { - "node": ">=8" + "node": ">= 12" } }, - "node_modules/@openzeppelin/docs-utils/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/@openzeppelin/docs-utils": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@openzeppelin/docs-utils/-/docs-utils-0.1.5.tgz", + "integrity": "sha512-GfqXArKmdq8rv+hsP+g8uS1VEkvMIzWs31dCONffzmqFwJ+MOsaNQNZNXQnLRgUkzk8i5mTNDjJuxDy+aBZImQ==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "@frangio/servbot": "^0.2.5", + "chalk": "^3.0.0", + "chokidar": "^3.5.3", + "env-paths": "^2.2.0", + "find-up": "^4.1.0", + "is-port-reachable": "^3.0.0", + "js-yaml": "^3.13.1", + "lodash.startcase": "^4.4.0", + "minimist": "^1.2.0" }, - "engines": { - "node": ">=8" + "bin": { + "oz-docs": "oz-docs.js" } }, "node_modules/@openzeppelin/merkle-tree": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@openzeppelin/merkle-tree/-/merkle-tree-1.0.7.tgz", - "integrity": "sha512-i93t0YYv6ZxTCYU3CdO5Q+DXK0JH10A4dCBOMlzYbX+ujTXm+k1lXiEyVqmf94t3sqmv8sm/XT5zTa0+efnPgQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@openzeppelin/merkle-tree/-/merkle-tree-1.0.8.tgz", + "integrity": "sha512-E2c9/Y3vjZXwVvPZKqCKUn7upnvam1P1ZhowJyZVQSkzZm5WhumtaRr+wkUXrZVfkIc7Gfrl7xzabElqDL09ow==", "dev": true, "dependencies": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0" + "@metamask/abi-utils": "^2.0.4", + "ethereum-cryptography": "^3.0.0" } }, "node_modules/@openzeppelin/upgrade-safe-transpiler": { - "version": "0.3.32", - "resolved": "https://registry.npmjs.org/@openzeppelin/upgrade-safe-transpiler/-/upgrade-safe-transpiler-0.3.32.tgz", - "integrity": "sha512-ypgj6MXXcDG0dOuMwENXt0H4atCtCsPgpDgWZYewb2egfUCMpj6d2GO4pcNZgdn1zYsmUHfm5ZA/Nga/8qkdKA==", + "version": "0.3.33", + "resolved": "https://registry.npmjs.org/@openzeppelin/upgrade-safe-transpiler/-/upgrade-safe-transpiler-0.3.33.tgz", + "integrity": "sha512-yKdnfZtfDw0ivonZmDx1YgFJXLNHz/5+XPN7bx/9ObQYKUawmTiOcGC6BKezpphL+witvHQbMhmQbwGIyEoR8g==", "dev": true, "dependencies": { "ajv": "^8.0.0", @@ -1807,107 +1879,100 @@ "upgrade-safe-transpiler": "dist/cli.js" } }, - "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/@noble/curves": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "@noble/hashes": "1.4.0" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "url": "https://paulmillr.com/funding/" } }, - "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/ethereum-cryptography": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", - "integrity": "sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==", + "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/@scure/base": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", "dev": true, - "dependencies": { - "@noble/curves": "1.1.0", - "@noble/hashes": "1.3.1", - "@scure/bip32": "1.3.1", - "@scure/bip39": "1.2.1" + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" }, - "engines": { - "node": ">=16 || 14 >=14.17" + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dev": true, + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://paulmillr.com/funding/" } }, - "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "node_modules/@openzeppelin/upgrade-safe-transpiler/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" } }, "node_modules/@openzeppelin/upgrades-core": { - "version": "1.29.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.29.0.tgz", - "integrity": "sha512-csZvAMNqUJjMDNBPbaXcV9Nlo4oagMD/HkOBHTpYbBTpnmUhwPVHOMv+Rl0RatBdLHuGc6hw88h80k5PWkEeWw==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.44.0.tgz", + "integrity": "sha512-AUnQW7cbh2ntFuQdHi5C0vKB+QfkTQtzXgCmzazXLJDX7slFTF676lw+x97ZKfzwQw5unO1+ALZMx+s+2yQUew==", "dev": true, "dependencies": { - "cbor": "^9.0.0", + "@nomicfoundation/slang": "^0.18.3", + "bignumber.js": "^9.1.2", + "cbor": "^10.0.0", "chalk": "^4.1.0", "compare-versions": "^6.0.0", "debug": "^4.1.1", "ethereumjs-util": "^7.0.3", + "minimatch": "^9.0.5", "minimist": "^1.2.7", "proper-lockfile": "^4.1.1", - "solidity-ast": "^0.4.26" + "solidity-ast": "^0.4.60" }, "bin": { "openzeppelin-upgrades-core": "dist/cli/cli.js" } }, - "node_modules/@openzeppelin/upgrades-core/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/@openzeppelin/upgrades-core/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -1924,45 +1989,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@openzeppelin/upgrades-core/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@openzeppelin/upgrades-core/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/@openzeppelin/upgrades-core/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@openzeppelin/upgrades-core/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -2001,9 +2027,9 @@ "dev": true }, "node_modules/@pnpm/npm-conf": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.2.tgz", - "integrity": "sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.3.1.tgz", + "integrity": "sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==", "dev": true, "dependencies": { "@pnpm/config.env-replace": "^1.1.0", @@ -2015,36 +2041,36 @@ } }, "node_modules/@scure/base": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.6.tgz", - "integrity": "sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.5.tgz", + "integrity": "sha512-9rE6EOVeIQzt5TSu4v+K523F8u6DhBsoZWPGKlnCshhlDhy0kJzUX4V+tr2dWmzF1GdekvThABoEQBGBQI7xZw==", "dev": true, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@scure/bip32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.1.tgz", - "integrity": "sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.7.0.tgz", + "integrity": "sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==", "dev": true, "dependencies": { - "@noble/curves": "~1.1.0", - "@noble/hashes": "~1.3.1", - "@scure/base": "~1.1.0" + "@noble/curves": "~1.9.0", + "@noble/hashes": "~1.8.0", + "@scure/base": "~1.2.5" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@scure/bip39": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", - "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz", + "integrity": "sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==", "dev": true, "dependencies": { - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" + "@noble/hashes": "~1.8.0", + "@scure/base": "~1.2.5" }, "funding": { "url": "https://paulmillr.com/funding/" @@ -2066,6 +2092,12 @@ "node": ">=6" } }, + "node_modules/@sentry/core/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/@sentry/hub": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", @@ -2080,6 +2112,12 @@ "node": ">=6" } }, + "node_modules/@sentry/hub/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/@sentry/minimal": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", @@ -2094,6 +2132,12 @@ "node": ">=6" } }, + "node_modules/@sentry/minimal/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/@sentry/node": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", @@ -2114,6 +2158,12 @@ "node": ">=6" } }, + "node_modules/@sentry/node/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/@sentry/tracing": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", @@ -2130,7 +2180,13 @@ "node": ">=6" } }, - "node_modules/@sentry/types": { + "node_modules/@sentry/tracing/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@sentry/types": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", @@ -2152,6 +2208,12 @@ "node": ">=6" } }, + "node_modules/@sentry/utils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/@sindresorhus/is": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", @@ -2165,9 +2227,9 @@ } }, "node_modules/@solidity-parser/parser": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.18.0.tgz", - "integrity": "sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.19.0.tgz", + "integrity": "sha512-RV16k/qIxW/wWc+mLzV3ARyKUaMUTBy9tOLMzFhtNSKYeTAanQ3a5MudJKf/8arIFnA2L27SNjarQKmFg0w/jA==", "dev": true }, "node_modules/@szmarczak/http-timer": { @@ -2182,68 +2244,53 @@ "node": ">=14.16" } }, - "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true, - "optional": true, - "peer": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true, - "optional": true, - "peer": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true, - "optional": true, - "peer": true - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true, - "optional": true, - "peer": true - }, "node_modules/@types/bn.js": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.2.tgz", - "integrity": "sha512-dkpZu0szUtn9UXTmw+e0AJFd4D2XAxDnsCLdc05SfqpqzPEBft8eQr8uaFitfo/dUUOZERaLec2hHMG87A4Dxg==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.6.tgz", + "integrity": "sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/chai": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.6.tgz", - "integrity": "sha512-VOVRLM1mBxIRxydiViqPcKn6MIxZytrbMpd6RJLIWKxUNr3zux8no0Oc7kJx0WAPIitgZ0gkrDS+btlqQpubpw==", - "dev": true + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.1.tgz", + "integrity": "sha512-iu1JLYmGmITRzUgNiLMZD3WCoFzpYtueuyAgHTXqgwSRAMIlFTnZqG6/xenkpUGRJEzSfklUTI4GNSzks/dc0w==", + "dev": true, + "dependencies": { + "@types/deep-eql": "*" + } }, "node_modules/@types/chai-as-promised": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.6.tgz", - "integrity": "sha512-cQLhk8fFarRVZAXUQV1xEnZgMoPxqKojBvRkqPCKPQCzEhpbbSKl1Uu75kDng7k5Ln6LQLUmNBjLlFthCgm1NA==", + "version": "7.1.8", + "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.8.tgz", + "integrity": "sha512-ThlRVIJhr69FLlh6IctTXFkmhtP3NpMZ2QGq69StYLyKZFp/HOp1VdKZj7RvfNWYYcJ1xlbLGLLWj1UvP5u/Gw==", "dev": true, "dependencies": { "@types/chai": "*" } }, - "node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "dev": true, - "license": "MIT" + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true + }, + "node_modules/@types/estree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "dev": true }, "node_modules/@types/glob": { "version": "7.2.0", @@ -2261,21 +2308,11 @@ "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", "dev": true }, - "node_modules/@types/is-ci": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/is-ci/-/is-ci-3.0.0.tgz", - "integrity": "sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.1.0" - } - }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@types/lru-cache": { "version": "5.1.1", @@ -2289,52 +2326,36 @@ "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", "dev": true }, - "node_modules/@types/minimist": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", "dev": true }, "node_modules/@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.19.2" - } - }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", "dev": true }, "node_modules/@types/pbkdf2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", + "integrity": "sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==", "dev": true, "dependencies": { "@types/node": "*" } }, - "node_modules/@types/semver": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.2.tgz", - "integrity": "sha512-7aqorHYgdNO4DM36stTiGO3DvKoex9TQRwsJU6vMaFGyqpBA1MNZkz+PG3gaNUPpTAOYhT1WR7M1JyA3fbS9Cw==", - "dev": true - }, "node_modules/abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", @@ -2342,9 +2363,9 @@ "dev": true }, "node_modules/abitype": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.0.tgz", - "integrity": "sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.8.tgz", + "integrity": "sha512-ZeiI6h3GnW06uYDLx0etQtX/p8E24UaHHBj57RSjK7YBFe7iuVn07EDpOeP451D06sF27VOz9JJPlIKJmXgkEg==", "dev": true, "funding": { "url": "https://github.com/sponsors/wevm" @@ -2363,11 +2384,10 @@ } }, "node_modules/acorn": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz", - "integrity": "sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", "dev": true, - "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -2380,31 +2400,10 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, - "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/address": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/address/-/address-1.2.2.tgz", - "integrity": "sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/adm-zip": { "version": "0.4.16", "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", @@ -2414,6 +2413,12 @@ "node": ">=0.3.0" } }, + "node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", + "dev": true + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -2440,15 +2445,15 @@ } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -2474,29 +2479,6 @@ "string-width": "^4.1.0" } }, - "node_modules/ansi-align/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-align/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/ansi-colors": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", @@ -2521,18 +2503,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -2543,32 +2513,29 @@ } }, "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/antlr4": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.13.1.tgz", - "integrity": "sha512-kiXTspaRYvnIArgE97z5YVVf/cDVQABr3abFRR6mE7yesLMkgu4ujuyV/sgxafQ8wgve0DJQUJ38Z8tkgA2izA==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.13.2.tgz", + "integrity": "sha512-QiVbZhyy4xAZ17UPEuG3YTOt8ZaoeOR1CvEAqrEsDBsOqINslaB147i9xqljZqoyf5S+EUlGStaj+t22LT9MOg==", "dev": true, "engines": { "node": ">=16" } }, - "node_modules/antlr4ts": { - "version": "0.5.0-alpha.4", - "resolved": "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz", - "integrity": "sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==", - "dev": true - }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -2582,14 +2549,6 @@ "node": ">= 8" } }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true, - "optional": true, - "peer": true - }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -2599,19 +2558,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -2621,73 +2567,6 @@ "node": ">=8" } }, - "node_modules/array.prototype.findlast": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.3.tgz", - "integrity": "sha512-kcBubumjciBg4JKp5KTKtI7ec7tRefPk88yjkWJwaVKYd9QfTaxcsOxoMNKd7iBr447zCfDV0z1kOF47umv42g==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flat": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", - "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", - "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", - "is-array-buffer": "^3.0.2", - "is-shared-array-buffer": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -2724,24 +2603,11 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/axios": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", - "integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz", + "integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==", "dev": true, - "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -2755,9 +2621,9 @@ "dev": true }, "node_modules/base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz", + "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==", "dev": true, "dependencies": { "safe-buffer": "^5.0.1" @@ -2775,13 +2641,25 @@ "node": ">=4" } }, + "node_modules/bignumber.js": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.0.tgz", + "integrity": "sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/blakejs": { @@ -2791,9 +2669,9 @@ "dev": true }, "node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.2.tgz", + "integrity": "sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==", "dev": true }, "node_modules/boxen": { @@ -2818,21 +2696,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/boxen/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/boxen/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2849,76 +2712,25 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/boxen/node_modules/color-convert": { + "node_modules/boxen/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/boxen/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/boxen/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/boxen/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/boxen/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/boxen/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -2933,15 +2745,6 @@ "node": ">=8" } }, - "node_modules/breakword": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/breakword/-/breakword-1.0.6.tgz", - "integrity": "sha512-yjxDAYyK/pBvws9H4xKYpLDpYKEH6CzrBPAuXq3x18I+c/2MkVtT3qAr7Oloi6Dss9qNhPVueAAVU1CSeNDIXw==", - "dev": true, - "dependencies": { - "wcwidth": "^1.0.1" - } - }, "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", @@ -3006,21 +2809,6 @@ "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", "dev": true }, - "node_modules/bufferutil": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", - "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "peer": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -3057,23 +2845,29 @@ "node": ">=14.16" } }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "node_modules/cacheable-request/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, "dependencies": { - "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "function-bind": "^1.1.2" }, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, "node_modules/callsites": { @@ -3097,86 +2891,59 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/camelcase-keys": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", - "dev": true, - "dependencies": { - "camelcase": "^5.3.1", - "map-obj": "^4.0.0", - "quick-lru": "^4.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/camelcase-keys/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/cbor": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cbor/-/cbor-9.0.1.tgz", - "integrity": "sha512-/TQOWyamDxvVIv+DY9cOLNuABkoyz8K/F3QE56539pGVYohx0+MEA1f4lChFTX79dBTBS7R1PF6ovH7G+VtBfQ==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-10.0.3.tgz", + "integrity": "sha512-72Jnj81xMsqepqdcSdf2+fflz/UDsThOHy5hj2MW5F5xzHL8Oa0KQ6I6V9CwVUPxg5pf+W9xp6W2KilaRXWWtw==", "dev": true, "dependencies": { - "nofilter": "^3.1.0" + "nofilter": "^3.0.2" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/chai": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.8.tgz", - "integrity": "sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "type-detect": "^4.1.0" }, "engines": { "node": ">=4" } }, "node_modules/chai-as-promised": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz", - "integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz", + "integrity": "sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw==", "dev": true, "dependencies": { "check-error": "^1.0.2" }, "peerDependencies": { - "chai": ">= 2.1.2 < 5" + "chai": ">= 2.1.2 < 6" } }, "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/chardet": { @@ -3195,25 +2962,22 @@ } }, "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, "engines": { "node": "*" } }, "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -3226,14 +2990,17 @@ "engines": { "node": ">= 8.10.0" }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "dev": true, "funding": [ { @@ -3246,13 +3013,16 @@ } }, "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.6.tgz", + "integrity": "sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw==", "dev": true, "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" } }, "node_modules/clean-stack": { @@ -3291,6 +3061,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, "node_modules/cli-truncate": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", @@ -3307,32 +3092,54 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cli-truncate/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "node_modules/cli-truncate/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/cli-truncate/node_modules/slice-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", - "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "node_modules/cli-truncate/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", "dev": true, "dependencies": { - "ansi-styles": "^6.0.0", - "is-fullwidth-code-point": "^4.0.0" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" }, "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/cliui": { @@ -3349,51 +3156,22 @@ "node": ">=12" } }, - "node_modules/cliui/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">=8" - } - }, - "node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" + "node": ">=7.0.0" } }, "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/colorette": { @@ -3418,22 +3196,21 @@ "version": "1.2.9", "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", + "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", "dev": true, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/compare-versions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz", - "integrity": "sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz", + "integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==", "dev": true }, "node_modules/concat-map": { @@ -3505,6 +3282,18 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "dev": true, + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -3532,18 +3321,10 @@ "sha.js": "^2.4.8" } }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true, - "optional": true, - "peer": true - }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "dependencies": { "path-key": "^3.1.0", @@ -3563,39 +3344,6 @@ "node": "*" } }, - "node_modules/csv": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/csv/-/csv-5.5.3.tgz", - "integrity": "sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==", - "dev": true, - "dependencies": { - "csv-generate": "^3.4.3", - "csv-parse": "^4.16.3", - "csv-stringify": "^5.6.5", - "stream-transform": "^2.1.3" - }, - "engines": { - "node": ">= 0.1.90" - } - }, - "node_modules/csv-generate": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/csv-generate/-/csv-generate-3.4.3.tgz", - "integrity": "sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==", - "dev": true - }, - "node_modules/csv-parse": { - "version": "4.16.3", - "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-4.16.3.tgz", - "integrity": "sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==", - "dev": true - }, - "node_modules/csv-stringify": { - "version": "5.6.5", - "resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-5.6.5.tgz", - "integrity": "sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==", - "dev": true - }, "node_modules/dataloader": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", @@ -3609,12 +3357,12 @@ "dev": true }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -3626,39 +3374,17 @@ } }, "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decamelize-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", - "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, - "dependencies": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/decamelize-keys/node_modules/map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", @@ -3687,9 +3413,9 @@ } }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", "dev": true, "dependencies": { "type-detect": "^4.0.0" @@ -3713,18 +3439,6 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "node_modules/defaults": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", - "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", - "dev": true, - "dependencies": { - "clone": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/defer-to-connect": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", @@ -3734,40 +3448,6 @@ "node": ">=10" } }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -3795,24 +3475,10 @@ "node": ">=8" } }, - "node_modules/detect-port": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.5.1.tgz", - "integrity": "sha512-aBzdj76lueB6uUst5iAs7+0H/oOjqI5D16XUWxlWMIMROhcM0rfsNVk93zTngq1dDNpoXRr++Sus7ETAExppAQ==", - "dev": true, - "dependencies": { - "address": "^1.0.1", - "debug": "4" - }, - "bin": { - "detect": "bin/detect-port.js", - "detect-port": "bin/detect-port.js" - } - }, "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "dev": true, "engines": { "node": ">=0.3.1" @@ -3851,6 +3517,20 @@ "node": ">=10" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -3858,9 +3538,9 @@ "dev": true }, "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", + "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", "dev": true, "dependencies": { "bn.js": "^4.11.9", @@ -3872,6 +3552,12 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "dev": true + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -3921,67 +3607,11 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/es-abstract": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", - "integrity": "sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.2", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-set-tostringtag": "^2.0.1", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.1", - "get-symbol-description": "^1.0.0", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", - "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.12", - "is-weakref": "^1.0.2", - "object-inspect": "^1.12.3", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "safe-array-concat": "^1.0.1", - "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", - "string.prototype.trimstart": "^1.0.7", - "typed-array-buffer": "^1.0.0", - "typed-array-byte-length": "^1.0.0", - "typed-array-byte-offset": "^1.0.0", - "typed-array-length": "^1.0.4", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.11" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, "engines": { "node": ">= 0.4" } @@ -3995,62 +3625,52 @@ "node": ">= 0.4" } }, - "node_modules/es-set-tostringtag": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", - "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.3", - "has": "^1.0.3", - "has-tostringtag": "^1.0.0" + "es-errors": "^1.3.0" }, "engines": { "node": ">= 0.4" } }, - "node_modules/es-shim-unscopables": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - } - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "dev": true, "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { - "node": ">=0.8.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/escodegen": { @@ -4149,32 +3769,32 @@ } }, "node_modules/eslint": { - "version": "9.13.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz", - "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==", + "version": "9.25.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.25.1.tgz", + "integrity": "sha512-E6Mtz9oGQWDCpV12319d59n4tx9zOTXSTmc8BLVxBx+G/0RdM5MvEEJLU9c0+aleoePYYgVTOsRblx433qmhWQ==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.7.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.13.0", - "@eslint/plugin-kit": "^0.2.0", - "@humanfs/node": "^0.16.5", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.20.0", + "@eslint/config-helpers": "^0.2.1", + "@eslint/core": "^0.13.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.25.1", + "@eslint/plugin-kit": "^0.2.8", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.1", + "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.1.0", - "eslint-visitor-keys": "^4.1.0", - "espree": "^10.2.0", + "eslint-scope": "^8.3.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -4188,8 +3808,7 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" @@ -4210,24 +3829,22 @@ } }, "node_modules/eslint-config-prettier": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz", - "integrity": "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==", + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.2.tgz", + "integrity": "sha512-Epgp/EofAUeEpIdZkW60MHKvPyru1ruQJxPL+WIycnaPApuseK0Zpkrh/FwL9oIpQvIhJwV7ptOy0DWUjTlCiA==", "dev": true, - "license": "MIT", "bin": { - "eslint-config-prettier": "build/bin/cli.js" + "eslint-config-prettier": "bin/cli.js" }, "peerDependencies": { "eslint": ">=7.0.0" } }, "node_modules/eslint-scope": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz", - "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", + "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -4240,31 +3857,41 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "node_modules/eslint/node_modules/chalk": { @@ -4272,7 +3899,6 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4284,58 +3910,11 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/eslint/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/eslint/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/eslint/node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, - "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -4352,7 +3931,6 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -4360,22 +3938,17 @@ "node": ">=10.13.0" } }, - "node_modules/eslint/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "node_modules/eslint/node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, - "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -4386,12 +3959,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/eslint/node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, - "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -4407,7 +3991,6 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, - "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -4418,25 +4001,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/eslint/node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -4445,29 +4014,15 @@ } }, "node_modules/espree": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", - "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.12.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "eslint-visitor-keys": "^4.2.0" }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", - "dev": true, - "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -4489,9 +4044,9 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -4505,7 +4060,6 @@ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -4532,35 +4086,29 @@ } }, "node_modules/ethereum-bloom-filters": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz", - "integrity": "sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.2.0.tgz", + "integrity": "sha512-28hyiE7HVsWubqhpVLVmZXFd4ITeHi+BUu05o9isf0GUpMtzBUi+8/gFrGaGYzvGAJQmJ3JKj77Mk9G98T84rA==", "dev": true, "dependencies": { - "js-sha3": "^0.8.0" + "@noble/hashes": "^1.4.0" } }, "node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-3.2.0.tgz", + "integrity": "sha512-Urr5YVsalH+Jo0sYkTkv1MyI9bLYZwW8BENZCeE1QYaTHETEYx0Nv/SVsWkSqpYrzweg6d8KMY1wTjH/1m/BIg==", "dev": true, "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" + "@noble/ciphers": "1.3.0", + "@noble/curves": "1.9.0", + "@noble/hashes": "1.8.0", + "@scure/bip32": "1.7.0", + "@scure/bip39": "1.6.0" + }, + "engines": { + "node": "^14.21.3 || >=16", + "npm": ">=9" } }, "node_modules/ethereumjs-util": { @@ -4579,11 +4127,28 @@ "node": ">=10.0.0" } }, - "node_modules/ethereumjs-util/node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "dev": true + "node_modules/ethereumjs-util/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } }, "node_modules/ethers": { "version": "6.13.7", @@ -4618,7 +4183,6 @@ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", "dev": true, - "license": "MIT", "dependencies": { "@noble/hashes": "1.3.2" }, @@ -4631,7 +4195,6 @@ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", "dev": true, - "license": "MIT", "engines": { "node": ">= 16" }, @@ -4639,39 +4202,13 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/ethers/node_modules/aes-js": { - "version": "4.0.0-beta.5", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", - "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", - "dev": true - }, - "node_modules/ethers/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "dev": true, - "license": "0BSD" - }, - "node_modules/ethers/node_modules/ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "node_modules/ethers/node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } + "dependencies": { + "undici-types": "~6.19.2" } }, "node_modules/ethjs-unit": { @@ -4733,30 +4270,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/execa/node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/execa/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/extendable-error": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/extendable-error/-/extendable-error-0.1.7.tgz", @@ -4790,16 +4303,16 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" @@ -4817,10 +4330,26 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, + "node_modules/fast-uri": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", + "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -4831,7 +4360,6 @@ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, - "license": "MIT", "dependencies": { "flat-cache": "^4.0.0" }, @@ -4864,16 +4392,6 @@ "node": ">=8" } }, - "node_modules/find-yarn-workspace-root2": { - "version": "1.2.16", - "resolved": "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz", - "integrity": "sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==", - "dev": true, - "dependencies": { - "micromatch": "^4.0.2", - "pkg-dir": "^4.2.0" - } - }, "node_modules/flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", @@ -4888,7 +4406,6 @@ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, - "license": "MIT", "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" @@ -4898,16 +4415,15 @@ } }, "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", - "dev": true, - "license": "ISC" + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "dev": true, "funding": [ { @@ -4924,22 +4440,13 @@ } } }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, "node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, "dependencies": { - "cross-spawn": "^7.0.0", + "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" }, "engines": { @@ -4949,26 +4456,15 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" }, "engines": { @@ -5010,37 +4506,24 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/function.prototype.name": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", - "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" - }, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5077,16 +4560,21 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -5095,32 +4583,29 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">= 0.4" } }, - "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" - }, "engines": { - "node": ">= 0.4" + "node": ">=16" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ghost-testrpc": { @@ -5136,12 +4621,82 @@ "testrpc-sc": "index.js" } }, + "node_modules/ghost-testrpc/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ghost-testrpc/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ghost-testrpc/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/ghost-testrpc/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/ghost-testrpc/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/ghost-testrpc/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ghost-testrpc/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/glob": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", - "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", + "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", "dev": true, - "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^4.0.1", @@ -5172,22 +4727,11 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/glob/node_modules/minimatch": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -5241,7 +4785,6 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-16.0.0.tgz", "integrity": "sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" }, @@ -5249,21 +4792,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -5285,12 +4813,12 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5321,18 +4849,24 @@ "url": "https://github.com/sindresorhus/got?sponsor=1" } }, + "node_modules/got/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, "node_modules/graphlib": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", @@ -5372,15 +4906,6 @@ "node": ">=0.10.0" } }, - "node_modules/hard-rejection": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/hardhat": { "version": "2.23.0", "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.23.0.tgz", @@ -5446,29 +4971,28 @@ } }, "node_modules/hardhat-exposed": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/hardhat-exposed/-/hardhat-exposed-0.3.15.tgz", - "integrity": "sha512-jqxErCnSWGYf4vAkLmh3H3u+IuLuCLw/EVeV13z1JKJMJAd/iO+G283n8T124S/Q2BF/BoA2zgzYAlqXgNyKew==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/hardhat-exposed/-/hardhat-exposed-0.3.19.tgz", + "integrity": "sha512-vVye5TurJu8dWeo4ma+EfLAOQaJyica4uncd0/BGPO2tmexuDwZUmE1vYx81PlP4Iak3wqkNTEPxWQaE2ZnKnw==", "dev": true, "dependencies": { - "micromatch": "^4.0.4", - "solidity-ast": "^0.4.52" + "micromatch": "^4.0.8", + "solidity-ast": "^0.4.59" }, "peerDependencies": { "hardhat": "^2.3.0" } }, "node_modules/hardhat-gas-reporter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/hardhat-gas-reporter/-/hardhat-gas-reporter-2.1.0.tgz", - "integrity": "sha512-d/WU/qHhBFnbweAm2fAAjcaaE0M7BKZ4r+/bqcFlfP6um28BXtlv2FrJ6oyQUGSFD0ttbmB7sH4ZFDzkYw5GzA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/hardhat-gas-reporter/-/hardhat-gas-reporter-2.2.3.tgz", + "integrity": "sha512-/52fDR0WOgPTjImmx4j179SAgxPv/499TD0o0qnMhaRr24i2cqlcmCW92FJi0QAKu7HcnxdBGZWQP/5aPjQqUw==", "dev": true, - "license": "MIT", "dependencies": { "@ethersproject/abi": "^5.7.0", "@ethersproject/bytes": "^5.7.0", "@ethersproject/units": "^5.7.0", - "@solidity-parser/parser": "^0.18.0", + "@solidity-parser/parser": "^0.19.0", "axios": "^1.6.7", "brotli-wasm": "^2.0.1", "chalk": "4.1.2", @@ -5479,28 +5003,28 @@ "lodash": "^4.17.21", "markdown-table": "2.0.0", "sha1": "^1.1.1", - "viem": "2.7.14" + "viem": "^2.27.0" }, "peerDependencies": { "hardhat": "^2.16.0" } }, "node_modules/hardhat-gas-reporter/node_modules/@noble/curves": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.3.0.tgz", - "integrity": "sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", "dev": true, "dependencies": { - "@noble/hashes": "1.3.3" + "@noble/hashes": "1.4.0" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/hardhat-gas-reporter/node_modules/@noble/hashes": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", - "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", "dev": true, "engines": { "node": ">= 16" @@ -5509,56 +5033,40 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/hardhat-gas-reporter/node_modules/@scure/bip32": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.3.tgz", - "integrity": "sha512-LJaN3HwRbfQK0X1xFSi0Q9amqOgzQnnDngIt+ZlsBC3Bm7/nE7K0kwshZHyaru79yIVRv/e1mQAjZyuZG6jOFQ==", + "node_modules/hardhat-gas-reporter/node_modules/@scure/base": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", "dev": true, - "dependencies": { - "@noble/curves": "~1.3.0", - "@noble/hashes": "~1.3.2", - "@scure/base": "~1.1.4" - }, "funding": { "url": "https://paulmillr.com/funding/" } }, - "node_modules/hardhat-gas-reporter/node_modules/@scure/bip39": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.2.tgz", - "integrity": "sha512-HYf9TUXG80beW+hGAt3TRM8wU6pQoYur9iNypTROm42dorCGmLnFe3eWjz3gOq6G62H2WRh0FCzAR1PI+29zIA==", + "node_modules/hardhat-gas-reporter/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", "dev": true, "dependencies": { - "@noble/hashes": "~1.3.2", - "@scure/base": "~1.1.4" + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" }, "funding": { "url": "https://paulmillr.com/funding/" } }, - "node_modules/hardhat-gas-reporter/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/hardhat-gas-reporter/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/hardhat-gas-reporter/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" + "url": "https://paulmillr.com/funding/" } }, "node_modules/hardhat-gas-reporter/node_modules/chalk": { @@ -5577,49 +5085,16 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/hardhat-gas-reporter/node_modules/cli-table3": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.4.tgz", - "integrity": "sha512-Lm3L0p+/npIQWNIiyF/nAn7T5dnOwR3xNTHXYEBFBFVPXzCVNZ5lqEC/1eo/EVfpDsQ1I+TX4ORPQgp+UI0CRw==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0" - }, - "engines": { - "node": "10.* || >= 12.*" - }, - "optionalDependencies": { - "@colors/colors": "1.5.0" - } - }, - "node_modules/hardhat-gas-reporter/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/hardhat-gas-reporter/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/hardhat-gas-reporter/node_modules/ethereum-cryptography": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.3.tgz", - "integrity": "sha512-BlwbIL7/P45W8FGW2r7LGuvoEZ+7PWsniMvQ4p5s2xCyw9tmaDlpfsN9HjAucbF+t/qpVHwZUisgfK24TCW8aA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", "dev": true, "dependencies": { - "@noble/curves": "1.3.0", - "@noble/hashes": "1.3.3", - "@scure/bip32": "1.3.3", - "@scure/bip39": "1.2.2" + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" } }, "node_modules/hardhat-gas-reporter/node_modules/glob": { @@ -5627,7 +5102,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, - "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", @@ -5643,30 +5117,11 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/hardhat-gas-reporter/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/hardhat-gas-reporter/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/hardhat-gas-reporter/node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, - "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -5681,44 +5136,13 @@ "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/hardhat-gas-reporter/node_modules/markdown-table": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", - "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", - "dev": true, - "dependencies": { - "repeat-string": "^1.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/hardhat-gas-reporter/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "dev": true }, "node_modules/hardhat-gas-reporter/node_modules/path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, - "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -5730,36 +5154,10 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/hardhat-gas-reporter/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/hardhat-gas-reporter/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/hardhat-ignore-warnings": { - "version": "0.2.11", - "resolved": "https://registry.npmjs.org/hardhat-ignore-warnings/-/hardhat-ignore-warnings-0.2.11.tgz", - "integrity": "sha512-+nHnRbP6COFZaXE7HAY7TZNE3au5vHe5dkcnyq0XaP07ikT2fJ3NhFY0vn7Deh4Qbz0Z/9Xpnj2ki6Ktgk61pg==", + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/hardhat-ignore-warnings/-/hardhat-ignore-warnings-0.2.12.tgz", + "integrity": "sha512-SaxCLKzYBMk3Rd1275TnanUmmxwgU+bu4Ekf2MKcqXxxt6xTGcPTtTaM+USrLgmejZHC4Itg/PaWITlOp4RL3g==", "dev": true, "dependencies": { "minimatch": "^5.1.0", @@ -5767,15 +5165,6 @@ "solidity-comments": "^0.0.2" } }, - "node_modules/hardhat-ignore-warnings/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/hardhat-ignore-warnings/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", @@ -5900,6 +5289,15 @@ } ] }, + "node_modules/hardhat/node_modules/@scure/base": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", + "dev": true, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/hardhat/node_modules/@scure/bip32": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", @@ -6050,9 +5448,9 @@ } }, "node_modules/hardhat/node_modules/undici": { - "version": "5.28.4", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", - "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", + "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", "dev": true, "dependencies": { "@fastify/busboy": "^2.0.0" @@ -6061,6 +5459,36 @@ "node": ">=14.0" } }, + "node_modules/hardhat/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/hardhat/node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "dev": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/hardhat/node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -6073,79 +5501,34 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, "engines": { - "node": ">= 0.4.0" + "node": ">=8" } }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -6216,12 +5599,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, "node_modules/http-cache-semantics": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", @@ -6257,18 +5634,6 @@ "node": ">=10.19.0" } }, - "node_modules/http2-wrapper/node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -6283,10 +5648,13 @@ } }, "node_modules/human-id": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/human-id/-/human-id-1.0.2.tgz", - "integrity": "sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==", - "dev": true + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/human-id/-/human-id-4.1.1.tgz", + "integrity": "sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg==", + "dev": true, + "bin": { + "human-id": "dist/cli.js" + } }, "node_modules/human-signals": { "version": "5.0.0", @@ -6325,24 +5693,24 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "engines": { "node": ">= 4" } }, "node_modules/immutable": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.4.tgz", - "integrity": "sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", "dev": true }, "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, "dependencies": { "parent-module": "^1.0.0", @@ -6386,6 +5754,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "dependencies": { "once": "^1.3.0", @@ -6404,20 +5773,6 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, - "node_modules/internal-slot": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", @@ -6436,38 +5791,12 @@ "fp-ts": "^1.0.0" } }, - "node_modules/is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "dependencies": { - "has-bigints": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -6480,61 +5809,6 @@ "node": ">=8" } }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -6578,18 +5852,6 @@ "npm": ">=3" } }, - "node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -6599,28 +5861,13 @@ "node": ">=0.12.0" } }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/is-port-reachable": { @@ -6632,34 +5879,6 @@ "node": ">=8" } }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -6672,21 +5891,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-subdir": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-subdir/-/is-subdir-1.2.0.tgz", @@ -6699,36 +5903,6 @@ "node": ">=4" } }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-typed-array": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", - "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", - "dev": true, - "dependencies": { - "which-typed-array": "^1.1.11" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -6741,18 +5915,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -6762,12 +5924,6 @@ "node": ">=0.10.0" } }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -6775,14 +5931,14 @@ "dev": true }, "node_modules/isows": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.3.tgz", - "integrity": "sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.6.tgz", + "integrity": "sha512-lPHCayd40oW98/I0uvgaHKWCSvkzY27LjWLbtzOm64yQ+G3Q5npjjbdppU65iZXkK1Zt+kH9pfegli0AYfwYYw==", "dev": true, "funding": [ { "type": "github", - "url": "https://github.com/sponsors/wagmi-dev" + "url": "https://github.com/sponsors/wevm" } ], "peerDependencies": { @@ -6790,11 +5946,10 @@ } }, "node_modules/jackspeak": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", - "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.0.tgz", + "integrity": "sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==", "dev": true, - "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -6803,9 +5958,6 @@ }, "funding": { "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" } }, "node_modules/js-sha3": { @@ -6846,9 +5998,9 @@ "dev": true }, "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, "node_modules/json-stable-stringify-without-jsonify": { @@ -6876,9 +6028,9 @@ } }, "node_modules/jsonschema": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", - "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz", + "integrity": "sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==", "dev": true, "engines": { "node": "*" @@ -6904,7 +6056,6 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, - "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -6918,15 +6069,6 @@ "node": ">=0.10.0" } }, - "node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/latest-version": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", @@ -6974,21 +6116,21 @@ "dev": true }, "node_modules/lint-staged": { - "version": "15.2.10", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.10.tgz", - "integrity": "sha512-5dY5t743e1byO19P9I4b3x8HJwalIznL5E1FWYnU6OWw33KxNBSLAc6Cy7F2PsFEO8FKnLwjwm5hx7aMF0jzZg==", - "dev": true, - "dependencies": { - "chalk": "~5.3.0", - "commander": "~12.1.0", - "debug": "~4.3.6", - "execa": "~8.0.1", - "lilconfig": "~3.1.2", - "listr2": "~8.2.4", - "micromatch": "~4.0.8", - "pidtree": "~0.6.0", - "string-argv": "~0.3.2", - "yaml": "~2.5.0" + "version": "15.5.1", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.5.1.tgz", + "integrity": "sha512-6m7u8mue4Xn6wK6gZvSCQwBvMBR36xfY24nF5bMTf2MHDYG6S3yhJuOgdYVw99hsjyDt2d4z168b3naI8+NWtQ==", + "dev": true, + "dependencies": { + "chalk": "^5.4.1", + "commander": "^13.1.0", + "debug": "^4.4.0", + "execa": "^8.0.1", + "lilconfig": "^3.1.3", + "listr2": "^8.2.5", + "micromatch": "^4.0.8", + "pidtree": "^0.6.0", + "string-argv": "^0.3.2", + "yaml": "^2.7.0" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -7001,9 +6143,9 @@ } }, "node_modules/lint-staged/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", + "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -7012,42 +6154,10 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/lint-staged/node_modules/commander": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", - "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", - "dev": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/lint-staged/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/lint-staged/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/listr2": { - "version": "8.2.5", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.5.tgz", - "integrity": "sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.3.2.tgz", + "integrity": "sha512-vsBzcU4oE+v0lj4FhVLzr9dBTv4/fHIa57l+GCwovP8MoFNZJTOhGU8PXd4v2VJCbECAaijBiHntiekFMLvo0g==", "dev": true, "dependencies": { "cli-truncate": "^4.0.0", @@ -7085,13 +6195,36 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/listr2/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" + "node_modules/listr2/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true + }, + "node_modules/listr2/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" }, "engines": { "node": ">=12" @@ -7117,21 +6250,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/load-yaml-file": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", - "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.5", - "js-yaml": "^3.13.0", - "pify": "^4.0.1", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -7154,6 +6272,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.", "dev": true }, "node_modules/lodash.merge": { @@ -7190,21 +6309,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/log-symbols/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -7221,45 +6325,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/log-symbols/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/log-symbols/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/log-symbols/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/log-update": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", @@ -7318,6 +6383,12 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/log-update/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true + }, "node_modules/log-update/node_modules/is-fullwidth-code-point": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", @@ -7349,6 +6420,23 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/log-update/node_modules/strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -7382,12 +6470,12 @@ } }, "node_modules/loupe": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", - "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", "dev": true, "dependencies": { - "get-func-name": "^2.0.0" + "get-func-name": "^2.0.1" } }, "node_modules/lowercase-keys": { @@ -7409,33 +6497,34 @@ "dev": true }, "node_modules/lru-cache": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz", - "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", + "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", "dev": true, - "license": "ISC", "engines": { "node": "20 || >=22" } }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "node_modules/markdown-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", "dev": true, - "optional": true, - "peer": true + "dependencies": { + "repeat-string": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } }, - "node_modules/map-obj": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", - "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "dev": true, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 0.4" } }, "node_modules/md5.js": { @@ -7458,43 +6547,6 @@ "node": ">= 0.10.0" } }, - "node_modules/meow": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz", - "integrity": "sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==", - "dev": true, - "dependencies": { - "@types/minimist": "^1.2.0", - "camelcase-keys": "^6.2.2", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "^4.0.2", - "normalize-package-data": "^2.5.0", - "read-pkg-up": "^7.0.1", - "redent": "^3.0.0", - "trim-newlines": "^3.0.0", - "type-fest": "^0.13.1", - "yargs-parser": "^18.1.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/meow/node_modules/type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -7566,15 +6618,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/micro-packed/node_modules/@scure/base": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.5.tgz", - "integrity": "sha512-9rE6EOVeIQzt5TSu4v+K523F8u6DhBsoZWPGKlnCshhlDhy0kJzUX4V+tr2dWmzF1GdekvThABoEQBGBQI7xZw==", - "dev": true, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -7645,15 +6688,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -7667,15 +6701,18 @@ "dev": true }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minimist": { @@ -7687,39 +6724,15 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "dev": true, - "dependencies": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, - "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } }, - "node_modules/mixme": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/mixme/-/mixme-0.5.9.tgz", - "integrity": "sha512-VC5fg6ySUscaWUpI4gxCBTQMH2RdUpNrk+MsbpCYtIvf9SBJdiUey4qE7BXviJsJR4nDQxCZ+3yaYNW3guz/Pw==", - "dev": true, - "engines": { - "node": ">= 8.0.0" - } - }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -7742,32 +6755,31 @@ } }, "node_modules/mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", - "dev": true, - "dependencies": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "nanoid": "3.3.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" }, "bin": { "_mocha": "bin/_mocha", @@ -7775,19 +6787,6 @@ }, "engines": { "node": ">= 14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" - } - }, - "node_modules/mocha/node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" } }, "node_modules/mocha/node_modules/argparse": { @@ -7807,18 +6806,6 @@ "wrap-ansi": "^7.0.0" } }, - "node_modules/mocha/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/mocha/node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -7836,55 +6823,25 @@ } }, "node_modules/mocha/node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "*" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/mocha/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/mocha/node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -7913,9 +6870,9 @@ } }, "node_modules/mocha/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -7924,27 +6881,11 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/mocha/node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, - "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -7970,20 +6911,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mocha/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -8017,21 +6944,11 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/mocha/node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -8039,24 +6956,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": ">=4" } }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -8105,9 +7019,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", - "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", "dev": true, "bin": { "node-gyp-build": "bin.js", @@ -8148,27 +7062,6 @@ "nopt": "bin/nopt.js" } }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -8237,46 +7130,10 @@ "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==", "dev": true }, - "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/obliterator": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", - "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.5.tgz", + "integrity": "sha512-42CPE9AhahZRsMNslczq0ctAEtqk8Eka26QofnqC346BZdHDySk3LWka23LI7ULIw11NmltpiLagIq8gBozxTw==", "dev": true }, "node_modules/once": { @@ -8304,17 +7161,17 @@ } }, "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -8341,6 +7198,35 @@ "integrity": "sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==", "dev": true }, + "node_modules/ox": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/ox/-/ox-0.6.9.tgz", + "integrity": "sha512-wi5ShvzE4eOcTwQVsIPdFr+8ycyX+5le/96iAJutaZAvCes1J0+RvpEPg5QDPDiaR0XQQAvZVl7AwqQcINuUug==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "dependencies": { + "@adraffy/ens-normalize": "^1.10.1", + "@noble/curves": "^1.6.0", + "@noble/hashes": "^1.5.0", + "@scure/bip32": "^1.5.0", + "@scure/bip39": "^1.4.0", + "abitype": "^1.0.6", + "eventemitter3": "5.0.1" + }, + "peerDependencies": { + "typescript": ">=5.4.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/p-cancelable": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", @@ -8372,11 +7258,10 @@ } }, "node_modules/p-limit": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.0.0.tgz", - "integrity": "sha512-Dx+NzOuILWwjJE9OYtEKuQRy0i3c5QVAmDsVrvvRSgyNnPuB27D2DyEjl6QTNyeePaAHjaPk+ya0yA0Frld8RA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.2.0.tgz", + "integrity": "sha512-kuUqqHNUqoIWp/c467RI4X6mmyuojY5jGutNU0wVTmEOOfcuwLqyMVoAi9MKi2Ak+5i9+nhmrK4ufZE8069kHA==", "dev": true, - "license": "MIT", "dependencies": { "yocto-queue": "^1.1.1" }, @@ -8457,11 +7342,19 @@ } }, "node_modules/package-json-from-dist": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", - "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true + }, + "node_modules/package-manager-detector": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-0.2.11.tgz", + "integrity": "sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==", "dev": true, - "license": "BlueOak-1.0.0" + "dependencies": { + "quansync": "^0.2.7" + } }, "node_modules/parent-module": { "version": "1.0.1", @@ -8531,7 +7424,6 @@ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", "dev": true, - "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" @@ -8616,18 +7508,6 @@ "node": ">=6" } }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -8637,94 +7517,13 @@ "node": ">=4" } }, - "node_modules/preferred-pm": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.1.2.tgz", - "integrity": "sha512-nk7dKrcW8hfCZ4H6klWcdRknBOXWzNQByJ0oJyX97BOupsYD+FzLS4hflgEu/uPUEHZCuRfMxzCBsuWd7OzT8Q==", - "dev": true, - "dependencies": { - "find-up": "^5.0.0", - "find-yarn-workspace-root2": "1.2.16", - "path-exists": "^4.0.0", - "which-pm": "2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/preferred-pm/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/preferred-pm/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/preferred-pm/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/preferred-pm/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/preferred-pm/node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "node_modules/pony-cause": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/pony-cause/-/pony-cause-2.1.11.tgz", + "integrity": "sha512-M7LhCsdNbNgiLYiP4WjsfLUuFmCfnjdF6jKe2R9NKl4WFN+HZPGHJZ9lnLP7f9ZnKe3U9nuWD0szirmj+migUg==", "dev": true, - "license": "MIT", "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12.0.0" } }, "node_modules/prelude-ls": { @@ -8737,9 +7536,9 @@ } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -8752,30 +7551,26 @@ } }, "node_modules/prettier-plugin-solidity": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.1.3.tgz", - "integrity": "sha512-fQ9yucPi2sBbA2U2Xjh6m4isUTJ7S7QLc/XDDsktqqxYfTwdYKJ0EnnywXHwCGAaYbQNK+HIYPL1OemxuMsgeg==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.4.3.tgz", + "integrity": "sha512-Mrr/iiR9f9IaeGRMZY2ApumXcn/C5Gs3S7B7hWB3gigBFML06C0yEyW86oLp0eqiA0qg+46FaChgLPJCj/pIlg==", "dev": true, "dependencies": { - "@solidity-parser/parser": "^0.16.0", - "semver": "^7.3.8", - "solidity-comments-extractor": "^0.0.7" + "@solidity-parser/parser": "^0.20.1", + "semver": "^7.7.1" }, "engines": { - "node": ">=12" + "node": ">=18" }, "peerDependencies": { - "prettier": ">=2.3.0 || >=3.0.0-alpha.0" + "prettier": ">=2.3.0" } }, "node_modules/prettier-plugin-solidity/node_modules/@solidity-parser/parser": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.1.tgz", - "integrity": "sha512-PdhRFNhbTtu3x8Axm0uYpqOy/lODYQK+MlYSgqIsq2L8SFYEHJPHNUiOTAJbDGzNjjr1/n9AcIayxafR/fWmYw==", - "dev": true, - "dependencies": { - "antlr4ts": "^0.5.0-alpha.4" - } + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.20.1.tgz", + "integrity": "sha512-58I2sRpzaQUN+jJmWbHfbWf9AKfzqCI8JAdFB0vbyY+u8tBRcuTt9LxzasvR0LGQpcRv97eyV7l61FQ3Ib7zVw==", + "dev": true }, "node_modules/proper-lockfile": { "version": "4.1.2", @@ -8788,6 +7583,12 @@ "signal-exit": "^3.0.2" } }, + "node_modules/proper-lockfile/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", @@ -8800,21 +7601,31 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "dev": true }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", - "dev": true - }, "node_modules/punycode": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", - "integrity": "sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "engines": { "node": ">=6" } }, + "node_modules/quansync": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.10.tgz", + "integrity": "sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/antfu" + }, + { + "type": "individual", + "url": "https://github.com/sponsors/sxzz" + } + ] + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -8836,12 +7647,15 @@ ] }, "node_modules/quick-lru": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", "dev": true, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/randombytes": { @@ -8892,83 +7706,33 @@ "node": ">=0.10.0" } }, - "node_modules/read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "node_modules/read-yaml-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-1.1.0.tgz", + "integrity": "sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==", "dev": true, "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" + "graceful-fs": "^4.1.5", + "js-yaml": "^3.6.1", + "pify": "^4.0.1", + "strip-bom": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "dependencies": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg/node_modules/type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-yaml-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-1.1.0.tgz", - "integrity": "sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.5", - "js-yaml": "^3.6.1", - "pify": "^4.0.1", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "node": ">= 6" } }, "node_modules/readdirp": { @@ -9007,58 +7771,32 @@ "node": ">=6.0.0" } }, - "node_modules/redent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", - "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "dev": true, - "dependencies": { - "indent-string": "^4.0.0", - "strip-indent": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/redent/node_modules/strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "node_modules/recursive-readdir/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { - "min-indent": "^1.0.0" - }, - "engines": { - "node": ">=8" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/regenerator-runtime": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", - "dev": true - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", - "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "node_modules/recursive-readdir/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "set-function-name": "^2.0.0" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "*" } }, "node_modules/registry-auth-token": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", - "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.1.0.tgz", + "integrity": "sha512-GdekYuwLXLxMuFTwAPg5UKGLW/UXzQrZvH/Zj791BQif5T05T0RsaLfHc9q3ZOKi7n+BoprPD9mJ0O0k4xzUlw==", "dev": true, "dependencies": { "@pnpm/npm-conf": "^2.1.0" @@ -9100,11 +7838,14 @@ "node": ">=0.10.0" } }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, "node_modules/resolve": { "version": "1.17.0", @@ -9179,18 +7920,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/restore-cursor/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", @@ -9201,9 +7930,9 @@ } }, "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, "engines": { "iojs": ">=1.0.0", @@ -9217,13 +7946,13 @@ "dev": true }, "node_modules/rimraf": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.0.tgz", - "integrity": "sha512-u+yqhM92LW+89cxUQK0SRyvXYQmyuKHx0jkx4W7KfwLGLqJnQM5031Uv1trE4gB9XEXBM/s6MxKlfW95IidqaA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", + "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", "dev": true, - "license": "ISC", "dependencies": { - "glob": "^11.0.0" + "glob": "^11.0.0", + "package-json-from-dist": "^1.0.0" }, "bin": { "rimraf": "dist/esm/bin.mjs" @@ -9257,12 +7986,6 @@ "rlp": "bin/rlp" } }, - "node_modules/rlp/node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "dev": true - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -9286,24 +8009,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/safe-array-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", - "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "has-symbols": "^1.0.3", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -9324,20 +8029,6 @@ } ] }, - "node_modules/safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "is-regex": "^1.1.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -9369,6 +8060,16 @@ "istanbul": "lib/cli.js" } }, + "node_modules/sc-istanbul/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/sc-istanbul/node_modules/esprima": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", @@ -9386,6 +8087,7 @@ "version": "5.0.15", "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "inflight": "^1.0.4", @@ -9407,6 +8109,18 @@ "node": ">=0.10.0" } }, + "node_modules/sc-istanbul/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/sc-istanbul/node_modules/resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", @@ -9458,21 +8172,6 @@ "node": ">=18.0.0" } }, - "node_modules/secp256k1/node_modules/elliptic": { - "version": "6.5.7", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", - "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", - "dev": true, - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "node_modules/secp256k1/node_modules/node-addon-api": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", @@ -9480,13 +8179,10 @@ "dev": true }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -9494,70 +8190,15 @@ "node": ">=10" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "dependencies": { "randombytes": "^2.1.0" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-function-name": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", - "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", - "dev": true, - "dependencies": { - "define-data-property": "^1.0.1", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -9640,10 +8281,21 @@ "node": ">=4" } }, + "node_modules/shelljs/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/shelljs/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -9660,29 +8312,29 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "node_modules/shelljs/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "*" } }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/slash": { "version": "3.0.0", @@ -9694,207 +8346,46 @@ } }, "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/solc": { + "version": "0.8.26", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.26.tgz", + "integrity": "sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g==", "dev": true, "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/smartwrap": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/smartwrap/-/smartwrap-2.0.2.tgz", - "integrity": "sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==", - "dev": true, - "dependencies": { - "array.prototype.flat": "^1.2.3", - "breakword": "^1.0.5", - "grapheme-splitter": "^1.0.4", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1", - "yargs": "^15.1.0" - }, - "bin": { - "smartwrap": "src/terminal-adapter.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/smartwrap/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/smartwrap/node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "node_modules/smartwrap/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/smartwrap/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/smartwrap/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/smartwrap/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/smartwrap/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/smartwrap/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "node_modules/smartwrap/node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/solc": { - "version": "0.8.26", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.26.tgz", - "integrity": "sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g==", - "dev": true, - "license": "MIT", - "dependencies": { - "command-exists": "^1.2.8", - "commander": "^8.1.0", - "follow-redirects": "^1.12.1", - "js-sha3": "0.8.0", - "memorystream": "^0.3.1", - "semver": "^5.5.0", - "tmp": "0.0.33" + "command-exists": "^1.2.8", + "commander": "^8.1.0", + "follow-redirects": "^1.12.1", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "semver": "^5.5.0", + "tmp": "0.0.33" }, "bin": { "solcjs": "solc.js" @@ -9908,7 +8399,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", "dev": true, - "license": "MIT", "engines": { "node": ">= 12" } @@ -9918,18 +8408,17 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver" } }, "node_modules/solhint": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-5.0.0.tgz", - "integrity": "sha512-pSRKkzRsruia6/xa9L5VSyd7dMZkiiTi/aYZcvUQo7KK+S16ojPwIbt2jfjbH5WEJ83grzIIE4WrYQfAxGWh/A==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-5.0.5.tgz", + "integrity": "sha512-WrnG6T+/UduuzSWsSOAbfq1ywLUDwNea3Gd5hg6PS+pLUm8lz2ECNr0beX609clBxmDeZ3676AiA9nPDljmbJQ==", "dev": true, "dependencies": { - "@solidity-parser/parser": "^0.18.0", + "@solidity-parser/parser": "^0.19.0", "ajv": "^6.12.6", "antlr4": "^4.13.1-patch-1", "ast-parents": "^0.0.1", @@ -9959,19 +8448,20 @@ "resolved": "scripts/solhint-custom", "link": true }, - "node_modules/solhint/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/solhint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/solhint/node_modules/argparse": { @@ -9980,15 +8470,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/solhint/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/solhint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -10005,28 +8486,20 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/solhint/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/solhint/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, "engines": { - "node": ">=7.0.0" + "node": ">=14" } }, - "node_modules/solhint/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/solhint/node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -10042,15 +8515,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/solhint/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/solhint/node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -10063,6 +8527,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/solhint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "node_modules/solhint/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", @@ -10091,26 +8561,11 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/solhint/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/solidity-ast": { - "version": "0.4.52", - "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.52.tgz", - "integrity": "sha512-iOya9BSiB9jhM8Vf40n8lGELGzwrUc57rl5BhfNtJ5cvAaMvRcNlHeAMNvqJJyjoUnczqRbHqdivEqK89du3Cw==", - "dev": true, - "dependencies": { - "array.prototype.findlast": "^1.2.2" - } + "version": "0.4.60", + "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.60.tgz", + "integrity": "sha512-UwhasmQ37ji1ul8cIp0XlrQ/+SVQhy09gGqJH4jnwdo2TgI6YIByzi0PI5QvIGcIdFOs1pbSmJW1pnWB7AVh2w==", + "dev": true }, "node_modules/solidity-comments": { "version": "0.0.2", @@ -10133,11 +8588,85 @@ "solidity-comments-win32-x64-msvc": "0.0.2" } }, - "node_modules/solidity-comments-extractor": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz", - "integrity": "sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw==", - "dev": true + "node_modules/solidity-comments-darwin-arm64": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-darwin-arm64/-/solidity-comments-darwin-arm64-0.0.2.tgz", + "integrity": "sha512-HidWkVLSh7v+Vu0CA7oI21GWP/ZY7ro8g8OmIxE8oTqyMwgMbE8F1yc58Sj682Hj199HCZsjmtn1BE4PCbLiGA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-darwin-x64": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-darwin-x64/-/solidity-comments-darwin-x64-0.0.2.tgz", + "integrity": "sha512-Zjs0Ruz6faBTPT6fBecUt6qh4CdloT8Bwoc0+qxRoTn9UhYscmbPQkUgQEbS0FQPysYqVzzxJB4h1Ofbf4wwtA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-freebsd-x64": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-freebsd-x64/-/solidity-comments-freebsd-x64-0.0.2.tgz", + "integrity": "sha512-8Qe4mpjuAxFSwZJVk7B8gAoLCdbtS412bQzBwk63L8dmlHogvE39iT70aAk3RHUddAppT5RMBunlPUCFYJ3ZTw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-linux-arm64-gnu": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-linux-arm64-gnu/-/solidity-comments-linux-arm64-gnu-0.0.2.tgz", + "integrity": "sha512-spkb0MZZnmrP+Wtq4UxP+nyPAVRe82idOjqndolcNR0S9Xvu4ebwq+LvF4HiUgjTDmeiqYiFZQ8T9KGdLSIoIg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-linux-arm64-musl": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-linux-arm64-musl/-/solidity-comments-linux-arm64-musl-0.0.2.tgz", + "integrity": "sha512-guCDbHArcjE+JDXYkxx5RZzY1YF6OnAKCo+sTC5fstyW/KGKaQJNPyBNWuwYsQiaEHpvhW1ha537IvlGek8GqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } }, "node_modules/solidity-comments-linux-x64-gnu": { "version": "0.0.2", @@ -10171,25 +8700,72 @@ "node": ">= 10" } }, - "node_modules/solidity-coverage": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.5.tgz", - "integrity": "sha512-6C6N6OV2O8FQA0FWA95FdzVH+L16HU94iFgg5wAFZ29UpLFkgNI/DRR2HotG1bC0F4gAc/OMs2BJI44Q/DYlKQ==", + "node_modules/solidity-comments-win32-arm64-msvc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-win32-arm64-msvc/-/solidity-comments-win32-arm64-msvc-0.0.2.tgz", + "integrity": "sha512-QnWJoCQcJj+rnutULOihN9bixOtYWDdF5Rfz9fpHejL1BtNjdLW1om55XNVHGAHPqBxV4aeQQ6OirKnp9zKsug==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-win32-ia32-msvc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-win32-ia32-msvc/-/solidity-comments-win32-ia32-msvc-0.0.2.tgz", + "integrity": "sha512-vUg4nADtm/NcOtlIymG23NWJUSuMsvX15nU7ynhGBsdKtt8xhdP3C/zA6vjDk8Jg+FXGQL6IHVQ++g/7rSQi0w==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-win32-x64-msvc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-win32-x64-msvc/-/solidity-comments-win32-x64-msvc-0.0.2.tgz", + "integrity": "sha512-36j+KUF4V/y0t3qatHm/LF5sCUCBx2UndxE1kq5bOzh/s+nQgatuyB+Pd5BfuPQHdWu2KaExYe20FlAa6NL7+Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-coverage": { + "version": "0.8.15", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.15.tgz", + "integrity": "sha512-qH7290NKww4/t/qFvnSEePEzON0k025IGVlwc8wo8Q6p+h1Tt6fV2M0k3yfsps3TomZYTROsfPXjx7MSnwD5uA==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.0.9", - "@solidity-parser/parser": "^0.16.0", + "@solidity-parser/parser": "^0.19.0", "chalk": "^2.4.2", "death": "^1.1.0", - "detect-port": "^1.3.0", "difflib": "^0.2.4", "fs-extra": "^8.1.0", "ghost-testrpc": "^0.0.2", "global-modules": "^2.0.0", "globby": "^10.0.1", "jsonschema": "^1.2.4", - "lodash": "^4.17.15", - "mocha": "10.2.0", + "lodash": "^4.17.21", + "mocha": "^10.2.0", "node-emoji": "^1.10.0", "pify": "^4.0.1", "recursive-readdir": "^2.2.2", @@ -10205,13 +8781,64 @@ "hardhat": "^2.11.0" } }, - "node_modules/solidity-coverage/node_modules/@solidity-parser/parser": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.1.tgz", - "integrity": "sha512-PdhRFNhbTtu3x8Axm0uYpqOy/lODYQK+MlYSgqIsq2L8SFYEHJPHNUiOTAJbDGzNjjr1/n9AcIayxafR/fWmYw==", + "node_modules/solidity-coverage/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/solidity-coverage/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/solidity-coverage/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/solidity-coverage/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "dependencies": { - "antlr4ts": "^0.5.0-alpha.4" + "color-name": "1.1.3" + } + }, + "node_modules/solidity-coverage/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/solidity-coverage/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" } }, "node_modules/solidity-coverage/node_modules/fs-extra": { @@ -10232,6 +8859,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -10267,6 +8895,39 @@ "node": ">=8" } }, + "node_modules/solidity-coverage/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/solidity-coverage/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/solidity-coverage/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/solidity-docgen": { "version": "0.6.0-beta.36", "resolved": "https://registry.npmjs.org/solidity-docgen/-/solidity-docgen-0.6.0-beta.36.tgz", @@ -10313,107 +8974,15 @@ } }, "node_modules/spawndamnit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawndamnit/-/spawndamnit-2.0.0.tgz", - "integrity": "sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==", - "dev": true, - "dependencies": { - "cross-spawn": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, - "node_modules/spawndamnit/node_modules/cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", - "dev": true, - "dependencies": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "node_modules/spawndamnit/node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "node_modules/spawndamnit/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", - "dev": true, - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/spawndamnit/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/spawndamnit/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/spawndamnit/node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", - "dev": true - }, - "node_modules/spdx-correct": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", - "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/spdx-expression-parse": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "resolved": "https://registry.npmjs.org/spawndamnit/-/spawndamnit-3.0.1.tgz", + "integrity": "sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg==", "dev": true, "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "cross-spawn": "^7.0.5", + "signal-exit": "^4.0.1" } }, - "node_modules/spdx-license-ids": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz", - "integrity": "sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==", - "dev": true - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -10421,9 +8990,9 @@ "dev": true }, "node_modules/stacktrace-parser": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", - "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.11.tgz", + "integrity": "sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg==", "dev": true, "dependencies": { "type-fest": "^0.7.1" @@ -10450,15 +9019,6 @@ "node": ">= 0.8" } }, - "node_modules/stream-transform": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/stream-transform/-/stream-transform-2.1.3.tgz", - "integrity": "sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==", - "dev": true, - "dependencies": { - "mixme": "^0.5.1" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -10478,20 +9038,17 @@ } }, "node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/string-width-cjs": { @@ -10518,82 +9075,13 @@ "node": ">=8" } }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/string-width/node_modules/emoji-regex": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", - "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", - "dev": true - }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/string.prototype.trim": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", - "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "node_modules/string-width/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimend": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", - "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", - "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, "node_modules/strip-ansi": { @@ -10668,21 +9156,21 @@ } }, "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.9.0.tgz", + "integrity": "sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==", "dev": true, "dependencies": { "ajv": "^8.0.1", @@ -10695,22 +9183,6 @@ "node": ">=10.0.0" } }, - "node_modules/table/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/table/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -10720,33 +9192,21 @@ "node": ">=8" } }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/table/node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/table/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/table/node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, "node_modules/term-size": { @@ -10848,75 +9308,10 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, - "node_modules/trim-newlines": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", - "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true }, "node_modules/tsort": { @@ -10925,97 +9320,6 @@ "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", "dev": true }, - "node_modules/tty-table": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/tty-table/-/tty-table-4.2.1.tgz", - "integrity": "sha512-xz0uKo+KakCQ+Dxj1D/tKn2FSyreSYWzdkL/BYhgN6oMW808g8QRMuh1atAV9fjTPbWBjfbkKQpI/5rEcnAc7g==", - "dev": true, - "dependencies": { - "chalk": "^4.1.2", - "csv": "^5.5.3", - "kleur": "^4.1.5", - "smartwrap": "^2.0.2", - "strip-ansi": "^6.0.1", - "wcwidth": "^1.0.1", - "yargs": "^17.7.1" - }, - "bin": { - "tty-table": "adapters/terminal-adapter.js" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/tty-table/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/tty-table/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/tty-table/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/tty-table/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/tty-table/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/tty-table/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -11029,18 +9333,18 @@ } }, "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, "engines": { "node": ">=10" @@ -11049,90 +9353,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/typed-array-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", - "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "is-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/typed-array-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", - "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", - "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", - "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", - "dev": true, - "optional": true, - "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/uglify-js": { - "version": "3.17.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", - "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", "dev": true, "optional": true, "bin": { @@ -11142,27 +9366,11 @@ "node": ">=0.8.0" } }, - "node_modules/unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/undici": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.4.0.tgz", - "integrity": "sha512-PUQM3/es3noM24oUn10u3kNNap0AbxESOmnssmW+dOi9yGwlUSi5nTNYl3bNbTkWOF8YZDkx2tCmj9OtQ3iGGw==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.8.0.tgz", + "integrity": "sha512-vFv1GA99b7eKO1HG/4RPu2Is3FBTWBrmzqzO0mz+rLxN3yXkE4mqRcb8g8fHxzX4blEysrNZLqg5RbJLqX5buA==", "dev": true, - "license": "MIT", "engines": { "node": ">=20.18.1" } @@ -11171,8 +9379,7 @@ "version": "6.19.8", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/universalify": { "version": "0.1.2", @@ -11201,21 +9408,6 @@ "punycode": "^2.1.0" } }, - "node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "peer": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, "node_modules/utf8": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", @@ -11229,36 +9421,22 @@ "dev": true }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true, - "optional": true, - "peer": true - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "node_modules/viem": { - "version": "2.7.14", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.7.14.tgz", - "integrity": "sha512-5b1KB1gXli02GOQHZIUsRluNUwssl2t4hqdFAzyWPwJ744N83jAOBOjOkrGz7K3qMIv9b0GQt3DoZIErSQTPkQ==", + "version": "2.28.2", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.28.2.tgz", + "integrity": "sha512-HTdoskL1fsyabBplaY6qz59WXHY6+edt+byuKQz3M8SKPU9D9XLgu7t04JNXPHoxPOv72qB+ZNSfpN6PMdDtqw==", "dev": true, "funding": [ { @@ -11267,14 +9445,14 @@ } ], "dependencies": { - "@adraffy/ens-normalize": "1.10.0", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.2", - "@scure/bip32": "1.3.2", - "@scure/bip39": "1.2.1", - "abitype": "1.0.0", - "isows": "1.0.3", - "ws": "8.13.0" + "@noble/curves": "1.8.2", + "@noble/hashes": "1.7.2", + "@scure/bip32": "1.6.2", + "@scure/bip39": "1.5.4", + "abitype": "1.0.8", + "isows": "1.0.6", + "ox": "0.6.9", + "ws": "8.18.1" }, "peerDependencies": { "typescript": ">=5.0.4" @@ -11285,54 +9463,64 @@ } } }, - "node_modules/viem/node_modules/@adraffy/ens-normalize": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz", - "integrity": "sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==", - "dev": true - }, "node_modules/viem/node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.2.tgz", + "integrity": "sha512-vnI7V6lFNe0tLAuJMu+2sX+FcL14TaCWy1qiczg1VwRmPrpQCdq5ESXQMqUc2tluRNf6irBXrWbl1mGN8uaU/g==", "dev": true, "dependencies": { - "@noble/hashes": "1.3.2" + "@noble/hashes": "1.7.2" + }, + "engines": { + "node": "^14.21.3 || >=16" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/viem/node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.2.tgz", + "integrity": "sha512-biZ0NUSxyjLLqo6KxEJ1b+C2NAx0wtDoFvCaXHGgUkeHzf3Xc1xKumFKREuT7f7DARNZ/slvYUwFG6B0f2b6hQ==", "dev": true, "engines": { - "node": ">= 16" + "node": "^14.21.3 || >=16" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/viem/node_modules/@scure/bip32": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.2.tgz", - "integrity": "sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.2.tgz", + "integrity": "sha512-t96EPDMbtGgtb7onKKqxRLfE5g05k7uHnHRM2xdE6BP/ZmxaLtPek4J4KfVn/90IQNrU1IOAqMgiDtUdtbe3nw==", "dev": true, "dependencies": { - "@noble/curves": "~1.2.0", - "@noble/hashes": "~1.3.2", - "@scure/base": "~1.1.2" + "@noble/curves": "~1.8.1", + "@noble/hashes": "~1.7.1", + "@scure/base": "~1.2.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/viem/node_modules/@scure/bip39": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.4.tgz", + "integrity": "sha512-TFM4ni0vKvCfBpohoh+/lY05i9gRbSwXWngAsF4CABQxoaOHijxuaZ2R6cStDQ5CHtHO9aGJTr4ksVJASRRyMA==", + "dev": true, + "dependencies": { + "@noble/hashes": "~1.7.1", + "@scure/base": "~1.2.4" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/viem/node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", "dev": true, "engines": { "node": ">=10.0.0" @@ -11350,19 +9538,10 @@ } } }, - "node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", - "dev": true, - "dependencies": { - "defaults": "^1.0.3" - } - }, "node_modules/web3-utils": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.2.tgz", - "integrity": "sha512-TdApdzdse5YR+5GCX/b/vQnhhbj1KSAtfrDtRW7YS0kcWp1gkJsN62gw6GzCaNTeXookB7UrLtmDUuMv65qgow==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.4.tgz", + "integrity": "sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==", "dev": true, "dependencies": { "@ethereumjs/util": "^8.1.0", @@ -11378,22 +9557,76 @@ "node": ">=8.0.0" } }, - "node_modules/web3-utils/node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "dev": true - }, + "node_modules/web3-utils/node_modules/@noble/curves": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", + "dev": true, + "dependencies": { + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/@scure/base": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", + "dev": true, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "dev": true, + "dependencies": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dev": true, + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/web3-utils/node_modules/ethereum-cryptography": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", - "integrity": "sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", "dev": true, "dependencies": { - "@noble/curves": "1.1.0", - "@noble/hashes": "1.3.1", - "@scure/bip32": "1.3.1", - "@scure/bip39": "1.2.1" + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" } }, "node_modules/webidl-conversions": { @@ -11427,60 +9660,6 @@ "node": ">= 8" } }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-module": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", - "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", - "dev": true - }, - "node_modules/which-pm": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.0.0.tgz", - "integrity": "sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==", - "dev": true, - "dependencies": { - "load-yaml-file": "^0.2.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8.15" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", - "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -11493,29 +9672,6 @@ "node": ">=8" } }, - "node_modules/widest-line/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/widest-line/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -11532,9 +9688,9 @@ "dev": true }, "node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", "dev": true }, "node_modules/wrap-ansi": { @@ -11572,118 +9728,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/wrap-ansi-cjs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -11691,17 +9735,16 @@ "dev": true }, "node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, - "license": "MIT", "engines": { - "node": ">=8.3.0" + "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -11722,9 +9765,9 @@ } }, "node_modules/yaml": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", - "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz", + "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==", "dev": true, "bin": { "yaml": "bin.mjs" @@ -11752,25 +9795,12 @@ } }, "node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-parser/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, "engines": { - "node": ">=6" + "node": ">=10" } }, "node_modules/yargs-unparser": { @@ -11788,50 +9818,6 @@ "node": ">=10" } }, - "node_modules/yargs-unparser/node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/yargs-unparser/node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/yargs/node_modules/yargs-parser": { "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", @@ -11841,23 +9827,11 @@ "node": ">=12" } }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/yocto-queue": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", - "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", + "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.20" }, @@ -11866,12 +9840,33 @@ } }, "scripts/solhint-custom": { - "name": "solhint-plugin-openzeppelin", "version": "0.0.0", "dev": true, "dependencies": { "minimatch": "^3.1.2" } + }, + "scripts/solhint-custom/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "scripts/solhint-custom/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } } } } From 71a6b25fa8fc171f4697e88974216202edc91751 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 01:14:22 -0600 Subject: [PATCH 025/110] up --- test/utils/cryptography/ERC7739Utils.test.js | 38 +++++++++----------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/test/utils/cryptography/ERC7739Utils.test.js b/test/utils/cryptography/ERC7739Utils.test.js index 758215e0851..e80afcfaa4f 100644 --- a/test/utils/cryptography/ERC7739Utils.test.js +++ b/test/utils/cryptography/ERC7739Utils.test.js @@ -169,16 +169,8 @@ describe('ERC7739Utils', function () { contentTypeName: 'B', contentType: 'A(C c)B(A a)C(uint256 v)', }, - { - descr: 'should return nothing for an empty descriptor', - contentsDescr: '', - contentTypeName: null, - }, - { - descr: 'should return nothing if no [(] is present', - contentsDescr: 'SomeType', - contentTypeName: null, - }, + { descr: 'should return nothing for an empty descriptor', contentsDescr: '', contentTypeName: null }, + { descr: 'should return nothing if no [(] is present', contentsDescr: 'SomeType', contentTypeName: null }, { descr: 'should return nothing if starts with [(] (implicit)', contentsDescr: '(SomeType(address foo,uint256 bar)', @@ -189,21 +181,25 @@ describe('ERC7739Utils', function () { contentsDescr: '(SomeType(address foo,uint256 bar)(SomeType', contentTypeName: null, }, - forbiddenChars.split('').map(char => ({ - descr: `should return nothing if contains [${char}] (implicit)`, - contentsDescr: `SomeType${char}(address foo,uint256 bar)`, - contentTypeName: null, - })), - forbiddenChars.split('').map(char => ({ - descr: `should return nothing if contains [${char}] (explicit)`, - contentsDescr: `SomeType${char}(address foo,uint256 bar)SomeType${char}`, - contentTypeName: null, - })), + forbiddenChars + .split('') + .map(char => ({ + descr: `should return nothing if contains [${char}] (implicit)`, + contentsDescr: `SomeType${char}(address foo,uint256 bar)`, + contentTypeName: null, + })), + forbiddenChars + .split('') + .map(char => ({ + descr: `should return nothing if contains [${char}] (explicit)`, + contentsDescr: `SomeType${char}(address foo,uint256 bar)SomeType${char}`, + contentTypeName: null, + })), )) { it(descr, async function () { await expect(this.mock.$decodeContentsDescr(contentsDescr)).to.eventually.deep.equal([ contentTypeName ?? '', - contentTypeName ? contentType ?? contentsDescr : '', + contentTypeName ? (contentType ?? contentsDescr) : '', ]); }); } From 35d4a12f09ff1b8340348dd036200e38de948f0e Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 01:14:34 -0600 Subject: [PATCH 026/110] up --- test/proxy/Clones.test.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/test/proxy/Clones.test.js b/test/proxy/Clones.test.js index 0706c6f834c..93bcfba19b9 100644 --- a/test/proxy/Clones.test.js +++ b/test/proxy/Clones.test.js @@ -31,17 +31,18 @@ async function fixture() { const newClone = args => async (opts = {}) => { - const clone = await (args - ? factory.$cloneWithImmutableArgs.staticCall(implementation, args) - : factory.$clone.staticCall(implementation) + const clone = await ( + args + ? factory.$cloneWithImmutableArgs.staticCall(implementation, args) + : factory.$clone.staticCall(implementation) ).then(address => implementation.attach(address)); const tx = await (args ? opts.deployValue ? factory.$cloneWithImmutableArgs(implementation, args, ethers.Typed.uint256(opts.deployValue)) : factory.$cloneWithImmutableArgs(implementation, args) : opts.deployValue - ? factory.$clone(implementation, ethers.Typed.uint256(opts.deployValue)) - : factory.$clone(implementation)); + ? factory.$clone(implementation, ethers.Typed.uint256(opts.deployValue)) + : factory.$clone(implementation)); if (opts.initData || opts.initValue) { await deployer.sendTransaction({ to: clone, value: opts.initValue ?? 0n, data: opts.initData ?? '0x' }); } @@ -52,9 +53,10 @@ async function fixture() { args => async (opts = {}) => { const salt = opts.salt ?? ethers.randomBytes(32); - const clone = await (args - ? factory.$cloneDeterministicWithImmutableArgs.staticCall(implementation, args, salt) - : factory.$cloneDeterministic.staticCall(implementation, salt) + const clone = await ( + args + ? factory.$cloneDeterministicWithImmutableArgs.staticCall(implementation, args, salt) + : factory.$cloneDeterministic.staticCall(implementation, salt) ).then(address => implementation.attach(address)); const tx = await (args ? opts.deployValue @@ -66,8 +68,8 @@ async function fixture() { ) : factory.$cloneDeterministicWithImmutableArgs(implementation, args, salt) : opts.deployValue - ? factory.$cloneDeterministic(implementation, salt, ethers.Typed.uint256(opts.deployValue)) - : factory.$cloneDeterministic(implementation, salt)); + ? factory.$cloneDeterministic(implementation, salt, ethers.Typed.uint256(opts.deployValue)) + : factory.$cloneDeterministic(implementation, salt)); if (opts.initData || opts.initValue) { await deployer.sendTransaction({ to: clone, value: opts.initValue ?? 0n, data: opts.initData ?? '0x' }); } From a95705bae2baf08d235a8df3892b9401fd093b16 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 01:21:28 -0600 Subject: [PATCH 027/110] reset dependencies --- package-lock.json | 2702 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 2152 insertions(+), 550 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92314bf0cf5..7c4f8ae063e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,9 +23,9 @@ "@openzeppelin/upgrades-core": "^1.20.6", "chai": "^4.2.0", "eslint": "^9.0.0", - "eslint-config-prettier": "^10.0.0", + "eslint-config-prettier": "^10.0.1", "ethers": "^6.13.7", - "glob": "^11.0.0", + "glob": "^7.2.0", "globals": "^16.0.0", "graphlib": "^2.1.8", "hardhat": "^2.23.0", @@ -40,7 +40,7 @@ "prettier": "^3.0.0", "prettier-plugin-solidity": "^1.1.0", "rimraf": "^6.0.0", - "semver": "^7.3.5", + "semver": "^7.5.3", "solhint": "^5.0.0", "solhint-plugin-openzeppelin": "file:scripts/solhint-custom", "solidity-ast": "^0.4.50", @@ -88,12 +88,6 @@ "node": ">=6.9.0" } }, - "node_modules/@bytecodealliance/preview2-shim": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@bytecodealliance/preview2-shim/-/preview2-shim-0.17.0.tgz", - "integrity": "sha512-JorcEwe4ud0x5BS/Ar2aQWOQoFzjq/7jcnxYXCvSMh0oRm0dQXzOA+hqLDBnOMks1LLBA7dmiLLsEBl09Yd6iQ==", - "dev": true - }, "node_modules/@changesets/apply-release-plan": { "version": "7.0.12", "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-7.0.12.tgz", @@ -154,13 +148,13 @@ } }, "node_modules/@changesets/changelog-github": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.5.1.tgz", - "integrity": "sha512-BVuHtF+hrhUScSoHnJwTELB4/INQxVFc+P/Qdt20BLiBFIHFJDDUaGsZw+8fQeJTRP5hJZrzpt3oZWh0G19rAQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.5.0.tgz", + "integrity": "sha512-zoeq2LJJVcPJcIotHRJEEA2qCqX0AQIeFE+L21L8sRLPVqDhSXY8ZWAt2sohtBpFZkBwu+LUwMSKRr2lMy3LJA==", "dev": true, "dependencies": { "@changesets/get-github-info": "^0.6.0", - "@changesets/types": "^6.1.0", + "@changesets/types": "^6.0.0", "dotenv": "^8.1.0" } }, @@ -203,6 +197,33 @@ "changeset": "bin.js" } }, + "node_modules/@changesets/cli/node_modules/@changesets/pre": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.2.tgz", + "integrity": "sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==", + "dev": true, + "dependencies": { + "@changesets/errors": "^0.2.0", + "@changesets/types": "^6.1.0", + "@manypkg/get-packages": "^1.1.3", + "fs-extra": "^7.0.1" + } + }, + "node_modules/@changesets/cli/node_modules/@changesets/read": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.5.tgz", + "integrity": "sha512-UPzNGhsSjHD3Veb0xO/MwvasGe8eMyNrR/sT9gR8Q3DhOQZirgKhhXv/8hVsI0QpPjR004Z9iFxoJU6in3uGMg==", + "dev": true, + "dependencies": { + "@changesets/git": "^3.0.4", + "@changesets/logger": "^0.1.1", + "@changesets/parse": "^0.4.1", + "@changesets/types": "^6.1.0", + "fs-extra": "^7.0.1", + "p-filter": "^2.1.0", + "picocolors": "^1.1.0" + } + }, "node_modules/@changesets/cli/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -278,6 +299,33 @@ "@manypkg/get-packages": "^1.1.3" } }, + "node_modules/@changesets/get-release-plan/node_modules/@changesets/pre": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.2.tgz", + "integrity": "sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==", + "dev": true, + "dependencies": { + "@changesets/errors": "^0.2.0", + "@changesets/types": "^6.1.0", + "@manypkg/get-packages": "^1.1.3", + "fs-extra": "^7.0.1" + } + }, + "node_modules/@changesets/get-release-plan/node_modules/@changesets/read": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.5.tgz", + "integrity": "sha512-UPzNGhsSjHD3Veb0xO/MwvasGe8eMyNrR/sT9gR8Q3DhOQZirgKhhXv/8hVsI0QpPjR004Z9iFxoJU6in3uGMg==", + "dev": true, + "dependencies": { + "@changesets/git": "^3.0.4", + "@changesets/logger": "^0.1.1", + "@changesets/parse": "^0.4.1", + "@changesets/types": "^6.1.0", + "fs-extra": "^7.0.1", + "p-filter": "^2.1.0", + "picocolors": "^1.1.0" + } + }, "node_modules/@changesets/get-version-range-type": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.4.0.tgz", @@ -317,30 +365,103 @@ } }, "node_modules/@changesets/pre": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.2.tgz", - "integrity": "sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.0.tgz", + "integrity": "sha512-HLTNYX/A4jZxc+Sq8D1AMBsv+1qD6rmmJtjsCJa/9MSRybdxh0mjbTvE6JYZQ/ZiQ0mMlDOlGPXTm9KLTU3jyw==", "dev": true, "dependencies": { + "@babel/runtime": "^7.20.1", "@changesets/errors": "^0.2.0", - "@changesets/types": "^6.1.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1" } }, "node_modules/@changesets/read": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.5.tgz", - "integrity": "sha512-UPzNGhsSjHD3Veb0xO/MwvasGe8eMyNrR/sT9gR8Q3DhOQZirgKhhXv/8hVsI0QpPjR004Z9iFxoJU6in3uGMg==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.0.tgz", + "integrity": "sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw==", "dev": true, "dependencies": { - "@changesets/git": "^3.0.4", - "@changesets/logger": "^0.1.1", - "@changesets/parse": "^0.4.1", - "@changesets/types": "^6.1.0", + "@babel/runtime": "^7.20.1", + "@changesets/git": "^3.0.0", + "@changesets/logger": "^0.1.0", + "@changesets/parse": "^0.4.0", + "@changesets/types": "^6.0.0", + "chalk": "^2.1.0", "fs-extra": "^7.0.1", - "p-filter": "^2.1.0", - "picocolors": "^1.1.0" + "p-filter": "^2.1.0" + } + }, + "node_modules/@changesets/read/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/read/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/read/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@changesets/read/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@changesets/read/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@changesets/read/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/read/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, "node_modules/@changesets/should-skip-package": { @@ -436,9 +557,9 @@ } }, "node_modules/@eslint/compat": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.9.tgz", - "integrity": "sha512-gCdSY54n7k+driCadyMNv8JSPzYLeDVM/ikZRtvtROBpRdFSkS8W9A82MqsaY7lZuwL0wiapgD0NT1xT0hyJsA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.1.tgz", + "integrity": "sha512-JbHG2TWuCeNzh87fXo+/46Z1LEo9DBA9T188d0fZgGxAD+cNyS6sx9fdiyxjGPBMyQVRlCutTByZ6a5+YMkF7g==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -637,16 +758,6 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@ethereumjs/common": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-3.2.0.tgz", - "integrity": "sha512-pksvzI0VyLgmuEF2FA/JR/4/y6hcPq8OUail3/AvycBaW1d5VSauOZzqGvJ3RTmR4MU35lWE8KseKOsEhrFRBA==", - "dev": true, - "dependencies": { - "@ethereumjs/util": "^8.1.0", - "crc-32": "^1.2.0" - } - }, "node_modules/@ethereumjs/rlp": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", @@ -659,93 +770,6 @@ "node": ">=14" } }, - "node_modules/@ethereumjs/tx": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-4.2.0.tgz", - "integrity": "sha512-1nc6VO4jtFd172BbSnTnDQVr9IYBFl1y4xPzZdtkrkKIncBCkdbgfdRV+MiTkJYAtTxvV12GRZLqBFT1PNK6Yw==", - "dev": true, - "dependencies": { - "@ethereumjs/common": "^3.2.0", - "@ethereumjs/rlp": "^4.0.1", - "@ethereumjs/util": "^8.1.0", - "ethereum-cryptography": "^2.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@ethereumjs/tx/node_modules/@noble/curves": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", - "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", - "dev": true, - "dependencies": { - "@noble/hashes": "1.4.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@ethereumjs/tx/node_modules/@noble/hashes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", - "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "dev": true, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@ethereumjs/tx/node_modules/@scure/base": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", - "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", - "dev": true, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@ethereumjs/tx/node_modules/@scure/bip32": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", - "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", - "dev": true, - "dependencies": { - "@noble/curves": "~1.4.0", - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@ethereumjs/tx/node_modules/@scure/bip39": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", - "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", - "dev": true, - "dependencies": { - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@ethereumjs/tx/node_modules/ethereum-cryptography": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", - "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", - "dev": true, - "dependencies": { - "@noble/curves": "1.4.2", - "@noble/hashes": "1.4.0", - "@scure/bip32": "1.4.0", - "@scure/bip39": "1.3.0" - } - }, "node_modules/@ethereumjs/util": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", @@ -1481,70 +1505,25 @@ "node": ">=6 <7 || >=8" } }, - "node_modules/@metamask/abi-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@metamask/abi-utils/-/abi-utils-2.0.4.tgz", - "integrity": "sha512-StnIgUB75x7a7AgUhiaUZDpCsqGp7VkNnZh2XivXkJ6mPkE83U8ARGQj5MbRis7VJY8BC5V1AbB1fjdh0hupPQ==", - "dev": true, - "dependencies": { - "@metamask/superstruct": "^3.1.0", - "@metamask/utils": "^9.0.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@metamask/superstruct": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@metamask/superstruct/-/superstruct-3.2.1.tgz", - "integrity": "sha512-fLgJnDOXFmuVlB38rUN5SmU7hAFQcCjrg3Vrxz67KTY7YHFnSNEKvX4avmEBdOI0yTCxZjwMCFEqsC8k2+Wd3g==", - "dev": true, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@metamask/utils": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@metamask/utils/-/utils-9.3.0.tgz", - "integrity": "sha512-w8CVbdkDrVXFJbfBSlDfafDR6BAkpDmv1bC1UJVCoVny5tW2RKAdn9i68Xf7asYT4TnUhl/hN4zfUiKQq9II4g==", + "node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", "dev": true, "dependencies": { - "@ethereumjs/tx": "^4.2.0", - "@metamask/superstruct": "^3.1.0", - "@noble/hashes": "^1.3.1", - "@scure/base": "^1.1.3", - "@types/debug": "^4.1.7", - "debug": "^4.3.4", - "pony-cause": "^2.1.10", - "semver": "^7.5.4", - "uuid": "^9.0.1" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@noble/ciphers": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz", - "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==", - "dev": true, - "engines": { - "node": "^14.21.3 || >=16" + "@noble/hashes": "1.3.2" }, "funding": { "url": "https://paulmillr.com/funding/" } }, - "node_modules/@noble/curves": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.0.tgz", - "integrity": "sha512-7YDlXiNMdO1YZeH6t/kvopHHbIZzlxrCV9WLqCY6QhcXOoXiNCMDqJIglZ9Yjx5+w7Dz30TITFrlTjnRg7sKEg==", + "node_modules/@noble/curves/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", "dev": true, - "dependencies": { - "@noble/hashes": "1.8.0" - }, "engines": { - "node": "^14.21.3 || >=16" + "node": ">= 16" }, "funding": { "url": "https://paulmillr.com/funding/" @@ -1691,9 +1670,9 @@ } }, "node_modules/@nomicfoundation/hardhat-chai-matchers": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.8.tgz", - "integrity": "sha512-Z5PiCXH4xhNLASROlSUOADfhfpfhYO6D7Hn9xp8PddmHey0jq704cr6kfU8TRrQ4PUZbpfsZadPj+pCfZdjPIg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.6.tgz", + "integrity": "sha512-Te1Uyo9oJcTCF0Jy9dztaLpshmlpjLf2yPtWXlXuLjMt3RRSmJLm/+rKVTW6gfadAEs12U/it6D0ZRnnRGiICQ==", "dev": true, "dependencies": { "@types/chai-as-promised": "^7.1.3", @@ -1723,9 +1702,9 @@ } }, "node_modules/@nomicfoundation/hardhat-network-helpers": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.12.tgz", - "integrity": "sha512-xTNQNI/9xkHvjmCJnJOTyqDSl8uq1rKb2WOVmixQxFtRd7Oa3ecO8zM0cyC2YmOK+jHB9WPZ+F/ijkHg1CoORA==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.9.tgz", + "integrity": "sha512-OXWCv0cHpwLUO2u7bFxBna6dQtCC2Gg/aN/KtJLO7gmuuA28vgmVKYFRCDUqrbjujzgfwQ2aKyZ9Y3vSmDqS7Q==", "dev": true, "dependencies": { "ethereumjs-util": "^7.1.4" @@ -1734,15 +1713,6 @@ "hardhat": "^2.9.5" } }, - "node_modules/@nomicfoundation/slang": { - "version": "0.18.3", - "resolved": "https://registry.npmjs.org/@nomicfoundation/slang/-/slang-0.18.3.tgz", - "integrity": "sha512-YqAWgckqbHM0/CZxi9Nlf4hjk9wUNLC9ngWCWBiqMxPIZmzsVKYuChdlrfeBPQyvQQBoOhbx+7C1005kLVQDZQ==", - "dev": true, - "dependencies": { - "@bytecodealliance/preview2-shim": "0.17.0" - } - }, "node_modules/@nomicfoundation/solidity-analyzer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.2.tgz", @@ -1852,19 +1822,21 @@ } }, "node_modules/@openzeppelin/merkle-tree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@openzeppelin/merkle-tree/-/merkle-tree-1.0.8.tgz", - "integrity": "sha512-E2c9/Y3vjZXwVvPZKqCKUn7upnvam1P1ZhowJyZVQSkzZm5WhumtaRr+wkUXrZVfkIc7Gfrl7xzabElqDL09ow==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@openzeppelin/merkle-tree/-/merkle-tree-1.0.7.tgz", + "integrity": "sha512-i93t0YYv6ZxTCYU3CdO5Q+DXK0JH10A4dCBOMlzYbX+ujTXm+k1lXiEyVqmf94t3sqmv8sm/XT5zTa0+efnPgQ==", "dev": true, "dependencies": { - "@metamask/abi-utils": "^2.0.4", - "ethereum-cryptography": "^3.0.0" + "@ethersproject/abi": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0" } }, "node_modules/@openzeppelin/upgrade-safe-transpiler": { - "version": "0.3.33", - "resolved": "https://registry.npmjs.org/@openzeppelin/upgrade-safe-transpiler/-/upgrade-safe-transpiler-0.3.33.tgz", - "integrity": "sha512-yKdnfZtfDw0ivonZmDx1YgFJXLNHz/5+XPN7bx/9ObQYKUawmTiOcGC6BKezpphL+witvHQbMhmQbwGIyEoR8g==", + "version": "0.3.32", + "resolved": "https://registry.npmjs.org/@openzeppelin/upgrade-safe-transpiler/-/upgrade-safe-transpiler-0.3.32.tgz", + "integrity": "sha512-ypgj6MXXcDG0dOuMwENXt0H4atCtCsPgpDgWZYewb2egfUCMpj6d2GO4pcNZgdn1zYsmUHfm5ZA/Nga/8qkdKA==", "dev": true, "dependencies": { "ajv": "^8.0.0", @@ -1952,22 +1924,19 @@ } }, "node_modules/@openzeppelin/upgrades-core": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.44.0.tgz", - "integrity": "sha512-AUnQW7cbh2ntFuQdHi5C0vKB+QfkTQtzXgCmzazXLJDX7slFTF676lw+x97ZKfzwQw5unO1+ALZMx+s+2yQUew==", + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.29.0.tgz", + "integrity": "sha512-csZvAMNqUJjMDNBPbaXcV9Nlo4oagMD/HkOBHTpYbBTpnmUhwPVHOMv+Rl0RatBdLHuGc6hw88h80k5PWkEeWw==", "dev": true, "dependencies": { - "@nomicfoundation/slang": "^0.18.3", - "bignumber.js": "^9.1.2", - "cbor": "^10.0.0", + "cbor": "^9.0.0", "chalk": "^4.1.0", "compare-versions": "^6.0.0", "debug": "^4.1.1", "ethereumjs-util": "^7.0.3", - "minimatch": "^9.0.5", "minimist": "^1.2.7", "proper-lockfile": "^4.1.1", - "solidity-ast": "^0.4.60" + "solidity-ast": "^0.4.26" }, "bin": { "openzeppelin-upgrades-core": "dist/cli/cli.js" @@ -2050,32 +2019,74 @@ } }, "node_modules/@scure/bip32": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.7.0.tgz", - "integrity": "sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.2.tgz", + "integrity": "sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==", "dev": true, "dependencies": { - "@noble/curves": "~1.9.0", - "@noble/hashes": "~1.8.0", - "@scure/base": "~1.2.5" + "@noble/curves": "~1.2.0", + "@noble/hashes": "~1.3.2", + "@scure/base": "~1.1.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32/node_modules/@noble/hashes": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", + "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", + "dev": true, + "engines": { + "node": ">= 16" }, "funding": { "url": "https://paulmillr.com/funding/" } }, + "node_modules/@scure/bip32/node_modules/@scure/base": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", + "dev": true, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@scure/bip39": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz", - "integrity": "sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", + "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", "dev": true, "dependencies": { - "@noble/hashes": "~1.8.0", - "@scure/base": "~1.2.5" + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" }, "funding": { "url": "https://paulmillr.com/funding/" } }, + "node_modules/@scure/bip39/node_modules/@noble/hashes": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", + "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", + "dev": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39/node_modules/@scure/base": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", + "dev": true, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@sentry/core": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", @@ -2227,9 +2238,9 @@ } }, "node_modules/@solidity-parser/parser": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.19.0.tgz", - "integrity": "sha512-RV16k/qIxW/wWc+mLzV3ARyKUaMUTBy9tOLMzFhtNSKYeTAanQ3a5MudJKf/8arIFnA2L27SNjarQKmFg0w/jA==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.18.0.tgz", + "integrity": "sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA==", "dev": true }, "node_modules/@szmarczak/http-timer": { @@ -2271,15 +2282,6 @@ "@types/chai": "*" } }, - "node_modules/@types/debug": { - "version": "4.1.12", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", - "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", - "dev": true, - "dependencies": { - "@types/ms": "*" - } - }, "node_modules/@types/deep-eql": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", @@ -2326,12 +2328,6 @@ "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", "dev": true }, - "node_modules/@types/ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", - "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", - "dev": true - }, "node_modules/@types/node": { "version": "12.20.55", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", @@ -2363,9 +2359,9 @@ "dev": true }, "node_modules/abitype": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.8.tgz", - "integrity": "sha512-ZeiI6h3GnW06uYDLx0etQtX/p8E24UaHHBj57RSjK7YBFe7iuVn07EDpOeP451D06sF27VOz9JJPlIKJmXgkEg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.0.tgz", + "integrity": "sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/wevm" @@ -2404,6 +2400,15 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/address": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/address/-/address-1.2.2.tgz", + "integrity": "sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/adm-zip": { "version": "0.4.16", "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", @@ -2536,6 +2541,12 @@ "node": ">=16" } }, + "node_modules/antlr4ts": { + "version": "0.5.0-alpha.4", + "resolved": "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz", + "integrity": "sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==", + "dev": true + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -2558,6 +2569,22 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -2567,6 +2594,47 @@ "node": ">=8" } }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -2597,12 +2665,36 @@ "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", "dev": true }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/axios": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz", @@ -2641,15 +2733,6 @@ "node": ">=4" } }, - "node_modules/bignumber.js": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.0.tgz", - "integrity": "sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -2857,6 +2940,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", @@ -2870,6 +2971,22 @@ "node": ">= 0.4" } }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -2892,30 +3009,30 @@ } }, "node_modules/cbor": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/cbor/-/cbor-10.0.3.tgz", - "integrity": "sha512-72Jnj81xMsqepqdcSdf2+fflz/UDsThOHy5hj2MW5F5xzHL8Oa0KQ6I6V9CwVUPxg5pf+W9xp6W2KilaRXWWtw==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-9.0.2.tgz", + "integrity": "sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==", "dev": true, "dependencies": { - "nofilter": "^3.0.2" + "nofilter": "^3.1.0" }, "engines": { - "node": ">=18" + "node": ">=16" } }, "node_modules/chai": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", - "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.8.tgz", + "integrity": "sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", + "check-error": "^1.0.2", + "deep-eql": "^4.1.2", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", "pathval": "^1.1.1", - "type-detect": "^4.1.0" + "type-detect": "^4.0.5" }, "engines": { "node": ">=4" @@ -3199,9 +3316,9 @@ "dev": true }, "node_modules/commander": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", - "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "dev": true, "engines": { "node": ">=18" @@ -3282,18 +3399,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "dev": true, - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -3344,6 +3449,57 @@ "node": "*" } }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/dataloader": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", @@ -3448,6 +3604,40 @@ "node": ">=10" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -3475,6 +3665,23 @@ "node": ">=8" } }, + "node_modules/detect-port": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.6.1.tgz", + "integrity": "sha512-CmnVc+Hek2egPx1PeTFVta2W78xy2K/9Rkf6cC4T59S50tVnzKj+tnx5mmx5lwvCkujZ4uRrpRSuV+IVs3f90Q==", + "dev": true, + "dependencies": { + "address": "^1.0.1", + "debug": "4" + }, + "bin": { + "detect": "bin/detect-port.js", + "detect-port": "bin/detect-port.js" + }, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/diff": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", @@ -3607,6 +3814,71 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-abstract": { + "version": "1.23.9", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz", + "integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.0", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-regex": "^1.2.1", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.0", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.3", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.18" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -3652,22 +3924,51 @@ "node": ">= 0.4" } }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "node_modules/es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "dev": true, + "dependencies": { + "hasown": "^2.0.2" + }, "engines": { - "node": ">=6" + "node": ">= 0.4" } }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -3829,12 +4130,12 @@ } }, "node_modules/eslint-config-prettier": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.2.tgz", - "integrity": "sha512-Epgp/EofAUeEpIdZkW60MHKvPyru1ruQJxPL+WIycnaPApuseK0Zpkrh/FwL9oIpQvIhJwV7ptOy0DWUjTlCiA==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz", + "integrity": "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==", "dev": true, "bin": { - "eslint-config-prettier": "bin/cli.js" + "eslint-config-prettier": "build/bin/cli.js" }, "peerDependencies": { "eslint": ">=7.0.0" @@ -4094,23 +4395,6 @@ "@noble/hashes": "^1.4.0" } }, - "node_modules/ethereum-cryptography": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-3.2.0.tgz", - "integrity": "sha512-Urr5YVsalH+Jo0sYkTkv1MyI9bLYZwW8BENZCeE1QYaTHETEYx0Nv/SVsWkSqpYrzweg6d8KMY1wTjH/1m/BIg==", - "dev": true, - "dependencies": { - "@noble/ciphers": "1.3.0", - "@noble/curves": "1.9.0", - "@noble/hashes": "1.8.0", - "@scure/bip32": "1.7.0", - "@scure/bip39": "1.6.0" - }, - "engines": { - "node": "^14.21.3 || >=16", - "npm": ">=9" - } - }, "node_modules/ethereumjs-util": { "version": "7.1.5", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", @@ -4178,18 +4462,6 @@ "node": ">=14.0.0" } }, - "node_modules/ethers/node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dev": true, - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/ethers/node_modules/@noble/hashes": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", @@ -4440,6 +4712,21 @@ } } }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/foreground-child": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", @@ -4529,6 +4816,35 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -4608,6 +4924,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/ghost-testrpc": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz", @@ -4693,23 +5026,21 @@ } }, "node_modules/glob": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", - "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - }, - "bin": { - "glob": "dist/esm/bin.mjs" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": "20 || >=22" + "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -4727,19 +5058,26 @@ "node": ">= 6" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/glob/node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "*" } }, "node_modules/global-modules": { @@ -4792,6 +5130,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -4971,28 +5325,28 @@ } }, "node_modules/hardhat-exposed": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/hardhat-exposed/-/hardhat-exposed-0.3.19.tgz", - "integrity": "sha512-vVye5TurJu8dWeo4ma+EfLAOQaJyica4uncd0/BGPO2tmexuDwZUmE1vYx81PlP4Iak3wqkNTEPxWQaE2ZnKnw==", + "version": "0.3.15", + "resolved": "https://registry.npmjs.org/hardhat-exposed/-/hardhat-exposed-0.3.15.tgz", + "integrity": "sha512-jqxErCnSWGYf4vAkLmh3H3u+IuLuCLw/EVeV13z1JKJMJAd/iO+G283n8T124S/Q2BF/BoA2zgzYAlqXgNyKew==", "dev": true, "dependencies": { - "micromatch": "^4.0.8", - "solidity-ast": "^0.4.59" + "micromatch": "^4.0.4", + "solidity-ast": "^0.4.52" }, "peerDependencies": { "hardhat": "^2.3.0" } }, "node_modules/hardhat-gas-reporter": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/hardhat-gas-reporter/-/hardhat-gas-reporter-2.2.3.tgz", - "integrity": "sha512-/52fDR0WOgPTjImmx4j179SAgxPv/499TD0o0qnMhaRr24i2cqlcmCW92FJi0QAKu7HcnxdBGZWQP/5aPjQqUw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hardhat-gas-reporter/-/hardhat-gas-reporter-2.1.0.tgz", + "integrity": "sha512-d/WU/qHhBFnbweAm2fAAjcaaE0M7BKZ4r+/bqcFlfP6um28BXtlv2FrJ6oyQUGSFD0ttbmB7sH4ZFDzkYw5GzA==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.7.0", "@ethersproject/bytes": "^5.7.0", "@ethersproject/units": "^5.7.0", - "@solidity-parser/parser": "^0.19.0", + "@solidity-parser/parser": "^0.18.0", "axios": "^1.6.7", "brotli-wasm": "^2.0.1", "chalk": "4.1.2", @@ -5003,7 +5357,7 @@ "lodash": "^4.17.21", "markdown-table": "2.0.0", "sha1": "^1.1.1", - "viem": "^2.27.0" + "viem": "2.7.14" }, "peerDependencies": { "hardhat": "^2.16.0" @@ -5155,9 +5509,9 @@ } }, "node_modules/hardhat-ignore-warnings": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/hardhat-ignore-warnings/-/hardhat-ignore-warnings-0.2.12.tgz", - "integrity": "sha512-SaxCLKzYBMk3Rd1275TnanUmmxwgU+bu4Ekf2MKcqXxxt6xTGcPTtTaM+USrLgmejZHC4Itg/PaWITlOp4RL3g==", + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/hardhat-ignore-warnings/-/hardhat-ignore-warnings-0.2.11.tgz", + "integrity": "sha512-+nHnRbP6COFZaXE7HAY7TZNE3au5vHe5dkcnyq0XaP07ikT2fJ3NhFY0vn7Deh4Qbz0Z/9Xpnj2ki6Ktgk61pg==", "dev": true, "dependencies": { "minimatch": "^5.1.0", @@ -5501,6 +5855,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -5510,6 +5876,33 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", @@ -5773,6 +6166,20 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", @@ -5791,12 +6198,63 @@ "fp-ts": "^1.0.0" } }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -5809,47 +6267,153 @@ "node": ">=8" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { - "node": ">=12" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "dev": true, "dependencies": { - "is-extglob": "^2.1.1" + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-hex-prefixed": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, "engines": { - "node": ">=6.5.0", - "npm": ">=3" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", + "dev": true, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-number": { @@ -5861,6 +6425,22 @@ "node": ">=0.12.0" } }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -5879,6 +6459,51 @@ "node": ">=8" } }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -5891,6 +6516,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-subdir": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-subdir/-/is-subdir-1.2.0.tgz", @@ -5903,6 +6544,38 @@ "node": ">=4" } }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -5915,6 +6588,49 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -5924,6 +6640,12 @@ "node": ">=0.10.0" } }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -5931,14 +6653,14 @@ "dev": true }, "node_modules/isows": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.6.tgz", - "integrity": "sha512-lPHCayd40oW98/I0uvgaHKWCSvkzY27LjWLbtzOm64yQ+G3Q5npjjbdppU65iZXkK1Zt+kH9pfegli0AYfwYYw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.3.tgz", + "integrity": "sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==", "dev": true, "funding": [ { "type": "github", - "url": "https://github.com/sponsors/wevm" + "url": "https://github.com/sponsors/wagmi-dev" } ], "peerDependencies": { @@ -6116,21 +6838,21 @@ "dev": true }, "node_modules/lint-staged": { - "version": "15.5.1", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.5.1.tgz", - "integrity": "sha512-6m7u8mue4Xn6wK6gZvSCQwBvMBR36xfY24nF5bMTf2MHDYG6S3yhJuOgdYVw99hsjyDt2d4z168b3naI8+NWtQ==", - "dev": true, - "dependencies": { - "chalk": "^5.4.1", - "commander": "^13.1.0", - "debug": "^4.4.0", - "execa": "^8.0.1", - "lilconfig": "^3.1.3", - "listr2": "^8.2.5", - "micromatch": "^4.0.8", - "pidtree": "^0.6.0", - "string-argv": "^0.3.2", - "yaml": "^2.7.0" + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.10.tgz", + "integrity": "sha512-5dY5t743e1byO19P9I4b3x8HJwalIznL5E1FWYnU6OWw33KxNBSLAc6Cy7F2PsFEO8FKnLwjwm5hx7aMF0jzZg==", + "dev": true, + "dependencies": { + "chalk": "~5.3.0", + "commander": "~12.1.0", + "debug": "~4.3.6", + "execa": "~8.0.1", + "lilconfig": "~3.1.2", + "listr2": "~8.2.4", + "micromatch": "~4.0.8", + "pidtree": "~0.6.0", + "string-argv": "~0.3.2", + "yaml": "~2.5.0" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -6143,9 +6865,9 @@ } }, "node_modules/lint-staged/node_modules/chalk": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", - "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -6154,10 +6876,27 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/lint-staged/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/listr2": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.3.2.tgz", - "integrity": "sha512-vsBzcU4oE+v0lj4FhVLzr9dBTv4/fHIa57l+GCwovP8MoFNZJTOhGU8PXd4v2VJCbECAaijBiHntiekFMLvo0g==", + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.5.tgz", + "integrity": "sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==", "dev": true, "dependencies": { "cli-truncate": "^4.0.0", @@ -6497,12 +7236,15 @@ "dev": true }, "node_modules/lru-cache": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", - "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { - "node": "20 || >=22" + "node": ">=10" } }, "node_modules/markdown-table": { @@ -6971,6 +7713,18 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "node_modules/nanoid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -7130,6 +7884,47 @@ "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==", "dev": true }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/obliterator": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.5.tgz", @@ -7198,33 +7993,21 @@ "integrity": "sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==", "dev": true }, - "node_modules/ox": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/ox/-/ox-0.6.9.tgz", - "integrity": "sha512-wi5ShvzE4eOcTwQVsIPdFr+8ycyX+5le/96iAJutaZAvCes1J0+RvpEPg5QDPDiaR0XQQAvZVl7AwqQcINuUug==", + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/wevm" - } - ], "dependencies": { - "@adraffy/ens-normalize": "^1.10.1", - "@noble/curves": "^1.6.0", - "@noble/hashes": "^1.5.0", - "@scure/bip32": "^1.5.0", - "@scure/bip39": "^1.4.0", - "abitype": "^1.0.6", - "eventemitter3": "5.0.1" + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" }, - "peerDependencies": { - "typescript": ">=5.4.0" + "engines": { + "node": ">= 0.4" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/p-cancelable": { @@ -7258,9 +8041,9 @@ } }, "node_modules/p-limit": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.2.0.tgz", - "integrity": "sha512-kuUqqHNUqoIWp/c467RI4X6mmyuojY5jGutNU0wVTmEOOfcuwLqyMVoAi9MKi2Ak+5i9+nhmrK4ufZE8069kHA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.0.0.tgz", + "integrity": "sha512-Dx+NzOuILWwjJE9OYtEKuQRy0i3c5QVAmDsVrvvRSgyNnPuB27D2DyEjl6QTNyeePaAHjaPk+ya0yA0Frld8RA==", "dev": true, "dependencies": { "yocto-queue": "^1.1.1" @@ -7435,6 +8218,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", + "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", + "dev": true, + "engines": { + "node": "20 || >=22" + } + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -7517,13 +8309,13 @@ "node": ">=4" } }, - "node_modules/pony-cause": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/pony-cause/-/pony-cause-2.1.11.tgz", - "integrity": "sha512-M7LhCsdNbNgiLYiP4WjsfLUuFmCfnjdF6jKe2R9NKl4WFN+HZPGHJZ9lnLP7f9ZnKe3U9nuWD0szirmj+migUg==", + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", "dev": true, "engines": { - "node": ">=12.0.0" + "node": ">= 0.4" } }, "node_modules/prelude-ls": { @@ -7572,6 +8364,18 @@ "integrity": "sha512-58I2sRpzaQUN+jJmWbHfbWf9AKfzqCI8JAdFB0vbyY+u8tBRcuTt9LxzasvR0LGQpcRv97eyV7l61FQ3Ib7zVw==", "dev": true }, + "node_modules/prettier-plugin-solidity/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/proper-lockfile": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", @@ -7793,6 +8597,48 @@ "node": "*" } }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/registry-auth-token": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.1.0.tgz", @@ -7946,13 +8792,12 @@ "dev": true }, "node_modules/rimraf": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", - "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.0.tgz", + "integrity": "sha512-u+yqhM92LW+89cxUQK0SRyvXYQmyuKHx0jkx4W7KfwLGLqJnQM5031Uv1trE4gB9XEXBM/s6MxKlfW95IidqaA==", "dev": true, "dependencies": { - "glob": "^11.0.0", - "package-json-from-dist": "^1.0.0" + "glob": "^11.0.0" }, "bin": { "rimraf": "dist/esm/bin.mjs" @@ -7964,6 +8809,44 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rimraf/node_modules/glob": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", + "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -8009,6 +8892,25 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -8029,6 +8931,39 @@ } ] }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -8179,10 +9114,13 @@ "dev": true }, "node_modules/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { "semver": "bin/semver.js" }, @@ -8199,6 +9137,52 @@ "randombytes": "^2.1.0" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -8324,6 +9308,78 @@ "node": "*" } }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -8413,12 +9469,12 @@ } }, "node_modules/solhint": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-5.0.5.tgz", - "integrity": "sha512-WrnG6T+/UduuzSWsSOAbfq1ywLUDwNea3Gd5hg6PS+pLUm8lz2ECNr0beX609clBxmDeZ3676AiA9nPDljmbJQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-5.0.0.tgz", + "integrity": "sha512-pSRKkzRsruia6/xa9L5VSyd7dMZkiiTi/aYZcvUQo7KK+S16ojPwIbt2jfjbH5WEJ83grzIIE4WrYQfAxGWh/A==", "dev": true, "dependencies": { - "@solidity-parser/parser": "^0.19.0", + "@solidity-parser/parser": "^0.18.0", "ajv": "^6.12.6", "antlr4": "^4.13.1-patch-1", "ast-parents": "^0.0.1", @@ -8562,10 +9618,13 @@ } }, "node_modules/solidity-ast": { - "version": "0.4.60", - "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.60.tgz", - "integrity": "sha512-UwhasmQ37ji1ul8cIp0XlrQ/+SVQhy09gGqJH4jnwdo2TgI6YIByzi0PI5QvIGcIdFOs1pbSmJW1pnWB7AVh2w==", - "dev": true + "version": "0.4.52", + "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.52.tgz", + "integrity": "sha512-iOya9BSiB9jhM8Vf40n8lGELGzwrUc57rl5BhfNtJ5cvAaMvRcNlHeAMNvqJJyjoUnczqRbHqdivEqK89du3Cw==", + "dev": true, + "dependencies": { + "array.prototype.findlast": "^1.2.2" + } }, "node_modules/solidity-comments": { "version": "0.0.2", @@ -8749,23 +9808,24 @@ } }, "node_modules/solidity-coverage": { - "version": "0.8.15", - "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.15.tgz", - "integrity": "sha512-qH7290NKww4/t/qFvnSEePEzON0k025IGVlwc8wo8Q6p+h1Tt6fV2M0k3yfsps3TomZYTROsfPXjx7MSnwD5uA==", + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.5.tgz", + "integrity": "sha512-6C6N6OV2O8FQA0FWA95FdzVH+L16HU94iFgg5wAFZ29UpLFkgNI/DRR2HotG1bC0F4gAc/OMs2BJI44Q/DYlKQ==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.0.9", - "@solidity-parser/parser": "^0.19.0", + "@solidity-parser/parser": "^0.16.0", "chalk": "^2.4.2", "death": "^1.1.0", + "detect-port": "^1.3.0", "difflib": "^0.2.4", "fs-extra": "^8.1.0", "ghost-testrpc": "^0.0.2", "global-modules": "^2.0.0", "globby": "^10.0.1", "jsonschema": "^1.2.4", - "lodash": "^4.17.21", - "mocha": "^10.2.0", + "lodash": "^4.17.15", + "mocha": "10.2.0", "node-emoji": "^1.10.0", "pify": "^4.0.1", "recursive-readdir": "^2.2.2", @@ -8781,6 +9841,24 @@ "hardhat": "^2.11.0" } }, + "node_modules/solidity-coverage/node_modules/@solidity-parser/parser": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.2.tgz", + "integrity": "sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==", + "dev": true, + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, + "node_modules/solidity-coverage/node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/solidity-coverage/node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -8793,6 +9871,12 @@ "node": ">=4" } }, + "node_modules/solidity-coverage/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/solidity-coverage/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -8817,21 +9901,91 @@ "node": ">=4" } }, - "node_modules/solidity-coverage/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/solidity-coverage/node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/solidity-coverage/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/solidity-coverage/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/solidity-coverage/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/solidity-coverage/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/solidity-coverage/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/solidity-coverage/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/solidity-coverage/node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/solidity-coverage/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -8841,6 +9995,22 @@ "node": ">=0.8.0" } }, + "node_modules/solidity-coverage/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/solidity-coverage/node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -8904,6 +10074,33 @@ "node": ">=4" } }, + "node_modules/solidity-coverage/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/solidity-coverage/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/solidity-coverage/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -8916,6 +10113,175 @@ "node": "*" } }, + "node_modules/solidity-coverage/node_modules/mocha": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", + "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "dev": true, + "dependencies": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/solidity-coverage/node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/solidity-coverage/node_modules/mocha/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/solidity-coverage/node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/solidity-coverage/node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/solidity-coverage/node_modules/mocha/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/solidity-coverage/node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/solidity-coverage/node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/solidity-coverage/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/solidity-coverage/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/solidity-coverage/node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/solidity-coverage/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -8928,6 +10294,51 @@ "node": ">=4" } }, + "node_modules/solidity-coverage/node_modules/workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true + }, + "node_modules/solidity-coverage/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/solidity-coverage/node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/solidity-coverage/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/solidity-docgen": { "version": "0.6.0-beta.36", "resolved": "https://registry.npmjs.org/solidity-docgen/-/solidity-docgen-0.6.0-beta.36.tgz", @@ -9084,6 +10495,62 @@ "node": ">=8" } }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -9353,6 +10820,80 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/uglify-js": { "version": "3.19.3", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", @@ -9366,6 +10907,24 @@ "node": ">=0.8.0" } }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/undici": { "version": "7.8.0", "resolved": "https://registry.npmjs.org/undici/-/undici-7.8.0.tgz", @@ -9420,23 +10979,10 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, - "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/viem": { - "version": "2.28.2", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.28.2.tgz", - "integrity": "sha512-HTdoskL1fsyabBplaY6qz59WXHY6+edt+byuKQz3M8SKPU9D9XLgu7t04JNXPHoxPOv72qB+ZNSfpN6PMdDtqw==", + "version": "2.7.14", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.7.14.tgz", + "integrity": "sha512-5b1KB1gXli02GOQHZIUsRluNUwssl2t4hqdFAzyWPwJ744N83jAOBOjOkrGz7K3qMIv9b0GQt3DoZIErSQTPkQ==", "dev": true, "funding": [ { @@ -9445,14 +10991,14 @@ } ], "dependencies": { - "@noble/curves": "1.8.2", - "@noble/hashes": "1.7.2", - "@scure/bip32": "1.6.2", - "@scure/bip39": "1.5.4", - "abitype": "1.0.8", - "isows": "1.0.6", - "ox": "0.6.9", - "ws": "8.18.1" + "@adraffy/ens-normalize": "1.10.0", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@scure/bip32": "1.3.2", + "@scure/bip39": "1.2.1", + "abitype": "1.0.0", + "isows": "1.0.3", + "ws": "8.13.0" }, "peerDependencies": { "typescript": ">=5.0.4" @@ -9463,64 +11009,28 @@ } } }, - "node_modules/viem/node_modules/@noble/curves": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.2.tgz", - "integrity": "sha512-vnI7V6lFNe0tLAuJMu+2sX+FcL14TaCWy1qiczg1VwRmPrpQCdq5ESXQMqUc2tluRNf6irBXrWbl1mGN8uaU/g==", - "dev": true, - "dependencies": { - "@noble/hashes": "1.7.2" - }, - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } + "node_modules/viem/node_modules/@adraffy/ens-normalize": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz", + "integrity": "sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==", + "dev": true }, "node_modules/viem/node_modules/@noble/hashes": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.2.tgz", - "integrity": "sha512-biZ0NUSxyjLLqo6KxEJ1b+C2NAx0wtDoFvCaXHGgUkeHzf3Xc1xKumFKREuT7f7DARNZ/slvYUwFG6B0f2b6hQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", "dev": true, "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/viem/node_modules/@scure/bip32": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.2.tgz", - "integrity": "sha512-t96EPDMbtGgtb7onKKqxRLfE5g05k7uHnHRM2xdE6BP/ZmxaLtPek4J4KfVn/90IQNrU1IOAqMgiDtUdtbe3nw==", - "dev": true, - "dependencies": { - "@noble/curves": "~1.8.1", - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/viem/node_modules/@scure/bip39": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.4.tgz", - "integrity": "sha512-TFM4ni0vKvCfBpohoh+/lY05i9gRbSwXWngAsF4CABQxoaOHijxuaZ2R6cStDQ5CHtHO9aGJTr4ksVJASRRyMA==", - "dev": true, - "dependencies": { - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.4" + "node": ">= 16" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/viem/node_modules/ws": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", - "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "dev": true, "engines": { "node": ">=10.0.0" @@ -9660,6 +11170,91 @@ "node": ">= 8" } }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -9764,10 +11359,16 @@ "node": ">=10" } }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/yaml": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz", - "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", + "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", "dev": true, "bin": { "yaml": "bin.mjs" @@ -9840,6 +11441,7 @@ } }, "scripts/solhint-custom": { + "name": "solhint-plugin-openzeppelin", "version": "0.0.0", "dev": true, "dependencies": { From 90509bd38bf73de625215b5839eaae83b43fdc7d Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 01:24:57 -0600 Subject: [PATCH 028/110] reset dependencies --- package-lock.json | 2099 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 1766 insertions(+), 333 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7c4f8ae063e..f6e81a80f1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "devDependencies": { "@changesets/changelog-github": "^0.5.0", - "@changesets/cli": "^2.26.0", + "@changesets/cli": "^2.26.2", "@changesets/pre": "^2.0.0", "@changesets/read": "^0.6.0", "@eslint/compat": "^1.2.1", @@ -22,10 +22,10 @@ "@openzeppelin/upgrade-safe-transpiler": "^0.3.32", "@openzeppelin/upgrades-core": "^1.20.6", "chai": "^4.2.0", - "eslint": "^9.0.0", - "eslint-config-prettier": "^10.0.1", + "eslint": "^9.13.0", + "eslint-config-prettier": "^10.0.0", "ethers": "^6.13.7", - "glob": "^7.2.0", + "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", "hardhat": "^2.23.0", @@ -37,10 +37,10 @@ "lodash.startcase": "^4.4.0", "micromatch": "^4.0.2", "p-limit": "^6.0.0", - "prettier": "^3.0.0", - "prettier-plugin-solidity": "^1.1.0", + "prettier": "^3.0.3", + "prettier-plugin-solidity": "^1.1.3", "rimraf": "^6.0.0", - "semver": "^7.5.3", + "semver": "^7.5.4", "solhint": "^5.0.0", "solhint-plugin-openzeppelin": "file:scripts/solhint-custom", "solidity-ast": "^0.4.50", @@ -89,16 +89,16 @@ } }, "node_modules/@changesets/apply-release-plan": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-7.0.12.tgz", - "integrity": "sha512-EaET7As5CeuhTzvXTQCRZeBUcisoYPDDcXvgTE/2jmmypKp0RC7LxKj/yzqeh/1qFTZI7oDGFcL1PHRuQuketQ==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.4.tgz", + "integrity": "sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==", "dev": true, "dependencies": { - "@changesets/config": "^3.1.1", - "@changesets/get-version-range-type": "^0.4.0", - "@changesets/git": "^3.0.4", - "@changesets/should-skip-package": "^0.1.2", - "@changesets/types": "^6.1.0", + "@babel/runtime": "^7.20.1", + "@changesets/config": "^2.3.1", + "@changesets/get-version-range-type": "^0.3.2", + "@changesets/git": "^2.0.0", + "@changesets/types": "^5.2.1", "@manypkg/get-packages": "^1.1.3", "detect-indent": "^6.0.0", "fs-extra": "^7.0.1", @@ -109,6 +109,57 @@ "semver": "^7.5.3" } }, + "node_modules/@changesets/apply-release-plan/node_modules/@changesets/errors": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", + "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "dev": true, + "dependencies": { + "extendable-error": "^0.1.5" + } + }, + "node_modules/@changesets/apply-release-plan/node_modules/@changesets/git": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/git/-/git-2.0.0.tgz", + "integrity": "sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "is-subdir": "^1.1.1", + "micromatch": "^4.0.2", + "spawndamnit": "^2.0.0" + } + }, + "node_modules/@changesets/apply-release-plan/node_modules/@changesets/types": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", + "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "dev": true + }, + "node_modules/@changesets/apply-release-plan/node_modules/cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", + "dev": true, + "dependencies": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "node_modules/@changesets/apply-release-plan/node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, "node_modules/@changesets/apply-release-plan/node_modules/prettier": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", @@ -124,29 +175,105 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/@changesets/apply-release-plan/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@changesets/apply-release-plan/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@changesets/apply-release-plan/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/@changesets/apply-release-plan/node_modules/spawndamnit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawndamnit/-/spawndamnit-2.0.0.tgz", + "integrity": "sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==", + "dev": true, + "dependencies": { + "cross-spawn": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "node_modules/@changesets/apply-release-plan/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/@changesets/apply-release-plan/node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", + "dev": true + }, "node_modules/@changesets/assemble-release-plan": { - "version": "6.0.6", - "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-6.0.6.tgz", - "integrity": "sha512-Frkj8hWJ1FRZiY3kzVCKzS0N5mMwWKwmv9vpam7vt8rZjLL1JMthdh6pSDVSPumHPshTTkKZ0VtNbE0cJHZZUg==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.4.tgz", + "integrity": "sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==", "dev": true, "dependencies": { - "@changesets/errors": "^0.2.0", - "@changesets/get-dependents-graph": "^2.1.3", - "@changesets/should-skip-package": "^0.1.2", - "@changesets/types": "^6.1.0", + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.3.6", + "@changesets/types": "^5.2.1", "@manypkg/get-packages": "^1.1.3", "semver": "^7.5.3" } }, + "node_modules/@changesets/assemble-release-plan/node_modules/@changesets/errors": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", + "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "dev": true, + "dependencies": { + "extendable-error": "^0.1.5" + } + }, + "node_modules/@changesets/assemble-release-plan/node_modules/@changesets/types": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", + "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "dev": true + }, "node_modules/@changesets/changelog-git": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.2.1.tgz", - "integrity": "sha512-x/xEleCFLH28c3bQeQIyeZf8lFXyDFVn1SgcBiR2Tw/r4IAWlk1fzxCEZ6NxQAjF2Nwtczoen3OA2qR+UawQ8Q==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.1.14.tgz", + "integrity": "sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==", "dev": true, "dependencies": { - "@changesets/types": "^6.1.0" + "@changesets/types": "^5.2.1" } }, + "node_modules/@changesets/changelog-git/node_modules/@changesets/types": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", + "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "dev": true + }, "node_modules/@changesets/changelog-github": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.5.0.tgz", @@ -159,177 +286,752 @@ } }, "node_modules/@changesets/cli": { - "version": "2.29.2", - "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.29.2.tgz", - "integrity": "sha512-vwDemKjGYMOc0l6WUUTGqyAWH3AmueeyoJa1KmFRtCYiCoY5K3B68ErYpDB6H48T4lLI4czum4IEjh6ildxUeg==", + "version": "2.26.2", + "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.2.tgz", + "integrity": "sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==", "dev": true, "dependencies": { - "@changesets/apply-release-plan": "^7.0.12", - "@changesets/assemble-release-plan": "^6.0.6", - "@changesets/changelog-git": "^0.2.1", - "@changesets/config": "^3.1.1", - "@changesets/errors": "^0.2.0", - "@changesets/get-dependents-graph": "^2.1.3", - "@changesets/get-release-plan": "^4.0.10", - "@changesets/git": "^3.0.4", - "@changesets/logger": "^0.1.1", - "@changesets/pre": "^2.0.2", - "@changesets/read": "^0.6.5", - "@changesets/should-skip-package": "^0.1.2", - "@changesets/types": "^6.1.0", - "@changesets/write": "^0.4.0", + "@babel/runtime": "^7.20.1", + "@changesets/apply-release-plan": "^6.1.4", + "@changesets/assemble-release-plan": "^5.2.4", + "@changesets/changelog-git": "^0.1.14", + "@changesets/config": "^2.3.1", + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.3.6", + "@changesets/get-release-plan": "^3.0.17", + "@changesets/git": "^2.0.0", + "@changesets/logger": "^0.0.5", + "@changesets/pre": "^1.0.14", + "@changesets/read": "^0.5.9", + "@changesets/types": "^5.2.1", + "@changesets/write": "^0.2.3", "@manypkg/get-packages": "^1.1.3", + "@types/is-ci": "^3.0.0", + "@types/semver": "^7.5.0", "ansi-colors": "^4.1.3", - "ci-info": "^3.7.0", - "enquirer": "^2.4.1", + "chalk": "^2.1.0", + "enquirer": "^2.3.0", "external-editor": "^3.1.0", "fs-extra": "^7.0.1", - "mri": "^1.2.0", + "human-id": "^1.0.2", + "is-ci": "^3.0.1", + "meow": "^6.0.0", + "outdent": "^0.5.0", "p-limit": "^2.2.0", - "package-manager-detector": "^0.2.0", - "picocolors": "^1.1.0", + "preferred-pm": "^3.0.0", "resolve-from": "^5.0.0", "semver": "^7.5.3", - "spawndamnit": "^3.0.1", - "term-size": "^2.1.0" + "spawndamnit": "^2.0.0", + "term-size": "^2.1.0", + "tty-table": "^4.1.5" }, "bin": { "changeset": "bin.js" } }, + "node_modules/@changesets/cli/node_modules/@changesets/errors": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", + "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "dev": true, + "dependencies": { + "extendable-error": "^0.1.5" + } + }, + "node_modules/@changesets/cli/node_modules/@changesets/git": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/git/-/git-2.0.0.tgz", + "integrity": "sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "is-subdir": "^1.1.1", + "micromatch": "^4.0.2", + "spawndamnit": "^2.0.0" + } + }, + "node_modules/@changesets/cli/node_modules/@changesets/logger": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz", + "integrity": "sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==", + "dev": true, + "dependencies": { + "chalk": "^2.1.0" + } + }, + "node_modules/@changesets/cli/node_modules/@changesets/parse": { + "version": "0.3.16", + "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.3.16.tgz", + "integrity": "sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==", + "dev": true, + "dependencies": { + "@changesets/types": "^5.2.1", + "js-yaml": "^3.13.1" + } + }, "node_modules/@changesets/cli/node_modules/@changesets/pre": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.2.tgz", - "integrity": "sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==", + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.14.tgz", + "integrity": "sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==", "dev": true, "dependencies": { - "@changesets/errors": "^0.2.0", - "@changesets/types": "^6.1.0", + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/types": "^5.2.1", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1" } }, "node_modules/@changesets/cli/node_modules/@changesets/read": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.5.tgz", - "integrity": "sha512-UPzNGhsSjHD3Veb0xO/MwvasGe8eMyNrR/sT9gR8Q3DhOQZirgKhhXv/8hVsI0QpPjR004Z9iFxoJU6in3uGMg==", + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.5.9.tgz", + "integrity": "sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==", "dev": true, "dependencies": { - "@changesets/git": "^3.0.4", - "@changesets/logger": "^0.1.1", - "@changesets/parse": "^0.4.1", - "@changesets/types": "^6.1.0", + "@babel/runtime": "^7.20.1", + "@changesets/git": "^2.0.0", + "@changesets/logger": "^0.0.5", + "@changesets/parse": "^0.3.16", + "@changesets/types": "^5.2.1", + "chalk": "^2.1.0", "fs-extra": "^7.0.1", - "p-filter": "^2.1.0", - "picocolors": "^1.1.0" + "p-filter": "^2.1.0" + } + }, + "node_modules/@changesets/cli/node_modules/@changesets/types": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", + "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "dev": true + }, + "node_modules/@changesets/cli/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/cli/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/cli/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@changesets/cli/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@changesets/cli/node_modules/cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", + "dev": true, + "dependencies": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "node_modules/@changesets/cli/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@changesets/cli/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/cli/node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/@changesets/cli/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@changesets/cli/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@changesets/cli/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@changesets/cli/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/@changesets/cli/node_modules/spawndamnit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawndamnit/-/spawndamnit-2.0.0.tgz", + "integrity": "sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==", + "dev": true, + "dependencies": { + "cross-spawn": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "node_modules/@changesets/cli/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/cli/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/@changesets/cli/node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", + "dev": true + }, + "node_modules/@changesets/config": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@changesets/config/-/config-2.3.1.tgz", + "integrity": "sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==", + "dev": true, + "dependencies": { + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.3.6", + "@changesets/logger": "^0.0.5", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "fs-extra": "^7.0.1", + "micromatch": "^4.0.2" + } + }, + "node_modules/@changesets/config/node_modules/@changesets/errors": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", + "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "dev": true, + "dependencies": { + "extendable-error": "^0.1.5" + } + }, + "node_modules/@changesets/config/node_modules/@changesets/logger": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz", + "integrity": "sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==", + "dev": true, + "dependencies": { + "chalk": "^2.1.0" + } + }, + "node_modules/@changesets/config/node_modules/@changesets/types": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", + "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "dev": true + }, + "node_modules/@changesets/config/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/config/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/config/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@changesets/config/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@changesets/config/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@changesets/config/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/config/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/errors": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.2.0.tgz", + "integrity": "sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==", + "dev": true, + "dependencies": { + "extendable-error": "^0.1.5" + } + }, + "node_modules/@changesets/get-dependents-graph": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.6.tgz", + "integrity": "sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==", + "dev": true, + "dependencies": { + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "chalk": "^2.1.0", + "fs-extra": "^7.0.1", + "semver": "^7.5.3" + } + }, + "node_modules/@changesets/get-dependents-graph/node_modules/@changesets/types": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", + "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "dev": true + }, + "node_modules/@changesets/get-dependents-graph/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/get-dependents-graph/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/get-dependents-graph/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@changesets/get-dependents-graph/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@changesets/get-dependents-graph/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@changesets/get-dependents-graph/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/get-dependents-graph/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/get-github-info": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.6.0.tgz", + "integrity": "sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==", + "dev": true, + "dependencies": { + "dataloader": "^1.4.0", + "node-fetch": "^2.5.0" + } + }, + "node_modules/@changesets/get-release-plan": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.17.tgz", + "integrity": "sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/assemble-release-plan": "^5.2.4", + "@changesets/config": "^2.3.1", + "@changesets/pre": "^1.0.14", + "@changesets/read": "^0.5.9", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3" + } + }, + "node_modules/@changesets/get-release-plan/node_modules/@changesets/errors": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", + "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "dev": true, + "dependencies": { + "extendable-error": "^0.1.5" + } + }, + "node_modules/@changesets/get-release-plan/node_modules/@changesets/git": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/git/-/git-2.0.0.tgz", + "integrity": "sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "is-subdir": "^1.1.1", + "micromatch": "^4.0.2", + "spawndamnit": "^2.0.0" + } + }, + "node_modules/@changesets/get-release-plan/node_modules/@changesets/logger": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz", + "integrity": "sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==", + "dev": true, + "dependencies": { + "chalk": "^2.1.0" + } + }, + "node_modules/@changesets/get-release-plan/node_modules/@changesets/parse": { + "version": "0.3.16", + "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.3.16.tgz", + "integrity": "sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==", + "dev": true, + "dependencies": { + "@changesets/types": "^5.2.1", + "js-yaml": "^3.13.1" + } + }, + "node_modules/@changesets/get-release-plan/node_modules/@changesets/pre": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.14.tgz", + "integrity": "sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "fs-extra": "^7.0.1" + } + }, + "node_modules/@changesets/get-release-plan/node_modules/@changesets/read": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.5.9.tgz", + "integrity": "sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/git": "^2.0.0", + "@changesets/logger": "^0.0.5", + "@changesets/parse": "^0.3.16", + "@changesets/types": "^5.2.1", + "chalk": "^2.1.0", + "fs-extra": "^7.0.1", + "p-filter": "^2.1.0" + } + }, + "node_modules/@changesets/get-release-plan/node_modules/@changesets/types": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", + "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "dev": true + }, + "node_modules/@changesets/get-release-plan/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/get-release-plan/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/get-release-plan/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@changesets/get-release-plan/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@changesets/get-release-plan/node_modules/cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", + "dev": true, + "dependencies": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, - "node_modules/@changesets/cli/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/@changesets/get-release-plan/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.8.0" } }, - "node_modules/@changesets/config": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@changesets/config/-/config-3.1.1.tgz", - "integrity": "sha512-bd+3Ap2TKXxljCggI0mKPfzCQKeV/TU4yO2h2C6vAihIo8tzseAn2e7klSuiyYYXvgu53zMN1OeYMIQkaQoWnA==", + "node_modules/@changesets/get-release-plan/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, - "dependencies": { - "@changesets/errors": "^0.2.0", - "@changesets/get-dependents-graph": "^2.1.3", - "@changesets/logger": "^0.1.1", - "@changesets/types": "^6.1.0", - "@manypkg/get-packages": "^1.1.3", - "fs-extra": "^7.0.1", - "micromatch": "^4.0.8" + "engines": { + "node": ">=4" } }, - "node_modules/@changesets/errors": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.2.0.tgz", - "integrity": "sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==", + "node_modules/@changesets/get-release-plan/node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "dependencies": { - "extendable-error": "^0.1.5" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, - "node_modules/@changesets/get-dependents-graph": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-2.1.3.tgz", - "integrity": "sha512-gphr+v0mv2I3Oxt19VdWRRUxq3sseyUpX9DaHpTUmLj92Y10AGy+XOtV+kbM6L/fDcpx7/ISDFK6T8A/P3lOdQ==", + "node_modules/@changesets/get-release-plan/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", "dev": true, "dependencies": { - "@changesets/types": "^6.1.0", - "@manypkg/get-packages": "^1.1.3", - "picocolors": "^1.1.0", - "semver": "^7.5.3" + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/@changesets/get-github-info": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.6.0.tgz", - "integrity": "sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==", + "node_modules/@changesets/get-release-plan/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", "dev": true, - "dependencies": { - "dataloader": "^1.4.0", - "node-fetch": "^2.5.0" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/@changesets/get-release-plan": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-4.0.10.tgz", - "integrity": "sha512-CCJ/f3edYaA3MqoEnWvGGuZm0uMEMzNJ97z9hdUR34AOvajSwySwsIzC/bBu3+kuGDsB+cny4FljG8UBWAa7jg==", + "node_modules/@changesets/get-release-plan/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/@changesets/get-release-plan/node_modules/spawndamnit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawndamnit/-/spawndamnit-2.0.0.tgz", + "integrity": "sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==", "dev": true, "dependencies": { - "@changesets/assemble-release-plan": "^6.0.6", - "@changesets/config": "^3.1.1", - "@changesets/pre": "^2.0.2", - "@changesets/read": "^0.6.5", - "@changesets/types": "^6.1.0", - "@manypkg/get-packages": "^1.1.3" + "cross-spawn": "^5.1.0", + "signal-exit": "^3.0.2" } }, - "node_modules/@changesets/get-release-plan/node_modules/@changesets/pre": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.2.tgz", - "integrity": "sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==", + "node_modules/@changesets/get-release-plan/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { - "@changesets/errors": "^0.2.0", - "@changesets/types": "^6.1.0", - "@manypkg/get-packages": "^1.1.3", - "fs-extra": "^7.0.1" + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@changesets/get-release-plan/node_modules/@changesets/read": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.5.tgz", - "integrity": "sha512-UPzNGhsSjHD3Veb0xO/MwvasGe8eMyNrR/sT9gR8Q3DhOQZirgKhhXv/8hVsI0QpPjR004Z9iFxoJU6in3uGMg==", + "node_modules/@changesets/get-release-plan/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "dependencies": { - "@changesets/git": "^3.0.4", - "@changesets/logger": "^0.1.1", - "@changesets/parse": "^0.4.1", - "@changesets/types": "^6.1.0", - "fs-extra": "^7.0.1", - "p-filter": "^2.1.0", - "picocolors": "^1.1.0" + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" } }, + "node_modules/@changesets/get-release-plan/node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", + "dev": true + }, "node_modules/@changesets/get-version-range-type": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.4.0.tgz", - "integrity": "sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz", + "integrity": "sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==", "dev": true }, "node_modules/@changesets/git": { @@ -464,16 +1166,6 @@ "node": ">=4" } }, - "node_modules/@changesets/should-skip-package": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@changesets/should-skip-package/-/should-skip-package-0.1.2.tgz", - "integrity": "sha512-qAK/WrqWLNCP22UDdBTMPH5f41elVDlsNyat180A33dWxuUDyNpg6fPi/FyTZwRriVjg0L8gnjJn2F9XAoF0qw==", - "dev": true, - "dependencies": { - "@changesets/types": "^6.1.0", - "@manypkg/get-packages": "^1.1.3" - } - }, "node_modules/@changesets/types": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@changesets/types/-/types-6.1.0.tgz", @@ -481,17 +1173,24 @@ "dev": true }, "node_modules/@changesets/write": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.4.0.tgz", - "integrity": "sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.2.3.tgz", + "integrity": "sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==", "dev": true, "dependencies": { - "@changesets/types": "^6.1.0", + "@babel/runtime": "^7.20.1", + "@changesets/types": "^5.2.1", "fs-extra": "^7.0.1", - "human-id": "^4.1.1", + "human-id": "^1.0.2", "prettier": "^2.7.1" } }, + "node_modules/@changesets/write/node_modules/@changesets/types": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", + "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "dev": true + }, "node_modules/@changesets/write/node_modules/prettier": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", @@ -574,12 +1273,12 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz", - "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", + "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", "dev": true, "dependencies": { - "@eslint/object-schema": "^2.1.6", + "@eslint/object-schema": "^2.1.4", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -609,15 +1308,6 @@ "node": "*" } }, - "node_modules/@eslint/config-helpers": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.2.tgz", - "integrity": "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, "node_modules/@eslint/core": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz", @@ -728,9 +1418,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.25.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.25.1.tgz", - "integrity": "sha512-dEIwmjntEx8u3Uvv+kr3PDeeArL8Hw07H9kyYxCjnM9pBjfEhk6uLXSchxxzgiwtRhhzVzqmUSDFBOi1TuZ7qg==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz", + "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1310,19 +2000,6 @@ "node": ">=18.18.0" } }, - "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", - "dev": true, - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -1337,9 +2014,9 @@ } }, "node_modules/@humanwhocodes/retry": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", - "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", "dev": true, "engines": { "node": ">=18.18" @@ -1688,9 +2365,9 @@ } }, "node_modules/@nomicfoundation/hardhat-ethers": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.8.tgz", - "integrity": "sha512-zhOZ4hdRORls31DTOqg+GmEZM0ujly8GGIuRY7t7szEk2zW/arY1qDug/py8AEktT00v5K+b6RvbVog+va51IA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.4.tgz", + "integrity": "sha512-k9qbLoY7qn6C6Y1LI0gk2kyHXil2Tauj4kGzQ8pgxYXIGw8lWn8tuuL72E11CrlKaXRUvOgF0EXrv/msPI2SbA==", "dev": true, "dependencies": { "debug": "^4.1.1", @@ -2310,6 +2987,15 @@ "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", "dev": true }, + "node_modules/@types/is-ci": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/is-ci/-/is-ci-3.0.4.tgz", + "integrity": "sha512-AkCYCmwlXeuH89DagDCzvCAyltI2v9lh3U3DqSg/GrBYoReAaWwxfXCqMx9UV5MajLZ4ZFwZzV4cABGIxk2XRw==", + "dev": true, + "dependencies": { + "ci-info": "^3.1.0" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -2328,12 +3014,24 @@ "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", "dev": true }, + "node_modules/@types/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", + "dev": true + }, "node_modules/@types/node": { "version": "12.20.55", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", "dev": true }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true + }, "node_modules/@types/pbkdf2": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz", @@ -2352,6 +3050,12 @@ "@types/node": "*" } }, + "node_modules/@types/semver": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz", + "integrity": "sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==", + "dev": true + }, "node_modules/abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", @@ -2614,6 +3318,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/arraybuffer.prototype.slice": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", @@ -2635,6 +3357,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -2828,6 +3559,15 @@ "node": ">=8" } }, + "node_modules/breakword": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/breakword/-/breakword-1.0.6.tgz", + "integrity": "sha512-yjxDAYyK/pBvws9H4xKYpLDpYKEH6CzrBPAuXq3x18I+c/2MkVtT3qAr7Oloi6Dss9qNhPVueAAVU1CSeNDIXw==", + "dev": true, + "dependencies": { + "wcwidth": "^1.0.1" + } + }, "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", @@ -3008,6 +3748,41 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase-keys/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-keys/node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/cbor": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/cbor/-/cbor-9.0.2.tgz", @@ -3273,6 +4048,15 @@ "node": ">=12" } }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -3449,6 +4233,39 @@ "node": "*" } }, + "node_modules/csv": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/csv/-/csv-5.5.3.tgz", + "integrity": "sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==", + "dev": true, + "dependencies": { + "csv-generate": "^3.4.3", + "csv-parse": "^4.16.3", + "csv-stringify": "^5.6.5", + "stream-transform": "^2.1.3" + }, + "engines": { + "node": ">= 0.1.90" + } + }, + "node_modules/csv-generate": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/csv-generate/-/csv-generate-3.4.3.tgz", + "integrity": "sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==", + "dev": true + }, + "node_modules/csv-parse": { + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-4.16.3.tgz", + "integrity": "sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==", + "dev": true + }, + "node_modules/csv-stringify": { + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-5.6.5.tgz", + "integrity": "sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==", + "dev": true + }, "node_modules/data-view-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", @@ -3541,6 +4358,40 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dev": true, + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", @@ -3595,6 +4446,18 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/defer-to-connect": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", @@ -4070,32 +4933,31 @@ } }, "node_modules/eslint": { - "version": "9.25.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.25.1.tgz", - "integrity": "sha512-E6Mtz9oGQWDCpV12319d59n4tx9zOTXSTmc8BLVxBx+G/0RdM5MvEEJLU9c0+aleoePYYgVTOsRblx433qmhWQ==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz", + "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.20.0", - "@eslint/config-helpers": "^0.2.1", - "@eslint/core": "^0.13.0", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.25.1", - "@eslint/plugin-kit": "^0.2.8", - "@humanfs/node": "^0.16.6", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.18.0", + "@eslint/core": "^0.7.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.13.0", + "@eslint/plugin-kit": "^0.2.0", + "@humanfs/node": "^0.16.5", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.2", + "@humanwhocodes/retry": "^0.3.1", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.6", + "cross-spawn": "^7.0.2", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.3.0", - "eslint-visitor-keys": "^4.2.0", - "espree": "^10.3.0", + "eslint-scope": "^8.1.0", + "eslint-visitor-keys": "^4.1.0", + "espree": "^10.2.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -4109,7 +4971,8 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3" + "optionator": "^0.9.3", + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" @@ -4169,6 +5032,15 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/@eslint/core": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", + "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/eslint/node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -4664,6 +5536,16 @@ "node": ">=8" } }, + "node_modules/find-yarn-workspace-root2": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz", + "integrity": "sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==", + "dev": true, + "dependencies": { + "micromatch": "^4.0.2", + "pkg-dir": "^4.2.0" + } + }, "node_modules/flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", @@ -5025,22 +5907,24 @@ "node": ">=4" } }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "node_modules/glob": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", + "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": "*" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -5058,26 +5942,19 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/global-modules": { @@ -5221,6 +6098,12 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "node_modules/graphlib": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", @@ -5260,6 +6143,15 @@ "node": ">=0.10.0" } }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/hardhat": { "version": "2.23.0", "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.23.0.tgz", @@ -5992,6 +6884,12 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, "node_modules/http-cache-semantics": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", @@ -6041,13 +6939,10 @@ } }, "node_modules/human-id": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/human-id/-/human-id-4.1.1.tgz", - "integrity": "sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg==", - "dev": true, - "bin": { - "human-id": "dist/cli.js" - } + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/human-id/-/human-id-1.0.2.tgz", + "integrity": "sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==", + "dev": true }, "node_modules/human-signals": { "version": "5.0.0", @@ -6295,6 +7190,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-ci": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", + "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", + "dev": true, + "dependencies": { + "ci-info": "^3.2.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, "node_modules/is-data-view": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", @@ -6791,6 +7698,15 @@ "node": ">=0.10.0" } }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/latest-version": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", @@ -6989,6 +7905,21 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/load-yaml-file": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", + "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.5", + "js-yaml": "^3.13.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -7247,6 +8178,18 @@ "node": ">=10" } }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/markdown-table": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", @@ -7289,6 +8232,74 @@ "node": ">= 0.10.0" } }, + "node_modules/meow": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz", + "integrity": "sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==", + "dev": true, + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "^4.0.2", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/meow/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -7430,6 +8441,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -7466,6 +8486,29 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/minimist-options/node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -7475,6 +8518,15 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mixme": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/mixme/-/mixme-0.5.10.tgz", + "integrity": "sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q==", + "dev": true, + "engines": { + "node": ">= 8.0.0" + } + }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -7698,15 +8750,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -7816,6 +8859,27 @@ "nopt": "bin/nopt.js" } }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -8130,15 +9194,6 @@ "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", "dev": true }, - "node_modules/package-manager-detector": { - "version": "0.2.11", - "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-0.2.11.tgz", - "integrity": "sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==", - "dev": true, - "dependencies": { - "quansync": "^0.2.7" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -8300,6 +9355,18 @@ "node": ">=6" } }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -8315,7 +9382,95 @@ "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", "dev": true, "engines": { - "node": ">= 0.4" + "node": ">= 0.4" + } + }, + "node_modules/preferred-pm": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.1.4.tgz", + "integrity": "sha512-lEHd+yEm22jXdCphDrkvIJQU66EuLojPPtvZkpKIkiD+l0DMThF/niqZKJSoU8Vl7iuvtmzyMhir9LdVy5WMnA==", + "dev": true, + "dependencies": { + "find-up": "^5.0.0", + "find-yarn-workspace-root2": "1.2.16", + "path-exists": "^4.0.0", + "which-pm": "^2.2.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/preferred-pm/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/preferred-pm/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/preferred-pm/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/preferred-pm/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/preferred-pm/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/prelude-ls": { @@ -8328,9 +9483,9 @@ } }, "node_modules/prettier": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", - "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -8343,26 +9498,30 @@ } }, "node_modules/prettier-plugin-solidity": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.4.3.tgz", - "integrity": "sha512-Mrr/iiR9f9IaeGRMZY2ApumXcn/C5Gs3S7B7hWB3gigBFML06C0yEyW86oLp0eqiA0qg+46FaChgLPJCj/pIlg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.1.3.tgz", + "integrity": "sha512-fQ9yucPi2sBbA2U2Xjh6m4isUTJ7S7QLc/XDDsktqqxYfTwdYKJ0EnnywXHwCGAaYbQNK+HIYPL1OemxuMsgeg==", "dev": true, "dependencies": { - "@solidity-parser/parser": "^0.20.1", - "semver": "^7.7.1" + "@solidity-parser/parser": "^0.16.0", + "semver": "^7.3.8", + "solidity-comments-extractor": "^0.0.7" }, "engines": { - "node": ">=18" + "node": ">=12" }, "peerDependencies": { - "prettier": ">=2.3.0" + "prettier": ">=2.3.0 || >=3.0.0-alpha.0" } }, "node_modules/prettier-plugin-solidity/node_modules/@solidity-parser/parser": { - "version": "0.20.1", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.20.1.tgz", - "integrity": "sha512-58I2sRpzaQUN+jJmWbHfbWf9AKfzqCI8JAdFB0vbyY+u8tBRcuTt9LxzasvR0LGQpcRv97eyV7l61FQ3Ib7zVw==", - "dev": true + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.2.tgz", + "integrity": "sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==", + "dev": true, + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } }, "node_modules/prettier-plugin-solidity/node_modules/semver": { "version": "7.7.1", @@ -8405,6 +9564,12 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "dev": true }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", + "dev": true + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -8414,22 +9579,6 @@ "node": ">=6" } }, - "node_modules/quansync": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.10.tgz", - "integrity": "sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/antfu" - }, - { - "type": "individual", - "url": "https://github.com/sponsors/sxzz" - } - ] - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -8510,6 +9659,56 @@ "node": ">=0.10.0" } }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/read-yaml-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-1.1.0.tgz", @@ -8597,6 +9796,19 @@ "node": "*" } }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -8693,6 +9905,12 @@ "node": ">=0.10.0" } }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, "node_modules/resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -8809,44 +10027,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/glob": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", - "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", - "dev": true, - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -9114,9 +10294,9 @@ "dev": true }, "node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -9137,6 +10317,12 @@ "randombytes": "^2.1.0" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -9429,6 +10615,110 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/smartwrap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/smartwrap/-/smartwrap-2.0.2.tgz", + "integrity": "sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==", + "dev": true, + "dependencies": { + "array.prototype.flat": "^1.2.3", + "breakword": "^1.0.5", + "grapheme-splitter": "^1.0.4", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1", + "yargs": "^15.1.0" + }, + "bin": { + "smartwrap": "src/terminal-adapter.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/smartwrap/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/smartwrap/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/smartwrap/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/smartwrap/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/smartwrap/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "node_modules/smartwrap/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/smartwrap/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/solc": { "version": "0.8.26", "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.26.tgz", @@ -9679,6 +10969,12 @@ "node": ">= 10" } }, + "node_modules/solidity-comments-extractor": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz", + "integrity": "sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw==", + "dev": true + }, "node_modules/solidity-comments-freebsd-x64": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/solidity-comments-freebsd-x64/-/solidity-comments-freebsd-x64-0.0.2.tgz", @@ -10394,6 +11690,38 @@ "signal-exit": "^4.0.1" } }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.21", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz", + "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==", + "dev": true + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -10430,6 +11758,15 @@ "node": ">= 0.8" } }, + "node_modules/stream-transform": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/stream-transform/-/stream-transform-2.1.3.tgz", + "integrity": "sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==", + "dev": true, + "dependencies": { + "mixme": "^0.5.1" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -10610,6 +11947,18 @@ "npm": ">=3" } }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -10775,6 +12124,15 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, + "node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/tslib": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", @@ -10787,6 +12145,43 @@ "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", "dev": true }, + "node_modules/tty-table": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/tty-table/-/tty-table-4.2.3.tgz", + "integrity": "sha512-Fs15mu0vGzCrj8fmJNP7Ynxt5J7praPXqFN0leZeZBXJwkMxv9cb2D454k1ltrtUSJbZ4yH4e0CynsHLxmUfFA==", + "dev": true, + "dependencies": { + "chalk": "^4.1.2", + "csv": "^5.5.3", + "kleur": "^4.1.5", + "smartwrap": "^2.0.2", + "strip-ansi": "^6.0.1", + "wcwidth": "^1.0.1", + "yargs": "^17.7.1" + }, + "bin": { + "tty-table": "adapters/terminal-adapter.js" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/tty-table/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -10926,9 +12321,9 @@ } }, "node_modules/undici": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.8.0.tgz", - "integrity": "sha512-vFv1GA99b7eKO1HG/4RPu2Is3FBTWBrmzqzO0mz+rLxN3yXkE4mqRcb8g8fHxzX4blEysrNZLqg5RbJLqX5buA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.4.0.tgz", + "integrity": "sha512-PUQM3/es3noM24oUn10u3kNNap0AbxESOmnssmW+dOi9yGwlUSi5nTNYl3bNbTkWOF8YZDkx2tCmj9OtQ3iGGw==", "dev": true, "engines": { "node": ">=20.18.1" @@ -10979,6 +12374,16 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "node_modules/viem": { "version": "2.7.14", "resolved": "https://registry.npmjs.org/viem/-/viem-2.7.14.tgz", @@ -11048,6 +12453,15 @@ } } }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "dependencies": { + "defaults": "^1.0.3" + } + }, "node_modules/web3-utils": { "version": "1.10.4", "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.4.tgz", @@ -11234,6 +12648,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true + }, + "node_modules/which-pm": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.2.0.tgz", + "integrity": "sha512-MOiaDbA5ZZgUjkeMWM5EkJp4loW5ZRoa5bc3/aeMox/PJelMhE6t7S/mLuiY43DBupyxH+S0U1bTui9kWUlmsw==", + "dev": true, + "dependencies": { + "load-yaml-file": "^0.2.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8.15" + } + }, "node_modules/which-typed-array": { "version": "1.1.19", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", From 10f40d74f3bfd7e7964812f01faf2f9c23ce295d Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 01:26:42 -0600 Subject: [PATCH 029/110] reset dependencies --- package-lock.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index f6e81a80f1b..79582874804 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "devDependencies": { "@changesets/changelog-github": "^0.5.0", - "@changesets/cli": "^2.26.2", + "@changesets/cli": "^2.26.0", "@changesets/pre": "^2.0.0", "@changesets/read": "^0.6.0", "@eslint/compat": "^1.2.1", @@ -22,7 +22,7 @@ "@openzeppelin/upgrade-safe-transpiler": "^0.3.32", "@openzeppelin/upgrades-core": "^1.20.6", "chai": "^4.2.0", - "eslint": "^9.13.0", + "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", "ethers": "^6.13.7", "glob": "^11.0.0", @@ -37,10 +37,10 @@ "lodash.startcase": "^4.4.0", "micromatch": "^4.0.2", "p-limit": "^6.0.0", - "prettier": "^3.0.3", - "prettier-plugin-solidity": "^1.1.3", + "prettier": "^3.0.0", + "prettier-plugin-solidity": "^1.1.0", "rimraf": "^6.0.0", - "semver": "^7.5.4", + "semver": "^7.3.5", "solhint": "^5.0.0", "solhint-plugin-openzeppelin": "file:scripts/solhint-custom", "solidity-ast": "^0.4.50", @@ -5908,9 +5908,9 @@ } }, "node_modules/glob": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", - "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", + "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", From 36fb0441daa74fa6ca0cfa79c4f50a7845dcf43a Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 01:27:57 -0600 Subject: [PATCH 030/110] lint --- test/account/AccountERC7702.t.sol | 5 +--- test/proxy/Clones.test.js | 22 ++++++++--------- test/utils/cryptography/ERC7739Utils.test.js | 26 +++++++++----------- 3 files changed, 22 insertions(+), 31 deletions(-) diff --git a/test/account/AccountERC7702.t.sol b/test/account/AccountERC7702.t.sol index e2302049c31..f79e1bcc761 100644 --- a/test/account/AccountERC7702.t.sol +++ b/test/account/AccountERC7702.t.sol @@ -43,10 +43,7 @@ contract AccountERC7702Test is Test { // Setup entrypoint vm.deal(address(ERC4337Utils.ENTRYPOINT_V08), MAX_ETH); - vm.etch( - address(ERC4337Utils.ENTRYPOINT_V08), - vm.readFileBinary("test/bin/EntryPoint070.bytecode") - ); + vm.etch(address(ERC4337Utils.ENTRYPOINT_V08), vm.readFileBinary("test/bin/EntryPoint070.bytecode")); } function testExecuteBatch(uint256 argA, uint256 argB) public { diff --git a/test/proxy/Clones.test.js b/test/proxy/Clones.test.js index 93bcfba19b9..0706c6f834c 100644 --- a/test/proxy/Clones.test.js +++ b/test/proxy/Clones.test.js @@ -31,18 +31,17 @@ async function fixture() { const newClone = args => async (opts = {}) => { - const clone = await ( - args - ? factory.$cloneWithImmutableArgs.staticCall(implementation, args) - : factory.$clone.staticCall(implementation) + const clone = await (args + ? factory.$cloneWithImmutableArgs.staticCall(implementation, args) + : factory.$clone.staticCall(implementation) ).then(address => implementation.attach(address)); const tx = await (args ? opts.deployValue ? factory.$cloneWithImmutableArgs(implementation, args, ethers.Typed.uint256(opts.deployValue)) : factory.$cloneWithImmutableArgs(implementation, args) : opts.deployValue - ? factory.$clone(implementation, ethers.Typed.uint256(opts.deployValue)) - : factory.$clone(implementation)); + ? factory.$clone(implementation, ethers.Typed.uint256(opts.deployValue)) + : factory.$clone(implementation)); if (opts.initData || opts.initValue) { await deployer.sendTransaction({ to: clone, value: opts.initValue ?? 0n, data: opts.initData ?? '0x' }); } @@ -53,10 +52,9 @@ async function fixture() { args => async (opts = {}) => { const salt = opts.salt ?? ethers.randomBytes(32); - const clone = await ( - args - ? factory.$cloneDeterministicWithImmutableArgs.staticCall(implementation, args, salt) - : factory.$cloneDeterministic.staticCall(implementation, salt) + const clone = await (args + ? factory.$cloneDeterministicWithImmutableArgs.staticCall(implementation, args, salt) + : factory.$cloneDeterministic.staticCall(implementation, salt) ).then(address => implementation.attach(address)); const tx = await (args ? opts.deployValue @@ -68,8 +66,8 @@ async function fixture() { ) : factory.$cloneDeterministicWithImmutableArgs(implementation, args, salt) : opts.deployValue - ? factory.$cloneDeterministic(implementation, salt, ethers.Typed.uint256(opts.deployValue)) - : factory.$cloneDeterministic(implementation, salt)); + ? factory.$cloneDeterministic(implementation, salt, ethers.Typed.uint256(opts.deployValue)) + : factory.$cloneDeterministic(implementation, salt)); if (opts.initData || opts.initValue) { await deployer.sendTransaction({ to: clone, value: opts.initValue ?? 0n, data: opts.initData ?? '0x' }); } diff --git a/test/utils/cryptography/ERC7739Utils.test.js b/test/utils/cryptography/ERC7739Utils.test.js index e80afcfaa4f..161804550d2 100644 --- a/test/utils/cryptography/ERC7739Utils.test.js +++ b/test/utils/cryptography/ERC7739Utils.test.js @@ -181,25 +181,21 @@ describe('ERC7739Utils', function () { contentsDescr: '(SomeType(address foo,uint256 bar)(SomeType', contentTypeName: null, }, - forbiddenChars - .split('') - .map(char => ({ - descr: `should return nothing if contains [${char}] (implicit)`, - contentsDescr: `SomeType${char}(address foo,uint256 bar)`, - contentTypeName: null, - })), - forbiddenChars - .split('') - .map(char => ({ - descr: `should return nothing if contains [${char}] (explicit)`, - contentsDescr: `SomeType${char}(address foo,uint256 bar)SomeType${char}`, - contentTypeName: null, - })), + forbiddenChars.split('').map(char => ({ + descr: `should return nothing if contains [${char}] (implicit)`, + contentsDescr: `SomeType${char}(address foo,uint256 bar)`, + contentTypeName: null, + })), + forbiddenChars.split('').map(char => ({ + descr: `should return nothing if contains [${char}] (explicit)`, + contentsDescr: `SomeType${char}(address foo,uint256 bar)SomeType${char}`, + contentTypeName: null, + })), )) { it(descr, async function () { await expect(this.mock.$decodeContentsDescr(contentsDescr)).to.eventually.deep.equal([ contentTypeName ?? '', - contentTypeName ? (contentType ?? contentsDescr) : '', + contentTypeName ? contentType ?? contentsDescr : '', ]); }); } From 7e10f80c4b4224e12b2e06e3bdddc1eb764a5968 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 10:03:10 -0600 Subject: [PATCH 031/110] Attempt to fix tests --- package-lock.json | 8 ++++---- package.json | 2 +- test/metatx/ERC2771Forwarder.test.js | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 79582874804..f53748ee0ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.7", + "ethers": "^6.13.6-beta.1", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", @@ -5307,9 +5307,9 @@ } }, "node_modules/ethers": { - "version": "6.13.7", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.7.tgz", - "integrity": "sha512-qbaJ0uIrjh+huP1Lad2f2QtzW5dcqSVjIzVH6yWB4dKoMuj2WqYz5aMeeQTCNpAKgTJBM5J9vcc2cYJ23UAimQ==", + "version": "6.13.6-beta.1", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.6-beta.1.tgz", + "integrity": "sha512-sJZklf+m7QrlzYnOFbR0qHPqgYHeevbY98VIhzvnSdzhJVN/nNV/skKc/4wjyxbWRhK9t7r6ENcwUwLPjfxTLw==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index 636236c1288..423e1a5a9c7 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.7", + "ethers": "^6.13.6-beta.1", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", diff --git a/test/metatx/ERC2771Forwarder.test.js b/test/metatx/ERC2771Forwarder.test.js index bf6cfd10c4b..f3fa0eb819e 100644 --- a/test/metatx/ERC2771Forwarder.test.js +++ b/test/metatx/ERC2771Forwarder.test.js @@ -174,7 +174,9 @@ describe('ERC2771Forwarder', function () { // Because the relayer call consumes gas until the `CALL` opcode, the gas left after failing // the subcall won't enough to finish the top level call (after testing), so we add a // moderated buffer. - const gasLimit = estimate + 2_000n; + const gasLimit = estimate + 10_000n; + + console.log(estimate); // The subcall out of gas should be caught by the contract and then bubbled up consuming // the available gas with an `invalid` opcode. From c6ed868272b64943fb78fef5b3e269cbc5bace53 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 10:09:07 -0600 Subject: [PATCH 032/110] up --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index f53748ee0ae..c9ff8f98081 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.6-beta.1", + "ethers": "6.13.6-beta.1", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", diff --git a/package.json b/package.json index 423e1a5a9c7..f5e42ee977c 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.6-beta.1", + "ethers": "6.13.6-beta.1", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", From f6d07c25368dffdf8c7fbaea48887d7ff42695d5 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 11:52:54 -0600 Subject: [PATCH 033/110] adjust action.yml --- .github/actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 3c5fc602e13..9f96c25ebec 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -13,7 +13,7 @@ runs: path: '**/node_modules' key: npm-v3-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - run: npm ci + run: npm ci --legacy-peer-deps shell: bash if: steps.cache.outputs.cache-hit != 'true' - name: Install Foundry From cfa2392be0b97c5bb325eb618b195bb9df3021c1 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 11:57:20 -0600 Subject: [PATCH 034/110] up --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e675785315a..b6267220b90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10923,9 +10923,9 @@ "dev": true }, "node_modules/solidity-coverage": { - "version": "0.8.15", - "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.15.tgz", - "integrity": "sha512-qH7290NKww4/t/qFvnSEePEzON0k025IGVlwc8wo8Q6p+h1Tt6fV2M0k3yfsps3TomZYTROsfPXjx7MSnwD5uA==", + "version": "0.8.14", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.14.tgz", + "integrity": "sha512-ItAAObe5GaEOp20kXC2BZRnph+9P7Rtoqg2mQc2SXGEHgSDF2wWd1Wxz3ntzQWXkbCtIIGdJT918HG00cObwbA==", "dev": true, "license": "ISC", "dependencies": { From 3a90091dea7395feace99f0203bcb19732bc132f Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 13:53:33 -0600 Subject: [PATCH 035/110] lint --- test/utils/cryptography/ERC7739Utils.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/cryptography/ERC7739Utils.test.js b/test/utils/cryptography/ERC7739Utils.test.js index 161804550d2..93e382df611 100644 --- a/test/utils/cryptography/ERC7739Utils.test.js +++ b/test/utils/cryptography/ERC7739Utils.test.js @@ -195,7 +195,7 @@ describe('ERC7739Utils', function () { it(descr, async function () { await expect(this.mock.$decodeContentsDescr(contentsDescr)).to.eventually.deep.equal([ contentTypeName ?? '', - contentTypeName ? contentType ?? contentsDescr : '', + contentTypeName ? (contentType ?? contentsDescr) : '', ]); }); } From bdec803a46cb4591bdad7ddc79fd075dedbbbe6d Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 14:04:43 -0600 Subject: [PATCH 036/110] lint --- contracts/utils/cryptography/ERC7739.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/utils/cryptography/ERC7739.sol b/contracts/utils/cryptography/ERC7739.sol index 06c66354375..eb4f47f37c3 100644 --- a/contracts/utils/cryptography/ERC7739.sol +++ b/contracts/utils/cryptography/ERC7739.sol @@ -43,8 +43,8 @@ abstract contract ERC7739 is AbstractSigner, EIP712, IERC1271 { (_isValidNestedTypedDataSignature(hash, signature) || _isValidNestedPersonalSignSignature(hash, signature)) ? IERC1271.isValidSignature.selector : (hash == 0x7739773977397739773977397739773977397739773977397739773977397739 && signature.length == 0) - ? bytes4(0x77390001) - : bytes4(0xffffffff); + ? bytes4(0x77390001) + : bytes4(0xffffffff); } /** From 1c97739c1fa97941a71b99eb6b9ed096eb085b51 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 15:42:17 -0600 Subject: [PATCH 037/110] Test ethers 6.13.6-beta.1 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index a82155c7608..a8cdbf4de21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.4", + "ethers": "^6.13.6-beta.1", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", @@ -4483,9 +4483,9 @@ } }, "node_modules/ethers": { - "version": "6.13.7", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.7.tgz", - "integrity": "sha512-qbaJ0uIrjh+huP1Lad2f2QtzW5dcqSVjIzVH6yWB4dKoMuj2WqYz5aMeeQTCNpAKgTJBM5J9vcc2cYJ23UAimQ==", + "version": "6.13.6-beta.1", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.6-beta.1.tgz", + "integrity": "sha512-sJZklf+m7QrlzYnOFbR0qHPqgYHeevbY98VIhzvnSdzhJVN/nNV/skKc/4wjyxbWRhK9t7r6ENcwUwLPjfxTLw==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index d2f7dec6c6d..635290f6205 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.4", + "ethers": "^6.13.6-beta.1", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", From 6b1bbd8d7bb6096597b478c443fde4d6b51e1c6a Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 15:44:49 -0600 Subject: [PATCH 038/110] up --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a8cdbf4de21..1ac37124f2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4483,9 +4483,9 @@ } }, "node_modules/ethers": { - "version": "6.13.6-beta.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.6-beta.1.tgz", - "integrity": "sha512-sJZklf+m7QrlzYnOFbR0qHPqgYHeevbY98VIhzvnSdzhJVN/nNV/skKc/4wjyxbWRhK9t7r6ENcwUwLPjfxTLw==", + "version": "6.13.7", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.7.tgz", + "integrity": "sha512-qbaJ0uIrjh+huP1Lad2f2QtzW5dcqSVjIzVH6yWB4dKoMuj2WqYz5aMeeQTCNpAKgTJBM5J9vcc2cYJ23UAimQ==", "dev": true, "funding": [ { From 77645155684d4981067f554f4b2db19673fed406 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 15:49:19 -0600 Subject: [PATCH 039/110] up --- package-lock.json | 155 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 155 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index f5274cde547..e1b7018388f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", - "hardhat": "^2.23.0", + "hardhat": "^2.22.7", "hardhat-exposed": "^0.3.15", "hardhat-gas-reporter": "^2.1.0", "hardhat-ignore-warnings": "^0.2.11", @@ -9306,6 +9306,159 @@ "node": ">= 10" } }, + "node_modules/solidity-comments-darwin-x64": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-darwin-x64/-/solidity-comments-darwin-x64-0.0.2.tgz", + "integrity": "sha512-Zjs0Ruz6faBTPT6fBecUt6qh4CdloT8Bwoc0+qxRoTn9UhYscmbPQkUgQEbS0FQPysYqVzzxJB4h1Ofbf4wwtA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-freebsd-x64": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-freebsd-x64/-/solidity-comments-freebsd-x64-0.0.2.tgz", + "integrity": "sha512-8Qe4mpjuAxFSwZJVk7B8gAoLCdbtS412bQzBwk63L8dmlHogvE39iT70aAk3RHUddAppT5RMBunlPUCFYJ3ZTw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-linux-arm64-gnu": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-linux-arm64-gnu/-/solidity-comments-linux-arm64-gnu-0.0.2.tgz", + "integrity": "sha512-spkb0MZZnmrP+Wtq4UxP+nyPAVRe82idOjqndolcNR0S9Xvu4ebwq+LvF4HiUgjTDmeiqYiFZQ8T9KGdLSIoIg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-linux-arm64-musl": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-linux-arm64-musl/-/solidity-comments-linux-arm64-musl-0.0.2.tgz", + "integrity": "sha512-guCDbHArcjE+JDXYkxx5RZzY1YF6OnAKCo+sTC5fstyW/KGKaQJNPyBNWuwYsQiaEHpvhW1ha537IvlGek8GqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-linux-x64-gnu": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-linux-x64-gnu/-/solidity-comments-linux-x64-gnu-0.0.2.tgz", + "integrity": "sha512-zIqLehBK/g7tvrFmQljrfZXfkEeLt2v6wbe+uFu6kH/qAHZa7ybt8Vc0wYcmjo2U0PeBm15d79ee3AkwbIjFdQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-linux-x64-musl": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-linux-x64-musl/-/solidity-comments-linux-x64-musl-0.0.2.tgz", + "integrity": "sha512-R9FeDloVlFGTaVkOlELDVC7+1Tjx5WBPI5L8r0AGOPHK3+jOcRh6sKYpI+VskSPDc3vOO46INkpDgUXrKydlIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-win32-arm64-msvc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-win32-arm64-msvc/-/solidity-comments-win32-arm64-msvc-0.0.2.tgz", + "integrity": "sha512-QnWJoCQcJj+rnutULOihN9bixOtYWDdF5Rfz9fpHejL1BtNjdLW1om55XNVHGAHPqBxV4aeQQ6OirKnp9zKsug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-win32-ia32-msvc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-win32-ia32-msvc/-/solidity-comments-win32-ia32-msvc-0.0.2.tgz", + "integrity": "sha512-vUg4nADtm/NcOtlIymG23NWJUSuMsvX15nU7ynhGBsdKtt8xhdP3C/zA6vjDk8Jg+FXGQL6IHVQ++g/7rSQi0w==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/solidity-comments-win32-x64-msvc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/solidity-comments-win32-x64-msvc/-/solidity-comments-win32-x64-msvc-0.0.2.tgz", + "integrity": "sha512-36j+KUF4V/y0t3qatHm/LF5sCUCBx2UndxE1kq5bOzh/s+nQgatuyB+Pd5BfuPQHdWu2KaExYe20FlAa6NL7+Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/solidity-coverage": { "version": "0.8.15", "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.15.tgz", diff --git a/package.json b/package.json index 3462961972a..64ee144be16 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", - "hardhat": "^2.23.0", + "hardhat": "^2.22.7", "hardhat-exposed": "^0.3.15", "hardhat-gas-reporter": "^2.1.0", "hardhat-ignore-warnings": "^0.2.11", From 19fe4c525d96d9d8baa2b9bf48be25b3c0384b44 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 15:52:18 -0600 Subject: [PATCH 040/110] up --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1ac37124f2e..e1b7018388f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.6-beta.1", + "ethers": "6.13.6-beta.1", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", @@ -4483,9 +4483,9 @@ } }, "node_modules/ethers": { - "version": "6.13.7", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.7.tgz", - "integrity": "sha512-qbaJ0uIrjh+huP1Lad2f2QtzW5dcqSVjIzVH6yWB4dKoMuj2WqYz5aMeeQTCNpAKgTJBM5J9vcc2cYJ23UAimQ==", + "version": "6.13.6-beta.1", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.6-beta.1.tgz", + "integrity": "sha512-sJZklf+m7QrlzYnOFbR0qHPqgYHeevbY98VIhzvnSdzhJVN/nNV/skKc/4wjyxbWRhK9t7r6ENcwUwLPjfxTLw==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index 635290f6205..64ee144be16 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "chai": "^4.2.0", "eslint": "^9.0.0", "eslint-config-prettier": "^10.0.0", - "ethers": "^6.13.6-beta.1", + "ethers": "6.13.6-beta.1", "glob": "^11.0.0", "globals": "^16.0.0", "graphlib": "^2.1.8", From 11c42c30401cb6ca137d44210e3d5cc84af7cbc9 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 15:56:27 -0600 Subject: [PATCH 041/110] checks --- .github/workflows/checks.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6aca7f30cb4..3d8c50b52e2 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -119,6 +119,8 @@ jobs: - name: Set up environment uses: ./.github/actions/setup - uses: crytic/slither-action@v0.4.1 + with: + ignore-compile: true codespell: runs-on: ubuntu-latest From be6875359dc9329c524f60e528686d0d1e83902d Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 15:57:04 -0600 Subject: [PATCH 042/110] up --- contracts/mocks/account/AccountMock.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/mocks/account/AccountMock.sol b/contracts/mocks/account/AccountMock.sol index d7abd906691..f73f8a52ce1 100644 --- a/contracts/mocks/account/AccountMock.sol +++ b/contracts/mocks/account/AccountMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.27; import {Account} from "../../account/Account.sol"; import {AccountERC7579} from "../../account/extensions/AccountERC7579.sol"; From f0a1155af8fedcaa268ba182dc9b89b81bc9cb4a Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 16:01:33 -0600 Subject: [PATCH 043/110] build in slither --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 3d8c50b52e2..94e07a64879 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -118,6 +118,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up environment uses: ./.github/actions/setup + - run: npm run compile - uses: crytic/slither-action@v0.4.1 with: ignore-compile: true From c42a7fdfe69d13ea355f8bf1af230372c1c21ded Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 16:22:31 -0600 Subject: [PATCH 044/110] Update build command --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 94e07a64879..fb647e8519c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -118,7 +118,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up environment uses: ./.github/actions/setup - - run: npm run compile + - run: forge build - uses: crytic/slither-action@v0.4.1 with: ignore-compile: true From 6e576ca6138e05151d3fea066609d80efaeb3d9d Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 16:43:30 -0600 Subject: [PATCH 045/110] compile hardhat too --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index fb647e8519c..2bfe8b19a8d 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -119,6 +119,7 @@ jobs: - name: Set up environment uses: ./.github/actions/setup - run: forge build + - run: npm run compile - uses: crytic/slither-action@v0.4.1 with: ignore-compile: true From 593e87989f60d557290f0f030e158dde694848a0 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 17:45:51 -0600 Subject: [PATCH 046/110] revert slither changes --- .github/workflows/checks.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 2bfe8b19a8d..6aca7f30cb4 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -118,11 +118,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up environment uses: ./.github/actions/setup - - run: forge build - - run: npm run compile - uses: crytic/slither-action@v0.4.1 - with: - ignore-compile: true codespell: runs-on: ubuntu-latest From c3f39a10361ea00e1f0264bc606b65718e4ea1c1 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 17:49:22 -0600 Subject: [PATCH 047/110] Remove package-lock.json to skip installing dependencies --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6aca7f30cb4..07c62e64839 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -118,6 +118,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up environment uses: ./.github/actions/setup + - run: rm package-lock.json # Dependencies already installed - uses: crytic/slither-action@v0.4.1 codespell: From db76c3bc9f0ebb5fac5cb04108a680717c0683a5 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 17:52:18 -0600 Subject: [PATCH 048/110] up --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 07c62e64839..cab570955ed 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -118,7 +118,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up environment uses: ./.github/actions/setup - - run: rm package-lock.json # Dependencies already installed + - run: rm package-lock.json package.json # Dependencies already installed - uses: crytic/slither-action@v0.4.1 codespell: From 8eebff05659f9f5cd1429aee9be8b6092fdbd802 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 18:08:22 -0600 Subject: [PATCH 049/110] Add @custom:stateless tag --- contracts/account/Account.sol | 2 ++ contracts/account/extensions/ERC7821.sol | 2 ++ contracts/utils/cryptography/AbstractSigner.sol | 2 ++ contracts/utils/cryptography/SignerERC7702.sol | 2 ++ 4 files changed, 8 insertions(+) diff --git a/contracts/account/Account.sol b/contracts/account/Account.sol index 56c18c8bfa9..a58536df669 100644 --- a/contracts/account/Account.sol +++ b/contracts/account/Account.sol @@ -19,6 +19,8 @@ import {AbstractSigner} from "../utils/cryptography/AbstractSigner.sol"; * IMPORTANT: Implementing a mechanism to validate signatures is a security-sensitive operation as it may allow an * attacker to bypass the account's security measures. Check out {SignerECDSA}, {SignerP256}, or {SignerRSA} for * digital signature validation implementations. + * + * @custom:stateless */ abstract contract Account is AbstractSigner, IAccount { /** diff --git a/contracts/account/extensions/ERC7821.sol b/contracts/account/extensions/ERC7821.sol index a8f7c09e5d1..c442d868234 100644 --- a/contracts/account/extensions/ERC7821.sol +++ b/contracts/account/extensions/ERC7821.sol @@ -10,6 +10,8 @@ import {Account} from "../Account.sol"; * @dev Minimal batch executor following ERC-7821. * * Only supports supports single batch mode (`0x01000000000000000000`). Does not support optional "opData". + * + * @custom:stateless */ abstract contract ERC7821 is IERC7821 { using ERC7579Utils for *; diff --git a/contracts/utils/cryptography/AbstractSigner.sol b/contracts/utils/cryptography/AbstractSigner.sol index a85fdefe851..40803518c68 100644 --- a/contracts/utils/cryptography/AbstractSigner.sol +++ b/contracts/utils/cryptography/AbstractSigner.sol @@ -6,6 +6,8 @@ pragma solidity ^0.8.20; * @dev Abstract contract for signature validation. * * Developers must implement {_rawSignatureValidation} and use it as the lowest-level signature validation mechanism. + * + * @custom:stateless */ abstract contract AbstractSigner { /** diff --git a/contracts/utils/cryptography/SignerERC7702.sol b/contracts/utils/cryptography/SignerERC7702.sol index b413decbf59..baa2f2ac670 100644 --- a/contracts/utils/cryptography/SignerERC7702.sol +++ b/contracts/utils/cryptography/SignerERC7702.sol @@ -7,6 +7,8 @@ import {AbstractSigner} from "./AbstractSigner.sol"; /** * @dev Implementation of {AbstractSigner} for implementation for an EOA. Useful for ERC-7702 accounts. + * + * @custom:stateless */ abstract contract SignerERC7702 is AbstractSigner { /** From 65fa7de909a4c5fb4851fa7279181fdf88f2c7f4 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sat, 3 May 2025 00:16:18 -0600 Subject: [PATCH 050/110] update upgradeable.patch --- scripts/upgradeable/upgradeable.patch | 109 ++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 7 deletions(-) diff --git a/scripts/upgradeable/upgradeable.patch b/scripts/upgradeable/upgradeable.patch index 5d54ef4203e..4ab2c0ecc35 100644 --- a/scripts/upgradeable/upgradeable.patch +++ b/scripts/upgradeable/upgradeable.patch @@ -110,7 +110,7 @@ index 60d0a430a..0e4f91a6d 100644 } ``` diff --git a/contracts/package.json b/contracts/package.json -index 3682eadeb..4f870d094 100644 +index 70ae73bc2..99bc6f8b2 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,5 +1,5 @@ @@ -118,7 +118,7 @@ index 3682eadeb..4f870d094 100644 - "name": "@openzeppelin/contracts", + "name": "@openzeppelin/contracts-upgradeable", "description": "Secure Smart Contract library for Solidity", - "version": "5.2.0", + "version": "5.3.0", "files": [ @@ -13,7 +13,7 @@ }, @@ -136,11 +136,11 @@ index 3682eadeb..4f870d094 100644 - "homepage": "https://openzeppelin.com/contracts/" + "homepage": "https://openzeppelin.com/contracts/", + "peerDependencies": { -+ "@openzeppelin/contracts": "" ++ "@openzeppelin/contracts": "5.3.0" + } } diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol -index bcb67c87a..7195c3bbd 100644 +index c39954e35..aff99fe86 100644 --- a/contracts/utils/cryptography/EIP712.sol +++ b/contracts/utils/cryptography/EIP712.sol @@ -4,7 +4,6 @@ @@ -224,7 +224,7 @@ index bcb67c87a..7195c3bbd 100644 } /** -@@ -127,6 +108,10 @@ abstract contract EIP712 is IERC5267 { +@@ -125,6 +106,10 @@ abstract contract EIP712 is IERC5267 { uint256[] memory extensions ) { @@ -235,7 +235,7 @@ index bcb67c87a..7195c3bbd 100644 return ( hex"0f", // 01111 _EIP712Name(), -@@ -141,22 +126,62 @@ abstract contract EIP712 is IERC5267 { +@@ -139,22 +124,62 @@ abstract contract EIP712 is IERC5267 { /** * @dev The name parameter for the EIP712 domain. * @@ -309,7 +309,7 @@ index bcb67c87a..7195c3bbd 100644 } } diff --git a/package.json b/package.json -index f9e7d9205..c35020d51 100644 +index 64ee144be..f4665ac9b 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ @@ -329,6 +329,101 @@ index 304d1386a..a1cd63bee 100644 -@openzeppelin/contracts/=contracts/ +@openzeppelin/contracts-upgradeable/=contracts/ +@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ +diff --git a/scripts/upgradeable/upgradeable.patch b/scripts/upgradeable/upgradeable.patch +index 5d54ef420..334dd5a46 100644 +--- a/scripts/upgradeable/upgradeable.patch ++++ b/scripts/upgradeable/upgradeable.patch +@@ -110,7 +110,7 @@ index 60d0a430a..0e4f91a6d 100644 + } + ``` + diff --git a/contracts/package.json b/contracts/package.json +-index 3682eadeb..4f870d094 100644 ++index 70ae73bc2..ef659873f 100644 + --- a/contracts/package.json + +++ b/contracts/package.json + @@ -1,5 +1,5 @@ +@@ -118,7 +118,7 @@ index 3682eadeb..4f870d094 100644 + - "name": "@openzeppelin/contracts", + + "name": "@openzeppelin/contracts-upgradeable", + "description": "Secure Smart Contract library for Solidity", +- "version": "5.2.0", ++ "version": "5.3.0", + "files": [ + @@ -13,7 +13,7 @@ + }, +@@ -140,7 +140,7 @@ index 3682eadeb..4f870d094 100644 + + } + } + diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol +-index bcb67c87a..7195c3bbd 100644 ++index c39954e35..aff99fe86 100644 + --- a/contracts/utils/cryptography/EIP712.sol + +++ b/contracts/utils/cryptography/EIP712.sol + @@ -4,7 +4,6 @@ +@@ -224,7 +224,7 @@ index bcb67c87a..7195c3bbd 100644 + } + + /** +-@@ -127,6 +108,10 @@ abstract contract EIP712 is IERC5267 { ++@@ -125,6 +106,10 @@ abstract contract EIP712 is IERC5267 { + uint256[] memory extensions + ) + { +@@ -235,7 +235,7 @@ index bcb67c87a..7195c3bbd 100644 + return ( + hex"0f", // 01111 + _EIP712Name(), +-@@ -141,22 +126,62 @@ abstract contract EIP712 is IERC5267 { ++@@ -139,22 +124,62 @@ abstract contract EIP712 is IERC5267 { + /** + * @dev The name parameter for the EIP712 domain. + * +@@ -309,7 +309,7 @@ index bcb67c87a..7195c3bbd 100644 + } + } + diff --git a/package.json b/package.json +-index f9e7d9205..c35020d51 100644 ++index 64ee144be..f4665ac9b 100644 + --- a/package.json + +++ b/package.json + @@ -34,7 +34,7 @@ +@@ -329,6 +329,21 @@ index 304d1386a..a1cd63bee 100644 + -@openzeppelin/contracts/=contracts/ + +@openzeppelin/contracts-upgradeable/=contracts/ + +@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ ++diff --git a/test/account/AccountERC7702.test.js b/test/account/AccountERC7702.test.js ++index d08a52209..391c200fb 100644 ++--- a/test/account/AccountERC7702.test.js +++++ b/test/account/AccountERC7702.test.js ++@@ -26,8 +26,8 @@ async function fixture() { ++ ++ // domain cannot be fetched using getDomain(mock) before the mock is deployed ++ const domain = { ++- name: 'AccountERC7702Mock', ++- version: '1', +++ name: '', +++ version: '', ++ chainId: entrypointDomain.chainId, ++ verifyingContract: mock.address, ++ }; + diff --git a/test/utils/cryptography/EIP712.test.js b/test/utils/cryptography/EIP712.test.js + index 2b6e7fa97..268e0d29d 100644 + --- a/test/utils/cryptography/EIP712.test.js +diff --git a/test/account/AccountERC7702.test.js b/test/account/AccountERC7702.test.js +index d08a52209..7a44bccfe 100644 +--- a/test/account/AccountERC7702.test.js ++++ b/test/account/AccountERC7702.test.js +@@ -26,8 +26,8 @@ async function fixture() { + + // domain cannot be fetched using getDomain(mock) before the mock is deployed + const domain = { +- name: 'AccountERC7702Mock', +- version: '1', ++ name: '', // Not initialized in the context of signer ++ version: '', // Not initialized in the context of signer + chainId: entrypointDomain.chainId, + verifyingContract: mock.address, + }; diff --git a/test/utils/cryptography/EIP712.test.js b/test/utils/cryptography/EIP712.test.js index 2b6e7fa97..268e0d29d 100644 --- a/test/utils/cryptography/EIP712.test.js From abac3bd61f30122abbf9b0cc29ffd12b0479b2d6 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sat, 3 May 2025 00:17:43 -0600 Subject: [PATCH 051/110] fix conflicts --- scripts/upgradeable/upgradeable.patch | 80 --------------------------- 1 file changed, 80 deletions(-) diff --git a/scripts/upgradeable/upgradeable.patch b/scripts/upgradeable/upgradeable.patch index 4ab2c0ecc35..efba37b4298 100644 --- a/scripts/upgradeable/upgradeable.patch +++ b/scripts/upgradeable/upgradeable.patch @@ -329,86 +329,6 @@ index 304d1386a..a1cd63bee 100644 -@openzeppelin/contracts/=contracts/ +@openzeppelin/contracts-upgradeable/=contracts/ +@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ -diff --git a/scripts/upgradeable/upgradeable.patch b/scripts/upgradeable/upgradeable.patch -index 5d54ef420..334dd5a46 100644 ---- a/scripts/upgradeable/upgradeable.patch -+++ b/scripts/upgradeable/upgradeable.patch -@@ -110,7 +110,7 @@ index 60d0a430a..0e4f91a6d 100644 - } - ``` - diff --git a/contracts/package.json b/contracts/package.json --index 3682eadeb..4f870d094 100644 -+index 70ae73bc2..ef659873f 100644 - --- a/contracts/package.json - +++ b/contracts/package.json - @@ -1,5 +1,5 @@ -@@ -118,7 +118,7 @@ index 3682eadeb..4f870d094 100644 - - "name": "@openzeppelin/contracts", - + "name": "@openzeppelin/contracts-upgradeable", - "description": "Secure Smart Contract library for Solidity", -- "version": "5.2.0", -+ "version": "5.3.0", - "files": [ - @@ -13,7 +13,7 @@ - }, -@@ -140,7 +140,7 @@ index 3682eadeb..4f870d094 100644 - + } - } - diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol --index bcb67c87a..7195c3bbd 100644 -+index c39954e35..aff99fe86 100644 - --- a/contracts/utils/cryptography/EIP712.sol - +++ b/contracts/utils/cryptography/EIP712.sol - @@ -4,7 +4,6 @@ -@@ -224,7 +224,7 @@ index bcb67c87a..7195c3bbd 100644 - } - - /** --@@ -127,6 +108,10 @@ abstract contract EIP712 is IERC5267 { -+@@ -125,6 +106,10 @@ abstract contract EIP712 is IERC5267 { - uint256[] memory extensions - ) - { -@@ -235,7 +235,7 @@ index bcb67c87a..7195c3bbd 100644 - return ( - hex"0f", // 01111 - _EIP712Name(), --@@ -141,22 +126,62 @@ abstract contract EIP712 is IERC5267 { -+@@ -139,22 +124,62 @@ abstract contract EIP712 is IERC5267 { - /** - * @dev The name parameter for the EIP712 domain. - * -@@ -309,7 +309,7 @@ index bcb67c87a..7195c3bbd 100644 - } - } - diff --git a/package.json b/package.json --index f9e7d9205..c35020d51 100644 -+index 64ee144be..f4665ac9b 100644 - --- a/package.json - +++ b/package.json - @@ -34,7 +34,7 @@ -@@ -329,6 +329,21 @@ index 304d1386a..a1cd63bee 100644 - -@openzeppelin/contracts/=contracts/ - +@openzeppelin/contracts-upgradeable/=contracts/ - +@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ -+diff --git a/test/account/AccountERC7702.test.js b/test/account/AccountERC7702.test.js -+index d08a52209..391c200fb 100644 -+--- a/test/account/AccountERC7702.test.js -++++ b/test/account/AccountERC7702.test.js -+@@ -26,8 +26,8 @@ async function fixture() { -+ -+ // domain cannot be fetched using getDomain(mock) before the mock is deployed -+ const domain = { -+- name: 'AccountERC7702Mock', -+- version: '1', -++ name: '', -++ version: '', -+ chainId: entrypointDomain.chainId, -+ verifyingContract: mock.address, -+ }; - diff --git a/test/utils/cryptography/EIP712.test.js b/test/utils/cryptography/EIP712.test.js - index 2b6e7fa97..268e0d29d 100644 - --- a/test/utils/cryptography/EIP712.test.js diff --git a/test/account/AccountERC7702.test.js b/test/account/AccountERC7702.test.js index d08a52209..7a44bccfe 100644 --- a/test/account/AccountERC7702.test.js From 7d120b9520344673b7956a3673c1932c1051b985 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sat, 3 May 2025 00:19:53 -0600 Subject: [PATCH 052/110] rollback --- scripts/upgradeable/upgradeable.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgradeable/upgradeable.patch b/scripts/upgradeable/upgradeable.patch index efba37b4298..20c463a3f65 100644 --- a/scripts/upgradeable/upgradeable.patch +++ b/scripts/upgradeable/upgradeable.patch @@ -110,7 +110,7 @@ index 60d0a430a..0e4f91a6d 100644 } ``` diff --git a/contracts/package.json b/contracts/package.json -index 70ae73bc2..99bc6f8b2 100644 +index 70ae73bc2..ef659873f 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,5 +1,5 @@ @@ -136,7 +136,7 @@ index 70ae73bc2..99bc6f8b2 100644 - "homepage": "https://openzeppelin.com/contracts/" + "homepage": "https://openzeppelin.com/contracts/", + "peerDependencies": { -+ "@openzeppelin/contracts": "5.3.0" ++ "@openzeppelin/contracts": "" + } } diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol From 02eccc1938766c38be02adfe1af539db25edb56f Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sat, 3 May 2025 00:21:56 -0600 Subject: [PATCH 053/110] update upgradeable.patch --- scripts/upgradeable/upgradeable.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/upgradeable/upgradeable.patch b/scripts/upgradeable/upgradeable.patch index 20c463a3f65..66cbdce8334 100644 --- a/scripts/upgradeable/upgradeable.patch +++ b/scripts/upgradeable/upgradeable.patch @@ -340,6 +340,21 @@ index d08a52209..7a44bccfe 100644 - name: 'AccountERC7702Mock', - version: '1', + name: '', // Not initialized in the context of signer ++ version: '', // Not initialized in the context of signer + chainId: entrypointDomain.chainId, + verifyingContract: mock.address, + }; +diff --git a/test/account/examples/AccountERC7702WithModulesMock.test.js b/test/account/examples/AccountERC7702WithModulesMock.test.js +index 9ee5f9177..f6106bcc7 100644 +--- a/test/account/examples/AccountERC7702WithModulesMock.test.js ++++ b/test/account/examples/AccountERC7702WithModulesMock.test.js +@@ -36,8 +36,8 @@ async function fixture() { + + // domain cannot be fetched using getDomain(mock) before the mock is deployed + const domain = { +- name: 'AccountERC7702WithModulesMock', +- version: '1', ++ name: '', // Not initialized in the context of signer + version: '', // Not initialized in the context of signer chainId: entrypointDomain.chainId, verifyingContract: mock.address, From c39d5f5755c64b3c0ff7fc666c615e58f6135f2a Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sat, 3 May 2025 00:43:58 -0600 Subject: [PATCH 054/110] Tweak workflows --- .github/actions/setup/action.yml | 3 ++- .github/workflows/checks.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 3c5fc602e13..fe8a85b3f55 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -13,7 +13,8 @@ runs: path: '**/node_modules' key: npm-v3-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - run: npm ci + ## TODO: Remove when EIP-7702 authorizations are enabled in latest non-beta ethers version + run: npm ci --legacy-peer-deps shell: bash if: steps.cache.outputs.cache-hit != 'true' - name: Install Foundry diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6aca7f30cb4..cba9894b3b9 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -118,6 +118,8 @@ jobs: - uses: actions/checkout@v4 - name: Set up environment uses: ./.github/actions/setup + ## TODO: Remove when EIP-7702 authorizations are enabled in latest non-beta ethers version + - run: rm package-lock.json package.json # Dependencies already installed - uses: crytic/slither-action@v0.4.1 codespell: From 54f632a588bd9b306d42c51d3e7613625809b665 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sat, 3 May 2025 00:46:34 -0600 Subject: [PATCH 055/110] Use Solidity 0.8.27 as default and set default EVM to prague --- foundry.toml | 2 +- hardhat.config.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/foundry.toml b/foundry.toml index 7a2e8a60942..ea8b1fadd88 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,5 +1,5 @@ [profile.default] -solc_version = '0.8.24' +solc_version = '0.8.27' evm_version = 'prague' optimizer = true optimizer-runs = 200 diff --git a/hardhat.config.js b/hardhat.config.js index 30c19ca6d5b..17ebf45eeb7 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -18,7 +18,7 @@ const { argv } = require('yargs/yargs')() compiler: { alias: 'compileVersion', type: 'string', - default: '0.8.24', + default: '0.8.27', }, src: { alias: 'source', @@ -38,7 +38,7 @@ const { argv } = require('yargs/yargs')() evm: { alias: 'evmVersion', type: 'string', - default: 'cancun', + default: 'prague', }, // Extra modules coverage: { From 58c794e3f4caf91421cd4d643b5465dd513e282f Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sat, 3 May 2025 01:04:29 -0600 Subject: [PATCH 056/110] Adjust ERC2771Forwarder gas to avoid GasFloorMoreThanGasLimit --- test/metatx/ERC2771Forwarder.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/metatx/ERC2771Forwarder.test.js b/test/metatx/ERC2771Forwarder.test.js index bf6cfd10c4b..07682c18747 100644 --- a/test/metatx/ERC2771Forwarder.test.js +++ b/test/metatx/ERC2771Forwarder.test.js @@ -174,7 +174,7 @@ describe('ERC2771Forwarder', function () { // Because the relayer call consumes gas until the `CALL` opcode, the gas left after failing // the subcall won't enough to finish the top level call (after testing), so we add a // moderated buffer. - const gasLimit = estimate + 2_000n; + const gasLimit = estimate + 10_000n; // The subcall out of gas should be caught by the contract and then bubbled up consuming // the available gas with an `invalid` opcode. From 6a60523c837b473fd7f795927d4dc6289ee2a3b8 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sat, 3 May 2025 01:05:36 -0600 Subject: [PATCH 057/110] Remove console.log --- test/metatx/ERC2771Forwarder.test.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/metatx/ERC2771Forwarder.test.js b/test/metatx/ERC2771Forwarder.test.js index f3fa0eb819e..07682c18747 100644 --- a/test/metatx/ERC2771Forwarder.test.js +++ b/test/metatx/ERC2771Forwarder.test.js @@ -176,8 +176,6 @@ describe('ERC2771Forwarder', function () { // moderated buffer. const gasLimit = estimate + 10_000n; - console.log(estimate); - // The subcall out of gas should be caught by the contract and then bubbled up consuming // the available gas with an `invalid` opcode. await expect(this.forwarder.execute(request, { gasLimit })).to.be.revertedWithoutReason(); From 80edba8c438f178af37adef73c8a17559f28e4ab Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 01:42:11 -0600 Subject: [PATCH 058/110] Add EnumerableSetExtended and EnumerableMapExtended --- contracts/utils/README.adoc | 5 + .../utils/structs/EnumerableMapExtended.sol | 287 ++++++++++++ .../utils/structs/EnumerableSetExtended.sol | 422 ++++++++++++++++++ scripts/generate/run.js | 2 + scripts/generate/templates/Enumerable.opts.js | 64 +++ scripts/generate/templates/EnumerableMap.js | 4 +- .../generate/templates/EnumerableMap.opts.js | 19 - .../templates/EnumerableMapExtended.js | 179 ++++++++ scripts/generate/templates/EnumerableSet.js | 4 +- .../generate/templates/EnumerableSet.opts.js | 12 - .../templates/EnumerableSetExtended.js | 319 +++++++++++++ test/utils/structs/EnumerableMap.test.js | 8 +- .../structs/EnumerableMapExtended.test.js | 66 +++ test/utils/structs/EnumerableSet.test.js | 6 +- .../structs/EnumerableSetExtended.test.js | 62 +++ 15 files changed, 1417 insertions(+), 42 deletions(-) create mode 100644 contracts/utils/structs/EnumerableMapExtended.sol create mode 100644 contracts/utils/structs/EnumerableSetExtended.sol create mode 100644 scripts/generate/templates/Enumerable.opts.js delete mode 100644 scripts/generate/templates/EnumerableMap.opts.js create mode 100644 scripts/generate/templates/EnumerableMapExtended.js delete mode 100644 scripts/generate/templates/EnumerableSet.opts.js create mode 100644 scripts/generate/templates/EnumerableSetExtended.js create mode 100644 test/utils/structs/EnumerableMapExtended.test.js create mode 100644 test/utils/structs/EnumerableSetExtended.test.js diff --git a/contracts/utils/README.adoc b/contracts/utils/README.adoc index 2810a5772bf..b77398ff6a7 100644 --- a/contracts/utils/README.adoc +++ b/contracts/utils/README.adoc @@ -23,6 +23,7 @@ Miscellaneous contracts and libraries containing utility functions you can use t * {BitMaps}: A simple library to manage boolean value mapped to a numerical index in an efficient way. * {EnumerableMap}: A type like Solidity's https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`], but with key-value _enumeration_: this will let you know how many entries a mapping has, and iterate over them (which is not possible with `mapping`). * {EnumerableSet}: Like {EnumerableMap}, but for https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets]. Can be used to store privileged accounts, issued IDs, etc. + * {EnumerableSetExtended} and {EnumerableMapExtended}: Extensions of the `EnumerableSet` and `EnumerableMap` libraries with more types, including non-value types. * {DoubleEndedQueue}: An implementation of a https://en.wikipedia.org/wiki/Double-ended_queue[double ended queue] whose values can be added or removed from both sides. Useful for FIFO and LIFO structures. * {CircularBuffer}: A data structure to store the last N values pushed to it. * {Checkpoints}: A data structure to store values mapped to a strictly increasing key. Can be used for storing and accessing values over time. @@ -129,8 +130,12 @@ Ethereum contracts have no native concept of an interface, so applications must {{EnumerableMap}} +{{EnumerableMapExtended}} + {{EnumerableSet}} +{{EnumerableSetExtended}} + {{DoubleEndedQueue}} {{CircularBuffer}} diff --git a/contracts/utils/structs/EnumerableMapExtended.sol b/contracts/utils/structs/EnumerableMapExtended.sol new file mode 100644 index 00000000000..31dd512afd5 --- /dev/null +++ b/contracts/utils/structs/EnumerableMapExtended.sol @@ -0,0 +1,287 @@ +// SPDX-License-Identifier: MIT +// This file was procedurally generated from scripts/generate/templates/EnumerableMapExtended.js. + +pragma solidity ^0.8.20; + +import {EnumerableSet} from "./EnumerableSet.sol"; +import {EnumerableSetExtended} from "./EnumerableSetExtended.sol"; + +/** + * @dev Library for managing an enumerable variant of Solidity's + * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] + * type for non-value types as keys. + * + * Maps have the following properties: + * + * - Entries are added, removed, and checked for existence in constant time + * (O(1)). + * - Entries are enumerated in O(n). No guarantees are made on the ordering. + * - Map can be cleared (all entries removed) in O(n). + * + * ```solidity + * contract Example { + * // Add the library methods + * using EnumerableMapExtended for EnumerableMapExtended.BytesToUintMap; + * + * // Declare a set state variable + * EnumerableMapExtended.BytesToUintMap private myMap; + * } + * ``` + * + * The following map types are supported: + * + * - `bytes -> uint256` (`BytesToUintMap`) + * - `string -> string` (`StringToStringMap`) + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure + * unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an + * array of EnumerableMap. + * ==== + * + * NOTE: Extensions of {EnumerableMap} + */ +library EnumerableMapExtended { + using EnumerableSet for *; + using EnumerableSetExtended for *; + + /** + * @dev Query for a nonexistent map key. + */ + error EnumerableMapNonexistentBytesKey(bytes key); + + struct BytesToUintMap { + // Storage of keys + EnumerableSetExtended.BytesSet _keys; + mapping(bytes key => uint256) _values; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set(BytesToUintMap storage map, bytes memory key, uint256 value) internal returns (bool) { + map._values[key] = value; + return map._keys.add(key); + } + + /** + * @dev Removes a key-value pair from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(BytesToUintMap storage map, bytes memory key) internal returns (bool) { + delete map._values[key]; + return map._keys.remove(key); + } + + /** + * @dev Removes all the entries from a map. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(BytesToUintMap storage map) internal { + uint256 len = length(map); + for (uint256 i = 0; i < len; ++i) { + delete map._values[map._keys.at(i)]; + } + map._keys.clear(); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(BytesToUintMap storage map, bytes memory key) internal view returns (bool) { + return map._keys.contains(key); + } + + /** + * @dev Returns the number of key-value pairs in the map. O(1). + */ + function length(BytesToUintMap storage map) internal view returns (uint256) { + return map._keys.length(); + } + + /** + * @dev Returns the key-value pair stored at position `index` in the map. O(1). + * + * Note that there are no guarantees on the ordering of entries inside the + * array, and it may change when more entries are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at( + BytesToUintMap storage map, + uint256 index + ) internal view returns (bytes memory key, uint256 value) { + key = map._keys.at(index); + value = map._values[key]; + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet( + BytesToUintMap storage map, + bytes memory key + ) internal view returns (bool exists, uint256 value) { + value = map._values[key]; + exists = value != uint256(0) || contains(map, key); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(BytesToUintMap storage map, bytes memory key) internal view returns (uint256 value) { + bool exists; + (exists, value) = tryGet(map, key); + if (!exists) { + revert EnumerableMapNonexistentBytesKey(key); + } + } + + /** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function keys(BytesToUintMap storage map) internal view returns (bytes[] memory) { + return map._keys.values(); + } + + /** + * @dev Query for a nonexistent map key. + */ + error EnumerableMapNonexistentStringKey(string key); + + struct StringToStringMap { + // Storage of keys + EnumerableSetExtended.StringSet _keys; + mapping(string key => string) _values; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set(StringToStringMap storage map, string memory key, string memory value) internal returns (bool) { + map._values[key] = value; + return map._keys.add(key); + } + + /** + * @dev Removes a key-value pair from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(StringToStringMap storage map, string memory key) internal returns (bool) { + delete map._values[key]; + return map._keys.remove(key); + } + + /** + * @dev Removes all the entries from a map. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(StringToStringMap storage map) internal { + uint256 len = length(map); + for (uint256 i = 0; i < len; ++i) { + delete map._values[map._keys.at(i)]; + } + map._keys.clear(); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(StringToStringMap storage map, string memory key) internal view returns (bool) { + return map._keys.contains(key); + } + + /** + * @dev Returns the number of key-value pairs in the map. O(1). + */ + function length(StringToStringMap storage map) internal view returns (uint256) { + return map._keys.length(); + } + + /** + * @dev Returns the key-value pair stored at position `index` in the map. O(1). + * + * Note that there are no guarantees on the ordering of entries inside the + * array, and it may change when more entries are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at( + StringToStringMap storage map, + uint256 index + ) internal view returns (string memory key, string memory value) { + key = map._keys.at(index); + value = map._values[key]; + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet( + StringToStringMap storage map, + string memory key + ) internal view returns (bool exists, string memory value) { + value = map._values[key]; + exists = bytes(value).length != 0 || contains(map, key); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(StringToStringMap storage map, string memory key) internal view returns (string memory value) { + bool exists; + (exists, value) = tryGet(map, key); + if (!exists) { + revert EnumerableMapNonexistentStringKey(key); + } + } + + /** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function keys(StringToStringMap storage map) internal view returns (string[] memory) { + return map._keys.values(); + } +} diff --git a/contracts/utils/structs/EnumerableSetExtended.sol b/contracts/utils/structs/EnumerableSetExtended.sol new file mode 100644 index 00000000000..82f3ae9da76 --- /dev/null +++ b/contracts/utils/structs/EnumerableSetExtended.sol @@ -0,0 +1,422 @@ +// SPDX-License-Identifier: MIT +// This file was procedurally generated from scripts/generate/templates/EnumerableSetExtended.js. + +pragma solidity ^0.8.20; + +import {Hashes} from "../cryptography/Hashes.sol"; + +/** + * @dev Library for managing + * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of non-value + * types. + * + * Sets have the following properties: + * + * - Elements are added, removed, and checked for existence in constant time + * (O(1)). + * - Elements are enumerated in O(n). No guarantees are made on the ordering. + * - Set can be cleared (all elements removed) in O(n). + * + * ```solidity + * contract Example { + * // Add the library methods + * using EnumerableSetExtended for EnumerableSetExtended.StringSet; + * + * // Declare a set state variable + * EnumerableSetExtended.StringSet private mySet; + * } + * ``` + * + * Sets of type `string` (`StringSet`), `bytes` (`BytesSet`) and + * `bytes32[2]` (`Bytes32x2Set`) are supported. + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure + * unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an + * array of EnumerableSet. + * ==== + * + * NOTE: This is an extension of {EnumerableSet}. + */ +library EnumerableSetExtended { + struct StringSet { + // Storage of set values + string[] _values; + // Position is the index of the value in the `values` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(string value => uint256) _positions; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(StringSet storage self, string memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[value] = self._values.length; + return true; + } else { + return false; + } + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(StringSet storage self, string memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + uint256 position = self._positions[value]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + string memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[lastValue] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[value]; + + return true; + } else { + return false; + } + } + + /** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(StringSet storage set) internal { + uint256 len = length(set); + for (uint256 i = 0; i < len; ++i) { + delete set._positions[set._values[i]]; + } + // Replace when these are available in Arrays.sol + string[] storage array = set._values; + assembly ("memory-safe") { + sstore(array.slot, 0) + } + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(StringSet storage self, string memory value) internal view returns (bool) { + return self._positions[value] != 0; + } + + /** + * @dev Returns the number of values on the set. O(1). + */ + function length(StringSet storage self) internal view returns (uint256) { + return self._values.length; + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(StringSet storage self, uint256 index) internal view returns (string memory) { + return self._values[index]; + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(StringSet storage self) internal view returns (string[] memory) { + return self._values; + } + + struct BytesSet { + // Storage of set values + bytes[] _values; + // Position is the index of the value in the `values` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(bytes value => uint256) _positions; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(BytesSet storage self, bytes memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[value] = self._values.length; + return true; + } else { + return false; + } + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(BytesSet storage self, bytes memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + uint256 position = self._positions[value]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + bytes memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[lastValue] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[value]; + + return true; + } else { + return false; + } + } + + /** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(BytesSet storage set) internal { + uint256 len = length(set); + for (uint256 i = 0; i < len; ++i) { + delete set._positions[set._values[i]]; + } + // Replace when these are available in Arrays.sol + bytes[] storage array = set._values; + assembly ("memory-safe") { + sstore(array.slot, 0) + } + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(BytesSet storage self, bytes memory value) internal view returns (bool) { + return self._positions[value] != 0; + } + + /** + * @dev Returns the number of values on the set. O(1). + */ + function length(BytesSet storage self) internal view returns (uint256) { + return self._values.length; + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(BytesSet storage self, uint256 index) internal view returns (bytes memory) { + return self._values[index]; + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(BytesSet storage self) internal view returns (bytes[] memory) { + return self._values; + } + + struct Bytes32x2Set { + // Storage of set values + bytes32[2][] _values; + // Position is the index of the value in the `values` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(bytes32 valueHash => uint256) _positions; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[_hash(value)] = self._values.length; + return true; + } else { + return false; + } + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + bytes32 valueHash = _hash(value); + uint256 position = self._positions[valueHash]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + bytes32[2] memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[_hash(lastValue)] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[valueHash]; + + return true; + } else { + return false; + } + } + + /** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(Bytes32x2Set storage self) internal { + bytes32[2][] storage v = self._values; + + uint256 len = length(self); + for (uint256 i = 0; i < len; ++i) { + delete self._positions[_hash(v[i])]; + } + assembly ("memory-safe") { + sstore(v.slot, 0) + } + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(Bytes32x2Set storage self, bytes32[2] memory value) internal view returns (bool) { + return self._positions[_hash(value)] != 0; + } + + /** + * @dev Returns the number of values on the set. O(1). + */ + function length(Bytes32x2Set storage self) internal view returns (uint256) { + return self._values.length; + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(Bytes32x2Set storage self, uint256 index) internal view returns (bytes32[2] memory) { + return self._values[index]; + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(Bytes32x2Set storage self) internal view returns (bytes32[2][] memory) { + return self._values; + } + + function _hash(bytes32[2] memory value) private pure returns (bytes32) { + return Hashes.efficientKeccak256(value[0], value[1]); + } +} diff --git a/scripts/generate/run.js b/scripts/generate/run.js index 6779c93f44b..a2f89e16e54 100755 --- a/scripts/generate/run.js +++ b/scripts/generate/run.js @@ -44,6 +44,8 @@ for (const [file, template] of Object.entries({ 'utils/Packing.sol': './templates/Packing.js', 'mocks/StorageSlotMock.sol': './templates/StorageSlotMock.js', 'mocks/TransientSlotMock.sol': './templates/TransientSlotMock.js', + 'utils/structs/EnumerableSetExtended.sol': './templates/EnumerableSetExtended.js', + 'utils/structs/EnumerableMapExtended.sol': './templates/EnumerableMapExtended.js', })) { generateFromTemplate(file, template, './contracts/'); } diff --git a/scripts/generate/templates/Enumerable.opts.js b/scripts/generate/templates/Enumerable.opts.js new file mode 100644 index 00000000000..cad0f4d7908 --- /dev/null +++ b/scripts/generate/templates/Enumerable.opts.js @@ -0,0 +1,64 @@ +const { capitalize, mapValues } = require('../../helpers'); + +const mapType = str => (str == 'uint256' ? 'Uint' : capitalize(str)); + +const formatSetType = type => ({ name: `${mapType(type)}Set`, type }); + +const SET_TYPES = ['bytes32', 'address', 'uint256'].map(formatSetType); + +const formatMapType = (keyType, valueType) => ({ + name: `${mapType(keyType)}To${mapType(valueType)}Map`, + keyType, + valueType, +}); + +const MAP_TYPES = ['uint256', 'address', 'bytes32'] + .flatMap((key, _, array) => array.map(value => [key, value])) + .slice(0, -1) // remove bytes32 → byte32 (last one) that is already defined + .map(args => formatMapType(...args)); + +const extendedTypeDescr = ({ type, size = 0, memory = false }) => { + memory |= size > 0; + + const name = [type == 'uint256' ? 'Uint' : capitalize(type), size].filter(Boolean).join('x'); + const base = size ? type : undefined; + const typeFull = size ? `${type}[${size}]` : type; + const typeLoc = memory ? `${typeFull} memory` : typeFull; + return { name, type: typeFull, typeLoc, base, size, memory }; +}; + +const toExtendedSetTypeDescr = value => ({ name: value.name + 'Set', value }); + +const toExtendedMapTypeDescr = ({ key, value }) => ({ + name: `${key.name}To${value.name}Map`, + keySet: toExtendedSetTypeDescr(key), + key, + value, +}); + +const EXTENDED_SET_TYPES = [ + { type: 'bytes32', size: 2 }, + { type: 'string', memory: true }, + { type: 'bytes', memory: true }, +] + .map(extendedTypeDescr) + .map(toExtendedSetTypeDescr); + +const EXTENDED_MAP_TYPES = [ + { key: { type: 'bytes', memory: true }, value: { type: 'uint256' } }, + { key: { type: 'string', memory: true }, value: { type: 'string', memory: true } }, +] + .map(entry => mapValues(entry, extendedTypeDescr)) + .map(toExtendedMapTypeDescr); + +module.exports = { + SET_TYPES, + MAP_TYPES, + EXTENDED_SET_TYPES, + EXTENDED_MAP_TYPES, + formatSetType, + formatMapType, + extendedTypeDescr, + toExtendedSetTypeDescr, + toExtendedMapTypeDescr, +}; diff --git a/scripts/generate/templates/EnumerableMap.js b/scripts/generate/templates/EnumerableMap.js index 284e5ac0281..8879c7a4b11 100644 --- a/scripts/generate/templates/EnumerableMap.js +++ b/scripts/generate/templates/EnumerableMap.js @@ -1,6 +1,6 @@ const format = require('../format-lines'); const { fromBytes32, toBytes32 } = require('./conversion'); -const { TYPES } = require('./EnumerableMap.opts'); +const { MAP_TYPES } = require('./Enumerable.opts'); const header = `\ pragma solidity ^0.8.20; @@ -290,7 +290,7 @@ module.exports = format( 'using EnumerableSet for EnumerableSet.Bytes32Set;', '', defaultMap, - TYPES.map(details => customMap(details)), + MAP_TYPES.map(details => customMap(details)), ), ).trimEnd(), '}', diff --git a/scripts/generate/templates/EnumerableMap.opts.js b/scripts/generate/templates/EnumerableMap.opts.js deleted file mode 100644 index d26ab05b2ac..00000000000 --- a/scripts/generate/templates/EnumerableMap.opts.js +++ /dev/null @@ -1,19 +0,0 @@ -const { capitalize } = require('../../helpers'); - -const mapType = str => (str == 'uint256' ? 'Uint' : capitalize(str)); - -const formatType = (keyType, valueType) => ({ - name: `${mapType(keyType)}To${mapType(valueType)}Map`, - keyType, - valueType, -}); - -const TYPES = ['uint256', 'address', 'bytes32'] - .flatMap((key, _, array) => array.map(value => [key, value])) - .slice(0, -1) // remove bytes32 → byte32 (last one) that is already defined - .map(args => formatType(...args)); - -module.exports = { - TYPES, - formatType, -}; diff --git a/scripts/generate/templates/EnumerableMapExtended.js b/scripts/generate/templates/EnumerableMapExtended.js new file mode 100644 index 00000000000..b1b55278974 --- /dev/null +++ b/scripts/generate/templates/EnumerableMapExtended.js @@ -0,0 +1,179 @@ +const format = require('../format-lines'); +const { EXTENDED_SET_TYPES, EXTENDED_MAP_TYPES } = require('./Enumerable.opts'); + +const header = `\ +pragma solidity ^0.8.20; + +import {EnumerableSet} from "./EnumerableSet.sol"; +import {EnumerableSetExtended} from "./EnumerableSetExtended.sol"; + +/** + * @dev Library for managing an enumerable variant of Solidity's + * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[\`mapping\`] + * type for non-value types as keys. + * + * Maps have the following properties: + * + * - Entries are added, removed, and checked for existence in constant time + * (O(1)). + * - Entries are enumerated in O(n). No guarantees are made on the ordering. + * - Map can be cleared (all entries removed) in O(n). + * + * \`\`\`solidity + * contract Example { + * // Add the library methods + * using EnumerableMapExtended for EnumerableMapExtended.BytesToUintMap; + * + * // Declare a set state variable + * EnumerableMapExtended.BytesToUintMap private myMap; + * } + * \`\`\` + * + * The following map types are supported: + * + * - \`bytes -> uint256\` (\`BytesToUintMap\`) + * - \`string -> string\` (\`StringToStringMap\`) + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure + * unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an + * array of EnumerableMap. + * ==== + * + * NOTE: Extensions of {EnumerableMap} + */ +`; + +const map = ({ name, keySet, key, value }) => `\ +/** + * @dev Query for a nonexistent map key. + */ +error EnumerableMapNonexistent${key.name}Key(${key.type} key); + +struct ${name} { + // Storage of keys + ${EXTENDED_SET_TYPES.some(el => el.name == keySet.name) ? 'EnumerableSetExtended' : 'EnumerableSet'}.${keySet.name} _keys; + mapping(${key.type} key => ${value.type}) _values; +} + +/** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ +function set(${name} storage map, ${key.typeLoc} key, ${value.typeLoc} value) internal returns (bool) { + map._values[key] = value; + return map._keys.add(key); +} + +/** + * @dev Removes a key-value pair from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ +function remove(${name} storage map, ${key.typeLoc} key) internal returns (bool) { + delete map._values[key]; + return map._keys.remove(key); +} + +/** + * @dev Removes all the entries from a map. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. + */ +function clear(${name} storage map) internal { + uint256 len = length(map); + for (uint256 i = 0; i < len; ++i) { + delete map._values[map._keys.at(i)]; + } + map._keys.clear(); +} + +/** + * @dev Returns true if the key is in the map. O(1). + */ +function contains(${name} storage map, ${key.typeLoc} key) internal view returns (bool) { + return map._keys.contains(key); +} + +/** + * @dev Returns the number of key-value pairs in the map. O(1). + */ +function length(${name} storage map) internal view returns (uint256) { + return map._keys.length(); +} + +/** + * @dev Returns the key-value pair stored at position \`index\` in the map. O(1). + * + * Note that there are no guarantees on the ordering of entries inside the + * array, and it may change when more entries are added or removed. + * + * Requirements: + * + * - \`index\` must be strictly less than {length}. + */ +function at( + ${name} storage map, + uint256 index +) internal view returns (${key.typeLoc} key, ${value.typeLoc} value) { + key = map._keys.at(index); + value = map._values[key]; +} + +/** + * @dev Tries to returns the value associated with \`key\`. O(1). + * Does not revert if \`key\` is not in the map. + */ +function tryGet( + ${name} storage map, + ${key.typeLoc} key +) internal view returns (bool exists, ${value.typeLoc} value) { + value = map._values[key]; + exists = ${value.memory ? 'bytes(value).length != 0' : `value != ${value.type}(0)`} || contains(map, key); +} + +/** + * @dev Returns the value associated with \`key\`. O(1). + * + * Requirements: + * + * - \`key\` must be in the map. + */ +function get(${name} storage map, ${key.typeLoc} key) internal view returns (${value.typeLoc} value) { + bool exists; + (exists, value) = tryGet(map, key); + if (!exists) { + revert EnumerableMapNonexistent${key.name}Key(key); + } +} + +/** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ +function keys(${name} storage map) internal view returns (${key.type}[] memory) { + return map._keys.values(); +} +`; + +// GENERATE +module.exports = format( + header.trimEnd(), + 'library EnumerableMapExtended {', + format( + [].concat('using EnumerableSet for *;', 'using EnumerableSetExtended for *;', '', EXTENDED_MAP_TYPES.map(map)), + ).trimEnd(), + '}', +); diff --git a/scripts/generate/templates/EnumerableSet.js b/scripts/generate/templates/EnumerableSet.js index 3169d6a46f5..26263ba1889 100644 --- a/scripts/generate/templates/EnumerableSet.js +++ b/scripts/generate/templates/EnumerableSet.js @@ -1,6 +1,6 @@ const format = require('../format-lines'); const { fromBytes32, toBytes32 } = require('./conversion'); -const { TYPES } = require('./EnumerableSet.opts'); +const { SET_TYPES } = require('./Enumerable.opts'); const header = `\ pragma solidity ^0.8.20; @@ -267,7 +267,7 @@ module.exports = format( format( [].concat( defaultSet, - TYPES.map(details => customSet(details)), + SET_TYPES.map(details => customSet(details)), ), ).trimEnd(), '}', diff --git a/scripts/generate/templates/EnumerableSet.opts.js b/scripts/generate/templates/EnumerableSet.opts.js deleted file mode 100644 index 739f0acdfe4..00000000000 --- a/scripts/generate/templates/EnumerableSet.opts.js +++ /dev/null @@ -1,12 +0,0 @@ -const { capitalize } = require('../../helpers'); - -const mapType = str => (str == 'uint256' ? 'Uint' : capitalize(str)); - -const formatType = type => ({ - name: `${mapType(type)}Set`, - type, -}); - -const TYPES = ['bytes32', 'address', 'uint256'].map(formatType); - -module.exports = { TYPES, formatType }; diff --git a/scripts/generate/templates/EnumerableSetExtended.js b/scripts/generate/templates/EnumerableSetExtended.js new file mode 100644 index 00000000000..73c4b446160 --- /dev/null +++ b/scripts/generate/templates/EnumerableSetExtended.js @@ -0,0 +1,319 @@ +const format = require('../format-lines'); +const { EXTENDED_SET_TYPES } = require('./Enumerable.opts'); + +const header = `\ +pragma solidity ^0.8.20; + +import {Hashes} from "../cryptography/Hashes.sol"; + +/** + * @dev Library for managing + * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of non-value + * types. + * + * Sets have the following properties: + * + * - Elements are added, removed, and checked for existence in constant time + * (O(1)). + * - Elements are enumerated in O(n). No guarantees are made on the ordering. + * - Set can be cleared (all elements removed) in O(n). + * + * \`\`\`solidity + * contract Example { + * // Add the library methods + * using EnumerableSetExtended for EnumerableSetExtended.StringSet; + * + * // Declare a set state variable + * EnumerableSetExtended.StringSet private mySet; + * } + * \`\`\` + * + * Sets of type \`string\` (\`StringSet\`), \`bytes\` (\`BytesSet\`) and + * \`bytes32[2]\` (\`Bytes32x2Set\`) are supported. + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure + * unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an + * array of EnumerableSet. + * ==== + * + * NOTE: This is an extension of {EnumerableSet}. + */ +`; + +const set = ({ name, value }) => `\ +struct ${name} { + // Storage of set values + ${value.type}[] _values; + // Position is the index of the value in the \`values\` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(${value.type} value => uint256) _positions; +} + +/** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ +function add(${name} storage self, ${value.type} memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[value] = self._values.length; + return true; + } else { + return false; + } +} + +/** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ +function remove(${name} storage self, ${value.type} memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + uint256 position = self._positions[value]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + ${value.type} memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[lastValue] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[value]; + + return true; + } else { + return false; + } +} + +/** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ +function clear(${name} storage set) internal { + uint256 len = length(set); + for (uint256 i = 0; i < len; ++i) { + delete set._positions[set._values[i]]; + } + // Replace when these are available in Arrays.sol + ${value.type}[] storage array = set._values; + assembly ("memory-safe") { + sstore(array.slot, 0) + } +} + +/** + * @dev Returns true if the value is in the set. O(1). + */ +function contains(${name} storage self, ${value.type} memory value) internal view returns (bool) { + return self._positions[value] != 0; +} + +/** + * @dev Returns the number of values on the set. O(1). + */ +function length(${name} storage self) internal view returns (uint256) { + return self._values.length; +} + +/** + * @dev Returns the value stored at position \`index\` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - \`index\` must be strictly less than {length}. + */ +function at(${name} storage self, uint256 index) internal view returns (${value.type} memory) { + return self._values[index]; +} + +/** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ +function values(${name} storage self) internal view returns (${value.type}[] memory) { + return self._values; +} +`; + +const arraySet = ({ name, value }) => `\ +struct ${name} { + // Storage of set values + ${value.type}[] _values; + // Position is the index of the value in the \`values\` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(bytes32 valueHash => uint256) _positions; +} + +/** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ +function add(${name} storage self, ${value.type} memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[_hash(value)] = self._values.length; + return true; + } else { + return false; + } +} + +/** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ +function remove(${name} storage self, ${value.type} memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + bytes32 valueHash = _hash(value); + uint256 position = self._positions[valueHash]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + ${value.type} memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[_hash(lastValue)] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[valueHash]; + + return true; + } else { + return false; + } +} + +/** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ +function clear(${name} storage self) internal { + ${value.type}[] storage v = self._values; + + uint256 len = length(self); + for (uint256 i = 0; i < len; ++i) { + delete self._positions[_hash(v[i])]; + } + assembly ("memory-safe") { + sstore(v.slot, 0) + } +} + +/** + * @dev Returns true if the value is in the set. O(1). + */ +function contains(${name} storage self, ${value.type} memory value) internal view returns (bool) { + return self._positions[_hash(value)] != 0; +} + +/** + * @dev Returns the number of values on the set. O(1). + */ +function length(${name} storage self) internal view returns (uint256) { + return self._values.length; +} + +/** + * @dev Returns the value stored at position \`index\` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - \`index\` must be strictly less than {length}. + */ +function at(${name} storage self, uint256 index) internal view returns (${value.type} memory) { + return self._values[index]; +} + +/** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ +function values(${name} storage self) internal view returns (${value.type}[] memory) { + return self._values; +} +`; + +const hashes = `\ +function _hash(bytes32[2] memory value) private pure returns (bytes32) { + return Hashes.efficientKeccak256(value[0], value[1]); +} +`; + +// GENERATE +module.exports = format( + header.trimEnd(), + 'library EnumerableSetExtended {', + format( + [].concat( + EXTENDED_SET_TYPES.filter(({ value }) => value.size == 0).map(set), + EXTENDED_SET_TYPES.filter(({ value }) => value.size > 0).map(arraySet), + hashes, + ), + ).trimEnd(), + '}', +); diff --git a/test/utils/structs/EnumerableMap.test.js b/test/utils/structs/EnumerableMap.test.js index cb4b77a651f..d512fb32d18 100644 --- a/test/utils/structs/EnumerableMap.test.js +++ b/test/utils/structs/EnumerableMap.test.js @@ -3,17 +3,17 @@ const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); const { mapValues } = require('../../helpers/iterate'); const { generators } = require('../../helpers/random'); -const { TYPES, formatType } = require('../../../scripts/generate/templates/EnumerableMap.opts'); +const { MAP_TYPES, formatMapType } = require('../../../scripts/generate/templates/Enumerable.opts'); const { shouldBehaveLikeMap } = require('./EnumerableMap.behavior'); // Add Bytes32ToBytes32Map that must be tested but is not part of the generated types. -TYPES.unshift(formatType('bytes32', 'bytes32')); +MAP_TYPES.unshift(formatMapType('bytes32', 'bytes32')); async function fixture() { const mock = await ethers.deployContract('$EnumerableMap'); const env = Object.fromEntries( - TYPES.map(({ name, keyType, valueType }) => [ + MAP_TYPES.map(({ name, keyType, valueType }) => [ name, { keyType, @@ -52,7 +52,7 @@ describe('EnumerableMap', function () { Object.assign(this, await loadFixture(fixture)); }); - for (const { name } of TYPES) { + for (const { name } of MAP_TYPES) { describe(name, function () { beforeEach(async function () { Object.assign(this, this.env[name]); diff --git a/test/utils/structs/EnumerableMapExtended.test.js b/test/utils/structs/EnumerableMapExtended.test.js new file mode 100644 index 00000000000..a40b83dd12d --- /dev/null +++ b/test/utils/structs/EnumerableMapExtended.test.js @@ -0,0 +1,66 @@ +const { ethers } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { mapValues } = require('../../helpers/iterate'); +const { generators } = require('../../helpers/random'); +const { EXTENDED_MAP_TYPES } = require('../../../scripts/generate/templates/Enumerable.opts'); + +const { shouldBehaveLikeMap } = require('./EnumerableMap.behavior'); + +async function fixture() { + const mock = await ethers.deployContract('$EnumerableMapExtended'); + + const env = Object.fromEntries( + EXTENDED_MAP_TYPES.map(({ name, key, value }) => [ + name, + { + key, + value, + keys: Array.from({ length: 3 }, generators[key.type]), + values: Array.from({ length: 3 }, generators[value.type]), + zeroValue: generators[value.type].zero, + methods: mapValues( + { + set: `$set(uint256,${key.type},${value.type})`, + get: `$get(uint256,${key.type})`, + tryGet: `$tryGet(uint256,${key.type})`, + remove: `$remove(uint256,${key.type})`, + clear: `$clear_EnumerableMapExtended_${name}(uint256)`, + length: `$length_EnumerableMapExtended_${name}(uint256)`, + at: `$at_EnumerableMapExtended_${name}(uint256,uint256)`, + contains: `$contains(uint256,${key.type})`, + keys: `$keys_EnumerableMapExtended_${name}(uint256)`, + }, + fnSig => + (...args) => + mock.getFunction(fnSig)(0, ...args), + ), + events: { + setReturn: `return$set_EnumerableMapExtended_${name}_${key.type}_${value.type}`, + removeReturn: `return$remove_EnumerableMapExtended_${name}_${key.type}`, + }, + error: key.memory || value.memory ? `EnumerableMapNonexistent${key.name}Key` : `EnumerableMapNonexistentKey`, + }, + ]), + ); + + return { mock, env }; +} + +describe('EnumerableMapExtended', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + for (const { name, key, value } of EXTENDED_MAP_TYPES) { + describe(`${name} (enumerable map from ${key.type} to ${value.type})`, function () { + beforeEach(async function () { + Object.assign(this, this.env[name]); + [this.keyA, this.keyB, this.keyC] = this.keys; + [this.valueA, this.valueB, this.valueC] = this.values; + }); + + shouldBehaveLikeMap(); + }); + } +}); diff --git a/test/utils/structs/EnumerableSet.test.js b/test/utils/structs/EnumerableSet.test.js index 1f92727a4c4..f60adc103a5 100644 --- a/test/utils/structs/EnumerableSet.test.js +++ b/test/utils/structs/EnumerableSet.test.js @@ -3,7 +3,7 @@ const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); const { mapValues } = require('../../helpers/iterate'); const { generators } = require('../../helpers/random'); -const { TYPES } = require('../../../scripts/generate/templates/EnumerableSet.opts'); +const { SET_TYPES } = require('../../../scripts/generate/templates/Enumerable.opts'); const { shouldBehaveLikeSet } = require('./EnumerableSet.behavior'); @@ -20,7 +20,7 @@ async function fixture() { const mock = await ethers.deployContract('$EnumerableSet'); const env = Object.fromEntries( - TYPES.map(({ name, type }) => [ + SET_TYPES.map(({ name, type }) => [ type, { values: Array.from({ length: 3 }, generators[type]), @@ -49,7 +49,7 @@ describe('EnumerableSet', function () { Object.assign(this, await loadFixture(fixture)); }); - for (const { type } of TYPES) { + for (const { type } of SET_TYPES) { describe(type, function () { beforeEach(function () { Object.assign(this, this.env[type]); diff --git a/test/utils/structs/EnumerableSetExtended.test.js b/test/utils/structs/EnumerableSetExtended.test.js new file mode 100644 index 00000000000..3b9d5ad746d --- /dev/null +++ b/test/utils/structs/EnumerableSetExtended.test.js @@ -0,0 +1,62 @@ +const { ethers } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { mapValues } = require('../../helpers/iterate'); +const { generators } = require('../../helpers/random'); +const { EXTENDED_SET_TYPES } = require('../../../scripts/generate/templates/Enumerable.opts'); + +const { shouldBehaveLikeSet } = require('./EnumerableSet.behavior'); + +async function fixture() { + const mock = await ethers.deployContract('$EnumerableSetExtended'); + + const env = Object.fromEntries( + EXTENDED_SET_TYPES.map(({ name, value }) => [ + name, + { + value, + values: Array.from( + { length: 3 }, + value.size ? () => Array.from({ length: value.size }, generators[value.base]) : generators[value.type], + ), + methods: mapValues( + { + add: `$add(uint256,${value.type})`, + remove: `$remove(uint256,${value.type})`, + contains: `$contains(uint256,${value.type})`, + clear: `$clear_EnumerableSetExtended_${name}(uint256)`, + length: `$length_EnumerableSetExtended_${name}(uint256)`, + at: `$at_EnumerableSetExtended_${name}(uint256,uint256)`, + values: `$values_EnumerableSetExtended_${name}(uint256)`, + }, + fnSig => + (...args) => + mock.getFunction(fnSig)(0, ...args), + ), + events: { + addReturn: `return$add_EnumerableSetExtended_${name}_${value.type.replace(/[[\]]/g, '_')}`, + removeReturn: `return$remove_EnumerableSetExtended_${name}_${value.type.replace(/[[\]]/g, '_')}`, + }, + }, + ]), + ); + + return { mock, env }; +} + +describe('EnumerableSetExtended', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + for (const { name, value } of EXTENDED_SET_TYPES) { + describe(`${name} (enumerable set of ${value.type})`, function () { + beforeEach(function () { + Object.assign(this, this.env[name]); + [this.valueA, this.valueB, this.valueC] = this.values; + }); + + shouldBehaveLikeSet(); + }); + } +}); From 29c48d91b4d8766a0c10e22a077db118bd39996e Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sat, 3 May 2025 01:29:08 -0600 Subject: [PATCH 059/110] Fix lint and enable formatting after generation --- contracts/utils/structs/EnumerableMapExtended.sol | 10 ++-------- contracts/utils/structs/EnumerableSetExtended.sol | 2 +- scripts/generate/run.js | 4 ++-- scripts/generate/templates/EnumerableMapExtended.js | 10 ++-------- scripts/generate/templates/EnumerableSetExtended.js | 2 +- 5 files changed, 8 insertions(+), 20 deletions(-) diff --git a/contracts/utils/structs/EnumerableMapExtended.sol b/contracts/utils/structs/EnumerableMapExtended.sol index 31dd512afd5..91b912e6d72 100644 --- a/contracts/utils/structs/EnumerableMapExtended.sol +++ b/contracts/utils/structs/EnumerableMapExtended.sol @@ -120,10 +120,7 @@ library EnumerableMapExtended { * * - `index` must be strictly less than {length}. */ - function at( - BytesToUintMap storage map, - uint256 index - ) internal view returns (bytes memory key, uint256 value) { + function at(BytesToUintMap storage map, uint256 index) internal view returns (bytes memory key, uint256 value) { key = map._keys.at(index); value = map._values[key]; } @@ -132,10 +129,7 @@ library EnumerableMapExtended { * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ - function tryGet( - BytesToUintMap storage map, - bytes memory key - ) internal view returns (bool exists, uint256 value) { + function tryGet(BytesToUintMap storage map, bytes memory key) internal view returns (bool exists, uint256 value) { value = map._values[key]; exists = value != uint256(0) || contains(map, key); } diff --git a/contracts/utils/structs/EnumerableSetExtended.sol b/contracts/utils/structs/EnumerableSetExtended.sol index 82f3ae9da76..a5ba388a74f 100644 --- a/contracts/utils/structs/EnumerableSetExtended.sol +++ b/contracts/utils/structs/EnumerableSetExtended.sol @@ -27,7 +27,7 @@ import {Hashes} from "../cryptography/Hashes.sol"; * } * ``` * - * Sets of type `string` (`StringSet`), `bytes` (`BytesSet`) and + * Sets of type `string` (`StringSet`), `bytes` (`BytesSet`) and * `bytes32[2]` (`Bytes32x2Set`) are supported. * * [WARNING] diff --git a/scripts/generate/run.js b/scripts/generate/run.js index a2f89e16e54..68516fa135b 100755 --- a/scripts/generate/run.js +++ b/scripts/generate/run.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -// const cp = require('child_process'); +const cp = require('child_process'); const fs = require('fs'); const path = require('path'); const format = require('./format-lines'); @@ -27,7 +27,7 @@ function generateFromTemplate(file, template, outputPrefix = '') { ); fs.writeFileSync(output, content); - // cp.execFileSync('prettier', ['--write', output]); + cp.execFileSync('prettier', ['--write', output]); } // Contracts diff --git a/scripts/generate/templates/EnumerableMapExtended.js b/scripts/generate/templates/EnumerableMapExtended.js index b1b55278974..8baf4a752da 100644 --- a/scripts/generate/templates/EnumerableMapExtended.js +++ b/scripts/generate/templates/EnumerableMapExtended.js @@ -120,10 +120,7 @@ function length(${name} storage map) internal view returns (uint256) { * * - \`index\` must be strictly less than {length}. */ -function at( - ${name} storage map, - uint256 index -) internal view returns (${key.typeLoc} key, ${value.typeLoc} value) { +function at(${name} storage map, uint256 index) internal view returns (${key.typeLoc} key, ${value.typeLoc} value) { key = map._keys.at(index); value = map._values[key]; } @@ -132,10 +129,7 @@ function at( * @dev Tries to returns the value associated with \`key\`. O(1). * Does not revert if \`key\` is not in the map. */ -function tryGet( - ${name} storage map, - ${key.typeLoc} key -) internal view returns (bool exists, ${value.typeLoc} value) { +function tryGet(${name} storage map, ${key.typeLoc} key) internal view returns (bool exists, ${value.typeLoc} value) { value = map._values[key]; exists = ${value.memory ? 'bytes(value).length != 0' : `value != ${value.type}(0)`} || contains(map, key); } diff --git a/scripts/generate/templates/EnumerableSetExtended.js b/scripts/generate/templates/EnumerableSetExtended.js index 73c4b446160..1899828ba81 100644 --- a/scripts/generate/templates/EnumerableSetExtended.js +++ b/scripts/generate/templates/EnumerableSetExtended.js @@ -28,7 +28,7 @@ import {Hashes} from "../cryptography/Hashes.sol"; * } * \`\`\` * - * Sets of type \`string\` (\`StringSet\`), \`bytes\` (\`BytesSet\`) and + * Sets of type \`string\` (\`StringSet\`), \`bytes\` (\`BytesSet\`) and * \`bytes32[2]\` (\`Bytes32x2Set\`) are supported. * * [WARNING] From fae0a67abf27dd1d06e0dc7152b3273f960ea291 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 01:46:58 -0600 Subject: [PATCH 060/110] Add ERC7913 signers and utilities --- contracts/interfaces/IERC7913.sol | 17 ++ contracts/utils/README.adoc | 17 ++ contracts/utils/cryptography/ERC7913Utils.sol | 82 ++++++ .../utils/cryptography/MultiSignerERC7913.sol | 246 ++++++++++++++++++ .../MultiSignerERC7913Weighted.sol | 196 ++++++++++++++ .../utils/cryptography/SignerERC7913.sol | 51 ++++ docs/modules/ROOT/pages/utilities.adoc | 25 ++ 7 files changed, 634 insertions(+) create mode 100644 contracts/interfaces/IERC7913.sol create mode 100644 contracts/utils/cryptography/ERC7913Utils.sol create mode 100644 contracts/utils/cryptography/MultiSignerERC7913.sol create mode 100644 contracts/utils/cryptography/MultiSignerERC7913Weighted.sol create mode 100644 contracts/utils/cryptography/SignerERC7913.sol diff --git a/contracts/interfaces/IERC7913.sol b/contracts/interfaces/IERC7913.sol new file mode 100644 index 00000000000..58e334095fc --- /dev/null +++ b/contracts/interfaces/IERC7913.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +/** + * @dev Signature verifier interface. + */ +interface IERC7913SignatureVerifier { + /** + * @dev Verifies `signature` as a valid signature of `hash` by `key`. + * + * MUST return the bytes4 magic value IERC7913SignatureVerifier.verify.selector if the signature is valid. + * SHOULD return 0xffffffff or revert if the signature is not valid. + * SHOULD return 0xffffffff or revert if the key is empty + */ + function verify(bytes calldata key, bytes32 hash, bytes calldata signature) external view returns (bytes4); +} diff --git a/contracts/utils/README.adoc b/contracts/utils/README.adoc index b77398ff6a7..411ffdc3f51 100644 --- a/contracts/utils/README.adoc +++ b/contracts/utils/README.adoc @@ -50,8 +50,11 @@ Miscellaneous contracts and libraries containing utility functions you can use t * {AbstractSigner}: Abstract contract for internal signature validation in smart contracts. * {ERC7739}: An abstract contract to validate signatures following the rehashing scheme from `ERC7739Utils`. * {ERC7739Utils}: Utilities library that implements a defensive rehashing mechanism to prevent replayability of smart contract signatures based on ERC-7739. + * {ERC7913Utils}: utilities library that implements ERC-7913 signature verification with fallback to ERC-1271 and ECDSA. * {SignerECDSA}, {SignerP256}, {SignerRSA}: Implementations of an {AbstractSigner} with specific signature validation algorithms. * {SignerERC7702}: Implementation of {AbstractSigner} that validates signatures using the contract's own address as the signer, useful for delegated accounts following EIP-7702. + * {SignerERC7913}, {MultiSignerERC7913}, {MultiSignerERC7913Weighted}: Implementations of {AbstractSigner} that validate signatures based on ERC-7913. Including a simple and weighted multisignature scheme. + * {ERC7913SignatureVerifierP256}, {ERC7913SignatureVerifierRSA}: Ready to use ERC-7913 signature verifiers for P256 and RSA keys [NOTE] ==== @@ -100,6 +103,20 @@ Because Solidity does not support generic types, {EnumerableMap} and {Enumerable {{SignerRSA}} +{{SignerERC7913}} + +{{MultiSignerERC7913}} + +{{MultiSignerERC7913Weighted}} + +=== ERC-7913 + +{{ERC7913Utils}} + +{{ERC7913SignatureVerifierP256}} + +{{ERC7913SignatureVerifierRSA}} + == Security {{ReentrancyGuard}} diff --git a/contracts/utils/cryptography/ERC7913Utils.sol b/contracts/utils/cryptography/ERC7913Utils.sol new file mode 100644 index 00000000000..285d3895ff7 --- /dev/null +++ b/contracts/utils/cryptography/ERC7913Utils.sol @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.24; + +import {SignatureChecker} from "./SignatureChecker.sol"; +import {Bytes} from "../Bytes.sol"; +import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol"; + +/** + * @dev Library that provides common ERC-7913 utility functions. + * + * This library extends the functionality of xref:api:utils#SignatureChecker[SignatureChecker] + * to support signature verification for keys that do not have an Ethereum address of their own + * as with ERC-1271. + * + * See https://eips.ethereum.org/EIPS/eip-7913[ERC-7913]. + */ +library ERC7913Utils { + using Bytes for bytes; + + /** + * @dev Verifies a signature for a given signer and hash. + * + * The signer is a `bytes` object that is the concatenation of an address and optionally a key: + * `verifier || key`. A signer must be at least 20 bytes long. + * + * Verification is done as follows: + * - If `signer.length < 20`: verification fails + * - If `signer.length == 20`: verification is done using {SignatureChecker} + * - Otherwise: verification is done using {IERC7913SignatureVerifier} + */ + function isValidSignatureNow( + bytes memory signer, + bytes32 hash, + bytes memory signature + ) internal view returns (bool) { + if (signer.length < 20) { + return false; + } else if (signer.length == 20) { + return SignatureChecker.isValidSignatureNow(address(bytes20(signer)), hash, signature); + } else { + (bool success, bytes memory result) = address(bytes20(signer)).staticcall( + abi.encodeCall(IERC7913SignatureVerifier.verify, (signer.slice(20), hash, signature)) + ); + return (success && + result.length >= 32 && + abi.decode(result, (bytes32)) == bytes32(IERC7913SignatureVerifier.verify.selector)); + } + } + + /** + * @dev Verifies multiple `signatures` for a given hash using a set of `signers`. + * + * The signers must be ordered by their `keccak256` hash to ensure no duplicates and to optimize + * the verification process. The function will return `false` if the signers are not properly ordered. + * + * Requirements: + * + * * The `signatures` array must be at least the `signers` array's length. + */ + function areValidSignaturesNow( + bytes32 hash, + bytes[] memory signers, + bytes[] memory signatures + ) internal view returns (bool) { + bytes32 previousId = bytes32(0); + + uint256 signersLength = signers.length; + for (uint256 i = 0; i < signersLength; i++) { + bytes memory signer = signers[i]; + // Signers must ordered by id to ensure no duplicates + bytes32 id = keccak256(signer); + if (previousId >= id || !isValidSignatureNow(signer, hash, signatures[i])) { + return false; + } + + previousId = id; + } + + return true; + } +} diff --git a/contracts/utils/cryptography/MultiSignerERC7913.sol b/contracts/utils/cryptography/MultiSignerERC7913.sol new file mode 100644 index 00000000000..2d348e32927 --- /dev/null +++ b/contracts/utils/cryptography/MultiSignerERC7913.sol @@ -0,0 +1,246 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.27; + +import {AbstractSigner} from "./AbstractSigner.sol"; +import {ERC7913Utils} from "./ERC7913Utils.sol"; +import {EnumerableSetExtended} from "../structs/EnumerableSetExtended.sol"; +import {Calldata} from "../../utils/Calldata.sol"; +import {SafeCast} from "../../utils/math/SafeCast.sol"; + +/** + * @dev Implementation of {AbstractSigner} using multiple ERC-7913 signers with a threshold-based + * signature verification system. + * + * This contract allows managing a set of authorized signers and requires a minimum number of + * signatures (threshold) to approve operations. It uses ERC-7913 formatted signers, which + * concatenate a verifier address and a key: `verifier || key`. + * + * Example of usage: + * + * ```solidity + * contract MyMultiSignerAccount is Account, MultiSignerERC7913, Initializable { + * constructor() EIP712("MyMultiSignerAccount", "1") {} + * + * function initialize(bytes[] memory signers, uint256 threshold) public initializer { + * _addSigners(signers); + * _setThreshold(threshold); + * } + * + * function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf { + * _addSigners(signers); + * } + * + * function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf { + * _removeSigners(signers); + * } + * + * function setThreshold(uint256 threshold) public onlyEntryPointOrSelf { + * _setThreshold(threshold); + * } + * } + * ``` + * + * IMPORTANT: Failing to properly initialize the signers and threshold either during construction + * (if used standalone) or during initialization (if used as a clone) may leave the contract + * either front-runnable or unusable. + */ +abstract contract MultiSignerERC7913 is AbstractSigner { + using EnumerableSetExtended for EnumerableSetExtended.BytesSet; + using ERC7913Utils for *; + using SafeCast for uint256; + + EnumerableSetExtended.BytesSet private _signersSet; + uint128 private _threshold; + + /// @dev Emitted when signers are added. + event ERC7913SignersAdded(bytes[] indexed signers); + + /// @dev Emitted when signers are removed. + event ERC7913SignersRemoved(bytes[] indexed signers); + + /// @dev Emitted when the threshold is updated. + event ERC7913ThresholdSet(uint256 threshold); + + /// @dev The `signer` already exists. + error MultiSignerERC7913AlreadyExists(bytes signer); + + /// @dev The `signer` does not exist. + error MultiSignerERC7913NonexistentSigner(bytes signer); + + /// @dev The `signer` is less than 20 bytes long. + error MultiSignerERC7913InvalidSigner(bytes signer); + + /// @dev The `threshold` is unreachable given the number of `signers`. + error MultiSignerERC7913UnreachableThreshold(uint256 signers, uint256 threshold); + + /** + * @dev Returns the set of authorized signers. Prefer {_signers} for internal use. + * + * WARNING: This operation copies the entire signers set to memory, which can be expensive. This is designed + * for view accessors queried without gas fees. Using it in state-changing functions may become uncallable + * if the signers set grows too large. + */ + function signers() public view virtual returns (bytes[] memory) { + return _signers().values(); + } + + /// @dev Returns whether the `signer` is an authorized signer. + function isSigner(bytes memory signer) public view virtual returns (bool) { + return _signers().contains(signer); + } + + /// @dev Returns the minimum number of signers required to approve a multisignature operation. + function threshold() public view virtual returns (uint256) { + return _threshold; + } + + /// @dev Returns the set of authorized signers. + function _signers() internal view virtual returns (EnumerableSetExtended.BytesSet storage) { + return _signersSet; + } + + /** + * @dev Adds the `newSigners` to those allowed to sign on behalf of this contract. + * Internal version without access control. + * + * Requirements: + * + * * Each of `newSigners` must be at least 20 bytes long. Reverts with {MultiSignerERC7913InvalidSigner} if not. + * * Each of `newSigners` must not be authorized. See {isSigner}. Reverts with {MultiSignerERC7913AlreadyExists} if so. + */ + function _addSigners(bytes[] memory newSigners) internal virtual { + uint256 newSignersLength = newSigners.length; + for (uint256 i = 0; i < newSignersLength; i++) { + bytes memory signer = newSigners[i]; + require(signer.length >= 20, MultiSignerERC7913InvalidSigner(signer)); + require(_signers().add(signer), MultiSignerERC7913AlreadyExists(signer)); + } + emit ERC7913SignersAdded(newSigners); + } + + /** + * @dev Removes the `oldSigners` from the authorized signers. Internal version without access control. + * + * Requirements: + * + * * Each of `oldSigners` must be authorized. See {isSigner}. Otherwise {MultiSignerERC7913NonexistentSigner} is thrown. + * * See {_validateReachableThreshold} for the threshold validation. + */ + function _removeSigners(bytes[] memory oldSigners) internal virtual { + uint256 oldSignersLength = oldSigners.length; + for (uint256 i = 0; i < oldSignersLength; i++) { + bytes memory signer = oldSigners[i]; + require(_signers().remove(signer), MultiSignerERC7913NonexistentSigner(signer)); + } + _validateReachableThreshold(); + emit ERC7913SignersRemoved(oldSigners); + } + + /** + * @dev Sets the signatures `threshold` required to approve a multisignature operation. + * Internal version without access control. + * + * Requirements: + * + * * See {_validateReachableThreshold} for the threshold validation. + */ + function _setThreshold(uint256 newThreshold) internal virtual { + _threshold = newThreshold.toUint128(); + _validateReachableThreshold(); + emit ERC7913ThresholdSet(newThreshold); + } + + /** + * @dev Validates the current threshold is reachable. + * + * Requirements: + * + * * The {signers}'s length must be `>=` to the {threshold}. Throws {MultiSignerERC7913UnreachableThreshold} if not. + */ + function _validateReachableThreshold() internal view virtual { + uint256 totalSigners = _signers().length(); + uint256 currentThreshold = threshold(); + require( + totalSigners >= currentThreshold, + MultiSignerERC7913UnreachableThreshold(totalSigners, currentThreshold) + ); + } + + /** + * @dev Decodes, validates the signature and checks the signers are authorized. + * See {_validateSignatures} and {_validateThreshold} for more details. + * + * Example of signature encoding: + * + * ```solidity + * // Encode signers (verifier || key) + * bytes memory signer1 = abi.encodePacked(verifier1, key1); + * bytes memory signer2 = abi.encodePacked(verifier2, key2); + * + * // Order signers by their id + * if (keccak256(signer1) > keccak256(signer2)) { + * (signer1, signer2) = (signer2, signer1); + * (signature1, signature2) = (signature2, signature1); + * } + * + * // Assign ordered signers and signatures + * bytes[] memory signers = new bytes[](2); + * bytes[] memory signatures = new bytes[](2); + * signers[0] = signer1; + * signatures[0] = signature1; + * signers[1] = signer2; + * signatures[1] = signature2; + * + * // Encode the multi signature + * bytes memory signature = abi.encode(signers, signatures); + * ``` + * + * Requirements: + * + * * The `signature` must be encoded as `abi.encode(signers, signatures)`. + */ + function _rawSignatureValidation( + bytes32 hash, + bytes calldata signature + ) internal view virtual override returns (bool) { + if (signature.length == 0) return false; // For ERC-7739 compatibility + (bytes[] memory signingSigners, bytes[] memory signatures) = abi.decode(signature, (bytes[], bytes[])); + if (signingSigners.length != signatures.length) return false; + return _validateThreshold(signingSigners) && _validateSignatures(hash, signingSigners, signatures); + } + + /** + * @dev Validates the signatures using the signers and their corresponding signatures. + * Returns whether whether the signers are authorized and the signatures are valid for the given hash. + * + * IMPORTANT: For simplicity, this contract assumes that the signers are ordered by their `keccak256` hash + * to avoid duplication when iterating through the signers (i.e. `keccak256(signer1) < keccak256(signer2)`). + * The function will return false if the signers are not ordered. + * + * Requirements: + * + * * The `signatures` arrays must be at least as large as the `signingSigners` arrays. Panics otherwise. + */ + function _validateSignatures( + bytes32 hash, + bytes[] memory signingSigners, + bytes[] memory signatures + ) internal view virtual returns (bool valid) { + uint256 signersLength = signingSigners.length; + for (uint256 i = 0; i < signersLength; i++) { + if (!isSigner(signingSigners[i])) { + return false; + } + } + return hash.areValidSignaturesNow(signingSigners, signatures); + } + + /** + * @dev Validates that the number of signers meets the {threshold} requirement. + * Assumes the signers were already validated. See {_validateSignatures} for more details. + */ + function _validateThreshold(bytes[] memory validatingSigners) internal view virtual returns (bool) { + return validatingSigners.length >= threshold(); + } +} diff --git a/contracts/utils/cryptography/MultiSignerERC7913Weighted.sol b/contracts/utils/cryptography/MultiSignerERC7913Weighted.sol new file mode 100644 index 00000000000..5e7cb2831c0 --- /dev/null +++ b/contracts/utils/cryptography/MultiSignerERC7913Weighted.sol @@ -0,0 +1,196 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.27; + +import {Math} from "../math/Math.sol"; +import {SafeCast} from "../math/SafeCast.sol"; +import {MultiSignerERC7913} from "./MultiSignerERC7913.sol"; +import {EnumerableSetExtended} from "../../utils/structs/EnumerableSetExtended.sol"; + +/** + * @dev Extension of {MultiSignerERC7913} that supports weighted signatures. + * + * This contract allows assigning different weights to each signer, enabling more + * flexible governance schemes. For example, some signers could have higher weight + * than others, allowing for weighted voting or prioritized authorization. + * + * Example of usage: + * + * ```solidity + * contract MyWeightedMultiSignerAccount is Account, MultiSignerERC7913Weighted, Initializable { + * constructor() EIP712("MyWeightedMultiSignerAccount", "1") {} + * + * function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold) public initializer { + * _addSigners(signers); + * _setSignerWeights(signers, weights); + * _setThreshold(threshold); + * } + * + * function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf { + * _addSigners(signers); + * } + * + * function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf { + * _removeSigners(signers); + * } + * + * function setThreshold(uint256 threshold) public onlyEntryPointOrSelf { + * _setThreshold(threshold); + * } + * + * function setSignerWeights(bytes[] memory signers, uint256[] memory weights) public onlyEntryPointOrSelf { + * _setSignerWeights(signers, weights); + * } + * } + * ``` + * + * IMPORTANT: When setting a threshold value, ensure it matches the scale used for signer weights. + * For example, if signers have weights like 1, 2, or 3, then a threshold of 4 would require at + * least two signers (e.g., one with weight 1 and one with weight 3). See {signerWeight}. + */ +abstract contract MultiSignerERC7913Weighted is MultiSignerERC7913 { + using EnumerableSetExtended for EnumerableSetExtended.BytesSet; + using SafeCast for uint256; + + // Invariant: sum(weights) >= threshold + uint128 private _totalWeight; + + // Mapping from signer to weight + mapping(bytes signer => uint256) private _weights; + + /// @dev Emitted when a signer's weight is changed. + event ERC7913SignerWeightChanged(bytes indexed signer, uint256 weight); + + /// @dev Thrown when a signer's weight is invalid. + error MultiSignerERC7913WeightedInvalidWeight(bytes signer, uint256 weight); + + /// @dev Thrown when the threshold is unreachable. + error MultiSignerERC7913WeightedMismatchedLength(); + + /// @dev Gets the weight of a signer. Returns 0 if the signer is not authorized. + function signerWeight(bytes memory signer) public view virtual returns (uint256) { + return Math.ternary(isSigner(signer), _signerWeight(signer), 0); + } + + /// @dev Gets the total weight of all signers. + function totalWeight() public view virtual returns (uint256) { + return _totalWeight; // Doesn't need Math.max because it's incremented by the default 1 in `_addSigners` + } + + /** + * @dev Gets the weight of the current signer. Returns 1 if not explicitly set. + * + * NOTE: This internal function doesn't check if the signer is authorized. + */ + function _signerWeight(bytes memory signer) internal view virtual returns (uint256) { + return Math.max(_weights[signer], 1); + } + + /** + * @dev Sets weights for multiple signers at once. Internal version without access control. + * + * Requirements: + * + * - `signers` and `weights` arrays must have the same length. Reverts with {MultiSignerERC7913WeightedMismatchedLength} on mismatch. + * - Each signer must exist in the set of authorized signers. Reverts with {MultiSignerERC7913NonexistentSigner} if not. + * - Each weight must be greater than 0. Reverts with {MultiSignerERC7913WeightedInvalidWeight} if not. + * - See {_validateReachableThreshold} for the threshold validation. + * + * Emits {ERC7913SignerWeightChanged} for each signer. + */ + function _setSignerWeights(bytes[] memory signers, uint256[] memory newWeights) internal virtual { + require(signers.length == newWeights.length, MultiSignerERC7913WeightedMismatchedLength()); + uint256 oldWeight = _weightSigners(signers); + uint256 signersLength = signers.length; + + for (uint256 i = 0; i < signersLength; i++) { + bytes memory signer = signers[i]; + uint256 newWeight = newWeights[i]; + require(isSigner(signer), MultiSignerERC7913NonexistentSigner(signer)); + require(newWeight > 0, MultiSignerERC7913WeightedInvalidWeight(signer, newWeight)); + } + + _unsafeSetSignerWeights(signers, newWeights); + _totalWeight = (_totalWeight - oldWeight + _weightSigners(signers)).toUint128(); + _validateReachableThreshold(); + } + + /// @inheritdoc MultiSignerERC7913 + function _addSigners(bytes[] memory newSigners) internal virtual override { + super._addSigners(newSigners); + _totalWeight += newSigners.length.toUint128(); // Each new signer has a default weight of 1 + } + + /** + * @dev See {MultiSignerERC7913-_removeSigners}. + * + * Emits {ERC7913SignerWeightChanged} for each removed signer. + */ + function _removeSigners(bytes[] memory oldSigners) internal virtual override { + uint256 removedWeight = _weightSigners(oldSigners); + unchecked { + // Can't overflow. Invariant: sum(weights) >= threshold + _totalWeight -= removedWeight.toUint128(); + } + // Clean up weights for removed signers + _unsafeSetSignerWeights(oldSigners, new uint256[](oldSigners.length)); + super._removeSigners(oldSigners); + } + + /** + * @dev Sets the threshold for the multisignature operation. Internal version without access control. + * + * Requirements: + * + * * The {totalWeight} must be `>=` to the {threshold}. Throws {MultiSignerERC7913UnreachableThreshold} if not. + * + * NOTE: This function intentionally does not call `super._validateReachableThreshold` because the base implementation + * assumes each signer has a weight of 1, which is a subset of this weighted implementation. Consider that multiple + * implementations of this function may exist in the contract, so important side effects may be missed + * depending on the linearization order. + */ + function _validateReachableThreshold() internal view virtual override { + uint256 weight = totalWeight(); + uint256 currentThreshold = threshold(); + require(weight >= currentThreshold, MultiSignerERC7913UnreachableThreshold(weight, currentThreshold)); + } + + /** + * @dev Validates that the total weight of signers meets the threshold requirement. + * + * NOTE: This function intentionally does not call `super. _validateThreshold` because the base implementation + * assumes each signer has a weight of 1, which is a subset of this weighted implementation. Consider that multiple + * implementations of this function may exist in the contract, so important side effects may be missed + * depending on the linearization order. + */ + function _validateThreshold(bytes[] memory signers) internal view virtual override returns (bool) { + return _weightSigners(signers) >= threshold(); + } + + /// @dev Calculates the total weight of a set of signers. For all signers weight use {totalWeight}. + function _weightSigners(bytes[] memory signers) internal view virtual returns (uint256) { + uint256 weight = 0; + uint256 signersLength = signers.length; + for (uint256 i = 0; i < signersLength; i++) { + weight += signerWeight(signers[i]); + } + return weight; + } + + /** + * @dev Sets the weights for multiple signers without updating the total weight or validating the threshold. + * + * Requirements: + * + * * The `newWeights` array must be at least as large as the `signers` array. Panics otherwise. + * + * Emits {ERC7913SignerWeightChanged} for each signer. + */ + function _unsafeSetSignerWeights(bytes[] memory signers, uint256[] memory newWeights) private { + uint256 signersLength = signers.length; + for (uint256 i = 0; i < signersLength; i++) { + _weights[signers[i]] = newWeights[i]; + emit ERC7913SignerWeightChanged(signers[i], newWeights[i]); + } + } +} diff --git a/contracts/utils/cryptography/SignerERC7913.sol b/contracts/utils/cryptography/SignerERC7913.sol new file mode 100644 index 00000000000..ae05d618677 --- /dev/null +++ b/contracts/utils/cryptography/SignerERC7913.sol @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.24; + +import {AbstractSigner} from "./AbstractSigner.sol"; +import {ERC7913Utils} from "./ERC7913Utils.sol"; + +/** + * @dev Implementation of {AbstractSigner} using + * https://eips.ethereum.org/EIPS/eip-7913[ERC-7913] signature verification. + * + * For {Account} usage, a {_setSigner} function is provided to set the ERC-7913 formatted {signer}. + * Doing so is easier for a factory, who is likely to use initializable clones of this contract. + * + * The signer is a `bytes` object that concatenates a verifier address and a key: `verifier || key`. + * + * Example of usage: + * + * ```solidity + * contract MyAccountERC7913 is Account, SignerERC7913, Initializable { + * function initialize(bytes memory signer_) public initializer { + * _setSigner(signer_); + * } + * } + * ``` + * + * IMPORTANT: Failing to call {_setSigner} either during construction (if used standalone) + * or during initialization (if used as a clone) may leave the signer either front-runnable or unusable. + */ + +abstract contract SignerERC7913 is AbstractSigner { + bytes private _signer; + + /// @dev Return the ERC-7913 signer (i.e. `verifier || key`). + function signer() public view virtual returns (bytes memory) { + return _signer; + } + + /// @dev Sets the signer (i.e. `verifier || key`) with an ERC-7913 formatted signer. + function _setSigner(bytes memory signer_) internal { + _signer = signer_; + } + + /// @dev Verifies a signature using {ERC7913Utils-isValidSignatureNow} with {signer}, `hash` and `signature`. + function _rawSignatureValidation( + bytes32 hash, + bytes calldata signature + ) internal view virtual override returns (bool) { + return ERC7913Utils.isValidSignatureNow(signer(), hash, signature); + } +} diff --git a/docs/modules/ROOT/pages/utilities.adoc b/docs/modules/ROOT/pages/utilities.adoc index 04cb2ee43a5..64b8029624b 100644 --- a/docs/modules/ROOT/pages/utilities.adoc +++ b/docs/modules/ROOT/pages/utilities.adoc @@ -97,6 +97,31 @@ function _verify( IMPORTANT: Always use keys of at least 2048 bits. Additionally, be aware that PKCS#1 v1.5 allows for replayability due to the possibility of arbitrary optional parameters. To prevent replay attacks, consider including an onchain nonce or unique identifier in the message. +=== ERC-7913 Signature Verifiers + +ERC-7913 extends the concept of signature verification to support keys that don't have their own Ethereum address. This is particularly useful for integrating non-Ethereum cryptographic curves, hardware devices, or other identity systems into smart accounts. + +The standard defines a verifier interface that can be implemented to support different types of keys. A signer is represented as a `bytes` object that concatenates a verifier address and a key: `verifier || key`. + +xref:api:utils.adoc#ERC7913Utils[`ERC7913Utils`] provides functions for verifying signatures using ERC-7913 compatible verifiers: + +[source,solidity] +---- +using ERC7913Utils for bytes; + +function _verify(bytes memory signer, bytes32 hash, bytes memory signature) internal view returns (bool) { + return signer.isValidSignatureNow(hash, signature); +} +---- + +The verification process works as follows: + +* If `signer.length < 20`: verification fails +* If `signer.length == 20`: verification is done using xref:api:utils#SignatureChecker[SignatureChecker] +* Otherwise: verification is done using an ERC-7913 verifier. + +This allows for backward compatibility with EOAs and ERC-1271 contracts while supporting new types of keys. + === Verifying Merkle Proofs Developers can build a Merkle Tree off-chain, which allows for verifying that an element (leaf) is part of a set by using a Merkle Proof. This technique is widely used for creating whitelists (e.g., for airdrops) and other advanced use cases. From e412bd933bccbcbcc85ca1e020be9c3e5ac1d5d4 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 2 May 2025 01:42:11 -0600 Subject: [PATCH 061/110] Add EnumerableSetExtended and EnumerableMapExtended --- contracts/utils/README.adoc | 5 + .../utils/structs/EnumerableMapExtended.sol | 287 ++++++++++++ .../utils/structs/EnumerableSetExtended.sol | 422 ++++++++++++++++++ scripts/generate/run.js | 2 + scripts/generate/templates/Enumerable.opts.js | 64 +++ scripts/generate/templates/EnumerableMap.js | 4 +- .../generate/templates/EnumerableMap.opts.js | 19 - .../templates/EnumerableMapExtended.js | 179 ++++++++ scripts/generate/templates/EnumerableSet.js | 4 +- .../generate/templates/EnumerableSet.opts.js | 12 - .../templates/EnumerableSetExtended.js | 319 +++++++++++++ test/utils/structs/EnumerableMap.test.js | 8 +- .../structs/EnumerableMapExtended.test.js | 66 +++ test/utils/structs/EnumerableSet.test.js | 6 +- .../structs/EnumerableSetExtended.test.js | 62 +++ 15 files changed, 1417 insertions(+), 42 deletions(-) create mode 100644 contracts/utils/structs/EnumerableMapExtended.sol create mode 100644 contracts/utils/structs/EnumerableSetExtended.sol create mode 100644 scripts/generate/templates/Enumerable.opts.js delete mode 100644 scripts/generate/templates/EnumerableMap.opts.js create mode 100644 scripts/generate/templates/EnumerableMapExtended.js delete mode 100644 scripts/generate/templates/EnumerableSet.opts.js create mode 100644 scripts/generate/templates/EnumerableSetExtended.js create mode 100644 test/utils/structs/EnumerableMapExtended.test.js create mode 100644 test/utils/structs/EnumerableSetExtended.test.js diff --git a/contracts/utils/README.adoc b/contracts/utils/README.adoc index 74b26b236cc..83912e5b0c2 100644 --- a/contracts/utils/README.adoc +++ b/contracts/utils/README.adoc @@ -23,6 +23,7 @@ Miscellaneous contracts and libraries containing utility functions you can use t * {BitMaps}: A simple library to manage boolean value mapped to a numerical index in an efficient way. * {EnumerableMap}: A type like Solidity's https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`], but with key-value _enumeration_: this will let you know how many entries a mapping has, and iterate over them (which is not possible with `mapping`). * {EnumerableSet}: Like {EnumerableMap}, but for https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets]. Can be used to store privileged accounts, issued IDs, etc. + * {EnumerableSetExtended} and {EnumerableMapExtended}: Extensions of the `EnumerableSet` and `EnumerableMap` libraries with more types, including non-value types. * {DoubleEndedQueue}: An implementation of a https://en.wikipedia.org/wiki/Double-ended_queue[double ended queue] whose values can be added or removed from both sides. Useful for FIFO and LIFO structures. * {CircularBuffer}: A data structure to store the last N values pushed to it. * {Checkpoints}: A data structure to store values mapped to a strictly increasing key. Can be used for storing and accessing values over time. @@ -108,8 +109,12 @@ Ethereum contracts have no native concept of an interface, so applications must {{EnumerableMap}} +{{EnumerableMapExtended}} + {{EnumerableSet}} +{{EnumerableSetExtended}} + {{DoubleEndedQueue}} {{CircularBuffer}} diff --git a/contracts/utils/structs/EnumerableMapExtended.sol b/contracts/utils/structs/EnumerableMapExtended.sol new file mode 100644 index 00000000000..31dd512afd5 --- /dev/null +++ b/contracts/utils/structs/EnumerableMapExtended.sol @@ -0,0 +1,287 @@ +// SPDX-License-Identifier: MIT +// This file was procedurally generated from scripts/generate/templates/EnumerableMapExtended.js. + +pragma solidity ^0.8.20; + +import {EnumerableSet} from "./EnumerableSet.sol"; +import {EnumerableSetExtended} from "./EnumerableSetExtended.sol"; + +/** + * @dev Library for managing an enumerable variant of Solidity's + * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] + * type for non-value types as keys. + * + * Maps have the following properties: + * + * - Entries are added, removed, and checked for existence in constant time + * (O(1)). + * - Entries are enumerated in O(n). No guarantees are made on the ordering. + * - Map can be cleared (all entries removed) in O(n). + * + * ```solidity + * contract Example { + * // Add the library methods + * using EnumerableMapExtended for EnumerableMapExtended.BytesToUintMap; + * + * // Declare a set state variable + * EnumerableMapExtended.BytesToUintMap private myMap; + * } + * ``` + * + * The following map types are supported: + * + * - `bytes -> uint256` (`BytesToUintMap`) + * - `string -> string` (`StringToStringMap`) + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure + * unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an + * array of EnumerableMap. + * ==== + * + * NOTE: Extensions of {EnumerableMap} + */ +library EnumerableMapExtended { + using EnumerableSet for *; + using EnumerableSetExtended for *; + + /** + * @dev Query for a nonexistent map key. + */ + error EnumerableMapNonexistentBytesKey(bytes key); + + struct BytesToUintMap { + // Storage of keys + EnumerableSetExtended.BytesSet _keys; + mapping(bytes key => uint256) _values; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set(BytesToUintMap storage map, bytes memory key, uint256 value) internal returns (bool) { + map._values[key] = value; + return map._keys.add(key); + } + + /** + * @dev Removes a key-value pair from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(BytesToUintMap storage map, bytes memory key) internal returns (bool) { + delete map._values[key]; + return map._keys.remove(key); + } + + /** + * @dev Removes all the entries from a map. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(BytesToUintMap storage map) internal { + uint256 len = length(map); + for (uint256 i = 0; i < len; ++i) { + delete map._values[map._keys.at(i)]; + } + map._keys.clear(); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(BytesToUintMap storage map, bytes memory key) internal view returns (bool) { + return map._keys.contains(key); + } + + /** + * @dev Returns the number of key-value pairs in the map. O(1). + */ + function length(BytesToUintMap storage map) internal view returns (uint256) { + return map._keys.length(); + } + + /** + * @dev Returns the key-value pair stored at position `index` in the map. O(1). + * + * Note that there are no guarantees on the ordering of entries inside the + * array, and it may change when more entries are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at( + BytesToUintMap storage map, + uint256 index + ) internal view returns (bytes memory key, uint256 value) { + key = map._keys.at(index); + value = map._values[key]; + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet( + BytesToUintMap storage map, + bytes memory key + ) internal view returns (bool exists, uint256 value) { + value = map._values[key]; + exists = value != uint256(0) || contains(map, key); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(BytesToUintMap storage map, bytes memory key) internal view returns (uint256 value) { + bool exists; + (exists, value) = tryGet(map, key); + if (!exists) { + revert EnumerableMapNonexistentBytesKey(key); + } + } + + /** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function keys(BytesToUintMap storage map) internal view returns (bytes[] memory) { + return map._keys.values(); + } + + /** + * @dev Query for a nonexistent map key. + */ + error EnumerableMapNonexistentStringKey(string key); + + struct StringToStringMap { + // Storage of keys + EnumerableSetExtended.StringSet _keys; + mapping(string key => string) _values; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set(StringToStringMap storage map, string memory key, string memory value) internal returns (bool) { + map._values[key] = value; + return map._keys.add(key); + } + + /** + * @dev Removes a key-value pair from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(StringToStringMap storage map, string memory key) internal returns (bool) { + delete map._values[key]; + return map._keys.remove(key); + } + + /** + * @dev Removes all the entries from a map. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(StringToStringMap storage map) internal { + uint256 len = length(map); + for (uint256 i = 0; i < len; ++i) { + delete map._values[map._keys.at(i)]; + } + map._keys.clear(); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(StringToStringMap storage map, string memory key) internal view returns (bool) { + return map._keys.contains(key); + } + + /** + * @dev Returns the number of key-value pairs in the map. O(1). + */ + function length(StringToStringMap storage map) internal view returns (uint256) { + return map._keys.length(); + } + + /** + * @dev Returns the key-value pair stored at position `index` in the map. O(1). + * + * Note that there are no guarantees on the ordering of entries inside the + * array, and it may change when more entries are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at( + StringToStringMap storage map, + uint256 index + ) internal view returns (string memory key, string memory value) { + key = map._keys.at(index); + value = map._values[key]; + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet( + StringToStringMap storage map, + string memory key + ) internal view returns (bool exists, string memory value) { + value = map._values[key]; + exists = bytes(value).length != 0 || contains(map, key); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(StringToStringMap storage map, string memory key) internal view returns (string memory value) { + bool exists; + (exists, value) = tryGet(map, key); + if (!exists) { + revert EnumerableMapNonexistentStringKey(key); + } + } + + /** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function keys(StringToStringMap storage map) internal view returns (string[] memory) { + return map._keys.values(); + } +} diff --git a/contracts/utils/structs/EnumerableSetExtended.sol b/contracts/utils/structs/EnumerableSetExtended.sol new file mode 100644 index 00000000000..82f3ae9da76 --- /dev/null +++ b/contracts/utils/structs/EnumerableSetExtended.sol @@ -0,0 +1,422 @@ +// SPDX-License-Identifier: MIT +// This file was procedurally generated from scripts/generate/templates/EnumerableSetExtended.js. + +pragma solidity ^0.8.20; + +import {Hashes} from "../cryptography/Hashes.sol"; + +/** + * @dev Library for managing + * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of non-value + * types. + * + * Sets have the following properties: + * + * - Elements are added, removed, and checked for existence in constant time + * (O(1)). + * - Elements are enumerated in O(n). No guarantees are made on the ordering. + * - Set can be cleared (all elements removed) in O(n). + * + * ```solidity + * contract Example { + * // Add the library methods + * using EnumerableSetExtended for EnumerableSetExtended.StringSet; + * + * // Declare a set state variable + * EnumerableSetExtended.StringSet private mySet; + * } + * ``` + * + * Sets of type `string` (`StringSet`), `bytes` (`BytesSet`) and + * `bytes32[2]` (`Bytes32x2Set`) are supported. + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure + * unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an + * array of EnumerableSet. + * ==== + * + * NOTE: This is an extension of {EnumerableSet}. + */ +library EnumerableSetExtended { + struct StringSet { + // Storage of set values + string[] _values; + // Position is the index of the value in the `values` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(string value => uint256) _positions; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(StringSet storage self, string memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[value] = self._values.length; + return true; + } else { + return false; + } + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(StringSet storage self, string memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + uint256 position = self._positions[value]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + string memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[lastValue] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[value]; + + return true; + } else { + return false; + } + } + + /** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(StringSet storage set) internal { + uint256 len = length(set); + for (uint256 i = 0; i < len; ++i) { + delete set._positions[set._values[i]]; + } + // Replace when these are available in Arrays.sol + string[] storage array = set._values; + assembly ("memory-safe") { + sstore(array.slot, 0) + } + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(StringSet storage self, string memory value) internal view returns (bool) { + return self._positions[value] != 0; + } + + /** + * @dev Returns the number of values on the set. O(1). + */ + function length(StringSet storage self) internal view returns (uint256) { + return self._values.length; + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(StringSet storage self, uint256 index) internal view returns (string memory) { + return self._values[index]; + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(StringSet storage self) internal view returns (string[] memory) { + return self._values; + } + + struct BytesSet { + // Storage of set values + bytes[] _values; + // Position is the index of the value in the `values` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(bytes value => uint256) _positions; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(BytesSet storage self, bytes memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[value] = self._values.length; + return true; + } else { + return false; + } + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(BytesSet storage self, bytes memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + uint256 position = self._positions[value]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + bytes memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[lastValue] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[value]; + + return true; + } else { + return false; + } + } + + /** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(BytesSet storage set) internal { + uint256 len = length(set); + for (uint256 i = 0; i < len; ++i) { + delete set._positions[set._values[i]]; + } + // Replace when these are available in Arrays.sol + bytes[] storage array = set._values; + assembly ("memory-safe") { + sstore(array.slot, 0) + } + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(BytesSet storage self, bytes memory value) internal view returns (bool) { + return self._positions[value] != 0; + } + + /** + * @dev Returns the number of values on the set. O(1). + */ + function length(BytesSet storage self) internal view returns (uint256) { + return self._values.length; + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(BytesSet storage self, uint256 index) internal view returns (bytes memory) { + return self._values[index]; + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(BytesSet storage self) internal view returns (bytes[] memory) { + return self._values; + } + + struct Bytes32x2Set { + // Storage of set values + bytes32[2][] _values; + // Position is the index of the value in the `values` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(bytes32 valueHash => uint256) _positions; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[_hash(value)] = self._values.length; + return true; + } else { + return false; + } + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + bytes32 valueHash = _hash(value); + uint256 position = self._positions[valueHash]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + bytes32[2] memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[_hash(lastValue)] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[valueHash]; + + return true; + } else { + return false; + } + } + + /** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(Bytes32x2Set storage self) internal { + bytes32[2][] storage v = self._values; + + uint256 len = length(self); + for (uint256 i = 0; i < len; ++i) { + delete self._positions[_hash(v[i])]; + } + assembly ("memory-safe") { + sstore(v.slot, 0) + } + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(Bytes32x2Set storage self, bytes32[2] memory value) internal view returns (bool) { + return self._positions[_hash(value)] != 0; + } + + /** + * @dev Returns the number of values on the set. O(1). + */ + function length(Bytes32x2Set storage self) internal view returns (uint256) { + return self._values.length; + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(Bytes32x2Set storage self, uint256 index) internal view returns (bytes32[2] memory) { + return self._values[index]; + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(Bytes32x2Set storage self) internal view returns (bytes32[2][] memory) { + return self._values; + } + + function _hash(bytes32[2] memory value) private pure returns (bytes32) { + return Hashes.efficientKeccak256(value[0], value[1]); + } +} diff --git a/scripts/generate/run.js b/scripts/generate/run.js index 6779c93f44b..a2f89e16e54 100755 --- a/scripts/generate/run.js +++ b/scripts/generate/run.js @@ -44,6 +44,8 @@ for (const [file, template] of Object.entries({ 'utils/Packing.sol': './templates/Packing.js', 'mocks/StorageSlotMock.sol': './templates/StorageSlotMock.js', 'mocks/TransientSlotMock.sol': './templates/TransientSlotMock.js', + 'utils/structs/EnumerableSetExtended.sol': './templates/EnumerableSetExtended.js', + 'utils/structs/EnumerableMapExtended.sol': './templates/EnumerableMapExtended.js', })) { generateFromTemplate(file, template, './contracts/'); } diff --git a/scripts/generate/templates/Enumerable.opts.js b/scripts/generate/templates/Enumerable.opts.js new file mode 100644 index 00000000000..cad0f4d7908 --- /dev/null +++ b/scripts/generate/templates/Enumerable.opts.js @@ -0,0 +1,64 @@ +const { capitalize, mapValues } = require('../../helpers'); + +const mapType = str => (str == 'uint256' ? 'Uint' : capitalize(str)); + +const formatSetType = type => ({ name: `${mapType(type)}Set`, type }); + +const SET_TYPES = ['bytes32', 'address', 'uint256'].map(formatSetType); + +const formatMapType = (keyType, valueType) => ({ + name: `${mapType(keyType)}To${mapType(valueType)}Map`, + keyType, + valueType, +}); + +const MAP_TYPES = ['uint256', 'address', 'bytes32'] + .flatMap((key, _, array) => array.map(value => [key, value])) + .slice(0, -1) // remove bytes32 → byte32 (last one) that is already defined + .map(args => formatMapType(...args)); + +const extendedTypeDescr = ({ type, size = 0, memory = false }) => { + memory |= size > 0; + + const name = [type == 'uint256' ? 'Uint' : capitalize(type), size].filter(Boolean).join('x'); + const base = size ? type : undefined; + const typeFull = size ? `${type}[${size}]` : type; + const typeLoc = memory ? `${typeFull} memory` : typeFull; + return { name, type: typeFull, typeLoc, base, size, memory }; +}; + +const toExtendedSetTypeDescr = value => ({ name: value.name + 'Set', value }); + +const toExtendedMapTypeDescr = ({ key, value }) => ({ + name: `${key.name}To${value.name}Map`, + keySet: toExtendedSetTypeDescr(key), + key, + value, +}); + +const EXTENDED_SET_TYPES = [ + { type: 'bytes32', size: 2 }, + { type: 'string', memory: true }, + { type: 'bytes', memory: true }, +] + .map(extendedTypeDescr) + .map(toExtendedSetTypeDescr); + +const EXTENDED_MAP_TYPES = [ + { key: { type: 'bytes', memory: true }, value: { type: 'uint256' } }, + { key: { type: 'string', memory: true }, value: { type: 'string', memory: true } }, +] + .map(entry => mapValues(entry, extendedTypeDescr)) + .map(toExtendedMapTypeDescr); + +module.exports = { + SET_TYPES, + MAP_TYPES, + EXTENDED_SET_TYPES, + EXTENDED_MAP_TYPES, + formatSetType, + formatMapType, + extendedTypeDescr, + toExtendedSetTypeDescr, + toExtendedMapTypeDescr, +}; diff --git a/scripts/generate/templates/EnumerableMap.js b/scripts/generate/templates/EnumerableMap.js index 284e5ac0281..8879c7a4b11 100644 --- a/scripts/generate/templates/EnumerableMap.js +++ b/scripts/generate/templates/EnumerableMap.js @@ -1,6 +1,6 @@ const format = require('../format-lines'); const { fromBytes32, toBytes32 } = require('./conversion'); -const { TYPES } = require('./EnumerableMap.opts'); +const { MAP_TYPES } = require('./Enumerable.opts'); const header = `\ pragma solidity ^0.8.20; @@ -290,7 +290,7 @@ module.exports = format( 'using EnumerableSet for EnumerableSet.Bytes32Set;', '', defaultMap, - TYPES.map(details => customMap(details)), + MAP_TYPES.map(details => customMap(details)), ), ).trimEnd(), '}', diff --git a/scripts/generate/templates/EnumerableMap.opts.js b/scripts/generate/templates/EnumerableMap.opts.js deleted file mode 100644 index d26ab05b2ac..00000000000 --- a/scripts/generate/templates/EnumerableMap.opts.js +++ /dev/null @@ -1,19 +0,0 @@ -const { capitalize } = require('../../helpers'); - -const mapType = str => (str == 'uint256' ? 'Uint' : capitalize(str)); - -const formatType = (keyType, valueType) => ({ - name: `${mapType(keyType)}To${mapType(valueType)}Map`, - keyType, - valueType, -}); - -const TYPES = ['uint256', 'address', 'bytes32'] - .flatMap((key, _, array) => array.map(value => [key, value])) - .slice(0, -1) // remove bytes32 → byte32 (last one) that is already defined - .map(args => formatType(...args)); - -module.exports = { - TYPES, - formatType, -}; diff --git a/scripts/generate/templates/EnumerableMapExtended.js b/scripts/generate/templates/EnumerableMapExtended.js new file mode 100644 index 00000000000..b1b55278974 --- /dev/null +++ b/scripts/generate/templates/EnumerableMapExtended.js @@ -0,0 +1,179 @@ +const format = require('../format-lines'); +const { EXTENDED_SET_TYPES, EXTENDED_MAP_TYPES } = require('./Enumerable.opts'); + +const header = `\ +pragma solidity ^0.8.20; + +import {EnumerableSet} from "./EnumerableSet.sol"; +import {EnumerableSetExtended} from "./EnumerableSetExtended.sol"; + +/** + * @dev Library for managing an enumerable variant of Solidity's + * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[\`mapping\`] + * type for non-value types as keys. + * + * Maps have the following properties: + * + * - Entries are added, removed, and checked for existence in constant time + * (O(1)). + * - Entries are enumerated in O(n). No guarantees are made on the ordering. + * - Map can be cleared (all entries removed) in O(n). + * + * \`\`\`solidity + * contract Example { + * // Add the library methods + * using EnumerableMapExtended for EnumerableMapExtended.BytesToUintMap; + * + * // Declare a set state variable + * EnumerableMapExtended.BytesToUintMap private myMap; + * } + * \`\`\` + * + * The following map types are supported: + * + * - \`bytes -> uint256\` (\`BytesToUintMap\`) + * - \`string -> string\` (\`StringToStringMap\`) + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure + * unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an + * array of EnumerableMap. + * ==== + * + * NOTE: Extensions of {EnumerableMap} + */ +`; + +const map = ({ name, keySet, key, value }) => `\ +/** + * @dev Query for a nonexistent map key. + */ +error EnumerableMapNonexistent${key.name}Key(${key.type} key); + +struct ${name} { + // Storage of keys + ${EXTENDED_SET_TYPES.some(el => el.name == keySet.name) ? 'EnumerableSetExtended' : 'EnumerableSet'}.${keySet.name} _keys; + mapping(${key.type} key => ${value.type}) _values; +} + +/** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ +function set(${name} storage map, ${key.typeLoc} key, ${value.typeLoc} value) internal returns (bool) { + map._values[key] = value; + return map._keys.add(key); +} + +/** + * @dev Removes a key-value pair from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ +function remove(${name} storage map, ${key.typeLoc} key) internal returns (bool) { + delete map._values[key]; + return map._keys.remove(key); +} + +/** + * @dev Removes all the entries from a map. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. + */ +function clear(${name} storage map) internal { + uint256 len = length(map); + for (uint256 i = 0; i < len; ++i) { + delete map._values[map._keys.at(i)]; + } + map._keys.clear(); +} + +/** + * @dev Returns true if the key is in the map. O(1). + */ +function contains(${name} storage map, ${key.typeLoc} key) internal view returns (bool) { + return map._keys.contains(key); +} + +/** + * @dev Returns the number of key-value pairs in the map. O(1). + */ +function length(${name} storage map) internal view returns (uint256) { + return map._keys.length(); +} + +/** + * @dev Returns the key-value pair stored at position \`index\` in the map. O(1). + * + * Note that there are no guarantees on the ordering of entries inside the + * array, and it may change when more entries are added or removed. + * + * Requirements: + * + * - \`index\` must be strictly less than {length}. + */ +function at( + ${name} storage map, + uint256 index +) internal view returns (${key.typeLoc} key, ${value.typeLoc} value) { + key = map._keys.at(index); + value = map._values[key]; +} + +/** + * @dev Tries to returns the value associated with \`key\`. O(1). + * Does not revert if \`key\` is not in the map. + */ +function tryGet( + ${name} storage map, + ${key.typeLoc} key +) internal view returns (bool exists, ${value.typeLoc} value) { + value = map._values[key]; + exists = ${value.memory ? 'bytes(value).length != 0' : `value != ${value.type}(0)`} || contains(map, key); +} + +/** + * @dev Returns the value associated with \`key\`. O(1). + * + * Requirements: + * + * - \`key\` must be in the map. + */ +function get(${name} storage map, ${key.typeLoc} key) internal view returns (${value.typeLoc} value) { + bool exists; + (exists, value) = tryGet(map, key); + if (!exists) { + revert EnumerableMapNonexistent${key.name}Key(key); + } +} + +/** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ +function keys(${name} storage map) internal view returns (${key.type}[] memory) { + return map._keys.values(); +} +`; + +// GENERATE +module.exports = format( + header.trimEnd(), + 'library EnumerableMapExtended {', + format( + [].concat('using EnumerableSet for *;', 'using EnumerableSetExtended for *;', '', EXTENDED_MAP_TYPES.map(map)), + ).trimEnd(), + '}', +); diff --git a/scripts/generate/templates/EnumerableSet.js b/scripts/generate/templates/EnumerableSet.js index 3169d6a46f5..26263ba1889 100644 --- a/scripts/generate/templates/EnumerableSet.js +++ b/scripts/generate/templates/EnumerableSet.js @@ -1,6 +1,6 @@ const format = require('../format-lines'); const { fromBytes32, toBytes32 } = require('./conversion'); -const { TYPES } = require('./EnumerableSet.opts'); +const { SET_TYPES } = require('./Enumerable.opts'); const header = `\ pragma solidity ^0.8.20; @@ -267,7 +267,7 @@ module.exports = format( format( [].concat( defaultSet, - TYPES.map(details => customSet(details)), + SET_TYPES.map(details => customSet(details)), ), ).trimEnd(), '}', diff --git a/scripts/generate/templates/EnumerableSet.opts.js b/scripts/generate/templates/EnumerableSet.opts.js deleted file mode 100644 index 739f0acdfe4..00000000000 --- a/scripts/generate/templates/EnumerableSet.opts.js +++ /dev/null @@ -1,12 +0,0 @@ -const { capitalize } = require('../../helpers'); - -const mapType = str => (str == 'uint256' ? 'Uint' : capitalize(str)); - -const formatType = type => ({ - name: `${mapType(type)}Set`, - type, -}); - -const TYPES = ['bytes32', 'address', 'uint256'].map(formatType); - -module.exports = { TYPES, formatType }; diff --git a/scripts/generate/templates/EnumerableSetExtended.js b/scripts/generate/templates/EnumerableSetExtended.js new file mode 100644 index 00000000000..73c4b446160 --- /dev/null +++ b/scripts/generate/templates/EnumerableSetExtended.js @@ -0,0 +1,319 @@ +const format = require('../format-lines'); +const { EXTENDED_SET_TYPES } = require('./Enumerable.opts'); + +const header = `\ +pragma solidity ^0.8.20; + +import {Hashes} from "../cryptography/Hashes.sol"; + +/** + * @dev Library for managing + * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of non-value + * types. + * + * Sets have the following properties: + * + * - Elements are added, removed, and checked for existence in constant time + * (O(1)). + * - Elements are enumerated in O(n). No guarantees are made on the ordering. + * - Set can be cleared (all elements removed) in O(n). + * + * \`\`\`solidity + * contract Example { + * // Add the library methods + * using EnumerableSetExtended for EnumerableSetExtended.StringSet; + * + * // Declare a set state variable + * EnumerableSetExtended.StringSet private mySet; + * } + * \`\`\` + * + * Sets of type \`string\` (\`StringSet\`), \`bytes\` (\`BytesSet\`) and + * \`bytes32[2]\` (\`Bytes32x2Set\`) are supported. + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure + * unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an + * array of EnumerableSet. + * ==== + * + * NOTE: This is an extension of {EnumerableSet}. + */ +`; + +const set = ({ name, value }) => `\ +struct ${name} { + // Storage of set values + ${value.type}[] _values; + // Position is the index of the value in the \`values\` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(${value.type} value => uint256) _positions; +} + +/** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ +function add(${name} storage self, ${value.type} memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[value] = self._values.length; + return true; + } else { + return false; + } +} + +/** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ +function remove(${name} storage self, ${value.type} memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + uint256 position = self._positions[value]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + ${value.type} memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[lastValue] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[value]; + + return true; + } else { + return false; + } +} + +/** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ +function clear(${name} storage set) internal { + uint256 len = length(set); + for (uint256 i = 0; i < len; ++i) { + delete set._positions[set._values[i]]; + } + // Replace when these are available in Arrays.sol + ${value.type}[] storage array = set._values; + assembly ("memory-safe") { + sstore(array.slot, 0) + } +} + +/** + * @dev Returns true if the value is in the set. O(1). + */ +function contains(${name} storage self, ${value.type} memory value) internal view returns (bool) { + return self._positions[value] != 0; +} + +/** + * @dev Returns the number of values on the set. O(1). + */ +function length(${name} storage self) internal view returns (uint256) { + return self._values.length; +} + +/** + * @dev Returns the value stored at position \`index\` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - \`index\` must be strictly less than {length}. + */ +function at(${name} storage self, uint256 index) internal view returns (${value.type} memory) { + return self._values[index]; +} + +/** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ +function values(${name} storage self) internal view returns (${value.type}[] memory) { + return self._values; +} +`; + +const arraySet = ({ name, value }) => `\ +struct ${name} { + // Storage of set values + ${value.type}[] _values; + // Position is the index of the value in the \`values\` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(bytes32 valueHash => uint256) _positions; +} + +/** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ +function add(${name} storage self, ${value.type} memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[_hash(value)] = self._values.length; + return true; + } else { + return false; + } +} + +/** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ +function remove(${name} storage self, ${value.type} memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + bytes32 valueHash = _hash(value); + uint256 position = self._positions[valueHash]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + ${value.type} memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[_hash(lastValue)] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[valueHash]; + + return true; + } else { + return false; + } +} + +/** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ +function clear(${name} storage self) internal { + ${value.type}[] storage v = self._values; + + uint256 len = length(self); + for (uint256 i = 0; i < len; ++i) { + delete self._positions[_hash(v[i])]; + } + assembly ("memory-safe") { + sstore(v.slot, 0) + } +} + +/** + * @dev Returns true if the value is in the set. O(1). + */ +function contains(${name} storage self, ${value.type} memory value) internal view returns (bool) { + return self._positions[_hash(value)] != 0; +} + +/** + * @dev Returns the number of values on the set. O(1). + */ +function length(${name} storage self) internal view returns (uint256) { + return self._values.length; +} + +/** + * @dev Returns the value stored at position \`index\` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - \`index\` must be strictly less than {length}. + */ +function at(${name} storage self, uint256 index) internal view returns (${value.type} memory) { + return self._values[index]; +} + +/** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ +function values(${name} storage self) internal view returns (${value.type}[] memory) { + return self._values; +} +`; + +const hashes = `\ +function _hash(bytes32[2] memory value) private pure returns (bytes32) { + return Hashes.efficientKeccak256(value[0], value[1]); +} +`; + +// GENERATE +module.exports = format( + header.trimEnd(), + 'library EnumerableSetExtended {', + format( + [].concat( + EXTENDED_SET_TYPES.filter(({ value }) => value.size == 0).map(set), + EXTENDED_SET_TYPES.filter(({ value }) => value.size > 0).map(arraySet), + hashes, + ), + ).trimEnd(), + '}', +); diff --git a/test/utils/structs/EnumerableMap.test.js b/test/utils/structs/EnumerableMap.test.js index cb4b77a651f..d512fb32d18 100644 --- a/test/utils/structs/EnumerableMap.test.js +++ b/test/utils/structs/EnumerableMap.test.js @@ -3,17 +3,17 @@ const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); const { mapValues } = require('../../helpers/iterate'); const { generators } = require('../../helpers/random'); -const { TYPES, formatType } = require('../../../scripts/generate/templates/EnumerableMap.opts'); +const { MAP_TYPES, formatMapType } = require('../../../scripts/generate/templates/Enumerable.opts'); const { shouldBehaveLikeMap } = require('./EnumerableMap.behavior'); // Add Bytes32ToBytes32Map that must be tested but is not part of the generated types. -TYPES.unshift(formatType('bytes32', 'bytes32')); +MAP_TYPES.unshift(formatMapType('bytes32', 'bytes32')); async function fixture() { const mock = await ethers.deployContract('$EnumerableMap'); const env = Object.fromEntries( - TYPES.map(({ name, keyType, valueType }) => [ + MAP_TYPES.map(({ name, keyType, valueType }) => [ name, { keyType, @@ -52,7 +52,7 @@ describe('EnumerableMap', function () { Object.assign(this, await loadFixture(fixture)); }); - for (const { name } of TYPES) { + for (const { name } of MAP_TYPES) { describe(name, function () { beforeEach(async function () { Object.assign(this, this.env[name]); diff --git a/test/utils/structs/EnumerableMapExtended.test.js b/test/utils/structs/EnumerableMapExtended.test.js new file mode 100644 index 00000000000..a40b83dd12d --- /dev/null +++ b/test/utils/structs/EnumerableMapExtended.test.js @@ -0,0 +1,66 @@ +const { ethers } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { mapValues } = require('../../helpers/iterate'); +const { generators } = require('../../helpers/random'); +const { EXTENDED_MAP_TYPES } = require('../../../scripts/generate/templates/Enumerable.opts'); + +const { shouldBehaveLikeMap } = require('./EnumerableMap.behavior'); + +async function fixture() { + const mock = await ethers.deployContract('$EnumerableMapExtended'); + + const env = Object.fromEntries( + EXTENDED_MAP_TYPES.map(({ name, key, value }) => [ + name, + { + key, + value, + keys: Array.from({ length: 3 }, generators[key.type]), + values: Array.from({ length: 3 }, generators[value.type]), + zeroValue: generators[value.type].zero, + methods: mapValues( + { + set: `$set(uint256,${key.type},${value.type})`, + get: `$get(uint256,${key.type})`, + tryGet: `$tryGet(uint256,${key.type})`, + remove: `$remove(uint256,${key.type})`, + clear: `$clear_EnumerableMapExtended_${name}(uint256)`, + length: `$length_EnumerableMapExtended_${name}(uint256)`, + at: `$at_EnumerableMapExtended_${name}(uint256,uint256)`, + contains: `$contains(uint256,${key.type})`, + keys: `$keys_EnumerableMapExtended_${name}(uint256)`, + }, + fnSig => + (...args) => + mock.getFunction(fnSig)(0, ...args), + ), + events: { + setReturn: `return$set_EnumerableMapExtended_${name}_${key.type}_${value.type}`, + removeReturn: `return$remove_EnumerableMapExtended_${name}_${key.type}`, + }, + error: key.memory || value.memory ? `EnumerableMapNonexistent${key.name}Key` : `EnumerableMapNonexistentKey`, + }, + ]), + ); + + return { mock, env }; +} + +describe('EnumerableMapExtended', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + for (const { name, key, value } of EXTENDED_MAP_TYPES) { + describe(`${name} (enumerable map from ${key.type} to ${value.type})`, function () { + beforeEach(async function () { + Object.assign(this, this.env[name]); + [this.keyA, this.keyB, this.keyC] = this.keys; + [this.valueA, this.valueB, this.valueC] = this.values; + }); + + shouldBehaveLikeMap(); + }); + } +}); diff --git a/test/utils/structs/EnumerableSet.test.js b/test/utils/structs/EnumerableSet.test.js index 1f92727a4c4..f60adc103a5 100644 --- a/test/utils/structs/EnumerableSet.test.js +++ b/test/utils/structs/EnumerableSet.test.js @@ -3,7 +3,7 @@ const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); const { mapValues } = require('../../helpers/iterate'); const { generators } = require('../../helpers/random'); -const { TYPES } = require('../../../scripts/generate/templates/EnumerableSet.opts'); +const { SET_TYPES } = require('../../../scripts/generate/templates/Enumerable.opts'); const { shouldBehaveLikeSet } = require('./EnumerableSet.behavior'); @@ -20,7 +20,7 @@ async function fixture() { const mock = await ethers.deployContract('$EnumerableSet'); const env = Object.fromEntries( - TYPES.map(({ name, type }) => [ + SET_TYPES.map(({ name, type }) => [ type, { values: Array.from({ length: 3 }, generators[type]), @@ -49,7 +49,7 @@ describe('EnumerableSet', function () { Object.assign(this, await loadFixture(fixture)); }); - for (const { type } of TYPES) { + for (const { type } of SET_TYPES) { describe(type, function () { beforeEach(function () { Object.assign(this, this.env[type]); diff --git a/test/utils/structs/EnumerableSetExtended.test.js b/test/utils/structs/EnumerableSetExtended.test.js new file mode 100644 index 00000000000..3b9d5ad746d --- /dev/null +++ b/test/utils/structs/EnumerableSetExtended.test.js @@ -0,0 +1,62 @@ +const { ethers } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { mapValues } = require('../../helpers/iterate'); +const { generators } = require('../../helpers/random'); +const { EXTENDED_SET_TYPES } = require('../../../scripts/generate/templates/Enumerable.opts'); + +const { shouldBehaveLikeSet } = require('./EnumerableSet.behavior'); + +async function fixture() { + const mock = await ethers.deployContract('$EnumerableSetExtended'); + + const env = Object.fromEntries( + EXTENDED_SET_TYPES.map(({ name, value }) => [ + name, + { + value, + values: Array.from( + { length: 3 }, + value.size ? () => Array.from({ length: value.size }, generators[value.base]) : generators[value.type], + ), + methods: mapValues( + { + add: `$add(uint256,${value.type})`, + remove: `$remove(uint256,${value.type})`, + contains: `$contains(uint256,${value.type})`, + clear: `$clear_EnumerableSetExtended_${name}(uint256)`, + length: `$length_EnumerableSetExtended_${name}(uint256)`, + at: `$at_EnumerableSetExtended_${name}(uint256,uint256)`, + values: `$values_EnumerableSetExtended_${name}(uint256)`, + }, + fnSig => + (...args) => + mock.getFunction(fnSig)(0, ...args), + ), + events: { + addReturn: `return$add_EnumerableSetExtended_${name}_${value.type.replace(/[[\]]/g, '_')}`, + removeReturn: `return$remove_EnumerableSetExtended_${name}_${value.type.replace(/[[\]]/g, '_')}`, + }, + }, + ]), + ); + + return { mock, env }; +} + +describe('EnumerableSetExtended', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + for (const { name, value } of EXTENDED_SET_TYPES) { + describe(`${name} (enumerable set of ${value.type})`, function () { + beforeEach(function () { + Object.assign(this, this.env[name]); + [this.valueA, this.valueB, this.valueC] = this.values; + }); + + shouldBehaveLikeSet(); + }); + } +}); From f7f64eec43c040decc3e08a1c7af855cb03a336d Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sat, 3 May 2025 10:35:51 -0600 Subject: [PATCH 062/110] Add changeset and fix linting --- .changeset/pink-dolls-shop.md | 5 +++++ contracts/utils/structs/EnumerableMapExtended.sol | 10 ++-------- contracts/utils/structs/EnumerableSetExtended.sol | 2 +- scripts/generate/run.js | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 .changeset/pink-dolls-shop.md diff --git a/.changeset/pink-dolls-shop.md b/.changeset/pink-dolls-shop.md new file mode 100644 index 00000000000..7718a738fcd --- /dev/null +++ b/.changeset/pink-dolls-shop.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`EnumerableSetExtended` and `EnumerableMapExtended`: Extensions of the `EnumerableSet` and `EnumerableMap` libraries with more types, including non-value types. diff --git a/contracts/utils/structs/EnumerableMapExtended.sol b/contracts/utils/structs/EnumerableMapExtended.sol index 31dd512afd5..91b912e6d72 100644 --- a/contracts/utils/structs/EnumerableMapExtended.sol +++ b/contracts/utils/structs/EnumerableMapExtended.sol @@ -120,10 +120,7 @@ library EnumerableMapExtended { * * - `index` must be strictly less than {length}. */ - function at( - BytesToUintMap storage map, - uint256 index - ) internal view returns (bytes memory key, uint256 value) { + function at(BytesToUintMap storage map, uint256 index) internal view returns (bytes memory key, uint256 value) { key = map._keys.at(index); value = map._values[key]; } @@ -132,10 +129,7 @@ library EnumerableMapExtended { * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ - function tryGet( - BytesToUintMap storage map, - bytes memory key - ) internal view returns (bool exists, uint256 value) { + function tryGet(BytesToUintMap storage map, bytes memory key) internal view returns (bool exists, uint256 value) { value = map._values[key]; exists = value != uint256(0) || contains(map, key); } diff --git a/contracts/utils/structs/EnumerableSetExtended.sol b/contracts/utils/structs/EnumerableSetExtended.sol index 82f3ae9da76..a5ba388a74f 100644 --- a/contracts/utils/structs/EnumerableSetExtended.sol +++ b/contracts/utils/structs/EnumerableSetExtended.sol @@ -27,7 +27,7 @@ import {Hashes} from "../cryptography/Hashes.sol"; * } * ``` * - * Sets of type `string` (`StringSet`), `bytes` (`BytesSet`) and + * Sets of type `string` (`StringSet`), `bytes` (`BytesSet`) and * `bytes32[2]` (`Bytes32x2Set`) are supported. * * [WARNING] diff --git a/scripts/generate/run.js b/scripts/generate/run.js index a2f89e16e54..68516fa135b 100755 --- a/scripts/generate/run.js +++ b/scripts/generate/run.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -// const cp = require('child_process'); +const cp = require('child_process'); const fs = require('fs'); const path = require('path'); const format = require('./format-lines'); @@ -27,7 +27,7 @@ function generateFromTemplate(file, template, outputPrefix = '') { ); fs.writeFileSync(output, content); - // cp.execFileSync('prettier', ['--write', output]); + cp.execFileSync('prettier', ['--write', output]); } // Contracts From b695659abcbfe833f7f2596e9c24b0790de11a3e Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sun, 1 Jun 2025 21:45:03 -0600 Subject: [PATCH 063/110] Remove TODOs --- .github/actions/setup/action.yml | 3 +-- .github/workflows/checks.yml | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index fe8a85b3f55..3c5fc602e13 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -13,8 +13,7 @@ runs: path: '**/node_modules' key: npm-v3-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - ## TODO: Remove when EIP-7702 authorizations are enabled in latest non-beta ethers version - run: npm ci --legacy-peer-deps + run: npm ci shell: bash if: steps.cache.outputs.cache-hit != 'true' - name: Install Foundry diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index cba9894b3b9..6aca7f30cb4 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -118,8 +118,6 @@ jobs: - uses: actions/checkout@v4 - name: Set up environment uses: ./.github/actions/setup - ## TODO: Remove when EIP-7702 authorizations are enabled in latest non-beta ethers version - - run: rm package-lock.json package.json # Dependencies already installed - uses: crytic/slither-action@v0.4.1 codespell: From 5c4fb8824760226964f0d859619fe43e1cffa303 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sun, 1 Jun 2025 21:46:32 -0600 Subject: [PATCH 064/110] Reset package-lock --- package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a2fecf97526..30fbd0b1c12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4483,9 +4483,9 @@ } }, "node_modules/ethers": { - "version": "6.14.3", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.14.3.tgz", - "integrity": "sha512-qq7ft/oCJohoTcsNPFaXSQUm457MA5iWqkf1Mb11ujONdg7jBI6sAOrHaTi3j0CBqIGFSCeR/RMc+qwRRub7IA==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.14.0.tgz", + "integrity": "sha512-KgHwltNSMdbrGWEyKkM0Rt2s+u1nDH/5BVDQakLinzGEJi4bWindBzZSCC4gKsbZjwDTI6ex/8suR9Ihbmz4IQ==", "dev": true, "funding": [ { @@ -4497,6 +4497,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@adraffy/ens-normalize": "1.10.1", "@noble/curves": "1.2.0", From 8f32638bd24d53a2bf5249c820a62c538c7d3bb2 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Sun, 1 Jun 2025 21:48:34 -0600 Subject: [PATCH 065/110] Revert run.js --- scripts/generate/run.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/generate/run.js b/scripts/generate/run.js index 68516fa135b..6779c93f44b 100755 --- a/scripts/generate/run.js +++ b/scripts/generate/run.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const cp = require('child_process'); +// const cp = require('child_process'); const fs = require('fs'); const path = require('path'); const format = require('./format-lines'); @@ -27,7 +27,7 @@ function generateFromTemplate(file, template, outputPrefix = '') { ); fs.writeFileSync(output, content); - cp.execFileSync('prettier', ['--write', output]); + // cp.execFileSync('prettier', ['--write', output]); } // Contracts @@ -44,8 +44,6 @@ for (const [file, template] of Object.entries({ 'utils/Packing.sol': './templates/Packing.js', 'mocks/StorageSlotMock.sol': './templates/StorageSlotMock.js', 'mocks/TransientSlotMock.sol': './templates/TransientSlotMock.js', - 'utils/structs/EnumerableSetExtended.sol': './templates/EnumerableSetExtended.js', - 'utils/structs/EnumerableMapExtended.sol': './templates/EnumerableMapExtended.js', })) { generateFromTemplate(file, template, './contracts/'); } From b12ca61a09acabae77d2747c21cb2d2b3d2b553d Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 2 Jun 2025 10:42:23 +0200 Subject: [PATCH 066/110] Merge Enumerable{Set,Map}Extended into Enumerable{Set,Map} --- contracts/utils/README.adoc | 5 - contracts/utils/structs/EnumerableMap.sol | 234 +++++++++- .../utils/structs/EnumerableMapExtended.sol | 281 ------------ contracts/utils/structs/EnumerableSet.sol | 378 ++++++++++++++++ .../utils/structs/EnumerableSetExtended.sol | 422 ------------------ scripts/generate/run.js | 4 +- scripts/generate/templates/Enumerable.opts.js | 67 ++- scripts/generate/templates/EnumerableMap.js | 159 ++++++- .../templates/EnumerableMapExtended.js | 179 -------- scripts/generate/templates/EnumerableSet.js | 270 ++++++++++- .../templates/EnumerableSetExtended.js | 319 ------------- test/utils/structs/EnumerableMap.behavior.js | 2 +- test/utils/structs/EnumerableMap.test.js | 59 ++- .../structs/EnumerableMapExtended.test.js | 66 --- test/utils/structs/EnumerableSet.test.js | 31 +- .../structs/EnumerableSetExtended.test.js | 62 --- 16 files changed, 1106 insertions(+), 1432 deletions(-) delete mode 100644 contracts/utils/structs/EnumerableMapExtended.sol delete mode 100644 contracts/utils/structs/EnumerableSetExtended.sol delete mode 100644 scripts/generate/templates/EnumerableMapExtended.js delete mode 100644 scripts/generate/templates/EnumerableSetExtended.js delete mode 100644 test/utils/structs/EnumerableMapExtended.test.js delete mode 100644 test/utils/structs/EnumerableSetExtended.test.js diff --git a/contracts/utils/README.adoc b/contracts/utils/README.adoc index 6a265a9fa6a..10b8e17aafe 100644 --- a/contracts/utils/README.adoc +++ b/contracts/utils/README.adoc @@ -23,7 +23,6 @@ Miscellaneous contracts and libraries containing utility functions you can use t * {BitMaps}: A simple library to manage boolean value mapped to a numerical index in an efficient way. * {EnumerableMap}: A type like Solidity's https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`], but with key-value _enumeration_: this will let you know how many entries a mapping has, and iterate over them (which is not possible with `mapping`). * {EnumerableSet}: Like {EnumerableMap}, but for https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets]. Can be used to store privileged accounts, issued IDs, etc. - * {EnumerableSetExtended} and {EnumerableMapExtended}: Extensions of the `EnumerableSet` and `EnumerableMap` libraries with more types, including non-value types. * {DoubleEndedQueue}: An implementation of a https://en.wikipedia.org/wiki/Double-ended_queue[double ended queue] whose values can be added or removed from both sides. Useful for FIFO and LIFO structures. * {CircularBuffer}: A data structure to store the last N values pushed to it. * {Checkpoints}: A data structure to store values mapped to a strictly increasing key. Can be used for storing and accessing values over time. @@ -121,12 +120,8 @@ Ethereum contracts have no native concept of an interface, so applications must {{EnumerableMap}} -{{EnumerableMapExtended}} - {{EnumerableSet}} -{{EnumerableSetExtended}} - {{DoubleEndedQueue}} {{CircularBuffer}} diff --git a/contracts/utils/structs/EnumerableMap.sol b/contracts/utils/structs/EnumerableMap.sol index 09fa498fcb4..a53ac05ec60 100644 --- a/contracts/utils/structs/EnumerableMap.sol +++ b/contracts/utils/structs/EnumerableMap.sol @@ -39,6 +39,8 @@ import {EnumerableSet} from "./EnumerableSet.sol"; * - `address -> address` (`AddressToAddressMap`) since v5.1.0 * - `address -> bytes32` (`AddressToBytes32Map`) since v5.1.0 * - `bytes32 -> address` (`Bytes32ToAddressMap`) since v5.1.0 + * - `bytes -> uint256` (`BytesToUintMap`) since v5.4.0 + * - `string -> string` (`StringToStringMap`) since v5.4.0 * * [WARNING] * ==== @@ -51,7 +53,7 @@ import {EnumerableSet} from "./EnumerableSet.sol"; * ==== */ library EnumerableMap { - using EnumerableSet for EnumerableSet.Bytes32Set; + using EnumerableSet for *; // To implement this library for multiple types with as little code repetition as possible, we write it in // terms of a generic Map type with bytes32 keys and values. The Map implementation uses private functions, @@ -997,4 +999,234 @@ library EnumerableMap { return result; } + + /** + * @dev Query for a nonexistent map key. + */ + error EnumerableMapNonexistentBytesKey(bytes key); + + struct BytesToUintMap { + // Storage of keys + EnumerableSet.BytesSet _keys; + mapping(bytes key => uint256) _values; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set(BytesToUintMap storage map, bytes memory key, uint256 value) internal returns (bool) { + map._values[key] = value; + return map._keys.add(key); + } + + /** + * @dev Removes a key-value pair from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(BytesToUintMap storage map, bytes memory key) internal returns (bool) { + delete map._values[key]; + return map._keys.remove(key); + } + + /** + * @dev Removes all the entries from a map. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(BytesToUintMap storage map) internal { + uint256 len = length(map); + for (uint256 i = 0; i < len; ++i) { + delete map._values[map._keys.at(i)]; + } + map._keys.clear(); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(BytesToUintMap storage map, bytes memory key) internal view returns (bool) { + return map._keys.contains(key); + } + + /** + * @dev Returns the number of key-value pairs in the map. O(1). + */ + function length(BytesToUintMap storage map) internal view returns (uint256) { + return map._keys.length(); + } + + /** + * @dev Returns the key-value pair stored at position `index` in the map. O(1). + * + * Note that there are no guarantees on the ordering of entries inside the + * array, and it may change when more entries are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(BytesToUintMap storage map, uint256 index) internal view returns (bytes memory key, uint256 value) { + key = map._keys.at(index); + value = map._values[key]; + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet(BytesToUintMap storage map, bytes memory key) internal view returns (bool exists, uint256 value) { + value = map._values[key]; + exists = value != uint256(0) || contains(map, key); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(BytesToUintMap storage map, bytes memory key) internal view returns (uint256 value) { + bool exists; + (exists, value) = tryGet(map, key); + if (!exists) { + revert EnumerableMapNonexistentBytesKey(key); + } + } + + /** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function keys(BytesToUintMap storage map) internal view returns (bytes[] memory) { + return map._keys.values(); + } + + /** + * @dev Query for a nonexistent map key. + */ + error EnumerableMapNonexistentStringKey(string key); + + struct StringToStringMap { + // Storage of keys + EnumerableSet.StringSet _keys; + mapping(string key => string) _values; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set(StringToStringMap storage map, string memory key, string memory value) internal returns (bool) { + map._values[key] = value; + return map._keys.add(key); + } + + /** + * @dev Removes a key-value pair from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(StringToStringMap storage map, string memory key) internal returns (bool) { + delete map._values[key]; + return map._keys.remove(key); + } + + /** + * @dev Removes all the entries from a map. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(StringToStringMap storage map) internal { + uint256 len = length(map); + for (uint256 i = 0; i < len; ++i) { + delete map._values[map._keys.at(i)]; + } + map._keys.clear(); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(StringToStringMap storage map, string memory key) internal view returns (bool) { + return map._keys.contains(key); + } + + /** + * @dev Returns the number of key-value pairs in the map. O(1). + */ + function length(StringToStringMap storage map) internal view returns (uint256) { + return map._keys.length(); + } + + /** + * @dev Returns the key-value pair stored at position `index` in the map. O(1). + * + * Note that there are no guarantees on the ordering of entries inside the + * array, and it may change when more entries are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at( + StringToStringMap storage map, + uint256 index + ) internal view returns (string memory key, string memory value) { + key = map._keys.at(index); + value = map._values[key]; + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet( + StringToStringMap storage map, + string memory key + ) internal view returns (bool exists, string memory value) { + value = map._values[key]; + exists = bytes(value).length != 0 || contains(map, key); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(StringToStringMap storage map, string memory key) internal view returns (string memory value) { + bool exists; + (exists, value) = tryGet(map, key); + if (!exists) { + revert EnumerableMapNonexistentStringKey(key); + } + } + + /** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function keys(StringToStringMap storage map) internal view returns (string[] memory) { + return map._keys.values(); + } } diff --git a/contracts/utils/structs/EnumerableMapExtended.sol b/contracts/utils/structs/EnumerableMapExtended.sol deleted file mode 100644 index 91b912e6d72..00000000000 --- a/contracts/utils/structs/EnumerableMapExtended.sol +++ /dev/null @@ -1,281 +0,0 @@ -// SPDX-License-Identifier: MIT -// This file was procedurally generated from scripts/generate/templates/EnumerableMapExtended.js. - -pragma solidity ^0.8.20; - -import {EnumerableSet} from "./EnumerableSet.sol"; -import {EnumerableSetExtended} from "./EnumerableSetExtended.sol"; - -/** - * @dev Library for managing an enumerable variant of Solidity's - * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] - * type for non-value types as keys. - * - * Maps have the following properties: - * - * - Entries are added, removed, and checked for existence in constant time - * (O(1)). - * - Entries are enumerated in O(n). No guarantees are made on the ordering. - * - Map can be cleared (all entries removed) in O(n). - * - * ```solidity - * contract Example { - * // Add the library methods - * using EnumerableMapExtended for EnumerableMapExtended.BytesToUintMap; - * - * // Declare a set state variable - * EnumerableMapExtended.BytesToUintMap private myMap; - * } - * ``` - * - * The following map types are supported: - * - * - `bytes -> uint256` (`BytesToUintMap`) - * - `string -> string` (`StringToStringMap`) - * - * [WARNING] - * ==== - * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure - * unusable. - * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. - * - * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an - * array of EnumerableMap. - * ==== - * - * NOTE: Extensions of {EnumerableMap} - */ -library EnumerableMapExtended { - using EnumerableSet for *; - using EnumerableSetExtended for *; - - /** - * @dev Query for a nonexistent map key. - */ - error EnumerableMapNonexistentBytesKey(bytes key); - - struct BytesToUintMap { - // Storage of keys - EnumerableSetExtended.BytesSet _keys; - mapping(bytes key => uint256) _values; - } - - /** - * @dev Adds a key-value pair to a map, or updates the value for an existing - * key. O(1). - * - * Returns true if the key was added to the map, that is if it was not - * already present. - */ - function set(BytesToUintMap storage map, bytes memory key, uint256 value) internal returns (bool) { - map._values[key] = value; - return map._keys.add(key); - } - - /** - * @dev Removes a key-value pair from a map. O(1). - * - * Returns true if the key was removed from the map, that is if it was present. - */ - function remove(BytesToUintMap storage map, bytes memory key) internal returns (bool) { - delete map._values[key]; - return map._keys.remove(key); - } - - /** - * @dev Removes all the entries from a map. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(BytesToUintMap storage map) internal { - uint256 len = length(map); - for (uint256 i = 0; i < len; ++i) { - delete map._values[map._keys.at(i)]; - } - map._keys.clear(); - } - - /** - * @dev Returns true if the key is in the map. O(1). - */ - function contains(BytesToUintMap storage map, bytes memory key) internal view returns (bool) { - return map._keys.contains(key); - } - - /** - * @dev Returns the number of key-value pairs in the map. O(1). - */ - function length(BytesToUintMap storage map) internal view returns (uint256) { - return map._keys.length(); - } - - /** - * @dev Returns the key-value pair stored at position `index` in the map. O(1). - * - * Note that there are no guarantees on the ordering of entries inside the - * array, and it may change when more entries are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at(BytesToUintMap storage map, uint256 index) internal view returns (bytes memory key, uint256 value) { - key = map._keys.at(index); - value = map._values[key]; - } - - /** - * @dev Tries to returns the value associated with `key`. O(1). - * Does not revert if `key` is not in the map. - */ - function tryGet(BytesToUintMap storage map, bytes memory key) internal view returns (bool exists, uint256 value) { - value = map._values[key]; - exists = value != uint256(0) || contains(map, key); - } - - /** - * @dev Returns the value associated with `key`. O(1). - * - * Requirements: - * - * - `key` must be in the map. - */ - function get(BytesToUintMap storage map, bytes memory key) internal view returns (uint256 value) { - bool exists; - (exists, value) = tryGet(map, key); - if (!exists) { - revert EnumerableMapNonexistentBytesKey(key); - } - } - - /** - * @dev Return the an array containing all the keys - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function keys(BytesToUintMap storage map) internal view returns (bytes[] memory) { - return map._keys.values(); - } - - /** - * @dev Query for a nonexistent map key. - */ - error EnumerableMapNonexistentStringKey(string key); - - struct StringToStringMap { - // Storage of keys - EnumerableSetExtended.StringSet _keys; - mapping(string key => string) _values; - } - - /** - * @dev Adds a key-value pair to a map, or updates the value for an existing - * key. O(1). - * - * Returns true if the key was added to the map, that is if it was not - * already present. - */ - function set(StringToStringMap storage map, string memory key, string memory value) internal returns (bool) { - map._values[key] = value; - return map._keys.add(key); - } - - /** - * @dev Removes a key-value pair from a map. O(1). - * - * Returns true if the key was removed from the map, that is if it was present. - */ - function remove(StringToStringMap storage map, string memory key) internal returns (bool) { - delete map._values[key]; - return map._keys.remove(key); - } - - /** - * @dev Removes all the entries from a map. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(StringToStringMap storage map) internal { - uint256 len = length(map); - for (uint256 i = 0; i < len; ++i) { - delete map._values[map._keys.at(i)]; - } - map._keys.clear(); - } - - /** - * @dev Returns true if the key is in the map. O(1). - */ - function contains(StringToStringMap storage map, string memory key) internal view returns (bool) { - return map._keys.contains(key); - } - - /** - * @dev Returns the number of key-value pairs in the map. O(1). - */ - function length(StringToStringMap storage map) internal view returns (uint256) { - return map._keys.length(); - } - - /** - * @dev Returns the key-value pair stored at position `index` in the map. O(1). - * - * Note that there are no guarantees on the ordering of entries inside the - * array, and it may change when more entries are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at( - StringToStringMap storage map, - uint256 index - ) internal view returns (string memory key, string memory value) { - key = map._keys.at(index); - value = map._values[key]; - } - - /** - * @dev Tries to returns the value associated with `key`. O(1). - * Does not revert if `key` is not in the map. - */ - function tryGet( - StringToStringMap storage map, - string memory key - ) internal view returns (bool exists, string memory value) { - value = map._values[key]; - exists = bytes(value).length != 0 || contains(map, key); - } - - /** - * @dev Returns the value associated with `key`. O(1). - * - * Requirements: - * - * - `key` must be in the map. - */ - function get(StringToStringMap storage map, string memory key) internal view returns (string memory value) { - bool exists; - (exists, value) = tryGet(map, key); - if (!exists) { - revert EnumerableMapNonexistentStringKey(key); - } - } - - /** - * @dev Return the an array containing all the keys - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function keys(StringToStringMap storage map) internal view returns (string[] memory) { - return map._keys.values(); - } -} diff --git a/contracts/utils/structs/EnumerableSet.sol b/contracts/utils/structs/EnumerableSet.sol index ec8bb377965..f70a4d19334 100644 --- a/contracts/utils/structs/EnumerableSet.sol +++ b/contracts/utils/structs/EnumerableSet.sol @@ -5,6 +5,7 @@ pragma solidity ^0.8.20; import {Arrays} from "../Arrays.sol"; +import {Hashes} from "../cryptography/Hashes.sol"; /** * @dev Library for managing @@ -419,4 +420,381 @@ library EnumerableSet { return result; } + + struct StringSet { + // Storage of set values + string[] _values; + // Position is the index of the value in the `values` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(string value => uint256) _positions; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(StringSet storage self, string memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[value] = self._values.length; + return true; + } else { + return false; + } + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(StringSet storage self, string memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + uint256 position = self._positions[value]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + string memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[lastValue] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[value]; + + return true; + } else { + return false; + } + } + + /** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(StringSet storage set) internal { + uint256 len = length(set); + for (uint256 i = 0; i < len; ++i) { + delete set._positions[set._values[i]]; + } + // Replace when these are available in Arrays.sol + string[] storage array = set._values; + assembly ("memory-safe") { + sstore(array.slot, 0) + } + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(StringSet storage self, string memory value) internal view returns (bool) { + return self._positions[value] != 0; + } + + /** + * @dev Returns the number of values on the set. O(1). + */ + function length(StringSet storage self) internal view returns (uint256) { + return self._values.length; + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(StringSet storage self, uint256 index) internal view returns (string memory) { + return self._values[index]; + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(StringSet storage self) internal view returns (string[] memory) { + return self._values; + } + + struct BytesSet { + // Storage of set values + bytes[] _values; + // Position is the index of the value in the `values` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(bytes value => uint256) _positions; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(BytesSet storage self, bytes memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[value] = self._values.length; + return true; + } else { + return false; + } + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(BytesSet storage self, bytes memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + uint256 position = self._positions[value]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + bytes memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[lastValue] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[value]; + + return true; + } else { + return false; + } + } + + /** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(BytesSet storage set) internal { + uint256 len = length(set); + for (uint256 i = 0; i < len; ++i) { + delete set._positions[set._values[i]]; + } + // Replace when these are available in Arrays.sol + bytes[] storage array = set._values; + assembly ("memory-safe") { + sstore(array.slot, 0) + } + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(BytesSet storage self, bytes memory value) internal view returns (bool) { + return self._positions[value] != 0; + } + + /** + * @dev Returns the number of values on the set. O(1). + */ + function length(BytesSet storage self) internal view returns (uint256) { + return self._values.length; + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(BytesSet storage self, uint256 index) internal view returns (bytes memory) { + return self._values[index]; + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(BytesSet storage self) internal view returns (bytes[] memory) { + return self._values; + } + + struct Bytes32x2Set { + // Storage of set values + bytes32[2][] _values; + // Position is the index of the value in the `values` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(bytes32 valueHash => uint256) _positions; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[_hash(value)] = self._values.length; + return true; + } else { + return false; + } + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + bytes32 valueHash = _hash(value); + uint256 position = self._positions[valueHash]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + bytes32[2] memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[_hash(lastValue)] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[valueHash]; + + return true; + } else { + return false; + } + } + + /** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ + function clear(Bytes32x2Set storage self) internal { + bytes32[2][] storage v = self._values; + + uint256 len = length(self); + for (uint256 i = 0; i < len; ++i) { + delete self._positions[_hash(v[i])]; + } + assembly ("memory-safe") { + sstore(v.slot, 0) + } + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(Bytes32x2Set storage self, bytes32[2] memory value) internal view returns (bool) { + return self._positions[_hash(value)] != 0; + } + + /** + * @dev Returns the number of values on the set. O(1). + */ + function length(Bytes32x2Set storage self) internal view returns (uint256) { + return self._values.length; + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(Bytes32x2Set storage self, uint256 index) internal view returns (bytes32[2] memory) { + return self._values[index]; + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(Bytes32x2Set storage self) internal view returns (bytes32[2][] memory) { + return self._values; + } + + function _hash(bytes32[2] memory value) private pure returns (bytes32) { + return Hashes.efficientKeccak256(value[0], value[1]); + } } diff --git a/contracts/utils/structs/EnumerableSetExtended.sol b/contracts/utils/structs/EnumerableSetExtended.sol deleted file mode 100644 index a5ba388a74f..00000000000 --- a/contracts/utils/structs/EnumerableSetExtended.sol +++ /dev/null @@ -1,422 +0,0 @@ -// SPDX-License-Identifier: MIT -// This file was procedurally generated from scripts/generate/templates/EnumerableSetExtended.js. - -pragma solidity ^0.8.20; - -import {Hashes} from "../cryptography/Hashes.sol"; - -/** - * @dev Library for managing - * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of non-value - * types. - * - * Sets have the following properties: - * - * - Elements are added, removed, and checked for existence in constant time - * (O(1)). - * - Elements are enumerated in O(n). No guarantees are made on the ordering. - * - Set can be cleared (all elements removed) in O(n). - * - * ```solidity - * contract Example { - * // Add the library methods - * using EnumerableSetExtended for EnumerableSetExtended.StringSet; - * - * // Declare a set state variable - * EnumerableSetExtended.StringSet private mySet; - * } - * ``` - * - * Sets of type `string` (`StringSet`), `bytes` (`BytesSet`) and - * `bytes32[2]` (`Bytes32x2Set`) are supported. - * - * [WARNING] - * ==== - * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure - * unusable. - * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. - * - * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an - * array of EnumerableSet. - * ==== - * - * NOTE: This is an extension of {EnumerableSet}. - */ -library EnumerableSetExtended { - struct StringSet { - // Storage of set values - string[] _values; - // Position is the index of the value in the `values` array plus 1. - // Position 0 is used to mean a value is not in the set. - mapping(string value => uint256) _positions; - } - - /** - * @dev Add a value to a set. O(1). - * - * Returns true if the value was added to the set, that is if it was not - * already present. - */ - function add(StringSet storage self, string memory value) internal returns (bool) { - if (!contains(self, value)) { - self._values.push(value); - // The value is stored at length-1, but we add 1 to all indexes - // and use 0 as a sentinel value - self._positions[value] = self._values.length; - return true; - } else { - return false; - } - } - - /** - * @dev Removes a value from a set. O(1). - * - * Returns true if the value was removed from the set, that is if it was - * present. - */ - function remove(StringSet storage self, string memory value) internal returns (bool) { - // We cache the value's position to prevent multiple reads from the same storage slot - uint256 position = self._positions[value]; - - if (position != 0) { - // Equivalent to contains(self, value) - // To delete an element from the _values array in O(1), we swap the element to delete with the last one in - // the array, and then remove the last element (sometimes called as 'swap and pop'). - // This modifies the order of the array, as noted in {at}. - - uint256 valueIndex = position - 1; - uint256 lastIndex = self._values.length - 1; - - if (valueIndex != lastIndex) { - string memory lastValue = self._values[lastIndex]; - - // Move the lastValue to the index where the value to delete is - self._values[valueIndex] = lastValue; - // Update the tracked position of the lastValue (that was just moved) - self._positions[lastValue] = position; - } - - // Delete the slot where the moved value was stored - self._values.pop(); - - // Delete the tracked position for the deleted slot - delete self._positions[value]; - - return true; - } else { - return false; - } - } - - /** - * @dev Removes all the values from a set. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(StringSet storage set) internal { - uint256 len = length(set); - for (uint256 i = 0; i < len; ++i) { - delete set._positions[set._values[i]]; - } - // Replace when these are available in Arrays.sol - string[] storage array = set._values; - assembly ("memory-safe") { - sstore(array.slot, 0) - } - } - - /** - * @dev Returns true if the value is in the set. O(1). - */ - function contains(StringSet storage self, string memory value) internal view returns (bool) { - return self._positions[value] != 0; - } - - /** - * @dev Returns the number of values on the set. O(1). - */ - function length(StringSet storage self) internal view returns (uint256) { - return self._values.length; - } - - /** - * @dev Returns the value stored at position `index` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at(StringSet storage self, uint256 index) internal view returns (string memory) { - return self._values[index]; - } - - /** - * @dev Return the entire set in an array - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function values(StringSet storage self) internal view returns (string[] memory) { - return self._values; - } - - struct BytesSet { - // Storage of set values - bytes[] _values; - // Position is the index of the value in the `values` array plus 1. - // Position 0 is used to mean a value is not in the set. - mapping(bytes value => uint256) _positions; - } - - /** - * @dev Add a value to a set. O(1). - * - * Returns true if the value was added to the set, that is if it was not - * already present. - */ - function add(BytesSet storage self, bytes memory value) internal returns (bool) { - if (!contains(self, value)) { - self._values.push(value); - // The value is stored at length-1, but we add 1 to all indexes - // and use 0 as a sentinel value - self._positions[value] = self._values.length; - return true; - } else { - return false; - } - } - - /** - * @dev Removes a value from a set. O(1). - * - * Returns true if the value was removed from the set, that is if it was - * present. - */ - function remove(BytesSet storage self, bytes memory value) internal returns (bool) { - // We cache the value's position to prevent multiple reads from the same storage slot - uint256 position = self._positions[value]; - - if (position != 0) { - // Equivalent to contains(self, value) - // To delete an element from the _values array in O(1), we swap the element to delete with the last one in - // the array, and then remove the last element (sometimes called as 'swap and pop'). - // This modifies the order of the array, as noted in {at}. - - uint256 valueIndex = position - 1; - uint256 lastIndex = self._values.length - 1; - - if (valueIndex != lastIndex) { - bytes memory lastValue = self._values[lastIndex]; - - // Move the lastValue to the index where the value to delete is - self._values[valueIndex] = lastValue; - // Update the tracked position of the lastValue (that was just moved) - self._positions[lastValue] = position; - } - - // Delete the slot where the moved value was stored - self._values.pop(); - - // Delete the tracked position for the deleted slot - delete self._positions[value]; - - return true; - } else { - return false; - } - } - - /** - * @dev Removes all the values from a set. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(BytesSet storage set) internal { - uint256 len = length(set); - for (uint256 i = 0; i < len; ++i) { - delete set._positions[set._values[i]]; - } - // Replace when these are available in Arrays.sol - bytes[] storage array = set._values; - assembly ("memory-safe") { - sstore(array.slot, 0) - } - } - - /** - * @dev Returns true if the value is in the set. O(1). - */ - function contains(BytesSet storage self, bytes memory value) internal view returns (bool) { - return self._positions[value] != 0; - } - - /** - * @dev Returns the number of values on the set. O(1). - */ - function length(BytesSet storage self) internal view returns (uint256) { - return self._values.length; - } - - /** - * @dev Returns the value stored at position `index` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at(BytesSet storage self, uint256 index) internal view returns (bytes memory) { - return self._values[index]; - } - - /** - * @dev Return the entire set in an array - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function values(BytesSet storage self) internal view returns (bytes[] memory) { - return self._values; - } - - struct Bytes32x2Set { - // Storage of set values - bytes32[2][] _values; - // Position is the index of the value in the `values` array plus 1. - // Position 0 is used to mean a value is not in the set. - mapping(bytes32 valueHash => uint256) _positions; - } - - /** - * @dev Add a value to a set. O(1). - * - * Returns true if the value was added to the set, that is if it was not - * already present. - */ - function add(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { - if (!contains(self, value)) { - self._values.push(value); - // The value is stored at length-1, but we add 1 to all indexes - // and use 0 as a sentinel value - self._positions[_hash(value)] = self._values.length; - return true; - } else { - return false; - } - } - - /** - * @dev Removes a value from a set. O(1). - * - * Returns true if the value was removed from the set, that is if it was - * present. - */ - function remove(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { - // We cache the value's position to prevent multiple reads from the same storage slot - bytes32 valueHash = _hash(value); - uint256 position = self._positions[valueHash]; - - if (position != 0) { - // Equivalent to contains(self, value) - // To delete an element from the _values array in O(1), we swap the element to delete with the last one in - // the array, and then remove the last element (sometimes called as 'swap and pop'). - // This modifies the order of the array, as noted in {at}. - - uint256 valueIndex = position - 1; - uint256 lastIndex = self._values.length - 1; - - if (valueIndex != lastIndex) { - bytes32[2] memory lastValue = self._values[lastIndex]; - - // Move the lastValue to the index where the value to delete is - self._values[valueIndex] = lastValue; - // Update the tracked position of the lastValue (that was just moved) - self._positions[_hash(lastValue)] = position; - } - - // Delete the slot where the moved value was stored - self._values.pop(); - - // Delete the tracked position for the deleted slot - delete self._positions[valueHash]; - - return true; - } else { - return false; - } - } - - /** - * @dev Removes all the values from a set. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(Bytes32x2Set storage self) internal { - bytes32[2][] storage v = self._values; - - uint256 len = length(self); - for (uint256 i = 0; i < len; ++i) { - delete self._positions[_hash(v[i])]; - } - assembly ("memory-safe") { - sstore(v.slot, 0) - } - } - - /** - * @dev Returns true if the value is in the set. O(1). - */ - function contains(Bytes32x2Set storage self, bytes32[2] memory value) internal view returns (bool) { - return self._positions[_hash(value)] != 0; - } - - /** - * @dev Returns the number of values on the set. O(1). - */ - function length(Bytes32x2Set storage self) internal view returns (uint256) { - return self._values.length; - } - - /** - * @dev Returns the value stored at position `index` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at(Bytes32x2Set storage self, uint256 index) internal view returns (bytes32[2] memory) { - return self._values[index]; - } - - /** - * @dev Return the entire set in an array - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function values(Bytes32x2Set storage self) internal view returns (bytes32[2][] memory) { - return self._values; - } - - function _hash(bytes32[2] memory value) private pure returns (bytes32) { - return Hashes.efficientKeccak256(value[0], value[1]); - } -} diff --git a/scripts/generate/run.js b/scripts/generate/run.js index 6779c93f44b..b06685adee7 100755 --- a/scripts/generate/run.js +++ b/scripts/generate/run.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -// const cp = require('child_process'); +const cp = require('child_process'); const fs = require('fs'); const path = require('path'); const format = require('./format-lines'); @@ -27,7 +27,7 @@ function generateFromTemplate(file, template, outputPrefix = '') { ); fs.writeFileSync(output, content); - // cp.execFileSync('prettier', ['--write', output]); + cp.execFileSync('prettier', ['--write', output]); } // Contracts diff --git a/scripts/generate/templates/Enumerable.opts.js b/scripts/generate/templates/Enumerable.opts.js index cad0f4d7908..611e969d1d6 100644 --- a/scripts/generate/templates/Enumerable.opts.js +++ b/scripts/generate/templates/Enumerable.opts.js @@ -1,23 +1,6 @@ const { capitalize, mapValues } = require('../../helpers'); -const mapType = str => (str == 'uint256' ? 'Uint' : capitalize(str)); - -const formatSetType = type => ({ name: `${mapType(type)}Set`, type }); - -const SET_TYPES = ['bytes32', 'address', 'uint256'].map(formatSetType); - -const formatMapType = (keyType, valueType) => ({ - name: `${mapType(keyType)}To${mapType(valueType)}Map`, - keyType, - valueType, -}); - -const MAP_TYPES = ['uint256', 'address', 'bytes32'] - .flatMap((key, _, array) => array.map(value => [key, value])) - .slice(0, -1) // remove bytes32 → byte32 (last one) that is already defined - .map(args => formatMapType(...args)); - -const extendedTypeDescr = ({ type, size = 0, memory = false }) => { +const typeDescr = ({ type, size = 0, memory = false }) => { memory |= size > 0; const name = [type == 'uint256' ? 'Uint' : capitalize(type), size].filter(Boolean).join('x'); @@ -27,38 +10,46 @@ const extendedTypeDescr = ({ type, size = 0, memory = false }) => { return { name, type: typeFull, typeLoc, base, size, memory }; }; -const toExtendedSetTypeDescr = value => ({ name: value.name + 'Set', value }); +const toSetTypeDescr = value => ({ + name: value.name + 'Set', + value, +}); -const toExtendedMapTypeDescr = ({ key, value }) => ({ +const toMapTypeDescr = ({ key, value }) => ({ name: `${key.name}To${value.name}Map`, - keySet: toExtendedSetTypeDescr(key), + keySet: toSetTypeDescr(key), key, value, }); -const EXTENDED_SET_TYPES = [ +const SET_TYPES = [ + { type: 'bytes32' }, + { type: 'address' }, + { type: 'uint256' }, { type: 'bytes32', size: 2 }, { type: 'string', memory: true }, { type: 'bytes', memory: true }, ] - .map(extendedTypeDescr) - .map(toExtendedSetTypeDescr); - -const EXTENDED_MAP_TYPES = [ - { key: { type: 'bytes', memory: true }, value: { type: 'uint256' } }, - { key: { type: 'string', memory: true }, value: { type: 'string', memory: true } }, -] - .map(entry => mapValues(entry, extendedTypeDescr)) - .map(toExtendedMapTypeDescr); + .map(typeDescr) + .map(toSetTypeDescr); + +const MAP_TYPES = [] + .concat( + // value type maps + ['uint256', 'address', 'bytes32'] + .flatMap((keyType, _, array) => array.map(valueType => ({ key: { type: keyType }, value: { type: valueType } }))) + .slice(0, -1), // remove bytes32 → byte32 (last one) that is already defined + // non-value type maps + { key: { type: 'bytes', memory: true }, value: { type: 'uint256' } }, + { key: { type: 'string', memory: true }, value: { type: 'string', memory: true } }, + ) + .map(entry => mapValues(entry, typeDescr)) + .map(toMapTypeDescr); module.exports = { SET_TYPES, MAP_TYPES, - EXTENDED_SET_TYPES, - EXTENDED_MAP_TYPES, - formatSetType, - formatMapType, - extendedTypeDescr, - toExtendedSetTypeDescr, - toExtendedMapTypeDescr, + typeDescr, + toSetTypeDescr, + toMapTypeDescr, }; diff --git a/scripts/generate/templates/EnumerableMap.js b/scripts/generate/templates/EnumerableMap.js index 8879c7a4b11..7e52b2eb3c6 100644 --- a/scripts/generate/templates/EnumerableMap.js +++ b/scripts/generate/templates/EnumerableMap.js @@ -40,6 +40,8 @@ import {EnumerableSet} from "./EnumerableSet.sol"; * - \`address -> address\` (\`AddressToAddressMap\`) since v5.1.0 * - \`address -> bytes32\` (\`AddressToBytes32Map\`) since v5.1.0 * - \`bytes32 -> address\` (\`Bytes32ToAddressMap\`) since v5.1.0 + * - \`bytes -> uint256\` (\`BytesToUintMap\`) since v5.4.0 + * - \`string -> string\` (\`StringToStringMap\`) since v5.4.0 * * [WARNING] * ==== @@ -176,7 +178,7 @@ function keys(Bytes32ToBytes32Map storage map) internal view returns (bytes32[] } `; -const customMap = ({ name, keyType, valueType }) => `\ +const customMap = ({ name, key, value }) => `\ // ${name} struct ${name} { @@ -190,8 +192,8 @@ struct ${name} { * Returns true if the key was added to the map, that is if it was not * already present. */ -function set(${name} storage map, ${keyType} key, ${valueType} value) internal returns (bool) { - return set(map._inner, ${toBytes32(keyType, 'key')}, ${toBytes32(valueType, 'value')}); +function set(${name} storage map, ${key.type} key, ${value.type} value) internal returns (bool) { + return set(map._inner, ${toBytes32(key.type, 'key')}, ${toBytes32(value.type, 'value')}); } /** @@ -199,8 +201,8 @@ function set(${name} storage map, ${keyType} key, ${valueType} value) internal r * * Returns true if the key was removed from the map, that is if it was present. */ -function remove(${name} storage map, ${keyType} key) internal returns (bool) { - return remove(map._inner, ${toBytes32(keyType, 'key')}); +function remove(${name} storage map, ${key.type} key) internal returns (bool) { + return remove(map._inner, ${toBytes32(key.type, 'key')}); } /** @@ -216,8 +218,8 @@ function clear(${name} storage map) internal { /** * @dev Returns true if the key is in the map. O(1). */ -function contains(${name} storage map, ${keyType} key) internal view returns (bool) { - return contains(map._inner, ${toBytes32(keyType, 'key')}); +function contains(${name} storage map, ${key.type} key) internal view returns (bool) { + return contains(map._inner, ${toBytes32(key.type, 'key')}); } /** @@ -236,18 +238,18 @@ function length(${name} storage map) internal view returns (uint256) { * * - \`index\` must be strictly less than {length}. */ -function at(${name} storage map, uint256 index) internal view returns (${keyType} key, ${valueType} value) { +function at(${name} storage map, uint256 index) internal view returns (${key.type} key, ${value.type} value) { (bytes32 atKey, bytes32 val) = at(map._inner, index); - return (${fromBytes32(keyType, 'atKey')}, ${fromBytes32(valueType, 'val')}); + return (${fromBytes32(key.type, 'atKey')}, ${fromBytes32(value.type, 'val')}); } /** * @dev Tries to returns the value associated with \`key\`. O(1). * Does not revert if \`key\` is not in the map. */ -function tryGet(${name} storage map, ${keyType} key) internal view returns (bool exists, ${valueType} value) { - (bool success, bytes32 val) = tryGet(map._inner, ${toBytes32(keyType, 'key')}); - return (success, ${fromBytes32(valueType, 'val')}); +function tryGet(${name} storage map, ${key.type} key) internal view returns (bool exists, ${value.type} value) { + (bool success, bytes32 val) = tryGet(map._inner, ${toBytes32(key.type, 'key')}); + return (success, ${fromBytes32(value.type, 'val')}); } /** @@ -257,8 +259,8 @@ function tryGet(${name} storage map, ${keyType} key) internal view returns (bool * * - \`key\` must be in the map. */ -function get(${name} storage map, ${keyType} key) internal view returns (${valueType}) { - return ${fromBytes32(valueType, `get(map._inner, ${toBytes32(keyType, 'key')})`)}; +function get(${name} storage map, ${key.type} key) internal view returns (${value.type}) { + return ${fromBytes32(value.type, `get(map._inner, ${toBytes32(key.type, 'key')})`)}; } /** @@ -269,9 +271,9 @@ function get(${name} storage map, ${keyType} key) internal view returns (${value * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. */ -function keys(${name} storage map) internal view returns (${keyType}[] memory) { +function keys(${name} storage map) internal view returns (${key.type}[] memory) { bytes32[] memory store = keys(map._inner); - ${keyType}[] memory result; + ${key.type}[] memory result; assembly ("memory-safe") { result := store @@ -281,16 +283,137 @@ function keys(${name} storage map) internal view returns (${keyType}[] memory) { } `; +const memoryMap = ({ name, keySet, key, value }) => `\ +/** + * @dev Query for a nonexistent map key. + */ +error EnumerableMapNonexistent${key.name}Key(${key.type} key); + +struct ${name} { + // Storage of keys + EnumerableSet.${keySet.name} _keys; + mapping(${key.type} key => ${value.type}) _values; +} + +/** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ +function set(${name} storage map, ${key.typeLoc} key, ${value.typeLoc} value) internal returns (bool) { + map._values[key] = value; + return map._keys.add(key); +} + +/** + * @dev Removes a key-value pair from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ +function remove(${name} storage map, ${key.typeLoc} key) internal returns (bool) { + delete map._values[key]; + return map._keys.remove(key); +} + +/** + * @dev Removes all the entries from a map. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. + */ +function clear(${name} storage map) internal { + uint256 len = length(map); + for (uint256 i = 0; i < len; ++i) { + delete map._values[map._keys.at(i)]; + } + map._keys.clear(); +} + +/** + * @dev Returns true if the key is in the map. O(1). + */ +function contains(${name} storage map, ${key.typeLoc} key) internal view returns (bool) { + return map._keys.contains(key); +} + +/** + * @dev Returns the number of key-value pairs in the map. O(1). + */ +function length(${name} storage map) internal view returns (uint256) { + return map._keys.length(); +} + +/** + * @dev Returns the key-value pair stored at position \`index\` in the map. O(1). + * + * Note that there are no guarantees on the ordering of entries inside the + * array, and it may change when more entries are added or removed. + * + * Requirements: + * + * - \`index\` must be strictly less than {length}. + */ +function at( + ${name} storage map, + uint256 index +) internal view returns (${key.typeLoc} key, ${value.typeLoc} value) { + key = map._keys.at(index); + value = map._values[key]; +} + +/** + * @dev Tries to returns the value associated with \`key\`. O(1). + * Does not revert if \`key\` is not in the map. + */ +function tryGet( + ${name} storage map, + ${key.typeLoc} key +) internal view returns (bool exists, ${value.typeLoc} value) { + value = map._values[key]; + exists = ${value.memory ? 'bytes(value).length != 0' : `value != ${value.type}(0)`} || contains(map, key); +} + +/** + * @dev Returns the value associated with \`key\`. O(1). + * + * Requirements: + * + * - \`key\` must be in the map. + */ +function get(${name} storage map, ${key.typeLoc} key) internal view returns (${value.typeLoc} value) { + bool exists; + (exists, value) = tryGet(map, key); + if (!exists) { + revert EnumerableMapNonexistent${key.name}Key(key); + } +} + +/** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ +function keys(${name} storage map) internal view returns (${key.type}[] memory) { + return map._keys.values(); +} +`; + // GENERATE module.exports = format( header.trimEnd(), 'library EnumerableMap {', format( [].concat( - 'using EnumerableSet for EnumerableSet.Bytes32Set;', + 'using EnumerableSet for *;', '', defaultMap, - MAP_TYPES.map(details => customMap(details)), + MAP_TYPES.filter(({ key, value }) => !(key.memory || value.memory)).map(customMap), + MAP_TYPES.filter(({ key, value }) => key.memory || value.memory).map(memoryMap), ), ).trimEnd(), '}', diff --git a/scripts/generate/templates/EnumerableMapExtended.js b/scripts/generate/templates/EnumerableMapExtended.js deleted file mode 100644 index b1b55278974..00000000000 --- a/scripts/generate/templates/EnumerableMapExtended.js +++ /dev/null @@ -1,179 +0,0 @@ -const format = require('../format-lines'); -const { EXTENDED_SET_TYPES, EXTENDED_MAP_TYPES } = require('./Enumerable.opts'); - -const header = `\ -pragma solidity ^0.8.20; - -import {EnumerableSet} from "./EnumerableSet.sol"; -import {EnumerableSetExtended} from "./EnumerableSetExtended.sol"; - -/** - * @dev Library for managing an enumerable variant of Solidity's - * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[\`mapping\`] - * type for non-value types as keys. - * - * Maps have the following properties: - * - * - Entries are added, removed, and checked for existence in constant time - * (O(1)). - * - Entries are enumerated in O(n). No guarantees are made on the ordering. - * - Map can be cleared (all entries removed) in O(n). - * - * \`\`\`solidity - * contract Example { - * // Add the library methods - * using EnumerableMapExtended for EnumerableMapExtended.BytesToUintMap; - * - * // Declare a set state variable - * EnumerableMapExtended.BytesToUintMap private myMap; - * } - * \`\`\` - * - * The following map types are supported: - * - * - \`bytes -> uint256\` (\`BytesToUintMap\`) - * - \`string -> string\` (\`StringToStringMap\`) - * - * [WARNING] - * ==== - * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure - * unusable. - * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. - * - * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an - * array of EnumerableMap. - * ==== - * - * NOTE: Extensions of {EnumerableMap} - */ -`; - -const map = ({ name, keySet, key, value }) => `\ -/** - * @dev Query for a nonexistent map key. - */ -error EnumerableMapNonexistent${key.name}Key(${key.type} key); - -struct ${name} { - // Storage of keys - ${EXTENDED_SET_TYPES.some(el => el.name == keySet.name) ? 'EnumerableSetExtended' : 'EnumerableSet'}.${keySet.name} _keys; - mapping(${key.type} key => ${value.type}) _values; -} - -/** - * @dev Adds a key-value pair to a map, or updates the value for an existing - * key. O(1). - * - * Returns true if the key was added to the map, that is if it was not - * already present. - */ -function set(${name} storage map, ${key.typeLoc} key, ${value.typeLoc} value) internal returns (bool) { - map._values[key] = value; - return map._keys.add(key); -} - -/** - * @dev Removes a key-value pair from a map. O(1). - * - * Returns true if the key was removed from the map, that is if it was present. - */ -function remove(${name} storage map, ${key.typeLoc} key) internal returns (bool) { - delete map._values[key]; - return map._keys.remove(key); -} - -/** - * @dev Removes all the entries from a map. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. - */ -function clear(${name} storage map) internal { - uint256 len = length(map); - for (uint256 i = 0; i < len; ++i) { - delete map._values[map._keys.at(i)]; - } - map._keys.clear(); -} - -/** - * @dev Returns true if the key is in the map. O(1). - */ -function contains(${name} storage map, ${key.typeLoc} key) internal view returns (bool) { - return map._keys.contains(key); -} - -/** - * @dev Returns the number of key-value pairs in the map. O(1). - */ -function length(${name} storage map) internal view returns (uint256) { - return map._keys.length(); -} - -/** - * @dev Returns the key-value pair stored at position \`index\` in the map. O(1). - * - * Note that there are no guarantees on the ordering of entries inside the - * array, and it may change when more entries are added or removed. - * - * Requirements: - * - * - \`index\` must be strictly less than {length}. - */ -function at( - ${name} storage map, - uint256 index -) internal view returns (${key.typeLoc} key, ${value.typeLoc} value) { - key = map._keys.at(index); - value = map._values[key]; -} - -/** - * @dev Tries to returns the value associated with \`key\`. O(1). - * Does not revert if \`key\` is not in the map. - */ -function tryGet( - ${name} storage map, - ${key.typeLoc} key -) internal view returns (bool exists, ${value.typeLoc} value) { - value = map._values[key]; - exists = ${value.memory ? 'bytes(value).length != 0' : `value != ${value.type}(0)`} || contains(map, key); -} - -/** - * @dev Returns the value associated with \`key\`. O(1). - * - * Requirements: - * - * - \`key\` must be in the map. - */ -function get(${name} storage map, ${key.typeLoc} key) internal view returns (${value.typeLoc} value) { - bool exists; - (exists, value) = tryGet(map, key); - if (!exists) { - revert EnumerableMapNonexistent${key.name}Key(key); - } -} - -/** - * @dev Return the an array containing all the keys - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. - */ -function keys(${name} storage map) internal view returns (${key.type}[] memory) { - return map._keys.values(); -} -`; - -// GENERATE -module.exports = format( - header.trimEnd(), - 'library EnumerableMapExtended {', - format( - [].concat('using EnumerableSet for *;', 'using EnumerableSetExtended for *;', '', EXTENDED_MAP_TYPES.map(map)), - ).trimEnd(), - '}', -); diff --git a/scripts/generate/templates/EnumerableSet.js b/scripts/generate/templates/EnumerableSet.js index 26263ba1889..8f04474a58d 100644 --- a/scripts/generate/templates/EnumerableSet.js +++ b/scripts/generate/templates/EnumerableSet.js @@ -6,6 +6,7 @@ const header = `\ pragma solidity ^0.8.20; import {Arrays} from "../Arrays.sol"; +import {Hashes} from "../cryptography/Hashes.sol"; /** * @dev Library for managing @@ -44,6 +45,7 @@ import {Arrays} from "../Arrays.sol"; */ `; +// NOTE: this should be deprecated in favor of a more native construction in v6.0 const defaultSet = `\ // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with @@ -175,7 +177,8 @@ function _values(Set storage set) private view returns (bytes32[] memory) { } `; -const customSet = ({ name, type }) => `\ +// NOTE: this should be deprecated in favor of a more native construction in v6.0 +const customSet = ({ name, value: { type } }) => `\ // ${name} struct ${name} { @@ -260,6 +263,266 @@ function values(${name} storage set) internal view returns (${type}[] memory) { } `; +// NOTE: this should be used for all value-type sets in v6.0 +const set = ({ name, value }) => `\ +struct ${name} { + // Storage of set values + ${value.type}[] _values; + // Position is the index of the value in the \`values\` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(${value.type} value => uint256) _positions; +} + +/** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ +function add(${name} storage self, ${value.type} memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[value] = self._values.length; + return true; + } else { + return false; + } +} + +/** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ +function remove(${name} storage self, ${value.type} memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + uint256 position = self._positions[value]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + ${value.type} memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[lastValue] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[value]; + + return true; + } else { + return false; + } +} + +/** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ +function clear(${name} storage set) internal { + uint256 len = length(set); + for (uint256 i = 0; i < len; ++i) { + delete set._positions[set._values[i]]; + } + // Replace when these are available in Arrays.sol + ${value.type}[] storage array = set._values; + assembly ("memory-safe") { + sstore(array.slot, 0) + } +} + +/** + * @dev Returns true if the value is in the set. O(1). + */ +function contains(${name} storage self, ${value.type} memory value) internal view returns (bool) { + return self._positions[value] != 0; +} + +/** + * @dev Returns the number of values on the set. O(1). + */ +function length(${name} storage self) internal view returns (uint256) { + return self._values.length; +} + +/** + * @dev Returns the value stored at position \`index\` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - \`index\` must be strictly less than {length}. + */ +function at(${name} storage self, uint256 index) internal view returns (${value.type} memory) { + return self._values[index]; +} + +/** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ +function values(${name} storage self) internal view returns (${value.type}[] memory) { + return self._values; +} +`; + +const arraySet = ({ name, value }) => `\ +struct ${name} { + // Storage of set values + ${value.type}[] _values; + // Position is the index of the value in the \`values\` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(bytes32 valueHash => uint256) _positions; +} + +/** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ +function add(${name} storage self, ${value.type} memory value) internal returns (bool) { + if (!contains(self, value)) { + self._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + self._positions[_hash(value)] = self._values.length; + return true; + } else { + return false; + } +} + +/** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ +function remove(${name} storage self, ${value.type} memory value) internal returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + bytes32 valueHash = _hash(value); + uint256 position = self._positions[valueHash]; + + if (position != 0) { + // Equivalent to contains(self, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = self._values.length - 1; + + if (valueIndex != lastIndex) { + ${value.type} memory lastValue = self._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + self._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + self._positions[_hash(lastValue)] = position; + } + + // Delete the slot where the moved value was stored + self._values.pop(); + + // Delete the tracked position for the deleted slot + delete self._positions[valueHash]; + + return true; + } else { + return false; + } +} + +/** + * @dev Removes all the values from a set. O(n). + * + * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the + * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. + */ +function clear(${name} storage self) internal { + ${value.type}[] storage v = self._values; + + uint256 len = length(self); + for (uint256 i = 0; i < len; ++i) { + delete self._positions[_hash(v[i])]; + } + assembly ("memory-safe") { + sstore(v.slot, 0) + } +} + +/** + * @dev Returns true if the value is in the set. O(1). + */ +function contains(${name} storage self, ${value.type} memory value) internal view returns (bool) { + return self._positions[_hash(value)] != 0; +} + +/** + * @dev Returns the number of values on the set. O(1). + */ +function length(${name} storage self) internal view returns (uint256) { + return self._values.length; +} + +/** + * @dev Returns the value stored at position \`index\` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - \`index\` must be strictly less than {length}. + */ +function at(${name} storage self, uint256 index) internal view returns (${value.type} memory) { + return self._values[index]; +} + +/** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ +function values(${name} storage self) internal view returns (${value.type}[] memory) { + return self._values; +} +`; + +const hashes = `\ +function _hash(bytes32[2] memory value) private pure returns (bytes32) { + return Hashes.efficientKeccak256(value[0], value[1]); +} +`; + // GENERATE module.exports = format( header.trimEnd(), @@ -267,7 +530,10 @@ module.exports = format( format( [].concat( defaultSet, - SET_TYPES.map(details => customSet(details)), + SET_TYPES.filter(({ value }) => !value.memory).map(customSet), + SET_TYPES.filter(({ value }) => value.memory && value.size == 0).map(set), + SET_TYPES.filter(({ value }) => value.memory && value.size > 0).map(arraySet), + hashes, ), ).trimEnd(), '}', diff --git a/scripts/generate/templates/EnumerableSetExtended.js b/scripts/generate/templates/EnumerableSetExtended.js deleted file mode 100644 index 73c4b446160..00000000000 --- a/scripts/generate/templates/EnumerableSetExtended.js +++ /dev/null @@ -1,319 +0,0 @@ -const format = require('../format-lines'); -const { EXTENDED_SET_TYPES } = require('./Enumerable.opts'); - -const header = `\ -pragma solidity ^0.8.20; - -import {Hashes} from "../cryptography/Hashes.sol"; - -/** - * @dev Library for managing - * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of non-value - * types. - * - * Sets have the following properties: - * - * - Elements are added, removed, and checked for existence in constant time - * (O(1)). - * - Elements are enumerated in O(n). No guarantees are made on the ordering. - * - Set can be cleared (all elements removed) in O(n). - * - * \`\`\`solidity - * contract Example { - * // Add the library methods - * using EnumerableSetExtended for EnumerableSetExtended.StringSet; - * - * // Declare a set state variable - * EnumerableSetExtended.StringSet private mySet; - * } - * \`\`\` - * - * Sets of type \`string\` (\`StringSet\`), \`bytes\` (\`BytesSet\`) and - * \`bytes32[2]\` (\`Bytes32x2Set\`) are supported. - * - * [WARNING] - * ==== - * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure - * unusable. - * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. - * - * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an - * array of EnumerableSet. - * ==== - * - * NOTE: This is an extension of {EnumerableSet}. - */ -`; - -const set = ({ name, value }) => `\ -struct ${name} { - // Storage of set values - ${value.type}[] _values; - // Position is the index of the value in the \`values\` array plus 1. - // Position 0 is used to mean a value is not in the set. - mapping(${value.type} value => uint256) _positions; -} - -/** - * @dev Add a value to a set. O(1). - * - * Returns true if the value was added to the set, that is if it was not - * already present. - */ -function add(${name} storage self, ${value.type} memory value) internal returns (bool) { - if (!contains(self, value)) { - self._values.push(value); - // The value is stored at length-1, but we add 1 to all indexes - // and use 0 as a sentinel value - self._positions[value] = self._values.length; - return true; - } else { - return false; - } -} - -/** - * @dev Removes a value from a set. O(1). - * - * Returns true if the value was removed from the set, that is if it was - * present. - */ -function remove(${name} storage self, ${value.type} memory value) internal returns (bool) { - // We cache the value's position to prevent multiple reads from the same storage slot - uint256 position = self._positions[value]; - - if (position != 0) { - // Equivalent to contains(self, value) - // To delete an element from the _values array in O(1), we swap the element to delete with the last one in - // the array, and then remove the last element (sometimes called as 'swap and pop'). - // This modifies the order of the array, as noted in {at}. - - uint256 valueIndex = position - 1; - uint256 lastIndex = self._values.length - 1; - - if (valueIndex != lastIndex) { - ${value.type} memory lastValue = self._values[lastIndex]; - - // Move the lastValue to the index where the value to delete is - self._values[valueIndex] = lastValue; - // Update the tracked position of the lastValue (that was just moved) - self._positions[lastValue] = position; - } - - // Delete the slot where the moved value was stored - self._values.pop(); - - // Delete the tracked position for the deleted slot - delete self._positions[value]; - - return true; - } else { - return false; - } -} - -/** - * @dev Removes all the values from a set. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. - */ -function clear(${name} storage set) internal { - uint256 len = length(set); - for (uint256 i = 0; i < len; ++i) { - delete set._positions[set._values[i]]; - } - // Replace when these are available in Arrays.sol - ${value.type}[] storage array = set._values; - assembly ("memory-safe") { - sstore(array.slot, 0) - } -} - -/** - * @dev Returns true if the value is in the set. O(1). - */ -function contains(${name} storage self, ${value.type} memory value) internal view returns (bool) { - return self._positions[value] != 0; -} - -/** - * @dev Returns the number of values on the set. O(1). - */ -function length(${name} storage self) internal view returns (uint256) { - return self._values.length; -} - -/** - * @dev Returns the value stored at position \`index\` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - \`index\` must be strictly less than {length}. - */ -function at(${name} storage self, uint256 index) internal view returns (${value.type} memory) { - return self._values[index]; -} - -/** - * @dev Return the entire set in an array - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. - */ -function values(${name} storage self) internal view returns (${value.type}[] memory) { - return self._values; -} -`; - -const arraySet = ({ name, value }) => `\ -struct ${name} { - // Storage of set values - ${value.type}[] _values; - // Position is the index of the value in the \`values\` array plus 1. - // Position 0 is used to mean a value is not in the set. - mapping(bytes32 valueHash => uint256) _positions; -} - -/** - * @dev Add a value to a set. O(1). - * - * Returns true if the value was added to the set, that is if it was not - * already present. - */ -function add(${name} storage self, ${value.type} memory value) internal returns (bool) { - if (!contains(self, value)) { - self._values.push(value); - // The value is stored at length-1, but we add 1 to all indexes - // and use 0 as a sentinel value - self._positions[_hash(value)] = self._values.length; - return true; - } else { - return false; - } -} - -/** - * @dev Removes a value from a set. O(1). - * - * Returns true if the value was removed from the set, that is if it was - * present. - */ -function remove(${name} storage self, ${value.type} memory value) internal returns (bool) { - // We cache the value's position to prevent multiple reads from the same storage slot - bytes32 valueHash = _hash(value); - uint256 position = self._positions[valueHash]; - - if (position != 0) { - // Equivalent to contains(self, value) - // To delete an element from the _values array in O(1), we swap the element to delete with the last one in - // the array, and then remove the last element (sometimes called as 'swap and pop'). - // This modifies the order of the array, as noted in {at}. - - uint256 valueIndex = position - 1; - uint256 lastIndex = self._values.length - 1; - - if (valueIndex != lastIndex) { - ${value.type} memory lastValue = self._values[lastIndex]; - - // Move the lastValue to the index where the value to delete is - self._values[valueIndex] = lastValue; - // Update the tracked position of the lastValue (that was just moved) - self._positions[_hash(lastValue)] = position; - } - - // Delete the slot where the moved value was stored - self._values.pop(); - - // Delete the tracked position for the deleted slot - delete self._positions[valueHash]; - - return true; - } else { - return false; - } -} - -/** - * @dev Removes all the values from a set. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. - */ -function clear(${name} storage self) internal { - ${value.type}[] storage v = self._values; - - uint256 len = length(self); - for (uint256 i = 0; i < len; ++i) { - delete self._positions[_hash(v[i])]; - } - assembly ("memory-safe") { - sstore(v.slot, 0) - } -} - -/** - * @dev Returns true if the value is in the set. O(1). - */ -function contains(${name} storage self, ${value.type} memory value) internal view returns (bool) { - return self._positions[_hash(value)] != 0; -} - -/** - * @dev Returns the number of values on the set. O(1). - */ -function length(${name} storage self) internal view returns (uint256) { - return self._values.length; -} - -/** - * @dev Returns the value stored at position \`index\` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - \`index\` must be strictly less than {length}. - */ -function at(${name} storage self, uint256 index) internal view returns (${value.type} memory) { - return self._values[index]; -} - -/** - * @dev Return the entire set in an array - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. - */ -function values(${name} storage self) internal view returns (${value.type}[] memory) { - return self._values; -} -`; - -const hashes = `\ -function _hash(bytes32[2] memory value) private pure returns (bytes32) { - return Hashes.efficientKeccak256(value[0], value[1]); -} -`; - -// GENERATE -module.exports = format( - header.trimEnd(), - 'library EnumerableSetExtended {', - format( - [].concat( - EXTENDED_SET_TYPES.filter(({ value }) => value.size == 0).map(set), - EXTENDED_SET_TYPES.filter(({ value }) => value.size > 0).map(arraySet), - hashes, - ), - ).trimEnd(), - '}', -); diff --git a/test/utils/structs/EnumerableMap.behavior.js b/test/utils/structs/EnumerableMap.behavior.js index cf8de2e9df5..11806dae675 100644 --- a/test/utils/structs/EnumerableMap.behavior.js +++ b/test/utils/structs/EnumerableMap.behavior.js @@ -176,7 +176,7 @@ function shouldBehaveLikeMap() { .withArgs( this.key?.memory || this.value?.memory ? this.keyB - : ethers.AbiCoder.defaultAbiCoder().encode([this.keyType], [this.keyB]), + : ethers.AbiCoder.defaultAbiCoder().encode([this.key.type], [this.keyB]), ); }); }); diff --git a/test/utils/structs/EnumerableMap.test.js b/test/utils/structs/EnumerableMap.test.js index d512fb32d18..7319ba38d41 100644 --- a/test/utils/structs/EnumerableMap.test.js +++ b/test/utils/structs/EnumerableMap.test.js @@ -3,43 +3,58 @@ const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); const { mapValues } = require('../../helpers/iterate'); const { generators } = require('../../helpers/random'); -const { MAP_TYPES, formatMapType } = require('../../../scripts/generate/templates/Enumerable.opts'); +const { MAP_TYPES, typeDescr, toMapTypeDescr } = require('../../../scripts/generate/templates/Enumerable.opts'); const { shouldBehaveLikeMap } = require('./EnumerableMap.behavior'); // Add Bytes32ToBytes32Map that must be tested but is not part of the generated types. -MAP_TYPES.unshift(formatMapType('bytes32', 'bytes32')); +MAP_TYPES.unshift(toMapTypeDescr({ key: typeDescr({ type: 'bytes32' }), value: typeDescr({ type: 'bytes32' }) })); async function fixture() { const mock = await ethers.deployContract('$EnumerableMap'); + const env = Object.fromEntries( - MAP_TYPES.map(({ name, keyType, valueType }) => [ + MAP_TYPES.map(({ name, key, value }) => [ name, { - keyType, - keys: Array.from({ length: 3 }, generators[keyType]), - values: Array.from({ length: 3 }, generators[valueType]), - zeroValue: generators[valueType].zero, + key, + value, + keys: Array.from({ length: 3 }, generators[key.type]), + values: Array.from({ length: 3 }, generators[value.type]), + zeroValue: generators[value.type].zero, methods: mapValues( - { - set: `$set(uint256,${keyType},${valueType})`, - get: `$get_EnumerableMap_${name}(uint256,${keyType})`, - tryGet: `$tryGet_EnumerableMap_${name}(uint256,${keyType})`, - remove: `$remove_EnumerableMap_${name}(uint256,${keyType})`, - clear: `$clear_EnumerableMap_${name}(uint256)`, - length: `$length_EnumerableMap_${name}(uint256)`, - at: `$at_EnumerableMap_${name}(uint256,uint256)`, - contains: `$contains_EnumerableMap_${name}(uint256,${keyType})`, - keys: `$keys_EnumerableMap_${name}(uint256)`, - }, + MAP_TYPES.filter(map => map.key.name == key.name).length == 1 + ? { + set: `$set(uint256,${key.type},${value.type})`, + get: `$get(uint256,${key.type})`, + tryGet: `$tryGet(uint256,${key.type})`, + remove: `$remove(uint256,${key.type})`, + contains: `$contains(uint256,${key.type})`, + clear: `$clear_EnumerableMap_${name}(uint256)`, + length: `$length_EnumerableMap_${name}(uint256)`, + at: `$at_EnumerableMap_${name}(uint256,uint256)`, + keys: `$keys_EnumerableMap_${name}(uint256)`, + } + : { + set: `$set(uint256,${key.type},${value.type})`, + get: `$get_EnumerableMap_${name}(uint256,${key.type})`, + tryGet: `$tryGet_EnumerableMap_${name}(uint256,${key.type})`, + remove: `$remove_EnumerableMap_${name}(uint256,${key.type})`, + contains: `$contains_EnumerableMap_${name}(uint256,${key.type})`, + clear: `$clear_EnumerableMap_${name}(uint256)`, + length: `$length_EnumerableMap_${name}(uint256)`, + at: `$at_EnumerableMap_${name}(uint256,uint256)`, + keys: `$keys_EnumerableMap_${name}(uint256)`, + }, fnSig => (...args) => mock.getFunction(fnSig)(0, ...args), ), events: { - setReturn: `return$set_EnumerableMap_${name}_${keyType}_${valueType}`, - removeReturn: `return$remove_EnumerableMap_${name}_${keyType}`, + setReturn: `return$set_EnumerableMap_${name}_${key.type}_${value.type}`, + removeReturn: `return$remove_EnumerableMap_${name}_${key.type}`, }, + error: key.memory || value.memory ? `EnumerableMapNonexistent${key.name}Key` : `EnumerableMapNonexistentKey`, }, ]), ); @@ -52,8 +67,8 @@ describe('EnumerableMap', function () { Object.assign(this, await loadFixture(fixture)); }); - for (const { name } of MAP_TYPES) { - describe(name, function () { + for (const { name, key, value } of MAP_TYPES) { + describe(`${name} (enumerable map from ${key.type} to ${value.type})`, function () { beforeEach(async function () { Object.assign(this, this.env[name]); [this.keyA, this.keyB, this.keyC] = this.keys; diff --git a/test/utils/structs/EnumerableMapExtended.test.js b/test/utils/structs/EnumerableMapExtended.test.js deleted file mode 100644 index a40b83dd12d..00000000000 --- a/test/utils/structs/EnumerableMapExtended.test.js +++ /dev/null @@ -1,66 +0,0 @@ -const { ethers } = require('hardhat'); -const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); - -const { mapValues } = require('../../helpers/iterate'); -const { generators } = require('../../helpers/random'); -const { EXTENDED_MAP_TYPES } = require('../../../scripts/generate/templates/Enumerable.opts'); - -const { shouldBehaveLikeMap } = require('./EnumerableMap.behavior'); - -async function fixture() { - const mock = await ethers.deployContract('$EnumerableMapExtended'); - - const env = Object.fromEntries( - EXTENDED_MAP_TYPES.map(({ name, key, value }) => [ - name, - { - key, - value, - keys: Array.from({ length: 3 }, generators[key.type]), - values: Array.from({ length: 3 }, generators[value.type]), - zeroValue: generators[value.type].zero, - methods: mapValues( - { - set: `$set(uint256,${key.type},${value.type})`, - get: `$get(uint256,${key.type})`, - tryGet: `$tryGet(uint256,${key.type})`, - remove: `$remove(uint256,${key.type})`, - clear: `$clear_EnumerableMapExtended_${name}(uint256)`, - length: `$length_EnumerableMapExtended_${name}(uint256)`, - at: `$at_EnumerableMapExtended_${name}(uint256,uint256)`, - contains: `$contains(uint256,${key.type})`, - keys: `$keys_EnumerableMapExtended_${name}(uint256)`, - }, - fnSig => - (...args) => - mock.getFunction(fnSig)(0, ...args), - ), - events: { - setReturn: `return$set_EnumerableMapExtended_${name}_${key.type}_${value.type}`, - removeReturn: `return$remove_EnumerableMapExtended_${name}_${key.type}`, - }, - error: key.memory || value.memory ? `EnumerableMapNonexistent${key.name}Key` : `EnumerableMapNonexistentKey`, - }, - ]), - ); - - return { mock, env }; -} - -describe('EnumerableMapExtended', function () { - beforeEach(async function () { - Object.assign(this, await loadFixture(fixture)); - }); - - for (const { name, key, value } of EXTENDED_MAP_TYPES) { - describe(`${name} (enumerable map from ${key.type} to ${value.type})`, function () { - beforeEach(async function () { - Object.assign(this, this.env[name]); - [this.keyA, this.keyB, this.keyC] = this.keys; - [this.valueA, this.valueB, this.valueC] = this.values; - }); - - shouldBehaveLikeMap(); - }); - } -}); diff --git a/test/utils/structs/EnumerableSet.test.js b/test/utils/structs/EnumerableSet.test.js index f60adc103a5..e111d21975e 100644 --- a/test/utils/structs/EnumerableSet.test.js +++ b/test/utils/structs/EnumerableSet.test.js @@ -7,35 +7,38 @@ const { SET_TYPES } = require('../../../scripts/generate/templates/Enumerable.op const { shouldBehaveLikeSet } = require('./EnumerableSet.behavior'); -const getMethods = (mock, fnSigs) => { - return mapValues( +const getMethods = (mock, fnSigs) => + mapValues( fnSigs, fnSig => (...args) => mock.getFunction(fnSig)(0, ...args), ); -}; async function fixture() { const mock = await ethers.deployContract('$EnumerableSet'); const env = Object.fromEntries( - SET_TYPES.map(({ name, type }) => [ - type, + SET_TYPES.map(({ name, value }) => [ + name, { - values: Array.from({ length: 3 }, generators[type]), + value, + values: Array.from( + { length: 3 }, + value.size ? () => Array.from({ length: value.size }, generators[value.base]) : generators[value.type], + ), methods: getMethods(mock, { - add: `$add(uint256,${type})`, - remove: `$remove(uint256,${type})`, + add: `$add(uint256,${value.type})`, + remove: `$remove(uint256,${value.type})`, + contains: `$contains(uint256,${value.type})`, clear: `$clear_EnumerableSet_${name}(uint256)`, - contains: `$contains(uint256,${type})`, length: `$length_EnumerableSet_${name}(uint256)`, at: `$at_EnumerableSet_${name}(uint256,uint256)`, values: `$values_EnumerableSet_${name}(uint256)`, }), events: { - addReturn: `return$add_EnumerableSet_${name}_${type}`, - removeReturn: `return$remove_EnumerableSet_${name}_${type}`, + addReturn: `return$add_EnumerableSet_${name}_${value.type.replace(/[[\]]/g, '_')}`, + removeReturn: `return$remove_EnumerableSet_${name}_${value.type.replace(/[[\]]/g, '_')}`, }, }, ]), @@ -49,10 +52,10 @@ describe('EnumerableSet', function () { Object.assign(this, await loadFixture(fixture)); }); - for (const { type } of SET_TYPES) { - describe(type, function () { + for (const { name, value } of SET_TYPES) { + describe(`${name} (enumerable set of ${value.type})`, function () { beforeEach(function () { - Object.assign(this, this.env[type]); + Object.assign(this, this.env[name]); [this.valueA, this.valueB, this.valueC] = this.values; }); diff --git a/test/utils/structs/EnumerableSetExtended.test.js b/test/utils/structs/EnumerableSetExtended.test.js deleted file mode 100644 index 3b9d5ad746d..00000000000 --- a/test/utils/structs/EnumerableSetExtended.test.js +++ /dev/null @@ -1,62 +0,0 @@ -const { ethers } = require('hardhat'); -const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); - -const { mapValues } = require('../../helpers/iterate'); -const { generators } = require('../../helpers/random'); -const { EXTENDED_SET_TYPES } = require('../../../scripts/generate/templates/Enumerable.opts'); - -const { shouldBehaveLikeSet } = require('./EnumerableSet.behavior'); - -async function fixture() { - const mock = await ethers.deployContract('$EnumerableSetExtended'); - - const env = Object.fromEntries( - EXTENDED_SET_TYPES.map(({ name, value }) => [ - name, - { - value, - values: Array.from( - { length: 3 }, - value.size ? () => Array.from({ length: value.size }, generators[value.base]) : generators[value.type], - ), - methods: mapValues( - { - add: `$add(uint256,${value.type})`, - remove: `$remove(uint256,${value.type})`, - contains: `$contains(uint256,${value.type})`, - clear: `$clear_EnumerableSetExtended_${name}(uint256)`, - length: `$length_EnumerableSetExtended_${name}(uint256)`, - at: `$at_EnumerableSetExtended_${name}(uint256,uint256)`, - values: `$values_EnumerableSetExtended_${name}(uint256)`, - }, - fnSig => - (...args) => - mock.getFunction(fnSig)(0, ...args), - ), - events: { - addReturn: `return$add_EnumerableSetExtended_${name}_${value.type.replace(/[[\]]/g, '_')}`, - removeReturn: `return$remove_EnumerableSetExtended_${name}_${value.type.replace(/[[\]]/g, '_')}`, - }, - }, - ]), - ); - - return { mock, env }; -} - -describe('EnumerableSetExtended', function () { - beforeEach(async function () { - Object.assign(this, await loadFixture(fixture)); - }); - - for (const { name, value } of EXTENDED_SET_TYPES) { - describe(`${name} (enumerable set of ${value.type})`, function () { - beforeEach(function () { - Object.assign(this, this.env[name]); - [this.valueA, this.valueB, this.valueC] = this.values; - }); - - shouldBehaveLikeSet(); - }); - } -}); From 45fa35f55727647680bafb103e0fdbc676ce1bde Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 2 Jun 2025 11:11:22 +0200 Subject: [PATCH 067/110] Update scripts/generate/templates/Enumerable.opts.js --- scripts/generate/templates/Enumerable.opts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate/templates/Enumerable.opts.js b/scripts/generate/templates/Enumerable.opts.js index 611e969d1d6..20e11475729 100644 --- a/scripts/generate/templates/Enumerable.opts.js +++ b/scripts/generate/templates/Enumerable.opts.js @@ -38,7 +38,7 @@ const MAP_TYPES = [] // value type maps ['uint256', 'address', 'bytes32'] .flatMap((keyType, _, array) => array.map(valueType => ({ key: { type: keyType }, value: { type: valueType } }))) - .slice(0, -1), // remove bytes32 → byte32 (last one) that is already defined + .slice(0, -1), // remove bytes32 → bytes32 (last one) that is already defined // non-value type maps { key: { type: 'bytes', memory: true }, value: { type: 'uint256' } }, { key: { type: 'string', memory: true }, value: { type: 'string', memory: true } }, From bec8059bf0611d37857e0e86fde7cf6a04c5b76d Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 2 Jun 2025 16:57:36 +0200 Subject: [PATCH 068/110] clarification --- scripts/generate/templates/EnumerableSet.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/generate/templates/EnumerableSet.js b/scripts/generate/templates/EnumerableSet.js index 8f04474a58d..981b52db2b4 100644 --- a/scripts/generate/templates/EnumerableSet.js +++ b/scripts/generate/templates/EnumerableSet.js @@ -263,8 +263,7 @@ function values(${name} storage set) internal view returns (${type}[] memory) { } `; -// NOTE: this should be used for all value-type sets in v6.0 -const set = ({ name, value }) => `\ +const memorySet = ({ name, value }) => `\ struct ${name} { // Storage of set values ${value.type}[] _values; @@ -531,7 +530,7 @@ module.exports = format( [].concat( defaultSet, SET_TYPES.filter(({ value }) => !value.memory).map(customSet), - SET_TYPES.filter(({ value }) => value.memory && value.size == 0).map(set), + SET_TYPES.filter(({ value }) => value.memory && value.size == 0).map(memorySet), SET_TYPES.filter(({ value }) => value.memory && value.size > 0).map(arraySet), hashes, ), From 0d7f9d0311efd2b738350800f17bcfaeabc062b3 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 2 Jun 2025 17:03:20 +0200 Subject: [PATCH 069/110] speedup generation with selective linter --- scripts/generate/run.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/generate/run.js b/scripts/generate/run.js index b06685adee7..394bb39525e 100755 --- a/scripts/generate/run.js +++ b/scripts/generate/run.js @@ -13,7 +13,7 @@ function getVersion(path) { } } -function generateFromTemplate(file, template, outputPrefix = '') { +function generateFromTemplate(file, template, outputPrefix = '', lint = false) { const script = path.relative(path.join(__dirname, '../..'), __filename); const input = path.join(path.dirname(script), template); const output = path.join(outputPrefix, file); @@ -27,9 +27,12 @@ function generateFromTemplate(file, template, outputPrefix = '') { ); fs.writeFileSync(output, content); - cp.execFileSync('prettier', ['--write', output]); + lint && cp.execFileSync('prettier', ['--write', output]); } +// Some templates needs to go through the linter after generation +const needsLinter = ['utils/structs/EnumerableMap.sol']; + // Contracts for (const [file, template] of Object.entries({ 'utils/cryptography/MerkleProof.sol': './templates/MerkleProof.js', @@ -45,7 +48,7 @@ for (const [file, template] of Object.entries({ 'mocks/StorageSlotMock.sol': './templates/StorageSlotMock.js', 'mocks/TransientSlotMock.sol': './templates/TransientSlotMock.js', })) { - generateFromTemplate(file, template, './contracts/'); + generateFromTemplate(file, template, './contracts/', needsLinter.includes(file)); } // Tests @@ -54,5 +57,5 @@ for (const [file, template] of Object.entries({ 'utils/Packing.t.sol': './templates/Packing.t.js', 'utils/SlotDerivation.t.sol': './templates/SlotDerivation.t.js', })) { - generateFromTemplate(file, template, './test/'); + generateFromTemplate(file, template, './test/', needsLinter.includes(file)); } From 2376a457a8a723a0901d7c6121794cc4c39474ee Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 2 Jun 2025 18:06:41 +0200 Subject: [PATCH 070/110] update documentation --- contracts/utils/structs/EnumerableSet.sol | 10 ++++++++-- scripts/generate/templates/EnumerableSet.js | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/contracts/utils/structs/EnumerableSet.sol b/contracts/utils/structs/EnumerableSet.sol index f70a4d19334..94a7fb0eeb4 100644 --- a/contracts/utils/structs/EnumerableSet.sol +++ b/contracts/utils/structs/EnumerableSet.sol @@ -29,8 +29,14 @@ import {Hashes} from "../cryptography/Hashes.sol"; * } * ``` * - * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) - * and `uint256` (`UintSet`) are supported. + * The following types are supported: + * + * - `bytes32` (`Bytes32Set`) since v3.3.0 + * - `address` (`AddressSet`) since v3.3.0 + * - `uint256` (`UintSet`) since v3.3.0 + * - `string` (`StringSet`) since v5.4.0 + * - `bytes` (`BytesSet`) since v5.4.0 + * - `bytes32[2]` (`Bytes32x2Set`) since v5.4.0 * * [WARNING] * ==== diff --git a/scripts/generate/templates/EnumerableSet.js b/scripts/generate/templates/EnumerableSet.js index 981b52db2b4..668ee903b09 100644 --- a/scripts/generate/templates/EnumerableSet.js +++ b/scripts/generate/templates/EnumerableSet.js @@ -30,8 +30,14 @@ import {Hashes} from "../cryptography/Hashes.sol"; * } * \`\`\` * - * As of v3.3.0, sets of type \`bytes32\` (\`Bytes32Set\`), \`address\` (\`AddressSet\`) - * and \`uint256\` (\`UintSet\`) are supported. + * The following types are supported: + * + * - \`bytes32\` (\`Bytes32Set\`) since v3.3.0 + * - \`address\` (\`AddressSet\`) since v3.3.0 + * - \`uint256\` (\`UintSet\`) since v3.3.0 + * - \`string\` (\`StringSet\`) since v5.4.0 + * - \`bytes\` (\`BytesSet\`) since v5.4.0 + * - \`bytes32[2]\` (\`Bytes32x2Set\`) since v5.4.0 * * [WARNING] * ==== From c275c039209a9528893fb37b9dfb0c6b367c99d6 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 2 Jun 2025 10:49:21 -0600 Subject: [PATCH 071/110] Remove unnecesary code --- .github/actions/setup/action.yml | 2 +- .github/workflows/checks.yml | 2 +- contracts/account/README.adoc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 9f96c25ebec..3c5fc602e13 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -13,7 +13,7 @@ runs: path: '**/node_modules' key: npm-v3-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - run: npm ci --legacy-peer-deps + run: npm ci shell: bash if: steps.cache.outputs.cache-hit != 'true' - name: Install Foundry diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index cab570955ed..62c07cc13a5 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -118,7 +118,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up environment uses: ./.github/actions/setup - - run: rm package-lock.json package.json # Dependencies already installed + - run: rm package-lock.json package.json - uses: crytic/slither-action@v0.4.1 codespell: diff --git a/contracts/account/README.adoc b/contracts/account/README.adoc index 714087666fa..dc3c9a010a7 100644 --- a/contracts/account/README.adoc +++ b/contracts/account/README.adoc @@ -1,6 +1,6 @@ = Account [.readme-notice] -NOTE: This document is better viewed at https://docs.openzeppelin.com/community-contracts/api/account +NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/account This directory includes contracts to build accounts for ERC-4337. These include: From 5975d79687e7862765c008b1539f5ed514ca4da3 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 2 Jun 2025 11:14:19 -0600 Subject: [PATCH 072/110] Remove Bytes32x2 --- contracts/utils/structs/EnumerableSet.sol | 126 ----------------- scripts/generate/templates/Enumerable.opts.js | 1 - scripts/generate/templates/EnumerableSet.js | 131 +----------------- 3 files changed, 1 insertion(+), 257 deletions(-) diff --git a/contracts/utils/structs/EnumerableSet.sol b/contracts/utils/structs/EnumerableSet.sol index 94a7fb0eeb4..cc9a851c101 100644 --- a/contracts/utils/structs/EnumerableSet.sol +++ b/contracts/utils/structs/EnumerableSet.sol @@ -36,7 +36,6 @@ import {Hashes} from "../cryptography/Hashes.sol"; * - `uint256` (`UintSet`) since v3.3.0 * - `string` (`StringSet`) since v5.4.0 * - `bytes` (`BytesSet`) since v5.4.0 - * - `bytes32[2]` (`Bytes32x2Set`) since v5.4.0 * * [WARNING] * ==== @@ -675,131 +674,6 @@ library EnumerableSet { return self._values; } - struct Bytes32x2Set { - // Storage of set values - bytes32[2][] _values; - // Position is the index of the value in the `values` array plus 1. - // Position 0 is used to mean a value is not in the set. - mapping(bytes32 valueHash => uint256) _positions; - } - - /** - * @dev Add a value to a set. O(1). - * - * Returns true if the value was added to the set, that is if it was not - * already present. - */ - function add(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { - if (!contains(self, value)) { - self._values.push(value); - // The value is stored at length-1, but we add 1 to all indexes - // and use 0 as a sentinel value - self._positions[_hash(value)] = self._values.length; - return true; - } else { - return false; - } - } - - /** - * @dev Removes a value from a set. O(1). - * - * Returns true if the value was removed from the set, that is if it was - * present. - */ - function remove(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { - // We cache the value's position to prevent multiple reads from the same storage slot - bytes32 valueHash = _hash(value); - uint256 position = self._positions[valueHash]; - - if (position != 0) { - // Equivalent to contains(self, value) - // To delete an element from the _values array in O(1), we swap the element to delete with the last one in - // the array, and then remove the last element (sometimes called as 'swap and pop'). - // This modifies the order of the array, as noted in {at}. - - uint256 valueIndex = position - 1; - uint256 lastIndex = self._values.length - 1; - - if (valueIndex != lastIndex) { - bytes32[2] memory lastValue = self._values[lastIndex]; - - // Move the lastValue to the index where the value to delete is - self._values[valueIndex] = lastValue; - // Update the tracked position of the lastValue (that was just moved) - self._positions[_hash(lastValue)] = position; - } - - // Delete the slot where the moved value was stored - self._values.pop(); - - // Delete the tracked position for the deleted slot - delete self._positions[valueHash]; - - return true; - } else { - return false; - } - } - - /** - * @dev Removes all the values from a set. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(Bytes32x2Set storage self) internal { - bytes32[2][] storage v = self._values; - - uint256 len = length(self); - for (uint256 i = 0; i < len; ++i) { - delete self._positions[_hash(v[i])]; - } - assembly ("memory-safe") { - sstore(v.slot, 0) - } - } - - /** - * @dev Returns true if the value is in the set. O(1). - */ - function contains(Bytes32x2Set storage self, bytes32[2] memory value) internal view returns (bool) { - return self._positions[_hash(value)] != 0; - } - - /** - * @dev Returns the number of values on the set. O(1). - */ - function length(Bytes32x2Set storage self) internal view returns (uint256) { - return self._values.length; - } - - /** - * @dev Returns the value stored at position `index` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at(Bytes32x2Set storage self, uint256 index) internal view returns (bytes32[2] memory) { - return self._values[index]; - } - - /** - * @dev Return the entire set in an array - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function values(Bytes32x2Set storage self) internal view returns (bytes32[2][] memory) { - return self._values; - } - function _hash(bytes32[2] memory value) private pure returns (bytes32) { return Hashes.efficientKeccak256(value[0], value[1]); } diff --git a/scripts/generate/templates/Enumerable.opts.js b/scripts/generate/templates/Enumerable.opts.js index 20e11475729..95b403b408a 100644 --- a/scripts/generate/templates/Enumerable.opts.js +++ b/scripts/generate/templates/Enumerable.opts.js @@ -26,7 +26,6 @@ const SET_TYPES = [ { type: 'bytes32' }, { type: 'address' }, { type: 'uint256' }, - { type: 'bytes32', size: 2 }, { type: 'string', memory: true }, { type: 'bytes', memory: true }, ] diff --git a/scripts/generate/templates/EnumerableSet.js b/scripts/generate/templates/EnumerableSet.js index 668ee903b09..0586fcff3d2 100644 --- a/scripts/generate/templates/EnumerableSet.js +++ b/scripts/generate/templates/EnumerableSet.js @@ -37,7 +37,6 @@ import {Hashes} from "../cryptography/Hashes.sol"; * - \`uint256\` (\`UintSet\`) since v3.3.0 * - \`string\` (\`StringSet\`) since v5.4.0 * - \`bytes\` (\`BytesSet\`) since v5.4.0 - * - \`bytes32[2]\` (\`Bytes32x2Set\`) since v5.4.0 * * [WARNING] * ==== @@ -395,133 +394,6 @@ function values(${name} storage self) internal view returns (${value.type}[] mem } `; -const arraySet = ({ name, value }) => `\ -struct ${name} { - // Storage of set values - ${value.type}[] _values; - // Position is the index of the value in the \`values\` array plus 1. - // Position 0 is used to mean a value is not in the set. - mapping(bytes32 valueHash => uint256) _positions; -} - -/** - * @dev Add a value to a set. O(1). - * - * Returns true if the value was added to the set, that is if it was not - * already present. - */ -function add(${name} storage self, ${value.type} memory value) internal returns (bool) { - if (!contains(self, value)) { - self._values.push(value); - // The value is stored at length-1, but we add 1 to all indexes - // and use 0 as a sentinel value - self._positions[_hash(value)] = self._values.length; - return true; - } else { - return false; - } -} - -/** - * @dev Removes a value from a set. O(1). - * - * Returns true if the value was removed from the set, that is if it was - * present. - */ -function remove(${name} storage self, ${value.type} memory value) internal returns (bool) { - // We cache the value's position to prevent multiple reads from the same storage slot - bytes32 valueHash = _hash(value); - uint256 position = self._positions[valueHash]; - - if (position != 0) { - // Equivalent to contains(self, value) - // To delete an element from the _values array in O(1), we swap the element to delete with the last one in - // the array, and then remove the last element (sometimes called as 'swap and pop'). - // This modifies the order of the array, as noted in {at}. - - uint256 valueIndex = position - 1; - uint256 lastIndex = self._values.length - 1; - - if (valueIndex != lastIndex) { - ${value.type} memory lastValue = self._values[lastIndex]; - - // Move the lastValue to the index where the value to delete is - self._values[valueIndex] = lastValue; - // Update the tracked position of the lastValue (that was just moved) - self._positions[_hash(lastValue)] = position; - } - - // Delete the slot where the moved value was stored - self._values.pop(); - - // Delete the tracked position for the deleted slot - delete self._positions[valueHash]; - - return true; - } else { - return false; - } -} - -/** - * @dev Removes all the values from a set. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. - */ -function clear(${name} storage self) internal { - ${value.type}[] storage v = self._values; - - uint256 len = length(self); - for (uint256 i = 0; i < len; ++i) { - delete self._positions[_hash(v[i])]; - } - assembly ("memory-safe") { - sstore(v.slot, 0) - } -} - -/** - * @dev Returns true if the value is in the set. O(1). - */ -function contains(${name} storage self, ${value.type} memory value) internal view returns (bool) { - return self._positions[_hash(value)] != 0; -} - -/** - * @dev Returns the number of values on the set. O(1). - */ -function length(${name} storage self) internal view returns (uint256) { - return self._values.length; -} - -/** - * @dev Returns the value stored at position \`index\` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - \`index\` must be strictly less than {length}. - */ -function at(${name} storage self, uint256 index) internal view returns (${value.type} memory) { - return self._values[index]; -} - -/** - * @dev Return the entire set in an array - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. - */ -function values(${name} storage self) internal view returns (${value.type}[] memory) { - return self._values; -} -`; - const hashes = `\ function _hash(bytes32[2] memory value) private pure returns (bytes32) { return Hashes.efficientKeccak256(value[0], value[1]); @@ -536,8 +408,7 @@ module.exports = format( [].concat( defaultSet, SET_TYPES.filter(({ value }) => !value.memory).map(customSet), - SET_TYPES.filter(({ value }) => value.memory && value.size == 0).map(memorySet), - SET_TYPES.filter(({ value }) => value.memory && value.size > 0).map(arraySet), + SET_TYPES.filter(({ value }) => value.memory).map(memorySet), hashes, ), ).trimEnd(), From 935659952d667c596990a836168268abff0e72e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Garc=C3=ADa?= Date: Mon, 2 Jun 2025 11:15:15 -0600 Subject: [PATCH 073/110] Update .changeset/pink-dolls-shop.md Co-authored-by: Hadrien Croubois --- .changeset/pink-dolls-shop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/pink-dolls-shop.md b/.changeset/pink-dolls-shop.md index 7718a738fcd..9aeab0f77ac 100644 --- a/.changeset/pink-dolls-shop.md +++ b/.changeset/pink-dolls-shop.md @@ -2,4 +2,4 @@ 'openzeppelin-solidity': minor --- -`EnumerableSetExtended` and `EnumerableMapExtended`: Extensions of the `EnumerableSet` and `EnumerableMap` libraries with more types, including non-value types. +`EnumerableSet` and `EnumerableMap`: Add support for more types, including non-value types. From 86c2cb8b655fe9ec4dc17d8596f9f59eff329e82 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 2 Jun 2025 11:27:07 -0600 Subject: [PATCH 074/110] Remove unnecessary _hashes --- contracts/utils/structs/EnumerableSet.sol | 4 ---- scripts/generate/templates/EnumerableSet.js | 7 ------- 2 files changed, 11 deletions(-) diff --git a/contracts/utils/structs/EnumerableSet.sol b/contracts/utils/structs/EnumerableSet.sol index cc9a851c101..461106ea3c2 100644 --- a/contracts/utils/structs/EnumerableSet.sol +++ b/contracts/utils/structs/EnumerableSet.sol @@ -673,8 +673,4 @@ library EnumerableSet { function values(BytesSet storage self) internal view returns (bytes[] memory) { return self._values; } - - function _hash(bytes32[2] memory value) private pure returns (bytes32) { - return Hashes.efficientKeccak256(value[0], value[1]); - } } diff --git a/scripts/generate/templates/EnumerableSet.js b/scripts/generate/templates/EnumerableSet.js index 0586fcff3d2..c0d19d1c3ee 100644 --- a/scripts/generate/templates/EnumerableSet.js +++ b/scripts/generate/templates/EnumerableSet.js @@ -394,12 +394,6 @@ function values(${name} storage self) internal view returns (${value.type}[] mem } `; -const hashes = `\ -function _hash(bytes32[2] memory value) private pure returns (bytes32) { - return Hashes.efficientKeccak256(value[0], value[1]); -} -`; - // GENERATE module.exports = format( header.trimEnd(), @@ -409,7 +403,6 @@ module.exports = format( defaultSet, SET_TYPES.filter(({ value }) => !value.memory).map(customSet), SET_TYPES.filter(({ value }) => value.memory).map(memorySet), - hashes, ), ).trimEnd(), '}', From 68982306d38a9216b0896c3453a00f1d3fd2d2df Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 2 Jun 2025 11:53:30 -0600 Subject: [PATCH 075/110] Simplify --- contracts/utils/structs/EnumerableMap.sol | 145 ++---------------- scripts/generate/templates/Enumerable.opts.js | 3 +- scripts/generate/templates/EnumerableMap.js | 3 +- 3 files changed, 18 insertions(+), 133 deletions(-) diff --git a/contracts/utils/structs/EnumerableMap.sol b/contracts/utils/structs/EnumerableMap.sol index a53ac05ec60..1c67aacafdc 100644 --- a/contracts/utils/structs/EnumerableMap.sol +++ b/contracts/utils/structs/EnumerableMap.sol @@ -39,8 +39,7 @@ import {EnumerableSet} from "./EnumerableSet.sol"; * - `address -> address` (`AddressToAddressMap`) since v5.1.0 * - `address -> bytes32` (`AddressToBytes32Map`) since v5.1.0 * - `bytes32 -> address` (`Bytes32ToAddressMap`) since v5.1.0 - * - `bytes -> uint256` (`BytesToUintMap`) since v5.4.0 - * - `string -> string` (`StringToStringMap`) since v5.4.0 + * - `bytes -> bytes` (`BytesToBytesMap`) since v5.4.0 * * [WARNING] * ==== @@ -1005,10 +1004,10 @@ library EnumerableMap { */ error EnumerableMapNonexistentBytesKey(bytes key); - struct BytesToUintMap { + struct BytesToBytesMap { // Storage of keys EnumerableSet.BytesSet _keys; - mapping(bytes key => uint256) _values; + mapping(bytes key => bytes) _values; } /** @@ -1018,7 +1017,7 @@ library EnumerableMap { * Returns true if the key was added to the map, that is if it was not * already present. */ - function set(BytesToUintMap storage map, bytes memory key, uint256 value) internal returns (bool) { + function set(BytesToBytesMap storage map, bytes memory key, bytes memory value) internal returns (bool) { map._values[key] = value; return map._keys.add(key); } @@ -1028,7 +1027,7 @@ library EnumerableMap { * * Returns true if the key was removed from the map, that is if it was present. */ - function remove(BytesToUintMap storage map, bytes memory key) internal returns (bool) { + function remove(BytesToBytesMap storage map, bytes memory key) internal returns (bool) { delete map._values[key]; return map._keys.remove(key); } @@ -1039,7 +1038,7 @@ library EnumerableMap { * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. */ - function clear(BytesToUintMap storage map) internal { + function clear(BytesToBytesMap storage map) internal { uint256 len = length(map); for (uint256 i = 0; i < len; ++i) { delete map._values[map._keys.at(i)]; @@ -1050,126 +1049,14 @@ library EnumerableMap { /** * @dev Returns true if the key is in the map. O(1). */ - function contains(BytesToUintMap storage map, bytes memory key) internal view returns (bool) { + function contains(BytesToBytesMap storage map, bytes memory key) internal view returns (bool) { return map._keys.contains(key); } /** * @dev Returns the number of key-value pairs in the map. O(1). */ - function length(BytesToUintMap storage map) internal view returns (uint256) { - return map._keys.length(); - } - - /** - * @dev Returns the key-value pair stored at position `index` in the map. O(1). - * - * Note that there are no guarantees on the ordering of entries inside the - * array, and it may change when more entries are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at(BytesToUintMap storage map, uint256 index) internal view returns (bytes memory key, uint256 value) { - key = map._keys.at(index); - value = map._values[key]; - } - - /** - * @dev Tries to returns the value associated with `key`. O(1). - * Does not revert if `key` is not in the map. - */ - function tryGet(BytesToUintMap storage map, bytes memory key) internal view returns (bool exists, uint256 value) { - value = map._values[key]; - exists = value != uint256(0) || contains(map, key); - } - - /** - * @dev Returns the value associated with `key`. O(1). - * - * Requirements: - * - * - `key` must be in the map. - */ - function get(BytesToUintMap storage map, bytes memory key) internal view returns (uint256 value) { - bool exists; - (exists, value) = tryGet(map, key); - if (!exists) { - revert EnumerableMapNonexistentBytesKey(key); - } - } - - /** - * @dev Return the an array containing all the keys - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function keys(BytesToUintMap storage map) internal view returns (bytes[] memory) { - return map._keys.values(); - } - - /** - * @dev Query for a nonexistent map key. - */ - error EnumerableMapNonexistentStringKey(string key); - - struct StringToStringMap { - // Storage of keys - EnumerableSet.StringSet _keys; - mapping(string key => string) _values; - } - - /** - * @dev Adds a key-value pair to a map, or updates the value for an existing - * key. O(1). - * - * Returns true if the key was added to the map, that is if it was not - * already present. - */ - function set(StringToStringMap storage map, string memory key, string memory value) internal returns (bool) { - map._values[key] = value; - return map._keys.add(key); - } - - /** - * @dev Removes a key-value pair from a map. O(1). - * - * Returns true if the key was removed from the map, that is if it was present. - */ - function remove(StringToStringMap storage map, string memory key) internal returns (bool) { - delete map._values[key]; - return map._keys.remove(key); - } - - /** - * @dev Removes all the entries from a map. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(StringToStringMap storage map) internal { - uint256 len = length(map); - for (uint256 i = 0; i < len; ++i) { - delete map._values[map._keys.at(i)]; - } - map._keys.clear(); - } - - /** - * @dev Returns true if the key is in the map. O(1). - */ - function contains(StringToStringMap storage map, string memory key) internal view returns (bool) { - return map._keys.contains(key); - } - - /** - * @dev Returns the number of key-value pairs in the map. O(1). - */ - function length(StringToStringMap storage map) internal view returns (uint256) { + function length(BytesToBytesMap storage map) internal view returns (uint256) { return map._keys.length(); } @@ -1184,9 +1071,9 @@ library EnumerableMap { * - `index` must be strictly less than {length}. */ function at( - StringToStringMap storage map, + BytesToBytesMap storage map, uint256 index - ) internal view returns (string memory key, string memory value) { + ) internal view returns (bytes memory key, bytes memory value) { key = map._keys.at(index); value = map._values[key]; } @@ -1196,9 +1083,9 @@ library EnumerableMap { * Does not revert if `key` is not in the map. */ function tryGet( - StringToStringMap storage map, - string memory key - ) internal view returns (bool exists, string memory value) { + BytesToBytesMap storage map, + bytes memory key + ) internal view returns (bool exists, bytes memory value) { value = map._values[key]; exists = bytes(value).length != 0 || contains(map, key); } @@ -1210,11 +1097,11 @@ library EnumerableMap { * * - `key` must be in the map. */ - function get(StringToStringMap storage map, string memory key) internal view returns (string memory value) { + function get(BytesToBytesMap storage map, bytes memory key) internal view returns (bytes memory value) { bool exists; (exists, value) = tryGet(map, key); if (!exists) { - revert EnumerableMapNonexistentStringKey(key); + revert EnumerableMapNonexistentBytesKey(key); } } @@ -1226,7 +1113,7 @@ library EnumerableMap { * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. */ - function keys(StringToStringMap storage map) internal view returns (string[] memory) { + function keys(BytesToBytesMap storage map) internal view returns (bytes[] memory) { return map._keys.values(); } } diff --git a/scripts/generate/templates/Enumerable.opts.js b/scripts/generate/templates/Enumerable.opts.js index 95b403b408a..50c7349b352 100644 --- a/scripts/generate/templates/Enumerable.opts.js +++ b/scripts/generate/templates/Enumerable.opts.js @@ -39,8 +39,7 @@ const MAP_TYPES = [] .flatMap((keyType, _, array) => array.map(valueType => ({ key: { type: keyType }, value: { type: valueType } }))) .slice(0, -1), // remove bytes32 → bytes32 (last one) that is already defined // non-value type maps - { key: { type: 'bytes', memory: true }, value: { type: 'uint256' } }, - { key: { type: 'string', memory: true }, value: { type: 'string', memory: true } }, + { key: { type: 'bytes', memory: true }, value: { type: 'bytes', memory: true } }, ) .map(entry => mapValues(entry, typeDescr)) .map(toMapTypeDescr); diff --git a/scripts/generate/templates/EnumerableMap.js b/scripts/generate/templates/EnumerableMap.js index 7e52b2eb3c6..55742188861 100644 --- a/scripts/generate/templates/EnumerableMap.js +++ b/scripts/generate/templates/EnumerableMap.js @@ -40,8 +40,7 @@ import {EnumerableSet} from "./EnumerableSet.sol"; * - \`address -> address\` (\`AddressToAddressMap\`) since v5.1.0 * - \`address -> bytes32\` (\`AddressToBytes32Map\`) since v5.1.0 * - \`bytes32 -> address\` (\`Bytes32ToAddressMap\`) since v5.1.0 - * - \`bytes -> uint256\` (\`BytesToUintMap\`) since v5.4.0 - * - \`string -> string\` (\`StringToStringMap\`) since v5.4.0 + * - \`bytes -> bytes\` (\`BytesToBytesMap\`) since v5.4.0 * * [WARNING] * ==== From 4e2bc70d4b8b47ae663572e47aa4fd967f791cce Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 2 Jun 2025 11:59:49 -0600 Subject: [PATCH 076/110] Improve changesets --- .changeset/long-hornets-mate.md | 5 +++++ .changeset/pink-dolls-shop.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/long-hornets-mate.md diff --git a/.changeset/long-hornets-mate.md b/.changeset/long-hornets-mate.md new file mode 100644 index 00000000000..29f8f82a398 --- /dev/null +++ b/.changeset/long-hornets-mate.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`EnumerableMap`: Add support for `BytesToBytesMap` type. diff --git a/.changeset/pink-dolls-shop.md b/.changeset/pink-dolls-shop.md index 9aeab0f77ac..2b9fbf6c8a1 100644 --- a/.changeset/pink-dolls-shop.md +++ b/.changeset/pink-dolls-shop.md @@ -2,4 +2,4 @@ 'openzeppelin-solidity': minor --- -`EnumerableSet` and `EnumerableMap`: Add support for more types, including non-value types. +`EnumerableSet`: Add support for `StringSet` and `BytesSet` types. From 2a1f50378fc6b12ae00c6e106faba7800c4b63c7 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 2 Jun 2025 21:52:35 +0200 Subject: [PATCH 077/110] remove unecessary import --- contracts/utils/structs/EnumerableSet.sol | 1 - scripts/generate/templates/EnumerableSet.js | 1 - 2 files changed, 2 deletions(-) diff --git a/contracts/utils/structs/EnumerableSet.sol b/contracts/utils/structs/EnumerableSet.sol index 461106ea3c2..fcc738e6da4 100644 --- a/contracts/utils/structs/EnumerableSet.sol +++ b/contracts/utils/structs/EnumerableSet.sol @@ -5,7 +5,6 @@ pragma solidity ^0.8.20; import {Arrays} from "../Arrays.sol"; -import {Hashes} from "../cryptography/Hashes.sol"; /** * @dev Library for managing diff --git a/scripts/generate/templates/EnumerableSet.js b/scripts/generate/templates/EnumerableSet.js index c0d19d1c3ee..6719e38af2a 100644 --- a/scripts/generate/templates/EnumerableSet.js +++ b/scripts/generate/templates/EnumerableSet.js @@ -6,7 +6,6 @@ const header = `\ pragma solidity ^0.8.20; import {Arrays} from "../Arrays.sol"; -import {Hashes} from "../cryptography/Hashes.sol"; /** * @dev Library for managing From 326c466e63c1d69c93fe28e0c77d109003525bc9 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 2 Jun 2025 14:29:41 -0600 Subject: [PATCH 078/110] Use Arrays.sol --- contracts/utils/structs/EnumerableSet.sol | 12 ++---------- scripts/generate/templates/EnumerableSet.js | 6 +----- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/contracts/utils/structs/EnumerableSet.sol b/contracts/utils/structs/EnumerableSet.sol index fcc738e6da4..1c037241b19 100644 --- a/contracts/utils/structs/EnumerableSet.sol +++ b/contracts/utils/structs/EnumerableSet.sol @@ -502,11 +502,7 @@ library EnumerableSet { for (uint256 i = 0; i < len; ++i) { delete set._positions[set._values[i]]; } - // Replace when these are available in Arrays.sol - string[] storage array = set._values; - assembly ("memory-safe") { - sstore(array.slot, 0) - } + Arrays.unsafeSetLength(set._values, 0); } /** @@ -626,11 +622,7 @@ library EnumerableSet { for (uint256 i = 0; i < len; ++i) { delete set._positions[set._values[i]]; } - // Replace when these are available in Arrays.sol - bytes[] storage array = set._values; - assembly ("memory-safe") { - sstore(array.slot, 0) - } + Arrays.unsafeSetLength(set._values, 0); } /** diff --git a/scripts/generate/templates/EnumerableSet.js b/scripts/generate/templates/EnumerableSet.js index 6719e38af2a..ac620b88ae5 100644 --- a/scripts/generate/templates/EnumerableSet.js +++ b/scripts/generate/templates/EnumerableSet.js @@ -345,11 +345,7 @@ function clear(${name} storage set) internal { for (uint256 i = 0; i < len; ++i) { delete set._positions[set._values[i]]; } - // Replace when these are available in Arrays.sol - ${value.type}[] storage array = set._values; - assembly ("memory-safe") { - sstore(array.slot, 0) - } + Arrays.unsafeSetLength(set._values, 0); } /** From 67256187e8a8858d12131a1b126f0765ff28fd9e Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 2 Jun 2025 18:41:22 -0600 Subject: [PATCH 079/110] up --- .github/workflows/checks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 62c07cc13a5..6aca7f30cb4 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -118,7 +118,6 @@ jobs: - uses: actions/checkout@v4 - name: Set up environment uses: ./.github/actions/setup - - run: rm package-lock.json package.json - uses: crytic/slither-action@v0.4.1 codespell: From 0cce4d534cba4334f74683f63ea43cc8f2da02dd Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 2 Jun 2025 18:50:22 -0600 Subject: [PATCH 080/110] up --- contracts/utils/README.adoc | 5 - .../templates/EnumerableMapExtended.js | 173 ------------------ .../structs/EnumerableMapExtended.test.js | 66 ------- 3 files changed, 244 deletions(-) delete mode 100644 scripts/generate/templates/EnumerableMapExtended.js delete mode 100644 test/utils/structs/EnumerableMapExtended.test.js diff --git a/contracts/utils/README.adoc b/contracts/utils/README.adoc index 6bf5ba0f7d5..6ea03da7bd5 100644 --- a/contracts/utils/README.adoc +++ b/contracts/utils/README.adoc @@ -23,7 +23,6 @@ Miscellaneous contracts and libraries containing utility functions you can use t * {BitMaps}: A simple library to manage boolean value mapped to a numerical index in an efficient way. * {EnumerableMap}: A type like Solidity's https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`], but with key-value _enumeration_: this will let you know how many entries a mapping has, and iterate over them (which is not possible with `mapping`). * {EnumerableSet}: Like {EnumerableMap}, but for https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets]. Can be used to store privileged accounts, issued IDs, etc. - * {EnumerableSetExtended} and {EnumerableMapExtended}: Extensions of the `EnumerableSet` and `EnumerableMap` libraries with more types, including non-value types. * {DoubleEndedQueue}: An implementation of a https://en.wikipedia.org/wiki/Double-ended_queue[double ended queue] whose values can be added or removed from both sides. Useful for FIFO and LIFO structures. * {CircularBuffer}: A data structure to store the last N values pushed to it. * {Checkpoints}: A data structure to store values mapped to a strictly increasing key. Can be used for storing and accessing values over time. @@ -148,12 +147,8 @@ Ethereum contracts have no native concept of an interface, so applications must {{EnumerableMap}} -{{EnumerableMapExtended}} - {{EnumerableSet}} -{{EnumerableSetExtended}} - {{DoubleEndedQueue}} {{CircularBuffer}} diff --git a/scripts/generate/templates/EnumerableMapExtended.js b/scripts/generate/templates/EnumerableMapExtended.js deleted file mode 100644 index 8baf4a752da..00000000000 --- a/scripts/generate/templates/EnumerableMapExtended.js +++ /dev/null @@ -1,173 +0,0 @@ -const format = require('../format-lines'); -const { EXTENDED_SET_TYPES, EXTENDED_MAP_TYPES } = require('./Enumerable.opts'); - -const header = `\ -pragma solidity ^0.8.20; - -import {EnumerableSet} from "./EnumerableSet.sol"; -import {EnumerableSetExtended} from "./EnumerableSetExtended.sol"; - -/** - * @dev Library for managing an enumerable variant of Solidity's - * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[\`mapping\`] - * type for non-value types as keys. - * - * Maps have the following properties: - * - * - Entries are added, removed, and checked for existence in constant time - * (O(1)). - * - Entries are enumerated in O(n). No guarantees are made on the ordering. - * - Map can be cleared (all entries removed) in O(n). - * - * \`\`\`solidity - * contract Example { - * // Add the library methods - * using EnumerableMapExtended for EnumerableMapExtended.BytesToUintMap; - * - * // Declare a set state variable - * EnumerableMapExtended.BytesToUintMap private myMap; - * } - * \`\`\` - * - * The following map types are supported: - * - * - \`bytes -> uint256\` (\`BytesToUintMap\`) - * - \`string -> string\` (\`StringToStringMap\`) - * - * [WARNING] - * ==== - * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure - * unusable. - * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. - * - * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an - * array of EnumerableMap. - * ==== - * - * NOTE: Extensions of {EnumerableMap} - */ -`; - -const map = ({ name, keySet, key, value }) => `\ -/** - * @dev Query for a nonexistent map key. - */ -error EnumerableMapNonexistent${key.name}Key(${key.type} key); - -struct ${name} { - // Storage of keys - ${EXTENDED_SET_TYPES.some(el => el.name == keySet.name) ? 'EnumerableSetExtended' : 'EnumerableSet'}.${keySet.name} _keys; - mapping(${key.type} key => ${value.type}) _values; -} - -/** - * @dev Adds a key-value pair to a map, or updates the value for an existing - * key. O(1). - * - * Returns true if the key was added to the map, that is if it was not - * already present. - */ -function set(${name} storage map, ${key.typeLoc} key, ${value.typeLoc} value) internal returns (bool) { - map._values[key] = value; - return map._keys.add(key); -} - -/** - * @dev Removes a key-value pair from a map. O(1). - * - * Returns true if the key was removed from the map, that is if it was present. - */ -function remove(${name} storage map, ${key.typeLoc} key) internal returns (bool) { - delete map._values[key]; - return map._keys.remove(key); -} - -/** - * @dev Removes all the entries from a map. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. - */ -function clear(${name} storage map) internal { - uint256 len = length(map); - for (uint256 i = 0; i < len; ++i) { - delete map._values[map._keys.at(i)]; - } - map._keys.clear(); -} - -/** - * @dev Returns true if the key is in the map. O(1). - */ -function contains(${name} storage map, ${key.typeLoc} key) internal view returns (bool) { - return map._keys.contains(key); -} - -/** - * @dev Returns the number of key-value pairs in the map. O(1). - */ -function length(${name} storage map) internal view returns (uint256) { - return map._keys.length(); -} - -/** - * @dev Returns the key-value pair stored at position \`index\` in the map. O(1). - * - * Note that there are no guarantees on the ordering of entries inside the - * array, and it may change when more entries are added or removed. - * - * Requirements: - * - * - \`index\` must be strictly less than {length}. - */ -function at(${name} storage map, uint256 index) internal view returns (${key.typeLoc} key, ${value.typeLoc} value) { - key = map._keys.at(index); - value = map._values[key]; -} - -/** - * @dev Tries to returns the value associated with \`key\`. O(1). - * Does not revert if \`key\` is not in the map. - */ -function tryGet(${name} storage map, ${key.typeLoc} key) internal view returns (bool exists, ${value.typeLoc} value) { - value = map._values[key]; - exists = ${value.memory ? 'bytes(value).length != 0' : `value != ${value.type}(0)`} || contains(map, key); -} - -/** - * @dev Returns the value associated with \`key\`. O(1). - * - * Requirements: - * - * - \`key\` must be in the map. - */ -function get(${name} storage map, ${key.typeLoc} key) internal view returns (${value.typeLoc} value) { - bool exists; - (exists, value) = tryGet(map, key); - if (!exists) { - revert EnumerableMapNonexistent${key.name}Key(key); - } -} - -/** - * @dev Return the an array containing all the keys - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. - */ -function keys(${name} storage map) internal view returns (${key.type}[] memory) { - return map._keys.values(); -} -`; - -// GENERATE -module.exports = format( - header.trimEnd(), - 'library EnumerableMapExtended {', - format( - [].concat('using EnumerableSet for *;', 'using EnumerableSetExtended for *;', '', EXTENDED_MAP_TYPES.map(map)), - ).trimEnd(), - '}', -); diff --git a/test/utils/structs/EnumerableMapExtended.test.js b/test/utils/structs/EnumerableMapExtended.test.js deleted file mode 100644 index a40b83dd12d..00000000000 --- a/test/utils/structs/EnumerableMapExtended.test.js +++ /dev/null @@ -1,66 +0,0 @@ -const { ethers } = require('hardhat'); -const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); - -const { mapValues } = require('../../helpers/iterate'); -const { generators } = require('../../helpers/random'); -const { EXTENDED_MAP_TYPES } = require('../../../scripts/generate/templates/Enumerable.opts'); - -const { shouldBehaveLikeMap } = require('./EnumerableMap.behavior'); - -async function fixture() { - const mock = await ethers.deployContract('$EnumerableMapExtended'); - - const env = Object.fromEntries( - EXTENDED_MAP_TYPES.map(({ name, key, value }) => [ - name, - { - key, - value, - keys: Array.from({ length: 3 }, generators[key.type]), - values: Array.from({ length: 3 }, generators[value.type]), - zeroValue: generators[value.type].zero, - methods: mapValues( - { - set: `$set(uint256,${key.type},${value.type})`, - get: `$get(uint256,${key.type})`, - tryGet: `$tryGet(uint256,${key.type})`, - remove: `$remove(uint256,${key.type})`, - clear: `$clear_EnumerableMapExtended_${name}(uint256)`, - length: `$length_EnumerableMapExtended_${name}(uint256)`, - at: `$at_EnumerableMapExtended_${name}(uint256,uint256)`, - contains: `$contains(uint256,${key.type})`, - keys: `$keys_EnumerableMapExtended_${name}(uint256)`, - }, - fnSig => - (...args) => - mock.getFunction(fnSig)(0, ...args), - ), - events: { - setReturn: `return$set_EnumerableMapExtended_${name}_${key.type}_${value.type}`, - removeReturn: `return$remove_EnumerableMapExtended_${name}_${key.type}`, - }, - error: key.memory || value.memory ? `EnumerableMapNonexistent${key.name}Key` : `EnumerableMapNonexistentKey`, - }, - ]), - ); - - return { mock, env }; -} - -describe('EnumerableMapExtended', function () { - beforeEach(async function () { - Object.assign(this, await loadFixture(fixture)); - }); - - for (const { name, key, value } of EXTENDED_MAP_TYPES) { - describe(`${name} (enumerable map from ${key.type} to ${value.type})`, function () { - beforeEach(async function () { - Object.assign(this, this.env[name]); - [this.keyA, this.keyB, this.keyC] = this.keys; - [this.valueA, this.valueB, this.valueC] = this.values; - }); - - shouldBehaveLikeMap(); - }); - } -}); From 30f3bfa9460b6be814b16d4a94e3866e57313ee3 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Tue, 3 Jun 2025 08:46:31 -0600 Subject: [PATCH 081/110] cleanup --- .../utils/structs/EnumerableMapExtended.sol | 281 ------------ .../utils/structs/EnumerableSetExtended.sol | 422 ------------------ .../structs/EnumerableSetExtended.test.js | 62 --- 3 files changed, 765 deletions(-) delete mode 100644 contracts/utils/structs/EnumerableMapExtended.sol delete mode 100644 contracts/utils/structs/EnumerableSetExtended.sol delete mode 100644 test/utils/structs/EnumerableSetExtended.test.js diff --git a/contracts/utils/structs/EnumerableMapExtended.sol b/contracts/utils/structs/EnumerableMapExtended.sol deleted file mode 100644 index 91b912e6d72..00000000000 --- a/contracts/utils/structs/EnumerableMapExtended.sol +++ /dev/null @@ -1,281 +0,0 @@ -// SPDX-License-Identifier: MIT -// This file was procedurally generated from scripts/generate/templates/EnumerableMapExtended.js. - -pragma solidity ^0.8.20; - -import {EnumerableSet} from "./EnumerableSet.sol"; -import {EnumerableSetExtended} from "./EnumerableSetExtended.sol"; - -/** - * @dev Library for managing an enumerable variant of Solidity's - * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] - * type for non-value types as keys. - * - * Maps have the following properties: - * - * - Entries are added, removed, and checked for existence in constant time - * (O(1)). - * - Entries are enumerated in O(n). No guarantees are made on the ordering. - * - Map can be cleared (all entries removed) in O(n). - * - * ```solidity - * contract Example { - * // Add the library methods - * using EnumerableMapExtended for EnumerableMapExtended.BytesToUintMap; - * - * // Declare a set state variable - * EnumerableMapExtended.BytesToUintMap private myMap; - * } - * ``` - * - * The following map types are supported: - * - * - `bytes -> uint256` (`BytesToUintMap`) - * - `string -> string` (`StringToStringMap`) - * - * [WARNING] - * ==== - * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure - * unusable. - * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. - * - * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an - * array of EnumerableMap. - * ==== - * - * NOTE: Extensions of {EnumerableMap} - */ -library EnumerableMapExtended { - using EnumerableSet for *; - using EnumerableSetExtended for *; - - /** - * @dev Query for a nonexistent map key. - */ - error EnumerableMapNonexistentBytesKey(bytes key); - - struct BytesToUintMap { - // Storage of keys - EnumerableSetExtended.BytesSet _keys; - mapping(bytes key => uint256) _values; - } - - /** - * @dev Adds a key-value pair to a map, or updates the value for an existing - * key. O(1). - * - * Returns true if the key was added to the map, that is if it was not - * already present. - */ - function set(BytesToUintMap storage map, bytes memory key, uint256 value) internal returns (bool) { - map._values[key] = value; - return map._keys.add(key); - } - - /** - * @dev Removes a key-value pair from a map. O(1). - * - * Returns true if the key was removed from the map, that is if it was present. - */ - function remove(BytesToUintMap storage map, bytes memory key) internal returns (bool) { - delete map._values[key]; - return map._keys.remove(key); - } - - /** - * @dev Removes all the entries from a map. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(BytesToUintMap storage map) internal { - uint256 len = length(map); - for (uint256 i = 0; i < len; ++i) { - delete map._values[map._keys.at(i)]; - } - map._keys.clear(); - } - - /** - * @dev Returns true if the key is in the map. O(1). - */ - function contains(BytesToUintMap storage map, bytes memory key) internal view returns (bool) { - return map._keys.contains(key); - } - - /** - * @dev Returns the number of key-value pairs in the map. O(1). - */ - function length(BytesToUintMap storage map) internal view returns (uint256) { - return map._keys.length(); - } - - /** - * @dev Returns the key-value pair stored at position `index` in the map. O(1). - * - * Note that there are no guarantees on the ordering of entries inside the - * array, and it may change when more entries are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at(BytesToUintMap storage map, uint256 index) internal view returns (bytes memory key, uint256 value) { - key = map._keys.at(index); - value = map._values[key]; - } - - /** - * @dev Tries to returns the value associated with `key`. O(1). - * Does not revert if `key` is not in the map. - */ - function tryGet(BytesToUintMap storage map, bytes memory key) internal view returns (bool exists, uint256 value) { - value = map._values[key]; - exists = value != uint256(0) || contains(map, key); - } - - /** - * @dev Returns the value associated with `key`. O(1). - * - * Requirements: - * - * - `key` must be in the map. - */ - function get(BytesToUintMap storage map, bytes memory key) internal view returns (uint256 value) { - bool exists; - (exists, value) = tryGet(map, key); - if (!exists) { - revert EnumerableMapNonexistentBytesKey(key); - } - } - - /** - * @dev Return the an array containing all the keys - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function keys(BytesToUintMap storage map) internal view returns (bytes[] memory) { - return map._keys.values(); - } - - /** - * @dev Query for a nonexistent map key. - */ - error EnumerableMapNonexistentStringKey(string key); - - struct StringToStringMap { - // Storage of keys - EnumerableSetExtended.StringSet _keys; - mapping(string key => string) _values; - } - - /** - * @dev Adds a key-value pair to a map, or updates the value for an existing - * key. O(1). - * - * Returns true if the key was added to the map, that is if it was not - * already present. - */ - function set(StringToStringMap storage map, string memory key, string memory value) internal returns (bool) { - map._values[key] = value; - return map._keys.add(key); - } - - /** - * @dev Removes a key-value pair from a map. O(1). - * - * Returns true if the key was removed from the map, that is if it was present. - */ - function remove(StringToStringMap storage map, string memory key) internal returns (bool) { - delete map._values[key]; - return map._keys.remove(key); - } - - /** - * @dev Removes all the entries from a map. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(StringToStringMap storage map) internal { - uint256 len = length(map); - for (uint256 i = 0; i < len; ++i) { - delete map._values[map._keys.at(i)]; - } - map._keys.clear(); - } - - /** - * @dev Returns true if the key is in the map. O(1). - */ - function contains(StringToStringMap storage map, string memory key) internal view returns (bool) { - return map._keys.contains(key); - } - - /** - * @dev Returns the number of key-value pairs in the map. O(1). - */ - function length(StringToStringMap storage map) internal view returns (uint256) { - return map._keys.length(); - } - - /** - * @dev Returns the key-value pair stored at position `index` in the map. O(1). - * - * Note that there are no guarantees on the ordering of entries inside the - * array, and it may change when more entries are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at( - StringToStringMap storage map, - uint256 index - ) internal view returns (string memory key, string memory value) { - key = map._keys.at(index); - value = map._values[key]; - } - - /** - * @dev Tries to returns the value associated with `key`. O(1). - * Does not revert if `key` is not in the map. - */ - function tryGet( - StringToStringMap storage map, - string memory key - ) internal view returns (bool exists, string memory value) { - value = map._values[key]; - exists = bytes(value).length != 0 || contains(map, key); - } - - /** - * @dev Returns the value associated with `key`. O(1). - * - * Requirements: - * - * - `key` must be in the map. - */ - function get(StringToStringMap storage map, string memory key) internal view returns (string memory value) { - bool exists; - (exists, value) = tryGet(map, key); - if (!exists) { - revert EnumerableMapNonexistentStringKey(key); - } - } - - /** - * @dev Return the an array containing all the keys - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function keys(StringToStringMap storage map) internal view returns (string[] memory) { - return map._keys.values(); - } -} diff --git a/contracts/utils/structs/EnumerableSetExtended.sol b/contracts/utils/structs/EnumerableSetExtended.sol deleted file mode 100644 index a5ba388a74f..00000000000 --- a/contracts/utils/structs/EnumerableSetExtended.sol +++ /dev/null @@ -1,422 +0,0 @@ -// SPDX-License-Identifier: MIT -// This file was procedurally generated from scripts/generate/templates/EnumerableSetExtended.js. - -pragma solidity ^0.8.20; - -import {Hashes} from "../cryptography/Hashes.sol"; - -/** - * @dev Library for managing - * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of non-value - * types. - * - * Sets have the following properties: - * - * - Elements are added, removed, and checked for existence in constant time - * (O(1)). - * - Elements are enumerated in O(n). No guarantees are made on the ordering. - * - Set can be cleared (all elements removed) in O(n). - * - * ```solidity - * contract Example { - * // Add the library methods - * using EnumerableSetExtended for EnumerableSetExtended.StringSet; - * - * // Declare a set state variable - * EnumerableSetExtended.StringSet private mySet; - * } - * ``` - * - * Sets of type `string` (`StringSet`), `bytes` (`BytesSet`) and - * `bytes32[2]` (`Bytes32x2Set`) are supported. - * - * [WARNING] - * ==== - * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure - * unusable. - * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. - * - * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an - * array of EnumerableSet. - * ==== - * - * NOTE: This is an extension of {EnumerableSet}. - */ -library EnumerableSetExtended { - struct StringSet { - // Storage of set values - string[] _values; - // Position is the index of the value in the `values` array plus 1. - // Position 0 is used to mean a value is not in the set. - mapping(string value => uint256) _positions; - } - - /** - * @dev Add a value to a set. O(1). - * - * Returns true if the value was added to the set, that is if it was not - * already present. - */ - function add(StringSet storage self, string memory value) internal returns (bool) { - if (!contains(self, value)) { - self._values.push(value); - // The value is stored at length-1, but we add 1 to all indexes - // and use 0 as a sentinel value - self._positions[value] = self._values.length; - return true; - } else { - return false; - } - } - - /** - * @dev Removes a value from a set. O(1). - * - * Returns true if the value was removed from the set, that is if it was - * present. - */ - function remove(StringSet storage self, string memory value) internal returns (bool) { - // We cache the value's position to prevent multiple reads from the same storage slot - uint256 position = self._positions[value]; - - if (position != 0) { - // Equivalent to contains(self, value) - // To delete an element from the _values array in O(1), we swap the element to delete with the last one in - // the array, and then remove the last element (sometimes called as 'swap and pop'). - // This modifies the order of the array, as noted in {at}. - - uint256 valueIndex = position - 1; - uint256 lastIndex = self._values.length - 1; - - if (valueIndex != lastIndex) { - string memory lastValue = self._values[lastIndex]; - - // Move the lastValue to the index where the value to delete is - self._values[valueIndex] = lastValue; - // Update the tracked position of the lastValue (that was just moved) - self._positions[lastValue] = position; - } - - // Delete the slot where the moved value was stored - self._values.pop(); - - // Delete the tracked position for the deleted slot - delete self._positions[value]; - - return true; - } else { - return false; - } - } - - /** - * @dev Removes all the values from a set. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(StringSet storage set) internal { - uint256 len = length(set); - for (uint256 i = 0; i < len; ++i) { - delete set._positions[set._values[i]]; - } - // Replace when these are available in Arrays.sol - string[] storage array = set._values; - assembly ("memory-safe") { - sstore(array.slot, 0) - } - } - - /** - * @dev Returns true if the value is in the set. O(1). - */ - function contains(StringSet storage self, string memory value) internal view returns (bool) { - return self._positions[value] != 0; - } - - /** - * @dev Returns the number of values on the set. O(1). - */ - function length(StringSet storage self) internal view returns (uint256) { - return self._values.length; - } - - /** - * @dev Returns the value stored at position `index` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at(StringSet storage self, uint256 index) internal view returns (string memory) { - return self._values[index]; - } - - /** - * @dev Return the entire set in an array - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function values(StringSet storage self) internal view returns (string[] memory) { - return self._values; - } - - struct BytesSet { - // Storage of set values - bytes[] _values; - // Position is the index of the value in the `values` array plus 1. - // Position 0 is used to mean a value is not in the set. - mapping(bytes value => uint256) _positions; - } - - /** - * @dev Add a value to a set. O(1). - * - * Returns true if the value was added to the set, that is if it was not - * already present. - */ - function add(BytesSet storage self, bytes memory value) internal returns (bool) { - if (!contains(self, value)) { - self._values.push(value); - // The value is stored at length-1, but we add 1 to all indexes - // and use 0 as a sentinel value - self._positions[value] = self._values.length; - return true; - } else { - return false; - } - } - - /** - * @dev Removes a value from a set. O(1). - * - * Returns true if the value was removed from the set, that is if it was - * present. - */ - function remove(BytesSet storage self, bytes memory value) internal returns (bool) { - // We cache the value's position to prevent multiple reads from the same storage slot - uint256 position = self._positions[value]; - - if (position != 0) { - // Equivalent to contains(self, value) - // To delete an element from the _values array in O(1), we swap the element to delete with the last one in - // the array, and then remove the last element (sometimes called as 'swap and pop'). - // This modifies the order of the array, as noted in {at}. - - uint256 valueIndex = position - 1; - uint256 lastIndex = self._values.length - 1; - - if (valueIndex != lastIndex) { - bytes memory lastValue = self._values[lastIndex]; - - // Move the lastValue to the index where the value to delete is - self._values[valueIndex] = lastValue; - // Update the tracked position of the lastValue (that was just moved) - self._positions[lastValue] = position; - } - - // Delete the slot where the moved value was stored - self._values.pop(); - - // Delete the tracked position for the deleted slot - delete self._positions[value]; - - return true; - } else { - return false; - } - } - - /** - * @dev Removes all the values from a set. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(BytesSet storage set) internal { - uint256 len = length(set); - for (uint256 i = 0; i < len; ++i) { - delete set._positions[set._values[i]]; - } - // Replace when these are available in Arrays.sol - bytes[] storage array = set._values; - assembly ("memory-safe") { - sstore(array.slot, 0) - } - } - - /** - * @dev Returns true if the value is in the set. O(1). - */ - function contains(BytesSet storage self, bytes memory value) internal view returns (bool) { - return self._positions[value] != 0; - } - - /** - * @dev Returns the number of values on the set. O(1). - */ - function length(BytesSet storage self) internal view returns (uint256) { - return self._values.length; - } - - /** - * @dev Returns the value stored at position `index` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at(BytesSet storage self, uint256 index) internal view returns (bytes memory) { - return self._values[index]; - } - - /** - * @dev Return the entire set in an array - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function values(BytesSet storage self) internal view returns (bytes[] memory) { - return self._values; - } - - struct Bytes32x2Set { - // Storage of set values - bytes32[2][] _values; - // Position is the index of the value in the `values` array plus 1. - // Position 0 is used to mean a value is not in the set. - mapping(bytes32 valueHash => uint256) _positions; - } - - /** - * @dev Add a value to a set. O(1). - * - * Returns true if the value was added to the set, that is if it was not - * already present. - */ - function add(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { - if (!contains(self, value)) { - self._values.push(value); - // The value is stored at length-1, but we add 1 to all indexes - // and use 0 as a sentinel value - self._positions[_hash(value)] = self._values.length; - return true; - } else { - return false; - } - } - - /** - * @dev Removes a value from a set. O(1). - * - * Returns true if the value was removed from the set, that is if it was - * present. - */ - function remove(Bytes32x2Set storage self, bytes32[2] memory value) internal returns (bool) { - // We cache the value's position to prevent multiple reads from the same storage slot - bytes32 valueHash = _hash(value); - uint256 position = self._positions[valueHash]; - - if (position != 0) { - // Equivalent to contains(self, value) - // To delete an element from the _values array in O(1), we swap the element to delete with the last one in - // the array, and then remove the last element (sometimes called as 'swap and pop'). - // This modifies the order of the array, as noted in {at}. - - uint256 valueIndex = position - 1; - uint256 lastIndex = self._values.length - 1; - - if (valueIndex != lastIndex) { - bytes32[2] memory lastValue = self._values[lastIndex]; - - // Move the lastValue to the index where the value to delete is - self._values[valueIndex] = lastValue; - // Update the tracked position of the lastValue (that was just moved) - self._positions[_hash(lastValue)] = position; - } - - // Delete the slot where the moved value was stored - self._values.pop(); - - // Delete the tracked position for the deleted slot - delete self._positions[valueHash]; - - return true; - } else { - return false; - } - } - - /** - * @dev Removes all the values from a set. O(n). - * - * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the - * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block. - */ - function clear(Bytes32x2Set storage self) internal { - bytes32[2][] storage v = self._values; - - uint256 len = length(self); - for (uint256 i = 0; i < len; ++i) { - delete self._positions[_hash(v[i])]; - } - assembly ("memory-safe") { - sstore(v.slot, 0) - } - } - - /** - * @dev Returns true if the value is in the set. O(1). - */ - function contains(Bytes32x2Set storage self, bytes32[2] memory value) internal view returns (bool) { - return self._positions[_hash(value)] != 0; - } - - /** - * @dev Returns the number of values on the set. O(1). - */ - function length(Bytes32x2Set storage self) internal view returns (uint256) { - return self._values.length; - } - - /** - * @dev Returns the value stored at position `index` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at(Bytes32x2Set storage self, uint256 index) internal view returns (bytes32[2] memory) { - return self._values[index]; - } - - /** - * @dev Return the entire set in an array - * - * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed - * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that - * this function has an unbounded cost, and using it as part of a state-changing function may render the function - * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. - */ - function values(Bytes32x2Set storage self) internal view returns (bytes32[2][] memory) { - return self._values; - } - - function _hash(bytes32[2] memory value) private pure returns (bytes32) { - return Hashes.efficientKeccak256(value[0], value[1]); - } -} diff --git a/test/utils/structs/EnumerableSetExtended.test.js b/test/utils/structs/EnumerableSetExtended.test.js deleted file mode 100644 index 3b9d5ad746d..00000000000 --- a/test/utils/structs/EnumerableSetExtended.test.js +++ /dev/null @@ -1,62 +0,0 @@ -const { ethers } = require('hardhat'); -const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); - -const { mapValues } = require('../../helpers/iterate'); -const { generators } = require('../../helpers/random'); -const { EXTENDED_SET_TYPES } = require('../../../scripts/generate/templates/Enumerable.opts'); - -const { shouldBehaveLikeSet } = require('./EnumerableSet.behavior'); - -async function fixture() { - const mock = await ethers.deployContract('$EnumerableSetExtended'); - - const env = Object.fromEntries( - EXTENDED_SET_TYPES.map(({ name, value }) => [ - name, - { - value, - values: Array.from( - { length: 3 }, - value.size ? () => Array.from({ length: value.size }, generators[value.base]) : generators[value.type], - ), - methods: mapValues( - { - add: `$add(uint256,${value.type})`, - remove: `$remove(uint256,${value.type})`, - contains: `$contains(uint256,${value.type})`, - clear: `$clear_EnumerableSetExtended_${name}(uint256)`, - length: `$length_EnumerableSetExtended_${name}(uint256)`, - at: `$at_EnumerableSetExtended_${name}(uint256,uint256)`, - values: `$values_EnumerableSetExtended_${name}(uint256)`, - }, - fnSig => - (...args) => - mock.getFunction(fnSig)(0, ...args), - ), - events: { - addReturn: `return$add_EnumerableSetExtended_${name}_${value.type.replace(/[[\]]/g, '_')}`, - removeReturn: `return$remove_EnumerableSetExtended_${name}_${value.type.replace(/[[\]]/g, '_')}`, - }, - }, - ]), - ); - - return { mock, env }; -} - -describe('EnumerableSetExtended', function () { - beforeEach(async function () { - Object.assign(this, await loadFixture(fixture)); - }); - - for (const { name, value } of EXTENDED_SET_TYPES) { - describe(`${name} (enumerable set of ${value.type})`, function () { - beforeEach(function () { - Object.assign(this, this.env[name]); - [this.valueA, this.valueB, this.valueC] = this.values; - }); - - shouldBehaveLikeSet(); - }); - } -}); From eab64f8d985a606325dec107e891ebeedcaa0c10 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Tue, 3 Jun 2025 08:58:00 -0600 Subject: [PATCH 082/110] Remove EnumerableSetExtended usage --- .../cryptography/ERC7913VerifierMock.sol | 37 +++++++++++++++++++ .../utils/cryptography/MultiSignerERC7913.sol | 8 ++-- .../MultiSignerERC7913Weighted.sol | 4 +- 3 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol diff --git a/contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol b/contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol new file mode 100644 index 00000000000..f2e25f10bf3 --- /dev/null +++ b/contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {IERC7913SignatureVerifier} from "../../../../contracts/interfaces/IERC7913.sol"; + +contract ERC7913VerifierMock is IERC7913SignatureVerifier { + // Store valid keys and their corresponding signatures + mapping(bytes32 => bool) private _validKeys; + mapping(bytes32 => mapping(bytes32 => bool)) private _validSignatures; + + constructor() { + // For testing purposes, we'll consider a specific key as valid + bytes32 validKeyHash = keccak256(abi.encodePacked("valid_key")); + _validKeys[validKeyHash] = true; + } + + function verify(bytes calldata key, bytes32 /* hash */, bytes calldata signature) external pure returns (bytes4) { + // For testing purposes, we'll only accept specific key/signature combinations + if (_isKnownSigner1(key, signature) || _isKnownSigner2(key, signature)) { + return IERC7913SignatureVerifier.verify.selector; + } + return 0xffffffff; + } + + function _isKnownSigner1(bytes calldata key, bytes calldata signature) internal pure returns (bool) { + return + keccak256(key) == keccak256(abi.encodePacked("valid_key_1")) && + keccak256(signature) == keccak256(abi.encodePacked("valid_signature_1")); + } + + function _isKnownSigner2(bytes calldata key, bytes calldata signature) internal pure returns (bool) { + return + keccak256(key) == keccak256(abi.encodePacked("valid_key_2")) && + keccak256(signature) == keccak256(abi.encodePacked("valid_signature_2")); + } +} diff --git a/contracts/utils/cryptography/MultiSignerERC7913.sol b/contracts/utils/cryptography/MultiSignerERC7913.sol index 2d348e32927..8fda2368712 100644 --- a/contracts/utils/cryptography/MultiSignerERC7913.sol +++ b/contracts/utils/cryptography/MultiSignerERC7913.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.27; import {AbstractSigner} from "./AbstractSigner.sol"; import {ERC7913Utils} from "./ERC7913Utils.sol"; -import {EnumerableSetExtended} from "../structs/EnumerableSetExtended.sol"; +import {EnumerableSet} from "../structs/EnumerableSet.sol"; import {Calldata} from "../../utils/Calldata.sol"; import {SafeCast} from "../../utils/math/SafeCast.sol"; @@ -46,11 +46,11 @@ import {SafeCast} from "../../utils/math/SafeCast.sol"; * either front-runnable or unusable. */ abstract contract MultiSignerERC7913 is AbstractSigner { - using EnumerableSetExtended for EnumerableSetExtended.BytesSet; + using EnumerableSet for EnumerableSet.BytesSet; using ERC7913Utils for *; using SafeCast for uint256; - EnumerableSetExtended.BytesSet private _signersSet; + EnumerableSet.BytesSet private _signersSet; uint128 private _threshold; /// @dev Emitted when signers are added. @@ -96,7 +96,7 @@ abstract contract MultiSignerERC7913 is AbstractSigner { } /// @dev Returns the set of authorized signers. - function _signers() internal view virtual returns (EnumerableSetExtended.BytesSet storage) { + function _signers() internal view virtual returns (EnumerableSet.BytesSet storage) { return _signersSet; } diff --git a/contracts/utils/cryptography/MultiSignerERC7913Weighted.sol b/contracts/utils/cryptography/MultiSignerERC7913Weighted.sol index 5e7cb2831c0..c2273b62bc2 100644 --- a/contracts/utils/cryptography/MultiSignerERC7913Weighted.sol +++ b/contracts/utils/cryptography/MultiSignerERC7913Weighted.sol @@ -5,7 +5,7 @@ pragma solidity ^0.8.27; import {Math} from "../math/Math.sol"; import {SafeCast} from "../math/SafeCast.sol"; import {MultiSignerERC7913} from "./MultiSignerERC7913.sol"; -import {EnumerableSetExtended} from "../../utils/structs/EnumerableSetExtended.sol"; +import {EnumerableSet} from "../../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {MultiSignerERC7913} that supports weighted signatures. @@ -49,7 +49,7 @@ import {EnumerableSetExtended} from "../../utils/structs/EnumerableSetExtended.s * least two signers (e.g., one with weight 1 and one with weight 3). See {signerWeight}. */ abstract contract MultiSignerERC7913Weighted is MultiSignerERC7913 { - using EnumerableSetExtended for EnumerableSetExtended.BytesSet; + using EnumerableSet for EnumerableSet.BytesSet; using SafeCast for uint256; // Invariant: sum(weights) >= threshold From e3dcc2b43f6bb4f20ac0fe94bf68b11f89d5d313 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Tue, 3 Jun 2025 09:05:02 -0600 Subject: [PATCH 083/110] Add tests --- contracts/mocks/account/AccountMock.sol | 58 ++++ .../cryptography/ERC7913P256Verifier.sol | 26 ++ .../utils/cryptography/ERC7913RSAVerifier.sol | 20 ++ test/account/AccountERC7913.test.js | 116 +++++++ test/account/AccountMultiSigner.test.js | 320 ++++++++++++++++++ .../AccountMultiSignerWeighted.test.js | 313 +++++++++++++++++ test/helpers/signers.js | 63 +++- test/utils/cryptography/ERC7913Utils.test.js | 257 ++++++++++++++ 8 files changed, 1172 insertions(+), 1 deletion(-) create mode 100644 contracts/utils/cryptography/ERC7913P256Verifier.sol create mode 100644 contracts/utils/cryptography/ERC7913RSAVerifier.sol create mode 100644 test/account/AccountERC7913.test.js create mode 100644 test/account/AccountMultiSigner.test.js create mode 100644 test/account/AccountMultiSignerWeighted.test.js create mode 100644 test/utils/cryptography/ERC7913Utils.test.js diff --git a/contracts/mocks/account/AccountMock.sol b/contracts/mocks/account/AccountMock.sol index f73f8a52ce1..02e67860aee 100644 --- a/contracts/mocks/account/AccountMock.sol +++ b/contracts/mocks/account/AccountMock.sol @@ -17,6 +17,9 @@ import {SignerECDSA} from "../../utils/cryptography/SignerECDSA.sol"; import {SignerP256} from "../../utils/cryptography/SignerP256.sol"; import {SignerRSA} from "../../utils/cryptography/SignerRSA.sol"; import {SignerERC7702} from "../../utils/cryptography/SignerERC7702.sol"; +import {SignerERC7913} from "../../utils/cryptography/SignerERC7913.sol"; +import {MultiSignerERC7913} from "../../utils/cryptography/MultiSignerERC7913.sol"; +import {MultiSignerERC7913Weighted} from "../../utils/cryptography/MultiSignerERC7913Weighted.sol"; abstract contract AccountMock is Account, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { /// Validates a user operation with a boolean signature. @@ -136,3 +139,58 @@ abstract contract AccountERC7579HookedMock is AccountERC7579Hooked { _installModule(MODULE_TYPE_VALIDATOR, validator, initData); } } + +abstract contract AccountMultiSignerMock is Account, MultiSignerERC7913, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { + constructor(bytes[] memory signers, uint256 threshold) { + _addSigners(signers); + _setThreshold(threshold); + } + + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} + +abstract contract AccountERC7913Mock is Account, SignerERC7913, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { + constructor(bytes memory _signer) { + _setSigner(_signer); + } + + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} + +abstract contract AccountMultiSignerWeightedMock is + Account, + MultiSignerERC7913Weighted, + ERC7739, + ERC7821, + ERC721Holder, + ERC1155Holder +{ + constructor(bytes[] memory signers, uint256[] memory weights, uint256 threshold) { + _addSigners(signers); + _setSignerWeights(signers, weights); + _setThreshold(threshold); + } + + /// @inheritdoc ERC7821 + function _erc7821AuthorizedExecutor( + address caller, + bytes32 mode, + bytes calldata executionData + ) internal view virtual override returns (bool) { + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); + } +} diff --git a/contracts/utils/cryptography/ERC7913P256Verifier.sol b/contracts/utils/cryptography/ERC7913P256Verifier.sol new file mode 100644 index 00000000000..b7b49a76363 --- /dev/null +++ b/contracts/utils/cryptography/ERC7913P256Verifier.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {P256} from "../../utils/cryptography/P256.sol"; +import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol"; + +/** + * @dev ERC-7913 signature verifier that support P256 (secp256r1) keys. + */ +contract ERC7913P256Verifier is IERC7913SignatureVerifier { + /// @inheritdoc IERC7913SignatureVerifier + function verify(bytes calldata key, bytes32 hash, bytes calldata signature) public view virtual returns (bytes4) { + // Signature length may be 0x40 or 0x41. + if (key.length == 0x40 && signature.length >= 0x40) { + bytes32 qx = bytes32(key[0x00:0x20]); + bytes32 qy = bytes32(key[0x20:0x40]); + bytes32 r = bytes32(signature[0x00:0x20]); + bytes32 s = bytes32(signature[0x20:0x40]); + if (P256.verify(hash, r, s, qx, qy)) { + return IERC7913SignatureVerifier.verify.selector; + } + } + return 0xFFFFFFFF; + } +} diff --git a/contracts/utils/cryptography/ERC7913RSAVerifier.sol b/contracts/utils/cryptography/ERC7913RSAVerifier.sol new file mode 100644 index 00000000000..f0e022f39c6 --- /dev/null +++ b/contracts/utils/cryptography/ERC7913RSAVerifier.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {RSA} from "../../utils/cryptography/RSA.sol"; +import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol"; + +/** + * @dev ERC-7913 signature verifier that support RSA keys. + */ +contract ERC7913RSAVerifier is IERC7913SignatureVerifier { + /// @inheritdoc IERC7913SignatureVerifier + function verify(bytes calldata key, bytes32 hash, bytes calldata signature) public view virtual returns (bytes4) { + (bytes memory e, bytes memory n) = abi.decode(key, (bytes, bytes)); + return + RSA.pkcs1Sha256(abi.encodePacked(hash), signature, e, n) + ? IERC7913SignatureVerifier.verify.selector + : bytes4(0xFFFFFFFF); + } +} diff --git a/test/account/AccountERC7913.test.js b/test/account/AccountERC7913.test.js new file mode 100644 index 00000000000..118938b17d4 --- /dev/null +++ b/test/account/AccountERC7913.test.js @@ -0,0 +1,116 @@ +const { ethers, entrypoint } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { getDomain } = require('../helpers/eip712'); +const { ERC4337Helper } = require('../helpers/erc4337'); +const { NonNativeSigner, P256SigningKey, RSASHA256SigningKey } = require('../helpers/signers'); +const { PackedUserOperation } = require('../helpers/eip712-types'); + +const { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder } = require('./Account.behavior'); +const { shouldBehaveLikeERC1271 } = require('../utils/cryptography/ERC1271.behavior'); +const { shouldBehaveLikeERC7821 } = require('./extensions/ERC7821.behavior'); + +// Prepare signer in advance (RSA are long to initialize) +const signerECDSA = ethers.Wallet.createRandom(); +const signerP256 = new NonNativeSigner(P256SigningKey.random()); +const signerRSA = new NonNativeSigner(RSASHA256SigningKey.random()); + +// Minimal fixture common to the different signer verifiers +async function fixture() { + // EOAs and environment + const [beneficiary, other] = await ethers.getSigners(); + const target = await ethers.deployContract('CallReceiverMock'); + + // ERC-7913 verifiers + const verifierP256 = await ethers.deployContract('ERC7913P256Verifier'); + const verifierRSA = await ethers.deployContract('ERC7913RSAVerifier'); + + // ERC-4337 env + const helper = new ERC4337Helper(); + await helper.wait(); + const entrypointDomain = await getDomain(entrypoint.v08); + const domain = { name: 'AccountERC7913', version: '1', chainId: entrypointDomain.chainId }; // Missing verifyingContract, + + const makeMock = signer => + helper.newAccount('$AccountERC7913Mock', ['AccountERC7913', '1', signer]).then(mock => { + domain.verifyingContract = mock.address; + return mock; + }); + + const signUserOp = function (userOp) { + return this.signer + .signTypedData(entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + }; + + return { + helper, + verifierP256, + verifierRSA, + domain, + target, + beneficiary, + other, + makeMock, + signUserOp, + }; +} + +describe('AccountERC7913', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + // Using ECDSA key as verifier + describe('ECDSA key', function () { + beforeEach(async function () { + this.signer = signerECDSA; + this.mock = await this.makeMock(this.signer.address); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); + }); + + // Using P256 key with an ERC-7913 verifier + describe('P256 key', function () { + beforeEach(async function () { + this.signer = signerP256; + this.mock = await this.makeMock( + ethers.concat([ + this.verifierP256.target, + this.signer.signingKey.publicKey.qx, + this.signer.signingKey.publicKey.qy, + ]), + ); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); + }); + + // Using RSA key with an ERC-7913 verifier + describe('RSA key', function () { + beforeEach(async function () { + this.signer = signerRSA; + this.mock = await this.makeMock( + ethers.concat([ + this.verifierRSA.target, + ethers.AbiCoder.defaultAbiCoder().encode( + ['bytes', 'bytes'], + [this.signer.signingKey.publicKey.e, this.signer.signingKey.publicKey.n], + ), + ]), + ); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); + }); +}); diff --git a/test/account/AccountMultiSigner.test.js b/test/account/AccountMultiSigner.test.js new file mode 100644 index 00000000000..8e794812161 --- /dev/null +++ b/test/account/AccountMultiSigner.test.js @@ -0,0 +1,320 @@ +const { ethers, entrypoint } = require('hardhat'); +const { expect } = require('chai'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { getDomain } = require('../helpers/eip712'); +const { ERC4337Helper } = require('../helpers/erc4337'); +const { NonNativeSigner, P256SigningKey, RSASHA256SigningKey, MultiERC7913SigningKey } = require('../helpers/signers'); + +const { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder } = require('./Account.behavior'); +const { shouldBehaveLikeERC1271 } = require('../utils/cryptography/ERC1271.behavior'); +const { shouldBehaveLikeERC7821 } = require('./extensions/ERC7821.behavior'); +const { PackedUserOperation } = require('../helpers/eip712-types'); + +// Prepare signers in advance (RSA are long to initialize) +const signerECDSA1 = ethers.Wallet.createRandom(); +const signerECDSA2 = ethers.Wallet.createRandom(); +const signerECDSA3 = ethers.Wallet.createRandom(); +const signerECDSA4 = ethers.Wallet.createRandom(); // Unauthorized signer +const signerP256 = new NonNativeSigner(P256SigningKey.random()); +const signerRSA = new NonNativeSigner(RSASHA256SigningKey.random()); + +// Minimal fixture common to the different signer verifiers +async function fixture() { + // EOAs and environment + const [beneficiary, other] = await ethers.getSigners(); + const target = await ethers.deployContract('CallReceiverMock'); + + // ERC-7913 verifiers + const verifierP256 = await ethers.deployContract('ERC7913P256Verifier'); + const verifierRSA = await ethers.deployContract('ERC7913RSAVerifier'); + + // ERC-4337 env + const helper = new ERC4337Helper(); + await helper.wait(); + const entrypointDomain = await getDomain(entrypoint.v08); + const domain = { name: 'AccountMultiSigner', version: '1', chainId: entrypointDomain.chainId }; // Missing verifyingContract + + const makeMock = (signers, threshold) => + helper.newAccount('$AccountMultiSignerMock', ['AccountMultiSigner', '1', signers, threshold]).then(mock => { + domain.verifyingContract = mock.address; + return mock; + }); + + // Sign user operations using MultiERC7913SigningKey + const signUserOp = function (userOp) { + return this.signer + .signTypedData(entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + }; + + const invalidSig = function () { + return this.signer.signMessage('invalid'); + }; + + return { + helper, + verifierP256, + verifierRSA, + domain, + target, + beneficiary, + other, + makeMock, + signUserOp, + invalidSig, + }; +} + +describe('AccountMultiSigner', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + describe('Multi ECDSA signers with threshold=1', function () { + beforeEach(async function () { + this.signer = new NonNativeSigner(new MultiERC7913SigningKey([signerECDSA1])); + this.mock = await this.makeMock([signerECDSA1.address], 1); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); + }); + + describe('Multi ECDSA signers with threshold=2', function () { + beforeEach(async function () { + this.signer = new NonNativeSigner(new MultiERC7913SigningKey([signerECDSA1, signerECDSA2])); + this.mock = await this.makeMock([signerECDSA1.address, signerECDSA2.address], 2); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); + }); + + describe('Mixed signers with threshold=2', function () { + beforeEach(async function () { + // Create signers array with all three types + signerP256.bytes = ethers.concat([ + this.verifierP256.target, + signerP256.signingKey.publicKey.qx, + signerP256.signingKey.publicKey.qy, + ]); + + signerRSA.bytes = ethers.concat([ + this.verifierRSA.target, + ethers.AbiCoder.defaultAbiCoder().encode( + ['bytes', 'bytes'], + [signerRSA.signingKey.publicKey.e, signerRSA.signingKey.publicKey.n], + ), + ]); + + this.signer = new NonNativeSigner(new MultiERC7913SigningKey([signerECDSA1, signerP256, signerRSA])); + this.mock = await this.makeMock([signerECDSA1.address, signerP256.bytes, signerRSA.bytes], 2); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); + }); + + describe('Signer management', function () { + beforeEach(async function () { + this.signer = new NonNativeSigner(new MultiERC7913SigningKey([signerECDSA1, signerECDSA2])); + this.mock = await this.makeMock([signerECDSA1.address, signerECDSA2.address], 1); + await this.mock.deploy(); + }); + + it('can add signers', async function () { + const signers = [ + signerECDSA3.address, // ECDSA Signer + ]; + + // Successfully adds a signer + const signersArrayBefore = await this.mock.signers().then(s => s.map(ethers.getAddress)); + await expect(this.mock.$_addSigners(signers)).to.emit(this.mock, 'ERC7913SignersAdded'); + const signersArrayAfter = await this.mock.signers().then(s => s.map(ethers.getAddress)); + expect(signersArrayAfter.length).to.equal(signersArrayBefore.length + 1); + expect(signersArrayAfter).to.include(ethers.getAddress(signerECDSA3.address)); + + // Reverts if the signer was already added + await expect(this.mock.$_addSigners(signers)) + .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913AlreadyExists') + .withArgs(...signers.map(s => s.toLowerCase())); + }); + + it('can remove signers', async function () { + const signers = [signerECDSA2.address]; + + // Successfully removes an already added signer + const signersArrayBefore = await this.mock.signers().then(s => s.map(ethers.getAddress)); + await expect(this.mock.$_removeSigners(signers)).to.emit(this.mock, 'ERC7913SignersRemoved'); + const signersArrayAfter = await this.mock.signers().then(s => s.map(ethers.getAddress)); + expect(signersArrayAfter.length).to.equal(signersArrayBefore.length - 1); + expect(signersArrayAfter).to.not.include(ethers.getAddress(signerECDSA2.address)); + + // Reverts removing a signer if it doesn't exist + await expect(this.mock.$_removeSigners(signers)) + .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913NonexistentSigner') + .withArgs(...signers.map(s => s.toLowerCase())); + + // Reverts if removing a signer makes the threshold unreachable + await expect(this.mock.$_removeSigners([signerECDSA1.address])) + .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913UnreachableThreshold') + .withArgs(0, 1); + }); + + it('can change threshold', async function () { + // Reachable threshold is set + await expect(this.mock.$_setThreshold(2)).to.emit(this.mock, 'ERC7913ThresholdSet'); + + // Unreachable threshold reverts + await expect(this.mock.$_setThreshold(3)).to.revertedWithCustomError( + this.mock, + 'MultiSignerERC7913UnreachableThreshold', + ); + }); + + it('rejects invalid signer format', async function () { + const invalidSigner = '0x123456'; // Too short + + await expect(this.mock.$_addSigners([invalidSigner])) + .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913InvalidSigner') + .withArgs(invalidSigner); + }); + + it('can read signers and threshold', async function () { + const signersArray = await this.mock.signers().then(s => s.map(ethers.getAddress)); // Checksum + expect(signersArray).to.have.lengthOf(2); + expect(signersArray).to.include(signerECDSA1.address); + expect(signersArray).to.include(signerECDSA2.address); + + const currentThreshold = await this.mock.threshold(); + expect(currentThreshold).to.equal(1); + }); + + it('checks if an address is a signer', async function () { + // Should return true for authorized signers + await expect(this.mock.isSigner(signerECDSA1.address)).to.eventually.be.true; + await expect(this.mock.isSigner(signerECDSA2.address)).to.eventually.be.true; + + // Should return false for unauthorized signers + await expect(this.mock.isSigner(signerECDSA3.address)).to.eventually.be.false; + await expect(this.mock.isSigner(signerECDSA4.address)).to.eventually.be.false; + }); + }); + + describe('Signature validation', function () { + const TEST_MESSAGE = ethers.keccak256(ethers.toUtf8Bytes('Test message')); + + beforeEach(async function () { + // Set up mock with authorized signers + this.mock = await this.makeMock([signerECDSA1.address, signerECDSA2.address], 1); + await this.mock.deploy(); + }); + + it('rejects signatures from unauthorized signers', async function () { + // Create signatures including an unauthorized signer + const authorizedSignature = await signerECDSA1.signMessage(ethers.getBytes(TEST_MESSAGE)); + const unauthorizedSignature = await signerECDSA4.signMessage(ethers.getBytes(TEST_MESSAGE)); + + // Prepare signers and signatures arrays + const signers = [ + signerECDSA1.address, + signerECDSA4.address, // Unauthorized signer + ].sort((a, b) => (ethers.toBigInt(ethers.keccak256(a)) < ethers.toBigInt(ethers.keccak256(b)) ? -1 : 1)); + + const signatures = signers.map(signer => { + if (signer === signerECDSA1.address) return authorizedSignature; + return unauthorizedSignature; + }); + + // Encode the multi-signature + const multiSignature = ethers.AbiCoder.defaultAbiCoder().encode(['bytes[]', 'bytes[]'], [signers, signatures]); + + // Should fail because one signer is not authorized + await expect(this.mock.$_rawSignatureValidation(TEST_MESSAGE, multiSignature)).to.eventually.be.false; + }); + + it('rejects invalid signatures from authorized signers', async function () { + // Create a valid signature and an invalid one from authorized signers + const validSignature = await signerECDSA1.signMessage(ethers.getBytes(TEST_MESSAGE)); + const invalidSignature = await signerECDSA2.signMessage(ethers.toUtf8Bytes('Different message')); // Wrong message + + // Prepare signers and signatures arrays + const signers = [signerECDSA1.address, signerECDSA2.address].sort((a, b) => + ethers.toBigInt(ethers.keccak256(a)) < ethers.toBigInt(ethers.keccak256(b)) ? -1 : 1, + ); + + const signatures = signers.map(signer => { + if (signer === signerECDSA1.address) return validSignature; + return invalidSignature; + }); + + // Encode the multi-signature + const multiSignature = ethers.AbiCoder.defaultAbiCoder().encode(['bytes[]', 'bytes[]'], [signers, signatures]); + + // Should fail because one signature is invalid + await expect(this.mock.$_rawSignatureValidation(TEST_MESSAGE, multiSignature)).to.eventually.be.false; + }); + + it('rejects signatures from unsorted signers', async function () { + // Create a valid signature and an invalid one from authorized signers + const validSignature1 = await signerECDSA1.signMessage(ethers.getBytes(TEST_MESSAGE)); + const validSignature2 = await signerECDSA2.signMessage(ethers.getBytes(TEST_MESSAGE)); + + // Prepare signers and signatures arrays + const signers = [signerECDSA1.address, signerECDSA2.address].sort((a, b) => + ethers.toBigInt(ethers.keccak256(a)) < ethers.toBigInt(ethers.keccak256(b)) ? -1 : 1, + ); + const unsortedSigners = signers.reverse(); + const signatures = unsortedSigners.map(signer => { + if (signer === signerECDSA1.address) return validSignature1; + return validSignature2; + }); + + // Encode the multi-signature + const multiSignature = ethers.AbiCoder.defaultAbiCoder().encode( + ['bytes[]', 'bytes[]'], + [unsortedSigners, signatures], + ); + + // Should fail because signers are not sorted + await expect(this.mock.$_rawSignatureValidation(TEST_MESSAGE, multiSignature)).to.eventually.be.false; + }); + + it('rejects signatures when signers.length != signatures.length', async function () { + // Create a valid signature and an invalid one from authorized signers + const validSignature1 = await signerECDSA1.signMessage(ethers.getBytes(TEST_MESSAGE)); + + // Prepare signers and signatures arrays + const signers = [signerECDSA1.address, signerECDSA2.address]; + const signatures = [validSignature1]; + + // Encode the multi-signature + const multiSignature = ethers.AbiCoder.defaultAbiCoder().encode(['bytes[]', 'bytes[]'], [signers, signatures]); + + // Should fail because signers and signatures arrays have different lengths + await expect(this.mock.$_rawSignatureValidation(TEST_MESSAGE, multiSignature)).to.eventually.be.false; + }); + + it('rejects duplicated signers', async function () { + // Create a valid signature + const validSignature = await signerECDSA1.signMessage(ethers.getBytes(TEST_MESSAGE)); + + // Prepare signers and signatures arrays + const signers = [signerECDSA1.address, signerECDSA1.address]; + const signatures = [validSignature, validSignature]; + + // Encode the multi-signature + const multiSignature = ethers.AbiCoder.defaultAbiCoder().encode(['bytes[]', 'bytes[]'], [signers, signatures]); + + // Should fail because of duplicated signers + await expect(this.mock.$_rawSignatureValidation(TEST_MESSAGE, multiSignature)).to.eventually.be.false; + }); + }); +}); diff --git a/test/account/AccountMultiSignerWeighted.test.js b/test/account/AccountMultiSignerWeighted.test.js new file mode 100644 index 00000000000..46d9633f081 --- /dev/null +++ b/test/account/AccountMultiSignerWeighted.test.js @@ -0,0 +1,313 @@ +const { ethers, entrypoint } = require('hardhat'); +const { expect } = require('chai'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); + +const { getDomain } = require('../helpers/eip712'); +const { ERC4337Helper } = require('../helpers/erc4337'); +const { NonNativeSigner, P256SigningKey, RSASHA256SigningKey, MultiERC7913SigningKey } = require('../helpers/signers'); +const { PackedUserOperation } = require('../helpers/eip712-types'); + +const { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder } = require('./Account.behavior'); +const { shouldBehaveLikeERC1271 } = require('../utils/cryptography/ERC1271.behavior'); +const { shouldBehaveLikeERC7821 } = require('./extensions/ERC7821.behavior'); + +// Prepare signers in advance (RSA are long to initialize) +const signerECDSA1 = ethers.Wallet.createRandom(); +const signerECDSA2 = ethers.Wallet.createRandom(); +const signerECDSA3 = ethers.Wallet.createRandom(); +const signerECDSA4 = ethers.Wallet.createRandom(); +const signerP256 = new NonNativeSigner(P256SigningKey.random()); +const signerRSA = new NonNativeSigner(RSASHA256SigningKey.random()); + +// Minimal fixture common to the different signer verifiers +async function fixture() { + // EOAs and environment + const [beneficiary, other] = await ethers.getSigners(); + const target = await ethers.deployContract('CallReceiverMock'); + + // ERC-7913 verifiers + const verifierP256 = await ethers.deployContract('ERC7913P256Verifier'); + const verifierRSA = await ethers.deployContract('ERC7913RSAVerifier'); + + // ERC-4337 env + const helper = new ERC4337Helper(); + await helper.wait(); + const entrypointDomain = await getDomain(entrypoint.v08); + const domain = { name: 'AccountMultiSignerWeighted', version: '1', chainId: entrypointDomain.chainId }; // Missing verifyingContract + + const makeMock = (signers, weights, threshold) => + helper + .newAccount('$AccountMultiSignerWeightedMock', ['AccountMultiSignerWeighted', '1', signers, weights, threshold]) + .then(mock => { + domain.verifyingContract = mock.address; + return mock; + }); + + // Sign user operations using NonNativeSigner with MultiERC7913SigningKey + const signUserOp = function (userOp) { + return this.signer + .signTypedData(entrypointDomain, { PackedUserOperation }, userOp.packed) + .then(signature => Object.assign(userOp, { signature })); + }; + + const invalidSig = function () { + return this.signer.signMessage('invalid'); + }; + + return { + helper, + verifierP256, + verifierRSA, + domain, + target, + beneficiary, + other, + makeMock, + signUserOp, + invalidSig, + }; +} + +describe('AccountMultiSignerWeighted', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + describe('Weighted signers with equal weights (1, 1, 1) and threshold=2', function () { + beforeEach(async function () { + const weights = [1, 1, 1]; + this.signer = new NonNativeSigner( + new MultiERC7913SigningKey([signerECDSA1, signerECDSA2, signerECDSA3], weights), + ); + this.mock = await this.makeMock([signerECDSA1.address, signerECDSA2.address, signerECDSA3.address], weights, 2); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); + }); + + describe('Weighted signers with varying weights (1, 2, 3) and threshold=3', function () { + beforeEach(async function () { + const weights = [1, 2, 3]; + this.signer = new NonNativeSigner(new MultiERC7913SigningKey([signerECDSA1, signerECDSA2], weights.slice(1))); + this.mock = await this.makeMock([signerECDSA1.address, signerECDSA2.address, signerECDSA3.address], weights, 3); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); + }); + + describe('Mixed weighted signers with threshold=4', function () { + beforeEach(async function () { + // Create signers array with all three types + signerP256.bytes = ethers.concat([ + this.verifierP256.target, + signerP256.signingKey.publicKey.qx, + signerP256.signingKey.publicKey.qy, + ]); + + signerRSA.bytes = ethers.concat([ + this.verifierRSA.target, + ethers.AbiCoder.defaultAbiCoder().encode( + ['bytes', 'bytes'], + [signerRSA.signingKey.publicKey.e, signerRSA.signingKey.publicKey.n], + ), + ]); + + const weights = [1, 2, 3]; + this.signer = new NonNativeSigner(new MultiERC7913SigningKey([signerECDSA1, signerP256, signerRSA], weights)); + this.mock = await this.makeMock( + [signerECDSA1.address, signerP256.bytes, signerRSA.bytes], + weights, + 4, // Requires at least signer2 + signer3, or all three signers + ); + }); + + shouldBehaveLikeAccountCore(); + shouldBehaveLikeAccountHolder(); + shouldBehaveLikeERC1271({ erc7739: true }); + shouldBehaveLikeERC7821(); + }); + + describe('Weight management', function () { + beforeEach(async function () { + const weights = [1, 2, 3]; + this.signer = new NonNativeSigner( + new MultiERC7913SigningKey([signerECDSA1, signerECDSA2, signerECDSA3], weights), + ); + this.mock = await this.makeMock([signerECDSA1.address, signerECDSA2.address, signerECDSA3.address], weights, 4); + await this.mock.deploy(); + }); + + it('can get signer weights', async function () { + const signer1 = signerECDSA1.address; + const signer2 = signerECDSA2.address; + const signer3 = signerECDSA3.address; + + await expect(this.mock.signerWeight(signer1)).to.eventually.equal(1); + await expect(this.mock.signerWeight(signer2)).to.eventually.equal(2); + await expect(this.mock.signerWeight(signer3)).to.eventually.equal(3); + }); + + it('can update signer weights', async function () { + const signer1 = signerECDSA1.address; + const signer2 = signerECDSA2.address; + const signer3 = signerECDSA3.address; + + // Successfully updates weights and emits event + await expect(this.mock.$_setSignerWeights([signer1, signer2], [5, 5])) + .to.emit(this.mock, 'ERC7913SignerWeightChanged') + .withArgs(signer1, 5) + .to.emit(this.mock, 'ERC7913SignerWeightChanged') + .withArgs(signer2, 5); + + await expect(this.mock.signerWeight(signer1)).to.eventually.equal(5); + await expect(this.mock.signerWeight(signer2)).to.eventually.equal(5); + await expect(this.mock.signerWeight(signer3)).to.eventually.equal(3); // unchanged + }); + + it('cannot set weight to non-existent signer', async function () { + const randomSigner = ethers.Wallet.createRandom().address; + + // Reverts when setting weight for non-existent signer + await expect(this.mock.$_setSignerWeights([randomSigner], [1])) + .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913NonexistentSigner') + .withArgs(randomSigner.toLowerCase()); + }); + + it('cannot set weight to 0', async function () { + const signer1 = signerECDSA1.address; + + // Reverts when setting weight to 0 + await expect(this.mock.$_setSignerWeights([signer1], [0])) + .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913WeightedInvalidWeight') + .withArgs(signer1.toLowerCase(), 0); + }); + + it('requires signers and weights arrays to have same length', async function () { + const signer1 = signerECDSA1.address; + const signer2 = signerECDSA2.address; + + // Reverts when arrays have different lengths + await expect(this.mock.$_setSignerWeights([signer1, signer2], [1])).to.be.revertedWithCustomError( + this.mock, + 'MultiSignerERC7913WeightedMismatchedLength', + ); + }); + + it('validates threshold is reachable when updating weights', async function () { + const signer1 = signerECDSA1.address; + const signer2 = signerECDSA2.address; + const signer3 = signerECDSA3.address; + + // First, lower the weights so the sum is exactly 6 (just enough for threshold=6) + await expect(this.mock.$_setSignerWeights([signer1, signer2, signer3], [1, 2, 3])).to.emit( + this.mock, + 'ERC7913SignerWeightChanged', + ); + + // Increase threshold to 6 + await expect(this.mock.$_setThreshold(6)).to.emit(this.mock, 'ERC7913ThresholdSet').withArgs(6); + + // Now try to lower weights so their sum is less than the threshold + await expect(this.mock.$_setSignerWeights([signer1, signer2, signer3], [1, 1, 1])).to.be.revertedWithCustomError( + this.mock, + 'MultiSignerERC7913UnreachableThreshold', + ); + + // Try to increase threshold to be larger than the total weight + await expect(this.mock.$_setThreshold(7)) + .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913UnreachableThreshold') + .withArgs(6, 7); + }); + + it('reports default weight of 1 for signers without explicit weight', async function () { + const signer4 = signerECDSA4.address; + + // Add a new signer without setting weight + await this.mock.$_addSigners([signer4]); + + // Should have default weight of 1 + await expect(this.mock.signerWeight(signer4)).to.eventually.equal(1); + }); + + it('reports weight of 0 for invalid signers', async function () { + const randomSigner = ethers.Wallet.createRandom().address; + await expect(this.mock.signerWeight(randomSigner)).to.eventually.equal(0); + }); + + it('can get total weight of all signers', async function () { + await expect(this.mock.totalWeight()).to.eventually.equal(6); // max(_totalWeight, _signers.length) = max(6, 3) = 6 + }); + + it('totalWeight returns correct value when all signers have default weight of 1', async function () { + // Deploy a new mock with all signers having default weight (1) + const signers = [signerECDSA1.address, signerECDSA2.address, signerECDSA3.address]; + const defaultWeights = [1, 1, 1]; // All weights are 1 (default) + const newMock = await this.makeMock(signers, defaultWeights, 2); + await newMock.deploy(); + + // totalWeight should return max(3, 3) = 3 when all weights are default + await expect(newMock.totalWeight()).to.eventually.equal(3); + + // Clear custom weights to ensure we're using default weights + await newMock.$_setSignerWeights(signers, [1, 1, 1]); + + // totalWeight should still be max(3, 3) = 3 + await expect(newMock.totalWeight()).to.eventually.equal(3); + }); + + it('_setSignerWeights correctly handles default weights when updating', async function () { + const signer1 = signerECDSA1.address; + + // Current weights are [1, 2, 3] + + // Set weight for signer1 from 1 (default) to 5 + await this.mock.$_setSignerWeights([signer1], [5]); + + // totalWeight should be updated from max(6, 3) to max(10, 3) = 10 + await expect(this.mock.totalWeight()).to.eventually.equal(10); + + // Reset signer1 to default weight (1) + await this.mock.$_setSignerWeights([signer1], [1]); + + // totalWeight should be back to max(6, 3) = 6 + await expect(this.mock.totalWeight()).to.eventually.equal(6); + }); + + it('updates total weight when adding and removing signers', async function () { + const signer4 = signerECDSA4.address; + + // Add a new signer - should increase total weight by default weight (1) + await this.mock.$_addSigners([signer4]); + await expect(this.mock.totalWeight()).to.eventually.equal(7); // max(7, 4) = 7 + + // Set weight to 5 - should increase total weight by 4 + await this.mock.$_setSignerWeights([signer4], [5]); + await expect(this.mock.totalWeight()).to.eventually.equal(11); // max(11, 4) = 11 + + // Remove signer - should decrease total weight by current weight (5) + await this.mock.$_removeSigners([signer4]); + await expect(this.mock.totalWeight()).to.eventually.equal(6); // max(6, 3) = 6 + }); + + it('removing signers should not make threshold unreachable', async function () { + // current threshold = 4, totalWeight = max(6, 3) = 6 + const signer1 = signerECDSA1.address; // weight 1 + const signer3 = signerECDSA3.address; // weight 3 + + // After removing signer3, the threshold is unreachable because totalWeight = max(3, 2) = 3 but threshold = 4 + // This should revert + await expect(this.mock.$_removeSigners([signer3])) + .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913UnreachableThreshold') + .withArgs(3, 4); + + // Removing signer1 should not revert (new totalWeight = max(5, 2) = 5, threshold = 4) + await expect(this.mock.$_removeSigners([signer1])).to.not.be.reverted; + }); + }); +}); diff --git a/test/helpers/signers.js b/test/helpers/signers.js index d807d592f0d..88759585649 100644 --- a/test/helpers/signers.js +++ b/test/helpers/signers.js @@ -13,9 +13,12 @@ const { hexlify, sha256, toBeHex, + keccak256, + toBigInt, } = require('ethers'); const { secp256r1 } = require('@noble/curves/p256'); const { generateKeyPairSync, privateEncrypt } = require('crypto'); +const { AbiCoder } = require('ethers'); // Lightweight version of BaseWallet class NonNativeSigner extends AbstractSigner { @@ -144,4 +147,62 @@ class RSASHA256SigningKey extends RSASigningKey { } } -module.exports = { NonNativeSigner, P256SigningKey, RSASigningKey, RSASHA256SigningKey }; +class MultiERC7913SigningKey { + #signers; + #weights; + + constructor(signers, weights = null) { + assertArgument( + Array.isArray(signers) && signers.length > 0, + 'signers must be a non-empty array', + 'signers', + signers.length, + ); + + if (weights !== null) { + assertArgument( + Array.isArray(weights) && weights.length === signers.length, + 'weights must be an array with the same length as signers', + 'weights', + weights.length, + ); + } + + this.#signers = signers; + this.#weights = weights; + } + + get signers() { + return this.#signers; + } + + get weights() { + return this.#weights; + } + + sign(digest /*: BytesLike*/ /*: Signature*/) { + assertArgument(dataLength(digest) === 32, 'invalid digest length', 'digest', digest); + + const sortedSigners = this.#signers + .map(signer => { + const signerBytes = typeof signer.address === 'string' ? signer.address : signer.bytes; + + const id = keccak256(signerBytes); + return { + id, + signer: signerBytes, + signature: signer.signingKey.sign(digest).serialized, + }; + }) + .sort((a, b) => (toBigInt(a.id) < toBigInt(b.id) ? -1 : 1)); + + return { + serialized: AbiCoder.defaultAbiCoder().encode( + ['bytes[]', 'bytes[]'], + [sortedSigners.map(p => p.signer), sortedSigners.map(p => p.signature)], + ), + }; + } +} + +module.exports = { NonNativeSigner, P256SigningKey, RSASigningKey, RSASHA256SigningKey, MultiERC7913SigningKey }; diff --git a/test/utils/cryptography/ERC7913Utils.test.js b/test/utils/cryptography/ERC7913Utils.test.js new file mode 100644 index 00000000000..1602bad0a61 --- /dev/null +++ b/test/utils/cryptography/ERC7913Utils.test.js @@ -0,0 +1,257 @@ +const { expect } = require('chai'); +const { ethers } = require('hardhat'); +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); +const { PANIC_CODES } = require('@nomicfoundation/hardhat-chai-matchers/panic'); + +const VALID_SW_KEY_1 = ethers.toUtf8Bytes('valid_key_1'); +const VALID_SW_KEY_2 = ethers.toUtf8Bytes('valid_key_2'); + +const VALID_SW_SIGNATURE_1 = ethers.toUtf8Bytes('valid_signature_1'); +const VALID_SW_SIGNATURE_2 = ethers.toUtf8Bytes('valid_signature_2'); + +async function fixture() { + const [, signer, other, extraSigner] = await ethers.getSigners(); + const mock = await ethers.deployContract('$ERC7913Utils'); + + // Deploy a mock ERC-1271 wallet + const wallet = await ethers.deployContract('ERC1271WalletMock', [signer]); + const wallet2 = await ethers.deployContract('ERC1271WalletMock', [extraSigner]); + + // Deploy a mock ERC-7913 verifier + const verifier = await ethers.deployContract('ERC7913VerifierMock'); + + return { + signer, + extraSigner, + other, + mock, + wallet, + wallet2, + verifier, + }; +} + +describe('ERC7913Utils', function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + }); + + describe('isValidSignatureNow', function () { + describe('with EOA signer', function () { + it('with matching signer and signature', async function () { + const eoaSigner = ethers.zeroPadValue(this.signer.address, 20); + const message = 'Hello, World!'; + const signature = await this.signer.signMessage(message); + await expect(this.mock.$isValidSignatureNow(eoaSigner, ethers.hashMessage(message), signature)).to.eventually.be + .true; + }); + + it('with invalid signer', async function () { + const eoaSigner = ethers.zeroPadValue(this.other.address, 20); + const message = 'Hello, World!'; + const signature = await this.signer.signMessage(message); + await expect(this.mock.$isValidSignatureNow(eoaSigner, ethers.hashMessage(message), signature)).to.eventually.be + .false; + }); + + it('with invalid signature', async function () { + const eoaSigner = ethers.zeroPadValue(this.signer.address, 20); + const signature = await this.signer.signMessage('Hello, World!'); + await expect(this.mock.$isValidSignatureNow(eoaSigner, ethers.hashMessage('Nope'), signature)).to.eventually.be + .false; + }); + }); + + describe('with ERC-1271 wallet', function () { + it('with matching signer and signature', async function () { + const walletSigner = ethers.zeroPadValue(this.wallet.target, 20); + const message = 'Hello, World!'; + const signature = await this.signer.signMessage(message); + await expect(this.mock.$isValidSignatureNow(walletSigner, ethers.hashMessage(message), signature)).to.eventually + .be.true; + }); + + it('with invalid signer', async function () { + const walletSigner = ethers.zeroPadValue(this.mock.target, 20); + const message = 'Hello, World!'; + const signature = await this.signer.signMessage(message); + await expect(this.mock.$isValidSignatureNow(walletSigner, ethers.hashMessage(message), signature)).to.eventually + .be.false; + }); + + it('with invalid signature', async function () { + const walletSigner = ethers.zeroPadValue(this.wallet.target, 20); + const signature = await this.signer.signMessage('Hello, World!'); + await expect(this.mock.$isValidSignatureNow(walletSigner, ethers.hashMessage('Nope'), signature)).to.eventually + .be.false; + }); + }); + + describe('with ERC-7913 verifier', function () { + it('with matching signer and signature', async function () { + await expect( + this.mock.$isValidSignatureNow( + ethers.concat([this.verifier.target, VALID_SW_KEY_1]), + ethers.hashMessage('Hello, World!'), + VALID_SW_SIGNATURE_1, + ), + ).to.eventually.be.true; + }); + + it('with invalid verifier', async function () { + const invalidVerifierSigner = ethers.concat([this.mock.target, VALID_SW_KEY_1]); + await expect( + this.mock.$isValidSignatureNow( + invalidVerifierSigner, + ethers.hashMessage('Hello, World!'), + VALID_SW_SIGNATURE_1, + ), + ).to.eventually.be.false; + }); + + it('with invalid key', async function () { + await expect( + this.mock.$isValidSignatureNow( + ethers.concat([this.verifier.target, ethers.randomBytes(32)]), + ethers.hashMessage('Hello, World!'), + VALID_SW_SIGNATURE_1, + ), + ).to.eventually.be.false; + }); + + it('with invalid signature', async function () { + await expect( + this.mock.$isValidSignatureNow( + ethers.concat([this.verifier.target, VALID_SW_KEY_1]), + ethers.hashMessage('Hello, World!'), + ethers.randomBytes(65), + ), + ).to.eventually.be.false; + }); + + it('with signer too short', async function () { + const shortSigner = ethers.randomBytes(19); + await expect( + this.mock.$isValidSignatureNow(shortSigner, ethers.hashMessage('Hello, World!'), VALID_SW_SIGNATURE_1), + ).to.eventually.be.false; + }); + }); + }); + + describe('areValidSignaturesNow', function () { + it('should validate a single signature', async function () { + const message = 'Hello, World!'; + const signature = await this.signer.signMessage(message); + await expect( + this.mock.$areValidSignaturesNow( + ethers.hashMessage(message), + [ethers.zeroPadValue(this.signer.address, 20)], + [signature], + ), + ).to.eventually.be.true; + }); + + it('should validate multiple signatures with different signer types', async function () { + const message = 'Hello, World!'; + const signature = await this.signer.signMessage(message); + const pairs = [ + [ethers.zeroPadValue(this.signer.address, 20), signature], + [ethers.zeroPadValue(this.wallet.target, 20), signature], + [ethers.concat([this.verifier.target, VALID_SW_KEY_1]), VALID_SW_SIGNATURE_1], + ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); + const signers = pairs.map(([signer]) => signer); + const signatures = pairs.map(([, signature]) => signature); + await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage(message), signers, signatures)).to.eventually.be + .true; + }); + + it('should validate multiple EOA signatures', async function () { + const message = 'Helllo, World!'; + const pairs = [ + [ethers.zeroPadValue(this.signer.address, 20), await this.signer.signMessage(message)], + [ethers.zeroPadValue(this.extraSigner.address, 20), await this.extraSigner.signMessage(message)], + ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); + const signers = pairs.map(([signer]) => signer); + const signatures = pairs.map(([, signature]) => signature); + await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage(message), signers, signatures)).to.eventually.be + .true; + }); + + it('should validate multiple ERC-1271 wallet signatures', async function () { + const message = 'Helllo, World!'; + const pairs = [ + [ethers.zeroPadValue(this.wallet.target, 20), await this.signer.signMessage(message)], + [ethers.zeroPadValue(this.wallet2.target, 20), await this.extraSigner.signMessage(message)], + ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); + const signers = pairs.map(([signer]) => signer); + const signatures = pairs.map(([, signature]) => signature); + await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage(message), signers, signatures)).to.eventually.be + .true; + }); + + it('should validate multiple ERC-7913 signatures', async function () { + const pairs = [ + [ethers.concat([this.verifier.target, VALID_SW_KEY_1]), VALID_SW_SIGNATURE_1], + [ethers.concat([this.verifier.target, VALID_SW_KEY_2]), VALID_SW_SIGNATURE_2], + ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); + const signers = pairs.map(([signer]) => signer); + const signatures = pairs.map(([, signature]) => signature); + await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage('Hello, World!'), signers, signatures)).to + .eventually.be.true; + }); + + it('should return false if any signature is invalid', async function () { + const message = 'Hello, World!'; + await expect( + this.mock.$areValidSignaturesNow( + ethers.hashMessage(message), + [ethers.zeroPadValue(this.signer.address, 20), await this.extraSigner.signMessage(message)], + [await this.signer.signMessage(message), await this.signer.signMessage('Nope')], + ), + ).to.eventually.be.false; + }); + + it('should return false if signers are not ordered by ID', async function () { + const message = 'Hello, World!'; + const pairs = [ + [ethers.zeroPadValue(this.signer.address, 20), await this.signer.signMessage(message)], + [ethers.zeroPadValue(this.extraSigner.address, 20), await this.extraSigner.signMessage(message)], + ]; + + if (ethers.keccak256(pairs[0][0]) - ethers.keccak256(pairs[1][0])) { + pairs.reverse(); + } + + const signers = pairs.map(([signer]) => signer); + const signatures = pairs.map(([, signature]) => signature); + await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage(message), signers, signatures)).to.eventually.be + .false; + }); + + it('should return false if there are duplicate signers', async function () { + const message = 'Hello, World!'; + await expect( + this.mock.$areValidSignaturesNow( + ethers.hashMessage(message), + [ethers.zeroPadValue(this.signer.address, 20), ethers.zeroPadValue(this.signer.address, 20)], // Same signer used twice + [await this.signer.signMessage(message), await this.signer.signMessage(message)], + ), + ).to.eventually.be.false; + }); + + it('should fail if signatures array length does not match signers array length', async function () { + const message = 'Hello, World!'; + await expect( + this.mock.$areValidSignaturesNow( + ethers.hashMessage(message), + [ethers.zeroPadValue(this.signer.address, 20), await this.extraSigner.signMessage(message)], + [await this.signer.signMessage(message)], // Missing one signature + ), + ).to.be.revertedWithPanic(PANIC_CODES.ARRAY_ACCESS_OUT_OF_BOUNDS); + }); + + it('should pass with empty arrays', async function () { + await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage('Hello, World!'), [], [])).to.eventually.be.true; + }); + }); +}); From 3ac675d979cce1b253fa2ae55a21902d7eee2d78 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Tue, 3 Jun 2025 09:08:50 -0600 Subject: [PATCH 084/110] Add changesets --- .changeset/nice-rings-wish.md | 5 +++++ .changeset/public-crabs-heal.md | 5 +++++ .changeset/quiet-kiwis-feel.md | 5 +++++ .changeset/social-walls-obey.md | 5 +++++ .changeset/sour-pens-shake.md | 5 +++++ contracts/utils/README.adoc | 6 +++--- 6 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .changeset/nice-rings-wish.md create mode 100644 .changeset/public-crabs-heal.md create mode 100644 .changeset/quiet-kiwis-feel.md create mode 100644 .changeset/social-walls-obey.md create mode 100644 .changeset/sour-pens-shake.md diff --git a/.changeset/nice-rings-wish.md b/.changeset/nice-rings-wish.md new file mode 100644 index 00000000000..50777b5523d --- /dev/null +++ b/.changeset/nice-rings-wish.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`ERC7913P256Verifier` and `ERC7913RSAVerifier`: Ready to use ERC-7913 verifiers that implement key verification for P256 (secp256r1) and RSA keys. diff --git a/.changeset/public-crabs-heal.md b/.changeset/public-crabs-heal.md new file mode 100644 index 00000000000..463dc988731 --- /dev/null +++ b/.changeset/public-crabs-heal.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`MultiSignerERC7913Weighted`: Extension of `MultiSignerERC7913` that supports assigning different weights to each signer, enabling more flexible governance schemes. diff --git a/.changeset/quiet-kiwis-feel.md b/.changeset/quiet-kiwis-feel.md new file mode 100644 index 00000000000..19cb5c67a97 --- /dev/null +++ b/.changeset/quiet-kiwis-feel.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`SignerERC7913`: Abstract signer that verifies signatures using the ERC-7913 workflow. diff --git a/.changeset/social-walls-obey.md b/.changeset/social-walls-obey.md new file mode 100644 index 00000000000..05da8adba30 --- /dev/null +++ b/.changeset/social-walls-obey.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`MultiSignerERC7913`: Implementation of `AbstractSigner` that supports multiple ERC-7913 signers with a threshold-based signature verification system. diff --git a/.changeset/sour-pens-shake.md b/.changeset/sour-pens-shake.md new file mode 100644 index 00000000000..3270031febf --- /dev/null +++ b/.changeset/sour-pens-shake.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`ERC7913Utils`: Utilities library for verifying signatures by ERC-7913 formatted signers. diff --git a/contracts/utils/README.adoc b/contracts/utils/README.adoc index 6ea03da7bd5..1b9d4e2e0f5 100644 --- a/contracts/utils/README.adoc +++ b/contracts/utils/README.adoc @@ -54,7 +54,7 @@ Miscellaneous contracts and libraries containing utility functions you can use t * {SignerECDSA}, {SignerP256}, {SignerRSA}: Implementations of an {AbstractSigner} with specific signature validation algorithms. * {SignerERC7702}: Implementation of {AbstractSigner} that validates signatures using the contract's own address as the signer, useful for delegated accounts following EIP-7702. * {SignerERC7913}, {MultiSignerERC7913}, {MultiSignerERC7913Weighted}: Implementations of {AbstractSigner} that validate signatures based on ERC-7913. Including a simple and weighted multisignature scheme. - * {ERC7913SignatureVerifierP256}, {ERC7913SignatureVerifierRSA}: Ready to use ERC-7913 signature verifiers for P256 and RSA keys + * {ERC7913P256Verifier}, {ERC7913RSAVerifier}: Ready to use ERC-7913 signature verifiers for P256 and RSA keys [NOTE] ==== @@ -113,9 +113,9 @@ Because Solidity does not support generic types, {EnumerableMap} and {Enumerable {{ERC7913Utils}} -{{ERC7913SignatureVerifierP256}} +{{ERC7913P256Verifier}} -{{ERC7913SignatureVerifierRSA}} +{{ERC7913RSAVerifier}} == Security From 804ceea15a6c7ee57cfdf4c63783e0d4c4af85ff Mon Sep 17 00:00:00 2001 From: ernestognw Date: Tue, 3 Jun 2025 21:53:18 -0600 Subject: [PATCH 085/110] Organize --- contracts/mocks/account/AccountMock.sol | 3 +++ contracts/utils/cryptography/README.adoc | 14 ++++++++++++++ .../{ => signers}/MultiSignerERC7913.sol | 8 ++++---- .../{ => signers}/MultiSignerERC7913Weighted.sol | 6 +++--- .../cryptography/{ => signers}/SignerERC7913.sol | 2 +- .../{ => verifiers}/ERC7913P256Verifier.sol | 4 ++-- .../{ => verifiers}/ERC7913RSAVerifier.sol | 4 ++-- 7 files changed, 29 insertions(+), 12 deletions(-) rename contracts/utils/cryptography/{ => signers}/MultiSignerERC7913.sol (97%) rename contracts/utils/cryptography/{ => signers}/MultiSignerERC7913Weighted.sol (98%) rename contracts/utils/cryptography/{ => signers}/SignerERC7913.sol (97%) rename contracts/utils/cryptography/{ => verifiers}/ERC7913P256Verifier.sol (86%) rename contracts/utils/cryptography/{ => verifiers}/ERC7913RSAVerifier.sol (82%) diff --git a/contracts/mocks/account/AccountMock.sol b/contracts/mocks/account/AccountMock.sol index 6baf12e7418..71b958051e4 100644 --- a/contracts/mocks/account/AccountMock.sol +++ b/contracts/mocks/account/AccountMock.sol @@ -17,6 +17,9 @@ import {SignerECDSA} from "../../utils/cryptography/signers/SignerECDSA.sol"; import {SignerP256} from "../../utils/cryptography/signers/SignerP256.sol"; import {SignerRSA} from "../../utils/cryptography/signers/SignerRSA.sol"; import {SignerERC7702} from "../../utils/cryptography/signers/SignerERC7702.sol"; +import {SignerERC7913} from "../../utils/cryptography/signers/SignerERC7913.sol"; +import {MultiSignerERC7913} from "../../utils/cryptography/signers/MultiSignerERC7913.sol"; +import {MultiSignerERC7913Weighted} from "../../utils/cryptography/signers/MultiSignerERC7913Weighted.sol"; abstract contract AccountMock is Account, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { /// Validates a user operation with a boolean signature. diff --git a/contracts/utils/cryptography/README.adoc b/contracts/utils/cryptography/README.adoc index 8e76f4e21a8..37a982448ec 100644 --- a/contracts/utils/cryptography/README.adoc +++ b/contracts/utils/cryptography/README.adoc @@ -17,6 +17,8 @@ A collection of contracts and libraries that implement various signature validat * {ERC7739}: An abstract contract to validate signatures following the rehashing scheme from {ERC7739Utils}. * {SignerECDSA}, {SignerP256}, {SignerRSA}: Implementations of an {AbstractSigner} with specific signature validation algorithms. * {SignerERC7702}: Implementation of {AbstractSigner} that validates signatures using the contract's own address as the signer, useful for delegated accounts following EIP-7702. + * {SignerERC7913}, {MultiSignerERC7913}, {MultiSignerERC7913Weighted}: Implementations of {AbstractSigner} that validate signatures based on ERC-7913. Including a simple and weighted multisignature scheme. + * {ERC7913P256Verifier}, {ERC7913RSAVerifier}: Ready to use ERC-7913 signature verifiers for P256 and RSA keys. == Utils @@ -51,3 +53,15 @@ A collection of contracts and libraries that implement various signature validat {{SignerRSA}} {{SignerERC7702}} + +{{SignerERC7913}} + +{{MultiSignerERC7913}} + +{{MultiSignerERC7913Weighted}} + +== Verifiers + +{{ERC7913P256Verifier}} + +{{ERC7913RSAVerifier}} diff --git a/contracts/utils/cryptography/MultiSignerERC7913.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol similarity index 97% rename from contracts/utils/cryptography/MultiSignerERC7913.sol rename to contracts/utils/cryptography/signers/MultiSignerERC7913.sol index 8fda2368712..22a71373f17 100644 --- a/contracts/utils/cryptography/MultiSignerERC7913.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.27; import {AbstractSigner} from "./AbstractSigner.sol"; -import {ERC7913Utils} from "./ERC7913Utils.sol"; -import {EnumerableSet} from "../structs/EnumerableSet.sol"; -import {Calldata} from "../../utils/Calldata.sol"; -import {SafeCast} from "../../utils/math/SafeCast.sol"; +import {ERC7913Utils} from "../ERC7913Utils.sol"; +import {EnumerableSet} from "../../structs/EnumerableSet.sol"; +import {Calldata} from "../../../utils/Calldata.sol"; +import {SafeCast} from "../../../utils/math/SafeCast.sol"; /** * @dev Implementation of {AbstractSigner} using multiple ERC-7913 signers with a threshold-based diff --git a/contracts/utils/cryptography/MultiSignerERC7913Weighted.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol similarity index 98% rename from contracts/utils/cryptography/MultiSignerERC7913Weighted.sol rename to contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol index c2273b62bc2..84660e46c84 100644 --- a/contracts/utils/cryptography/MultiSignerERC7913Weighted.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol @@ -2,10 +2,10 @@ pragma solidity ^0.8.27; -import {Math} from "../math/Math.sol"; -import {SafeCast} from "../math/SafeCast.sol"; +import {Math} from "../../math/Math.sol"; +import {SafeCast} from "../../math/SafeCast.sol"; import {MultiSignerERC7913} from "./MultiSignerERC7913.sol"; -import {EnumerableSet} from "../../utils/structs/EnumerableSet.sol"; +import {EnumerableSet} from "../../../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {MultiSignerERC7913} that supports weighted signatures. diff --git a/contracts/utils/cryptography/SignerERC7913.sol b/contracts/utils/cryptography/signers/SignerERC7913.sol similarity index 97% rename from contracts/utils/cryptography/SignerERC7913.sol rename to contracts/utils/cryptography/signers/SignerERC7913.sol index ae05d618677..1d628859138 100644 --- a/contracts/utils/cryptography/SignerERC7913.sol +++ b/contracts/utils/cryptography/signers/SignerERC7913.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.24; import {AbstractSigner} from "./AbstractSigner.sol"; -import {ERC7913Utils} from "./ERC7913Utils.sol"; +import {ERC7913Utils} from "../ERC7913Utils.sol"; /** * @dev Implementation of {AbstractSigner} using diff --git a/contracts/utils/cryptography/ERC7913P256Verifier.sol b/contracts/utils/cryptography/verifiers/ERC7913P256Verifier.sol similarity index 86% rename from contracts/utils/cryptography/ERC7913P256Verifier.sol rename to contracts/utils/cryptography/verifiers/ERC7913P256Verifier.sol index b7b49a76363..70d0f342a1d 100644 --- a/contracts/utils/cryptography/ERC7913P256Verifier.sol +++ b/contracts/utils/cryptography/verifiers/ERC7913P256Verifier.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.20; -import {P256} from "../../utils/cryptography/P256.sol"; -import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol"; +import {P256} from "../../../utils/cryptography/P256.sol"; +import {IERC7913SignatureVerifier} from "../../../interfaces/IERC7913.sol"; /** * @dev ERC-7913 signature verifier that support P256 (secp256r1) keys. diff --git a/contracts/utils/cryptography/ERC7913RSAVerifier.sol b/contracts/utils/cryptography/verifiers/ERC7913RSAVerifier.sol similarity index 82% rename from contracts/utils/cryptography/ERC7913RSAVerifier.sol rename to contracts/utils/cryptography/verifiers/ERC7913RSAVerifier.sol index f0e022f39c6..1139f93265b 100644 --- a/contracts/utils/cryptography/ERC7913RSAVerifier.sol +++ b/contracts/utils/cryptography/verifiers/ERC7913RSAVerifier.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.20; -import {RSA} from "../../utils/cryptography/RSA.sol"; -import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol"; +import {RSA} from "../../../utils/cryptography/RSA.sol"; +import {IERC7913SignatureVerifier} from "../../../interfaces/IERC7913.sol"; /** * @dev ERC-7913 signature verifier that support RSA keys. From d0f596181bedfb90cd32eb2de7fe48416a4c0104 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Tue, 3 Jun 2025 22:31:01 -0600 Subject: [PATCH 086/110] Review --- .changeset/sour-pens-shake.md | 2 +- contracts/utils/cryptography/ERC7913Utils.sol | 82 ------ .../utils/cryptography/SignatureChecker.sol | 84 +++++- .../signers/MultiSignerERC7913.sol | 46 ++-- .../signers/MultiSignerERC7913Weighted.sol | 12 +- .../cryptography/signers/SignerERC7913.sol | 6 +- docs/modules/ROOT/pages/utilities.adoc | 71 ++++- test/account/AccountMultiSigner.test.js | 4 +- test/utils/cryptography/ERC7913Utils.test.js | 257 ------------------ .../cryptography/SignatureChecker.test.js | 217 ++++++++++++++- 10 files changed, 385 insertions(+), 396 deletions(-) delete mode 100644 contracts/utils/cryptography/ERC7913Utils.sol delete mode 100644 test/utils/cryptography/ERC7913Utils.test.js diff --git a/.changeset/sour-pens-shake.md b/.changeset/sour-pens-shake.md index 3270031febf..e64e92d0c52 100644 --- a/.changeset/sour-pens-shake.md +++ b/.changeset/sour-pens-shake.md @@ -2,4 +2,4 @@ 'openzeppelin-solidity': minor --- -`ERC7913Utils`: Utilities library for verifying signatures by ERC-7913 formatted signers. +`SignatureChecker`: Add support for ERC-7913 signatures alongside existing ECDSA and ERC-1271 signature verification. diff --git a/contracts/utils/cryptography/ERC7913Utils.sol b/contracts/utils/cryptography/ERC7913Utils.sol deleted file mode 100644 index 285d3895ff7..00000000000 --- a/contracts/utils/cryptography/ERC7913Utils.sol +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.24; - -import {SignatureChecker} from "./SignatureChecker.sol"; -import {Bytes} from "../Bytes.sol"; -import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol"; - -/** - * @dev Library that provides common ERC-7913 utility functions. - * - * This library extends the functionality of xref:api:utils#SignatureChecker[SignatureChecker] - * to support signature verification for keys that do not have an Ethereum address of their own - * as with ERC-1271. - * - * See https://eips.ethereum.org/EIPS/eip-7913[ERC-7913]. - */ -library ERC7913Utils { - using Bytes for bytes; - - /** - * @dev Verifies a signature for a given signer and hash. - * - * The signer is a `bytes` object that is the concatenation of an address and optionally a key: - * `verifier || key`. A signer must be at least 20 bytes long. - * - * Verification is done as follows: - * - If `signer.length < 20`: verification fails - * - If `signer.length == 20`: verification is done using {SignatureChecker} - * - Otherwise: verification is done using {IERC7913SignatureVerifier} - */ - function isValidSignatureNow( - bytes memory signer, - bytes32 hash, - bytes memory signature - ) internal view returns (bool) { - if (signer.length < 20) { - return false; - } else if (signer.length == 20) { - return SignatureChecker.isValidSignatureNow(address(bytes20(signer)), hash, signature); - } else { - (bool success, bytes memory result) = address(bytes20(signer)).staticcall( - abi.encodeCall(IERC7913SignatureVerifier.verify, (signer.slice(20), hash, signature)) - ); - return (success && - result.length >= 32 && - abi.decode(result, (bytes32)) == bytes32(IERC7913SignatureVerifier.verify.selector)); - } - } - - /** - * @dev Verifies multiple `signatures` for a given hash using a set of `signers`. - * - * The signers must be ordered by their `keccak256` hash to ensure no duplicates and to optimize - * the verification process. The function will return `false` if the signers are not properly ordered. - * - * Requirements: - * - * * The `signatures` array must be at least the `signers` array's length. - */ - function areValidSignaturesNow( - bytes32 hash, - bytes[] memory signers, - bytes[] memory signatures - ) internal view returns (bool) { - bytes32 previousId = bytes32(0); - - uint256 signersLength = signers.length; - for (uint256 i = 0; i < signersLength; i++) { - bytes memory signer = signers[i]; - // Signers must ordered by id to ensure no duplicates - bytes32 id = keccak256(signer); - if (previousId >= id || !isValidSignatureNow(signer, hash, signatures[i])) { - return false; - } - - previousId = id; - } - - return true; - } -} diff --git a/contracts/utils/cryptography/SignatureChecker.sol b/contracts/utils/cryptography/SignatureChecker.sol index c326222d555..8704ec8548f 100644 --- a/contracts/utils/cryptography/SignatureChecker.sol +++ b/contracts/utils/cryptography/SignatureChecker.sol @@ -5,19 +5,29 @@ pragma solidity ^0.8.20; import {ECDSA} from "./ECDSA.sol"; import {IERC1271} from "../../interfaces/IERC1271.sol"; +import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol"; +import {Bytes} from "../../utils/Bytes.sol"; /** - * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA - * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like - * Argent and Safe Wallet (previously Gnosis Safe). + * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support: + * + * * ECDSA signatures from externally owned accounts (EOAs) + * * ERC-1271 signatures from smart contract wallets like Argent and Safe Wallet (previously Gnosis Safe) + * * ERC-7913 signatures from keys that do not have an Ethereum address of their own + * + * See https://eips.ethereum.org/EIPS/eip-1271[ERC-1271] and https://eips.ethereum.org/EIPS/eip-7913[ERC-7913]. */ library SignatureChecker { + using Bytes for bytes; + /** * @dev Checks if a signature is valid for a given signer and data hash. If the signer has code, the * signature is validated against it using ERC-1271, otherwise it's validated using `ECDSA.recover`. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). + * + * NOTE: For an extended version of this function that supports ERC-7913 signatures, see {isValidERC7913SignatureNow}. */ function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) { if (signer.code.length == 0) { @@ -47,4 +57,72 @@ library SignatureChecker { result.length >= 32 && abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector)); } + + /** + * @dev Verifies a signature for a given ERC-7913 signer and hash. + * + * The signer is a `bytes` object that is the concatenation of an address and optionally a key: + * `verifier || key`. A signer must be at least 20 bytes long. + * + * Verification is done as follows: + * + * * If `signer.length < 20`: verification fails + * * If `signer.length == 20`: verification is done using {isValidSignatureNow} + * * Otherwise: verification is done using {IERC7913SignatureVerifier} + * + * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus + * change through time. It could return true at block N and false at block N+1 (or the opposite). + */ + function isValidERC7913SignatureNow( + bytes memory signer, + bytes32 hash, + bytes memory signature + ) internal view returns (bool) { + if (signer.length < 20) { + return false; + } else if (signer.length == 20) { + return isValidSignatureNow(address(bytes20(signer)), hash, signature); + } else { + (bool success, bytes memory result) = address(bytes20(signer)).staticcall( + abi.encodeCall(IERC7913SignatureVerifier.verify, (signer.slice(20), hash, signature)) + ); + return (success && + result.length >= 32 && + abi.decode(result, (bytes32)) == bytes32(IERC7913SignatureVerifier.verify.selector)); + } + } + + /** + * @dev Verifies multiple ERC-7913 `signatures` for a given `hash` using a set of `signers`. + * + * The signers must be ordered by their `keccak256` hash to ensure no duplicates and to optimize + * the verification process. The function will return `false` if the signers are not properly ordered. + * + * Requirements: + * + * * The `signatures` array must be at least the `signers` array's length. + * + * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus + * change through time. It could return true at block N and false at block N+1 (or the opposite). + */ + function areValidERC7913SignaturesNow( + bytes32 hash, + bytes[] memory signers, + bytes[] memory signatures + ) internal view returns (bool) { + bytes32 previousId = bytes32(0); + + for (uint256 i = 0; i < signers.length; ++i) { + bytes memory signer = signers[i]; + // Signers must ordered by id to ensure no duplicates + bytes32 id = keccak256(signer); + if (previousId >= id || !isValidERC7913SignatureNow(signer, hash, signatures[i])) { + return false; + } + + previousId = id; + } + + return true; + } } diff --git a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol index 22a71373f17..b0593c15f58 100644 --- a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol @@ -3,9 +3,8 @@ pragma solidity ^0.8.27; import {AbstractSigner} from "./AbstractSigner.sol"; -import {ERC7913Utils} from "../ERC7913Utils.sol"; +import {SignatureChecker} from "../SignatureChecker.sol"; import {EnumerableSet} from "../../structs/EnumerableSet.sol"; -import {Calldata} from "../../../utils/Calldata.sol"; import {SafeCast} from "../../../utils/math/SafeCast.sol"; /** @@ -47,17 +46,17 @@ import {SafeCast} from "../../../utils/math/SafeCast.sol"; */ abstract contract MultiSignerERC7913 is AbstractSigner { using EnumerableSet for EnumerableSet.BytesSet; - using ERC7913Utils for *; + using SignatureChecker for *; using SafeCast for uint256; - EnumerableSet.BytesSet private _signersSet; + EnumerableSet.BytesSet private _signers; uint128 private _threshold; - /// @dev Emitted when signers are added. - event ERC7913SignersAdded(bytes[] indexed signers); + /// @dev Emitted when a signer is added. + event ERC7913SignerAdded(bytes indexed signers); - /// @dev Emitted when signers are removed. - event ERC7913SignersRemoved(bytes[] indexed signers); + /// @dev Emitted when a signers is removed. + event ERC7913SignerRemoved(bytes indexed signers); /// @dev Emitted when the threshold is updated. event ERC7913ThresholdSet(uint256 threshold); @@ -82,12 +81,12 @@ abstract contract MultiSignerERC7913 is AbstractSigner { * if the signers set grows too large. */ function signers() public view virtual returns (bytes[] memory) { - return _signers().values(); + return _signers.values(); } /// @dev Returns whether the `signer` is an authorized signer. function isSigner(bytes memory signer) public view virtual returns (bool) { - return _signers().contains(signer); + return _signers.contains(signer); } /// @dev Returns the minimum number of signers required to approve a multisignature operation. @@ -95,11 +94,6 @@ abstract contract MultiSignerERC7913 is AbstractSigner { return _threshold; } - /// @dev Returns the set of authorized signers. - function _signers() internal view virtual returns (EnumerableSet.BytesSet storage) { - return _signersSet; - } - /** * @dev Adds the `newSigners` to those allowed to sign on behalf of this contract. * Internal version without access control. @@ -110,13 +104,12 @@ abstract contract MultiSignerERC7913 is AbstractSigner { * * Each of `newSigners` must not be authorized. See {isSigner}. Reverts with {MultiSignerERC7913AlreadyExists} if so. */ function _addSigners(bytes[] memory newSigners) internal virtual { - uint256 newSignersLength = newSigners.length; - for (uint256 i = 0; i < newSignersLength; i++) { + for (uint256 i = 0; i < newSigners.length; ++i) { bytes memory signer = newSigners[i]; require(signer.length >= 20, MultiSignerERC7913InvalidSigner(signer)); - require(_signers().add(signer), MultiSignerERC7913AlreadyExists(signer)); + require(_signers.add(signer), MultiSignerERC7913AlreadyExists(signer)); + emit ERC7913SignerAdded(signer); } - emit ERC7913SignersAdded(newSigners); } /** @@ -128,13 +121,12 @@ abstract contract MultiSignerERC7913 is AbstractSigner { * * See {_validateReachableThreshold} for the threshold validation. */ function _removeSigners(bytes[] memory oldSigners) internal virtual { - uint256 oldSignersLength = oldSigners.length; - for (uint256 i = 0; i < oldSignersLength; i++) { + for (uint256 i = 0; i < oldSigners.length; ++i) { bytes memory signer = oldSigners[i]; - require(_signers().remove(signer), MultiSignerERC7913NonexistentSigner(signer)); + require(_signers.remove(signer), MultiSignerERC7913NonexistentSigner(signer)); + emit ERC7913SignerRemoved(signer); } _validateReachableThreshold(); - emit ERC7913SignersRemoved(oldSigners); } /** @@ -159,7 +151,7 @@ abstract contract MultiSignerERC7913 is AbstractSigner { * * The {signers}'s length must be `>=` to the {threshold}. Throws {MultiSignerERC7913UnreachableThreshold} if not. */ function _validateReachableThreshold() internal view virtual { - uint256 totalSigners = _signers().length(); + uint256 totalSigners = _signers.length(); uint256 currentThreshold = threshold(); require( totalSigners >= currentThreshold, @@ -206,7 +198,6 @@ abstract contract MultiSignerERC7913 is AbstractSigner { ) internal view virtual override returns (bool) { if (signature.length == 0) return false; // For ERC-7739 compatibility (bytes[] memory signingSigners, bytes[] memory signatures) = abi.decode(signature, (bytes[], bytes[])); - if (signingSigners.length != signatures.length) return false; return _validateThreshold(signingSigners) && _validateSignatures(hash, signingSigners, signatures); } @@ -227,13 +218,12 @@ abstract contract MultiSignerERC7913 is AbstractSigner { bytes[] memory signingSigners, bytes[] memory signatures ) internal view virtual returns (bool valid) { - uint256 signersLength = signingSigners.length; - for (uint256 i = 0; i < signersLength; i++) { + for (uint256 i = 0; i < signingSigners.length; ++i) { if (!isSigner(signingSigners[i])) { return false; } } - return hash.areValidSignaturesNow(signingSigners, signatures); + return hash.areValidERC7913SignaturesNow(signingSigners, signatures); } /** diff --git a/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol index 84660e46c84..0120333ac44 100644 --- a/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol @@ -99,11 +99,11 @@ abstract contract MultiSignerERC7913Weighted is MultiSignerERC7913 { * Emits {ERC7913SignerWeightChanged} for each signer. */ function _setSignerWeights(bytes[] memory signers, uint256[] memory newWeights) internal virtual { - require(signers.length == newWeights.length, MultiSignerERC7913WeightedMismatchedLength()); - uint256 oldWeight = _weightSigners(signers); uint256 signersLength = signers.length; + require(signersLength == newWeights.length, MultiSignerERC7913WeightedMismatchedLength()); + uint256 oldWeight = _weightSigners(signers); - for (uint256 i = 0; i < signersLength; i++) { + for (uint256 i = 0; i < signers.length; ++i) { bytes memory signer = signers[i]; uint256 newWeight = newWeights[i]; require(isSigner(signer), MultiSignerERC7913NonexistentSigner(signer)); @@ -170,8 +170,7 @@ abstract contract MultiSignerERC7913Weighted is MultiSignerERC7913 { /// @dev Calculates the total weight of a set of signers. For all signers weight use {totalWeight}. function _weightSigners(bytes[] memory signers) internal view virtual returns (uint256) { uint256 weight = 0; - uint256 signersLength = signers.length; - for (uint256 i = 0; i < signersLength; i++) { + for (uint256 i = 0; i < signers.length; ++i) { weight += signerWeight(signers[i]); } return weight; @@ -187,8 +186,7 @@ abstract contract MultiSignerERC7913Weighted is MultiSignerERC7913 { * Emits {ERC7913SignerWeightChanged} for each signer. */ function _unsafeSetSignerWeights(bytes[] memory signers, uint256[] memory newWeights) private { - uint256 signersLength = signers.length; - for (uint256 i = 0; i < signersLength; i++) { + for (uint256 i = 0; i < signers.length; ++i) { _weights[signers[i]] = newWeights[i]; emit ERC7913SignerWeightChanged(signers[i], newWeights[i]); } diff --git a/contracts/utils/cryptography/signers/SignerERC7913.sol b/contracts/utils/cryptography/signers/SignerERC7913.sol index 1d628859138..107b3959f87 100644 --- a/contracts/utils/cryptography/signers/SignerERC7913.sol +++ b/contracts/utils/cryptography/signers/SignerERC7913.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.24; import {AbstractSigner} from "./AbstractSigner.sol"; -import {ERC7913Utils} from "../ERC7913Utils.sol"; +import {SignatureChecker} from "../SignatureChecker.sol"; /** * @dev Implementation of {AbstractSigner} using @@ -41,11 +41,11 @@ abstract contract SignerERC7913 is AbstractSigner { _signer = signer_; } - /// @dev Verifies a signature using {ERC7913Utils-isValidSignatureNow} with {signer}, `hash` and `signature`. + /// @dev Verifies a signature using {SignatureChecker-isValidERC7913SignatureNow} with {signer}, `hash` and `signature`. function _rawSignatureValidation( bytes32 hash, bytes calldata signature ) internal view virtual override returns (bool) { - return ERC7913Utils.isValidSignatureNow(signer(), hash, signature); + return SignatureChecker.isValidERC7913SignatureNow(signer(), hash, signature); } } diff --git a/docs/modules/ROOT/pages/utilities.adoc b/docs/modules/ROOT/pages/utilities.adoc index 70f78a0c26b..7a95d551de6 100644 --- a/docs/modules/ROOT/pages/utilities.adoc +++ b/docs/modules/ROOT/pages/utilities.adoc @@ -97,30 +97,79 @@ function _verify( IMPORTANT: Always use keys of at least 2048 bits. Additionally, be aware that PKCS#1 v1.5 allows for replayability due to the possibility of arbitrary optional parameters. To prevent replay attacks, consider including an onchain nonce or unique identifier in the message. -=== ERC-7913 Signature Verifiers +=== Signature Verification -ERC-7913 extends the concept of signature verification to support keys that don't have their own Ethereum address. This is particularly useful for integrating non-Ethereum cryptographic curves, hardware devices, or other identity systems into smart accounts. +The xref:api:utils.adoc#SignatureChecker[`SignatureChecker`] library provides a unified interface for verifying signatures from different sources. It seamlessly supports: -The standard defines a verifier interface that can be implemented to support different types of keys. A signer is represented as a `bytes` object that concatenates a verifier address and a key: `verifier || key`. +* ECDSA signatures from externally owned accounts (EOAs) +* ERC-1271 signatures from smart contract wallets like Argent and Safe Wallet +* ERC-7913 signatures from keys that don't have their own Ethereum address -xref:api:utils.adoc#ERC7913Utils[`ERC7913Utils`] provides functions for verifying signatures using ERC-7913 compatible verifiers: +This allows developers to write signature verification code once and have it work across all these different signature types. + +==== Basic Signature Verification + +For standard signature verification that supports both EOAs and ERC-1271 contracts: [source,solidity] ---- -using ERC7913Utils for bytes; +using SignatureChecker for address; + +function _verifySignature(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) { + return SignatureChecker.isValidSignatureNow(signer, hash, signature); +} +---- + +The library automatically detects whether the signer is an EOA or a contract and uses the appropriate verification method. + +==== ERC-1271 Contract Signatures -function _verify(bytes memory signer, bytes32 hash, bytes memory signature) internal view returns (bool) { - return signer.isValidSignatureNow(hash, signature); +For smart contract wallets that implement ERC-1271, you can explicitly use: + +[source,solidity] +---- +function _verifyContractSignature(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) { + return SignatureChecker.isValidERC1271SignatureNow(signer, hash, signature); +} +---- + +==== ERC-7913 Extended Signatures + +ERC-7913 extends signature verification to support keys that don't have their own Ethereum address. This is useful for integrating non-Ethereum cryptographic curves, hardware devices, or other identity systems. + +A signer is represented as a `bytes` object that concatenates a verifier address and a key: `verifier || key`. + +[source,solidity] +---- +function _verifyERC7913Signature(bytes memory signer, bytes32 hash, bytes memory signature) internal view returns (bool) { + return SignatureChecker.isValidERC7913SignatureNow(signer, hash, signature); } ---- The verification process works as follows: * If `signer.length < 20`: verification fails -* If `signer.length == 20`: verification is done using xref:api:utils#SignatureChecker[SignatureChecker] -* Otherwise: verification is done using an ERC-7913 verifier. +* If `signer.length == 20`: verification is done using standard signature checking +* Otherwise: verification is done using an ERC-7913 verifier -This allows for backward compatibility with EOAs and ERC-1271 contracts while supporting new types of keys. +==== Batch Verification + +For verifying multiple ERC-7913 signatures at once: + +[source,solidity] +---- +function _verifyMultipleSignatures( + bytes32 hash, + bytes[] memory signers, + bytes[] memory signatures +) internal view returns (bool) { + return SignatureChecker.areValidERC7913SignaturesNow(hash, signers, signatures); +} +---- + +The signers must be ordered by their `keccak256` hash to ensure no duplicates and optimize verification. + +This unified approach allows smart contracts to accept signatures from any supported source without needing to implement different verification logic for each type. === Verifying Merkle Proofs @@ -507,4 +556,4 @@ function _setTargetAdminDelay(address target, uint32 newDelay) internal virtual emit TargetAdminDelayUpdated(target, newDelay, effect); } ----- \ No newline at end of file +---- diff --git a/test/account/AccountMultiSigner.test.js b/test/account/AccountMultiSigner.test.js index 8e794812161..5d7391fb6d9 100644 --- a/test/account/AccountMultiSigner.test.js +++ b/test/account/AccountMultiSigner.test.js @@ -136,7 +136,7 @@ describe('AccountMultiSigner', function () { // Successfully adds a signer const signersArrayBefore = await this.mock.signers().then(s => s.map(ethers.getAddress)); - await expect(this.mock.$_addSigners(signers)).to.emit(this.mock, 'ERC7913SignersAdded'); + await expect(this.mock.$_addSigners(signers)).to.emit(this.mock, 'ERC7913SignerAdded'); const signersArrayAfter = await this.mock.signers().then(s => s.map(ethers.getAddress)); expect(signersArrayAfter.length).to.equal(signersArrayBefore.length + 1); expect(signersArrayAfter).to.include(ethers.getAddress(signerECDSA3.address)); @@ -152,7 +152,7 @@ describe('AccountMultiSigner', function () { // Successfully removes an already added signer const signersArrayBefore = await this.mock.signers().then(s => s.map(ethers.getAddress)); - await expect(this.mock.$_removeSigners(signers)).to.emit(this.mock, 'ERC7913SignersRemoved'); + await expect(this.mock.$_removeSigners(signers)).to.emit(this.mock, 'ERC7913SignerRemoved'); const signersArrayAfter = await this.mock.signers().then(s => s.map(ethers.getAddress)); expect(signersArrayAfter.length).to.equal(signersArrayBefore.length - 1); expect(signersArrayAfter).to.not.include(ethers.getAddress(signerECDSA2.address)); diff --git a/test/utils/cryptography/ERC7913Utils.test.js b/test/utils/cryptography/ERC7913Utils.test.js deleted file mode 100644 index 1602bad0a61..00000000000 --- a/test/utils/cryptography/ERC7913Utils.test.js +++ /dev/null @@ -1,257 +0,0 @@ -const { expect } = require('chai'); -const { ethers } = require('hardhat'); -const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); -const { PANIC_CODES } = require('@nomicfoundation/hardhat-chai-matchers/panic'); - -const VALID_SW_KEY_1 = ethers.toUtf8Bytes('valid_key_1'); -const VALID_SW_KEY_2 = ethers.toUtf8Bytes('valid_key_2'); - -const VALID_SW_SIGNATURE_1 = ethers.toUtf8Bytes('valid_signature_1'); -const VALID_SW_SIGNATURE_2 = ethers.toUtf8Bytes('valid_signature_2'); - -async function fixture() { - const [, signer, other, extraSigner] = await ethers.getSigners(); - const mock = await ethers.deployContract('$ERC7913Utils'); - - // Deploy a mock ERC-1271 wallet - const wallet = await ethers.deployContract('ERC1271WalletMock', [signer]); - const wallet2 = await ethers.deployContract('ERC1271WalletMock', [extraSigner]); - - // Deploy a mock ERC-7913 verifier - const verifier = await ethers.deployContract('ERC7913VerifierMock'); - - return { - signer, - extraSigner, - other, - mock, - wallet, - wallet2, - verifier, - }; -} - -describe('ERC7913Utils', function () { - beforeEach(async function () { - Object.assign(this, await loadFixture(fixture)); - }); - - describe('isValidSignatureNow', function () { - describe('with EOA signer', function () { - it('with matching signer and signature', async function () { - const eoaSigner = ethers.zeroPadValue(this.signer.address, 20); - const message = 'Hello, World!'; - const signature = await this.signer.signMessage(message); - await expect(this.mock.$isValidSignatureNow(eoaSigner, ethers.hashMessage(message), signature)).to.eventually.be - .true; - }); - - it('with invalid signer', async function () { - const eoaSigner = ethers.zeroPadValue(this.other.address, 20); - const message = 'Hello, World!'; - const signature = await this.signer.signMessage(message); - await expect(this.mock.$isValidSignatureNow(eoaSigner, ethers.hashMessage(message), signature)).to.eventually.be - .false; - }); - - it('with invalid signature', async function () { - const eoaSigner = ethers.zeroPadValue(this.signer.address, 20); - const signature = await this.signer.signMessage('Hello, World!'); - await expect(this.mock.$isValidSignatureNow(eoaSigner, ethers.hashMessage('Nope'), signature)).to.eventually.be - .false; - }); - }); - - describe('with ERC-1271 wallet', function () { - it('with matching signer and signature', async function () { - const walletSigner = ethers.zeroPadValue(this.wallet.target, 20); - const message = 'Hello, World!'; - const signature = await this.signer.signMessage(message); - await expect(this.mock.$isValidSignatureNow(walletSigner, ethers.hashMessage(message), signature)).to.eventually - .be.true; - }); - - it('with invalid signer', async function () { - const walletSigner = ethers.zeroPadValue(this.mock.target, 20); - const message = 'Hello, World!'; - const signature = await this.signer.signMessage(message); - await expect(this.mock.$isValidSignatureNow(walletSigner, ethers.hashMessage(message), signature)).to.eventually - .be.false; - }); - - it('with invalid signature', async function () { - const walletSigner = ethers.zeroPadValue(this.wallet.target, 20); - const signature = await this.signer.signMessage('Hello, World!'); - await expect(this.mock.$isValidSignatureNow(walletSigner, ethers.hashMessage('Nope'), signature)).to.eventually - .be.false; - }); - }); - - describe('with ERC-7913 verifier', function () { - it('with matching signer and signature', async function () { - await expect( - this.mock.$isValidSignatureNow( - ethers.concat([this.verifier.target, VALID_SW_KEY_1]), - ethers.hashMessage('Hello, World!'), - VALID_SW_SIGNATURE_1, - ), - ).to.eventually.be.true; - }); - - it('with invalid verifier', async function () { - const invalidVerifierSigner = ethers.concat([this.mock.target, VALID_SW_KEY_1]); - await expect( - this.mock.$isValidSignatureNow( - invalidVerifierSigner, - ethers.hashMessage('Hello, World!'), - VALID_SW_SIGNATURE_1, - ), - ).to.eventually.be.false; - }); - - it('with invalid key', async function () { - await expect( - this.mock.$isValidSignatureNow( - ethers.concat([this.verifier.target, ethers.randomBytes(32)]), - ethers.hashMessage('Hello, World!'), - VALID_SW_SIGNATURE_1, - ), - ).to.eventually.be.false; - }); - - it('with invalid signature', async function () { - await expect( - this.mock.$isValidSignatureNow( - ethers.concat([this.verifier.target, VALID_SW_KEY_1]), - ethers.hashMessage('Hello, World!'), - ethers.randomBytes(65), - ), - ).to.eventually.be.false; - }); - - it('with signer too short', async function () { - const shortSigner = ethers.randomBytes(19); - await expect( - this.mock.$isValidSignatureNow(shortSigner, ethers.hashMessage('Hello, World!'), VALID_SW_SIGNATURE_1), - ).to.eventually.be.false; - }); - }); - }); - - describe('areValidSignaturesNow', function () { - it('should validate a single signature', async function () { - const message = 'Hello, World!'; - const signature = await this.signer.signMessage(message); - await expect( - this.mock.$areValidSignaturesNow( - ethers.hashMessage(message), - [ethers.zeroPadValue(this.signer.address, 20)], - [signature], - ), - ).to.eventually.be.true; - }); - - it('should validate multiple signatures with different signer types', async function () { - const message = 'Hello, World!'; - const signature = await this.signer.signMessage(message); - const pairs = [ - [ethers.zeroPadValue(this.signer.address, 20), signature], - [ethers.zeroPadValue(this.wallet.target, 20), signature], - [ethers.concat([this.verifier.target, VALID_SW_KEY_1]), VALID_SW_SIGNATURE_1], - ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); - const signers = pairs.map(([signer]) => signer); - const signatures = pairs.map(([, signature]) => signature); - await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage(message), signers, signatures)).to.eventually.be - .true; - }); - - it('should validate multiple EOA signatures', async function () { - const message = 'Helllo, World!'; - const pairs = [ - [ethers.zeroPadValue(this.signer.address, 20), await this.signer.signMessage(message)], - [ethers.zeroPadValue(this.extraSigner.address, 20), await this.extraSigner.signMessage(message)], - ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); - const signers = pairs.map(([signer]) => signer); - const signatures = pairs.map(([, signature]) => signature); - await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage(message), signers, signatures)).to.eventually.be - .true; - }); - - it('should validate multiple ERC-1271 wallet signatures', async function () { - const message = 'Helllo, World!'; - const pairs = [ - [ethers.zeroPadValue(this.wallet.target, 20), await this.signer.signMessage(message)], - [ethers.zeroPadValue(this.wallet2.target, 20), await this.extraSigner.signMessage(message)], - ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); - const signers = pairs.map(([signer]) => signer); - const signatures = pairs.map(([, signature]) => signature); - await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage(message), signers, signatures)).to.eventually.be - .true; - }); - - it('should validate multiple ERC-7913 signatures', async function () { - const pairs = [ - [ethers.concat([this.verifier.target, VALID_SW_KEY_1]), VALID_SW_SIGNATURE_1], - [ethers.concat([this.verifier.target, VALID_SW_KEY_2]), VALID_SW_SIGNATURE_2], - ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); - const signers = pairs.map(([signer]) => signer); - const signatures = pairs.map(([, signature]) => signature); - await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage('Hello, World!'), signers, signatures)).to - .eventually.be.true; - }); - - it('should return false if any signature is invalid', async function () { - const message = 'Hello, World!'; - await expect( - this.mock.$areValidSignaturesNow( - ethers.hashMessage(message), - [ethers.zeroPadValue(this.signer.address, 20), await this.extraSigner.signMessage(message)], - [await this.signer.signMessage(message), await this.signer.signMessage('Nope')], - ), - ).to.eventually.be.false; - }); - - it('should return false if signers are not ordered by ID', async function () { - const message = 'Hello, World!'; - const pairs = [ - [ethers.zeroPadValue(this.signer.address, 20), await this.signer.signMessage(message)], - [ethers.zeroPadValue(this.extraSigner.address, 20), await this.extraSigner.signMessage(message)], - ]; - - if (ethers.keccak256(pairs[0][0]) - ethers.keccak256(pairs[1][0])) { - pairs.reverse(); - } - - const signers = pairs.map(([signer]) => signer); - const signatures = pairs.map(([, signature]) => signature); - await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage(message), signers, signatures)).to.eventually.be - .false; - }); - - it('should return false if there are duplicate signers', async function () { - const message = 'Hello, World!'; - await expect( - this.mock.$areValidSignaturesNow( - ethers.hashMessage(message), - [ethers.zeroPadValue(this.signer.address, 20), ethers.zeroPadValue(this.signer.address, 20)], // Same signer used twice - [await this.signer.signMessage(message), await this.signer.signMessage(message)], - ), - ).to.eventually.be.false; - }); - - it('should fail if signatures array length does not match signers array length', async function () { - const message = 'Hello, World!'; - await expect( - this.mock.$areValidSignaturesNow( - ethers.hashMessage(message), - [ethers.zeroPadValue(this.signer.address, 20), await this.extraSigner.signMessage(message)], - [await this.signer.signMessage(message)], // Missing one signature - ), - ).to.be.revertedWithPanic(PANIC_CODES.ARRAY_ACCESS_OUT_OF_BOUNDS); - }); - - it('should pass with empty arrays', async function () { - await expect(this.mock.$areValidSignaturesNow(ethers.hashMessage('Hello, World!'), [], [])).to.eventually.be.true; - }); - }); -}); diff --git a/test/utils/cryptography/SignatureChecker.test.js b/test/utils/cryptography/SignatureChecker.test.js index 2b14f2f4c14..51d23539546 100644 --- a/test/utils/cryptography/SignatureChecker.test.js +++ b/test/utils/cryptography/SignatureChecker.test.js @@ -3,6 +3,7 @@ const { expect } = require('chai'); const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); const precompile = require('../../helpers/precompiles'); +const { PANIC_CODES } = require('@nomicfoundation/hardhat-chai-matchers/panic'); const TEST_MESSAGE = ethers.id('OpenZeppelin'); const TEST_MESSAGE_HASH = ethers.hashMessage(TEST_MESSAGE); @@ -10,14 +11,22 @@ const TEST_MESSAGE_HASH = ethers.hashMessage(TEST_MESSAGE); const WRONG_MESSAGE = ethers.id('Nope'); const WRONG_MESSAGE_HASH = ethers.hashMessage(WRONG_MESSAGE); +const VALID_SW_KEY_1 = ethers.toUtf8Bytes('valid_key_1'); +const VALID_SW_KEY_2 = ethers.toUtf8Bytes('valid_key_2'); + +const VALID_SW_SIGNATURE_1 = ethers.toUtf8Bytes('valid_signature_1'); +const VALID_SW_SIGNATURE_2 = ethers.toUtf8Bytes('valid_signature_2'); + async function fixture() { - const [signer, other] = await ethers.getSigners(); + const [signer, extraSigner, other] = await ethers.getSigners(); const mock = await ethers.deployContract('$SignatureChecker'); const wallet = await ethers.deployContract('ERC1271WalletMock', [signer]); + const wallet2 = await ethers.deployContract('ERC1271WalletMock', [extraSigner]); const malicious = await ethers.deployContract('ERC1271MaliciousMock'); const signature = await signer.signMessage(TEST_MESSAGE); + const verifier = await ethers.deployContract('ERC7913VerifierMock'); - return { signer, other, mock, wallet, malicious, signature }; + return { signer, other, extraSigner, mock, wallet, wallet2, malicious, signature, verifier }; } describe('SignatureChecker (ERC1271)', function () { @@ -72,4 +81,208 @@ describe('SignatureChecker (ERC1271)', function () { }); } }); + + describe('ERC7913', function () { + describe('isValidERC7913SignatureNow', function () { + describe('with EOA signer', function () { + it('with matching signer and signature', async function () { + const eoaSigner = ethers.zeroPadValue(this.signer.address, 20); + const signature = await this.signer.signMessage(TEST_MESSAGE); + await expect(this.mock.$isValidERC7913SignatureNow(eoaSigner, TEST_MESSAGE_HASH, signature)).to.eventually.be + .true; + }); + + it('with invalid signer', async function () { + const eoaSigner = ethers.zeroPadValue(this.other.address, 20); + const signature = await this.signer.signMessage(TEST_MESSAGE); + await expect(this.mock.$isValidERC7913SignatureNow(eoaSigner, TEST_MESSAGE_HASH, signature)).to.eventually.be + .false; + }); + + it('with invalid signature', async function () { + const eoaSigner = ethers.zeroPadValue(this.signer.address, 20); + const signature = await this.signer.signMessage(TEST_MESSAGE); + await expect(this.mock.$isValidERC7913SignatureNow(eoaSigner, WRONG_MESSAGE_HASH, signature)).to.eventually.be + .false; + }); + }); + + describe('with ERC-1271 wallet', function () { + it('with matching signer and signature', async function () { + const walletSigner = ethers.zeroPadValue(this.wallet.target, 20); + const signature = await this.signer.signMessage(TEST_MESSAGE); + await expect(this.mock.$isValidERC7913SignatureNow(walletSigner, TEST_MESSAGE_HASH, signature)).to.eventually + .be.true; + }); + + it('with invalid signer', async function () { + const walletSigner = ethers.zeroPadValue(this.mock.target, 20); + const signature = await this.signer.signMessage(TEST_MESSAGE); + await expect(this.mock.$isValidERC7913SignatureNow(walletSigner, TEST_MESSAGE_HASH, signature)).to.eventually + .be.false; + }); + + it('with invalid signature', async function () { + const walletSigner = ethers.zeroPadValue(this.wallet.target, 20); + const signature = await this.signer.signMessage(TEST_MESSAGE); + await expect(this.mock.$isValidERC7913SignatureNow(walletSigner, WRONG_MESSAGE_HASH, signature)).to.eventually + .be.false; + }); + }); + + describe('with ERC-7913 verifier', function () { + it('with matching signer and signature', async function () { + await expect( + this.mock.$isValidERC7913SignatureNow( + ethers.concat([this.verifier.target, VALID_SW_KEY_1]), + TEST_MESSAGE_HASH, + VALID_SW_SIGNATURE_1, + ), + ).to.eventually.be.true; + }); + + it('with invalid verifier', async function () { + const invalidVerifierSigner = ethers.concat([this.mock.target, VALID_SW_KEY_1]); + await expect( + this.mock.$isValidERC7913SignatureNow(invalidVerifierSigner, TEST_MESSAGE_HASH, VALID_SW_SIGNATURE_1), + ).to.eventually.be.false; + }); + + it('with invalid key', async function () { + await expect( + this.mock.$isValidERC7913SignatureNow( + ethers.concat([this.verifier.target, ethers.randomBytes(32)]), + TEST_MESSAGE_HASH, + VALID_SW_SIGNATURE_1, + ), + ).to.eventually.be.false; + }); + + it('with invalid signature', async function () { + await expect( + this.mock.$isValidERC7913SignatureNow( + ethers.concat([this.verifier.target, VALID_SW_KEY_1]), + TEST_MESSAGE_HASH, + ethers.randomBytes(65), + ), + ).to.eventually.be.false; + }); + + it('with signer too short', async function () { + const shortSigner = ethers.randomBytes(19); + await expect(this.mock.$isValidERC7913SignatureNow(shortSigner, TEST_MESSAGE_HASH, VALID_SW_SIGNATURE_1)).to + .eventually.be.false; + }); + }); + }); + + describe('areValidERC7913SignaturesNow', function () { + it('should validate a single signature', async function () { + const signature = await this.signer.signMessage(TEST_MESSAGE); + await expect( + this.mock.$areValidERC7913SignaturesNow( + TEST_MESSAGE_HASH, + [ethers.zeroPadValue(this.signer.address, 20)], + [signature], + ), + ).to.eventually.be.true; + }); + + it('should validate multiple signatures with different signer types', async function () { + const signature = await this.signer.signMessage(TEST_MESSAGE); + const pairs = [ + [ethers.zeroPadValue(this.signer.address, 20), signature], + [ethers.zeroPadValue(this.wallet.target, 20), signature], + [ethers.concat([this.verifier.target, VALID_SW_KEY_1]), VALID_SW_SIGNATURE_1], + ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); + const signers = pairs.map(([signer]) => signer); + const signatures = pairs.map(([, signature]) => signature); + await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, signers, signatures)).to.eventually.be + .true; + }); + + it('should validate multiple EOA signatures', async function () { + const pairs = [ + [ethers.zeroPadValue(this.signer.address, 20), await this.signer.signMessage(TEST_MESSAGE)], + [ethers.zeroPadValue(this.extraSigner.address, 20), await this.extraSigner.signMessage(TEST_MESSAGE)], + ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); + const signers = pairs.map(([signer]) => signer); + const signatures = pairs.map(([, signature]) => signature); + await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, signers, signatures)).to.eventually.be + .true; + }); + + it('should validate multiple ERC-1271 wallet signatures', async function () { + const pairs = [ + [ethers.zeroPadValue(this.wallet.target, 20), await this.signer.signMessage(TEST_MESSAGE)], + [ethers.zeroPadValue(this.wallet2.target, 20), await this.extraSigner.signMessage(TEST_MESSAGE)], + ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); + const signers = pairs.map(([signer]) => signer); + const signatures = pairs.map(([, signature]) => signature); + await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, signers, signatures)).to.eventually.be + .true; + }); + + it('should validate multiple ERC-7913 signatures', async function () { + const pairs = [ + [ethers.concat([this.verifier.target, VALID_SW_KEY_1]), VALID_SW_SIGNATURE_1], + [ethers.concat([this.verifier.target, VALID_SW_KEY_2]), VALID_SW_SIGNATURE_2], + ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); + const signers = pairs.map(([signer]) => signer); + const signatures = pairs.map(([, signature]) => signature); + await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, signers, signatures)).to.eventually.be + .true; + }); + + it('should return false if any signature is invalid', async function () { + await expect( + this.mock.$areValidERC7913SignaturesNow( + TEST_MESSAGE_HASH, + [ethers.zeroPadValue(this.signer.address, 20), await this.extraSigner.signMessage(TEST_MESSAGE)], + [await this.signer.signMessage(TEST_MESSAGE), await this.signer.signMessage(WRONG_MESSAGE)], + ), + ).to.eventually.be.false; + }); + + it('should return false if signers are not ordered by ID', async function () { + const pairs = [ + [ethers.zeroPadValue(this.signer.address, 20), await this.signer.signMessage(TEST_MESSAGE)], + [ethers.zeroPadValue(this.extraSigner.address, 20), await this.extraSigner.signMessage(TEST_MESSAGE)], + ]; + + if (ethers.keccak256(pairs[0][0]) < ethers.keccak256(pairs[1][0])) { + pairs.reverse(); + } + + const signers = pairs.map(([signer]) => signer); + const signatures = pairs.map(([, signature]) => signature); + await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, signers, signatures)).to.eventually.be + .false; + }); + + it('should return false if there are duplicate signers', async function () { + await expect( + this.mock.$areValidERC7913SignaturesNow( + TEST_MESSAGE_HASH, + [ethers.zeroPadValue(this.signer.address, 20), ethers.zeroPadValue(this.signer.address, 20)], // Same signer used twice + [await this.signer.signMessage(TEST_MESSAGE), await this.signer.signMessage(TEST_MESSAGE)], + ), + ).to.eventually.be.false; + }); + + it('should fail if signatures array length does not match signers array length', async function () { + await expect( + this.mock.$areValidERC7913SignaturesNow( + TEST_MESSAGE_HASH, + [ethers.zeroPadValue(this.signer.address, 20), await this.extraSigner.signMessage(TEST_MESSAGE)], + [await this.signer.signMessage(TEST_MESSAGE)], // Missing one signature + ), + ).to.be.revertedWithPanic(PANIC_CODES.ARRAY_ACCESS_OUT_OF_BOUNDS); + }); + + it('should pass with empty arrays', async function () { + await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, [], [])).to.eventually.be.true; + }); + }); + }); }); From 98108d90db9aadb1bfa7ceaea9ebb4ba40c9df98 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Tue, 3 Jun 2025 22:37:52 -0600 Subject: [PATCH 087/110] Increase SignatureChecker's pragma --- contracts/utils/cryptography/SignatureChecker.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/utils/cryptography/SignatureChecker.sol b/contracts/utils/cryptography/SignatureChecker.sol index 8704ec8548f..c3d045f0ee8 100644 --- a/contracts/utils/cryptography/SignatureChecker.sol +++ b/contracts/utils/cryptography/SignatureChecker.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {ECDSA} from "./ECDSA.sol"; import {IERC1271} from "../../interfaces/IERC1271.sol"; From e1ffe0559e209b8230636600a9882ceff84d077a Mon Sep 17 00:00:00 2001 From: ernestognw Date: Tue, 3 Jun 2025 23:00:19 -0600 Subject: [PATCH 088/110] Pragma consistency --- contracts/governance/Governor.sol | 2 +- contracts/governance/extensions/GovernorCountingOverridable.sol | 2 +- contracts/mocks/account/modules/ERC7579Mock.sol | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index 09d15fc77ee..828dbc3950e 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/Governor.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {IERC721Receiver} from "../token/ERC721/IERC721Receiver.sol"; import {IERC1155Receiver} from "../token/ERC1155/IERC1155Receiver.sol"; diff --git a/contracts/governance/extensions/GovernorCountingOverridable.sol b/contracts/governance/extensions/GovernorCountingOverridable.sol index ef8d34013fb..9900c64c800 100644 --- a/contracts/governance/extensions/GovernorCountingOverridable.sol +++ b/contracts/governance/extensions/GovernorCountingOverridable.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorCountingOverridable.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {SignatureChecker} from "../../utils/cryptography/SignatureChecker.sol"; import {SafeCast} from "../../utils/math/SafeCast.sol"; diff --git a/contracts/mocks/account/modules/ERC7579Mock.sol b/contracts/mocks/account/modules/ERC7579Mock.sol index bacaf26d8f5..4cb559e4b74 100644 --- a/contracts/mocks/account/modules/ERC7579Mock.sol +++ b/contracts/mocks/account/modules/ERC7579Mock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {MODULE_TYPE_HOOK, MODULE_TYPE_FALLBACK, MODULE_TYPE_VALIDATOR, IERC7579Hook, IERC7579Module, IERC7579Validator} from "../../../interfaces/draft-IERC7579.sol"; import {SignatureChecker} from "../../../utils/cryptography/SignatureChecker.sol"; From 9a321354660fd654866d8f25a48ae05e5d960d82 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Tue, 3 Jun 2025 23:11:01 -0600 Subject: [PATCH 089/110] Increase SignatureChecker minimum pragma to 0.8.24 --- contracts/governance/extensions/GovernorCountingFractional.sol | 2 +- contracts/governance/extensions/GovernorCountingSimple.sol | 2 +- contracts/governance/extensions/GovernorPreventLateQuorum.sol | 2 +- contracts/governance/extensions/GovernorProposalGuardian.sol | 2 +- .../governance/extensions/GovernorSequentialProposalId.sol | 2 +- contracts/governance/extensions/GovernorSettings.sol | 2 +- contracts/governance/extensions/GovernorStorage.sol | 2 +- contracts/governance/extensions/GovernorSuperQuorum.sol | 2 +- contracts/governance/extensions/GovernorTimelockAccess.sol | 2 +- contracts/governance/extensions/GovernorTimelockCompound.sol | 2 +- contracts/governance/extensions/GovernorTimelockControl.sol | 2 +- contracts/governance/extensions/GovernorVotes.sol | 2 +- contracts/governance/extensions/GovernorVotesQuorumFraction.sol | 2 +- .../governance/extensions/GovernorVotesSuperQuorumFraction.sol | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/contracts/governance/extensions/GovernorCountingFractional.sol b/contracts/governance/extensions/GovernorCountingFractional.sol index 039a4d88e1b..7af2a7060ac 100644 --- a/contracts/governance/extensions/GovernorCountingFractional.sol +++ b/contracts/governance/extensions/GovernorCountingFractional.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorCountingFractional.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {IGovernor, Governor} from "../Governor.sol"; import {GovernorCountingSimple} from "./GovernorCountingSimple.sol"; diff --git a/contracts/governance/extensions/GovernorCountingSimple.sol b/contracts/governance/extensions/GovernorCountingSimple.sol index 7d7a6a9af23..afa0efc2afa 100644 --- a/contracts/governance/extensions/GovernorCountingSimple.sol +++ b/contracts/governance/extensions/GovernorCountingSimple.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {IGovernor, Governor} from "../Governor.sol"; diff --git a/contracts/governance/extensions/GovernorPreventLateQuorum.sol b/contracts/governance/extensions/GovernorPreventLateQuorum.sol index 02b201d8a04..b92b3c67694 100644 --- a/contracts/governance/extensions/GovernorPreventLateQuorum.sol +++ b/contracts/governance/extensions/GovernorPreventLateQuorum.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.2.0) (governance/extensions/GovernorPreventLateQuorum.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../Governor.sol"; import {Math} from "../../utils/math/Math.sol"; diff --git a/contracts/governance/extensions/GovernorProposalGuardian.sol b/contracts/governance/extensions/GovernorProposalGuardian.sol index 10821ff4188..f1b5aba3681 100644 --- a/contracts/governance/extensions/GovernorProposalGuardian.sol +++ b/contracts/governance/extensions/GovernorProposalGuardian.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorProposalGuardian.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../Governor.sol"; diff --git a/contracts/governance/extensions/GovernorSequentialProposalId.sol b/contracts/governance/extensions/GovernorSequentialProposalId.sol index b46e0f6ed52..55b9e16314a 100644 --- a/contracts/governance/extensions/GovernorSequentialProposalId.sol +++ b/contracts/governance/extensions/GovernorSequentialProposalId.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorSequentialProposalId.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {IGovernor, Governor} from "../Governor.sol"; diff --git a/contracts/governance/extensions/GovernorSettings.sol b/contracts/governance/extensions/GovernorSettings.sol index 4c9b2930835..41793c5b0bc 100644 --- a/contracts/governance/extensions/GovernorSettings.sol +++ b/contracts/governance/extensions/GovernorSettings.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {IGovernor, Governor} from "../Governor.sol"; diff --git a/contracts/governance/extensions/GovernorStorage.sol b/contracts/governance/extensions/GovernorStorage.sol index 914b77d9df6..52fc5386b85 100644 --- a/contracts/governance/extensions/GovernorStorage.sol +++ b/contracts/governance/extensions/GovernorStorage.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorStorage.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../Governor.sol"; diff --git a/contracts/governance/extensions/GovernorSuperQuorum.sol b/contracts/governance/extensions/GovernorSuperQuorum.sol index 16d4004f1d8..47f2bfccedd 100644 --- a/contracts/governance/extensions/GovernorSuperQuorum.sol +++ b/contracts/governance/extensions/GovernorSuperQuorum.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorSuperQuorum.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../Governor.sol"; diff --git a/contracts/governance/extensions/GovernorTimelockAccess.sol b/contracts/governance/extensions/GovernorTimelockAccess.sol index dd95b122455..d340f585572 100644 --- a/contracts/governance/extensions/GovernorTimelockAccess.sol +++ b/contracts/governance/extensions/GovernorTimelockAccess.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorTimelockAccess.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {IGovernor, Governor} from "../Governor.sol"; import {AuthorityUtils} from "../../access/manager/AuthorityUtils.sol"; diff --git a/contracts/governance/extensions/GovernorTimelockCompound.sol b/contracts/governance/extensions/GovernorTimelockCompound.sol index ed5b5b48917..ea705a76e43 100644 --- a/contracts/governance/extensions/GovernorTimelockCompound.sol +++ b/contracts/governance/extensions/GovernorTimelockCompound.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorTimelockCompound.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {IGovernor, Governor} from "../Governor.sol"; import {ICompoundTimelock} from "../../vendor/compound/ICompoundTimelock.sol"; diff --git a/contracts/governance/extensions/GovernorTimelockControl.sol b/contracts/governance/extensions/GovernorTimelockControl.sol index 53613f4bd56..6aab59c9470 100644 --- a/contracts/governance/extensions/GovernorTimelockControl.sol +++ b/contracts/governance/extensions/GovernorTimelockControl.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorTimelockControl.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {IGovernor, Governor} from "../Governor.sol"; import {TimelockController} from "../TimelockController.sol"; diff --git a/contracts/governance/extensions/GovernorVotes.sol b/contracts/governance/extensions/GovernorVotes.sol index 748115433dc..960a91ba457 100644 --- a/contracts/governance/extensions/GovernorVotes.sol +++ b/contracts/governance/extensions/GovernorVotes.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../Governor.sol"; import {IVotes} from "../utils/IVotes.sol"; diff --git a/contracts/governance/extensions/GovernorVotesQuorumFraction.sol b/contracts/governance/extensions/GovernorVotesQuorumFraction.sol index a72d9de2aae..5abd7c129b0 100644 --- a/contracts/governance/extensions/GovernorVotesQuorumFraction.sol +++ b/contracts/governance/extensions/GovernorVotesQuorumFraction.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorVotesQuorumFraction.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {GovernorVotes} from "./GovernorVotes.sol"; import {Math} from "../../utils/math/Math.sol"; diff --git a/contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol b/contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol index 6686210e5b8..48c138ed1cf 100644 --- a/contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol +++ b/contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorVotesSuperQuorumFraction.sol) -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../Governor.sol"; import {GovernorSuperQuorum} from "./GovernorSuperQuorum.sol"; From d8e132a3612d388429923dc196154189f0ab2d9d Mon Sep 17 00:00:00 2001 From: ernestognw Date: Tue, 3 Jun 2025 23:26:13 -0600 Subject: [PATCH 090/110] Update mocks --- contracts/mocks/docs/governance/MyGovernor.sol | 2 +- contracts/mocks/governance/GovernorCountingOverridableMock.sol | 2 +- contracts/mocks/governance/GovernorFractionalMock.sol | 2 +- contracts/mocks/governance/GovernorMock.sol | 2 +- contracts/mocks/governance/GovernorPreventLateQuorumMock.sol | 2 +- contracts/mocks/governance/GovernorProposalGuardianMock.sol | 2 +- contracts/mocks/governance/GovernorSequentialProposalIdMock.sol | 2 +- contracts/mocks/governance/GovernorStorageMock.sol | 2 +- contracts/mocks/governance/GovernorSuperQuorumMock.sol | 2 +- contracts/mocks/governance/GovernorTimelockAccessMock.sol | 2 +- contracts/mocks/governance/GovernorTimelockCompoundMock.sol | 2 +- contracts/mocks/governance/GovernorTimelockControlMock.sol | 2 +- contracts/mocks/governance/GovernorVoteMock.sol | 2 +- .../mocks/governance/GovernorVotesSuperQuorumFractionMock.sol | 2 +- contracts/mocks/governance/GovernorWithParamsMock.sol | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/contracts/mocks/docs/governance/MyGovernor.sol b/contracts/mocks/docs/governance/MyGovernor.sol index 339f48d39f4..4d38d0fa7ac 100644 --- a/contracts/mocks/docs/governance/MyGovernor.sol +++ b/contracts/mocks/docs/governance/MyGovernor.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../../governance/Governor.sol"; import {GovernorCountingSimple} from "../../../governance/extensions/GovernorCountingSimple.sol"; diff --git a/contracts/mocks/governance/GovernorCountingOverridableMock.sol b/contracts/mocks/governance/GovernorCountingOverridableMock.sol index 96d8f15fed6..063cc3619e3 100644 --- a/contracts/mocks/governance/GovernorCountingOverridableMock.sol +++ b/contracts/mocks/governance/GovernorCountingOverridableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol"; diff --git a/contracts/mocks/governance/GovernorFractionalMock.sol b/contracts/mocks/governance/GovernorFractionalMock.sol index d6d6042a273..ae8a2c10755 100644 --- a/contracts/mocks/governance/GovernorFractionalMock.sol +++ b/contracts/mocks/governance/GovernorFractionalMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol"; diff --git a/contracts/mocks/governance/GovernorMock.sol b/contracts/mocks/governance/GovernorMock.sol index 69668d285b2..867eccf5a8a 100644 --- a/contracts/mocks/governance/GovernorMock.sol +++ b/contracts/mocks/governance/GovernorMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol"; diff --git a/contracts/mocks/governance/GovernorPreventLateQuorumMock.sol b/contracts/mocks/governance/GovernorPreventLateQuorumMock.sol index 176976f9199..e403d17b552 100644 --- a/contracts/mocks/governance/GovernorPreventLateQuorumMock.sol +++ b/contracts/mocks/governance/GovernorPreventLateQuorumMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorPreventLateQuorum} from "../../governance/extensions/GovernorPreventLateQuorum.sol"; diff --git a/contracts/mocks/governance/GovernorProposalGuardianMock.sol b/contracts/mocks/governance/GovernorProposalGuardianMock.sol index 5ed45d6c942..01e2f0a67fa 100644 --- a/contracts/mocks/governance/GovernorProposalGuardianMock.sol +++ b/contracts/mocks/governance/GovernorProposalGuardianMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol"; diff --git a/contracts/mocks/governance/GovernorSequentialProposalIdMock.sol b/contracts/mocks/governance/GovernorSequentialProposalIdMock.sol index 882ee0b2483..0bd86dccb2a 100644 --- a/contracts/mocks/governance/GovernorSequentialProposalIdMock.sol +++ b/contracts/mocks/governance/GovernorSequentialProposalIdMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol"; diff --git a/contracts/mocks/governance/GovernorStorageMock.sol b/contracts/mocks/governance/GovernorStorageMock.sol index 48d8af308b3..9b2178e63da 100644 --- a/contracts/mocks/governance/GovernorStorageMock.sol +++ b/contracts/mocks/governance/GovernorStorageMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorTimelockControl} from "../../governance/extensions/GovernorTimelockControl.sol"; diff --git a/contracts/mocks/governance/GovernorSuperQuorumMock.sol b/contracts/mocks/governance/GovernorSuperQuorumMock.sol index 2a48dbb7ca1..72e8f163282 100644 --- a/contracts/mocks/governance/GovernorSuperQuorumMock.sol +++ b/contracts/mocks/governance/GovernorSuperQuorumMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol"; diff --git a/contracts/mocks/governance/GovernorTimelockAccessMock.sol b/contracts/mocks/governance/GovernorTimelockAccessMock.sol index f1b81b6caab..64ad64b5a1f 100644 --- a/contracts/mocks/governance/GovernorTimelockAccessMock.sol +++ b/contracts/mocks/governance/GovernorTimelockAccessMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorTimelockAccess} from "../../governance/extensions/GovernorTimelockAccess.sol"; diff --git a/contracts/mocks/governance/GovernorTimelockCompoundMock.sol b/contracts/mocks/governance/GovernorTimelockCompoundMock.sol index 98c2baf71ce..71508cd5ac0 100644 --- a/contracts/mocks/governance/GovernorTimelockCompoundMock.sol +++ b/contracts/mocks/governance/GovernorTimelockCompoundMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorTimelockCompound} from "../../governance/extensions/GovernorTimelockCompound.sol"; diff --git a/contracts/mocks/governance/GovernorTimelockControlMock.sol b/contracts/mocks/governance/GovernorTimelockControlMock.sol index 69f9402d1bb..0ff6fdf190b 100644 --- a/contracts/mocks/governance/GovernorTimelockControlMock.sol +++ b/contracts/mocks/governance/GovernorTimelockControlMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorTimelockControl} from "../../governance/extensions/GovernorTimelockControl.sol"; diff --git a/contracts/mocks/governance/GovernorVoteMock.sol b/contracts/mocks/governance/GovernorVoteMock.sol index e6949b5b25b..ea699a3a61c 100644 --- a/contracts/mocks/governance/GovernorVoteMock.sol +++ b/contracts/mocks/governance/GovernorVoteMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol"; import {GovernorVotes} from "../../governance/extensions/GovernorVotes.sol"; diff --git a/contracts/mocks/governance/GovernorVotesSuperQuorumFractionMock.sol b/contracts/mocks/governance/GovernorVotesSuperQuorumFractionMock.sol index 4967b033bd7..1f4282e4d6c 100644 --- a/contracts/mocks/governance/GovernorVotesSuperQuorumFractionMock.sol +++ b/contracts/mocks/governance/GovernorVotesSuperQuorumFractionMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol"; diff --git a/contracts/mocks/governance/GovernorWithParamsMock.sol b/contracts/mocks/governance/GovernorWithParamsMock.sol index 29b738e9d6b..6c31c992cbe 100644 --- a/contracts/mocks/governance/GovernorWithParamsMock.sol +++ b/contracts/mocks/governance/GovernorWithParamsMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {Governor} from "../../governance/Governor.sol"; import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol"; From 2dd9f2758598618ce8ab0a44d616ae643c4110f3 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 4 Jun 2025 10:02:13 +0200 Subject: [PATCH 091/110] paginated getSigner() --- .../signers/MultiSignerERC7913.sol | 28 +++++++++-------- test/account/AccountMultiSigner.test.js | 30 +++++++++---------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol index b0593c15f58..4c841b733b7 100644 --- a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol @@ -74,14 +74,16 @@ abstract contract MultiSignerERC7913 is AbstractSigner { error MultiSignerERC7913UnreachableThreshold(uint256 signers, uint256 threshold); /** - * @dev Returns the set of authorized signers. Prefer {_signers} for internal use. + * @dev Returns a slice of the set of authorized signers. * - * WARNING: This operation copies the entire signers set to memory, which can be expensive. This is designed - * for view accessors queried without gas fees. Using it in state-changing functions may become uncallable - * if the signers set grows too large. + * Using `start = 0` and `end = type(uint256).max` will return the entire set of signers. + * + * WARNING: Depending on the `start` and `end`, this operation can copy a large amount of data to memory, which + * can be expensive. This is designed for view accessors queried without gas fees. Using it in state-changing + * functions may become uncallable if the slice grows too large. */ - function signers() public view virtual returns (bytes[] memory) { - return _signers.values(); + function getSigners(uint256 start, uint256 end) public view virtual returns (bytes[] memory) { + return _signers.values(start, end); } /// @dev Returns whether the `signer` is an authorized signer. @@ -197,8 +199,8 @@ abstract contract MultiSignerERC7913 is AbstractSigner { bytes calldata signature ) internal view virtual override returns (bool) { if (signature.length == 0) return false; // For ERC-7739 compatibility - (bytes[] memory signingSigners, bytes[] memory signatures) = abi.decode(signature, (bytes[], bytes[])); - return _validateThreshold(signingSigners) && _validateSignatures(hash, signingSigners, signatures); + (bytes[] memory signers, bytes[] memory signatures) = abi.decode(signature, (bytes[], bytes[])); + return _validateThreshold(signers) && _validateSignatures(hash, signers, signatures); } /** @@ -211,19 +213,19 @@ abstract contract MultiSignerERC7913 is AbstractSigner { * * Requirements: * - * * The `signatures` arrays must be at least as large as the `signingSigners` arrays. Panics otherwise. + * * The `signatures` arrays must be at least as large as the `signers` arrays. Panics otherwise. */ function _validateSignatures( bytes32 hash, - bytes[] memory signingSigners, + bytes[] memory signers, bytes[] memory signatures ) internal view virtual returns (bool valid) { - for (uint256 i = 0; i < signingSigners.length; ++i) { - if (!isSigner(signingSigners[i])) { + for (uint256 i = 0; i < signers.length; ++i) { + if (!isSigner(signers[i])) { return false; } } - return hash.areValidERC7913SignaturesNow(signingSigners, signatures); + return hash.areValidERC7913SignaturesNow(signers, signatures); } /** diff --git a/test/account/AccountMultiSigner.test.js b/test/account/AccountMultiSigner.test.js index 5d7391fb6d9..ffc89ff471c 100644 --- a/test/account/AccountMultiSigner.test.js +++ b/test/account/AccountMultiSigner.test.js @@ -130,14 +130,14 @@ describe('AccountMultiSigner', function () { }); it('can add signers', async function () { - const signers = [ - signerECDSA3.address, // ECDSA Signer - ]; + const signers = [signerECDSA3.address]; // Successfully adds a signer - const signersArrayBefore = await this.mock.signers().then(s => s.map(ethers.getAddress)); - await expect(this.mock.$_addSigners(signers)).to.emit(this.mock, 'ERC7913SignerAdded'); - const signersArrayAfter = await this.mock.signers().then(s => s.map(ethers.getAddress)); + const signersArrayBefore = await this.mock.getSigners(0, ethers.MaxUint256).then(s => s.map(ethers.getAddress)); + await expect(this.mock.$_addSigners(signers)) + .to.emit(this.mock, 'ERC7913SignerAdded') + .withArgs(signerECDSA3.address); + const signersArrayAfter = await this.mock.getSigners(0, ethers.MaxUint256).then(s => s.map(ethers.getAddress)); expect(signersArrayAfter.length).to.equal(signersArrayBefore.length + 1); expect(signersArrayAfter).to.include(ethers.getAddress(signerECDSA3.address)); @@ -151,9 +151,11 @@ describe('AccountMultiSigner', function () { const signers = [signerECDSA2.address]; // Successfully removes an already added signer - const signersArrayBefore = await this.mock.signers().then(s => s.map(ethers.getAddress)); - await expect(this.mock.$_removeSigners(signers)).to.emit(this.mock, 'ERC7913SignerRemoved'); - const signersArrayAfter = await this.mock.signers().then(s => s.map(ethers.getAddress)); + const signersArrayBefore = await this.mock.getSigners(0, ethers.MaxUint256).then(s => s.map(ethers.getAddress)); + await expect(this.mock.$_removeSigners(signers)) + .to.emit(this.mock, 'ERC7913SignerRemoved') + .withArgs(signerECDSA2.address); + const signersArrayAfter = await this.mock.getSigners(0, ethers.MaxUint256).then(s => s.map(ethers.getAddress)); expect(signersArrayAfter.length).to.equal(signersArrayBefore.length - 1); expect(signersArrayAfter).to.not.include(ethers.getAddress(signerECDSA2.address)); @@ -188,13 +190,11 @@ describe('AccountMultiSigner', function () { }); it('can read signers and threshold', async function () { - const signersArray = await this.mock.signers().then(s => s.map(ethers.getAddress)); // Checksum - expect(signersArray).to.have.lengthOf(2); - expect(signersArray).to.include(signerECDSA1.address); - expect(signersArray).to.include(signerECDSA2.address); + await expect( + this.mock.getSigners(0, ethers.MaxUint256).then(s => s.map(ethers.getAddress)), + ).to.eventually.have.deep.members([signerECDSA1.address, signerECDSA2.address]); - const currentThreshold = await this.mock.threshold(); - expect(currentThreshold).to.equal(1); + await expect(this.mock.threshold()).to.eventually.equal(1); }); it('checks if an address is a signer', async function () { From 77587ad865c5c09b32b75c3bd01597cf23a27de3 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 4 Jun 2025 10:08:28 +0200 Subject: [PATCH 092/110] simplify mock --- .../cryptography/ERC7913VerifierMock.sol | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol b/contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol index f2e25f10bf3..bd1d3128136 100644 --- a/contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol +++ b/contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol @@ -5,33 +5,19 @@ pragma solidity ^0.8.20; import {IERC7913SignatureVerifier} from "../../../../contracts/interfaces/IERC7913.sol"; contract ERC7913VerifierMock is IERC7913SignatureVerifier { - // Store valid keys and their corresponding signatures - mapping(bytes32 => bool) private _validKeys; - mapping(bytes32 => mapping(bytes32 => bool)) private _validSignatures; - - constructor() { - // For testing purposes, we'll consider a specific key as valid - bytes32 validKeyHash = keccak256(abi.encodePacked("valid_key")); - _validKeys[validKeyHash] = true; - } - function verify(bytes calldata key, bytes32 /* hash */, bytes calldata signature) external pure returns (bytes4) { // For testing purposes, we'll only accept specific key/signature combinations - if (_isKnownSigner1(key, signature) || _isKnownSigner2(key, signature)) { - return IERC7913SignatureVerifier.verify.selector; - } - return 0xffffffff; + return + (_isKnownSigner1(key, signature) || _isKnownSigner2(key, signature)) + ? IERC7913SignatureVerifier.verify.selector + : bytes4(0xffffffff); } function _isKnownSigner1(bytes calldata key, bytes calldata signature) internal pure returns (bool) { - return - keccak256(key) == keccak256(abi.encodePacked("valid_key_1")) && - keccak256(signature) == keccak256(abi.encodePacked("valid_signature_1")); + return keccak256(key) == keccak256("valid_key_1") && keccak256(signature) == keccak256("valid_signature_1"); } function _isKnownSigner2(bytes calldata key, bytes calldata signature) internal pure returns (bool) { - return - keccak256(key) == keccak256(abi.encodePacked("valid_key_2")) && - keccak256(signature) == keccak256(abi.encodePacked("valid_signature_2")); + return keccak256(key) == keccak256("valid_key_2") && keccak256(signature) == keccak256("valid_signature_2"); } } From b7ddad92ba01c207fe50f5aafb704e3e3628f454 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 4 Jun 2025 10:42:03 +0200 Subject: [PATCH 093/110] minor signer helper refactor --- test/helpers/signers.js | 52 ++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/test/helpers/signers.js b/test/helpers/signers.js index 88759585649..9c20d768afa 100644 --- a/test/helpers/signers.js +++ b/test/helpers/signers.js @@ -1,4 +1,5 @@ const { + AbiCoder, AbstractSigner, Signature, TypedDataEncoder, @@ -18,7 +19,8 @@ const { } = require('ethers'); const { secp256r1 } = require('@noble/curves/p256'); const { generateKeyPairSync, privateEncrypt } = require('crypto'); -const { AbiCoder } = require('ethers'); + +const { zip } = require('./iterate'); // Lightweight version of BaseWallet class NonNativeSigner extends AbstractSigner { @@ -148,10 +150,10 @@ class RSASHA256SigningKey extends RSASigningKey { } class MultiERC7913SigningKey { + // this is a sorted array of objects that contain {signer, weight} #signers; - #weights; - constructor(signers, weights = null) { + constructor(signers, weights = undefined) { assertArgument( Array.isArray(signers) && signers.length > 0, 'signers must be a non-empty array', @@ -159,47 +161,39 @@ class MultiERC7913SigningKey { signers.length, ); - if (weights !== null) { - assertArgument( - Array.isArray(weights) && weights.length === signers.length, - 'weights must be an array with the same length as signers', - 'weights', - weights.length, - ); - } + assertArgument( + weights === undefined || (Array.isArray(weights) && weights.length === signers.length), + 'weights must be an array with the same length as signers', + 'weights', + weights?.length, + ); - this.#signers = signers; - this.#weights = weights; + // Sorting is done at construction so that it doesn't have to be done in sign() + this.#signers = zip(signers, weights ?? []) + .sort(([s1], [s2]) => + toBigInt(keccak256(s1.bytes ?? s1.address)) < toBigInt(keccak256(s2.bytes ?? s2.address)) ? -1 : 1, + ) + .map(([signer, weight = 1]) => ({ signer, weight })); } get signers() { - return this.#signers; + return this.#signers.map(({ signer }) => signer); } get weights() { - return this.#weights; + return this.#signers.map(({ weight }) => weight); } sign(digest /*: BytesLike*/ /*: Signature*/) { assertArgument(dataLength(digest) === 32, 'invalid digest length', 'digest', digest); - const sortedSigners = this.#signers - .map(signer => { - const signerBytes = typeof signer.address === 'string' ? signer.address : signer.bytes; - - const id = keccak256(signerBytes); - return { - id, - signer: signerBytes, - signature: signer.signingKey.sign(digest).serialized, - }; - }) - .sort((a, b) => (toBigInt(a.id) < toBigInt(b.id) ? -1 : 1)); - return { serialized: AbiCoder.defaultAbiCoder().encode( ['bytes[]', 'bytes[]'], - [sortedSigners.map(p => p.signer), sortedSigners.map(p => p.signature)], + [ + this.#signers.map(({ signer }) => signer.bytes ?? signer.address), + this.#signers.map(({ signer }) => signer.signingKey.sign(digest).serialized), + ], ), }; } From ea7ffc3a2ad5ce41eee5e4ae3952b5bba1f7ec99 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 4 Jun 2025 15:05:53 +0200 Subject: [PATCH 094/110] simplify helper --- test/helpers/signers.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/helpers/signers.js b/test/helpers/signers.js index 9c20d768afa..d4ae859228c 100644 --- a/test/helpers/signers.js +++ b/test/helpers/signers.js @@ -15,7 +15,6 @@ const { sha256, toBeHex, keccak256, - toBigInt, } = require('ethers'); const { secp256r1 } = require('@noble/curves/p256'); const { generateKeyPairSync, privateEncrypt } = require('crypto'); @@ -170,9 +169,7 @@ class MultiERC7913SigningKey { // Sorting is done at construction so that it doesn't have to be done in sign() this.#signers = zip(signers, weights ?? []) - .sort(([s1], [s2]) => - toBigInt(keccak256(s1.bytes ?? s1.address)) < toBigInt(keccak256(s2.bytes ?? s2.address)) ? -1 : 1, - ) + .sort(([s1], [s2]) => keccak256(s1.bytes ?? s1.address) - keccak256(s2.bytes ?? s2.address)) .map(([signer, weight = 1]) => ({ signer, weight })); } From 6619a533e203092d6bc89211f9fb6a8e584fd7b9 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 4 Jun 2025 18:53:52 +0200 Subject: [PATCH 095/110] Add fallback to check uniqueness if signers are not ordered (#56) --- .../utils/cryptography/SignatureChecker.sol | 24 ++-- .../cryptography/SignatureChecker.test.js | 119 +++++++++++------- 2 files changed, 89 insertions(+), 54 deletions(-) diff --git a/contracts/utils/cryptography/SignatureChecker.sol b/contracts/utils/cryptography/SignatureChecker.sol index c3d045f0ee8..8412c990f38 100644 --- a/contracts/utils/cryptography/SignatureChecker.sol +++ b/contracts/utils/cryptography/SignatureChecker.sol @@ -95,8 +95,8 @@ library SignatureChecker { /** * @dev Verifies multiple ERC-7913 `signatures` for a given `hash` using a set of `signers`. * - * The signers must be ordered by their `keccak256` hash to ensure no duplicates and to optimize - * the verification process. The function will return `false` if the signers are not properly ordered. + * The signers should be ordered by their `keccak256` hash to ensure efficient duplication check. Unordered + * signers are supported, but the uniqueness check will be more expensive. * * Requirements: * @@ -110,17 +110,25 @@ library SignatureChecker { bytes[] memory signers, bytes[] memory signatures ) internal view returns (bool) { - bytes32 previousId = bytes32(0); + bytes32 lastId = bytes32(0); for (uint256 i = 0; i < signers.length; ++i) { bytes memory signer = signers[i]; - // Signers must ordered by id to ensure no duplicates + + // If one of the signatures is invalid, reject the batch + if (!isValidERC7913SignatureNow(signer, hash, signatures[i])) return false; + bytes32 id = keccak256(signer); - if (previousId >= id || !isValidERC7913SignatureNow(signer, hash, signatures[i])) { - return false; + // If the current signer ID is greater than all previous IDs, then this is a new signer. + if (lastId < id) { + lastId = id; + } else { + // If this signer id is not greater than all the previous ones, verify that it is not a duplicate of a previous one + // This loop is never executed if the signers are ordered by id. + for (uint256 j = 0; j < i; ++j) { + if (id == keccak256(signers[j])) return false; + } } - - previousId = id; } return true; diff --git a/test/utils/cryptography/SignatureChecker.test.js b/test/utils/cryptography/SignatureChecker.test.js index 51d23539546..b141ab9bf5e 100644 --- a/test/utils/cryptography/SignatureChecker.test.js +++ b/test/utils/cryptography/SignatureChecker.test.js @@ -191,47 +191,90 @@ describe('SignatureChecker (ERC1271)', function () { it('should validate multiple signatures with different signer types', async function () { const signature = await this.signer.signMessage(TEST_MESSAGE); const pairs = [ - [ethers.zeroPadValue(this.signer.address, 20), signature], - [ethers.zeroPadValue(this.wallet.target, 20), signature], - [ethers.concat([this.verifier.target, VALID_SW_KEY_1]), VALID_SW_SIGNATURE_1], - ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); - const signers = pairs.map(([signer]) => signer); - const signatures = pairs.map(([, signature]) => signature); - await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, signers, signatures)).to.eventually.be - .true; + { signer: ethers.zeroPadValue(this.signer.address, 20), signature }, + { signer: ethers.zeroPadValue(this.wallet.target, 20), signature }, + { signer: ethers.concat([this.verifier.target, VALID_SW_KEY_1]), signature: VALID_SW_SIGNATURE_1 }, + ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(a) - ethers.keccak256(b)); + + await expect( + this.mock.$areValidERC7913SignaturesNow( + TEST_MESSAGE_HASH, + pairs.map(({ signer }) => signer), + pairs.map(({ signature }) => signature), + ), + ).to.eventually.be.true; }); it('should validate multiple EOA signatures', async function () { const pairs = [ - [ethers.zeroPadValue(this.signer.address, 20), await this.signer.signMessage(TEST_MESSAGE)], - [ethers.zeroPadValue(this.extraSigner.address, 20), await this.extraSigner.signMessage(TEST_MESSAGE)], - ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); - const signers = pairs.map(([signer]) => signer); - const signatures = pairs.map(([, signature]) => signature); - await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, signers, signatures)).to.eventually.be - .true; + { + signer: ethers.zeroPadValue(this.signer.address, 20), + signature: await this.signer.signMessage(TEST_MESSAGE), + }, + { + signer: ethers.zeroPadValue(this.extraSigner.address, 20), + signature: await this.extraSigner.signMessage(TEST_MESSAGE), + }, + ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(a) - ethers.keccak256(b)); + + await expect( + this.mock.$areValidERC7913SignaturesNow( + TEST_MESSAGE_HASH, + pairs.map(({ signer }) => signer), + pairs.map(({ signature }) => signature), + ), + ).to.eventually.be.true; }); it('should validate multiple ERC-1271 wallet signatures', async function () { const pairs = [ - [ethers.zeroPadValue(this.wallet.target, 20), await this.signer.signMessage(TEST_MESSAGE)], - [ethers.zeroPadValue(this.wallet2.target, 20), await this.extraSigner.signMessage(TEST_MESSAGE)], - ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); - const signers = pairs.map(([signer]) => signer); - const signatures = pairs.map(([, signature]) => signature); - await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, signers, signatures)).to.eventually.be - .true; + { + signer: ethers.zeroPadValue(this.wallet.target, 20), + signature: await this.signer.signMessage(TEST_MESSAGE), + }, + { + signer: ethers.zeroPadValue(this.wallet2.target, 20), + signature: await this.extraSigner.signMessage(TEST_MESSAGE), + }, + ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(a) - ethers.keccak256(b)); + + await expect( + this.mock.$areValidERC7913SignaturesNow( + TEST_MESSAGE_HASH, + pairs.map(({ signer }) => signer), + pairs.map(({ signature }) => signature), + ), + ).to.eventually.be.true; + }); + + it('should validate multiple ERC-7913 signatures (ordered by ID)', async function () { + const pairs = [ + { signer: ethers.concat([this.verifier.target, VALID_SW_KEY_1]), signature: VALID_SW_SIGNATURE_1 }, + { signer: ethers.concat([this.verifier.target, VALID_SW_KEY_2]), signature: VALID_SW_SIGNATURE_2 }, + ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(a) - ethers.keccak256(b)); + + await expect( + this.mock.$areValidERC7913SignaturesNow( + TEST_MESSAGE_HASH, + pairs.map(({ signer }) => signer), + pairs.map(({ signature }) => signature), + ), + ).to.eventually.be.true; }); - it('should validate multiple ERC-7913 signatures', async function () { + it('should validate multiple ERC-7913 signatures (unordered)', async function () { const pairs = [ - [ethers.concat([this.verifier.target, VALID_SW_KEY_1]), VALID_SW_SIGNATURE_1], - [ethers.concat([this.verifier.target, VALID_SW_KEY_2]), VALID_SW_SIGNATURE_2], - ].sort(([a], [b]) => ethers.keccak256(a) - ethers.keccak256(b)); - const signers = pairs.map(([signer]) => signer); - const signatures = pairs.map(([, signature]) => signature); - await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, signers, signatures)).to.eventually.be - .true; + { signer: ethers.concat([this.verifier.target, VALID_SW_KEY_1]), signature: VALID_SW_SIGNATURE_1 }, + { signer: ethers.concat([this.verifier.target, VALID_SW_KEY_2]), signature: VALID_SW_SIGNATURE_2 }, + ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(b) - ethers.keccak256(a)); // reverse + + await expect( + this.mock.$areValidERC7913SignaturesNow( + TEST_MESSAGE_HASH, + pairs.map(({ signer }) => signer), + pairs.map(({ signature }) => signature), + ), + ).to.eventually.be.true; }); it('should return false if any signature is invalid', async function () { @@ -244,22 +287,6 @@ describe('SignatureChecker (ERC1271)', function () { ).to.eventually.be.false; }); - it('should return false if signers are not ordered by ID', async function () { - const pairs = [ - [ethers.zeroPadValue(this.signer.address, 20), await this.signer.signMessage(TEST_MESSAGE)], - [ethers.zeroPadValue(this.extraSigner.address, 20), await this.extraSigner.signMessage(TEST_MESSAGE)], - ]; - - if (ethers.keccak256(pairs[0][0]) < ethers.keccak256(pairs[1][0])) { - pairs.reverse(); - } - - const signers = pairs.map(([signer]) => signer); - const signatures = pairs.map(([, signature]) => signature); - await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, signers, signatures)).to.eventually.be - .false; - }); - it('should return false if there are duplicate signers', async function () { await expect( this.mock.$areValidERC7913SignaturesNow( From cefe10183b28123fac2acb47063bcf65c173899d Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 4 Jun 2025 18:59:40 +0200 Subject: [PATCH 096/110] Update contracts/utils/cryptography/SignatureChecker.sol --- contracts/utils/cryptography/SignatureChecker.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contracts/utils/cryptography/SignatureChecker.sol b/contracts/utils/cryptography/SignatureChecker.sol index 8412c990f38..592be91e6ae 100644 --- a/contracts/utils/cryptography/SignatureChecker.sol +++ b/contracts/utils/cryptography/SignatureChecker.sol @@ -110,6 +110,8 @@ library SignatureChecker { bytes[] memory signers, bytes[] memory signatures ) internal view returns (bool) { + if (signers.length != signatures.length) return false; + bytes32 lastId = bytes32(0); for (uint256 i = 0; i < signers.length; ++i) { From b1753d11e62ca051adac0abb3afb8c60ef84630e Mon Sep 17 00:00:00 2001 From: ernestognw Date: Wed, 4 Jun 2025 15:26:28 -0600 Subject: [PATCH 097/110] Fix tests --- test/utils/cryptography/SignatureChecker.test.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/utils/cryptography/SignatureChecker.test.js b/test/utils/cryptography/SignatureChecker.test.js index b141ab9bf5e..88ab19ce00e 100644 --- a/test/utils/cryptography/SignatureChecker.test.js +++ b/test/utils/cryptography/SignatureChecker.test.js @@ -3,7 +3,6 @@ const { expect } = require('chai'); const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); const precompile = require('../../helpers/precompiles'); -const { PANIC_CODES } = require('@nomicfoundation/hardhat-chai-matchers/panic'); const TEST_MESSAGE = ethers.id('OpenZeppelin'); const TEST_MESSAGE_HASH = ethers.hashMessage(TEST_MESSAGE); @@ -297,14 +296,14 @@ describe('SignatureChecker (ERC1271)', function () { ).to.eventually.be.false; }); - it('should fail if signatures array length does not match signers array length', async function () { + it('should return false if signatures array length does not match signers array length', async function () { await expect( this.mock.$areValidERC7913SignaturesNow( TEST_MESSAGE_HASH, [ethers.zeroPadValue(this.signer.address, 20), await this.extraSigner.signMessage(TEST_MESSAGE)], [await this.signer.signMessage(TEST_MESSAGE)], // Missing one signature ), - ).to.be.revertedWithPanic(PANIC_CODES.ARRAY_ACCESS_OUT_OF_BOUNDS); + ).to.eventually.be.false; }); it('should pass with empty arrays', async function () { From cd2399bc9f1be80c3886e680b0d6239b8e3a9dcd Mon Sep 17 00:00:00 2001 From: ernestognw Date: Wed, 4 Jun 2025 15:39:10 -0600 Subject: [PATCH 098/110] Remove unnecessary mock --- .../cryptography/ERC7913VerifierMock.sol | 23 ----- .../cryptography/SignatureChecker.test.js | 95 +++++++++++++++---- 2 files changed, 74 insertions(+), 44 deletions(-) delete mode 100644 contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol diff --git a/contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol b/contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol deleted file mode 100644 index bd1d3128136..00000000000 --- a/contracts/mocks/utils/cryptography/ERC7913VerifierMock.sol +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.20; - -import {IERC7913SignatureVerifier} from "../../../../contracts/interfaces/IERC7913.sol"; - -contract ERC7913VerifierMock is IERC7913SignatureVerifier { - function verify(bytes calldata key, bytes32 /* hash */, bytes calldata signature) external pure returns (bytes4) { - // For testing purposes, we'll only accept specific key/signature combinations - return - (_isKnownSigner1(key, signature) || _isKnownSigner2(key, signature)) - ? IERC7913SignatureVerifier.verify.selector - : bytes4(0xffffffff); - } - - function _isKnownSigner1(bytes calldata key, bytes calldata signature) internal pure returns (bool) { - return keccak256(key) == keccak256("valid_key_1") && keccak256(signature) == keccak256("valid_signature_1"); - } - - function _isKnownSigner2(bytes calldata key, bytes calldata signature) internal pure returns (bool) { - return keccak256(key) == keccak256("valid_key_2") && keccak256(signature) == keccak256("valid_signature_2"); - } -} diff --git a/test/utils/cryptography/SignatureChecker.test.js b/test/utils/cryptography/SignatureChecker.test.js index 88ab19ce00e..447ae4739c1 100644 --- a/test/utils/cryptography/SignatureChecker.test.js +++ b/test/utils/cryptography/SignatureChecker.test.js @@ -3,6 +3,7 @@ const { expect } = require('chai'); const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); const precompile = require('../../helpers/precompiles'); +const { P256SigningKey, NonNativeSigner } = require('../../helpers/signers'); const TEST_MESSAGE = ethers.id('OpenZeppelin'); const TEST_MESSAGE_HASH = ethers.hashMessage(TEST_MESSAGE); @@ -10,11 +11,8 @@ const TEST_MESSAGE_HASH = ethers.hashMessage(TEST_MESSAGE); const WRONG_MESSAGE = ethers.id('Nope'); const WRONG_MESSAGE_HASH = ethers.hashMessage(WRONG_MESSAGE); -const VALID_SW_KEY_1 = ethers.toUtf8Bytes('valid_key_1'); -const VALID_SW_KEY_2 = ethers.toUtf8Bytes('valid_key_2'); - -const VALID_SW_SIGNATURE_1 = ethers.toUtf8Bytes('valid_signature_1'); -const VALID_SW_SIGNATURE_2 = ethers.toUtf8Bytes('valid_signature_2'); +const aliceP256 = new NonNativeSigner(P256SigningKey.random()); +const bobP256 = new NonNativeSigner(P256SigningKey.random()); async function fixture() { const [signer, extraSigner, other] = await ethers.getSigners(); @@ -23,7 +21,7 @@ async function fixture() { const wallet2 = await ethers.deployContract('ERC1271WalletMock', [extraSigner]); const malicious = await ethers.deployContract('ERC1271MaliciousMock'); const signature = await signer.signMessage(TEST_MESSAGE); - const verifier = await ethers.deployContract('ERC7913VerifierMock'); + const verifier = await ethers.deployContract('ERC7913P256Verifier'); return { signer, other, extraSigner, mock, wallet, wallet2, malicious, signature, verifier }; } @@ -131,28 +129,38 @@ describe('SignatureChecker (ERC1271)', function () { describe('with ERC-7913 verifier', function () { it('with matching signer and signature', async function () { + const signature = await aliceP256.signMessage(TEST_MESSAGE); await expect( this.mock.$isValidERC7913SignatureNow( - ethers.concat([this.verifier.target, VALID_SW_KEY_1]), + ethers.concat([ + this.verifier.target, + aliceP256.signingKey.publicKey.qx, + aliceP256.signingKey.publicKey.qy, + ]), TEST_MESSAGE_HASH, - VALID_SW_SIGNATURE_1, + signature, ), ).to.eventually.be.true; }); it('with invalid verifier', async function () { - const invalidVerifierSigner = ethers.concat([this.mock.target, VALID_SW_KEY_1]); - await expect( - this.mock.$isValidERC7913SignatureNow(invalidVerifierSigner, TEST_MESSAGE_HASH, VALID_SW_SIGNATURE_1), - ).to.eventually.be.false; + const signature = await aliceP256.signMessage(TEST_MESSAGE); + const invalidVerifierSigner = ethers.concat([ + this.mock.target, + aliceP256.signingKey.publicKey.qx, + aliceP256.signingKey.publicKey.qy, + ]); + await expect(this.mock.$isValidERC7913SignatureNow(invalidVerifierSigner, TEST_MESSAGE_HASH, signature)).to + .eventually.be.false; }); it('with invalid key', async function () { + const signature = await aliceP256.signMessage(TEST_MESSAGE); await expect( this.mock.$isValidERC7913SignatureNow( ethers.concat([this.verifier.target, ethers.randomBytes(32)]), TEST_MESSAGE_HASH, - VALID_SW_SIGNATURE_1, + signature, ), ).to.eventually.be.false; }); @@ -160,7 +168,11 @@ describe('SignatureChecker (ERC1271)', function () { it('with invalid signature', async function () { await expect( this.mock.$isValidERC7913SignatureNow( - ethers.concat([this.verifier.target, VALID_SW_KEY_1]), + ethers.concat([ + this.verifier.target, + aliceP256.signingKey.publicKey.qx, + aliceP256.signingKey.publicKey.qy, + ]), TEST_MESSAGE_HASH, ethers.randomBytes(65), ), @@ -169,8 +181,9 @@ describe('SignatureChecker (ERC1271)', function () { it('with signer too short', async function () { const shortSigner = ethers.randomBytes(19); - await expect(this.mock.$isValidERC7913SignatureNow(shortSigner, TEST_MESSAGE_HASH, VALID_SW_SIGNATURE_1)).to - .eventually.be.false; + const signature = await aliceP256.signMessage(TEST_MESSAGE); + await expect(this.mock.$isValidERC7913SignatureNow(shortSigner, TEST_MESSAGE_HASH, signature)).to.eventually + .be.false; }); }); }); @@ -189,10 +202,18 @@ describe('SignatureChecker (ERC1271)', function () { it('should validate multiple signatures with different signer types', async function () { const signature = await this.signer.signMessage(TEST_MESSAGE); + const aliceSignature = await aliceP256.signMessage(TEST_MESSAGE); const pairs = [ { signer: ethers.zeroPadValue(this.signer.address, 20), signature }, { signer: ethers.zeroPadValue(this.wallet.target, 20), signature }, - { signer: ethers.concat([this.verifier.target, VALID_SW_KEY_1]), signature: VALID_SW_SIGNATURE_1 }, + { + signer: ethers.concat([ + this.verifier.target, + aliceP256.signingKey.publicKey.qx, + aliceP256.signingKey.publicKey.qy, + ]), + signature: aliceSignature, + }, ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(a) - ethers.keccak256(b)); await expect( @@ -247,9 +268,25 @@ describe('SignatureChecker (ERC1271)', function () { }); it('should validate multiple ERC-7913 signatures (ordered by ID)', async function () { + const aliceSignature = await aliceP256.signMessage(TEST_MESSAGE); + const bobSignature = await bobP256.signMessage(TEST_MESSAGE); const pairs = [ - { signer: ethers.concat([this.verifier.target, VALID_SW_KEY_1]), signature: VALID_SW_SIGNATURE_1 }, - { signer: ethers.concat([this.verifier.target, VALID_SW_KEY_2]), signature: VALID_SW_SIGNATURE_2 }, + { + signer: ethers.concat([ + this.verifier.target, + aliceP256.signingKey.publicKey.qx, + aliceP256.signingKey.publicKey.qy, + ]), + signature: aliceSignature, + }, + { + signer: ethers.concat([ + this.verifier.target, + bobP256.signingKey.publicKey.qx, + bobP256.signingKey.publicKey.qy, + ]), + signature: bobSignature, + }, ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(a) - ethers.keccak256(b)); await expect( @@ -262,9 +299,25 @@ describe('SignatureChecker (ERC1271)', function () { }); it('should validate multiple ERC-7913 signatures (unordered)', async function () { + const aliceSignature = await aliceP256.signMessage(TEST_MESSAGE); + const bobSignature = await bobP256.signMessage(TEST_MESSAGE); const pairs = [ - { signer: ethers.concat([this.verifier.target, VALID_SW_KEY_1]), signature: VALID_SW_SIGNATURE_1 }, - { signer: ethers.concat([this.verifier.target, VALID_SW_KEY_2]), signature: VALID_SW_SIGNATURE_2 }, + { + signer: ethers.concat([ + this.verifier.target, + aliceP256.signingKey.publicKey.qx, + aliceP256.signingKey.publicKey.qy, + ]), + signature: aliceSignature, + }, + { + signer: ethers.concat([ + this.verifier.target, + bobP256.signingKey.publicKey.qx, + bobP256.signingKey.publicKey.qy, + ]), + signature: bobSignature, + }, ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(b) - ethers.keccak256(a)); // reverse await expect( From 0b1b8eb812f470de938a22691ebb7b681b9fcf07 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Wed, 4 Jun 2025 15:41:45 -0600 Subject: [PATCH 099/110] Docs nits --- contracts/utils/cryptography/SignatureChecker.sol | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/contracts/utils/cryptography/SignatureChecker.sol b/contracts/utils/cryptography/SignatureChecker.sol index 592be91e6ae..261372f0c3d 100644 --- a/contracts/utils/cryptography/SignatureChecker.sol +++ b/contracts/utils/cryptography/SignatureChecker.sol @@ -94,14 +94,11 @@ library SignatureChecker { /** * @dev Verifies multiple ERC-7913 `signatures` for a given `hash` using a set of `signers`. + * Returns `false` if the number of signers and signatures is not the same. * * The signers should be ordered by their `keccak256` hash to ensure efficient duplication check. Unordered * signers are supported, but the uniqueness check will be more expensive. * - * Requirements: - * - * * The `signatures` array must be at least the `signers` array's length. - * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ From e59212539b7fbf08003f6b53f4fe2c624332b515 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Wed, 4 Jun 2025 18:26:57 -0600 Subject: [PATCH 100/110] Remove weighted multisig --- .changeset/public-crabs-heal.md | 5 - contracts/mocks/account/AccountMock.sol | 25 -- contracts/utils/cryptography/README.adoc | 4 +- .../signers/MultiSignerERC7913Weighted.sol | 194 ----------- .../AccountMultiSignerWeighted.test.js | 313 ------------------ 5 files changed, 1 insertion(+), 540 deletions(-) delete mode 100644 .changeset/public-crabs-heal.md delete mode 100644 contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol delete mode 100644 test/account/AccountMultiSignerWeighted.test.js diff --git a/.changeset/public-crabs-heal.md b/.changeset/public-crabs-heal.md deleted file mode 100644 index 463dc988731..00000000000 --- a/.changeset/public-crabs-heal.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'openzeppelin-solidity': minor ---- - -`MultiSignerERC7913Weighted`: Extension of `MultiSignerERC7913` that supports assigning different weights to each signer, enabling more flexible governance schemes. diff --git a/contracts/mocks/account/AccountMock.sol b/contracts/mocks/account/AccountMock.sol index 71b958051e4..cb4b1efec91 100644 --- a/contracts/mocks/account/AccountMock.sol +++ b/contracts/mocks/account/AccountMock.sol @@ -19,7 +19,6 @@ import {SignerRSA} from "../../utils/cryptography/signers/SignerRSA.sol"; import {SignerERC7702} from "../../utils/cryptography/signers/SignerERC7702.sol"; import {SignerERC7913} from "../../utils/cryptography/signers/SignerERC7913.sol"; import {MultiSignerERC7913} from "../../utils/cryptography/signers/MultiSignerERC7913.sol"; -import {MultiSignerERC7913Weighted} from "../../utils/cryptography/signers/MultiSignerERC7913Weighted.sol"; abstract contract AccountMock is Account, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { /// Validates a user operation with a boolean signature. @@ -170,27 +169,3 @@ abstract contract AccountERC7913Mock is Account, SignerERC7913, ERC7739, ERC7821 return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); } } - -abstract contract AccountMultiSignerWeightedMock is - Account, - MultiSignerERC7913Weighted, - ERC7739, - ERC7821, - ERC721Holder, - ERC1155Holder -{ - constructor(bytes[] memory signers, uint256[] memory weights, uint256 threshold) { - _addSigners(signers); - _setSignerWeights(signers, weights); - _setThreshold(threshold); - } - - /// @inheritdoc ERC7821 - function _erc7821AuthorizedExecutor( - address caller, - bytes32 mode, - bytes calldata executionData - ) internal view virtual override returns (bool) { - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData); - } -} diff --git a/contracts/utils/cryptography/README.adoc b/contracts/utils/cryptography/README.adoc index 37a982448ec..79b10437322 100644 --- a/contracts/utils/cryptography/README.adoc +++ b/contracts/utils/cryptography/README.adoc @@ -17,7 +17,7 @@ A collection of contracts and libraries that implement various signature validat * {ERC7739}: An abstract contract to validate signatures following the rehashing scheme from {ERC7739Utils}. * {SignerECDSA}, {SignerP256}, {SignerRSA}: Implementations of an {AbstractSigner} with specific signature validation algorithms. * {SignerERC7702}: Implementation of {AbstractSigner} that validates signatures using the contract's own address as the signer, useful for delegated accounts following EIP-7702. - * {SignerERC7913}, {MultiSignerERC7913}, {MultiSignerERC7913Weighted}: Implementations of {AbstractSigner} that validate signatures based on ERC-7913. Including a simple and weighted multisignature scheme. + * {SignerERC7913}, {MultiSignerERC7913}: Implementations of {AbstractSigner} that validate signatures based on ERC-7913. Including a simple multisignature scheme. * {ERC7913P256Verifier}, {ERC7913RSAVerifier}: Ready to use ERC-7913 signature verifiers for P256 and RSA keys. == Utils @@ -58,8 +58,6 @@ A collection of contracts and libraries that implement various signature validat {{MultiSignerERC7913}} -{{MultiSignerERC7913Weighted}} - == Verifiers {{ERC7913P256Verifier}} diff --git a/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol deleted file mode 100644 index 0120333ac44..00000000000 --- a/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol +++ /dev/null @@ -1,194 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.27; - -import {Math} from "../../math/Math.sol"; -import {SafeCast} from "../../math/SafeCast.sol"; -import {MultiSignerERC7913} from "./MultiSignerERC7913.sol"; -import {EnumerableSet} from "../../../utils/structs/EnumerableSet.sol"; - -/** - * @dev Extension of {MultiSignerERC7913} that supports weighted signatures. - * - * This contract allows assigning different weights to each signer, enabling more - * flexible governance schemes. For example, some signers could have higher weight - * than others, allowing for weighted voting or prioritized authorization. - * - * Example of usage: - * - * ```solidity - * contract MyWeightedMultiSignerAccount is Account, MultiSignerERC7913Weighted, Initializable { - * constructor() EIP712("MyWeightedMultiSignerAccount", "1") {} - * - * function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold) public initializer { - * _addSigners(signers); - * _setSignerWeights(signers, weights); - * _setThreshold(threshold); - * } - * - * function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf { - * _addSigners(signers); - * } - * - * function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf { - * _removeSigners(signers); - * } - * - * function setThreshold(uint256 threshold) public onlyEntryPointOrSelf { - * _setThreshold(threshold); - * } - * - * function setSignerWeights(bytes[] memory signers, uint256[] memory weights) public onlyEntryPointOrSelf { - * _setSignerWeights(signers, weights); - * } - * } - * ``` - * - * IMPORTANT: When setting a threshold value, ensure it matches the scale used for signer weights. - * For example, if signers have weights like 1, 2, or 3, then a threshold of 4 would require at - * least two signers (e.g., one with weight 1 and one with weight 3). See {signerWeight}. - */ -abstract contract MultiSignerERC7913Weighted is MultiSignerERC7913 { - using EnumerableSet for EnumerableSet.BytesSet; - using SafeCast for uint256; - - // Invariant: sum(weights) >= threshold - uint128 private _totalWeight; - - // Mapping from signer to weight - mapping(bytes signer => uint256) private _weights; - - /// @dev Emitted when a signer's weight is changed. - event ERC7913SignerWeightChanged(bytes indexed signer, uint256 weight); - - /// @dev Thrown when a signer's weight is invalid. - error MultiSignerERC7913WeightedInvalidWeight(bytes signer, uint256 weight); - - /// @dev Thrown when the threshold is unreachable. - error MultiSignerERC7913WeightedMismatchedLength(); - - /// @dev Gets the weight of a signer. Returns 0 if the signer is not authorized. - function signerWeight(bytes memory signer) public view virtual returns (uint256) { - return Math.ternary(isSigner(signer), _signerWeight(signer), 0); - } - - /// @dev Gets the total weight of all signers. - function totalWeight() public view virtual returns (uint256) { - return _totalWeight; // Doesn't need Math.max because it's incremented by the default 1 in `_addSigners` - } - - /** - * @dev Gets the weight of the current signer. Returns 1 if not explicitly set. - * - * NOTE: This internal function doesn't check if the signer is authorized. - */ - function _signerWeight(bytes memory signer) internal view virtual returns (uint256) { - return Math.max(_weights[signer], 1); - } - - /** - * @dev Sets weights for multiple signers at once. Internal version without access control. - * - * Requirements: - * - * - `signers` and `weights` arrays must have the same length. Reverts with {MultiSignerERC7913WeightedMismatchedLength} on mismatch. - * - Each signer must exist in the set of authorized signers. Reverts with {MultiSignerERC7913NonexistentSigner} if not. - * - Each weight must be greater than 0. Reverts with {MultiSignerERC7913WeightedInvalidWeight} if not. - * - See {_validateReachableThreshold} for the threshold validation. - * - * Emits {ERC7913SignerWeightChanged} for each signer. - */ - function _setSignerWeights(bytes[] memory signers, uint256[] memory newWeights) internal virtual { - uint256 signersLength = signers.length; - require(signersLength == newWeights.length, MultiSignerERC7913WeightedMismatchedLength()); - uint256 oldWeight = _weightSigners(signers); - - for (uint256 i = 0; i < signers.length; ++i) { - bytes memory signer = signers[i]; - uint256 newWeight = newWeights[i]; - require(isSigner(signer), MultiSignerERC7913NonexistentSigner(signer)); - require(newWeight > 0, MultiSignerERC7913WeightedInvalidWeight(signer, newWeight)); - } - - _unsafeSetSignerWeights(signers, newWeights); - _totalWeight = (_totalWeight - oldWeight + _weightSigners(signers)).toUint128(); - _validateReachableThreshold(); - } - - /// @inheritdoc MultiSignerERC7913 - function _addSigners(bytes[] memory newSigners) internal virtual override { - super._addSigners(newSigners); - _totalWeight += newSigners.length.toUint128(); // Each new signer has a default weight of 1 - } - - /** - * @dev See {MultiSignerERC7913-_removeSigners}. - * - * Emits {ERC7913SignerWeightChanged} for each removed signer. - */ - function _removeSigners(bytes[] memory oldSigners) internal virtual override { - uint256 removedWeight = _weightSigners(oldSigners); - unchecked { - // Can't overflow. Invariant: sum(weights) >= threshold - _totalWeight -= removedWeight.toUint128(); - } - // Clean up weights for removed signers - _unsafeSetSignerWeights(oldSigners, new uint256[](oldSigners.length)); - super._removeSigners(oldSigners); - } - - /** - * @dev Sets the threshold for the multisignature operation. Internal version without access control. - * - * Requirements: - * - * * The {totalWeight} must be `>=` to the {threshold}. Throws {MultiSignerERC7913UnreachableThreshold} if not. - * - * NOTE: This function intentionally does not call `super._validateReachableThreshold` because the base implementation - * assumes each signer has a weight of 1, which is a subset of this weighted implementation. Consider that multiple - * implementations of this function may exist in the contract, so important side effects may be missed - * depending on the linearization order. - */ - function _validateReachableThreshold() internal view virtual override { - uint256 weight = totalWeight(); - uint256 currentThreshold = threshold(); - require(weight >= currentThreshold, MultiSignerERC7913UnreachableThreshold(weight, currentThreshold)); - } - - /** - * @dev Validates that the total weight of signers meets the threshold requirement. - * - * NOTE: This function intentionally does not call `super. _validateThreshold` because the base implementation - * assumes each signer has a weight of 1, which is a subset of this weighted implementation. Consider that multiple - * implementations of this function may exist in the contract, so important side effects may be missed - * depending on the linearization order. - */ - function _validateThreshold(bytes[] memory signers) internal view virtual override returns (bool) { - return _weightSigners(signers) >= threshold(); - } - - /// @dev Calculates the total weight of a set of signers. For all signers weight use {totalWeight}. - function _weightSigners(bytes[] memory signers) internal view virtual returns (uint256) { - uint256 weight = 0; - for (uint256 i = 0; i < signers.length; ++i) { - weight += signerWeight(signers[i]); - } - return weight; - } - - /** - * @dev Sets the weights for multiple signers without updating the total weight or validating the threshold. - * - * Requirements: - * - * * The `newWeights` array must be at least as large as the `signers` array. Panics otherwise. - * - * Emits {ERC7913SignerWeightChanged} for each signer. - */ - function _unsafeSetSignerWeights(bytes[] memory signers, uint256[] memory newWeights) private { - for (uint256 i = 0; i < signers.length; ++i) { - _weights[signers[i]] = newWeights[i]; - emit ERC7913SignerWeightChanged(signers[i], newWeights[i]); - } - } -} diff --git a/test/account/AccountMultiSignerWeighted.test.js b/test/account/AccountMultiSignerWeighted.test.js deleted file mode 100644 index 46d9633f081..00000000000 --- a/test/account/AccountMultiSignerWeighted.test.js +++ /dev/null @@ -1,313 +0,0 @@ -const { ethers, entrypoint } = require('hardhat'); -const { expect } = require('chai'); -const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); - -const { getDomain } = require('../helpers/eip712'); -const { ERC4337Helper } = require('../helpers/erc4337'); -const { NonNativeSigner, P256SigningKey, RSASHA256SigningKey, MultiERC7913SigningKey } = require('../helpers/signers'); -const { PackedUserOperation } = require('../helpers/eip712-types'); - -const { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder } = require('./Account.behavior'); -const { shouldBehaveLikeERC1271 } = require('../utils/cryptography/ERC1271.behavior'); -const { shouldBehaveLikeERC7821 } = require('./extensions/ERC7821.behavior'); - -// Prepare signers in advance (RSA are long to initialize) -const signerECDSA1 = ethers.Wallet.createRandom(); -const signerECDSA2 = ethers.Wallet.createRandom(); -const signerECDSA3 = ethers.Wallet.createRandom(); -const signerECDSA4 = ethers.Wallet.createRandom(); -const signerP256 = new NonNativeSigner(P256SigningKey.random()); -const signerRSA = new NonNativeSigner(RSASHA256SigningKey.random()); - -// Minimal fixture common to the different signer verifiers -async function fixture() { - // EOAs and environment - const [beneficiary, other] = await ethers.getSigners(); - const target = await ethers.deployContract('CallReceiverMock'); - - // ERC-7913 verifiers - const verifierP256 = await ethers.deployContract('ERC7913P256Verifier'); - const verifierRSA = await ethers.deployContract('ERC7913RSAVerifier'); - - // ERC-4337 env - const helper = new ERC4337Helper(); - await helper.wait(); - const entrypointDomain = await getDomain(entrypoint.v08); - const domain = { name: 'AccountMultiSignerWeighted', version: '1', chainId: entrypointDomain.chainId }; // Missing verifyingContract - - const makeMock = (signers, weights, threshold) => - helper - .newAccount('$AccountMultiSignerWeightedMock', ['AccountMultiSignerWeighted', '1', signers, weights, threshold]) - .then(mock => { - domain.verifyingContract = mock.address; - return mock; - }); - - // Sign user operations using NonNativeSigner with MultiERC7913SigningKey - const signUserOp = function (userOp) { - return this.signer - .signTypedData(entrypointDomain, { PackedUserOperation }, userOp.packed) - .then(signature => Object.assign(userOp, { signature })); - }; - - const invalidSig = function () { - return this.signer.signMessage('invalid'); - }; - - return { - helper, - verifierP256, - verifierRSA, - domain, - target, - beneficiary, - other, - makeMock, - signUserOp, - invalidSig, - }; -} - -describe('AccountMultiSignerWeighted', function () { - beforeEach(async function () { - Object.assign(this, await loadFixture(fixture)); - }); - - describe('Weighted signers with equal weights (1, 1, 1) and threshold=2', function () { - beforeEach(async function () { - const weights = [1, 1, 1]; - this.signer = new NonNativeSigner( - new MultiERC7913SigningKey([signerECDSA1, signerECDSA2, signerECDSA3], weights), - ); - this.mock = await this.makeMock([signerECDSA1.address, signerECDSA2.address, signerECDSA3.address], weights, 2); - }); - - shouldBehaveLikeAccountCore(); - shouldBehaveLikeAccountHolder(); - shouldBehaveLikeERC1271({ erc7739: true }); - shouldBehaveLikeERC7821(); - }); - - describe('Weighted signers with varying weights (1, 2, 3) and threshold=3', function () { - beforeEach(async function () { - const weights = [1, 2, 3]; - this.signer = new NonNativeSigner(new MultiERC7913SigningKey([signerECDSA1, signerECDSA2], weights.slice(1))); - this.mock = await this.makeMock([signerECDSA1.address, signerECDSA2.address, signerECDSA3.address], weights, 3); - }); - - shouldBehaveLikeAccountCore(); - shouldBehaveLikeAccountHolder(); - shouldBehaveLikeERC1271({ erc7739: true }); - shouldBehaveLikeERC7821(); - }); - - describe('Mixed weighted signers with threshold=4', function () { - beforeEach(async function () { - // Create signers array with all three types - signerP256.bytes = ethers.concat([ - this.verifierP256.target, - signerP256.signingKey.publicKey.qx, - signerP256.signingKey.publicKey.qy, - ]); - - signerRSA.bytes = ethers.concat([ - this.verifierRSA.target, - ethers.AbiCoder.defaultAbiCoder().encode( - ['bytes', 'bytes'], - [signerRSA.signingKey.publicKey.e, signerRSA.signingKey.publicKey.n], - ), - ]); - - const weights = [1, 2, 3]; - this.signer = new NonNativeSigner(new MultiERC7913SigningKey([signerECDSA1, signerP256, signerRSA], weights)); - this.mock = await this.makeMock( - [signerECDSA1.address, signerP256.bytes, signerRSA.bytes], - weights, - 4, // Requires at least signer2 + signer3, or all three signers - ); - }); - - shouldBehaveLikeAccountCore(); - shouldBehaveLikeAccountHolder(); - shouldBehaveLikeERC1271({ erc7739: true }); - shouldBehaveLikeERC7821(); - }); - - describe('Weight management', function () { - beforeEach(async function () { - const weights = [1, 2, 3]; - this.signer = new NonNativeSigner( - new MultiERC7913SigningKey([signerECDSA1, signerECDSA2, signerECDSA3], weights), - ); - this.mock = await this.makeMock([signerECDSA1.address, signerECDSA2.address, signerECDSA3.address], weights, 4); - await this.mock.deploy(); - }); - - it('can get signer weights', async function () { - const signer1 = signerECDSA1.address; - const signer2 = signerECDSA2.address; - const signer3 = signerECDSA3.address; - - await expect(this.mock.signerWeight(signer1)).to.eventually.equal(1); - await expect(this.mock.signerWeight(signer2)).to.eventually.equal(2); - await expect(this.mock.signerWeight(signer3)).to.eventually.equal(3); - }); - - it('can update signer weights', async function () { - const signer1 = signerECDSA1.address; - const signer2 = signerECDSA2.address; - const signer3 = signerECDSA3.address; - - // Successfully updates weights and emits event - await expect(this.mock.$_setSignerWeights([signer1, signer2], [5, 5])) - .to.emit(this.mock, 'ERC7913SignerWeightChanged') - .withArgs(signer1, 5) - .to.emit(this.mock, 'ERC7913SignerWeightChanged') - .withArgs(signer2, 5); - - await expect(this.mock.signerWeight(signer1)).to.eventually.equal(5); - await expect(this.mock.signerWeight(signer2)).to.eventually.equal(5); - await expect(this.mock.signerWeight(signer3)).to.eventually.equal(3); // unchanged - }); - - it('cannot set weight to non-existent signer', async function () { - const randomSigner = ethers.Wallet.createRandom().address; - - // Reverts when setting weight for non-existent signer - await expect(this.mock.$_setSignerWeights([randomSigner], [1])) - .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913NonexistentSigner') - .withArgs(randomSigner.toLowerCase()); - }); - - it('cannot set weight to 0', async function () { - const signer1 = signerECDSA1.address; - - // Reverts when setting weight to 0 - await expect(this.mock.$_setSignerWeights([signer1], [0])) - .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913WeightedInvalidWeight') - .withArgs(signer1.toLowerCase(), 0); - }); - - it('requires signers and weights arrays to have same length', async function () { - const signer1 = signerECDSA1.address; - const signer2 = signerECDSA2.address; - - // Reverts when arrays have different lengths - await expect(this.mock.$_setSignerWeights([signer1, signer2], [1])).to.be.revertedWithCustomError( - this.mock, - 'MultiSignerERC7913WeightedMismatchedLength', - ); - }); - - it('validates threshold is reachable when updating weights', async function () { - const signer1 = signerECDSA1.address; - const signer2 = signerECDSA2.address; - const signer3 = signerECDSA3.address; - - // First, lower the weights so the sum is exactly 6 (just enough for threshold=6) - await expect(this.mock.$_setSignerWeights([signer1, signer2, signer3], [1, 2, 3])).to.emit( - this.mock, - 'ERC7913SignerWeightChanged', - ); - - // Increase threshold to 6 - await expect(this.mock.$_setThreshold(6)).to.emit(this.mock, 'ERC7913ThresholdSet').withArgs(6); - - // Now try to lower weights so their sum is less than the threshold - await expect(this.mock.$_setSignerWeights([signer1, signer2, signer3], [1, 1, 1])).to.be.revertedWithCustomError( - this.mock, - 'MultiSignerERC7913UnreachableThreshold', - ); - - // Try to increase threshold to be larger than the total weight - await expect(this.mock.$_setThreshold(7)) - .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913UnreachableThreshold') - .withArgs(6, 7); - }); - - it('reports default weight of 1 for signers without explicit weight', async function () { - const signer4 = signerECDSA4.address; - - // Add a new signer without setting weight - await this.mock.$_addSigners([signer4]); - - // Should have default weight of 1 - await expect(this.mock.signerWeight(signer4)).to.eventually.equal(1); - }); - - it('reports weight of 0 for invalid signers', async function () { - const randomSigner = ethers.Wallet.createRandom().address; - await expect(this.mock.signerWeight(randomSigner)).to.eventually.equal(0); - }); - - it('can get total weight of all signers', async function () { - await expect(this.mock.totalWeight()).to.eventually.equal(6); // max(_totalWeight, _signers.length) = max(6, 3) = 6 - }); - - it('totalWeight returns correct value when all signers have default weight of 1', async function () { - // Deploy a new mock with all signers having default weight (1) - const signers = [signerECDSA1.address, signerECDSA2.address, signerECDSA3.address]; - const defaultWeights = [1, 1, 1]; // All weights are 1 (default) - const newMock = await this.makeMock(signers, defaultWeights, 2); - await newMock.deploy(); - - // totalWeight should return max(3, 3) = 3 when all weights are default - await expect(newMock.totalWeight()).to.eventually.equal(3); - - // Clear custom weights to ensure we're using default weights - await newMock.$_setSignerWeights(signers, [1, 1, 1]); - - // totalWeight should still be max(3, 3) = 3 - await expect(newMock.totalWeight()).to.eventually.equal(3); - }); - - it('_setSignerWeights correctly handles default weights when updating', async function () { - const signer1 = signerECDSA1.address; - - // Current weights are [1, 2, 3] - - // Set weight for signer1 from 1 (default) to 5 - await this.mock.$_setSignerWeights([signer1], [5]); - - // totalWeight should be updated from max(6, 3) to max(10, 3) = 10 - await expect(this.mock.totalWeight()).to.eventually.equal(10); - - // Reset signer1 to default weight (1) - await this.mock.$_setSignerWeights([signer1], [1]); - - // totalWeight should be back to max(6, 3) = 6 - await expect(this.mock.totalWeight()).to.eventually.equal(6); - }); - - it('updates total weight when adding and removing signers', async function () { - const signer4 = signerECDSA4.address; - - // Add a new signer - should increase total weight by default weight (1) - await this.mock.$_addSigners([signer4]); - await expect(this.mock.totalWeight()).to.eventually.equal(7); // max(7, 4) = 7 - - // Set weight to 5 - should increase total weight by 4 - await this.mock.$_setSignerWeights([signer4], [5]); - await expect(this.mock.totalWeight()).to.eventually.equal(11); // max(11, 4) = 11 - - // Remove signer - should decrease total weight by current weight (5) - await this.mock.$_removeSigners([signer4]); - await expect(this.mock.totalWeight()).to.eventually.equal(6); // max(6, 3) = 6 - }); - - it('removing signers should not make threshold unreachable', async function () { - // current threshold = 4, totalWeight = max(6, 3) = 6 - const signer1 = signerECDSA1.address; // weight 1 - const signer3 = signerECDSA3.address; // weight 3 - - // After removing signer3, the threshold is unreachable because totalWeight = max(3, 2) = 3 but threshold = 4 - // This should revert - await expect(this.mock.$_removeSigners([signer3])) - .to.be.revertedWithCustomError(this.mock, 'MultiSignerERC7913UnreachableThreshold') - .withArgs(3, 4); - - // Removing signer1 should not revert (new totalWeight = max(5, 2) = 5, threshold = 4) - await expect(this.mock.$_removeSigners([signer1])).to.not.be.reverted; - }); - }); -}); From 4dc17a7ac2cb14f8a0678291ff537a75aa864105 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Wed, 4 Jun 2025 18:36:18 -0600 Subject: [PATCH 101/110] Use uint64 as threshold --- contracts/mocks/account/AccountMock.sol | 2 +- .../signers/MultiSignerERC7913.sol | 26 +++++++++---------- test/account/AccountMultiSigner.test.js | 11 ++++---- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/contracts/mocks/account/AccountMock.sol b/contracts/mocks/account/AccountMock.sol index cb4b1efec91..052730802fd 100644 --- a/contracts/mocks/account/AccountMock.sol +++ b/contracts/mocks/account/AccountMock.sol @@ -140,7 +140,7 @@ abstract contract AccountERC7579HookedMock is AccountERC7579Hooked { } abstract contract AccountMultiSignerMock is Account, MultiSignerERC7913, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { - constructor(bytes[] memory signers, uint256 threshold) { + constructor(bytes[] memory signers, uint64 threshold) { _addSigners(signers); _setThreshold(threshold); } diff --git a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol index 4c841b733b7..4bd8d280a14 100644 --- a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol @@ -5,7 +5,6 @@ pragma solidity ^0.8.27; import {AbstractSigner} from "./AbstractSigner.sol"; import {SignatureChecker} from "../SignatureChecker.sol"; import {EnumerableSet} from "../../structs/EnumerableSet.sol"; -import {SafeCast} from "../../../utils/math/SafeCast.sol"; /** * @dev Implementation of {AbstractSigner} using multiple ERC-7913 signers with a threshold-based @@ -21,7 +20,7 @@ import {SafeCast} from "../../../utils/math/SafeCast.sol"; * contract MyMultiSignerAccount is Account, MultiSignerERC7913, Initializable { * constructor() EIP712("MyMultiSignerAccount", "1") {} * - * function initialize(bytes[] memory signers, uint256 threshold) public initializer { + * function initialize(bytes[] memory signers, uint64 threshold) public initializer { * _addSigners(signers); * _setThreshold(threshold); * } @@ -34,7 +33,7 @@ import {SafeCast} from "../../../utils/math/SafeCast.sol"; * _removeSigners(signers); * } * - * function setThreshold(uint256 threshold) public onlyEntryPointOrSelf { + * function setThreshold(uint64 threshold) public onlyEntryPointOrSelf { * _setThreshold(threshold); * } * } @@ -47,10 +46,9 @@ import {SafeCast} from "../../../utils/math/SafeCast.sol"; abstract contract MultiSignerERC7913 is AbstractSigner { using EnumerableSet for EnumerableSet.BytesSet; using SignatureChecker for *; - using SafeCast for uint256; EnumerableSet.BytesSet private _signers; - uint128 private _threshold; + uint64 private _threshold; /// @dev Emitted when a signer is added. event ERC7913SignerAdded(bytes indexed signers); @@ -59,7 +57,7 @@ abstract contract MultiSignerERC7913 is AbstractSigner { event ERC7913SignerRemoved(bytes indexed signers); /// @dev Emitted when the threshold is updated. - event ERC7913ThresholdSet(uint256 threshold); + event ERC7913ThresholdSet(uint64 threshold); /// @dev The `signer` already exists. error MultiSignerERC7913AlreadyExists(bytes signer); @@ -71,18 +69,18 @@ abstract contract MultiSignerERC7913 is AbstractSigner { error MultiSignerERC7913InvalidSigner(bytes signer); /// @dev The `threshold` is unreachable given the number of `signers`. - error MultiSignerERC7913UnreachableThreshold(uint256 signers, uint256 threshold); + error MultiSignerERC7913UnreachableThreshold(uint64 signers, uint64 threshold); /** * @dev Returns a slice of the set of authorized signers. * - * Using `start = 0` and `end = type(uint256).max` will return the entire set of signers. + * Using `start = 0` and `end = type(uint64).max` will return the entire set of signers. * * WARNING: Depending on the `start` and `end`, this operation can copy a large amount of data to memory, which * can be expensive. This is designed for view accessors queried without gas fees. Using it in state-changing * functions may become uncallable if the slice grows too large. */ - function getSigners(uint256 start, uint256 end) public view virtual returns (bytes[] memory) { + function getSigners(uint64 start, uint64 end) public view virtual returns (bytes[] memory) { return _signers.values(start, end); } @@ -92,7 +90,7 @@ abstract contract MultiSignerERC7913 is AbstractSigner { } /// @dev Returns the minimum number of signers required to approve a multisignature operation. - function threshold() public view virtual returns (uint256) { + function threshold() public view virtual returns (uint64) { return _threshold; } @@ -139,8 +137,8 @@ abstract contract MultiSignerERC7913 is AbstractSigner { * * * See {_validateReachableThreshold} for the threshold validation. */ - function _setThreshold(uint256 newThreshold) internal virtual { - _threshold = newThreshold.toUint128(); + function _setThreshold(uint64 newThreshold) internal virtual { + _threshold = newThreshold; _validateReachableThreshold(); emit ERC7913ThresholdSet(newThreshold); } @@ -153,8 +151,8 @@ abstract contract MultiSignerERC7913 is AbstractSigner { * * The {signers}'s length must be `>=` to the {threshold}. Throws {MultiSignerERC7913UnreachableThreshold} if not. */ function _validateReachableThreshold() internal view virtual { - uint256 totalSigners = _signers.length(); - uint256 currentThreshold = threshold(); + uint64 totalSigners = uint64(_signers.length()); // Safe cast. Extremely costly to overflow. + uint64 currentThreshold = threshold(); require( totalSigners >= currentThreshold, MultiSignerERC7913UnreachableThreshold(totalSigners, currentThreshold) diff --git a/test/account/AccountMultiSigner.test.js b/test/account/AccountMultiSigner.test.js index ffc89ff471c..29badb26b47 100644 --- a/test/account/AccountMultiSigner.test.js +++ b/test/account/AccountMultiSigner.test.js @@ -5,6 +5,7 @@ const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); const { getDomain } = require('../helpers/eip712'); const { ERC4337Helper } = require('../helpers/erc4337'); const { NonNativeSigner, P256SigningKey, RSASHA256SigningKey, MultiERC7913SigningKey } = require('../helpers/signers'); +const { MAX_UINT64 } = require('../helpers/constants'); const { shouldBehaveLikeAccountCore, shouldBehaveLikeAccountHolder } = require('./Account.behavior'); const { shouldBehaveLikeERC1271 } = require('../utils/cryptography/ERC1271.behavior'); @@ -133,11 +134,11 @@ describe('AccountMultiSigner', function () { const signers = [signerECDSA3.address]; // Successfully adds a signer - const signersArrayBefore = await this.mock.getSigners(0, ethers.MaxUint256).then(s => s.map(ethers.getAddress)); + const signersArrayBefore = await this.mock.getSigners(0, MAX_UINT64).then(s => s.map(ethers.getAddress)); await expect(this.mock.$_addSigners(signers)) .to.emit(this.mock, 'ERC7913SignerAdded') .withArgs(signerECDSA3.address); - const signersArrayAfter = await this.mock.getSigners(0, ethers.MaxUint256).then(s => s.map(ethers.getAddress)); + const signersArrayAfter = await this.mock.getSigners(0, MAX_UINT64).then(s => s.map(ethers.getAddress)); expect(signersArrayAfter.length).to.equal(signersArrayBefore.length + 1); expect(signersArrayAfter).to.include(ethers.getAddress(signerECDSA3.address)); @@ -151,11 +152,11 @@ describe('AccountMultiSigner', function () { const signers = [signerECDSA2.address]; // Successfully removes an already added signer - const signersArrayBefore = await this.mock.getSigners(0, ethers.MaxUint256).then(s => s.map(ethers.getAddress)); + const signersArrayBefore = await this.mock.getSigners(0, MAX_UINT64).then(s => s.map(ethers.getAddress)); await expect(this.mock.$_removeSigners(signers)) .to.emit(this.mock, 'ERC7913SignerRemoved') .withArgs(signerECDSA2.address); - const signersArrayAfter = await this.mock.getSigners(0, ethers.MaxUint256).then(s => s.map(ethers.getAddress)); + const signersArrayAfter = await this.mock.getSigners(0, MAX_UINT64).then(s => s.map(ethers.getAddress)); expect(signersArrayAfter.length).to.equal(signersArrayBefore.length - 1); expect(signersArrayAfter).to.not.include(ethers.getAddress(signerECDSA2.address)); @@ -191,7 +192,7 @@ describe('AccountMultiSigner', function () { it('can read signers and threshold', async function () { await expect( - this.mock.getSigners(0, ethers.MaxUint256).then(s => s.map(ethers.getAddress)), + this.mock.getSigners(0, MAX_UINT64).then(s => s.map(ethers.getAddress)), ).to.eventually.have.deep.members([signerECDSA1.address, signerECDSA2.address]); await expect(this.mock.threshold()).to.eventually.equal(1); From d918e5971c2b6ec04dce7ba25450b1667a300b51 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Wed, 4 Jun 2025 19:58:15 -0600 Subject: [PATCH 102/110] Add totalSigners function --- .../utils/cryptography/signers/MultiSignerERC7913.sol | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol index 4bd8d280a14..13afc3274d3 100644 --- a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol @@ -71,6 +71,11 @@ abstract contract MultiSignerERC7913 is AbstractSigner { /// @dev The `threshold` is unreachable given the number of `signers`. error MultiSignerERC7913UnreachableThreshold(uint64 signers, uint64 threshold); + /// @dev Returns the total number of signers. + function totalSigners() public view virtual returns (uint64) { + return uint64(_signers.length()); // Safe cast. Extremely costly to overflow. + } + /** * @dev Returns a slice of the set of authorized signers. * @@ -151,11 +156,11 @@ abstract contract MultiSignerERC7913 is AbstractSigner { * * The {signers}'s length must be `>=` to the {threshold}. Throws {MultiSignerERC7913UnreachableThreshold} if not. */ function _validateReachableThreshold() internal view virtual { - uint64 totalSigners = uint64(_signers.length()); // Safe cast. Extremely costly to overflow. + uint64 signersLength = totalSigners(); uint64 currentThreshold = threshold(); require( - totalSigners >= currentThreshold, - MultiSignerERC7913UnreachableThreshold(totalSigners, currentThreshold) + signersLength >= currentThreshold, + MultiSignerERC7913UnreachableThreshold(signersLength, currentThreshold) ); } From 2bee2c42c314ca61ae4e22657181ca98d8fd77b1 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 5 Jun 2025 09:25:46 +0200 Subject: [PATCH 103/110] Update contracts/utils/cryptography/signers/MultiSignerERC7913.sol --- contracts/utils/cryptography/signers/MultiSignerERC7913.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol index 13afc3274d3..74f89e44c6f 100644 --- a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol @@ -12,7 +12,7 @@ import {EnumerableSet} from "../../structs/EnumerableSet.sol"; * * This contract allows managing a set of authorized signers and requires a minimum number of * signatures (threshold) to approve operations. It uses ERC-7913 formatted signers, which - * concatenate a verifier address and a key: `verifier || key`. + * makes it nativelly compatible with ECDSA and ERC-1271 signers. * * Example of usage: * From 7977301482ae9b6137d2f2550a8c3e46acb8d59c Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 5 Jun 2025 14:18:02 +0200 Subject: [PATCH 104/110] Apply suggestions from code review --- .../utils/cryptography/signers/MultiSignerERC7913.sol | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol index 74f89e44c6f..4db0addf471 100644 --- a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol @@ -12,7 +12,7 @@ import {EnumerableSet} from "../../structs/EnumerableSet.sol"; * * This contract allows managing a set of authorized signers and requires a minimum number of * signatures (threshold) to approve operations. It uses ERC-7913 formatted signers, which - * makes it nativelly compatible with ECDSA and ERC-1271 signers. + * makes it natively compatible with ECDSA and ERC-1271 signers. * * Example of usage: * @@ -210,9 +210,8 @@ abstract contract MultiSignerERC7913 is AbstractSigner { * @dev Validates the signatures using the signers and their corresponding signatures. * Returns whether whether the signers are authorized and the signatures are valid for the given hash. * - * IMPORTANT: For simplicity, this contract assumes that the signers are ordered by their `keccak256` hash - * to avoid duplication when iterating through the signers (i.e. `keccak256(signer1) < keccak256(signer2)`). - * The function will return false if the signers are not ordered. + * IMPORTANT: Sorting the signers by their `keccak256` hash will improve the gas efficiency of this function. + * See {SignatureChecker-areValidERC7913SignaturesNow} for more details. * * Requirements: * From 781644bf71defae18c7a8c0724c7921dfb9111e6 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 5 Jun 2025 14:24:45 +0200 Subject: [PATCH 105/110] remove weights from MultiERC7913SigningKey --- test/helpers/signers.js | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/test/helpers/signers.js b/test/helpers/signers.js index d4ae859228c..baa8b066627 100644 --- a/test/helpers/signers.js +++ b/test/helpers/signers.js @@ -19,8 +19,6 @@ const { const { secp256r1 } = require('@noble/curves/p256'); const { generateKeyPairSync, privateEncrypt } = require('crypto'); -const { zip } = require('./iterate'); - // Lightweight version of BaseWallet class NonNativeSigner extends AbstractSigner { #signingKey; @@ -152,7 +150,7 @@ class MultiERC7913SigningKey { // this is a sorted array of objects that contain {signer, weight} #signers; - constructor(signers, weights = undefined) { + constructor(signers) { assertArgument( Array.isArray(signers) && signers.length > 0, 'signers must be a non-empty array', @@ -160,25 +158,12 @@ class MultiERC7913SigningKey { signers.length, ); - assertArgument( - weights === undefined || (Array.isArray(weights) && weights.length === signers.length), - 'weights must be an array with the same length as signers', - 'weights', - weights?.length, - ); - // Sorting is done at construction so that it doesn't have to be done in sign() - this.#signers = zip(signers, weights ?? []) - .sort(([s1], [s2]) => keccak256(s1.bytes ?? s1.address) - keccak256(s2.bytes ?? s2.address)) - .map(([signer, weight = 1]) => ({ signer, weight })); + this.#signers = signers.sort((s1, s2) => keccak256(s1.bytes ?? s1.address) - keccak256(s2.bytes ?? s2.address)); } get signers() { - return this.#signers.map(({ signer }) => signer); - } - - get weights() { - return this.#signers.map(({ weight }) => weight); + return this.#signers; } sign(digest /*: BytesLike*/ /*: Signature*/) { @@ -188,8 +173,8 @@ class MultiERC7913SigningKey { serialized: AbiCoder.defaultAbiCoder().encode( ['bytes[]', 'bytes[]'], [ - this.#signers.map(({ signer }) => signer.bytes ?? signer.address), - this.#signers.map(({ signer }) => signer.signingKey.sign(digest).serialized), + this.#signers.map(signer => signer.bytes ?? signer.address), + this.#signers.map(signer => signer.signingKey.sign(digest).serialized), ], ), }; From 2855e50835cc47a8030028fca661b48d34233e0c Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 5 Jun 2025 14:40:59 +0200 Subject: [PATCH 106/110] test style consistency --- .../cryptography/SignatureChecker.test.js | 192 ++++++++++-------- 1 file changed, 109 insertions(+), 83 deletions(-) diff --git a/test/utils/cryptography/SignatureChecker.test.js b/test/utils/cryptography/SignatureChecker.test.js index 447ae4739c1..e767adfa844 100644 --- a/test/utils/cryptography/SignatureChecker.test.js +++ b/test/utils/cryptography/SignatureChecker.test.js @@ -129,104 +129,101 @@ describe('SignatureChecker (ERC1271)', function () { describe('with ERC-7913 verifier', function () { it('with matching signer and signature', async function () { + const signer = ethers.concat([ + this.verifier.target, + aliceP256.signingKey.publicKey.qx, + aliceP256.signingKey.publicKey.qy, + ]); const signature = await aliceP256.signMessage(TEST_MESSAGE); - await expect( - this.mock.$isValidERC7913SignatureNow( - ethers.concat([ - this.verifier.target, - aliceP256.signingKey.publicKey.qx, - aliceP256.signingKey.publicKey.qy, - ]), - TEST_MESSAGE_HASH, - signature, - ), - ).to.eventually.be.true; + + await expect(this.mock.$isValidERC7913SignatureNow(signer, TEST_MESSAGE_HASH, signature)).to.eventually.be + .true; }); it('with invalid verifier', async function () { - const signature = await aliceP256.signMessage(TEST_MESSAGE); - const invalidVerifierSigner = ethers.concat([ - this.mock.target, + const signer = ethers.concat([ + this.mock.target, // invalid verifier aliceP256.signingKey.publicKey.qx, aliceP256.signingKey.publicKey.qy, ]); - await expect(this.mock.$isValidERC7913SignatureNow(invalidVerifierSigner, TEST_MESSAGE_HASH, signature)).to - .eventually.be.false; + const signature = await aliceP256.signMessage(TEST_MESSAGE); + + await expect(this.mock.$isValidERC7913SignatureNow(signer, TEST_MESSAGE_HASH, signature)).to.eventually.be + .false; }); it('with invalid key', async function () { + const signer = ethers.concat([this.verifier.target, ethers.randomBytes(32)]); const signature = await aliceP256.signMessage(TEST_MESSAGE); - await expect( - this.mock.$isValidERC7913SignatureNow( - ethers.concat([this.verifier.target, ethers.randomBytes(32)]), - TEST_MESSAGE_HASH, - signature, - ), - ).to.eventually.be.false; + + await expect(this.mock.$isValidERC7913SignatureNow(signer, TEST_MESSAGE_HASH, signature)).to.eventually.be + .false; }); it('with invalid signature', async function () { - await expect( - this.mock.$isValidERC7913SignatureNow( - ethers.concat([ - this.verifier.target, - aliceP256.signingKey.publicKey.qx, - aliceP256.signingKey.publicKey.qy, - ]), - TEST_MESSAGE_HASH, - ethers.randomBytes(65), - ), - ).to.eventually.be.false; + const signer = ethers.concat([ + this.verifier.target, + aliceP256.signingKey.publicKey.qx, + aliceP256.signingKey.publicKey.qy, + ]); + const signature = ethers.randomBytes(65); // invalid (random) signature + + await expect(this.mock.$isValidERC7913SignatureNow(signer, TEST_MESSAGE_HASH, signature)).to.eventually.be + .false; }); it('with signer too short', async function () { - const shortSigner = ethers.randomBytes(19); + const signer = ethers.randomBytes(19); // too short const signature = await aliceP256.signMessage(TEST_MESSAGE); - await expect(this.mock.$isValidERC7913SignatureNow(shortSigner, TEST_MESSAGE_HASH, signature)).to.eventually - .be.false; + await expect(this.mock.$isValidERC7913SignatureNow(signer, TEST_MESSAGE_HASH, signature)).to.eventually.be + .false; }); }); }); describe('areValidERC7913SignaturesNow', function () { + const sortSigners = (...signers) => + signers.sort(({ signer: a }, { signer: b }) => ethers.keccak256(b) - ethers.keccak256(a)); + it('should validate a single signature', async function () { + const signer = ethers.zeroPadValue(this.signer.address, 20); const signature = await this.signer.signMessage(TEST_MESSAGE); - await expect( - this.mock.$areValidERC7913SignaturesNow( - TEST_MESSAGE_HASH, - [ethers.zeroPadValue(this.signer.address, 20)], - [signature], - ), - ).to.eventually.be.true; + + await expect(this.mock.$areValidERC7913SignaturesNow(TEST_MESSAGE_HASH, [signer], [signature])).to.eventually.be + .true; }); it('should validate multiple signatures with different signer types', async function () { - const signature = await this.signer.signMessage(TEST_MESSAGE); - const aliceSignature = await aliceP256.signMessage(TEST_MESSAGE); - const pairs = [ - { signer: ethers.zeroPadValue(this.signer.address, 20), signature }, - { signer: ethers.zeroPadValue(this.wallet.target, 20), signature }, + const signers = sortSigners( + { + signer: ethers.zeroPadValue(this.signer.address, 20), + signature: await this.signer.signMessage(TEST_MESSAGE), + }, + { + signer: ethers.zeroPadValue(this.wallet.target, 20), + signature: await this.signer.signMessage(TEST_MESSAGE), + }, { signer: ethers.concat([ this.verifier.target, aliceP256.signingKey.publicKey.qx, aliceP256.signingKey.publicKey.qy, ]), - signature: aliceSignature, + signature: await aliceP256.signMessage(TEST_MESSAGE), }, - ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(a) - ethers.keccak256(b)); + ); await expect( this.mock.$areValidERC7913SignaturesNow( TEST_MESSAGE_HASH, - pairs.map(({ signer }) => signer), - pairs.map(({ signature }) => signature), + signers.map(({ signer }) => signer), + signers.map(({ signature }) => signature), ), ).to.eventually.be.true; }); it('should validate multiple EOA signatures', async function () { - const pairs = [ + const signers = sortSigners( { signer: ethers.zeroPadValue(this.signer.address, 20), signature: await this.signer.signMessage(TEST_MESSAGE), @@ -235,19 +232,19 @@ describe('SignatureChecker (ERC1271)', function () { signer: ethers.zeroPadValue(this.extraSigner.address, 20), signature: await this.extraSigner.signMessage(TEST_MESSAGE), }, - ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(a) - ethers.keccak256(b)); + ); await expect( this.mock.$areValidERC7913SignaturesNow( TEST_MESSAGE_HASH, - pairs.map(({ signer }) => signer), - pairs.map(({ signature }) => signature), + signers.map(({ signer }) => signer), + signers.map(({ signature }) => signature), ), ).to.eventually.be.true; }); it('should validate multiple ERC-1271 wallet signatures', async function () { - const pairs = [ + const signers = sortSigners( { signer: ethers.zeroPadValue(this.wallet.target, 20), signature: await this.signer.signMessage(TEST_MESSAGE), @@ -256,28 +253,26 @@ describe('SignatureChecker (ERC1271)', function () { signer: ethers.zeroPadValue(this.wallet2.target, 20), signature: await this.extraSigner.signMessage(TEST_MESSAGE), }, - ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(a) - ethers.keccak256(b)); + ); await expect( this.mock.$areValidERC7913SignaturesNow( TEST_MESSAGE_HASH, - pairs.map(({ signer }) => signer), - pairs.map(({ signature }) => signature), + signers.map(({ signer }) => signer), + signers.map(({ signature }) => signature), ), ).to.eventually.be.true; }); it('should validate multiple ERC-7913 signatures (ordered by ID)', async function () { - const aliceSignature = await aliceP256.signMessage(TEST_MESSAGE); - const bobSignature = await bobP256.signMessage(TEST_MESSAGE); - const pairs = [ + const signers = sortSigners( { signer: ethers.concat([ this.verifier.target, aliceP256.signingKey.publicKey.qx, aliceP256.signingKey.publicKey.qy, ]), - signature: aliceSignature, + signature: await aliceP256.signMessage(TEST_MESSAGE), }, { signer: ethers.concat([ @@ -285,30 +280,28 @@ describe('SignatureChecker (ERC1271)', function () { bobP256.signingKey.publicKey.qx, bobP256.signingKey.publicKey.qy, ]), - signature: bobSignature, + signature: await bobP256.signMessage(TEST_MESSAGE), }, - ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(a) - ethers.keccak256(b)); + ); await expect( this.mock.$areValidERC7913SignaturesNow( TEST_MESSAGE_HASH, - pairs.map(({ signer }) => signer), - pairs.map(({ signature }) => signature), + signers.map(({ signer }) => signer), + signers.map(({ signature }) => signature), ), ).to.eventually.be.true; }); it('should validate multiple ERC-7913 signatures (unordered)', async function () { - const aliceSignature = await aliceP256.signMessage(TEST_MESSAGE); - const bobSignature = await bobP256.signMessage(TEST_MESSAGE); - const pairs = [ + const signers = sortSigners( { signer: ethers.concat([ this.verifier.target, aliceP256.signingKey.publicKey.qx, aliceP256.signingKey.publicKey.qy, ]), - signature: aliceSignature, + signature: await aliceP256.signMessage(TEST_MESSAGE), }, { signer: ethers.concat([ @@ -316,45 +309,78 @@ describe('SignatureChecker (ERC1271)', function () { bobP256.signingKey.publicKey.qx, bobP256.signingKey.publicKey.qy, ]), - signature: bobSignature, + signature: await bobP256.signMessage(TEST_MESSAGE), }, - ].sort(({ signer: a }, { signer: b }) => ethers.keccak256(b) - ethers.keccak256(a)); // reverse + ).reverse(); // reverse await expect( this.mock.$areValidERC7913SignaturesNow( TEST_MESSAGE_HASH, - pairs.map(({ signer }) => signer), - pairs.map(({ signature }) => signature), + signers.map(({ signer }) => signer), + signers.map(({ signature }) => signature), ), ).to.eventually.be.true; }); it('should return false if any signature is invalid', async function () { + const signers = sortSigners( + { + signer: ethers.zeroPadValue(this.signer.address, 20), + signature: await this.signer.signMessage(TEST_MESSAGE), + }, + { + signer: ethers.zeroPadValue(this.extraSigner.address, 20), + signature: await this.extraSigner.signMessage(WRONG_MESSAGE), + }, + ); + await expect( this.mock.$areValidERC7913SignaturesNow( TEST_MESSAGE_HASH, - [ethers.zeroPadValue(this.signer.address, 20), await this.extraSigner.signMessage(TEST_MESSAGE)], - [await this.signer.signMessage(TEST_MESSAGE), await this.signer.signMessage(WRONG_MESSAGE)], + signers.map(({ signer }) => signer), + signers.map(({ signature }) => signature), ), ).to.eventually.be.false; }); it('should return false if there are duplicate signers', async function () { + const signers = sortSigners( + { + signer: ethers.zeroPadValue(this.signer.address, 20), + signature: await this.signer.signMessage(TEST_MESSAGE), + }, + { + signer: ethers.zeroPadValue(this.signer.address, 20), + signature: await this.signer.signMessage(TEST_MESSAGE), + }, + ); + await expect( this.mock.$areValidERC7913SignaturesNow( TEST_MESSAGE_HASH, - [ethers.zeroPadValue(this.signer.address, 20), ethers.zeroPadValue(this.signer.address, 20)], // Same signer used twice - [await this.signer.signMessage(TEST_MESSAGE), await this.signer.signMessage(TEST_MESSAGE)], + signers.map(({ signer }) => signer), + signers.map(({ signature }) => signature), ), ).to.eventually.be.false; }); it('should return false if signatures array length does not match signers array length', async function () { + const signers = sortSigners( + { + signer: ethers.zeroPadValue(this.signer.address, 20), + signature: await this.signer.signMessage(TEST_MESSAGE), + }, + { + signer: ethers.zeroPadValue(this.extraSigner.address, 20), + signature: await this.extraSigner.signMessage(TEST_MESSAGE), + }, + ); + await expect( this.mock.$areValidERC7913SignaturesNow( TEST_MESSAGE_HASH, - [ethers.zeroPadValue(this.signer.address, 20), await this.extraSigner.signMessage(TEST_MESSAGE)], - [await this.signer.signMessage(TEST_MESSAGE)], // Missing one signature + signers.map(({ signer }) => signer), + signers.map(({ signature }) => signature).slice(1), ), ).to.eventually.be.false; }); From 395c67a713217dacc262f3ff7b1e58cc442e3ee7 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 5 Jun 2025 08:59:24 -0600 Subject: [PATCH 107/110] Suggestions --- .../utils/cryptography/signers/MultiSignerERC7913.sol | 7 +------ docs/modules/ROOT/pages/utilities.adoc | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol index 4db0addf471..21580fad7f8 100644 --- a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol @@ -71,11 +71,6 @@ abstract contract MultiSignerERC7913 is AbstractSigner { /// @dev The `threshold` is unreachable given the number of `signers`. error MultiSignerERC7913UnreachableThreshold(uint64 signers, uint64 threshold); - /// @dev Returns the total number of signers. - function totalSigners() public view virtual returns (uint64) { - return uint64(_signers.length()); // Safe cast. Extremely costly to overflow. - } - /** * @dev Returns a slice of the set of authorized signers. * @@ -156,7 +151,7 @@ abstract contract MultiSignerERC7913 is AbstractSigner { * * The {signers}'s length must be `>=` to the {threshold}. Throws {MultiSignerERC7913UnreachableThreshold} if not. */ function _validateReachableThreshold() internal view virtual { - uint64 signersLength = totalSigners(); + uint64 signersLength = uint64(_signers.length()); // Safe cast. Economically impossible to overflow. uint64 currentThreshold = threshold(); require( signersLength >= currentThreshold, diff --git a/docs/modules/ROOT/pages/utilities.adoc b/docs/modules/ROOT/pages/utilities.adoc index 7a95d551de6..e051f1b9e86 100644 --- a/docs/modules/ROOT/pages/utilities.adoc +++ b/docs/modules/ROOT/pages/utilities.adoc @@ -167,7 +167,7 @@ function _verifyMultipleSignatures( } ---- -The signers must be ordered by their `keccak256` hash to ensure no duplicates and optimize verification. +This function will reject inputs that contain duplicated signers. Sorting the signers by their `keccak256` hash is recommanded to minimize the gas cost. This unified approach allows smart contracts to accept signatures from any supported source without needing to implement different verification logic for each type. From a6bff02f17b2ed1f0548696f90bc321420b9e6a1 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 5 Jun 2025 09:01:15 -0600 Subject: [PATCH 108/110] up --- docs/modules/ROOT/pages/utilities.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/utilities.adoc b/docs/modules/ROOT/pages/utilities.adoc index e051f1b9e86..66a9490fe3d 100644 --- a/docs/modules/ROOT/pages/utilities.adoc +++ b/docs/modules/ROOT/pages/utilities.adoc @@ -167,7 +167,7 @@ function _verifyMultipleSignatures( } ---- -This function will reject inputs that contain duplicated signers. Sorting the signers by their `keccak256` hash is recommanded to minimize the gas cost. +This function will reject inputs that contain duplicated signers. Sorting the signers by their `keccak256` hash is recommended to minimize the gas cost. This unified approach allows smart contracts to accept signatures from any supported source without needing to implement different verification logic for each type. From 92e4fc7a8b929955298858475d34c112bd832ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Garc=C3=ADa?= Date: Thu, 5 Jun 2025 09:05:54 -0600 Subject: [PATCH 109/110] Update contracts/utils/cryptography/signers/MultiSignerERC7913.sol Co-authored-by: Hadrien Croubois --- contracts/utils/cryptography/signers/MultiSignerERC7913.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol index 21580fad7f8..f19b3ec3de6 100644 --- a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol @@ -151,7 +151,7 @@ abstract contract MultiSignerERC7913 is AbstractSigner { * * The {signers}'s length must be `>=` to the {threshold}. Throws {MultiSignerERC7913UnreachableThreshold} if not. */ function _validateReachableThreshold() internal view virtual { - uint64 signersLength = uint64(_signers.length()); // Safe cast. Economically impossible to overflow. + uint256 signersLength = _signers.length(); uint64 currentThreshold = threshold(); require( signersLength >= currentThreshold, From 7c9082fefa0f99de11895caba6b8f24fda8898c3 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 5 Jun 2025 09:08:37 -0600 Subject: [PATCH 110/110] Fix compilation --- contracts/utils/cryptography/signers/MultiSignerERC7913.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol index f19b3ec3de6..a23c82dcb2b 100644 --- a/contracts/utils/cryptography/signers/MultiSignerERC7913.sol +++ b/contracts/utils/cryptography/signers/MultiSignerERC7913.sol @@ -155,7 +155,10 @@ abstract contract MultiSignerERC7913 is AbstractSigner { uint64 currentThreshold = threshold(); require( signersLength >= currentThreshold, - MultiSignerERC7913UnreachableThreshold(signersLength, currentThreshold) + MultiSignerERC7913UnreachableThreshold( + uint64(signersLength), // Safe cast. Economically impossible to overflow. + currentThreshold + ) ); }