Closed OFRBG closed 5 years ago
Thanks @OFRBG for filing this issue! I've confirmed that this is an issue when forking on v6.3.0 and v6.2.5.
Just jotting down some of the research i've done on this one... This issue is caused by ForkedBlockchain.js
's storageTrieCache
object being shared between eth_sendTransaction
and eth_estimateGas
calls. eth_estimateGas
essentially poison's the live cache instead of cloning and using it's own.
This should now be fixed in our latest beta https://github.com/trufflesuite/ganache-core/releases/tag/v2.5.5-beta.0 Let me know if you have any more issues or if the fix doesn't work for you!
Expected Behavior
When calling a
payable
fallback, themsg.value
is equal to the wei attached as value.Current Behavior
When calling a
payable
fallback, themsg.value
is equal to twice the wei attached as value.(Running
npx ganache-cli --fork https://mainnet.infura.io/metamask
with version Ganache CLI v6.3.0 (ganache-core: 2.4.0), themsg.value
seems to double.)Possible Solution
I can't find the issue.
Steps to Reproduce (for bugs)
npx ganache-cli --fork https://mainnet.infura.io/metamask
balanceOf
for the address that deposited. The balance is2000000000000000000
wei.Context
The error isn't present when connecting to Kovan or Mainnet.
Your Environment