Proxy
The proxy is instantiated per wallet account and the related address holds the assets onchain.
This is the main interaction with the users.
Interactions with other contracts / modules
The proxy interacts with other contracts in the follow ways:
-
Plugin Registry
: it checks to for subscription status on the ability for plugins to have certain interactions -
Authenticators (Webauthn)
: Proxy's controlling entity informs what type of authenticator should be used to verify the incoming data. Currently we only supportWebauthn
, then authenticators are unique contracts that authenticates all proxies and their addresses are stored in the Factory. -
Plugins: There are 3 types of plugins, Pre tx check / Post tx hooks and 3rd party plugin. These are called at the separate points of the proxy contract.
The contract is instantiated by the Abstract Account module.
Install / remove plugins
Users can choose which plugins to install and up to a certain number. If a plugin is executable, the wallet will check that if the user's subscription is still valid.
If the subscription is not valid, the plugin shall not continue to be executed.
The installation of the plugins is through the Proxy install
interface, so to calculate the addr etc, then the Proxy
informs the registry of this installation and checks if the subscription is valid. There is no benefit for the user to
directly record it on the registry and not locally in their Proxy.
The removal of the plugins is through the Registry proxy_remove_plugins
interface, which removes the plugin from the
registry then calls to remove it in the Proxy. We must ensure both are removed at the same time because removing from
the registry may free up space to install more plugins if the Proxy can keep the old ones.
Traits
The relevant interfaces are wallet_trait
and wallet_plugin_trait
.