We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem: TypeError: Cannot read properties of undefined (reading 'provider') at getBalance (/coffee-contracts/scripts/buy-coffee.js:5:44).
Solution //buy-coffee.js
const { ethers } = require("hardhat") const hre = require("hardhat") // Returns the Ether balance of a given address. async function getBalance(address) { const balanceBigInt = await ethers.provider.getBalance(address) return hre.ethers.utils.formatEther(balanceBigInt) }
The text was updated successfully, but these errors were encountered:
thanks for the solution!
Sorry, something went wrong.
No branches or pull requests
I was having issues with this error while running through the tutorial and wanted to share a solution.
Problem:
TypeError: Cannot read properties of undefined (reading 'provider') at getBalance (/coffee-contracts/scripts/buy-coffee.js:5:44).
Solution
//buy-coffee.js
The text was updated successfully, but these errors were encountered: