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

Commit 71968fd

Browse files
authored
Add optional value to pass salt to presets (#87)
1 parent db3258c commit 71968fd

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/preset/builder/kernel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class Kernel extends UserOperationBuilder {
9191
instance.factory.address,
9292
instance.factory.interface.encodeFunctionData("createAccount", [
9393
await instance.signer.getAddress(),
94-
ethers.BigNumber.from(0),
94+
ethers.BigNumber.from(opts?.salt ?? 0),
9595
]),
9696
]);
9797
await instance.entryPoint.callStatic.getSenderAddress(instance.initCode);

src/preset/builder/simpleAccount.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class SimpleAccount extends UserOperationBuilder {
6767
instance.factory.address,
6868
instance.factory.interface.encodeFunctionData("createAccount", [
6969
await instance.signer.getAddress(),
70-
ethers.BigNumber.from(0),
70+
ethers.BigNumber.from(opts?.salt ?? 0),
7171
]),
7272
]);
7373
await instance.entryPoint.callStatic.getSenderAddress(instance.initCode);

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export interface ISendUserOperationResponse {
106106
export interface IPresetBuilderOpts {
107107
entryPoint?: string;
108108
factory?: string;
109+
salt?: BigNumberish;
109110
paymasterMiddleware?: UserOperationMiddlewareFn;
110111
overrideBundlerRpc?: string;
111112
}

0 commit comments

Comments
 (0)