handle_query_contract_id()
Handle explanation
The Ethereum application will call this handle to query the contract name and version to display.
The plugin needs to perform the following actions:
- Write the name of the plugin/smart contract
- Write the version
An example is already done in the boilerplate plugin. Adapt and expand it for your use case.
Fields descriptions
typedef struct ethQueryContractID_s {
// ===== READ ONLY ===== //
// INPUT. Transaction data available to the plugin. READ-ONLY.
const txContent_t *txContent;
// INPUT. Maximum possible name string length
size_t nameLength;
// INPUT. Maximum possible version string length
size_t versionLength;
// ===== READ WRITE ===== //
// RW INPUT. Contains the semi-persistent RAM space that can be used by the
// plugin in each handle call.
uint8_t *pluginContext; // PLUGIN_CONTEXT_SIZE
// ===== WRITE ONLY ===== //
// OUTPUT. Pointer to the name of the plugin
char *name;
// OUTPUT. Pointer to the version of the plugin
char *version;
// OUTPUT. Used by the plugin to inform the Ethereum application of the
// result of this handle The following return codes are expected, any other
// will abort the signing process:
// - ETH_PLUGIN_RESULT_OK
eth_plugin_result_t result;
} ethQueryContractID_t;