From bcf49561045b643cf44772bec81edff94e5e383a Mon Sep 17 00:00:00 2001 From: aboudjem Date: Mon, 11 Sep 2023 19:28:39 +0700 Subject: [PATCH 01/17] =?UTF-8?q?=F0=9F=8E=A8=20add=20=5F=20to=20internal?= =?UTF-8?q?=20execute=20func?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contracts/smart-account/base/Executor.sol | 2 +- contracts/smart-account/base/ModuleManager.sol | 4 ++-- contracts/smart-account/test/upgrades/ModuleManagerNew.sol | 4 ++-- contracts/smart-account/test/upgrades/v1/ModuleManagerV1.sol | 4 ++-- contracts/smart-account/test/upgrades/v1/SmartAccountV1.sol | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contracts/smart-account/base/Executor.sol b/contracts/smart-account/base/Executor.sol index 72f1e759..c4abc949 100644 --- a/contracts/smart-account/base/Executor.sol +++ b/contracts/smart-account/base/Executor.sol @@ -21,7 +21,7 @@ abstract contract Executor { uint256 txGas ); - function execute( + function _execute( address to, uint256 value, bytes memory data, diff --git a/contracts/smart-account/base/ModuleManager.sol b/contracts/smart-account/base/ModuleManager.sol index 2dc105f5..adb795bd 100644 --- a/contracts/smart-account/base/ModuleManager.sol +++ b/contracts/smart-account/base/ModuleManager.sol @@ -100,7 +100,7 @@ abstract contract ModuleManager is ) revert ModuleNotEnabled(msg.sender); // Execute transaction without further confirmations. // Can add guards here to allow delegatecalls for selected modules (msg.senders) only - success = execute( + success = _execute( to, value, data, @@ -266,7 +266,7 @@ abstract contract ModuleManager is bytes memory data, Enum.Operation operation ) internal returns (bool success) { - success = execute(to, value, data, operation, gasleft()); + success = _execute(to, value, data, operation, gasleft()); if (success) { emit ModuleTransaction(msg.sender, to, value, data, operation); emit ExecutionFromModuleSuccess(msg.sender); diff --git a/contracts/smart-account/test/upgrades/ModuleManagerNew.sol b/contracts/smart-account/test/upgrades/ModuleManagerNew.sol index d79a6a18..ca19f800 100644 --- a/contracts/smart-account/test/upgrades/ModuleManagerNew.sol +++ b/contracts/smart-account/test/upgrades/ModuleManagerNew.sol @@ -25,7 +25,7 @@ contract ModuleManagerNew is SelfAuthorized, Executor { if (to != address(0)) // Setup has to complete successfully or transaction fails. require( - execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), + _execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), "BSA000" ); } @@ -80,7 +80,7 @@ contract ModuleManagerNew is SelfAuthorized, Executor { "BSA104" ); // Execute transaction without further confirmations. - success = execute(to, value, data, operation, gasleft()); + success = _execute(to, value, data, operation, gasleft()); if (success) emit ExecutionFromModuleSuccess(msg.sender); else emit ExecutionFromModuleFailure(msg.sender); } diff --git a/contracts/smart-account/test/upgrades/v1/ModuleManagerV1.sol b/contracts/smart-account/test/upgrades/v1/ModuleManagerV1.sol index 83f850f7..df2c6010 100644 --- a/contracts/smart-account/test/upgrades/v1/ModuleManagerV1.sol +++ b/contracts/smart-account/test/upgrades/v1/ModuleManagerV1.sol @@ -121,7 +121,7 @@ contract ModuleManagerV1 is SelfAuthorized, Executor, ModuleManagerErrorsV1 { msg.sender == SENTINEL_MODULES || _modules[msg.sender] == address(0) ) revert ModuleNotEnabled(msg.sender); // Execute transaction without further confirmations. - success = execute(to, value, data, operation, gasleft()); + success = _execute(to, value, data, operation, gasleft()); if (success) { emit ModuleTransaction(msg.sender, to, value, data, operation); emit ExecutionFromModuleSuccess(msg.sender); @@ -177,7 +177,7 @@ contract ModuleManagerV1 is SelfAuthorized, Executor, ModuleManagerErrorsV1 { revert ModulesAlreadyInitialized(); _modules[SENTINEL_MODULES] = SENTINEL_MODULES; if (to != address(0)) - if (!execute(to, 0, data, Enum.Operation.DelegateCall, gasleft())) + if (!_execute(to, 0, data, Enum.Operation.DelegateCall, gasleft())) // Setup has to complete successfully or transaction fails. revert ModulesSetupExecutionFailed(); } diff --git a/contracts/smart-account/test/upgrades/v1/SmartAccountV1.sol b/contracts/smart-account/test/upgrades/v1/SmartAccountV1.sol index 1b0af363..76074f62 100644 --- a/contracts/smart-account/test/upgrades/v1/SmartAccountV1.sol +++ b/contracts/smart-account/test/upgrades/v1/SmartAccountV1.sol @@ -268,7 +268,7 @@ contract SmartAccountV1 is { // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than targetTxGas) // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than targetTxGas - success = execute( + success = _execute( _tx.to, _tx.value, _tx.data, @@ -486,7 +486,7 @@ contract SmartAccountV1 is ) external returns (uint256) { uint256 startGas = gasleft(); // We don't provide an error message here, as we use it to return the estimate - if (!execute(to, value, data, operation, gasleft())) + if (!_execute(to, value, data, operation, gasleft())) revert ExecutionFailed(); // Convert response to string and return via error message unchecked { From 34232c5a827d9259ab275f9437ad6da18eb4ee07 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Mon, 11 Sep 2023 21:48:11 +0700 Subject: [PATCH 02/17] =?UTF-8?q?=F0=9F=94=A5=20fix=20length=20on=20natspe?= =?UTF-8?q?c=20to=20fit=20120?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contracts/smart-account/BaseSmartAccount.sol | 13 +++-- .../smart-account/base/ModuleManager.sol | 3 +- contracts/smart-account/deployer/Create3.sol | 22 ++++---- .../estimation/SmartAccountNoAuth.sol | 12 ++--- .../factory/SmartAccountFactory.sol | 3 +- .../interfaces/IERC1155TokenReceiver.sol | 53 ++++++++++--------- .../smart-account/interfaces/IERC165.sol | 10 +++- .../modules/EcdsaOwnershipRegistryModule.sol | 3 +- .../modules/ForwardFlowModule.sol | 21 ++++---- .../paymasters/BasePaymaster.sol | 1 - .../singleton/VerifyingSingletonPaymaster.sol | 27 +++++----- 11 files changed, 89 insertions(+), 79 deletions(-) diff --git a/contracts/smart-account/BaseSmartAccount.sol b/contracts/smart-account/BaseSmartAccount.sol index af4eaa4b..0e9d410b 100644 --- a/contracts/smart-account/BaseSmartAccount.sol +++ b/contracts/smart-account/BaseSmartAccount.sol @@ -24,12 +24,11 @@ abstract contract BaseSmartAccount is IAccount, BaseSmartAccountErrors { uint256 internal constant SIG_VALIDATION_FAILED = 1; /** - * @dev Initialize the Smart Account with required states - * @param handler Default fallback handler provided in Smart Account - * @param moduleSetupContract Contract, that setups initial auth module for this smart account. It can be a module factory or - * a registry module that serves several smart accounts. - * @param moduleSetupData data containing address of the Setup Contract and a setup data - * @notice devs need to make sure it is only callable once (use initializer modifier or state check restrictions) + * @dev Initialize the Smart Account with required states. + * @param handler Default fallback handler for the Smart Account. + * @param moduleSetupContract Initializes the auth module; can be a factory or registry for multiple accounts. + * @param moduleSetupData Contains address of the Setup Contract and setup data. + * @notice Ensure this is callable only once (use initializer modifier or state checks). */ function init( address handler, @@ -48,7 +47,7 @@ abstract contract BaseSmartAccount is IAccount, BaseSmartAccountErrors { * otherwise, an address of an "authorizer" contract. * <6-byte> validUntil - last timestamp this operation is valid. 0 for "indefinite" * <6-byte> validAfter - first timestamp this operation is valid - * If the account doesn't use time-range, it is enough to return SIG_VALIDATION_FAILED value (1) for signature failure. + * If no time-range in account, return SIG_VALIDATION_FAILED (1) for signature failure. * Note that the validation code cannot use block.timestamp (or block.number) directly. */ function validateUserOp( diff --git a/contracts/smart-account/base/ModuleManager.sol b/contracts/smart-account/base/ModuleManager.sol index adb795bd..4a139144 100644 --- a/contracts/smart-account/base/ModuleManager.sol +++ b/contracts/smart-account/base/ModuleManager.sol @@ -275,8 +275,7 @@ abstract contract ModuleManager is /** * @notice Setup function sets the initial storage of the contract. - * @param setupContract Contract, that setups initial auth module for this smart account. It can be a module factory or - * a registry module that serves several smart accounts + * @param setupContract initializing the auth module; can be a module factory or a registry for multiple accounts. * @param setupData modules setup data (a standard calldata for the module setup contract) */ function _initialSetupModules( diff --git a/contracts/smart-account/deployer/Create3.sol b/contracts/smart-account/deployer/Create3.sol index d46140f4..1bd089c1 100644 --- a/contracts/smart-account/deployer/Create3.sol +++ b/contracts/smart-account/deployer/Create3.sol @@ -8,8 +8,8 @@ pragma solidity 0.8.17; library Create3 { /** @notice The bytecode for a contract that proxies the creation of another contract - @dev If this code is deployed using CREATE2 it can be used to decouple `creationCode` from the child contract address - + @dev If deployed via CREATE2, decouple creationCode from child contract address. + 0x67363d3d37363d34f03d5260086018f3: 0x00 0x67 0x67XXXXXXXXXXXXXXXX PUSH8 bytecode 0x363d3d37363d34f0 0x01 0x3d 0x3d RETURNDATASIZE 0 0x363d3d37363d34f0 @@ -43,7 +43,7 @@ library Create3 { /** @notice Creates a new contract with given `_creationCode` and `_salt` @param _salt Salt of the contract creation, resulting address will be derivated from this value only - @param _creationCode Creation code (constructor) of the contract to be deployed, this value doesn't affect the resulting address +@param _creationCode Constructor code for contract to be deployed; it doesn't affect the resulting address. @return addr of the deployed contract, reverts on error */ function create3( @@ -56,7 +56,7 @@ library Create3 { /** @notice Creates a new contract with given `_creationCode` and `_salt` @param _salt Salt of the contract creation, resulting address will be derivated from this value only - @param _creationCode Creation code (constructor) of the contract to be deployed, this value doesn't affect the resulting address + @param _creationCode Constructor code for contract to be deployed; it doesn't affect the resulting address. @param _value In WEI of ETH to be forwarded to child contract @return addr of the deployed contract, reverts on error */ @@ -108,12 +108,14 @@ library Create3 { } /** - @notice Computes the resulting address of a contract deployed using address(this) and the given `_salt` - @param _salt Salt of the contract creation, resulting address will be derivated from this value only - @return addr of the deployed contract, reverts on error - - @dev The address creation formula is: keccak256(rlp([keccak256(0xff ++ address(this) ++ _salt ++ keccak256(childBytecode))[12:], 0x01])) - */ + * @notice Computes the resulting address of a contract deployed using address(this) and the given `_salt` + * + * @dev Address creation formula: + * keccak256(rlp([keccak256(0xff+address(this)+_salt+keccak256(childBytecode))[12:],0x01])) + * + * @param _salt Salt of the contract creation, resulting address will be derived from this value only + * @return addr of the deployed contract, reverts on error + */ function addressOf(bytes32 _salt) internal view returns (address) { address proxy = addressOfProxy(_salt); return diff --git a/contracts/smart-account/estimation/SmartAccountNoAuth.sol b/contracts/smart-account/estimation/SmartAccountNoAuth.sol index 9f3b93e6..333a8899 100644 --- a/contracts/smart-account/estimation/SmartAccountNoAuth.sol +++ b/contracts/smart-account/estimation/SmartAccountNoAuth.sol @@ -45,14 +45,13 @@ contract SmartAccountNoAuth is bytes32 internal constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218; - // keccak256( - // "AccountTx(address to,uint256 value,bytes data,uint8 operation,uint256 targetTxGas,uint256 baseGas,uint256 gasPrice,uint256 tokenGasPriceFactor,address gasToken,address refundReceiver,uint256 nonce)" - // ); + // solhint-disable-next-line + // keccak256("AccountTx(address to,uint256 value,bytes data,uint8 operation,uint256 targetTxGas,uint256 baseGas,uint256 gasPrice,uint256 tokenGasPriceFactor,address gasToken,address refundReceiver,uint256 nonce)"); bytes32 internal constant ACCOUNT_TX_TYPEHASH = 0xda033865d68bf4a40a5a7cb4159a99e33dba8569e65ea3e38222eb12d9e66eee; - // Owner storage. Deprecated. Left for storage layout compatibility - address public owner_deprecated; + // /!\ Owner storage. Deprecated. Left for storage layout compatibility /!\ + address public ownerDeprecated; // changed to 2D nonce below // @notice there is no _nonce @@ -187,8 +186,7 @@ contract SmartAccountNoAuth is /** * @dev Initialize the Smart Account with required states * @param handler Default fallback handler provided in Smart Account - * @param moduleSetupContract Contract, that setups initial auth module for this smart account. It can be a module factory or - * a registry module that serves several smart accounts + * @param moduleSetupContract Initializes the auth module; can be a factory or registry for multiple accounts. * @param moduleSetupData modules setup data (a standard calldata for the module setup contract) * @notice devs need to make sure it is only callble once by initiazer or state check restrictions * @notice any further implementations that introduces a new state must have a reinit method diff --git a/contracts/smart-account/factory/SmartAccountFactory.sol b/contracts/smart-account/factory/SmartAccountFactory.sol index 6614a184..644c795c 100644 --- a/contracts/smart-account/factory/SmartAccountFactory.sol +++ b/contracts/smart-account/factory/SmartAccountFactory.sol @@ -157,8 +157,7 @@ contract SmartAccountFactory is Stakeable { /** * @dev Allows to retrieve the initializer data for the account. - * @param moduleSetupContract Contract, that setups initial auth module for this smart account. It can be a module factory or - * a registry module that serves several smart accounts + * @param moduleSetupContract Initializes the auth module; can be a factory or registry for multiple accounts. * @param moduleSetupData modules setup data (a standard calldata for the module setup contract) * @return initializer bytes for init method */ diff --git a/contracts/smart-account/interfaces/IERC1155TokenReceiver.sol b/contracts/smart-account/interfaces/IERC1155TokenReceiver.sol index 379b52f5..9f15bc52 100644 --- a/contracts/smart-account/interfaces/IERC1155TokenReceiver.sol +++ b/contracts/smart-account/interfaces/IERC1155TokenReceiver.sol @@ -6,18 +6,20 @@ pragma solidity 0.8.17; */ interface IERC1155TokenReceiver { /** - @notice Handle the receipt of a single ERC1155 token type. - @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated. - This function MUST return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61) if it accepts the transfer. - This function MUST revert if it rejects the transfer. - Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller. - @param _operator The address which initiated the transfer (i.e. msg.sender) - @param _from The address which previously owned the token - @param _id The ID of the token being transferred - @param _value The amount of tokens being transferred - @param _data Additional data with no specified format - @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` - */ + * @dev Handles the receipt of a single ERC1155 token type. This function is + * called at the end of a `safeTransferFrom` after the balance has been updated. + * + * NOTE: To accept the transfer, this must return + * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` + * (i.e. 0xf23a6e61, or its own function selector). + * + * @param _operator The address which initiated the transfer (i.e. msg.sender) + * @param _from The address which previously owned the token + * @param _id The ID of the token being transferred + * @param _value The amount of tokens being transferred + * @param _data Additional data with no specified format + * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed + */ function onERC1155Received( address _operator, address _from, @@ -27,18 +29,21 @@ interface IERC1155TokenReceiver { ) external returns (bytes4); /** - @notice Handle the receipt of multiple ERC1155 token types. - @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated. - This function MUST return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81) if it accepts the transfer(s). - This function MUST revert if it rejects the transfer(s). - Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller. - @param _operator The address which initiated the batch transfer (i.e. msg.sender) - @param _from The address which previously owned the token - @param _ids An array containing ids of each token being transferred (order and length must match _values array) - @param _values An array containing amounts of each token being transferred (order and length must match _ids array) - @param _data Additional data with no specified format - @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` - */ + * @dev Handles the receipt of a multiple ERC1155 token types. This function + * is called at the end of a `safeBatchTransferFrom` after the balances have + * been updated. + * + * NOTE: To accept the transfer(s), this must return + * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` + * (i.e. 0xbc197c81, or its own function selector). + * + * @param _operator The address which initiated the batch transfer (i.e. msg.sender) + * @param _from The address which previously owned the token + * @param _ids An array containing ids of each token being transferred (order and length must match values array) + * @param _values An array containing amounts of each token being transferred (order and length must match ids array) + * @param _data Additional data with no specified format + * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if allowed + */ function onERC1155BatchReceived( address _operator, address _from, diff --git a/contracts/smart-account/interfaces/IERC165.sol b/contracts/smart-account/interfaces/IERC165.sol index 8229ed4c..7c875dbe 100644 --- a/contracts/smart-account/interfaces/IERC165.sol +++ b/contracts/smart-account/interfaces/IERC165.sol @@ -1,7 +1,15 @@ // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.17; -/// @notice More details at https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/IERC165.sol +/** + * @dev Interface of the ERC165 standard, as defined in the + * https://eips.ethereum.org/EIPS/eip-165[EIP]. + * + * Implementers can declare support of contract interfaces, which can then be + * queried by others ({ERC165Checker}). + * + * For an implementation, see {ERC165}. + */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by diff --git a/contracts/smart-account/modules/EcdsaOwnershipRegistryModule.sol b/contracts/smart-account/modules/EcdsaOwnershipRegistryModule.sol index 75f8a09c..49cfde77 100644 --- a/contracts/smart-account/modules/EcdsaOwnershipRegistryModule.sol +++ b/contracts/smart-account/modules/EcdsaOwnershipRegistryModule.sol @@ -10,7 +10,8 @@ import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; * - It allows to validate user operations signed by EOA private key. * - EIP-1271 compatible (ensures Smart Account can validate signed messages). * - One owner per Smart Account. - * - Does not support outdated eth_sign flow for cheaper validations (see https://support.metamask.io/hc/en-us/articles/14764161421467-What-is-eth-sign-and-why-is-it-a-risk-) + * - Does not support outdated eth_sign flow for cheaper validations + * (see https://support.metamask.io/hc/en-us/articles/14764161421467-What-is-eth-sign-and-why-is-it-a-risk-) * !!!!!!! Only EOA owners supported, no Smart Account Owners * For Smart Contract Owners check SmartContractOwnership module instead * @author Fil Makarov - diff --git a/contracts/smart-account/modules/ForwardFlowModule.sol b/contracts/smart-account/modules/ForwardFlowModule.sol index 8da3dab6..f2ef4de7 100644 --- a/contracts/smart-account/modules/ForwardFlowModule.sol +++ b/contracts/smart-account/modules/ForwardFlowModule.sol @@ -85,9 +85,8 @@ contract ForwardFlowModule is ReentrancyGuard, ISignatureValidatorConstants { bytes32 internal constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218; - // keccak256( - // "AccountTx(address to,uint256 value,bytes data,uint8 operation,uint256 targetTxGas,uint256 baseGas,uint256 gasPrice,uint256 tokenGasPriceFactor,address gasToken,address refundReceiver,uint256 nonce)" - // ); + // solhint-disable-next-line + // keccak256("AccountTx(address to,uint256 value,bytes data,uint8 operation,uint256 targetTxGas,uint256 baseGas,uint256 gasPrice,uint256 tokenGasPriceFactor,address gasToken,address refundReceiver,uint256 nonce)"); bytes32 internal constant ACCOUNT_TX_TYPEHASH = 0xda033865d68bf4a40a5a7cb4159a99e33dba8569e65ea3e38222eb12d9e66eee; @@ -103,7 +102,7 @@ contract ForwardFlowModule is ReentrancyGuard, ISignatureValidatorConstants { /** * @dev Allows to estimate a transaction. - * @notice This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data. + * @notice This method is for estimation only, it will always revert and encode the result in the revert data. * @notice Call this method to get an estimate of the handlePayment costs that are deducted with `execTransaction` * @param gasUsed Gas used by the transaction. * @param baseGas Gas costs that are independent of the transaction execution @@ -171,8 +170,8 @@ contract ForwardFlowModule is ReentrancyGuard, ISignatureValidatorConstants { /** * @dev Allows to estimate a transaction. - * This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data. - * Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the wallet with `execTransaction` + * This method is for estimation only, it will always revert and encode the result in the revert data. + * Call this method to get an estimate of the handlePayment costs that are deducted with `execTransaction` * @param to Destination address of the transaction. * @param value Ether value of transaction. * @param data Data payload of transaction. @@ -204,7 +203,7 @@ contract ForwardFlowModule is ReentrancyGuard, ISignatureValidatorConstants { /** * @dev Safe (ex-Gnosis) style transaction with optional repay in native tokens or ERC20 - * @dev Allows to execute a transaction confirmed by required signature/s and then pays the account that submitted the transaction. + * @dev Execute a transaction confirmed by required signature/s and then pays the account that submitted it. * @dev Function name optimized to have hash started with zeros to make this function calls cheaper * @notice The fees are always transferred, even if the user transaction fails. * @param _tx Smart Account transaction @@ -270,15 +269,17 @@ contract ForwardFlowModule is ReentrancyGuard, ISignatureValidatorConstants { _tx.operation, _tx.targetTxGas ); - // If no targetTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful - // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert + + // If targetTxGas and gasPrice are both 0, the internal tx must succeed. + // Enables safe use of `estimateGas` by finding the minimum gas where the transaction doesn't revert if (!success && _tx.targetTxGas == 0 && refundInfo.gasPrice == 0) revert CanNotEstimateGas( _tx.targetTxGas, refundInfo.gasPrice, success ); - // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls + + // Transfer transaction costs to tx.origin to avoid intermediate contract payments. uint256 payment; if (refundInfo.gasPrice != 0) { payment = _handlePayment( diff --git a/contracts/smart-account/paymasters/BasePaymaster.sol b/contracts/smart-account/paymasters/BasePaymaster.sol index aa7b2b26..eca097b6 100644 --- a/contracts/smart-account/paymasters/BasePaymaster.sol +++ b/contracts/smart-account/paymasters/BasePaymaster.sol @@ -122,7 +122,6 @@ abstract contract BasePaymaster is IPaymaster, Ownable, BaseSmartAccountErrors { /// validate the call is made from a valid entrypoint function _requireFromEntryPoint() internal virtual { - // require(msg.sender == address(entryPoint), "Sender not EntryPoint"); // won't need BaseSmartAccountErrors import if (msg.sender != address(entryPoint)) revert CallerIsNotAnEntryPoint(msg.sender); } diff --git a/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol b/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol index 6d937f2a..0e1ba651 100644 --- a/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol +++ b/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol @@ -72,8 +72,8 @@ contract VerifyingSingletonPaymaster is } /** - * @dev Add a deposit for this paymaster and given paymasterId (Dapp Depositor address), used for paying for transaction fees - * @param paymasterId dapp identifier for which deposit is being made + * @dev Deposit funds for a given paymasterId to cover transaction fees. + * @param paymasterId Identifier of the dapp receiving the deposit. */ function depositFor(address paymasterId) external payable nonReentrant { if (paymasterId == address(0)) revert PaymasterIdCannotBeZero(); @@ -126,9 +126,9 @@ contract VerifyingSingletonPaymaster is } /** - * @dev Withdraws the specified amount of gas tokens from the paymaster's balance and transfers them to the specified address. - * @param withdrawAddress The address to which the gas tokens should be transferred. - * @param amount The amount of gas tokens to withdraw. + * @dev Withdraws specified gas tokens from paymaster's balance to a given address. + * @param withdrawAddress Address receiving the gas tokens. + * @param amount Amount of gas tokens to withdraw. */ function withdrawTo( address payable withdrawAddress, @@ -146,11 +146,9 @@ contract VerifyingSingletonPaymaster is } /** - * @dev This method is called by the off-chain service, to sign the request. - * It is called on-chain from the validatePaymasterUserOp, to validate the signature. - * @notice That this signature covers all fields of the UserOperation, except the "paymasterAndData", - * which will carry the signature itself. - * @return hash we're going to sign off-chain (and validate on-chain) + * @dev Called by off-chain service for signing, and on-chain in validatePaymasterUserOp for validation. + * @notice Signature covers all UserOperation fields except "paymasterAndData" which carries the signature. + * @return Hash to sign off-chain and validate on-chain. */ function getHash( UserOperation calldata userOp, @@ -158,7 +156,7 @@ contract VerifyingSingletonPaymaster is uint48 validUntil, uint48 validAfter ) public view returns (bytes32) { - //can't use userOp.hash(), since it contains also the paymasterAndData itself. + // can't use userOp.hash(), since it contains also the paymasterAndData itself. address sender = userOp.getSender(); return keccak256( @@ -231,14 +229,15 @@ contract VerifyingSingletonPaymaster is paymasterData.validAfter ); uint256 sigLength = paymasterData.signatureLength; - // we only "require" it here so that the revert reason on invalid signature will be of "VerifyingPaymaster", and not "ECDSA" + // Ensure revert reason is from "VerifyingPaymaster" not "ECDSA" on invalid signature. + if (sigLength != 65) revert InvalidPaymasterSignatureLength(sigLength); - //don't revert on signature failure: return SIG_VALIDATION_FAILED + // Don't revert on signature failure: return SIG_VALIDATION_FAILED. if ( verifyingSigner != hash.toEthSignedMessageHash().recover(paymasterData.signature) ) { - // empty context and sigFailed with time range provided + // Empty context and sigFailed with time range provided return ( "", _packValidationData( From 5de64daa872d60c9f78fda1ccfeee47f5a65d05a Mon Sep 17 00:00:00 2001 From: aboudjem Date: Mon, 11 Sep 2023 21:53:53 +0700 Subject: [PATCH 03/17] =?UTF-8?q?=F0=9F=9A=A8=20reorder=20func,=20fix=20li?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contracts/smart-account/SmartAccount.sol | 17 +++++++++++------ .../smart-account/base/FallbackManager.sol | 17 ++++++++++------- .../utils/GasEstimatorSmartAccount.sol | 6 ++---- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/contracts/smart-account/SmartAccount.sol b/contracts/smart-account/SmartAccount.sol index c9d2af23..0a10df76 100644 --- a/contracts/smart-account/SmartAccount.sol +++ b/contracts/smart-account/SmartAccount.sol @@ -44,8 +44,8 @@ contract SmartAccount is mapping(uint256 => uint256) public noncesDeprecated; // AA immutable storage - IEntryPoint private immutable _entryPoint; - address private immutable _self; + IEntryPoint private immutable ENTRY_POINT; + address private immutable SELF; // Events event ImplementationUpdated( @@ -63,10 +63,10 @@ contract SmartAccount is * @param anEntryPoint The address of the entry point contract. */ constructor(IEntryPoint anEntryPoint) { - _self = address(this); + SELF = address(this); if (address(anEntryPoint) == address(0)) revert EntryPointCannotBeZero(); - _entryPoint = anEntryPoint; + ENTRY_POINT = anEntryPoint; _modules[SENTINEL_MODULES] = SENTINEL_MODULES; } @@ -77,7 +77,7 @@ contract SmartAccount is * sources and accepts Ether as payment. */ receive() external payable { - if (address(this) == _self) revert DelegateCallsOnly(); + if (address(this) == SELF) revert DelegateCallsOnly(); emit SmartAccountReceivedNativeToken(msg.sender, msg.value); } @@ -233,6 +233,8 @@ contract SmartAccount is emit ImplementationUpdated(oldImplementation, _implementation); } +/* solhint-disable func-name-mixedcase */ + /** * @dev Execute a transaction (called by entryPoint) * @notice Name is optimized for this method to be cheaper to be called @@ -261,6 +263,7 @@ contract SmartAccount is uint256[] calldata value, bytes[] calldata func ) public { + _requireFromEntryPoint(); if ( dest.length == 0 || @@ -275,6 +278,8 @@ contract SmartAccount is } } +/* solhint-enable func-name-mixedcase */ + /** * @dev Deposit more funds for this account in the entryPoint */ @@ -313,7 +318,7 @@ contract SmartAccount is * @dev This function should be implemented by the subclass to return the current entry point used by this account. */ function entryPoint() public view virtual override returns (IEntryPoint) { - return _entryPoint; + return ENTRY_POINT; } /** diff --git a/contracts/smart-account/base/FallbackManager.sol b/contracts/smart-account/base/FallbackManager.sol index 753e4ddd..66ba7868 100644 --- a/contracts/smart-account/base/FallbackManager.sol +++ b/contracts/smart-account/base/FallbackManager.sol @@ -14,12 +14,14 @@ abstract contract FallbackManager is SelfAuthorized, FallbackManagerErrors { bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d4; + + uint256[24] private __gap; + event ChangedFallbackHandler( address indexed previousHandler, address indexed handler ); - // solhint-disable-next-line payable-fallback,no-complex-fallback fallback() external { bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT; @@ -50,17 +52,19 @@ abstract contract FallbackManager is SelfAuthorized, FallbackManagerErrors { } } - function getFallbackHandler() public view returns (address _handler) { - assembly { - _handler := sload(FALLBACK_HANDLER_STORAGE_SLOT) - } - } + /// @dev Allows to add a contract to handle fallback calls. /// Only fallback calls without value and with data will be forwarded /// @param handler contract to handle fallback calls. function setFallbackHandler(address handler) external virtual; + function getFallbackHandler() public view returns (address _handler) { + assembly { + _handler := sload(FALLBACK_HANDLER_STORAGE_SLOT) + } + } + function _setFallbackHandler(address handler) internal { if (handler == address(0)) revert HandlerCannotBeZero(); address previousHandler; @@ -76,5 +80,4 @@ abstract contract FallbackManager is SelfAuthorized, FallbackManagerErrors { emit ChangedFallbackHandler(previousHandler, handler); } - uint256[24] private __gap; } diff --git a/contracts/smart-account/utils/GasEstimatorSmartAccount.sol b/contracts/smart-account/utils/GasEstimatorSmartAccount.sol index 3bdf216f..8a42f459 100644 --- a/contracts/smart-account/utils/GasEstimatorSmartAccount.sol +++ b/contracts/smart-account/utils/GasEstimatorSmartAccount.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import "../factory/SmartAccountFactory.sol"; +import {SmartAccountFactory} from "../factory/SmartAccountFactory.sol"; // Contract for estimating gas on undeployed smart account // Deploys a smart account and then calls the appropriate method @@ -14,9 +14,8 @@ contract GasEstimatorSmartAccount { uint256 _index, bytes calldata _data // execTransaction data // counterFactual wallet should have assets if required ) external returns (bool success, bytes memory result, uint256 gas) { - // solhint-disable uint256 initialGas = gasleft(); - address _wallet = SmartAccountFactory(_factory) + SmartAccountFactory(_factory) .deployCounterFactualAccount( _moduleSetupContract, _moduleSetupData, @@ -24,6 +23,5 @@ contract GasEstimatorSmartAccount { ); (success, result) = _actualWallet.call(_data); gas = initialGas - gasleft(); - // solhint-enable } } From 30971cb04f3eaa55f00f2ca858fc3494feff8cdf Mon Sep 17 00:00:00 2001 From: aboudjem Date: Mon, 11 Sep 2023 22:23:31 +0700 Subject: [PATCH 04/17] =?UTF-8?q?=F0=9F=8E=A8=20re-order,=20lint=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contracts/smart-account/SmartAccount.sol | 5 +- .../smart-account/base/FallbackManager.sol | 6 +- .../smart-account/common/ReentrancyGuard.sol | 10 +- .../estimation/SmartAccountNoAuth.sol | 436 +++++++++--------- .../PasskeyValidationModules/Secp256r1.sol | 38 +- .../paymasters/BasePaymaster.sol | 4 +- .../singleton/VerifyingSingletonPaymaster.sol | 2 - .../utils/GasEstimatorSmartAccount.sol | 11 +- 8 files changed, 250 insertions(+), 262 deletions(-) diff --git a/contracts/smart-account/SmartAccount.sol b/contracts/smart-account/SmartAccount.sol index 0a10df76..aab2b85c 100644 --- a/contracts/smart-account/SmartAccount.sol +++ b/contracts/smart-account/SmartAccount.sol @@ -233,7 +233,7 @@ contract SmartAccount is emit ImplementationUpdated(oldImplementation, _implementation); } -/* solhint-disable func-name-mixedcase */ + /* solhint-disable func-name-mixedcase */ /** * @dev Execute a transaction (called by entryPoint) @@ -263,7 +263,6 @@ contract SmartAccount is uint256[] calldata value, bytes[] calldata func ) public { - _requireFromEntryPoint(); if ( dest.length == 0 || @@ -278,7 +277,7 @@ contract SmartAccount is } } -/* solhint-enable func-name-mixedcase */ + /* solhint-enable func-name-mixedcase */ /** * @dev Deposit more funds for this account in the entryPoint diff --git a/contracts/smart-account/base/FallbackManager.sol b/contracts/smart-account/base/FallbackManager.sol index 66ba7868..adaeb5cb 100644 --- a/contracts/smart-account/base/FallbackManager.sol +++ b/contracts/smart-account/base/FallbackManager.sol @@ -14,7 +14,6 @@ abstract contract FallbackManager is SelfAuthorized, FallbackManagerErrors { bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d4; - uint256[24] private __gap; event ChangedFallbackHandler( @@ -52,14 +51,12 @@ abstract contract FallbackManager is SelfAuthorized, FallbackManagerErrors { } } - - /// @dev Allows to add a contract to handle fallback calls. /// Only fallback calls without value and with data will be forwarded /// @param handler contract to handle fallback calls. function setFallbackHandler(address handler) external virtual; - function getFallbackHandler() public view returns (address _handler) { + function getFallbackHandler() public view returns (address _handler) { assembly { _handler := sload(FALLBACK_HANDLER_STORAGE_SLOT) } @@ -79,5 +76,4 @@ abstract contract FallbackManager is SelfAuthorized, FallbackManagerErrors { } emit ChangedFallbackHandler(previousHandler, handler); } - } diff --git a/contracts/smart-account/common/ReentrancyGuard.sol b/contracts/smart-account/common/ReentrancyGuard.sol index 17a4218a..65fe7224 100644 --- a/contracts/smart-account/common/ReentrancyGuard.sol +++ b/contracts/smart-account/common/ReentrancyGuard.sol @@ -3,16 +3,12 @@ pragma solidity 0.8.17; /// @title Reentrancy Guard - reentrancy protection abstract contract ReentrancyGuard { - error ReentrancyProtectionActivated(); - uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _reentrancyStatus; - constructor() { - _reentrancyStatus = NOT_ENTERED; - } + error ReentrancyProtectionActivated(); modifier nonReentrant() { if (_reentrancyStatus == ENTERED) @@ -22,6 +18,10 @@ abstract contract ReentrancyGuard { _reentrancyStatus = NOT_ENTERED; } + constructor() { + _reentrancyStatus = NOT_ENTERED; + } + function _isReentrancyGuardEntered() internal view returns (bool) { return _reentrancyStatus == ENTERED; } diff --git a/contracts/smart-account/estimation/SmartAccountNoAuth.sol b/contracts/smart-account/estimation/SmartAccountNoAuth.sol index 333a8899..c9e9276c 100644 --- a/contracts/smart-account/estimation/SmartAccountNoAuth.sol +++ b/contracts/smart-account/estimation/SmartAccountNoAuth.sol @@ -8,7 +8,6 @@ import {SignatureDecoder} from "../common/SignatureDecoder.sol"; import {SecuredTokenTransfer} from "../common/SecuredTokenTransfer.sol"; import {LibAddress} from "../libs/LibAddress.sol"; import {ISignatureValidator} from "../interfaces/ISignatureValidator.sol"; -import {Math} from "../libs/Math.sol"; import {IERC165} from "../interfaces/IERC165.sol"; import {ReentrancyGuard} from "../common/ReentrancyGuard.sol"; import {SmartAccountErrors} from "../common/Errors.sol"; @@ -58,9 +57,9 @@ contract SmartAccountNoAuth is mapping(uint256 => uint256) public nonces; // AA immutable storage - IEntryPoint private immutable _entryPoint; - uint256 private immutable _chainId; - address private immutable _self; + IEntryPoint private immutable ENTRY_POINT; + uint256 private immutable CHAIN_ID; + address private immutable SELF; // Events @@ -81,125 +80,163 @@ contract SmartAccountNoAuth is */ constructor(IEntryPoint anEntryPoint) { _modules[SENTINEL_MODULES] = SENTINEL_MODULES; - _self = address(this); + SELF = address(this); if (address(anEntryPoint) == address(0)) revert EntryPointCannotBeZero(); - _entryPoint = anEntryPoint; - _chainId = block.chainid; + ENTRY_POINT = anEntryPoint; + CHAIN_ID = block.chainid; } /** - * @dev This function allows the owner or entry point to execute certain actions. - * If the caller is not authorized, the function will revert with an error message. - * @notice This modifier is marked as internal and can only be called within the contract itself. + * @dev This function is a special fallback function that is triggered when the contract receives Ether. + * It logs an event indicating the amount of Ether received and the sender's address. + * @notice This function is marked as external and payable, meaning it can be called from external + * sources and accepts Ether as payment. */ - function _requireFromEntryPointOrSelf() internal view { - if (msg.sender != address(entryPoint()) && msg.sender != address(this)) - revert CallerIsNotEntryPointOrSelf(msg.sender); + receive() external payable { + if (address(this) == SELF) revert DelegateCallsOnly(); + emit SmartAccountReceivedNativeToken(msg.sender, msg.value); } /** - * @dev This function allows the owner or entry point to execute certain actions. - * If the caller is not authorized, the function will revert with an error message. - * @notice This modifier is marked as internal and can only be called within the contract itself. + * @dev Initialize the Smart Account with required states + * @param handler Default fallback handler provided in Smart Account + * @param moduleSetupContract Initializes the auth module; can be a factory or registry for multiple accounts. + * @param moduleSetupData modules setup data (a standard calldata for the module setup contract) + * @notice devs need to make sure it is only callble once by initiazer or state check restrictions + * @notice any further implementations that introduces a new state must have a reinit method + * @notice reinit is not possible, as _initialSetupModules reverts if the account is already initialized + * which is when there is at least one enabled module */ - function _requireFromEntryPoint() internal view { - if (msg.sender != address(entryPoint())) - revert CallerIsNotEntryPoint(msg.sender); + function init( + address handler, + address moduleSetupContract, + bytes calldata moduleSetupData + ) external virtual override returns (address) { + _setFallbackHandler(handler); + return _initialSetupModules(moduleSetupContract, moduleSetupData); } /** - * @notice All the new implementations MUST have this method! - * @notice Updates the implementation of the base wallet - * @param _implementation New wallet implementation + * @dev Interface function with the standard name for execute_ncC + * @param dest Address of the contract to call + * @param value Amount of native tokens to send along with the transaction + * @param func Data of the transaction */ - function updateImplementation(address _implementation) public virtual { - _requireFromEntryPointOrSelf(); - require(_implementation != address(0), "Address cannot be zero"); - if (!_implementation.isContract()) - revert InvalidImplementation(_implementation); - address oldImplementation; - - assembly { - oldImplementation := sload(address()) - sstore(address(), _implementation) - } - emit ImplementationUpdated(oldImplementation, _implementation); + function execute( + address dest, + uint256 value, + bytes calldata func + ) external { + execute_ncC(dest, value, func); } - /// Getters /** - * @dev Returns the address of the implementation contract associated with this contract. - * @notice The implementation address is stored in the contract's storage slot with index 0. + * @dev Interface function with the standard name for executeBatch_y6U + * @param dest Addresses of the contracts to call + * @param value Amounts of native tokens to send along with the transactions + * @param func Data of the transactions */ - function getImplementation() - external - view - returns (address _implementation) - { - assembly { - _implementation := sload(address()) + function executeBatch( + address[] calldata dest, + uint256[] calldata value, + bytes[] calldata func + ) external { + executeBatch_y6U(dest, value, func); + } + + function validateUserOp( + UserOperation calldata userOp, + bytes32 userOpHash, + uint256 missingAccountFunds + ) external virtual override returns (uint256 validationData) { + if (msg.sender != address(entryPoint())) + revert CallerIsNotAnEntryPoint(msg.sender); + + (, address validationModule) = abi.decode( + userOp.signature, + (bytes, address) + ); + if (address(_modules[validationModule]) != address(0)) { + validationData = IAuthorizationModule(validationModule) + .validateUserOp(userOp, userOpHash); + } else { + revert WrongValidationModule(validationModule); } + _payPrefund(missingAccountFunds); } /** - * @dev Returns the domain separator for this contract, as defined in the EIP-712 standard. - * @return bytes32 The domain separator hash. + * @dev Adds a module to the allowlist. + * @notice This can only be done via a userOp or a selfcall. + * @notice Enables the module `module` for the wallet. + * @param module Module to be allow-listed. */ - function domainSeparator() public view returns (bytes32) { - return - keccak256( - abi.encode( - DOMAIN_SEPARATOR_TYPEHASH, - block.chainid, - address(this) - ) - ); + function enableModule(address module) external virtual override { + _requireFromEntryPointOrSelf(); + _enableModule(module); } /** - * @notice Returns the ID of the chain the contract is currently deployed on. - * @return _chainId The ID of the current chain as a uint256. + * @dev Setups module for this Smart Account and enables it. + * @notice This can only be done via userOp or a selfcall. + * @notice Enables the module `module` for the wallet. */ - function getChainId() public view returns (uint256) { - return _chainId; + function setupAndEnableModule( + address setupContract, + bytes memory setupData + ) external virtual override returns (address) { + _requireFromEntryPointOrSelf(); + return _setupAndEnableModule(setupContract, setupData); + } + + function setFallbackHandler(address handler) external virtual override { + _requireFromEntryPoint(); + _setFallbackHandler(handler); } /** - * @dev returns a value from the nonces 2d mapping - * @param batchId : the key of the user's batch being queried - * @return nonce : the number of transactions made within said batch + * @notice Query if a contract implements an interface + * @param _interfaceId The interface identifier, as specified in ERC165 + * @return `true` if the contract implements `_interfaceID` */ - function getNonce(uint256 batchId) public view virtual returns (uint256) { - return nonces[batchId]; + function supportsInterface( + bytes4 _interfaceId + ) external view virtual override returns (bool) { + return _interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7 } /** - * @dev Returns the current entry point used by this account. - * @return EntryPoint as an `IEntryPoint` interface. - * @dev This function should be implemented by the subclass to return the current entry point used by this account. + * @dev Returns the address of the implementation contract associated with this contract. + * @notice The implementation address is stored in the contract's storage slot with index 0. */ - function entryPoint() public view virtual override returns (IEntryPoint) { - return _entryPoint; + function getImplementation() + external + view + returns (address _implementation) + { + assembly { + _implementation := sload(address()) + } } /** - * @dev Initialize the Smart Account with required states - * @param handler Default fallback handler provided in Smart Account - * @param moduleSetupContract Initializes the auth module; can be a factory or registry for multiple accounts. - * @param moduleSetupData modules setup data (a standard calldata for the module setup contract) - * @notice devs need to make sure it is only callble once by initiazer or state check restrictions - * @notice any further implementations that introduces a new state must have a reinit method - * @notice reinit is not possible, as _initialSetupModules reverts if the account is already initialized - * which is when there is at least one enabled module + * @notice All the new implementations MUST have this method! + * @notice Updates the implementation of the base wallet + * @param _implementation New wallet implementation */ - function init( - address handler, - address moduleSetupContract, - bytes calldata moduleSetupData - ) external virtual override returns (address) { - _setFallbackHandler(handler); - return _initialSetupModules(moduleSetupContract, moduleSetupData); + function updateImplementation(address _implementation) public virtual { + _requireFromEntryPointOrSelf(); + require(_implementation != address(0), "Address cannot be zero"); + if (!_implementation.isContract()) + revert InvalidImplementation(_implementation); + address oldImplementation; + + assembly { + oldImplementation := sload(address()) + sstore(address(), _implementation) + } + emit ImplementationUpdated(oldImplementation, _implementation); } /** @@ -218,20 +255,6 @@ contract SmartAccountNoAuth is _call(dest, value, func); } - /** - * @dev Interface function with the standard name for execute_ncC - * @param dest Address of the contract to call - * @param value Amount of native tokens to send along with the transaction - * @param func Data of the transaction - */ - function execute( - address dest, - uint256 value, - bytes calldata func - ) external { - execute_ncC(dest, value, func); - } - /** * @dev Execute a sequence of transactions * @notice Name is optimized for this method to be cheaper to be called @@ -259,64 +282,76 @@ contract SmartAccountNoAuth is } /** - * @dev Interface function with the standard name for executeBatch_y6U - * @param dest Addresses of the contracts to call - * @param value Amounts of native tokens to send along with the transactions - * @param func Data of the transactions + * @dev Deposit more funds for this account in the entryPoint */ - function executeBatch( - address[] calldata dest, - uint256[] calldata value, - bytes[] calldata func - ) external { - executeBatch_y6U(dest, value, func); + function addDeposit() public payable { + entryPoint().depositTo{value: msg.value}(address(this)); } /** - * @dev internal method that fecilitates the extenral calls from SmartAccount - * @dev similar to execute() of Executor.sol - * @param target destination address contract/non-contract - * @param value amount of native tokens - * @param data function singature of destination + * @dev Withdraw value from the account's deposit + * @param withdrawAddress target to send to + * @param amount to withdraw */ - function _call(address target, uint256 value, bytes memory data) internal { - assembly { - let success := call( - gas(), - target, - value, - add(data, 0x20), - mload(data), - 0, - 0 - ) - let ptr := mload(0x40) - returndatacopy(ptr, 0, returndatasize()) - if iszero(success) { - revert(ptr, returndatasize()) - } - } + function withdrawDepositTo( + address payable withdrawAddress, + uint256 amount + ) public payable { + _requireFromEntryPointOrSelf(); + entryPoint().withdrawTo(withdrawAddress, amount); } - function validateUserOp( - UserOperation calldata userOp, - bytes32 userOpHash, - uint256 missingAccountFunds - ) external virtual override returns (uint256 validationData) { - if (msg.sender != address(entryPoint())) - revert CallerIsNotAnEntryPoint(msg.sender); + /** + * @dev Removes a module from the allowlist. + * @notice This can only be done via a wallet transaction. + * @notice Disables the module `module` for the wallet. + * @param prevModule Module that pointed to the module to be removed in the linked list + * @param module Module to be removed. + */ + function disableModule(address prevModule, address module) public virtual { + _requireFromEntryPointOrSelf(); + _disableModule(prevModule, module); + } - (, address validationModule) = abi.decode( - userOp.signature, - (bytes, address) - ); - if (address(_modules[validationModule]) != address(0)) { - validationData = IAuthorizationModule(validationModule) - .validateUserOp(userOp, userOpHash); - } else { - revert WrongValidationModule(validationModule); - } - _payPrefund(missingAccountFunds); + /** + * @dev Returns the current entry point used by this account. + * @return EntryPoint as an `IEntryPoint` interface. + * @dev This function should be implemented by the subclass to return the current entry point used by this account. + */ + function entryPoint() public view virtual override returns (IEntryPoint) { + return ENTRY_POINT; + } + + /** + * @dev Returns the domain separator for this contract, as defined in the EIP-712 standard. + * @return bytes32 The domain separator hash. + */ + function domainSeparator() public view returns (bytes32) { + return + keccak256( + abi.encode( + DOMAIN_SEPARATOR_TYPEHASH, + block.chainid, + address(this) + ) + ); + } + + /** + * @notice Returns the ID of the chain the contract is currently deployed on. + * @return CHAIN_ID The ID of the current chain as a uint256. + */ + function getChainId() public view returns (uint256) { + return CHAIN_ID; + } + + /** + * @dev returns a value from the nonces 2d mapping + * @param batchId : the key of the user's batch being queried + * @return nonce : the number of transactions made within said batch + */ + function getNonce(uint256 batchId) public view virtual returns (uint256) { + return nonces[batchId]; } /** @@ -357,85 +392,48 @@ contract SmartAccountNoAuth is } /** - * @dev Deposit more funds for this account in the entryPoint - */ - function addDeposit() public payable { - entryPoint().depositTo{value: msg.value}(address(this)); - } - - /** - * @dev Withdraw value from the account's deposit - * @param withdrawAddress target to send to - * @param amount to withdraw - */ - function withdrawDepositTo( - address payable withdrawAddress, - uint256 amount - ) public payable { - _requireFromEntryPointOrSelf(); - entryPoint().withdrawTo(withdrawAddress, amount); - } - - /** - * @dev Adds a module to the allowlist. - * @notice This can only be done via a userOp or a selfcall. - * @notice Enables the module `module` for the wallet. - * @param module Module to be allow-listed. - */ - function enableModule(address module) external virtual override { - _requireFromEntryPointOrSelf(); - _enableModule(module); - } - - /** - * @dev Setups module for this Smart Account and enables it. - * @notice This can only be done via userOp or a selfcall. - * @notice Enables the module `module` for the wallet. - */ - function setupAndEnableModule( - address setupContract, - bytes memory setupData - ) external virtual override returns (address) { - _requireFromEntryPointOrSelf(); - return _setupAndEnableModule(setupContract, setupData); - } - - /** - * @dev Removes a module from the allowlist. - * @notice This can only be done via a wallet transaction. - * @notice Disables the module `module` for the wallet. - * @param prevModule Module that pointed to the module to be removed in the linked list - * @param module Module to be removed. + * @dev internal method that fecilitates the extenral calls from SmartAccount + * @dev similar to execute() of Executor.sol + * @param target destination address contract/non-contract + * @param value amount of native tokens + * @param data function singature of destination */ - function disableModule(address prevModule, address module) public virtual { - _requireFromEntryPointOrSelf(); - _disableModule(prevModule, module); - } - - function setFallbackHandler(address handler) external virtual override { - _requireFromEntryPoint(); - _setFallbackHandler(handler); + function _call(address target, uint256 value, bytes memory data) internal { + assembly { + let success := call( + gas(), + target, + value, + add(data, 0x20), + mload(data), + 0, + 0 + ) + let ptr := mload(0x40) + returndatacopy(ptr, 0, returndatasize()) + if iszero(success) { + revert(ptr, returndatasize()) + } + } } /** - * @notice Query if a contract implements an interface - * @param _interfaceId The interface identifier, as specified in ERC165 - * @return `true` if the contract implements `_interfaceID` + * @dev This function allows the owner or entry point to execute certain actions. + * If the caller is not authorized, the function will revert with an error message. + * @notice This modifier is marked as internal and can only be called within the contract itself. */ - function supportsInterface( - bytes4 _interfaceId - ) external view virtual override returns (bool) { - return _interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7 + function _requireFromEntryPointOrSelf() internal view { + if (msg.sender != address(entryPoint()) && msg.sender != address(this)) + revert CallerIsNotEntryPointOrSelf(msg.sender); } /** - * @dev This function is a special fallback function that is triggered when the contract receives Ether. - * It logs an event indicating the amount of Ether received and the sender's address. - * @notice This function is marked as external and payable, meaning it can be called from external - * sources and accepts Ether as payment. + * @dev This function allows the owner or entry point to execute certain actions. + * If the caller is not authorized, the function will revert with an error message. + * @notice This modifier is marked as internal and can only be called within the contract itself. */ - receive() external payable { - if (address(this) == _self) revert DelegateCallsOnly(); - emit SmartAccountReceivedNativeToken(msg.sender, msg.value); + function _requireFromEntryPoint() internal view { + if (msg.sender != address(entryPoint())) + revert CallerIsNotEntryPoint(msg.sender); } } diff --git a/contracts/smart-account/modules/PasskeyValidationModules/Secp256r1.sol b/contracts/smart-account/modules/PasskeyValidationModules/Secp256r1.sol index 93d1f0dc..6a3e9eb9 100644 --- a/contracts/smart-account/modules/PasskeyValidationModules/Secp256r1.sol +++ b/contracts/smart-account/modules/PasskeyValidationModules/Secp256r1.sol @@ -21,20 +21,20 @@ struct JPoint { } library Secp256r1 { - uint256 constant gx = + uint256 private constant GX = 0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296; - uint256 constant gy = + uint256 private constant GY = 0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5; - uint256 public constant pp = + uint256 private constant PP = 0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF; - uint256 public constant nn = + uint256 private constant NN = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551; - uint256 constant a = + uint256 private constant A = 0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC; - uint256 constant b = + uint256 private constant B = 0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B; - uint256 constant MOST_SIGNIFICANT = + uint256 private constant MOST_SIGNIFICANT = 0xc000000000000000000000000000000000000000000000000000000000000000; /* @@ -52,7 +52,7 @@ library Secp256r1 { uint256 s, uint256 e ) internal view returns (bool) { - if (r >= nn || s >= nn) { + if (r >= NN || s >= NN) { return false; } @@ -66,14 +66,14 @@ library Secp256r1 { uint256 s, uint256 e ) internal view returns (bool) { - if (r >= nn || s >= nn) { + if (r >= NN || s >= NN) { return false; } - uint256 w = primemod(s, nn); + uint256 w = primemod(s, NN); - uint256 u1 = mulmod(e, w, nn); - uint256 u2 = mulmod(r, w, nn); + uint256 u1 = mulmod(e, w, NN); + uint256 u2 = mulmod(r, w, NN); uint256 x; uint256 y; @@ -139,11 +139,11 @@ library Secp256r1 { return (0, 0); } - uint256 zinv = primemod(z, pp); - uint256 zinvsq = mulmod(zinv, zinv, pp); + uint256 zinv = primemod(z, PP); + uint256 zinvsq = mulmod(zinv, zinv, PP); - ax = mulmod(x, zinvsq, pp); - ay = mulmod(y, mulmod(zinvsq, zinv, pp), pp); + ax = mulmod(x, zinvsq, PP); + ay = mulmod(y, mulmod(zinvsq, zinv, PP), PP); } // Fermats little theorem https://en.wikipedia.org/wiki/Fermat%27s_little_theorem @@ -158,7 +158,7 @@ library Secp256r1 { return ret; } - // Wrapper for built-in BigNumber_modexp (contract 0x5) as described here. https://github.com/ethereum/EIPs/pull/198 + // WraPPer for built-in BigNumber_modexp (contract 0x5) as described here. https://github.com/ethereum/EIPs/pull/198 function modexp( uint256 _base, uint256 _exp, @@ -196,7 +196,7 @@ library Secp256r1 { ) internal pure returns (JPoint[16] memory points) { // JPoint[] memory u1Points = new JPoint[](4); // u1Points[0] = JPoint(0, 0, 0); - // u1Points[1] = JPoint(gx, gy, 1); // u1 + // u1Points[1] = JPoint(GX, GY, 1); // u1 // u1Points[2] = jPointDouble(u1Points[1]); // u1Points[3] = jPointAdd(u1Points[1], u1Points[2]); // avoiding this intermediate step by using it in a single array below @@ -208,7 +208,7 @@ library Secp256r1 { points[2] = jPointDouble(points[1]); points[3] = jPointAdd(points[1], points[2]); - points[4] = JPoint(gx, gy, 1); // u1Points[1] + points[4] = JPoint(GX, GY, 1); // u1Points[1] points[5] = jPointAdd(points[4], points[1]); points[6] = jPointAdd(points[4], points[2]); points[7] = jPointAdd(points[4], points[3]); diff --git a/contracts/smart-account/paymasters/BasePaymaster.sol b/contracts/smart-account/paymasters/BasePaymaster.sol index eca097b6..ab841aa9 100644 --- a/contracts/smart-account/paymasters/BasePaymaster.sol +++ b/contracts/smart-account/paymasters/BasePaymaster.sol @@ -1,8 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.17; -/* solhint-disable reason-string */ - import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IPaymaster} from "@account-abstraction/contracts/interfaces/IPaymaster.sol"; import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; @@ -14,8 +12,8 @@ import "@account-abstraction/contracts/core/Helpers.sol"; * Helper class for creating a paymaster. * provides helper methods for staking. * validates that the postOp is called only by the entryPoint + @notice Could have Ownable2Step */ -// @notice Could have Ownable2Step abstract contract BasePaymaster is IPaymaster, Ownable, BaseSmartAccountErrors { IEntryPoint public immutable entryPoint; diff --git a/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol b/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol index 0e1ba651..f6dd824a 100644 --- a/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol +++ b/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol @@ -1,8 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.17; -/* solhint-disable reason-string */ -/* solhint-disable no-inline-assembly */ import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {UserOperation, UserOperationLib} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; diff --git a/contracts/smart-account/utils/GasEstimatorSmartAccount.sol b/contracts/smart-account/utils/GasEstimatorSmartAccount.sol index 8a42f459..1324bf70 100644 --- a/contracts/smart-account/utils/GasEstimatorSmartAccount.sol +++ b/contracts/smart-account/utils/GasEstimatorSmartAccount.sol @@ -15,12 +15,11 @@ contract GasEstimatorSmartAccount { bytes calldata _data // execTransaction data // counterFactual wallet should have assets if required ) external returns (bool success, bytes memory result, uint256 gas) { uint256 initialGas = gasleft(); - SmartAccountFactory(_factory) - .deployCounterFactualAccount( - _moduleSetupContract, - _moduleSetupData, - _index - ); + SmartAccountFactory(_factory).deployCounterFactualAccount( + _moduleSetupContract, + _moduleSetupData, + _index + ); (success, result) = _actualWallet.call(_data); gas = initialGas - gasleft(); } From 0279e427f6693cbe09c2fc81cd81a1baba375316 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Mon, 11 Sep 2023 22:23:54 +0700 Subject: [PATCH 05/17] =?UTF-8?q?=F0=9F=94=A7=20edit=20solhint=20rules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .solhint.json | 13 +++++++++---- .solhintignore | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.solhint.json b/.solhint.json index 2ec16205..c9265ce5 100644 --- a/.solhint.json +++ b/.solhint.json @@ -12,7 +12,7 @@ "func-name-mixedcase": "error", "func-param-name-mixedcase": "error", "modifier-name-mixedcase": "error", - "private-vars-leading-underscore": ["error", { "strict": false }], + "private-vars-leading-underscore": ["off", { "strict": true }], "use-forbidden-name": "error", "var-name-mixedcase": "error", "imports-on-top": "error", @@ -24,13 +24,18 @@ "max-states-count": ["error", 15], "no-empty-blocks": "error", "no-unused-vars": "error", - "payable-fallback": "error", + "payable-fallback": "off", "constructor-syntax": "error", "explicit-types": "error", "no-unused-import": "error", - "one-contract-per-file": "error", + "one-contract-per-file": "warn", "not-rely-on-time": "off", - "reason-string": "error" + "reason-string": "error", + "no-inline-assembly": "off", + "avoid-low-level-calls": "off", + "custom-errors": "off", + "no-complex-fallback": "off", + "no-global-import": "off" }, "plugins": ["prettier"] } \ No newline at end of file diff --git a/.solhintignore b/.solhintignore index 0958327c..24ef6876 100644 --- a/.solhintignore +++ b/.solhintignore @@ -1,3 +1,4 @@ node_modules artifacts contracts/smart-account/test +contracts/smart-account/libs \ No newline at end of file From 01032c497510cef07db9e82f5d1e5a9b22e5954a Mon Sep 17 00:00:00 2001 From: aboudjem Date: Tue, 12 Sep 2023 15:27:46 +0700 Subject: [PATCH 06/17] =?UTF-8?q?=F0=9F=9A=A8=20fix=20lint=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../estimation/SmartAccountNoAuth.sol | 4 ++ .../factory/SmartAccountFactory.sol | 62 +++++++++---------- .../handler/DefaultCallbackHandler.sol | 2 + .../interfaces/IERC1155TokenReceiver.sol | 2 +- .../interfaces/ISessionKeyManager.sol | 1 - .../modules/BaseAuthorizationModule.sol | 6 +- .../modules/BatchedSessionRouterModule.sol | 4 +- .../modules/ForwardFlowModule.sol | 42 ++++++------- .../paymasters/BasePaymaster.sol | 20 +++--- .../paymasters/PaymasterHelpers.sol | 2 - 10 files changed, 76 insertions(+), 69 deletions(-) diff --git a/contracts/smart-account/estimation/SmartAccountNoAuth.sol b/contracts/smart-account/estimation/SmartAccountNoAuth.sol index c9e9276c..e7c95818 100644 --- a/contracts/smart-account/estimation/SmartAccountNoAuth.sol +++ b/contracts/smart-account/estimation/SmartAccountNoAuth.sol @@ -239,6 +239,8 @@ contract SmartAccountNoAuth is emit ImplementationUpdated(oldImplementation, _implementation); } + /* solhint-disable func-name-mixedcase */ + /** * @dev Execute a transaction (called directly from owner, or by entryPoint) * @notice Name is optimized for this method to be cheaper to be called @@ -281,6 +283,8 @@ contract SmartAccountNoAuth is } } + /* solhint-enable func-name-mixedcase */ + /** * @dev Deposit more funds for this account in the entryPoint */ diff --git a/contracts/smart-account/factory/SmartAccountFactory.sol b/contracts/smart-account/factory/SmartAccountFactory.sol index 644c795c..c12a06f9 100644 --- a/contracts/smart-account/factory/SmartAccountFactory.sol +++ b/contracts/smart-account/factory/SmartAccountFactory.sol @@ -39,11 +39,30 @@ contract SmartAccountFactory is Stakeable { } /** - * @dev Allows to retrieve the creation code used for the Proxy deployment. - * @return The creation code for the Proxy. + * @notice Allows to find out account address prior to deployment + * @param index extra salt that allows to deploy more accounts if needed for same EOA (default 0) */ - function accountCreationCode() public pure returns (bytes memory) { - return type(Proxy).creationCode; + function getAddressForCounterFactualAccount( + address moduleSetupContract, + bytes calldata moduleSetupData, + uint256 index + ) external view returns (address _account) { + // create initializer data based on init method, _owner and minimalHandler + bytes memory initializer = _getInitializer( + moduleSetupContract, + moduleSetupData + ); + bytes memory code = abi.encodePacked( + type(Proxy).creationCode, + uint256(uint160(basicImplementation)) + ); + bytes32 salt = keccak256( + abi.encodePacked(keccak256(initializer), index) + ); + bytes32 hash = keccak256( + abi.encodePacked(bytes1(0xff), address(this), salt, keccak256(code)) + ); + _account = address(uint160(uint256(hash))); } /** @@ -155,6 +174,14 @@ contract SmartAccountFactory is Stakeable { emit AccountCreationWithoutIndex(proxy, initialAuthorizationModule); } + /** + * @dev Allows to retrieve the creation code used for the Proxy deployment. + * @return The creation code for the Proxy. + */ + function accountCreationCode() public pure returns (bytes memory) { + return type(Proxy).creationCode; + } + /** * @dev Allows to retrieve the initializer data for the account. * @param moduleSetupContract Initializes the auth module; can be a factory or registry for multiple accounts. @@ -171,31 +198,4 @@ contract SmartAccountFactory is Stakeable { (address(minimalHandler), moduleSetupContract, moduleSetupData) ); } - - /** - * @notice Allows to find out account address prior to deployment - * @param index extra salt that allows to deploy more accounts if needed for same EOA (default 0) - */ - function getAddressForCounterFactualAccount( - address moduleSetupContract, - bytes calldata moduleSetupData, - uint256 index - ) external view returns (address _account) { - // create initializer data based on init method, _owner and minimalHandler - bytes memory initializer = _getInitializer( - moduleSetupContract, - moduleSetupData - ); - bytes memory code = abi.encodePacked( - type(Proxy).creationCode, - uint256(uint160(basicImplementation)) - ); - bytes32 salt = keccak256( - abi.encodePacked(keccak256(initializer), index) - ); - bytes32 hash = keccak256( - abi.encodePacked(bytes1(0xff), address(this), salt, keccak256(code)) - ); - _account = address(uint160(uint256(hash))); - } } diff --git a/contracts/smart-account/handler/DefaultCallbackHandler.sol b/contracts/smart-account/handler/DefaultCallbackHandler.sol index 071a0a94..3a30ccb1 100644 --- a/contracts/smart-account/handler/DefaultCallbackHandler.sol +++ b/contracts/smart-account/handler/DefaultCallbackHandler.sol @@ -1,6 +1,8 @@ // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.17; +/* solhint-disable no-empty-blocks */ + import {IERC1155TokenReceiver} from "../interfaces/IERC1155TokenReceiver.sol"; import {IERC721TokenReceiver} from "../interfaces/IERC721TokenReceiver.sol"; import {IERC777TokensRecipient} from "../interfaces/IERC777TokensRecipient.sol"; diff --git a/contracts/smart-account/interfaces/IERC1155TokenReceiver.sol b/contracts/smart-account/interfaces/IERC1155TokenReceiver.sol index 9f15bc52..50beca5e 100644 --- a/contracts/smart-account/interfaces/IERC1155TokenReceiver.sol +++ b/contracts/smart-account/interfaces/IERC1155TokenReceiver.sol @@ -40,7 +40,7 @@ interface IERC1155TokenReceiver { * @param _operator The address which initiated the batch transfer (i.e. msg.sender) * @param _from The address which previously owned the token * @param _ids An array containing ids of each token being transferred (order and length must match values array) - * @param _values An array containing amounts of each token being transferred (order and length must match ids array) + * @param _values An array containing amounts of each token transferred (order and length must match ids array) * @param _data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if allowed */ diff --git a/contracts/smart-account/interfaces/ISessionKeyManager.sol b/contracts/smart-account/interfaces/ISessionKeyManager.sol index 24f53a39..e624915f 100644 --- a/contracts/smart-account/interfaces/ISessionKeyManager.sol +++ b/contracts/smart-account/interfaces/ISessionKeyManager.sol @@ -1,6 +1,5 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; interface ISessionKeyManager { /** diff --git a/contracts/smart-account/modules/BaseAuthorizationModule.sol b/contracts/smart-account/modules/BaseAuthorizationModule.sol index dcc0ed93..d9aee05c 100644 --- a/contracts/smart-account/modules/BaseAuthorizationModule.sol +++ b/contracts/smart-account/modules/BaseAuthorizationModule.sol @@ -1,8 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import {IAuthorizationModule, UserOperation} from "../interfaces/IAuthorizationModule.sol"; -import {ISignatureValidator, ISignatureValidatorConstants} from "../interfaces/ISignatureValidator.sol"; +/* solhint-disable no-empty-blocks */ + +import {IAuthorizationModule} from "../interfaces/IAuthorizationModule.sol"; +import {ISignatureValidator} from "../interfaces/ISignatureValidator.sol"; contract AuthorizationModulesConstants { uint256 internal constant VALIDATION_SUCCESS = 0; diff --git a/contracts/smart-account/modules/BatchedSessionRouterModule.sol b/contracts/smart-account/modules/BatchedSessionRouterModule.sol index 30756b54..66640748 100644 --- a/contracts/smart-account/modules/BatchedSessionRouterModule.sol +++ b/contracts/smart-account/modules/BatchedSessionRouterModule.sol @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; +/* solhint-disable function-max-lines */ + import {BaseAuthorizationModule, UserOperation} from "./BaseAuthorizationModule.sol"; import {ISessionValidationModule} from "./SessionValidationModules/ISessionValidationModule.sol"; import {ISessionKeyManager} from "../interfaces/ISessionKeyManager.sol"; @@ -81,7 +83,7 @@ contract BatchedSessionRouter is BaseAuthorizationModule { uint256 length = sessionData.length; // iterate over batched operations - for (uint i; i < length; ) { + for (uint256 i; i < length; ) { // validate the sessionKey // sessionKeyManager reverts if something wrong ISessionKeyManager(sessionKeyManager).validateSessionKey( diff --git a/contracts/smart-account/modules/ForwardFlowModule.sol b/contracts/smart-account/modules/ForwardFlowModule.sol index f2ef4de7..1818be5c 100644 --- a/contracts/smart-account/modules/ForwardFlowModule.sol +++ b/contracts/smart-account/modules/ForwardFlowModule.sol @@ -6,6 +6,22 @@ import {Enum} from "../common/Enum.sol"; import {ReentrancyGuard} from "../common/ReentrancyGuard.sol"; import {Math} from "../libs/Math.sol"; +struct Transaction { + address to; + Enum.Operation operation; + uint256 value; + bytes data; + uint256 targetTxGas; +} + +struct FeeRefund { + uint256 baseGas; + uint256 gasPrice; //gasPrice or tokenGasPrice + uint256 tokenGasPriceFactor; + address gasToken; + address payable refundReceiver; +} + /** * @notice Throws when the address that signed the data (restored from signature) * differs from the address we expected to sign the data (i.e. some authorized address) @@ -64,22 +80,6 @@ interface IExecFromModule { ) external returns (bool success); } -struct Transaction { - address to; - Enum.Operation operation; - uint256 value; - bytes data; - uint256 targetTxGas; -} - -struct FeeRefund { - uint256 baseGas; - uint256 gasPrice; //gasPrice or tokenGasPrice - uint256 tokenGasPriceFactor; - address gasToken; - address payable refundReceiver; -} - contract ForwardFlowModule is ReentrancyGuard, ISignatureValidatorConstants { // Domain Seperators keccak256("EIP712Domain(uint256 chainId,address verifyingContract)"); bytes32 internal constant DOMAIN_SEPARATOR_TYPEHASH = @@ -90,14 +90,14 @@ contract ForwardFlowModule is ReentrancyGuard, ISignatureValidatorConstants { bytes32 internal constant ACCOUNT_TX_TYPEHASH = 0xda033865d68bf4a40a5a7cb4159a99e33dba8569e65ea3e38222eb12d9e66eee; - uint256 private immutable _chainId; + uint256 private immutable CHAIN_ID; mapping(uint256 => uint256) public nonces; event AccountHandlePayment(bytes32 indexed txHash, uint256 indexed payment); constructor() { - _chainId = block.chainid; + CHAIN_ID = block.chainid; } /** @@ -370,16 +370,16 @@ contract ForwardFlowModule is ReentrancyGuard, ISignatureValidatorConstants { ) public view returns (bytes32) { return keccak256( - abi.encode(DOMAIN_SEPARATOR_TYPEHASH, _chainId, smartAccount) + abi.encode(DOMAIN_SEPARATOR_TYPEHASH, CHAIN_ID, smartAccount) ); } /** * @notice Returns the ID of the chain the contract is currently deployed on. - * @return _chainId The ID of the current chain as a uint256. + * @return CHAIN_ID The ID of the current chain as a uint256. */ function getChainId() public view returns (uint256) { - return _chainId; + return CHAIN_ID; } /** diff --git a/contracts/smart-account/paymasters/BasePaymaster.sol b/contracts/smart-account/paymasters/BasePaymaster.sol index ab841aa9..18b6a6a5 100644 --- a/contracts/smart-account/paymasters/BasePaymaster.sol +++ b/contracts/smart-account/paymasters/BasePaymaster.sol @@ -11,14 +11,14 @@ import "@account-abstraction/contracts/core/Helpers.sol"; /** * Helper class for creating a paymaster. * provides helper methods for staking. - * validates that the postOp is called only by the entryPoint + * validates that the postOp is called only by the ENTRY_POINT @notice Could have Ownable2Step */ abstract contract BasePaymaster is IPaymaster, Ownable, BaseSmartAccountErrors { - IEntryPoint public immutable entryPoint; + IEntryPoint public immutable ENTRY_POINT; constructor(address _owner, IEntryPoint _entryPoint) { - entryPoint = _entryPoint; + ENTRY_POINT = _entryPoint; _transferOwnership(_owner); } @@ -63,7 +63,7 @@ abstract contract BasePaymaster is IPaymaster, Ownable, BaseSmartAccountErrors { * @param unstakeDelaySec - the unstake delay for this paymaster. Can only be increased. */ function addStake(uint32 unstakeDelaySec) external payable onlyOwner { - entryPoint.addStake{value: msg.value}(unstakeDelaySec); + ENTRY_POINT.addStake{value: msg.value}(unstakeDelaySec); } /** @@ -71,7 +71,7 @@ abstract contract BasePaymaster is IPaymaster, Ownable, BaseSmartAccountErrors { * The paymaster can't serve requests once unlocked, until it calls addStake again */ function unlockStake() external onlyOwner { - entryPoint.unlockStake(); + ENTRY_POINT.unlockStake(); } /** @@ -80,14 +80,14 @@ abstract contract BasePaymaster is IPaymaster, Ownable, BaseSmartAccountErrors { * @param withdrawAddress the address to send withdrawn value. */ function withdrawStake(address payable withdrawAddress) external onlyOwner { - entryPoint.withdrawStake(withdrawAddress); + ENTRY_POINT.withdrawStake(withdrawAddress); } /** - * return current paymaster's deposit on the entryPoint. + * return current paymaster's deposit on the ENTRY_POINT. */ function getDeposit() public view returns (uint256) { - return entryPoint.balanceOf(address(this)); + return ENTRY_POINT.balanceOf(address(this)); } function _validatePaymasterUserOp( @@ -98,7 +98,7 @@ abstract contract BasePaymaster is IPaymaster, Ownable, BaseSmartAccountErrors { /** * post-operation handler. - * (verified to be called only through the entryPoint) + * (verified to be called only through the ENTRY_POINT) * @dev if subclass returns a non-empty context from validatePaymasterUserOp, it must also implement this method. * @param mode enum with the following options: * opSucceeded - user operation succeeded. @@ -120,7 +120,7 @@ abstract contract BasePaymaster is IPaymaster, Ownable, BaseSmartAccountErrors { /// validate the call is made from a valid entrypoint function _requireFromEntryPoint() internal virtual { - if (msg.sender != address(entryPoint)) + if (msg.sender != address(ENTRY_POINT)) revert CallerIsNotAnEntryPoint(msg.sender); } } diff --git a/contracts/smart-account/paymasters/PaymasterHelpers.sol b/contracts/smart-account/paymasters/PaymasterHelpers.sol index 161179d2..a5f31f2b 100644 --- a/contracts/smart-account/paymasters/PaymasterHelpers.sol +++ b/contracts/smart-account/paymasters/PaymasterHelpers.sol @@ -26,11 +26,9 @@ library PaymasterHelpers { /** * @dev Encodes the paymaster context: paymasterId and gasPrice - * @param op UserOperation object * @param data PaymasterData passed */ function paymasterContext( - UserOperation calldata op, PaymasterData memory data ) internal From 8c71c2a6404feb3eef85d1a2707042114b204878 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Tue, 12 Sep 2023 16:55:12 +0700 Subject: [PATCH 07/17] =?UTF-8?q?=F0=9F=9A=A8=20fix=20all=20solhint=20erro?= =?UTF-8?q?rs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contracts/smart-account/BaseSmartAccount.sol | 6 +----- .../smart-account/modules/BatchedSessionRouterModule.sol | 3 ++- .../smart-account/modules/EcdsaOwnershipRegistryModule.sol | 3 ++- .../Exotic/EcdsaEthSignSupportOwnershipRegistryModule.sol | 3 ++- .../smart-account/modules/MultichainECDSAValidator.sol | 2 +- contracts/smart-account/modules/SessionKeyManagerModule.sol | 2 +- .../SessionValidationModules/ISessionValidationModule.sol | 3 ++- .../modules/SmartContractOwnershipRegistryModule.sol | 3 ++- .../verifying/singleton/VerifyingSingletonPaymaster.sol | 6 +++--- .../test/ForbiddenOpcodeInvokingAuthModule.sol | 2 +- .../test/WrongStorageAccessValidationModule.sol | 2 +- contracts/smart-account/test/mocks/MockAuthModule.sol | 3 ++- .../test/mocks/MockInvalidInitialAuthModule copy.sol | 3 ++- .../test/mocks/MockSessionValidationModule.sol | 2 +- 14 files changed, 23 insertions(+), 20 deletions(-) diff --git a/contracts/smart-account/BaseSmartAccount.sol b/contracts/smart-account/BaseSmartAccount.sol index 0e9d410b..05ccb7a0 100644 --- a/contracts/smart-account/BaseSmartAccount.sol +++ b/contracts/smart-account/BaseSmartAccount.sol @@ -1,10 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.17; -/* solhint-disable avoid-low-level-calls */ -/* solhint-disable no-inline-assembly */ -/* solhint-disable reason-string */ - import {IAccount} from "@account-abstraction/contracts/interfaces/IAccount.sol"; import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; import {UserOperationLib, UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; @@ -19,7 +15,7 @@ import "@account-abstraction/contracts/core/Helpers.sol"; abstract contract BaseSmartAccount is IAccount, BaseSmartAccountErrors { using UserOperationLib for UserOperation; - //return value in case of signature failure, with no time-range. + // Return value in case of signature failure, with no time-range. // equivalent to _packValidationData(true,0,0); uint256 internal constant SIG_VALIDATION_FAILED = 1; diff --git a/contracts/smart-account/modules/BatchedSessionRouterModule.sol b/contracts/smart-account/modules/BatchedSessionRouterModule.sol index 66640748..2d17e176 100644 --- a/contracts/smart-account/modules/BatchedSessionRouterModule.sol +++ b/contracts/smart-account/modules/BatchedSessionRouterModule.sol @@ -3,11 +3,12 @@ pragma solidity 0.8.17; /* solhint-disable function-max-lines */ -import {BaseAuthorizationModule, UserOperation} from "./BaseAuthorizationModule.sol"; +import {BaseAuthorizationModule} from "./BaseAuthorizationModule.sol"; import {ISessionValidationModule} from "./SessionValidationModules/ISessionValidationModule.sol"; import {ISessionKeyManager} from "../interfaces/ISessionKeyManager.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@account-abstraction/contracts/core/Helpers.sol"; +import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; /** * @title Batched Session Router diff --git a/contracts/smart-account/modules/EcdsaOwnershipRegistryModule.sol b/contracts/smart-account/modules/EcdsaOwnershipRegistryModule.sol index 49cfde77..a7ca94d8 100644 --- a/contracts/smart-account/modules/EcdsaOwnershipRegistryModule.sol +++ b/contracts/smart-account/modules/EcdsaOwnershipRegistryModule.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import {BaseAuthorizationModule, UserOperation} from "./BaseAuthorizationModule.sol"; +import {BaseAuthorizationModule} from "./BaseAuthorizationModule.sol"; +import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; /** diff --git a/contracts/smart-account/modules/Exotic/EcdsaEthSignSupportOwnershipRegistryModule.sol b/contracts/smart-account/modules/Exotic/EcdsaEthSignSupportOwnershipRegistryModule.sol index 131ab456..07611b70 100644 --- a/contracts/smart-account/modules/Exotic/EcdsaEthSignSupportOwnershipRegistryModule.sol +++ b/contracts/smart-account/modules/Exotic/EcdsaEthSignSupportOwnershipRegistryModule.sol @@ -1,8 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import {BaseAuthorizationModule, UserOperation} from "../BaseAuthorizationModule.sol"; +import {BaseAuthorizationModule} from "../BaseAuthorizationModule.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; /** * @title ECDSA ownership Authorization module for Biconomy Smart Accounts. diff --git a/contracts/smart-account/modules/MultichainECDSAValidator.sol b/contracts/smart-account/modules/MultichainECDSAValidator.sol index 57f5f658..d2f02d33 100644 --- a/contracts/smart-account/modules/MultichainECDSAValidator.sol +++ b/contracts/smart-account/modules/MultichainECDSAValidator.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import {UserOperation} from "./BaseAuthorizationModule.sol"; +import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; import {EcdsaOwnershipRegistryModule} from "./EcdsaOwnershipRegistryModule.sol"; import {UserOperationLib} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; diff --git a/contracts/smart-account/modules/SessionKeyManagerModule.sol b/contracts/smart-account/modules/SessionKeyManagerModule.sol index e29f97c3..f22e5a9d 100644 --- a/contracts/smart-account/modules/SessionKeyManagerModule.sol +++ b/contracts/smart-account/modules/SessionKeyManagerModule.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import {BaseAuthorizationModule, UserOperation} from "./BaseAuthorizationModule.sol"; +import {BaseAuthorizationModule} from "./BaseAuthorizationModule.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@account-abstraction/contracts/core/Helpers.sol"; import "./SessionValidationModules/ISessionValidationModule.sol"; diff --git a/contracts/smart-account/modules/SessionValidationModules/ISessionValidationModule.sol b/contracts/smart-account/modules/SessionValidationModules/ISessionValidationModule.sol index 5dc8afec..d3aa6d36 100644 --- a/contracts/smart-account/modules/SessionValidationModules/ISessionValidationModule.sol +++ b/contracts/smart-account/modules/SessionValidationModules/ISessionValidationModule.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import {UserOperation} from "../BaseAuthorizationModule.sol"; +import "../BaseAuthorizationModule.sol"; +import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; abstract contract ISessionValidationModule { // execute(address,uint256,bytes) diff --git a/contracts/smart-account/modules/SmartContractOwnershipRegistryModule.sol b/contracts/smart-account/modules/SmartContractOwnershipRegistryModule.sol index 36def374..6362ee42 100644 --- a/contracts/smart-account/modules/SmartContractOwnershipRegistryModule.sol +++ b/contracts/smart-account/modules/SmartContractOwnershipRegistryModule.sol @@ -1,8 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import {BaseAuthorizationModule, UserOperation, ISignatureValidator} from "./BaseAuthorizationModule.sol"; +import {BaseAuthorizationModule, ISignatureValidator} from "./BaseAuthorizationModule.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; /** * @title Smart Contract Ownership Authorization module for Biconomy Smart Accounts. diff --git a/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol b/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol index f6dd824a..4ae64959 100644 --- a/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol +++ b/contracts/smart-account/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol @@ -79,7 +79,7 @@ contract VerifyingSingletonPaymaster is paymasterIdBalances[paymasterId] = paymasterIdBalances[paymasterId] + msg.value; - entryPoint.depositTo{value: msg.value}(address(this)); + ENTRY_POINT.depositTo{value: msg.value}(address(this)); emit GasDeposited(paymasterId, msg.value); } @@ -139,7 +139,7 @@ contract VerifyingSingletonPaymaster is paymasterIdBalances[msg.sender] = paymasterIdBalances[msg.sender] - amount; - entryPoint.withdrawTo(withdrawAddress, amount); + ENTRY_POINT.withdrawTo(withdrawAddress, amount); emit GasWithdrawn(msg.sender, withdrawAddress, amount); } @@ -251,7 +251,7 @@ contract VerifyingSingletonPaymaster is paymasterIdBalances[paymasterData.paymasterId] ); return ( - userOp.paymasterContext(paymasterData), + PaymasterHelpers.paymasterContext(paymasterData), _packValidationData( false, paymasterData.validUntil, diff --git a/contracts/smart-account/test/ForbiddenOpcodeInvokingAuthModule.sol b/contracts/smart-account/test/ForbiddenOpcodeInvokingAuthModule.sol index adf82df8..a82be5f5 100644 --- a/contracts/smart-account/test/ForbiddenOpcodeInvokingAuthModule.sol +++ b/contracts/smart-account/test/ForbiddenOpcodeInvokingAuthModule.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.17; import {EcdsaOwnershipRegistryModule} from "../modules/EcdsaOwnershipRegistryModule.sol"; -import {UserOperation} from "../modules/BaseAuthorizationModule.sol"; +import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; contract ForbiddenOpcodeInvokingAuthModule is EcdsaOwnershipRegistryModule { function validateUserOp( diff --git a/contracts/smart-account/test/WrongStorageAccessValidationModule.sol b/contracts/smart-account/test/WrongStorageAccessValidationModule.sol index 79e79190..ab3e20e6 100644 --- a/contracts/smart-account/test/WrongStorageAccessValidationModule.sol +++ b/contracts/smart-account/test/WrongStorageAccessValidationModule.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.17; import {EcdsaOwnershipRegistryModule} from "../modules/EcdsaOwnershipRegistryModule.sol"; -import {UserOperation} from "../modules/BaseAuthorizationModule.sol"; +import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; contract WrongStorageAccessValidationModule is EcdsaOwnershipRegistryModule { uint256 public constant MAX_VALIDATION_COUNT = 10; diff --git a/contracts/smart-account/test/mocks/MockAuthModule.sol b/contracts/smart-account/test/mocks/MockAuthModule.sol index fb0b707d..17c86125 100644 --- a/contracts/smart-account/test/mocks/MockAuthModule.sol +++ b/contracts/smart-account/test/mocks/MockAuthModule.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.17; -import {BaseAuthorizationModule, UserOperation} from "../../modules/BaseAuthorizationModule.sol"; +import {BaseAuthorizationModule} from "../../modules/BaseAuthorizationModule.sol"; +import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; contract MockAuthModule is BaseAuthorizationModule { mapping(address => bytes) internal setupData; diff --git a/contracts/smart-account/test/mocks/MockInvalidInitialAuthModule copy.sol b/contracts/smart-account/test/mocks/MockInvalidInitialAuthModule copy.sol index 1a6c15aa..92311a88 100644 --- a/contracts/smart-account/test/mocks/MockInvalidInitialAuthModule copy.sol +++ b/contracts/smart-account/test/mocks/MockInvalidInitialAuthModule copy.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.17; -import {BaseAuthorizationModule, UserOperation} from "../../modules/BaseAuthorizationModule.sol"; +import {BaseAuthorizationModule} from "../../modules/BaseAuthorizationModule.sol"; +import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; contract MockInvalidInitialAuthModule is BaseAuthorizationModule { mapping(address => bytes) internal _setupData; diff --git a/contracts/smart-account/test/mocks/MockSessionValidationModule.sol b/contracts/smart-account/test/mocks/MockSessionValidationModule.sol index 36a403fb..f1e800bc 100644 --- a/contracts/smart-account/test/mocks/MockSessionValidationModule.sol +++ b/contracts/smart-account/test/mocks/MockSessionValidationModule.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.17; import {ISessionValidationModule} from "../../modules/SessionValidationModules/ISessionValidationModule.sol"; -import {UserOperation} from "../../modules/BaseAuthorizationModule.sol"; +import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract MockSessionValidationModule is ISessionValidationModule { From 93f853e76cf2616fa253eef3a3dc487fb6b12b35 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Tue, 12 Sep 2023 16:56:51 +0700 Subject: [PATCH 08/17] =?UTF-8?q?=F0=9F=94=A7=20update=20rules=20for=20thi?= =?UTF-8?q?s=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .solhint.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.solhint.json b/.solhint.json index c9265ce5..eaa2c16f 100644 --- a/.solhint.json +++ b/.solhint.json @@ -19,7 +19,7 @@ "ordering": "error", "visibility-modifier-order": "error", "code-complexity": ["error", 7], - "function-max-lines": ["error", 65], + "function-max-lines": ["error", 80], "max-line-length": ["warn", 120], "max-states-count": ["error", 15], "no-empty-blocks": "error", @@ -35,7 +35,8 @@ "avoid-low-level-calls": "off", "custom-errors": "off", "no-complex-fallback": "off", - "no-global-import": "off" + "no-global-import": "off", + "avoid-tx-origin": "off" }, "plugins": ["prettier"] } \ No newline at end of file From 327a68c6d71505d2e5c589a025e83c413515c518 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Tue, 12 Sep 2023 21:09:05 +0700 Subject: [PATCH 09/17] =?UTF-8?q?=F0=9F=92=9A=20fix=20wrong=20action=20fol?= =?UTF-8?q?ders?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/{.github => }/ISSUE_TEMPLATE/bug_report.md | 0 .github/{.github => }/ISSUE_TEMPLATE/feature_request.md | 0 .github/{.github => }/pull_request_template.md | 0 .github/{.github => }/workflows/check_branch_name.yml | 0 .github/{.github => }/workflows/mark_stale.yml | 0 .github/{.github => }/workflows/push_check.yml | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename .github/{.github => }/ISSUE_TEMPLATE/bug_report.md (100%) rename .github/{.github => }/ISSUE_TEMPLATE/feature_request.md (100%) rename .github/{.github => }/pull_request_template.md (100%) rename .github/{.github => }/workflows/check_branch_name.yml (100%) rename .github/{.github => }/workflows/mark_stale.yml (100%) rename .github/{.github => }/workflows/push_check.yml (100%) diff --git a/.github/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from .github/.github/ISSUE_TEMPLATE/bug_report.md rename to .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md similarity index 100% rename from .github/.github/ISSUE_TEMPLATE/feature_request.md rename to .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/.github/pull_request_template.md b/.github/pull_request_template.md similarity index 100% rename from .github/.github/pull_request_template.md rename to .github/pull_request_template.md diff --git a/.github/.github/workflows/check_branch_name.yml b/.github/workflows/check_branch_name.yml similarity index 100% rename from .github/.github/workflows/check_branch_name.yml rename to .github/workflows/check_branch_name.yml diff --git a/.github/.github/workflows/mark_stale.yml b/.github/workflows/mark_stale.yml similarity index 100% rename from .github/.github/workflows/mark_stale.yml rename to .github/workflows/mark_stale.yml diff --git a/.github/.github/workflows/push_check.yml b/.github/workflows/push_check.yml similarity index 100% rename from .github/.github/workflows/push_check.yml rename to .github/workflows/push_check.yml From 6afcbe21e650d944e497963dfd7645de5a6770d8 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Tue, 12 Sep 2023 21:26:56 +0700 Subject: [PATCH 10/17] =?UTF-8?q?=F0=9F=9A=91=20add=20.secret=20on=20push?= =?UTF-8?q?=20checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/push_check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/push_check.yml b/.github/workflows/push_check.yml index 0beb7fd0..f963b17a 100644 --- a/.github/workflows/push_check.yml +++ b/.github/workflows/push_check.yml @@ -40,5 +40,7 @@ jobs: - name: Install dependencies run: yarn install --frozen-lockfile && yarn build + - name: Create a fake .secret file + run: echo "do not deploy this banana wallet onto serious prod trees" > .secret - name: Run tests run: yarn test \ No newline at end of file From 9976315d9292ab9945a1378cbb21ff0553035229 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Tue, 12 Sep 2023 21:35:10 +0700 Subject: [PATCH 11/17] =?UTF-8?q?=F0=9F=99=88=20update=20ignore=20files=20?= =?UTF-8?q?to=20ignore=20typechain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 2 ++ .prettierignore | 1 + 2 files changed, 3 insertions(+) diff --git a/.eslintignore b/.eslintignore index 85f5562a..f027457a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,3 +2,5 @@ node_modules artifacts cache coverage +gasReporterOutput.json +**/typechain/ diff --git a/.prettierignore b/.prettierignore index c328d919..88d30c40 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,4 +3,5 @@ artifacts cache coverage* gasReporterOutput.json +**/typechain/ From b6dda3186d6ea98ebac9a869112a598a5c22fbd2 Mon Sep 17 00:00:00 2001 From: Adam Boudj Date: Tue, 12 Sep 2023 18:45:14 +0400 Subject: [PATCH 12/17] Update push_check.yml --- .github/workflows/push_check.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/push_check.yml b/.github/workflows/push_check.yml index f963b17a..ba9be8d9 100644 --- a/.github/workflows/push_check.yml +++ b/.github/workflows/push_check.yml @@ -17,10 +17,10 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Install dependencies - run: yarn install --frozen-lockfile + run: yarn install --frozen-lockfile && yarn build - name: Lint sources run: - yarn run lint + yarn run lint unit_test: name: Unit tests @@ -38,9 +38,9 @@ jobs: with: node-version: ${{ matrix.node-version }} - - name: Install dependencies - run: yarn install --frozen-lockfile && yarn build - name: Create a fake .secret file run: echo "do not deploy this banana wallet onto serious prod trees" > .secret + - name: Install dependencies + run: yarn install --frozen-lockfile && yarn build - name: Run tests - run: yarn test \ No newline at end of file + run: yarn test From 333e655f17e778bab0c43d895b3b17370f819eb0 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Tue, 12 Sep 2023 21:49:54 +0700 Subject: [PATCH 13/17] =?UTF-8?q?=F0=9F=92=9A=20fix=20ci=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/push_check.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_check.yml b/.github/workflows/push_check.yml index ba9be8d9..46d7e199 100644 --- a/.github/workflows/push_check.yml +++ b/.github/workflows/push_check.yml @@ -11,11 +11,12 @@ jobs: steps: - name: Checkout uses: 'actions/checkout@master' - - name: Set Node.js uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Create a fake .secret file + run: echo "pistol kiwi squirrel general approve avoid doll employ abandon banana" > .secret - name: Install dependencies run: yarn install --frozen-lockfile && yarn build - name: Lint sources @@ -39,7 +40,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: Create a fake .secret file - run: echo "do not deploy this banana wallet onto serious prod trees" > .secret + run: echo "pistol kiwi squirrel general approve avoid doll employ abandon banana" > .secret - name: Install dependencies run: yarn install --frozen-lockfile && yarn build - name: Run tests From 47c3308da227e0975f9a06982878a0979dfcaba3 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Tue, 12 Sep 2023 22:00:00 +0700 Subject: [PATCH 14/17] =?UTF-8?q?=F0=9F=90=9B=20Add=20default=20empty=20st?= =?UTF-8?q?ring=20fallbacks=20for=20network=20URLs=20to=20fix=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hardhat.config.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index a70adc1f..93a875da 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -242,27 +242,27 @@ const config: HardhatUserConfig = { chainId: 8453, }, opBNBMainnet: { - url: process.env.OP_BNB_MAINNET_URL, + url: process.env.OP_BNB_MAINNET_URL || "", accounts: hardhatAccounts, chainId: 204, }, opBNBTestnet: { - url: process.env.OP_BNB_TESTNET_URL, + url: process.env.OP_BNB_TESTNET_URL || "", accounts: hardhatAccounts, chainId: 5611, }, mantleMainnet: { - url: process.env.MANTLE_MAINNET_URL, + url: process.env.MANTLE_MAINNET_URL || "", accounts: hardhatAccounts, chainId: 5000, }, mantleTestnet: { - url: process.env.MANTLE_TESTNET_URL, + url: process.env.MANTLE_TESTNET_URL || "", accounts: hardhatAccounts, chainId: 5001, }, comboTestnet: { - url: process.env.COMBO_TESTNET_URL, + url: process.env.COMBO_TESTNET_URL || "", accounts: hardhatAccounts, chainId: 91715, }, From 4d064d859717a96a89481cb0e82a77688f6158d8 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Tue, 12 Sep 2023 22:00:55 +0700 Subject: [PATCH 15/17] =?UTF-8?q?=F0=9F=94=90=20fix=20fake=20.secret=20on?= =?UTF-8?q?=20push=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/push_check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_check.yml b/.github/workflows/push_check.yml index 46d7e199..ce5c2d1d 100644 --- a/.github/workflows/push_check.yml +++ b/.github/workflows/push_check.yml @@ -16,7 +16,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Create a fake .secret file - run: echo "pistol kiwi squirrel general approve avoid doll employ abandon banana" > .secret + run: echo "primary twist rack vendor diagram image used route theme frown either will" > .secret - name: Install dependencies run: yarn install --frozen-lockfile && yarn build - name: Lint sources @@ -40,7 +40,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: Create a fake .secret file - run: echo "pistol kiwi squirrel general approve avoid doll employ abandon banana" > .secret + run: echo "primary twist rack vendor diagram image used route theme frown either will" > .secret - name: Install dependencies run: yarn install --frozen-lockfile && yarn build - name: Run tests From d348bffb93cb6ca4a787babe2a7f0faa7a98d8f8 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Wed, 13 Sep 2023 15:57:00 +0700 Subject: [PATCH 16/17] =?UTF-8?q?=F0=9F=93=9D=20fix=20small=20typo=20on=20?= =?UTF-8?q?comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/PasskeyValidationModules/Secp256r1.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/smart-account/modules/PasskeyValidationModules/Secp256r1.sol b/contracts/smart-account/modules/PasskeyValidationModules/Secp256r1.sol index 6a3e9eb9..197673aa 100644 --- a/contracts/smart-account/modules/PasskeyValidationModules/Secp256r1.sol +++ b/contracts/smart-account/modules/PasskeyValidationModules/Secp256r1.sol @@ -158,7 +158,7 @@ library Secp256r1 { return ret; } - // WraPPer for built-in BigNumber_modexp (contract 0x5) as described here. https://github.com/ethereum/EIPs/pull/198 + // Wrapper for built-in BigNumber_modexp (contract 0x5) as described here. https://github.com/ethereum/EIPs/pull/198 function modexp( uint256 _base, uint256 _exp, From 538c4f5b4c604b5887d79739eb94b73154095de8 Mon Sep 17 00:00:00 2001 From: livingrockrises <90545960+livingrockrises@users.noreply.github.com> Date: Thu, 14 Sep 2023 14:59:09 +0400 Subject: [PATCH 17/17] lockfile --- yarn.lock | 318 +++++++++++++++--------------------------------------- 1 file changed, 87 insertions(+), 231 deletions(-) diff --git a/yarn.lock b/yarn.lock index a44a6f84..d9d3dcd8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1180,16 +1180,6 @@ dependencies: node-gyp-build "4.3.0" -"@trufflesuite/uws-js-unofficial@20.30.0-unofficial.0": - version "20.30.0-unofficial.0" - resolved "https://registry.yarnpkg.com/@trufflesuite/uws-js-unofficial/-/uws-js-unofficial-20.30.0-unofficial.0.tgz#2fbc2f8ef7e82fbeea6abaf7e8a9d42a02b479d3" - integrity sha512-r5X0aOQcuT6pLwTRLD+mPnAM/nlKtvIK4Z+My++A8tTOR0qTjNRx8UB8jzRj3D+p9PMAp5LnpCUUGmz7/TppwA== - dependencies: - ws "8.13.0" - optionalDependencies: - bufferutil "4.0.7" - utf-8-validate "6.0.3" - "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" @@ -1369,17 +1359,17 @@ integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== "@types/node-fetch@^2.6.1": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== + version "2.6.5" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.5.tgz#972756a9a0fe354b2886bf3defe667ddb4f0d30a" + integrity sha512-OZsUlr2nxvkqUFLSaY2ZbA+P1q22q+KrlxWOn/38RX+u5kTkYL2mTujEpzUhGkS+K/QCYp9oagfXG39XOzyySg== dependencies: "@types/node" "*" - form-data "^3.0.0" + form-data "^4.0.0" "@types/node@*": - version "20.5.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.9.tgz#a70ec9d8fa0180a314c3ede0e20ea56ff71aed9a" - integrity sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ== + version "20.6.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.0.tgz#9d7daa855d33d4efec8aea88cd66db1c2f0ebe16" + integrity sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg== "@types/node@11.11.6": version "11.11.6" @@ -1530,7 +1520,7 @@ abortcontroller-polyfill@^1.7.5: resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz#6738495f4e901fbb57b6c0611d0c75f76c485bed" integrity sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ== -abstract-level@1.0.3, abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: +abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abstract-level/-/abstract-level-1.0.3.tgz#78a67d3d84da55ee15201486ab44c09560070741" integrity sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA== @@ -1543,18 +1533,6 @@ abstract-level@1.0.3, abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-lev module-error "^1.0.1" queue-microtask "^1.2.3" -abstract-leveldown@7.2.0, abstract-leveldown@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz#08d19d4e26fb5be426f7a57004851b39e1795a2e" - integrity sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ== - dependencies: - buffer "^6.0.3" - catering "^2.0.0" - is-buffer "^2.0.5" - level-concat-iterator "^3.0.0" - level-supports "^2.0.1" - queue-microtask "^1.2.3" - abstract-leveldown@^6.2.1: version "6.3.0" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz#d25221d1e6612f820c35963ba4bd739928f6026a" @@ -1566,6 +1544,18 @@ abstract-leveldown@^6.2.1: level-supports "~1.0.0" xtend "~4.0.0" +abstract-leveldown@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz#08d19d4e26fb5be426f7a57004851b39e1795a2e" + integrity sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ== + dependencies: + buffer "^6.0.3" + catering "^2.0.0" + is-buffer "^2.0.5" + level-concat-iterator "^3.0.0" + level-supports "^2.0.1" + queue-microtask "^1.2.3" + abstract-leveldown@~6.2.1: version "6.2.3" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz#036543d87e3710f2528e47040bc3261b77a9a8eb" @@ -1812,13 +1802,13 @@ array.prototype.flat@^1.3.1: es-shim-unscopables "^1.0.0" array.prototype.flatmap@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz#1aae7903c2100433cb8261cd4ed310aab5c4a183" - integrity sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ== + version "1.3.2" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz#c9a7c6831db8e719d6ce639190146c24bbd3e527" + integrity sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" es-shim-unscopables "^1.0.0" array.prototype.reduce@^1.0.6: @@ -1877,7 +1867,7 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async-eventemitter@0.2.4, async-eventemitter@^0.2.4: +async-eventemitter@^0.2.4: version "0.2.4" resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== @@ -2177,7 +2167,7 @@ bufferutil@4.0.5: dependencies: node-gyp-build "^4.3.0" -bufferutil@4.0.7, bufferutil@^4.0.1: +bufferutil@^4.0.1: version "4.0.7" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.7.tgz#60c0d19ba2c992dd8273d3f73772ffc894c153ad" integrity sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw== @@ -2559,9 +2549,9 @@ cookie@^0.4.1: integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== core-js-pure@^3.0.1: - version "3.32.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.32.1.tgz#5775b88f9062885f67b6d7edce59984e89d276f3" - integrity sha512-f52QZwkFVDPf7UEQZGHKx6NYxsxmVGJe5DIvbzOdRMJlmT6yv0KDjR8rmy3ngr/t5wU54c7Sp/qIJH0ppbhVpQ== + version "3.32.2" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.32.2.tgz#b7dbdac528625cf87eb0523b532eb61551b9a6d1" + integrity sha512-Y2rxThOuNywTjnX/PgA5vWM6CZ9QB9sz9oGeCixV8MqXZO70z/5SHzf9EeBrEBK0PN36DnEBBu9O/aGWzKuMZQ== core-util-is@1.0.2: version "1.0.2" @@ -2582,9 +2572,9 @@ cors@^2.8.1: vary "^1" cosmiconfig@^8.0.0: - version "8.3.4" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.3.4.tgz#ee1356e7f24e248a6bb34ec5d438c3dcebeb410c" - integrity sha512-SF+2P8+o/PTV05rgsAjDzL4OFdVXAulSfC/L19VaeVT7+tpOOSscCt2QLxDZ+CLxF2WOiq6y1K5asvs8qUJT/Q== + version "8.3.6" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.3.6.tgz#060a2b871d66dba6c8538ea1118ba1ac16f5fae3" + integrity sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA== dependencies: import-fresh "^3.3.0" js-yaml "^4.1.0" @@ -2631,17 +2621,6 @@ cross-fetch@^4.0.0: dependencies: node-fetch "^2.6.12" -cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -2768,11 +2747,21 @@ deferred-leveldown@~5.3.0: abstract-leveldown "~6.2.1" inherits "^2.0.3" +define-data-property@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.0.tgz#0db13540704e1d8d479a0656cf781267531b9451" + integrity sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" - integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== dependencies: + define-data-property "^1.0.1" has-property-descriptors "^1.0.0" object-keys "^1.1.1" @@ -2947,7 +2936,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.20.4, es-abstract@^1.22.1: +es-abstract@^1.22.1: version "1.22.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.1.tgz#8b4e5fc5cefd7f1660f0f8e1a52900dfbc9d9ccc" integrity sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw== @@ -3397,7 +3386,7 @@ ethereum-cryptography@^1.0.3: "@scure/bip32" "1.1.5" "@scure/bip39" "1.1.1" -ethereum-cryptography@^2.0.0: +ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz#18fa7108622e56481157a5cb7c01c0c6a672eb67" integrity sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug== @@ -3542,19 +3531,6 @@ evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - express@^4.14.0: version "4.18.2" resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" @@ -3772,15 +3748,6 @@ form-data@^2.2.0: combined-stream "^1.0.6" mime-types "^2.1.12" -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -3970,13 +3937,6 @@ get-port@^3.1.0: resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" integrity sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg== -get-stream@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - get-stream@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" @@ -4276,9 +4236,9 @@ hardhat-gas-reporter@^1.0.8: sha1 "^1.1.1" hardhat@^2.9.7: - version "2.17.2" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.17.2.tgz#250a8c8e76029e9bfbfb9b9abee68d5b350b5d4a" - integrity sha512-oUv40jBeHw0dKpbyQ+iH9cmNMziweLoTW3MnkNxJ2Gc0KGLrQR/1n4vV4xY60zn2LdmRgnwPqy3CgtY0mfwIIA== + version "2.17.3" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.17.3.tgz#4cb15f2afdea5f108970ed72e5b81e6e53052cfb" + integrity sha512-SFZoYVXW1bWJZrIIKXOA+IgcctfuKXDwENywiYNT2dM3YQc4fXNaTbuk/vpPzHIF50upByx4zW5EqczKYQubsA== dependencies: "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" @@ -4604,11 +4564,6 @@ interpret@^1.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== -invert-kv@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" - integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== - io-ts@1.10.4: version "1.10.4" resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" @@ -4765,11 +4720,6 @@ is-shared-array-buffer@^1.0.2: dependencies: call-bind "^1.0.2" -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== - is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" @@ -5013,13 +4963,6 @@ klaw@^1.0.0: optionalDependencies: graceful-fs "^4.1.9" -lcid@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" - integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== - dependencies: - invert-kv "^2.0.0" - level-codec@^9.0.0: version "9.0.2" resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-9.0.2.tgz#fd60df8c64786a80d44e63423096ffead63d8cbc" @@ -5258,13 +5201,6 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -map-age-cleaner@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" - markdown-table@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60" @@ -5294,15 +5230,6 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== -mem@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" - integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== - dependencies: - map-age-cleaner "^0.1.1" - mimic-fn "^2.0.0" - p-is-promise "^2.0.0" - memdown@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/memdown/-/memdown-5.1.0.tgz#608e91a9f10f37f5b5fe767667a8674129a833cb" @@ -5405,11 +5332,6 @@ mime@1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mimic-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - mimic-response@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" @@ -5729,11 +5651,6 @@ next-tick@^1.1.0: resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - node-addon-api@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" @@ -5798,13 +5715,6 @@ normalize-url@^6.0.1: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw== - dependencies: - path-key "^2.0.0" - number-to-bn@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" @@ -5942,15 +5852,6 @@ optionator@^0.9.1: prelude-ls "^1.2.1" type-check "^0.4.0" -os-locale@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" - integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== - dependencies: - execa "^1.0.0" - lcid "^2.0.0" - mem "^4.0.0" - os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -5966,21 +5867,6 @@ p-cancelable@^3.0.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-3.0.0.tgz#63826694b54d61ca1c20ebcb6d3ecf5e14cd8050" integrity sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw== -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" - integrity sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw== - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== - -p-is-promise@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" - integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== - p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" @@ -6092,11 +5978,6 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== - path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" @@ -6264,7 +6145,7 @@ qs@6.11.0: dependencies: side-channel "^1.0.4" -qs@^6.11.0, qs@^6.4.0, qs@^6.9.4: +qs@^6.11.2, qs@^6.4.0, qs@^6.9.4: version "6.11.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9" integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA== @@ -6388,13 +6269,13 @@ regexp-tree@~0.1.1: integrity sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA== regexp.prototype.flags@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" - integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== + version "1.5.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e" + integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== dependencies: call-bind "^1.0.2" define-properties "^1.2.0" - functions-have-names "^1.2.3" + set-function-name "^2.0.0" regexpp@^3.0.0, regexpp@^3.1.0: version "3.2.0" @@ -6734,6 +6615,15 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-function-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== + dependencies: + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" + setimmediate@1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" @@ -6765,13 +6655,6 @@ sha1@^1.1.1: charenc ">= 0.0.1" crypt ">= 0.0.1" -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== - dependencies: - shebang-regex "^1.0.0" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -6779,11 +6662,6 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== - shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" @@ -6807,11 +6685,6 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.0: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - simple-concat@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" @@ -7043,22 +6916,22 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: strip-ansi "^6.0.1" string.prototype.trim@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" - integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== + version "1.2.8" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd" + integrity sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" string.prototype.trimend@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" - integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz#1bb3afc5008661d73e2dc015cd4853732d6c471e" + integrity sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" string.prototype.trimstart@^1.0.6: version "1.0.7" @@ -7109,11 +6982,6 @@ strip-bom@^3.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q== - strip-hex-prefix@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" @@ -7540,9 +7408,9 @@ unbox-primitive@^1.0.2: which-boxed-primitive "^1.0.2" undici@^5.14.0: - version "5.23.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.23.0.tgz#e7bdb0ed42cebe7b7aca87ced53e6eaafb8f8ca0" - integrity sha512-1D7w+fvRsqlQ9GscLBwcAJinqcZGHUKjbOmXdlE/v8BvEGXjeWAax+341q44EuTcHXXnfyKNbKRq4Lg7OzhMmg== + version "5.24.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.24.0.tgz#6133630372894cfeb3c3dab13b4c23866bd344b5" + integrity sha512-OKlckxBjFl0oXxcj9FU6oB8fDAaiRUq+D8jrFWGmOfI/gIyjk/IeS75LMzgYKUaeHzLUcYvf9bbJGSrUwTfwwQ== dependencies: busboy "^1.6.0" @@ -7574,12 +7442,12 @@ url-set-query@^1.0.0: integrity sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg== url@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.1.tgz#26f90f615427eca1b9f4d6a28288c147e2302a32" - integrity sha512-rWS3H04/+mzzJkv0eZ7vEDGiQbgquI1fGfOad6zKvgYQi1SzMmhl7c/DdRGxhaWrVH6z0qWITo8rpnxK/RfEhA== + version "0.11.2" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.2.tgz#02f250a6e0d992b781828cd456d44f49bf2e19dd" + integrity sha512-7yIgNnrST44S7PJ5+jXbdIupfU1nWUdQJBFBeJRclPXiWgCvrSq5Frw8lr/i//n5sqDfzoKmBymMS81l4U/7cg== dependencies: punycode "^1.4.1" - qs "^6.11.0" + qs "^6.11.2" utf-8-validate@5.0.7: version "5.0.7" @@ -7588,13 +7456,6 @@ utf-8-validate@5.0.7: dependencies: node-gyp-build "^4.3.0" -utf-8-validate@6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-6.0.3.tgz#7d8c936d854e86b24d1d655f138ee27d2636d777" - integrity sha512-uIuGf9TWQ/y+0Lp+KGZCMuJWc3N9BHA+l/UmHd/oUHwJJDeysyTRxNQVkbzsIWfGFbRe3OcgML/i0mvVRPOyDA== - dependencies: - node-gyp-build "^4.3.0" - utf-8-validate@^5.0.2: version "5.0.10" resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.10.tgz#d7d10ea39318171ca982718b6b96a8d2442571a2" @@ -7644,9 +7505,9 @@ uuid@^8.3.2: integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== uuid@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" - integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== + version "9.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" + integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== v8-compile-cache-lib@^3.0.1: version "3.0.1" @@ -7959,7 +7820,7 @@ which-typed-array@^1.1.10, which-typed-array@^1.1.11, which-typed-array@^1.1.2: gopd "^1.0.1" has-tostringtag "^1.0.0" -which@1.3.1, which@^1.1.1, which@^1.2.9, which@^1.3.1: +which@1.3.1, which@^1.1.1, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -8031,11 +7892,6 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== -ws@8.13.0: - version "8.13.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" - integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== - ws@^3.0.0: version "3.3.3" resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" @@ -8115,7 +7971,7 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@13.1.2, yargs-parser@^13.1.0: +yargs-parser@13.1.2, yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==