hyperledger / cacti

Hyperledger Cacti is a new approach to the blockchain interoperability problem
https://wiki.hyperledger.org/display/cactus
Apache License 2.0
338 stars 278 forks source link

feat(core-api): include deployed contracts in consortium data model #371

Open petermetz opened 3 years ago

petermetz commented 3 years ago

Is your feature request related to a problem? Please describe.

Right now if I want to invoke a contract on a Web3/eth ledger through the API client, I need to provide the ABI in my request and the contract address.

It's also quite easy to make a mistake when specifying which contract to use for what since it's not very intuitive for humans to differentiate long, randomized hex strings.

Describe the solution you'd like

We could provide a shorthand for this by storing this information as part of the consortium definition so that the request definition for a contract invocation could reference the contract ID as defined by the consortium definition. The challenge is to define a Contract model entity that can accurately represent contracts in general for all ledgers, not just for a single one them.

The usage of this feature must be entirely optional meaning that any contract can be invoked on any ledger through the Cactus API client, no matter what.

Describe alternatives you've considered

The alternative is in place as of right now which is to mandate the callers to provide the ABI of the contract they are invoking.

cc: @takeutak @sfuji822 @jonathan-m-hamilton

kikoncuo commented 3 years ago

For EVM: Contracts could be specified in a json file that has an array with all the contracts (ABI, address, and name). They could be loaded as objects so they can be invoked in a similar way on different blockchains