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

Commit

Permalink
Add optional value to pass salt to presets (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
hazim-j authored Aug 3, 2023
1 parent db3258c commit 71968fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/preset/builder/kernel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class Kernel extends UserOperationBuilder {
instance.factory.address,
instance.factory.interface.encodeFunctionData("createAccount", [
await instance.signer.getAddress(),
ethers.BigNumber.from(0),
ethers.BigNumber.from(opts?.salt ?? 0),
]),
]);
await instance.entryPoint.callStatic.getSenderAddress(instance.initCode);
Expand Down
2 changes: 1 addition & 1 deletion src/preset/builder/simpleAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class SimpleAccount extends UserOperationBuilder {
instance.factory.address,
instance.factory.interface.encodeFunctionData("createAccount", [
await instance.signer.getAddress(),
ethers.BigNumber.from(0),
ethers.BigNumber.from(opts?.salt ?? 0),
]),
]);
await instance.entryPoint.callStatic.getSenderAddress(instance.initCode);
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export interface ISendUserOperationResponse {
export interface IPresetBuilderOpts {
entryPoint?: string;
factory?: string;
salt?: BigNumberish;
paymasterMiddleware?: UserOperationMiddlewareFn;
overrideBundlerRpc?: string;
}
Expand Down

0 comments on commit 71968fd

Please sign in to comment.