Skip to content

Commit

Permalink
Upgrade oracles contract (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsudmi authored May 25, 2022
1 parent e1891e2 commit ba0ce66
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .openzeppelin/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -1573,8 +1573,8 @@
}
},
"18c76f9f9c8cbc616449cdc622ac25ad9bd25971f8875f66a6c1201056b8b325": {
"address": "0xDb123d84CdB055fdbFa9058f64A460BB0fBF8eAE",
"txHash": "0x647d2cf174087c56fb6e6ffd75054f3a5ea1ed8572e280f27bdf13b7da691202",
"address": "0xfc9B67b6034F6B306EA9Bd8Ec1baf3eFA2490394",
"txHash": "0xa6941b8f3ab34a4f5b2d898f96dbf7f990efa8c03882af17db1b8d6c6d94a841",
"layout": {
"storage": [
{
Expand Down
4 changes: 2 additions & 2 deletions .openzeppelin/unknown-31337.json
Original file line number Diff line number Diff line change
Expand Up @@ -1573,8 +1573,8 @@
}
},
"18c76f9f9c8cbc616449cdc622ac25ad9bd25971f8875f66a6c1201056b8b325": {
"address": "0xDb123d84CdB055fdbFa9058f64A460BB0fBF8eAE",
"txHash": "0x647d2cf174087c56fb6e6ffd75054f3a5ea1ed8572e280f27bdf13b7da691202",
"address": "0xfc9B67b6034F6B306EA9Bd8Ec1baf3eFA2490394",
"txHash": "0xa6941b8f3ab34a4f5b2d898f96dbf7f990efa8c03882af17db1b8d6c6d94a841",
"layout": {
"storage": [
{
Expand Down
26 changes: 2 additions & 24 deletions deployments/index.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
const { white, green } = require('chalk');
const { ethers, upgrades, config } = require('hardhat');
const { contracts, contractSettings } = require('./settings');

function log(message) {
if (config != null && config.suppressLogs !== true) {
console.log(message);
}
}

async function upgradeOracles() {
const signer = await ethers.provider.getSigner(contractSettings.admin);
const Oracles = await ethers.getContractFactory('Oracles', signer);

// upgrade Oracles to new implementation
const proxy = await upgrades.upgradeProxy(contracts.oracles, Oracles);
return proxy.deployed();
}
const { contracts } = require('./settings');

async function deployContracts() {
const Oracles = await ethers.getContractFactory('Oracles');
let impl = await upgrades.prepareUpgrade(contracts.oracles, Oracles);
log(white(`Deployed Oracles implementation contract: ${green(impl)}`));
return contracts;
}

async function upgradeContracts() {
await deployContracts();
await upgradeOracles();
log(white('Upgraded Oracles contract'));
return contracts;
}

Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require('hardhat-contract-sizer');
require('hardhat-abi-exporter');
require('@nomiclabs/hardhat-etherscan');

const BLOCK_NUMBER = 14754000;
const BLOCK_NUMBER = 14841650;
const OPTIMIZER_RUNS = 5000000;
const log = (...text) => console.log(gray(...['└─> [DEBUG]'].concat(text)));

Expand Down
2 changes: 1 addition & 1 deletion test/Proxies.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let proxies = [
let implementations = [
'0xe68E649862F7036094f1E4eD5d69a738aCDE666f',
'0xfa00515082fe90430C80DA9B299f353929653d7B',
'0xDb123d84CdB055fdbFa9058f64A460BB0fBF8eAE',
'0xfc9B67b6034F6B306EA9Bd8Ec1baf3eFA2490394',
'0x41bcac23e4db058d8D7aAbE2Fccdae5F01FE647A',
'0x7cA75ccf264b2d9F91D4ABA7639fC7FcC73a7e09',
'0xA28C2d79f0c5B78CeC699DAB0303008179815396',
Expand Down

0 comments on commit ba0ce66

Please sign in to comment.