Skip to content

Commit 34ed3b8

Browse files
committed
ran linter
1 parent ba184eb commit 34ed3b8

32 files changed

+905
-156
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dist: trusty
22
sudo: required
33
language: node_js
44
node_js:
5-
- '12'
5+
- '16'
66
cache:
77
directories:
88
- node_modules

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: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ const ContractABIPaths = {
4040
MaticXCAmpleRebaseGateway: 'contracts/satellite-chain/bridge-gateways',
4141
MaticXCAmpleTransferGateway: 'contracts/satellite-chain/bridge-gateways',
4242

43+
AMPLArbitrumGateway: 'contracts/base-chain/bridge-gateways',
44+
ArbitrumXCAmpleGateway: 'contracts/satellite-chain/bridge-gateways',
45+
4346
// utilities
4447
ChainBridgeBatchRebaseReport: 'contracts/_utilities',
4548
};
@@ -54,11 +57,18 @@ const getCompiledContractFactory = (ethers, contract) => {
5457
);
5558
};
5659

57-
const deployContract = async (ethers, contractName, signer, args, txParams) => {
60+
const deployContract = async (
61+
ethers,
62+
contractName,
63+
signer,
64+
args,
65+
txParams,
66+
waitBlocks = 0,
67+
) => {
5868
// console.log('Deploying', contractName);
5969
const Factory = await getCompiledContractFactory(ethers, contractName);
6070
const contract = await Factory.connect(signer).deploy(...args, txParams);
61-
await contract.deployTransaction.wait();
71+
await contract.deployTransaction.wait(waitBlocks);
6272
// console.log('Deployed');
6373
return contract;
6474
};
@@ -75,6 +85,7 @@ const deployProxyContract = async (
7585
args,
7686
initializerDef,
7787
txParams,
88+
waitBlocks = 0,
7889
) => {
7990
// console.log('Deploying proxy', contractName);
8091
const ProxyAdminFactory = await getCompiledContractFactory(
@@ -88,7 +99,7 @@ const deployProxyContract = async (
8899
initializerDef,
89100
txParams,
90101
);
91-
await contract.deployTransaction.wait();
102+
await contract.deployTransaction.wait(waitBlocks);
92103
// console.log('Deployed');
93104

94105
const defaultProxyAdmin = ProxyAdminFactory.connect(signer).attach(
@@ -99,7 +110,7 @@ const deployProxyContract = async (
99110
newProxyAdmin.address,
100111
txParams,
101112
);
102-
await refChangeTx.wait();
113+
await refChangeTx.wait(waitBlocks);
103114

104115
return contract;
105116
};
@@ -111,7 +122,7 @@ const upgradeProxyContract = async (
111122
deployedContractRef,
112123
signer,
113124
txParams,
114-
force=false,
125+
force = false,
115126
) => {
116127
const proxyAdmin = await getDeployedContractInstance(
117128
network,
@@ -125,25 +136,24 @@ const upgradeProxyContract = async (
125136
ethers.provider,
126137
);
127138

128-
const currentImplAddr = await proxyAdmin.getProxyImplementation(proxy.address);
129-
console.log(`Current implementation for ${contractName} is at`, currentImplAddr);
139+
const currentImplAddr = await proxyAdmin.getProxyImplementation(
140+
proxy.address,
141+
);
142+
console.log(
143+
`Current implementation for ${contractName} is at`,
144+
currentImplAddr,
145+
);
130146

131147
// deploy new implementation
132148
let newImpl;
133-
if(!force) {
149+
if (!force) {
134150
const Factory = await getCompiledContractFactory(ethers, contractName);
135151
newImpl = await upgrades.prepareUpgrade(proxy.address, Factory);
136152
} else {
137-
console.log(`CAUTION: Skpping storage layout verification!`)
138-
console.log(`CANCEL NOW to stop, this action is not reversable`)
153+
console.log(`CAUTION: Skpping storage layout verification!`);
154+
console.log(`CANCEL NOW to stop, this action is not reversable`);
139155
await sleep(10);
140-
newImpl = await deployContract(
141-
ethers,
142-
contractName,
143-
signer,
144-
[],
145-
txParams,
146-
);
156+
newImpl = await deployContract(ethers, contractName, signer, [], txParams);
147157
}
148158
console.log(`New implementation for ${contractName} is at`, newImpl.address);
149159

0 commit comments

Comments
 (0)