Skip to content

Instantly share code, notes, and snippets.

@covelitein
Created February 23, 2023 10:33
a2e's deploy.js
const hre = require('hardhat')
const fs = require('fs')
async function main() {
const Contract = await hre.ethers.getContractFactory('AnswerToEarn')
const contract = await Contract.deploy()
await contract.deployed()
const address = JSON.stringify({ address: contract.address }, null, 4)
fs.writeFile('./src/abis/contractAddress.json', address, 'utf8', (err) => {
if (err) {
console.error(err)
return
}
console.log('Deployed contract address', contract.address)
})
}
main().catch((error) => {
console.error(error)
process.exitCode = 1
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment