Update contract addresses file on deploy
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 33s Details

This commit is contained in:
Ladd Hoffman 2024-03-17 12:06:06 -05:00
parent 5fd2841e77
commit 7e13449514
2 changed files with 7 additions and 2 deletions

View File

@ -6,7 +6,9 @@
"scripts": {
"test": "hardhat test",
"automatic-staking-local": "hardhat run --network localhost scripts/automatic-staking.js",
"automatic-staking-sepolia": "hardhat run --network sepolia scripts/automatic-staking.js"
"automatic-staking-sepolia": "hardhat run --network sepolia scripts/automatic-staking.js",
"deploy-local": "hardhat run --network localhost scripts/deploy.js",
"deploy-sepolia": "hardhat run --network sepolia scripts/deploy.js"
},
"author": "",
"license": "ISC",

View File

@ -3,6 +3,8 @@ const fs = require('fs');
const contractAddresses = require('../../contract-addresses.json');
const contractAddressesWritePath = '../contract-addresses.json';
const network = process.env.HARDHAT_NETWORK;
async function main() {
@ -19,7 +21,8 @@ async function main() {
console.log(`Work1 deployed to ${work1.target}`);
contractAddresses[network].Work1 = work1.target;
fs.writeFileSync('../../contract-addresses.json', JSON.stringify(contractAddresses, null, 2));
fs.writeFileSync(contractAddressesWritePath, JSON.stringify(contractAddresses, null, 2));
console.log('Wrote file', fs.realpathSync(contractAddressesWritePath));
}
// We recommend this pattern to be able to use async/await everywhere