From 40c2a0d75be9fe24845bab8fb6566a85274157f3 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 29 Dec 2024 21:41:54 +0000 Subject: [PATCH] docs: add FAQ entry about saltNonce in Safe account creation Co-Authored-By: Kristof Gazso --- docs/pages/permissionless/faqs.mdx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/pages/permissionless/faqs.mdx b/docs/pages/permissionless/faqs.mdx index ca477a3c..de97cf5d 100644 --- a/docs/pages/permissionless/faqs.mdx +++ b/docs/pages/permissionless/faqs.mdx @@ -44,3 +44,24 @@ const userOp = await smartAccountClient.prepareUserOperation({ preVerificationGas: 100_000n, }) ``` + +## Do I need the same saltNonce to re-initialize my Safe? + +When initializing a Safe account with `toSafeSmartAccount`, if you want to get the same account address when re-initializing the Safe wallet, you must use the same `saltNonce` value that was used during the initial creation. + +Using a different `saltNonce` will result in a different account address being generated. Here's an example of how to specify the `saltNonce`: + +```typescript +const safeAccount = await toSafeSmartAccount({ + client: publicClient, + entryPoint: { + address: entryPoint07Address, + version: "0.7", + }, + owners: [someSigner], + saltNonce: 100n, // must match the original saltNonce to get the same address + version: "1.4.1", +}); +``` + +For more details about the `saltNonce` parameter and other configuration options, see the [reference documentation for toSafeSmartAccount](/permissionless/reference/accounts/toSafeSmartAccount#saltnonce).