Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Reason for use of defaultOp in UserOperationBuilder #118

Open
sushisilence opened this issue Dec 7, 2023 · 0 comments
Open

Reason for use of defaultOp in UserOperationBuilder #118

sushisilence opened this issue Dec 7, 2023 · 0 comments

Comments

@sushisilence
Copy link

Hello team,

What is the purpose of defaultOp in the UserOperationBuilder?

userop.js/src/builder.ts

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():

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant