-
Notifications
You must be signed in to change notification settings - Fork 20.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
return msg.sender.balance;
returns unexpected value in Geth
#14989
Comments
So, regarding I don't know what geth could do differently, so I'll close this. If it's not working as intended, or I've misinterpreted it, please open it again. |
Maybe should be reopened, because the first issue did not fully represent the bug reported on remix: The wrong result is also returned when trying to return the balance of an arbitrary address:
I documented a detailed account in this comment, and it seems most like a Geth issue to me. |
This is related to: eth/api_backend.go func (b *EthAPIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmCfg vm.Config) (*vm.EVM, func() error, error) { math.MaxBig256 == 115792089237316195423570985008687907853269984665640564039455084007913129639935 Is a constant in Geth( common/math/big.go) |
This issue is preventing the use of |
Referring from Solidity issue #2325
Geth returning an unexpected number when calling a constant function which returns
msg.sender.balance
A demonstration contract similar to the following was deployed on Rinkeby here
System information
Geth version:
geth version
Expected behaviour
function constSenderBal() constant returns (uint256)
should return the balance of the sender when called from console.Actual behaviour
Returns a huge garbage (perhaps negative) number. Correct number is event logged by a TX calling
function senderBal()
Steps to reproduce the behaviour
Behaviour seems only to present only in Geth.
The text was updated successfully, but these errors were encountered: