create more than one

aniket-engg 3 weeks ago committed by Aniket
parent 51d710868b
commit 35f56c9f43
  1. 9
      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: {

Loading…
Cancel
Save