Skip to content

Commit

Permalink
(Update) Prepare to HF2 in Core
Browse files Browse the repository at this point in the history
  • Loading branch information
varasev committed Oct 5, 2018
1 parent e6e04e9 commit e1e8a67
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 45 deletions.
3 changes: 2 additions & 1 deletion migrations/2_deploy_contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ module.exports = function(deployer, network, accounts) {
"PROXY_ADDRESS": proxyStorage.address,
"POA_ADDRESS": poaNetworkConsensusAddress,
"EMISSION_FUNDS_ADDRESS": emissionFunds.address,
"REWARD_BY_BLOCK_ADDRESS": rewardByBlock.address
"REWARD_BY_BLOCK_ADDRESS": rewardByBlock.address,
"MOC": masterOfCeremony
};

fs.writeFileSync('./contracts.json', JSON.stringify(contracts, null, 2));
Expand Down
14 changes: 8 additions & 6 deletions scripts/migrate/migrateAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ async function main() {
console.log('');

console.log('VotingToManageEmissionFunds.init...');
const distributionThreshold = 259200; // three days, in seconds
const emissionReleaseThreshold = 604800; // seven days, in seconds
const emissionReleaseTime = Math.floor(new Date() / 1000) + emissionReleaseThreshold; // now plus emissionReleaseThreshold (unix timestamp)
const distributionThreshold = 604800; // seven days, in seconds
const emissionReleaseThreshold = 7776000; // three months, in seconds
const emissionReleaseTime = 1550509200; // Monday, 18-Feb-2019 17:00:00 UTC (unix timestamp)
init = votingToManageEmissionFundsInstance.methods.init(
emissionReleaseTime,
emissionReleaseThreshold,
Expand Down Expand Up @@ -282,9 +282,11 @@ async function main() {
emissionFundsAddress.should.be.equal(
EthereumUtil.toChecksumAddress(await rewardByBlockInstance.methods.emissionFunds().call())
);
'0x0000000000000000000000000000000000000000'.should.be.equal(
await rewardByBlockInstance.methods.bridgeContract().call()
);
(await rewardByBlockInstance.methods.bridgesAllowed().call()).should.be.deep.equal([
'0x0000000000000000000000000000000000000000',
'0x0000000000000000000000000000000000000000',
'0x0000000000000000000000000000000000000000'
]);
process.env.PROXY_STORAGE_NEW_ADDRESS.should.be.equal(
await rewardByBlockInstance.methods.proxyStorage().call()
);
Expand Down
12 changes: 9 additions & 3 deletions scripts/migrate/migrateVotings.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,15 @@ async function votingToChangeMigrateAndCheck(sender, key, chainId, contractName)

console.log(' Set miningByVoting...');
let miningByVoting = {};
events = await keysManagerInstance.getPastEvents('ValidatorInitialized', {fromBlock: 0, toBlock: 'latest'});
for (i = 0; i < events.length; i++) {
miningByVoting[events[i].returnValues.votingKey] = events[i].returnValues.miningKey;
try {
events = await keysManagerInstance.getPastEvents('ValidatorInitialized', {fromBlock: 0, toBlock: 'latest'});
for (i = 0; i < events.length; i++) {
miningByVoting[events[i].returnValues.votingKey] = events[i].returnValues.miningKey;
}
} catch (events_err) {
if (events_err.message.indexOf('Returned values aren\'t valid') < 0) {
throw events_err;
}
}
events = await keysManagerInstance.getPastEvents('VotingKeyChanged', {fromBlock: 0, toBlock: 'latest'});
for (i = 0; i < events.length; i++) {
Expand Down
56 changes: 21 additions & 35 deletions scripts/migrate/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e1e8a67

Please sign in to comment.