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

BUG: Cannot return an NFT with special classID #245

Open
giansalex opened this issue Mar 3, 2023 · 1 comment
Open

BUG: Cannot return an NFT with special classID #245

giansalex opened this issue Mar 3, 2023 · 1 comment
Labels
golang ics-721 Possible protocol vulnerability

Comments

@giansalex
Copy link
Contributor

giansalex commented Mar 3, 2023

After transfer via IBC an NFT that has a classID with special characters (e.g: p/0/1), I can't return it to the origin chain.

Environment

Steps to Reproduce

  • Create collection with special chars and mint an NFT
iris tx nft issue disperze/0/1 
iris tx nft mint disperze/0/1 gonft001
  • Transfer to JUNO
iris tx nft-transfer transfer nft-transfer channel-24 <receiver> disperze/0/1 gonft001
  • Return to origin (IRIS)
MSG='{"send_nft": {"contract": "juno1stv6sk0mvku34fj2mqrlyru6683866n306mfv52tlugtl322zmks26kg7a", "token_id": "gonft001", "msg": "eyAicmVjZWl2ZX.....zF9IH0gfQ=="}}'

junod tx wasm execute <cw721-contract> "$MSG"

Expected and Actual Behavior

Expected: Recover the original NFT on IRIS
Actual: Error ibc/C99502011F102E8562678BB2FD928A7CC78E051C207DF6908C3F1E30BD9F1D5C: nft class does not exist

Additional Context

ClassID sent from JUNO chain: wasm.juno1stv6sk0mvku34fj2mqrlyru6683866n306mfv52tlugtl322zmks26kg7a/channel-89/disperze/0/1
but nft-transfer module is searching classID: "ibc/" + sha256("disperze/0/1") instead disperze/0/1

Txs
IRIS: https://gon.ping.pub/iris/tx/5210E17BB09FD3B3DDB77844C9D3E375182251275DA84F386925734FE3910D81
JUNO: https://blueprints.juno.giansalex.dev/#/transactions/5E7EAB3013FEA650ADB1B91D1A6F4FAD2DEF0BB66B7C7989FF11B67450EDFA58

go method:
https://github.com/bianjieai/nft-transfer/blob/v1.1.1-beta/types/trace.go#L64

@giansalex
Copy link
Contributor Author

This bug also affects other IBC events, such as IBC Timeout, IBC Ack with error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
golang ics-721 Possible protocol vulnerability
Projects
None yet
Development

No branches or pull requests

2 participants