Submitted by Franfran, also found by gogo, immeas, Koolex, zaskoh, MalfurionWhitehat, and zaskoh
contracts/smart-contract-wallet/BaseSmartAccount.sol#L60-L68
contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L319-L329
contracts/smart-contract-wallet/BaseSmartAccount.sol#L60-L68
Some parts of the codebase are not compliant with the EIP-4337 from the EIP-4337 specifications, at multiple degrees of severity.
Sender existence
If we take a look at the _createSenderIfNeeded() function, we can see that its not properly implemented:
The statement in the EIP implies that if the account does not exist, the initcode must be used.
In this case, it first check if the initcode exists, but this condition should be checked later.
This could be rewritten to:
Account
The third specification of the validateUserOp() is the following:
This is currently not the case, as the case when the account does not support signature aggregation is not supported right now in the code. The validateUserOp() reverts everytime if the recovered signature does not match.
Additionally, the validateUserOp() should return a time range, as per the EIP specifications:
This isnt the case. It just returns a signature deadline validity, which would probably be here the validUntil value.
Aggregator
This part deals with the aggregator interfacing:
This aggregator address validation is not done.
Refactor the code that is not compliant with the EIP.
livingrockrises (Biconomy) confirmed and commented:
