Dfinity Self Describing Standard

The ERC1820 registry contract provides a common contract interface registration/query service, and Dfinity also needs such a service. Dfinity currently does not have such a service.

Problems to be solved

No one has the motivation to establish such a service, because the call to the contract does not require the caller to pay gas (Cycles) fees, but the contract publisher provides gas (Cycles) in the contract.

Solution

Canister should implement the interface self-describing.

Dfinity can solve the problem solved by ERC1820 through the interface self-description, and achieve the self-description of the canister interface by implementing supported Interface(text) → (bool).

Example

You can test it with the following command :

   dfx deploy
   
   dfx canister call standard supportedInterface '("test:(text)->(text)query")'
2 Likes

We create a [token standard] Base on [Self-describing Standard] .
Everyone is welcome to comment. We are willing to help issue tokens based on this standard

this standard was dropped.

Please do not use this standard

Motoko canister support default method __get_candid_interface_tmp_hack to get did, if rust canister implement this method ,Developer can check canister’s interface through __get_candid_interface_tmp_hack.

candid::export_service!();

#[query(name = "__get_candid_interface_tmp_hack")]
#[candid_method(query, rename = "__get_candid_interface_tmp_hack")] 
fn __export_did_tmp_() -> String { __export_service() }
1 Like