You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by hoangglong-nguyen November 13, 2023
I've tried a lot of solutions on this thread relating to this bug, but none of them seem to work. My hardhat-localhost is running with metamask connected. I also console.log abi, raffleAddress, chainId and they all seem to have been connected correctly. I'm suspecting my runContractFunction is not working properly but I don't know how to fix it. Please help.
Here is my error and my console
Here is my 02-update-front-end.js
const{ frontEndContractsFile, frontEndAbiFile }=require("../helper-hardhat-config")constfs=require("fs")const{ network }=require("hardhat")module.exports=async()=>{if(process.env.UPDATE_FRONT_END){console.log("Writing to front end...")awaitupdateContractAddresses()awaitupdateAbi()console.log("Front end written!")}}asyncfunctionupdateAbi(){constraffle=awaitethers.getContract("Raffle")fs.writeFileSync(frontEndAbiFile,JSON.stringify(raffle.interface.fragments))}asyncfunctionupdateContractAddresses(){constraffle=awaitethers.getContract("Raffle")constcontractAddresses=JSON.parse(fs.readFileSync(frontEndContractsFile,"utf8"))if(network.config.chainId.toString()incontractAddresses){if(!contractAddresses[network.config.chainId.toString()].includes(raffle.address)){contractAddresses[network.config.chainId.toString()]=raffle.address}}else{contractAddresses[network.config.chainId.toString()]=[raffle.address]}fs.writeFileSync(frontEndContractsFile,JSON.stringify(contractAddresses))}module.exports.tags=["all","frontend"]
Discussed in #6286
Originally posted by hoangglong-nguyen November 13, 2023
I've tried a lot of solutions on this thread relating to this bug, but none of them seem to work. My hardhat-localhost is running with metamask connected. I also console.log abi, raffleAddress, chainId and they all seem to have been connected correctly. I'm suspecting my runContractFunction is not working properly but I don't know how to fix it. Please help.
Here is my error and my console
Here is my 02-update-front-end.js
My LotteryEntrance.js
The text was updated successfully, but these errors were encountered: