diff --git a/.changeset/healthy-tools-impress.md b/.changeset/healthy-tools-impress.md new file mode 100644 index 00000000..cb81de9d --- /dev/null +++ b/.changeset/healthy-tools-impress.md @@ -0,0 +1,5 @@ +--- +"permissionless": patch +--- + +Fixed signMessage for safe 7579 when deployed diff --git a/packages/permissionless/accounts/safe/toSafeSmartAccount.ts b/packages/permissionless/accounts/safe/toSafeSmartAccount.ts index 2e291dfa..2723e186 100644 --- a/packages/permissionless/accounts/safe/toSafeSmartAccount.ts +++ b/packages/permissionless/accounts/safe/toSafeSmartAccount.ts @@ -1570,7 +1570,9 @@ export async function toSafeSmartAccount< const signatureBytes = concat(signatures.map((sig) => sig.data)) - return signatureBytes + return erc7579LaunchpadAddress + ? concat([zeroAddress, signatureBytes]) + : signatureBytes }, async signTypedData(typedData) { if (localOwners.length !== owners.length) { diff --git a/packages/permissionless/actions/smartAccount/signMessage.test.ts b/packages/permissionless/actions/smartAccount/signMessage.test.ts index 9f7d6379..b20a18af 100644 --- a/packages/permissionless/actions/smartAccount/signMessage.test.ts +++ b/packages/permissionless/actions/smartAccount/signMessage.test.ts @@ -110,12 +110,10 @@ describe.each(getCoreSmartAccounts())( } if (name.includes("Safe 7579")) { - return - // Due to 7579 launchpad, we can't verify the signature before deploying the account. - // await smartClient.sendTransaction({ - // calls: [{ to: zeroAddress, value: 0n }] - // }) + await smartClient.sendTransaction({ + calls: [{ to: zeroAddress, value: 0n }] + }) } const signature = await signMessage(smartClient, {