Skip to content

Commit

Permalink
Merge pull request sphinx-labs#589 from chugsplash/pate/fix-run-again…
Browse files Browse the repository at this point in the history
…st-local-network

fix(core): Fix initializeChugSplash failure on network where contracts are already deployed
  • Loading branch information
RPate97 authored Apr 7, 2023
2 parents aa56f3c + f178a5e commit ba246c5
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions packages/core/src/languages/solidity/predeploys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,22 @@ export const initializeChugSplash = async (
logger?.info('[ChugSplash]: deployed ChugSplashRegistry')
logger?.info('[ChugSplash]: initializing ChugSplashRegistry...')

await (
await ChugSplashRegistry.initialize(
executors,
await getGasPriceOverrides(provider)
)
).wait()
try {
await (
await ChugSplashRegistry.initialize(
executors,
await getGasPriceOverrides(provider)
)
).wait()
} catch (err) {
if (
err.message.includes('Initializable: contract is already initialized')
) {
logger?.info('[ChugSplash]: registry was already initialized')
} else {
throw err
}
}

for (const executorAddress of executors) {
assert(
Expand Down

0 comments on commit ba246c5

Please sign in to comment.