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

[uint160] : Uint160DecodeStringBE does not produce the desired uint160 #2647

Closed
mystrycrypto opened this issue Aug 17, 2022 · 2 comments
Closed

Comments

@mystrycrypto
Copy link

hashstring := "0xd2a4cff31913016155e38e474a2c06d08be276cf"
tokenHash, _ := neoutil.Uint160DecodeStringBE(strings.TrimPrefix(hashString, "0x"))
decimals, err := client().NEP17Decimals(tokenHash)

Produce: invocation failed: Called Contract Does Not Exist: 0xcf76e28bd0062c4a478ee35561011319f3cfa4d2
Am I doing it wrong?

@roman-khimov
Copy link
Member

roman-khimov commented Aug 17, 2022

Well, that's neo-project/neo#938 that is wrong here (but it can't be fixed now) and you've got a GAS contract hash that needs to be decoded with Uint160DecodeStringLE.

Check out the new nep17 API btw (introduced in 0.99.2): https://pkg.go.dev/github.com/nspcc-dev/neo-go@v0.99.2/pkg/rpcclient/nep17

@roman-khimov
Copy link
Member

Seems to be solved to me.

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

2 participants