Replies: 3 comments 5 replies
-
So I've even copy pasted Patrick's abi and contract addresses in the demo code. Still the error persists. |
Beta Was this translation helpful? Give feedback.
-
confirm your network on mata mask make sure your intially connected to a network whose chainId is enabled in constant you can also add this to your code this fix it if(raffleAddress){}
in the update ui async function updateUI() {
if(raffleAddress){
const feeFromCall = (await getEnteranceFee()).toString()
setFee(feeFromCall)
console.log(fee)
}
} |
Beta Was this translation helpful? Give feedback.
-
After some couple of hours i think i found whats going on. i run your code on my pc heres something intersting go back to your backend and deploy the contracts again run hh node make sure you also have this changes async function updateUI() {
if(raffleAddress){
const feeFromCall = (await getEnteranceFee()).toString()
setFee(feeFromCall)
console.log(fee)
}
} i strongly advive to use local network like in the video remeber to mark this as answer phew! @PatrickAlphaC |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Been stuck with this for 2 days
I can't get the enteranceFee from the contract using the function. Idk why
I've even copy pasted Patrick's abi and contract addresses in the demo code. Still the error persists.
I am using sepolia network on metamask and i've also provided the contract address for sepolia too
UPDATE : It seems that this happens when I start or refresh the app. After I start and edit few code and save the file. The error dissappears and it shows correct entranceFee. But I still don't consider this bug to be solved so if anybody could help I'd really be grateful
NOTE : When I use
yarn hardhat node
, the frontend files get updated but when I useyarn hardhat deploy --network sepolia
then the front end files are not getting updated. So I just pasted the contract address for sepolia in my contract-address fileMy component :
My contractAddresses.json file :
My updateFrontend code :
Beta Was this translation helpful? Give feedback.
All reactions