Pre-requisites for using a sessionKey in remote-signing
EtherspotWallet account should have SessionKeyValidator module installed.
SessionKeyValidator varies with the kind of operation performed, i.e there can be multiple kinds of SessionKeyValidator and the nonce to be used as part of userOp is generated from the address of SessionKeyValidator
Example:ERC20SessionKeyValidator is used to perform the erc20 based operations from etherspotWalletAddress
All validations on the UserOp (ERC20 operations) are done by ERC20SessionKeyValidator module
Nonce used during the UserOp Estimation is to be from:
This nonce is later used to identify the validatorModule used during the validationPhase in EntryPoint contract.
Copy
function validateUserOp( PackedUserOperation calldata userOp, bytes32 userOpHash, uint256 missingAccountFunds) external payable virtual override onlyEntryPoint payPrefund(missingAccountFunds) returns (uint256 validSignature){ address validator; // @notice validator encoding in nonce is just an example! // @notice this is not part of the standard! // Account Vendors may choose any other way to implement validator selection uint256 nonce = userOp.nonce; assembly { validator := shr(96, nonce) }