What problem does your feature solve?
ERC165 interface detection is well established protocol in the Ethereum ecosystem and EVM chains for doing a simple safety check that a protocol supports an interface at runtime.
Soroban does not contain the primitives for anyone wanting to replicate this pattern.
What would you like to see?
A primitive that provides for every element of the contract spec (function, type, event, error) an integer value, similar to the Solidity selector, that can be used in the same way that ERC-165 does for identifying if it is supported by a contract.
What alternatives are there?
If we explored the host understanding and learning about contract specs we could potentially introduce host functionality that could be used for introspecting the functions and types available on a contract. But this is a big lift, where a selector-like pattern would be much lower lift and constrained to contract-land allowing it to be something that gets innovated on independent of the Stellar protocol.
cc @mootz12 @marcelosalloum
What problem does your feature solve?
ERC165 interface detection is well established protocol in the Ethereum ecosystem and EVM chains for doing a simple safety check that a protocol supports an interface at runtime.
Soroban does not contain the primitives for anyone wanting to replicate this pattern.
What would you like to see?
A primitive that provides for every element of the contract spec (function, type, event, error) an integer value, similar to the Solidity selector, that can be used in the same way that ERC-165 does for identifying if it is supported by a contract.
What alternatives are there?
If we explored the host understanding and learning about contract specs we could potentially introduce host functionality that could be used for introspecting the functions and types available on a contract. But this is a big lift, where a selector-like pattern would be much lower lift and constrained to contract-land allowing it to be something that gets innovated on independent of the Stellar protocol.
cc @mootz12 @marcelosalloum