Skip to content

Commit

Permalink
deploy: skip deploying known EvmScriptRegistryFactory if given to DAO…
Browse files Browse the repository at this point in the history
…Factory (#570)
  • Loading branch information
sohkai authored Feb 6, 2020
1 parent d469c33 commit 1164625
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/deploy-daofactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ const ZERO_ADDR = '0x0000000000000000000000000000000000000000'

const defaultKernelBase = process.env.KERNEL_BASE
const defaultAclBaseAddress = process.env.ACL_BASE
const defaultEvmScriptRegistryFactoryAddress = process.env.EVM_REG_FACTORY

module.exports = async (
truffleExecCallback,
{
artifacts = globalArtifacts,
kernelBaseAddress = defaultKernelBase,
aclBaseAddress = defaultAclBaseAddress,
evmScriptRegistryFactoryAddress = defaultEvmScriptRegistryFactoryAddress,
withEvmScriptRegistryFactory = true,
verbose = true
} = {}
Expand Down Expand Up @@ -47,8 +49,14 @@ module.exports = async (
let evmScriptRegistryFactory
if (withEvmScriptRegistryFactory) {
const EVMScriptRegistryFactory = artifacts.require('EVMScriptRegistryFactory')
evmScriptRegistryFactory = await EVMScriptRegistryFactory.new()
await logDeploy(evmScriptRegistryFactory, { verbose })

if (evmScriptRegistryFactoryAddress) {
evmScriptRegistryFactory = EVMScriptRegistryFactory.at(evmScriptRegistryFactoryAddress)
log(`Skipping deploying new EVMScriptRegistryFactory, using provided address: ${evmScriptRegistryFactoryAddress}`)
} else {
evmScriptRegistryFactory = await EVMScriptRegistryFactory.new()
await logDeploy(evmScriptRegistryFactory, { verbose })
}
}
const daoFactory = await DAOFactory.new(
kernelBase.address,
Expand Down

0 comments on commit 1164625

Please sign in to comment.