Skip to content

Add primitives to support ERC165-like interface detection and other similar protocols #1983

Description

@leighmcculloch

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions