diff --git a/.changeset/pretty-mangos-flash.md b/.changeset/pretty-mangos-flash.md new file mode 100644 index 00000000..6efa99f9 --- /dev/null +++ b/.changeset/pretty-mangos-flash.md @@ -0,0 +1,5 @@ +--- +"permissionless": patch +--- + +Fixed sorting of attesters for safe and nexus diff --git a/packages/permissionless/accounts/nexus/toNexusSmartAccount.ts b/packages/permissionless/accounts/nexus/toNexusSmartAccount.ts index 2991b588..0ca3c2ae 100644 --- a/packages/permissionless/accounts/nexus/toNexusSmartAccount.ts +++ b/packages/permissionless/accounts/nexus/toNexusSmartAccount.ts @@ -164,7 +164,14 @@ export async function toNexusSmartAccount( } ], functionName: "createAccount", - args: [localOwner.address, index, attesters, threshold] + args: [ + localOwner.address, + index, + attesters.sort((left, right) => + left.toLowerCase().localeCompare(right.toLowerCase()) + ), + threshold + ] }) } } @@ -202,7 +209,14 @@ export async function toNexusSmartAccount( } ], functionName: "computeAccountAddress", - args: [localOwner.address, index, attesters, threshold] + args: [ + localOwner.address, + index, + attesters.sort((left, right) => + left.toLowerCase().localeCompare(right.toLowerCase()) + ), + threshold + ] }) return accountAddress diff --git a/packages/permissionless/accounts/safe/toSafeSmartAccount.ts b/packages/permissionless/accounts/safe/toSafeSmartAccount.ts index 65b3e574..2737010b 100644 --- a/packages/permissionless/accounts/safe/toSafeSmartAccount.ts +++ b/packages/permissionless/accounts/safe/toSafeSmartAccount.ts @@ -581,7 +581,9 @@ const get7579LaunchPadInitData = ({ module: hook.address, initData: hook.context })), - attesters, + attesters.sort((left, right) => + left.toLowerCase().localeCompare(right.toLowerCase()) + ), attestersThreshold ] }),