-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5042cf0
commit 7910fb3
Showing
3 changed files
with
102 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const { types } = require('hardhat/config'); | ||
const { txTask, loadSignerSync, etherscanVerify } = require('../helpers/tasks'); | ||
const { getDeployedContractInstance, upgradeProxyContract } = require('../helpers/contracts'); | ||
|
||
txTask( | ||
'upgrade:xc_ample', | ||
'Uprades the implementation of the xc-ample ERC-20 contract', | ||
) | ||
.addParam('force', 'Skip storage layout verification', false, types.boolean) | ||
.setAction(async (args, hre) => { | ||
const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; | ||
if (txParams.gasPrice == 0) { | ||
txParams.gasPrice = await hre.ethers.provider.getGasPrice(); | ||
} | ||
|
||
const deployer = await loadSignerSync(args, hre.ethers.provider); | ||
const deployerAddress = await deployer.getAddress(); | ||
|
||
console.log('------------------------------------------------------------'); | ||
console.log('Deployer:', deployerAddress); | ||
console.log(txParams); | ||
|
||
console.log('------------------------------------------------------------'); | ||
console.log('Upgrading xc-ample contract'); | ||
const newImpl = await upgradeProxyContract( | ||
hre.ethers, | ||
hre.network.name, | ||
'XCAmple', | ||
'xcAmple', | ||
deployer, | ||
txParams, | ||
args.force | ||
); | ||
|
||
console.log('------------------------------------------------------------'); | ||
console.log('Verify on etherscan'); | ||
await etherscanVerify(hre, newImpl.address); | ||
}); |