diff --git a/scripts/deploy.ts b/scripts/deploy.ts index 4a80551..e867b37 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -110,9 +110,9 @@ export const deploy = async ( console.log('run the following command to verify the contract:'); const paramsStr = params.map((param) => { if (hre.ethers.BigNumber.isBigNumber(param)) { - return param.toString(); + return `"${param.toString()}"`; } - return param; + return `"${param}"`; }).join(' '); console.log(`npx hardhat verify --network ${hre.network.name} ${contract.address} ${paramsStr}`); diff --git a/scripts/utils/helper.ts b/scripts/utils/helper.ts index 6bca414..96d1c9c 100644 --- a/scripts/utils/helper.ts +++ b/scripts/utils/helper.ts @@ -7,8 +7,22 @@ export const estimateGas = async (hre: HardhatRuntimeEnvironment, tx: Deferrable const estimatedGasPrice = await hre.ethers.provider.getGasPrice(); const estimatedGas = estimatedGasUnit.mul(estimatedGasPrice); console.log('Estimated gas unit: ', estimatedGasUnit.toString()); - console.log('Estimated gas price (WEI): ', estimatedGasPrice.toString()); - console.log('Estimated gas (ETH): ', hre.ethers.utils.formatEther(estimatedGas)); + console.log('Estimated gas price (GWei): ', estimatedGasPrice.div(1000000000).toString()); + console.log(`Estimated gas (${getTokenName(hre)}): `, hre.ethers.utils.formatEther(estimatedGas)); return estimatedGas; } +const getTokenName = (hre: HardhatRuntimeEnvironment) => { + switch(hre.network.name) { + case 'mainnet': + case 'sepolia': + case 'goerli': + return 'ETH'; + case 'polygon': + case 'mumbai': + return 'MATIC'; + default: + return 'ETH'; + } +} +