clarinet icon indicating copy to clipboard operation
clarinet copied to clipboard

Support querying project trait ABIs and implementations

Open BowTiedRadone opened this issue 1 month ago • 1 comments

Summary

Currently, there is no convenient way in clarinet to query trait definitions and automatically discover contracts that implement a given trait. This limitation affects developer tooling that needs to reason about trait implementations dynamically.

In practice, this means external tools (like Rendezvous) must manually search for contracts that explicitly declare (impl-trait ...), even though the Clarity VM can determine trait compliance by evaluating contract sources and comparing them to a trait’s ABI.

Proposed Solution

Add two complementary methods to the clarinet-sdk:

  • getTraitABI(traitIdentifier: string): TraitABI: Retrieves the ABI for a given trait from the project’s contracts (either imported or locally defined).
  • findTraitImplementations(traitABI: TraitABI): ContractId[]: Scans the project for contracts (requirements or project contracts) that implement the given trait, based on ABI compatibility (not only explicit (impl-trait ...) usage).

Additional context

This proposal originated in discussion under #2037.

BowTiedRadone avatar Nov 03 '25 22:11 BowTiedRadone

CNET-160

linear[bot] avatar Nov 03 '25 22:11 linear[bot]