diff --git a/libs/remix-ui/run-tab/src/lib/actions/account.ts b/libs/remix-ui/run-tab/src/lib/actions/account.ts index a039f05b40d..203da5a1ff2 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/account.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/account.ts @@ -113,7 +113,14 @@ export const createSmartAccount = async (plugin: RunTab, dispatch: React.Dispatc transport: custom(window.ethereum!), }) - const salt = 0 + let salt + const safeAddresses: string[] = Object.keys(plugin.REACT_API.smartAccounts) + if(safeAddresses.length) { + const lastSafeAddress: string = safeAddresses[safeAddresses.length - 1] + const lastSmartAccount: SmartAccount = plugin.REACT_API.smartAccounts[lastSafeAddress] + salt = lastSmartAccount.salt + 1 + } else salt = 0 + const safeAccount = await toSafeSmartAccount({ client: walletClient, entryPoint: {