From fb39f70b024f5ef610de741cd6d4c285e0f659ce Mon Sep 17 00:00:00 2001 From: kopy-kat Date: Thu, 6 Mar 2025 15:56:38 +0000 Subject: [PATCH 1/3] feat: sort attesters --- .../accounts/nexus/toNexusSmartAccount.ts | 18 ++++++++++++++++-- .../accounts/safe/toSafeSmartAccount.ts | 4 +++- 2 files changed, 19 insertions(+), 3 deletions(-) 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 ] }), From 58f1e783d67e5021caef58582953b5146f0328b5 Mon Sep 17 00:00:00 2001 From: Garvit Khatri Date: Thu, 6 Mar 2025 16:17:02 +0000 Subject: [PATCH 2/3] Add changeset --- .changeset/pretty-mangos-flash.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/pretty-mangos-flash.md diff --git a/.changeset/pretty-mangos-flash.md b/.changeset/pretty-mangos-flash.md new file mode 100644 index 00000000..2e8075d2 --- /dev/null +++ b/.changeset/pretty-mangos-flash.md @@ -0,0 +1,5 @@ +--- +"permissionless": patch +--- + +Fixed sorting of attestors for safe and nexus From 76225bb7ae9ceb45e4bf2952f28ce0ef0a1e1afc Mon Sep 17 00:00:00 2001 From: Garvit Khatri Date: Thu, 6 Mar 2025 21:50:24 +0530 Subject: [PATCH 3/3] Update pretty-mangos-flash.md --- .changeset/pretty-mangos-flash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/pretty-mangos-flash.md b/.changeset/pretty-mangos-flash.md index 2e8075d2..6efa99f9 100644 --- a/.changeset/pretty-mangos-flash.md +++ b/.changeset/pretty-mangos-flash.md @@ -2,4 +2,4 @@ "permissionless": patch --- -Fixed sorting of attestors for safe and nexus +Fixed sorting of attesters for safe and nexus