Skip to content

Commit 4aa8b6e

Browse files
committed
restructured deployment scripts
1 parent 60f50f3 commit 4aa8b6e

29 files changed

+790
-624
lines changed

hardhat.config.js

Lines changed: 52 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ require('@nomiclabs/hardhat-etherscan');
1010
require('./tasks/deploy/ampleforth');
1111
require('./tasks/deploy/chain_bridge');
1212
require('./tasks/deploy/matic');
13+
require('./tasks/deploy/arbitrum');
1314
require('./tasks/deploy/rebase_reporter');
1415

1516
require('./tasks/ops/rebase');
@@ -26,94 +27,114 @@ module.exports = {
2627
solidity: {
2728
compilers: [
2829
{
29-
version: '0.4.24'
30+
version: '0.4.24',
3031
},
3132
{
32-
version: '0.7.6'
33+
version: '0.5.12',
3334
},
3435
{
35-
version: '0.6.4'
36+
version: '0.6.4',
3637
},
3738
{
38-
version: '0.6.8'
39+
version: '0.6.8',
3940
},
4041
{
41-
version: '0.5.12'
42+
version: '0.6.11',
43+
settings: {
44+
optimizer: {
45+
enabled: true,
46+
runs: 200,
47+
},
48+
},
4249
},
4350
{
4451
version: '0.7.3',
4552
settings: {
4653
optimizer: {
4754
enabled: true,
48-
runs: 200
49-
}
50-
}
51-
}
52-
]
55+
runs: 200,
56+
},
57+
},
58+
},
59+
{
60+
version: '0.7.6',
61+
settings: {
62+
optimizer: {
63+
enabled: true,
64+
runs: 200,
65+
},
66+
},
67+
},
68+
],
5369
},
5470
mocha: {
55-
timeout: 1000000
71+
timeout: 1000000,
5672
},
5773
gasReporter: {
5874
currency: 'USD',
5975
enabled: !!process.env.REPORT_GAS,
6076
excludeContracts: ['_mocks', '_external', 'uFragments'],
61-
coinmarketcap: process.env.COINMARKETCAP_API_KEY
77+
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
6278
},
6379

6480
etherscan: {
65-
apiKey: process.env.ETHERSCAN_API_KEY
81+
apiKey: process.env.ETHERSCAN_API_KEY,
6682
},
6783

6884
bscscan: {
69-
apiKey: process.env.BSCSCAN_API_KEY
85+
apiKey: process.env.BSCSCAN_API_KEY,
7086
},
7187

7288
networks: {
7389
localGethBaseChain: {
74-
url: 'http://localhost:7545'
90+
url: 'http://localhost:7545',
7591
},
7692
localGethSatChain1: {
77-
url: 'http://localhost:7550'
93+
url: 'http://localhost:7550',
7894
},
7995
localGethSatChain2: {
80-
url: 'http://localhost:7555'
96+
url: 'http://localhost:7555',
8197
},
8298

8399
// meter-passport
84100
dev1RopstenBaseChain: {
85-
url: 'https://eth-ropsten.alchemyapi.io/v2/' + process.env.ALCHEMY_SECRET
101+
url: 'https://eth-ropsten.alchemyapi.io/v2/' + process.env.ALCHEMY_SECRET,
86102
},
87103
dev1BscTestnetSatChain: {
88-
url: 'https://data-seed-prebsc-1-s1.binance.org:8545'
104+
url: 'https://data-seed-prebsc-1-s1.binance.org:8545',
89105
},
90106
dev1MeterTestnetSatChain: {
91-
url: 'https://rpctest.meter.io'
107+
url: 'https://rpctest.meter.io',
92108
},
93109

94110
// matic
95111
dev2GoerliBaseChain: {
96-
url: 'https://eth-goerli.alchemyapi.io/v2/' + process.env.ALCHEMY_SECRET
112+
url: 'https://eth-goerli.alchemyapi.io/v2/' + process.env.ALCHEMY_SECRET,
97113
},
98114
dev2MumbaiSatChain: {
99-
url: 'https://polygon-mumbai.infura.io/v3/' + process.env.INFURA_SECRET
115+
url: 'https://polygon-mumbai.infura.io/v3/' + process.env.INFURA_SECRET,
116+
},
117+
118+
// arbitrum
119+
dev3RinkebyBaseChain: {
120+
url: 'https://eth-rinkeby.alchemyapi.io/v2/' + process.env.ALCHEMY_SECRET,
121+
},
122+
dev3RinkebyArbitrumSatChain: {
123+
url: 'https://rinkeby.arbitrum.io/rpc',
100124
},
101125

102126
// prod
103127
prodEthereumBaseChain: {
104-
url: 'https://mainnet.infura.io/v3/' + process.env.INFURA_SECRET
128+
url: 'https://mainnet.infura.io/v3/' + process.env.INFURA_SECRET,
105129
},
106130
prodBscSatChain: {
107-
url: 'https://bsc-dataseed.binance.org'
108-
},
109-
prodAvaxSatChain: {
110-
url: 'https://api.avax.network/ext/bc/C/rpc'
131+
url: 'https://bsc-dataseed.binance.org',
111132
},
112133
prodMeterSatChain: {
113-
url: 'https://rpc.meter.io'
134+
url: 'https://rpc.meter.io',
114135
},
115136
prodMaticSatChain: {
116-
url: 'https://polygon-mainnet.infura.io/v3/' + process.env.INFURA_SECRET
117-
}
118-
}
137+
url: 'https://polygon-mainnet.infura.io/v3/' + process.env.INFURA_SECRET,
138+
},
139+
},
119140
};

helpers/contracts.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const ContractABIPaths = {
1515
UFragmentsPolicy: 'uFragments/contracts',
1616
Orchestrator: 'uFragments/contracts',
1717
MedianOracle: 'market-oracle/contracts',
18+
UFragmentsTestnet: 'contracts/_test',
1819

1920
// Chainbridge
2021
Bridge: 'chainbridge-solidity/contracts',
@@ -58,8 +59,9 @@ const deployContract = async (ethers, contractName, signer, args, txParams) => {
5859
// console.log('Deploying', contractName);
5960
const Factory = await getCompiledContractFactory(ethers, contractName);
6061
const contract = await Factory.connect(signer).deploy(...args, txParams);
61-
await contract.deployTransaction.wait();
62-
// console.log('Deployed');
62+
if (waitBlocks > 0) {
63+
await contract.deployTransaction.wait(waitBlocks);
64+
}
6365
return contract;
6466
};
6567

@@ -88,8 +90,9 @@ const deployProxyContract = async (
8890
initializerDef,
8991
txParams,
9092
);
91-
await contract.deployTransaction.wait();
92-
// console.log('Deployed');
93+
if (waitBlocks > 0) {
94+
await contract.deployTransaction.wait(waitBlocks);
95+
}
9396

9497
const defaultProxyAdmin = ProxyAdminFactory.connect(signer).attach(
9598
await getAdminAddress(signer.provider, contract.address),
@@ -99,7 +102,10 @@ const deployProxyContract = async (
99102
newProxyAdmin.address,
100103
txParams,
101104
);
102-
await refChangeTx.wait();
105+
106+
if (waitBlocks > 0) {
107+
await refChangeTx.wait(waitBlocks);
108+
}
103109

104110
return contract;
105111
};
@@ -141,7 +147,7 @@ const upgradeProxyContract = async (
141147
proxy.address,
142148
Factory.connect(signer),
143149
);
144-
await sleep(180);
150+
await sleep(30);
145151
} else {
146152
console.log(`CAUTION: Skpping storage layout verification!`);
147153
const newImpl = await deployContract(

0 commit comments

Comments
 (0)