Skip to content

Commit

Permalink
Merge pull request #188 from varasev/security-audit
Browse files Browse the repository at this point in the history
(Fix) A few enhancements in migrations/2_deploy_contract.js
  • Loading branch information
varasev authored Sep 18, 2018
2 parents 6c2c779 + 3f0da30 commit 8acbbe1
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions migrations/2_deploy_contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ module.exports = function(deployer, network, accounts) {

deployer.then(async function() {
if (!!process.env.DEPLOY_POA === true) {
poaNetworkConsensus = PoaNetworkConsensus.at(poaNetworkConsensusAddress);
let validators = await poaNetworkConsensus.getValidators.call();
const mocIndex = validators.indexOf(masterOfCeremony.toLowerCase())
if (mocIndex > -1) {
validators.splice(mocIndex, 1);
let validators = [];

if (poaNetworkConsensusAddress) {
poaNetworkConsensus = PoaNetworkConsensus.at(poaNetworkConsensusAddress);
validators = await poaNetworkConsensus.getValidators.call();
const mocIndex = validators.indexOf(masterOfCeremony.toLowerCase())
if (mocIndex > -1) {
validators.splice(mocIndex, 1);
}
}

poaNetworkConsensus = await PoaNetworkConsensus.new(masterOfCeremony, validators);
Expand Down Expand Up @@ -155,9 +159,9 @@ module.exports = function(deployer, network, accounts) {

// Initialize VotingToManageEmissionFunds
await votingToManageEmissionFunds.init(
moment.utc().add(3, 'months').unix(),
7776000,
604800,
demoMode ? moment.utc().add(10, 'minutes').unix() : moment.utc().add(3, 'months').unix(),
demoMode ? 3600 : 7776000, // emissionReleaseThreshold: 1 hour for demo, 3 months for production
demoMode ? 1500 : 604800, // distributionThreshold: 25 minutes for demo, 7 days for production
emissionFunds.address
);

Expand Down

0 comments on commit 8acbbe1

Please sign in to comment.