-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Check existing issues
- I checked there isn't already an issue for the bug I encountered.
Viem Version
2.43.1
Current Behavior
getUserOperationHash() doesn't handle properly different EIP-7702 "factory" settings.
It returns different values than the EntryPoint.getUserOperationHash(), and thus cause validation to fail.
The toPackedUserOperation should behave differently when "just packing" (for the purpose of making an ABI call) and "for signing".
- When packing it should pack the
factoryas-is, even if it is only 2 bytes (0x7702), not padding it to 20 bytes - When signing it should replace factory (which is a
0x7702with possible trailing zeros) with the current delegate (this is a mechanism that ensures a UserOp is never executed against a delegate that it wasn't explicitly signed for)
Expected Behavior
No response
Steps To Reproduce
I suggest testing the implementation of getUserOperationHash() against the values of the on-chain EntryPoint.getUserOperationHash(), to make sure they are aligned.
Unfortunately, I couldn't find a test against a contract.
e.g the tests here
Link to Minimal Reproducible Example
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
No labels