'Why do I always get "Returned values are not valid, did it run Out of Gas"?
I'm new on Ethereum blockchain and I'm working on deploy and using smart contracts using truffle on my private blockchain.
I have followed exactly this guide https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts
But every time i call getBalance() function
-> truffle(develop)> let balance = await instance.getBalance(accounts[0])
-> truffle(develop)> balance.toNumber()
I get the error: Returned values are not valid, did it run Out of Gas
So I added a simple smart contract getNumber() then return a simply integer (3) and I always get the same error.
But if I invoke sendCoin() function I don't get any error and I write correctly the transaction.
So I get the error any time I try to get values from the blockchain.
Someone can help me?
Solution 1:[1]
Chances are you did not deploy your contract properly. Interacting with a not exist or wrong contract could lead to that error message.
In truffle develop, try migrate command to compile and deploy your contracts and then see if it can work.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | StillFantasy |
