Notable changes
New function isValidSignatureUnsafe
This view function was introduced in SmartAccount.sol contract to validate an EIP-1271 signature by calling the function of the same name, isValidSignatureUnsafe, in a trusted module. In a successful validation, the return value will be EIP1271_MAGIC_VALUE, while a failed validation will return bytes4(0xffffffff). This is in accordance with the standard EIP-1271.
In turn, this new isValidSignatureUnsafe function was implemented in EcdsaOwnershipRegistryModule and PasskeyRegistryModule modules' contracts. This function, unlike the implementation of the isValidSignature, does not add a prefix "\x19Ethereum Signed Message:\n52" to the hash of the data to be validated by _verifySignature to check that this data was signed by the signature of the expected signer. Also, the new isValidSignatureForAddressUnsafe function was introduced in EcdsaOwnershipRegistryModule, which allows to verify signatures like the isValidSignatureUnsafe but for any smart account address. The modules BatchedSessionRouterModule and SessionKeyManager do not support the isValidSignatureUnsafe function and will revert when called with any arguments.
Minor differences
BaseSmartAccount.sol
The internal function
_validateNoncehas been removed.An argument
uint192 keyhas been added to thenoncefunction. This argument is passed toentryPoint().getNonce(address(this), key);. Previously, a constant0was passed instead ofkey.
SmartAccount.sol
The contract no longer inherits from the IERC165 interface.
The functions
executeCallandexecuteBatchCallhave been renamed toexecuteandexecuteBatch, respectively.The function
validationModulehas been optimized for gas efficiency using assembly code. Additionally, the call to the internal_validateNoncehas been removed.Functions
executeCall_s1mandexecuteBatchCall_4byhave been renamed toexecute_ncCandexecuteBatch_y6U.
ModuleManager.sol
The
execTransactionFromModuleandexecBatchTransactionFromModulefunctions have become payable.A new argument
txGashas been added to theexecTransactionFromModuleReturnDatafunction. The previous version of this function withouttxGasnow callsexecTransactionFromModuleReturnDatawith a zerotxGasamount.The contract uses a linked list of allowed modules. The first module is always the auth module, which is necessary for validating user operations and to not brick the contract. All other modules are linked to it. The
_disableModule()function prevents the removal of the first auth module.The
execBatchTransactionFromModulefunction, instead of calling theexecutefunction from the Executor.sol library, calls the internal_executeFromModule. This function, in turn, calls_executefrom Executor.sol and emits events in case of successful and unsuccessful execution.
SmartAccountFactory.sol
The contract is inherited from the Stakeable.sol contract.
The Proxy contract has been renamed to BiconomyMSAProxy. The contract itself remains unchanged.
In the
deployAccountfunction, the checkif (initializer.length > 0)has been deleted.
EcdsaOwnershipRegistryModule.sol
The internal
_verifySignaturefunction has been updated to check if the signature was made overdataHash.toEthSignedMessageHash().The new internal
_transferOwnershipfunction has been added.The new view function
getOwnerhas been added, which returns theowneraddress forsmartAccount.New
renounceOwnershipfunction has been added, which set zeroowneraddress formsg.sender.
BatchedSessionRouterModule.sol
Added
uint256 private constant MODULE_SIGNATURE_OFFSET = 96;.Instead of using a two-step process for decoding data from the signature, the
validateUserOpfunction directly decodes data fromuserOp.signature[MODULE_SIGNATURE_OFFSET:].The
validateUserOpfunction was updated by verification that thesessionKeyManagermodule is an enabled module.The function
isValidSignatureUnsafeis not supported.
SessionKeyManagerModule.sol
The function
isValidSignatureUnsafeis not supported.Instead of using a two-step process for decoding data from the signature, the
validateUserOpfunction directly decodes data fromuserOp.signature[MODULE_SIGNATURE_OFFSET:].
PasskeyRegistryModule.sol
A new view function named
getOwnerhas been added, which returnssmartAccountPasskey[smartAccount].The
_verifySignaturefunction has been updated to get the newaddress smartAccountargument. Previously, this function used themsg.senderaddress.In the
isValidSignaturefunction, themsg.senderis now passed to theisValidSignatureForAddressfunction, which in turn calls the updated_verifySignature.