This repository was archived by the owner on Oct 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
This repository was archived by the owner on Oct 20, 2024. It is now read-only.
Reason for use of defaultOp in UserOperationBuilder #118
Copy link
Copy link
Open
Description
Hello team,
What is the purpose of defaultOp in the UserOperationBuilder?
Lines 28 to 38 in 1d9d0e0
| export class UserOperationBuilder { | |
| private defaultOp: IUserOperation; | |
| private currOp: IUserOperation; | |
| private middlewareStack: Array<UserOperationMiddlewareFn>; | |
| constructor() { | |
| this.defaultOp = { ...DEFAULT_USER_OP }; | |
| this.currOp = { ...this.defaultOp }; | |
| this.middlewareStack = []; | |
| } | |
I'm asking because in SimpleAccount.init():
userop.js/src/preset/builder/simpleAccount.ts
Lines 89 to 98 in 1d9d0e0
| const base = instance | |
| .useDefaults({ | |
| sender: instance.proxy.address, | |
| signature: await instance.signer.signMessage( | |
| ethers.utils.arrayify(ethers.utils.keccak256("0xdead")) | |
| ), | |
| }) | |
| .useMiddleware(instance.resolveAccount) | |
| .useMiddleware(getGasPrice(instance.provider)); | |
A default message is being signed, and some defaults are being set. For a normal EOA an extra signature is okay, but if an MPC/Hardware wallet is used, then an extra signature is not ideal.
Is it possible to skip signing a message in the SimpleAccount.init() method?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels