Extraneous data in eth_call response is not handled correctly #23998
Labels
bug
feature/web3/wallet/core
feature/web3/wallet
Integrating Ethereum+ wallet support
OS/Android
Fixes related to Android browser functionality
OS/Desktop
QA Pass - Android ARM
QA Pass-Linux
QA Pass-macOS
QA Pass-Win64
QA/Yes
release-notes/include
Milestone
Per https://community.brave.com/t/wrong-price-to-vusdc/400120.
The result of calling
balanceOf(address account) → uint256
on the VUSDC contract (BSC network) returns0x0000000000000000000000000000000000000000000000000000000000045d120000000000000000000000000000000000000000000000000000000000000000000000000
which is 32 + 32 bytes.Since we consider the entire hex string as the
uint256
response, the resulting balance is incorrect. Etherscan, ethers, and other libraries only extract the first 32 bytes, so we should have same behaviour in brave-core. We should do the same forallowance(address owner, address spender) → uint256
as well.Note that there's already a function called
GetUint256HexFromData
ineth_abi_decoder.cc
that we can use for this purpose.Contact me if you need VUSDC on BSC network to test.
The text was updated successfully, but these errors were encountered: