Skip to content

Commit

Permalink
make governance env param
Browse files Browse the repository at this point in the history
  • Loading branch information
johannbarbie committed Feb 1, 2019
1 parent 85cdced commit c384bb3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions migrations/4_deploy_governance.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = (deployer, network, accounts) => {
const admin = accounts[1];
const proposalTime = process.env.PROPOSAL_TIME || DEFAULT_PROPOSAL_TIME;
const ownerAddr = process.env.GOV_OWNER;
const govAddr = process.env.GOV_ADDR;
const deployedToken = process.env.DEPLOYED_TOKEN;

deployer.then(async () => {
Expand All @@ -31,9 +32,15 @@ module.exports = (deployer, network, accounts) => {
nativeToken = await NativeToken.deployed();
}

log(' 🕐 Deploying Governance with proposal time:', durationToString(proposalTime));
const governance = await deployer.deploy(MinGov, proposalTime);

let governance;
if (govAddr) {
log(' Using existing Governance at:', govAddr);
governance = await MinGov.at(govAddr);
} else {
log(' 🕐 Deploying Governance with proposal time:', durationToString(proposalTime));
governance = await deployer.deploy(MinGov, proposalTime);
}

const bridgeProxy = await BridgeProxy.deployed();
log(' 🔄 Transferring ownership for Bridge:', bridgeProxy.address);
await bridgeProxy.changeAdmin(governance.address, { from: admin });
Expand Down

0 comments on commit c384bb3

Please sign in to comment.