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

Reason for use of defaultOp in UserOperationBuilder #118

@sushisilence

Description

@sushisilence

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions