Create contract modules
This part explains how to develop Contract Module.
In the demo, ERC20 functionalities are additional.
First, read about ERC20 Contract of fabric-tendermint-cross-demo.
Contract Module
In general, modules need to satisfy specific interfaces as explained by ERC20 Contract.
As Cross Framework, modules need to satisfy ContractModule interface.
type ContractModule interface {
OnContractCall(ctx context.Context, signers []authtypes.Account, callInfo txtypes.ContractCallInfo) (*txtypes.ContractCallResult, error)
}
Implementation in demo is here.