-
Notifications
You must be signed in to change notification settings - Fork 682
Zero balance in funded wallets #4404
Comments
I'm actually using: const privateKey = "0xe8ee08a685d093206043f7274958f3a51944ce0b49393d20fd9fed2d0585077b";
const account = web3.eth.accounts.privateKeyToAccount(privateKey);
const balance = await web3.eth.getBalance(account.address); |
I am having what seems to be the same problem. I airdrop test tokens to an account. I can query for those tokens in console and they show. But my test script that queries all 10 accounts for their test token balances all show 0 tokens. Ganache > Contracts tab show this error: ⚠ Your Truffle Project can no longer be found. Did you delete or move it? Update the location or restart Ganache. Even though the location is correct. |
@Kevin-Mok that branch works for me: ganache output:
code ouput:
@jehtee, your issue seems to be for Ganache UI. |
I have the same problem, launching ganache as follows: ganache-cli --fork https://eth-mainnet.alchemyapi.io/v2/<my_key> --networkId 1 --db c:/tmp/ganache-db/ --mnemonic "scare hope major aspect clock input dial anchor whale catalog bachelor nice" When calling eth_getBalance(), ganache allways returns 0. |
@nagualdev if the db exists new accounts aren't refunded. #1030 is that your issue? |
@davidmurdoch when I launch it, I can see the list of accounts with their balances (100ETH) in the console. |
@nagualdev I believe that's related to the bug in #1030. If the start up mnemonic/seed/accounts have changed since the DB was created it lies to you about their account balance on start up. It's a very annoying bug and I'm sorry it exists :-( |
I have the same problem with Ganache GUI.
I am pretty sure that worked 2 years ago ;-) UPDATE |
@SvenMeyer can you open an issue on Ganache UI for this? What you are describing is a slightly different bug. |
I am having a similar issue on ganache-cli. It seems like my wallets are funded until I run any transaction, then all the funded wallets lose their 100ETH |
Similar issue here. I launch it with
Initial output looks correct
After a while tho, all accounts (except the first one) report a balance of 0 ETH
Second account > 0?!
Third account > 0?!
Is this guys something you'll be fixing? Thanks |
@marcello33 Looks like you have a db but changed mnemonics and other start up params. This doesn't work. See: #756 But no, Consensys doesn't maintain Ganache anymore (no one does) and won't be fixing it. |
When I launch Ganache with
ganache --wallet.accounts 0xe8ee08a685d093206043f7274958f3a51944ce0b49393d20fd9fed2d0585077b,50000000000000000000
, I see:But when I do
web3.eth.getBalance(0x4f2D6eB43A905aE40D1921188ae41d213660Cb40)
in my code, this returns 0, and I cannot send any transactions. Why is this happening? You can run my code here on thebalance
branch.The text was updated successfully, but these errors were encountered: