Skip to content

Commit 35f56c9

Browse files
committed
create more than one
1 parent 51d7108 commit 35f56c9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

libs/remix-ui/run-tab/src/lib/actions/account.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,14 @@ export const createSmartAccount = async (plugin: RunTab, dispatch: React.Dispatc
113113
transport: custom(window.ethereum!),
114114
})
115115

116-
const salt = 0
116+
let salt
117+
const safeAddresses: string[] = Object.keys(plugin.REACT_API.smartAccounts)
118+
if(safeAddresses.length) {
119+
const lastSafeAddress: string = safeAddresses[safeAddresses.length - 1]
120+
const lastSmartAccount: SmartAccount = plugin.REACT_API.smartAccounts[lastSafeAddress]
121+
salt = lastSmartAccount.salt + 1
122+
} else salt = 0
123+
117124
const safeAccount = await toSafeSmartAccount({
118125
client: walletClient,
119126
entryPoint: {

0 commit comments

Comments
 (0)