Skip to content

Commit

Permalink
Add fallback initialization of contracts for redeploy=false
Browse files Browse the repository at this point in the history
  • Loading branch information
wsdt committed Nov 20, 2023
1 parent 1fb3011 commit d99f97f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/boba/contracts/deploy/020-Teleportation.deploy.ts
Original file line number Diff line number Diff line change
@@ -136,6 +136,18 @@ const deployFn: DeployFunction = async (hre) => {
res = await Teleportation.initialize()
file.log(fileName, `Teleportation initialized: ${await res.wait()}`)
} else {
try {
const disburser = await Teleportation.disburser()
if (!disburser || disburser === ethers.constants.AddressZero) {
// not initialized
let res = await Proxy__Teleportation.initialize()
file.log(fileName, `Initialized proxy: ${await res.wait()}`)
res = await Teleportation.initialize()
file.log(fileName, `Teleportation initialized: ${await res.wait()}`)
}
} catch(err) {
file.log(fileName, `Could not initialized not initialized contracts for already deployed contracts: ${JSON.stringify(err)}`)
}
file.log(fileName, `Not initializing contract again as already done.`)
}

0 comments on commit d99f97f

Please sign in to comment.