public-awesome / cw-ics721

CosmWasm IBC NFT Transfers
MIT License
56 stars 30 forks source link

name and symbol #70

Closed taitruong closed 7 months ago

taitruong commented 8 months ago

Instead of class id being stored in name and symbol, it's actual name and symbol from source chain should be transferred, when creating new collection.

Unfortunately name can't easily be changed. Reason is here: https://github.com/public-awesome/cw-ics721/blob/main/packages/ics721/src/ibc.rs#L256-L262

Basically ICS721 does a sub msg for instantiating cw721 contract (aka collection) on target chain. Once done, on reply, it needs to store ClassId and collection address in a map. The only way of getting class id is storing it somewhere in cw721 - in this case in name.

So what I can at least do, is setting symbol from source source. A possible solutions is storing name and class id into name with this syntax: name: name_from_source_collection (classID).

This way I could extract ClassId from name.

TBD: instantiate2

taitruong commented 7 months ago

Resolved using instantiate2 in PR 71: https://github.com/public-awesome/cw-ics721/pull/71