@@ -5,56 +5,56 @@ pragma solidity ^0.8.12;
55/* solhint-disable no-inline-assembly */
66/* solhint-disable reason-string */
77
8- import "../interfaces/IWallet .sol " ;
8+ import "../interfaces/IAccount .sol " ;
99import "../interfaces/IEntryPoint.sol " ;
1010
1111/**
12- * Basic wallet implementation.
13- * this contract provides the basic logic for implementing the IWallet interface - validateUserOp
14- * specific wallet implementation should inherit it and provide the wallet -specific logic
12+ * Basic account implementation.
13+ * this contract provides the basic logic for implementing the IAccount interface - validateUserOp
14+ * specific account implementation should inherit it and provide the account -specific logic
1515 */
16- abstract contract BaseWallet is IWallet {
16+ abstract contract BaseAccount is IAccount {
1717 using UserOperationLib for UserOperation;
1818
1919 /**
20- * return the wallet nonce.
20+ * return the account nonce.
2121 * subclass should return a nonce value that is used both by _validateAndUpdateNonce, and by the external provider (to read the current nonce)
2222 */
2323 function nonce () public view virtual returns (uint256 );
2424
2525 /**
26- * return the entryPoint used by this wallet .
27- * subclass should return the current entryPoint used by this wallet .
26+ * return the entryPoint used by this account .
27+ * subclass should return the current entryPoint used by this account .
2828 */
2929 function entryPoint () public view virtual returns (IEntryPoint);
3030
3131 /**
3232 * Validate user's signature and nonce.
3333 * subclass doesn't need to override this method. Instead, it should override the specific internal validation methods.
3434 */
35- function validateUserOp (UserOperation calldata userOp , bytes32 userOpHash , address aggregator , uint256 missingWalletFunds )
35+ function validateUserOp (UserOperation calldata userOp , bytes32 userOpHash , address aggregator , uint256 missingAccountFunds )
3636 external override virtual returns (uint256 deadline ) {
3737 _requireFromEntryPoint ();
3838 deadline = _validateSignature (userOp, userOpHash, aggregator);
3939 if (userOp.initCode.length == 0 ) {
4040 _validateAndUpdateNonce (userOp);
4141 }
42- _payPrefund (missingWalletFunds );
42+ _payPrefund (missingAccountFunds );
4343 }
4444
4545 /**
4646 * ensure the request comes from the known entrypoint.
4747 */
4848 function _requireFromEntryPoint () internal virtual view {
49- require (msg .sender == address (entryPoint ()), "wallet : not from EntryPoint " );
49+ require (msg .sender == address (entryPoint ()), "account : not from EntryPoint " );
5050 }
5151
5252 /**
5353 * validate the signature is valid for this message.
5454 * @param userOp validate the userOp.signature field
5555 * @param userOpHash convenient field: the hash of the request, to check the signature against
5656 * (also hashes the entrypoint and chain-id)
57- * @param aggregator the current aggregator. can be ignored by wallets that don't use aggregators
57+ * @param aggregator the current aggregator. can be ignored by accounts that don't use aggregators
5858 * @return deadline the last block timestamp this operation is valid, or zero if it is valid indefinitely.
5959 * Note that the validation code cannot use block.timestamp (or block.number) directly.
6060 */
@@ -63,8 +63,8 @@ abstract contract BaseWallet is IWallet {
6363
6464 /**
6565 * validate the current nonce matches the UserOperation nonce.
66- * then it should update the wallet 's state to prevent replay of this UserOperation.
67- * called only if initCode is empty (since "nonce" field is used as "salt" on wallet creation)
66+ * then it should update the account 's state to prevent replay of this UserOperation.
67+ * called only if initCode is empty (since "nonce" field is used as "salt" on account creation)
6868 * @param userOp the op to validate.
6969 */
7070 function _validateAndUpdateNonce (UserOperation calldata userOp ) internal virtual ;
@@ -74,20 +74,20 @@ abstract contract BaseWallet is IWallet {
7474 * subclass MAY override this method for better funds management
7575 * (e.g. send to the entryPoint more than the minimum required, so that in future transactions
7676 * it will not be required to send again)
77- * @param missingWalletFunds the minimum value this method should send the entrypoint.
77+ * @param missingAccountFunds the minimum value this method should send the entrypoint.
7878 * this value MAY be zero, in case there is enough deposit, or the userOp has a paymaster.
7979 */
80- function _payPrefund (uint256 missingWalletFunds ) internal virtual {
81- if (missingWalletFunds != 0 ) {
82- (bool success ,) = payable (msg .sender ).call {value : missingWalletFunds , gas : type (uint256 ).max}("" );
80+ function _payPrefund (uint256 missingAccountFunds ) internal virtual {
81+ if (missingAccountFunds != 0 ) {
82+ (bool success ,) = payable (msg .sender ).call {value : missingAccountFunds , gas : type (uint256 ).max}("" );
8383 (success);
84- //ignore failure (its EntryPoint's job to verify, not wallet .)
84+ //ignore failure (its EntryPoint's job to verify, not account .)
8585 }
8686 }
8787
8888 /**
8989 * expose an api to modify the entryPoint.
90- * must be called by current "admin" of the wallet .
90+ * must be called by current "admin" of the account .
9191 * @param newEntryPoint the new entrypoint to trust.
9292 */
9393 function updateEntryPoint (address newEntryPoint ) external {
@@ -97,7 +97,7 @@ abstract contract BaseWallet is IWallet {
9797
9898 /**
9999 * ensure the caller is allowed "admin" operations (such as changing the entryPoint)
100- * default implementation trust the wallet itself (or any signer that passes "validateUserOp")
100+ * default implementation trust the account itself (or any signer that passes "validateUserOp")
101101 * to be the "admin"
102102 */
103103 function _requireFromAdmin () internal view virtual {
0 commit comments