Wrong Eth balance returned in contract for <ADDR>.balance #5373
Unanswered
saad-s
asked this question in
General Q&A
Replies: 1 comment
-
@saad-s Kind regards, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to read eth balance of a given address within contract. But the value returned is too large.
My test setup is
MAC OS 12.4 (intel)
andtruffle(development)> version Truffle v5.5.21 (core: 5.5.21) Ganache v7.2.0 Solidity - 0.8.15 (solc-js) Node v18.2.0 Web3.js v1.7.4
Contract function
sample test case
Balance value in
balanceFromWeb3
is97.01
ethers which is correct value and matches Ganache UI value for account as well.But balance value from contract in
balanceFromWeb3
is180143888.x
ethers.I found this issue in geth (link) which seems related but I am unsure what to change in my setup to fix it.
Beta Was this translation helpful? Give feedback.
All reactions