Skip to content

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 {
    // DEPRECATED, will be removed soon. Do not use.
    ethPluginSharedRW_t *pluginSharedRW;

    // INPUT. Transaction data available to the plugin. READ-ONLY.
    ethPluginSharedRO_t *pluginSharedRO;

    // RW INPUT. Contains the semi-persistent RAM space that can be used by the
    // plugin in each handle call.
    uint8_t *pluginContext;

    // OUTPUT. Pointer to the name of the plugin
    char *name;
    // INPUT. Maximum possible name string length
    size_t nameLength;

    // OUTPUT. Pointer to the version of the plugin
    char *version;
    // INPUT. Maximum possible version string length
    size_t versionLength;

    // 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;