Skip to content

[Improvement] Surface encoding of arguments to onInstall and onUninstall #21

@jaypaik

Description

@jaypaik

IPlugin defines onInstall and onUninstall as such:

/// @notice Initialize plugin data for the modular account.
/// @dev Called by the modular account during `installPlugin`.
/// @param data Optional bytes array to be decoded and used by the plugin to setup initial plugin data for the modular account.
function onInstall(bytes calldata data) external;

/// @notice Clear plugin data for the modular account.
/// @dev Called by the modular account during `uninstallPlugin`.
/// @param data Optional bytes array to be decoded and used by the plugin to clear plugin data for the modular account.
function onUninstall(bytes calldata data) external;

bytes calldata is used because we expect different plugins to receive different shapes of data when initializing and cleaning up. However, there is no canonical way of determining how to encode this data from the client, without prior knowledge of how to encode it (e.g., access to the source code or documentation).

Perhaps this can be surfaced in pluginMetadata(), but more exploration needs to be done on the best format the encoding scheme should be returned. Ideally, the format should be easily parsable by client SDKs today.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions