Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

_address.call.gas(_gas)() adds 2300 to the value of _gas if the call fails. #89

Closed
beether opened this issue Mar 18, 2018 · 1 comment
Closed

Comments

@beether
Copy link

beether commented Mar 18, 2018

LogNumber(_gas);
if (!_address.call.gas(_gas)()) {
  LogNumber(_gas);
}

Pretty concise title. If you emit an event both before and after doing the above address call, you'll see the second event has a value of 2300 more. It only appears to happen if the call fails. In my example, it fails with out of gas (which may or may not be relevant -- I haven't tested that.) If it matters, _gas is a parameter to a function public which is called directly from web3.

Expected Behavior

Since there is no explicit assignment to _gas, its value should remain unchanged.

Current Behavior

As described above. 2300 is added. This bug did not exist in previous versions of ganache.

Your Environment

Ganache CLI v6.1.0 (ganache-core: 2.1.0)

Other Notes

I'm the most thorough tester in these parts.

@benjamincburns
Copy link
Contributor

Hi @beether sorry it took us so long to get back to you on this one.

Is this still an issue for you? If so, is the issue reproducing on geth and parity? If the issue doesn't reproduce on geth & parity then this is very likely a bug in ethereumjs/ethereumjs-vm. If it does reproduce in geth & parity then it's either expected behavior (seems unlikely) or a bug in ethereum/solidity.

As a result of the above I'm going to close this issue, however please respond back here if you think I've done this in error and I'll take another look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants