NFTs (and tokens in general) going interchain is a complex interaction between 2 chains.
This project covers these 2 hackathon challenges:
- Contract examples taxes and incentives
- Seamless UI for ICS721 transfers
Ark Protocol will do a demo based on Stargaze and Juno testnets. Repos: Wasm code: https://github.com/arkprotocol/ics721-plus Frontend code: https://github.com/arkprotocol/ics721-frontend
Both repos are currently private, with access for the Stargaze team. Once approved and ready for mainnet, we aim to make it public.
- Taxes and Incentives Contracts We have provided 6 different ICS721 outgoing proxy contracts, including (optional) taxes (aka ‘transfer fee’) for ICS721 transfers. Once a fee is defined, an NFT holder needs to send funds – as transfer fees – for transferring an NFT to another chain.
NOTE: by the design of the ICS721 contract, once an outgoing proxy is set, then transfers are only(!) eligible by using this outgoing proxy! Technically there are ways of bypassing this – but it’ll be hard and insecure (read more below).
For the receiving chain, we have provided – a simple but safe and straight forward – incoming incentives contract. Funds are send to this contract, where holders can make claim_incentives call on these funds. Each user is eligible to do a one-time claim per NFT.
NOTE: another way is having an ICS721 callback, for automatically incentivizing a recipient. Callbacks will be highly beneficial for other uses cases as well (like automatically listing an incoming NFT on a marketplace, swapping funds/IBC tokens e.g. into STARS, airdrops, and other ICS721-based utilities).
- Frontend with 2 UIs covering a Profile page for transfers and an ICS721 dashboard on each chain
Once connected a user may looked up all owned NFTs in the Profile page. Once a holder select an NFT and triggers an ICS721 transfer, there is a step-by-step guide:
- Select target chain (IBC Channel)
- Enter target wallet for NFT recipient
- Approve Outgoing Proxy eligible to transfer an NFT
- Transfer
In step 2, the transfer dialog by default suggests its counterpart as target recipient (e.g. “starsXYZ”) for the owner’s source wallet (e.g. “junoXYZ”). At the beginning everyone will be noobs related to ICS721. Hence a guided transfer will be essential for users getting familiar with ICS721. Later an additional one-click transfer will be a no-brainer for approving a proxy and sending an NFT with counterpart wallet and to a preferred chain.
In addition to the Profile page, there is also the ICS721 dashboard. It shows all existing ICS721 contracts (aka ICS721 Service Providers) on each chain. A user can select an ICS721 contract for getting more infos. These details will provide answers for these questions:
- how many collections are using this service?
- how many incoming NFTs have arrived?
- how many outgoing NFTs have been send?
- is this the home chain for collection XYZ?
- is this collection escrowed by ICS721?
- who owns this NFT?
- is NFT escrowed by ICS721?
There is a lot more showcase and demo – depending on your time :). Like:
- Different use cases for outgoing proxies contracts
- Tools for builders
I. Different use cases for outgoing proxies contracts
a. rate limited (e.g. max transfers of X NFTs per day) b. channel whitelist proxy: transfer only for given IBC channels (since EVERYONE is able to create new channels on existing IBC contracts, like for exploits) c. collection whitelist proxy and code id whitelist proxy: transfers only for given collections or cw721 code ids. This way an exploited, custom cw721 contracts will be avoided d. collection channels whitelist proxy: allowing creators to control whether their collection can be transferred and on which channels (=chains)
II. Tools for builders
Ark Protocol supports the NFT community for going interchain. For making this happened, we have build libs, packages and tools for builders to build ICS721 utilities:
a. macros The code for each outgoing and incentives contract is pretty slim. The reason for this is: each uses one of these 2 macros we have build:
- packages/cw-ics721-context-derive Contains cw_ics721_context_execute and cw_ics721_context_query macros for generating ICS721 Context-based contracts. Examples here: cw-ics721-incoming-incentives.
- packages/cw-ics721-outgoing-proxy-derive Contains cw_ics721_outgoing_proxy_execute and cw_ics721_outgoing_proxy_query macros for generating ICS721 proxies. Examples here: cw-ics721-outgoing-fee-proxy.
For more details checkout the READMEs, starting here:Â https://github.com/arkprotocol/ics721-plus/blob/main/README.md
b. packages
There are multiple packages for builders integrating in their contract:
- whitelist and whitelist map (e.g. used in outgoing proxies)
- multi test code for testing proxies and ICS721
- example usages are shown in contracts folder
Also for the frontends we plan to provide components and js libs for builders to use.