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

DecodeArgs - panic: runtime error: slice bounds out of range #22

Closed
femtoeu opened this issue Sep 29, 2022 · 1 comment
Closed

DecodeArgs - panic: runtime error: slice bounds out of range #22

femtoeu opened this issue Sep 29, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@femtoeu
Copy link

femtoeu commented Sep 29, 2022

Hello, i'm trying to decode transfer(address recipient, uint256 amount) function and sometimes i'm get this error:

github.com/lmittmann/w3.(*Func).DecodeArgs(...)
        C:/Users/James/go/pkg/mod/github.com/lmittmann/[email protected]/func.go:88
main.main.func1({0x12, 0x26, 0xa8, 0xc7, 0x8d, 0xa0, 0x1, 0xf0, 0x7a, 0x9b, ...})

I dont know which transaction makes this error.

@lmittmann lmittmann added the bug Something isn't working label Sep 29, 2022
@lmittmann
Copy link
Owner

Thanks for reporting this. Sounds like you are trying to decode args from an empty byte slice. This should not panic but return an error.

lmittmann added a commit that referenced this issue Mar 12, 2023
* return an error in `Func.DecodeArgs` if the input is <4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants