|
1 | 1 | const { types } = require('hardhat/config');
|
2 | 2 | const { txTask, loadSignerSync, etherscanVerify } = require('../helpers/tasks');
|
3 |
| -const { getDeployedContractInstance, upgradeProxyContract } = require('../helpers/contracts'); |
| 3 | +const { |
| 4 | + getDeployedContractInstance, |
| 5 | + upgradeProxyContract, |
| 6 | +} = require('../helpers/contracts'); |
4 | 7 |
|
5 | 8 | txTask(
|
6 | 9 | 'upgrade:xc_ample',
|
7 | 10 | 'Uprades the implementation of the xc-ample ERC-20 contract',
|
8 | 11 | )
|
9 |
| -.addParam('force', 'Skip storage layout verification', false, types.boolean) |
10 |
| -.setAction(async (args, hre) => { |
11 |
| - const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; |
12 |
| - if (txParams.gasPrice == 0) { |
13 |
| - txParams.gasPrice = await hre.ethers.provider.getGasPrice(); |
14 |
| - } |
| 12 | + .addParam('force', 'Skip storage layout verification', false, types.boolean) |
| 13 | + .setAction(async (args, hre) => { |
| 14 | + const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; |
| 15 | + if (txParams.gasPrice == 0) { |
| 16 | + txParams.gasPrice = await hre.ethers.provider.getGasPrice(); |
| 17 | + } |
15 | 18 |
|
16 |
| - const deployer = await loadSignerSync(args, hre.ethers.provider); |
17 |
| - const deployerAddress = await deployer.getAddress(); |
| 19 | + const deployer = await loadSignerSync(args, hre.ethers.provider); |
| 20 | + const deployerAddress = await deployer.getAddress(); |
18 | 21 |
|
19 |
| - console.log('------------------------------------------------------------'); |
20 |
| - console.log('Deployer:', deployerAddress); |
21 |
| - console.log(txParams); |
| 22 | + console.log('------------------------------------------------------------'); |
| 23 | + console.log('Deployer:', deployerAddress); |
| 24 | + console.log(txParams); |
22 | 25 |
|
23 |
| - console.log('------------------------------------------------------------'); |
24 |
| - console.log('Upgrading xc-ample contract'); |
25 |
| - const newImpl = await upgradeProxyContract( |
26 |
| - hre.ethers, |
27 |
| - hre.network.name, |
28 |
| - 'XCAmple', |
29 |
| - 'xcAmple', |
30 |
| - deployer, |
31 |
| - txParams, |
32 |
| - args.force |
33 |
| - ); |
| 26 | + console.log('------------------------------------------------------------'); |
| 27 | + console.log('Upgrading xc-ample contract'); |
| 28 | + const newImpl = await upgradeProxyContract( |
| 29 | + hre.ethers, |
| 30 | + hre.network.name, |
| 31 | + 'XCAmple', |
| 32 | + 'xcAmple', |
| 33 | + deployer, |
| 34 | + txParams, |
| 35 | + args.force, |
| 36 | + ); |
34 | 37 |
|
35 |
| - console.log('------------------------------------------------------------'); |
36 |
| - console.log('Verify on etherscan'); |
37 |
| - await etherscanVerify(hre, newImpl.address); |
38 |
| -}); |
| 38 | + console.log('------------------------------------------------------------'); |
| 39 | + console.log('Verify on etherscan'); |
| 40 | + await etherscanVerify(hre, newImpl.address); |
| 41 | + }); |
0 commit comments