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

feature request: ics721 handling custom collections #84

Closed
taitruong opened this issue Feb 1, 2024 · 3 comments
Closed

feature request: ics721 handling custom collections #84

taitruong opened this issue Feb 1, 2024 · 3 comments

Comments

@taitruong
Copy link
Collaborator

I was trying transferring a Juno NFT to Stargaze and got this error:
submessages: Error parsing into type cw721::query::ContractInfoResponse: unknown field minter, expected nameorsymbol: execute wasm contract failed [CosmWasm/wasmd@v0.45.0/x/wasm/keeper/keeper.go:395]

Reason is ics721 uses standard cw721, expecting ContractInfoResponse which should only contain name and symbol. But Juno collection has more than that.

command: junod query wasm contract-state smart juno1kpsy0mh58fzrl973ndvppujs9ea5xe9wggjhhg07c42l0yqk5n7st5800h '{"contract_info": {}}'

output:

{
  "data": {
    "name": "Atlas",
    "symbol": "ATL",
    "minter": "juno1xw99es9dwshk4hak3g9hajkppqu4lwnahzs0lkyd6zq7amj23pjqd7pnte",
    "royalty_bps": [
      250,
      250
    ],
    "royalty_addrs": [
      "juno1u8sql7kmx5pget7tavwlz6hhe3mxqn0h8yqr2xx288mk5g4xy58qd32as2",
      "juno1hcldlknu2mn3exckkg75tyzjnderl95zyjte2wl495z9jla0rmdqegxlxx"
    ],
    "second_admin": "juno1u8sql7kmx5pget7tavwlz6hhe3mxqn0h8yqr2xx288mk5g4xy58qd32as2"
  }
}

Solution: instead of using restrictive cw_serde, we can use serde for being more lenient and ignore all unknown fields.

@taitruong taitruong changed the title ics721 cant handle custom contracts (as expected) feature: ics721 handling custom collections Feb 1, 2024
@taitruong taitruong changed the title feature: ics721 handling custom collections feature request: ics721 handling custom collections Feb 1, 2024
@taitruong
Copy link
Collaborator Author

Tried transferring this: https://interchain.arkprotocol.io/collections/juno1kpsy0mh58fzrl973ndvppujs9ea5xe9wggjhhg07c42l0yqk5n7st5800h/Atlas%20%23896

Now getting this error:

failed to execute message; message index: 0: dispatch: submessages: dispatch: submessages: Error parsing into type ics721::state::UniversalAllNftInfoResponse: unknown field token1, expected one of image, image_data, external_url, description, name, attributes, background_color, animation_url, youtube_url: execute wasm contract failed

It is a custom AllNftInfo, CLI returns this: $CLI query wasm contract-state smart juno1kpsy0mh58fzrl973ndvppujs9ea5xe9wggjhhg07c42l0yqk5n7st5800h '{"all_nft_info":{"token_id": "Atlas #896"}}' --chain-id $CHAIN_ID --node $CHAIN_NODE --output json | jq

{
  "data": {
    "access": {
      "owner": "juno1ke55z7catvdvnhvyyh0pkvs30t09me72vcxkh5",
      "approvals": []
    },
    "info": {
      "token_uri": "ipfs://QmPjCme3eFgNia4BuRV4Y19A8eQesBSPrVqYDc5cXWxnJa/896.json",
      "extension": {
        "token1": null,
        "token2": null,
        "vesting_period": 0,
        "tier_index": 1,
        "image": "ipfs://QmUAgzXDd4ZeE93etnSQAPnxZqDV1sYV2TTnFyU5iUCwUx/896.webp",
        "image_data": null,
        "external_url": null,
        "description": "Atlas NFT is Cosmos' first generative music NFT, backed by 30 Juno. Atlas NFT is the governance of Atlas DAO, which aims to create sustainable value and passive yield for its members. The mission of Atlas DAO is to foster a thriving ecosystem that benefits all stakeholders, while also making a positive impact through charitable donations and volunteer work",
        "name": "Atlas #896",
        "attributes": [
          {
            "display_type": null,
            "trait_type": "BACKGROUND",
            "value": "LIQUIDBLUE"
          },
          {
            "display_type": null,
            "trait_type": "SHAPE",
            "value": "CIRCLE"
          },
          {
            "display_type": null,
            "trait_type": "LEVEL",
            "value": "LEVEL_1"
          },
          {
            "display_type": null,
            "trait_type": "HOLD",
            "value": "EARTH"
          },
          {
            "display_type": null,
            "trait_type": "BACKLIGHT",
            "value": "RED"
          },
          {
            "display_type": null,
            "trait_type": "CHARACTER",
            "value": "ARIA"
          },
          {
            "display_type": null,
            "trait_type": "CLOTHES",
            "value": "BLACK SS"
          },
          {
            "display_type": null,
            "trait_type": "ACCESSORIES",
            "value": "NONE"
          },
          {
            "display_type": null,
            "trait_type": "OVERLAYS",
            "value": "NONE"
          },
          {
            "display_type": null,
            "trait_type": "HEAD",
            "value": "PONYTAIL"
          },
          {
            "display_type": null,
            "trait_type": "EYE",
            "value": "BROWN"
          },
          {
            "display_type": null,
            "trait_type": "BASE",
            "value": "Only Strings attached"
          },
          {
            "display_type": null,
            "trait_type": "HARMONY",
            "value": "Small women Choir"
          },
          {
            "display_type": null,
            "trait_type": "MELODY",
            "value": "A single Bouzouki"
          },
          {
            "display_type": null,
            "trait_type": "PATTERN",
            "value": "Mallet groove"
          },
          {
            "display_type": null,
            "trait_type": "RHYTHM",
            "value": "Trunk on trunk"
          }
        ],
        "background_color": null,
        "animation_url": "ipfs://QmU8eh3xFoM3ePFWBVtXBKiikxKCqEHeh5TgdN5w2sq6hv/896.mp3",
        "youtube_url": null
      }
    }
  }
}

@taitruong
Copy link
Collaborator Author

taitruong commented Sep 27, 2024

With changes in #105 can transfer, but getting error on SG side: '{"error":"codespace: wasm, code: 5"}'

Also relayer errors: ERROR ThreadId(01) Failed to relay reverse ack packets: failed during a client operation: error raised while creating client for chain stargaze-1: failed fetching src network latest height with error: RPC error to endpoint https://rpc.stargaze-apis.com/: response error: Internal error: height 15584747 must be less than or equal to the current blockchain height 15584746 (code: -32603)

NOTE: since transfer fails, ofc it gets returned backed to owner on Juno

@taitruong
Copy link
Collaborator Author

fixed with PR #105

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

1 participant