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
_validateNonce
has been removed.An argument
uint192 key
has been added to thenonce
function. This argument is passed toentryPoint().getNonce(address(this), key);
. Previously, a constant0
was passed instead ofkey
.
SmartAccount.sol
The contract no longer inherits from the IERC165 interface.
The functions
executeCall
andexecuteBatchCall
have been renamed toexecute
andexecuteBatch
, respectively.The function
validationModule
has been optimized for gas efficiency using assembly code. Additionally, the call to the internal_validateNonce
has been removed.Functions
executeCall_s1m
andexecuteBatchCall_4by
have been renamed toexecute_ncC
andexecuteBatch_y6U
.
ModuleManager.sol
The
execTransactionFromModule
andexecBatchTransactionFromModule
functions have become payable.A new argument
txGas
has been added to theexecTransactionFromModuleReturnData
function. The previous version of this function withouttxGas
now callsexecTransactionFromModuleReturnData
with a zerotxGas
amount.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
execBatchTransactionFromModule
function, instead of calling theexecute
function from the Executor.sol library, calls the internal_executeFromModule
. This function, in turn, calls_execute
from 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
deployAccount
function, the checkif (initializer.length > 0)
has been deleted.
EcdsaOwnershipRegistryModule.sol
The internal
_verifySignature
function has been updated to check if the signature was made overdataHash.toEthSignedMessageHash()
.The new internal
_transferOwnership
function has been added.The new view function
getOwner
has been added, which returns theowner
address forsmartAccount
.New
renounceOwnership
function has been added, which set zeroowner
address 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
validateUserOp
function directly decodes data fromuserOp.signature[MODULE_SIGNATURE_OFFSET:]
.The
validateUserOp
function was updated by verification that thesessionKeyManager
module is an enabled module.The function
isValidSignatureUnsafe
is not supported.
SessionKeyManagerModule.sol
The function
isValidSignatureUnsafe
is not supported.Instead of using a two-step process for decoding data from the signature, the
validateUserOp
function directly decodes data fromuserOp.signature[MODULE_SIGNATURE_OFFSET:]
.
PasskeyRegistryModule.sol
A new view function named
getOwner
has been added, which returnssmartAccountPasskey[smartAccount]
.The
_verifySignature
function has been updated to get the newaddress smartAccount
argument. Previously, this function used themsg.sender
address.In the
isValidSignature
function, themsg.sender
is now passed to theisValidSignatureForAddress
function, which in turn calls the updated_verifySignature
.