CW2: adding supported interfaces value
- Dominant language
- Rust
- Stars
- 527
- Forks
- 362
- PR merge metrics
- No merged PRs in 30d
Description
Following some of the discussion on Twitter: https://twitter.com/EledraNguyen/status/1587640345701281792
### Motivation
There should be an easy way to detect what interfaces a cosmwasm contract implements (similar to EIP-165). There are several situations both on-chain and off-chain for such feature:
- An indexer wants to categorize different types of contract.
- A multichain application (wallet, marketplace, etc.) that already support ERC-165 from EVM chain wants to render different UX for different type of contracts.
- A contract wants different ways to interact with other contracts depending on their types.
### Implementation
We propose to add an optional map containing supported interfaces in the `ContractVersion` struct for these values.
The supported interface value should be a string of pre-defined format: :
For example: ["crates.io:cw721","crates.io:cw2"]
### Notes
There is no way to enforce the string format or forcing the contract to have actual implementation of the declared interfaces. Thus, this variable is entirely optional for both the implementor as well as the caller.
Contributor guide
Research direction
Start by locating the ContractVersion struct and existing cw2 version metadata usage. Review how optional fields are handled, then confirm the supported-interfaces value follows the proposed crate-registry and crate-name format and remains optional for both callers and implementors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100