Finschia / wasmd

Basic cosmos-sdk app with web assembly smart contracts
Other
1 stars 9 forks source link

Research about standard interface detection. #50

Open zemyblue opened 2 years ago

zemyblue commented 2 years ago

Summary

Research about standard interface detection.

Problem Definition

We need to know whether a specific smart contract supports a specific protocol, so that the smart contract can be excute and searched without errors in other smart contracts. For this purpose, in the case of EVM, the function of a function selector is provided. Let's see if there is a function that can replace EVM's function selector function that can distinguish a specific function from the wasm binary even in wasm of lbm-sdk.

If that feature doesn't exist, find out how to replace it.

Inheritance is not supported like EVM throught rustlang, the smart contract development language of cosmwasm. Then, we also suggest how to make a protocol such as ERC-165 a library so that other smart contract developers can use it.


For Admin Use

loloicci commented 1 year ago

Research about interface detection protocol

ERC165

Protocol and interfaces how a contract publishes its interface. The information to publish is defined by the contract's developer.

https://eips.ethereum.org/EIPS/eip-165

ERC1820

There is a contract to register the universal map from contracts to their interfaces, and ERC1820 defines its specification and the interfaces to interact with the contract.

https://eips.ethereum.org/EIPS/eip-1820

substitute of the function selector

On researching.

interface detection method

Done with https://github.com/line/cosmwasm/pull/245