increased logging, added localhost config to hardhat for gas approximation

This commit is contained in:
mfahampshire
2022-01-25 19:10:17 +01:00
parent 0a2ce7fa6d
commit 147be7afd9
4 changed files with 14 additions and 14 deletions
@@ -4,20 +4,26 @@ const contracts = require("../../contractAddresses.json");
const fs = require('file-system');
async function main() {
const BandwidthGenerator = await ethers.getContractFactory("BandwidthGenerator");
console.log('preparing to deploy contract...')
// if this is failing, check whether the ERC20 address has been manually added to the contract addresses json file
const bandwidthGenerator = await BandwidthGenerator.deploy(
contracts.mainnet.NYM_ERC20,
contracts.mainnet.GRAVITY
);
console.log('...contract successfully deployed...');
contracts.mainnet.BANDWIDTH_GENERATOR = bandwidthGenerator.address;
// the location of the json file is relative to where you are running the script from - run from root of directory
fs.writeFileSync('./contractAddresses.json', JSON.stringify(contracts), (err) => {
if (err) throw err;
});
console.log(`bandwidthGenerator.sol deployed at ${bandwidthGenerator.address}`);
console.log(`...bandwidthGenerator.sol deployed at ${bandwidthGenerator.address}`);
}
main()
@@ -11,13 +11,15 @@ async function main() {
contracts.rinkeby.GRAVITY
);
console.log("deploying...");
contracts.rinkeby.BANDWIDTH_GENERATOR = bandwidthGenerator.address;
// the location of the json file is relative to where you are running the script from - run from root of directory
fs.writeFileSync('./contractAddresses.json', JSON.stringify(contracts), (err) => {
if (err) throw err;
});
console.log(`bandwidthGenerator.sol deployed at ${bandwidthGenerator.address}`);
console.log(`...bandwidthGenerator.sol deployed at ${bandwidthGenerator.address}`);
}
main()