Skip to content
Lattice

IAccount

Git Source

ERC-4337 account interface.

Functions

validateUserOp

Validates a user operation on behalf of the EntryPoint.

MUST be gated to msg.sender == entryPoint. MUST NOT revert on a signature mismatch — instead return validationData with the low bit set (SIG_VALIDATION_FAILED == 1). If missingAccountFunds is non-zero, the account MUST transfer at least that much to the EntryPoint (msg.sender).

function validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash, uint256 missingAccountFunds)
        external
        returns (uint256 validationData);

Parameters

NameTypeDescription
userOpPackedUserOperationThe packed user operation.
userOpHashbytes32The EntryPoint-computed hash the signature is over (already domain-bound).
missingAccountFundsuint256The prefund the account owes the EntryPoint for this op.

Returns

NameTypeDescription
validationDatauint256Packed authorizer(160) || validUntil(48) || validAfter(48); 0 = valid,
1 = signature failure.