-
Notifications
You must be signed in to change notification settings - Fork 678
All pre-funded address balances drop to 0 after running a transaction #4511
Comments
There is a bug when starting with an existing Another perspective of this bug: ganache should re-fund the mnemonic's accounts with 100 eth every time it starts up, but doesn't. That's probably what is happening here. Here is the issue: #1030 |
Thank you. I have |
What version of ganache? |
Ganache CLI v6.12.2 (ganache-core: 2.13.2) |
Oh. Uninstall that. It's deprecated. Install ganache via |
Thanks, I updated to latest using I am now using |
Can you paste the ganache output? |
ubuntu@ip-172-31-19-56:~$ ganache --fork https://arb-mainnet.g.alchemy.com/v2/xxxxxxxxxxxxxxx --db ./ganache-data -h 0.0.0.0 --chain.chainId 42161 --mnemonic "xxxxxxxxxxxx" --accounts=10 Available Accounts(0) 0x828ad78d7F05A0EA9E6c2e6f50B4C8a38D0229A8 (1000 ETH) Private Keys(0) xxxxxxxxxxxx HD WalletMnemonic: xxxxxxxxxxxx Default Gas Price2000000000 BlockGas Limit30000000 Call Gas Limit50000000 Forked ChainLocation: https://arb-mainnet.g.alchemy.com/v2/xxxxxxxxxxxxxxxxxxxxxxxxx ChainHardfork: shanghai RPC Listening on 0.0.0.0:8545 |
eth_call |
Hm, it seems that no transactions are being sent here. Can you provide a reproduction script? |
Sure, if I run these two scripts, afterwards I will lose my ETH in the funded accounts. For reference, I am using hardhat in typescript mode. The way to run these in hardhat is wrapETH.ts
SwapETHForUSDC
|
I haven't run this yet, but are you sure your hardhat mnemonic matches your ganache mnemonic? And that the accounts they are using are the same (your logged |
Yes I am 100% sure they are the same |
I have made a video reproducing the issue: |
And here are the logs for that video: eth_blockNumber Transaction: 0xcfa2b7ee08f8bf7fa89df8db0cf974f9d070fae676976d48ea37ce73fcb5e323 eth_chainId Transaction: 0xa436e2b5ab180af98abc1e6c53957640c2211787bf44e082f7f3cf0b0d118d1a eth_getBalance Transaction: 0x0796e07d1d9213dd025b2016cb8098d441bf11f402bb92b98c89b866170ed240 eth_getBalance Transaction: 0x8cdebb09a8e1d5a7284c3f9197cedbc80ecfc54973528981db780ba536744bab eth_getBalance Transaction: 0xd42eec6a8da4224a5b654460c5b9f6d6dae27827e294962694176c3d1ed0639a eth_getBalance Transaction: 0xc728cfb42576482fc371e88fcfb05f3831d98de148fc8ae32616b57ae8c6ef8f eth_getBalance Transaction: 0x9d3b6056be6552efb52d7061ec4f8c7dba420df3ad0872428d45ff310b1da8c3 eth_getBalance Transaction: 0xdcbdef431d0dba55495c08052ac838cbc3618fbea4e9ae6dac0cee22f39cacb3 eth_getBalance Transaction: 0x67cf3a94219538d61e43848ea64990a134ece082c1d33c58c50a8e2fd81ad817 eth_getBalance Transaction: 0x23d38d927415b28c38d49f495a1ec64a16782cc674ca86f8b06521bd3040843e eth_getBalance Transaction: 0xdc7edc8887d4c8c14397c31a8b6ded31d4b02bb3094391730fa66e4e4f7dcd35 eth_chainId |
There are 10 value transfer transactions in the logs above. I think something in your set up is draining the accounts. Try starting Ganache with |
Are you still having this issue or got it solved? |
Hi mate, are you still having this issue or got it solved? If not you can get intouch with me so we can both get it solved together because a lot of people have come with same complain and it work for them i believe we can solve this together...Don't exhitate to say hi |
Hi mate, are you still having this issue or got it solved? If not you can get in touch with me so we can both get it solved together because a lot of people have come with same complain and it work for them i believe we can solve this together...Don't wait to say hi |
I am running a forked instance of Arbitrum using ganache like so:
ganache-cli --fork https://arb-mainnet.g.alchemy.com/v2/MYAPIKEY --db ./ganache-data -h 0.0.0.0 --chainId 42161 --mnemonic "my cool mnemonic"
I receive my prefunded wallets each with 100 ETH, but when I run any smart contracts on my forked instance, afterwards all of my ether balances on my funded accounts drop to 0.
Is this intended behavior or a bug?
The text was updated successfully, but these errors were encountered: