Skip to content
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

seth output error #935

Open
henry-hz opened this issue Apr 11, 2022 · 5 comments
Open

seth output error #935

henry-hz opened this issue Apr 11, 2022 · 5 comments

Comments

@henry-hz
Copy link
Contributor

When using the token command to check the balance, got an error:

token balance $CONTRACT $ETH_FROM
Error: invalid data for function output (arg="data", errorArg="", errorValue="0x", value="0x", reason="insufficient data for uint256 type", version=4.0.32)
@henry-hz henry-hz changed the title token utility output token cli output error Apr 11, 2022
@henry-hz
Copy link
Contributor Author

in fact, the issue is with seth:

seth call $ETH_USDT "balanceOf(address)(uint)" $ETH_FROM

@henry-hz henry-hz changed the title token cli output error seth output error Apr 11, 2022
@henry-hz
Copy link
Contributor Author

henry-hz commented Apr 11, 2022

in fact, the issue is with the abi decoding in seth, when the returned balance is zero

❯ seth --abi-decode 'balanceOf(address)(uint)' '0x'
Error: invalid data for function output (arg="data", errorArg="", errorValue="0x", value="0x", reason="insufficient data for uint256 type", version=4.0.32)

@saucepoint
Copy link

This command works fine for me:

seth call 0xdAC17F958D2ee523a2206206994597C13D831ec7 "balanceOf(address)(uint)" 0x3355d6E71585d4e619f4dB4C7c5Bfe549b278299
2656420038

Also replacing uint with uint256 yields the same result, was going to suggest that but doesnt seem like it makes a difference

@henry-hz
Copy link
Contributor Author

@saucepoint yep, the issue is only when the return value is 0, so the return value is 0x that causes the error. I think that it was working in the former releases, and maybe ethers changed how they deal with it.

@RaphaelNdonga
Copy link

I got this error when I had set the wrong $ETH_RPC_URL

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

No branches or pull requests

3 participants