Plugin Registry
This contract is similar to an "app store" for abstract accounts on D-Chain. It allows for the installation of plugins
(contracts) that can be used by the Proxy
contract, providing pre / post transaction hooks as well as fine-grained
authorisation for trusted third parties to execute certain messages.
Interactions with other contracts / modules
modules/abstractaccount
: the address of the instance of this contract is stored as anActor
namedPluginRegistry
in theAbstractAccount
module. It is queried by theProxy
for interactions and not directly stored in theProxy
contract.Proxy
:- install the plugins and pay the subscription fee if required
- will check the subscription status of the user before executing the plugin
Subscription Tiers for plugins
We provide different subscription tiers for the users to use the registry. By default, the first plugin installed will start the record of a "free tier".
#[cw_serde]
pub struct TierDetails {
pub max_plugins: u16,
pub duration: Option<Duration>,
pub fee: Coin,
}
/// Subscription tiers
/// Note: Registry interacts with the u8 so this can be extended
#[cw_serde]
pub enum SubscriptionTier {
Free = 0,
L1 = 1,
Other = 2,
}
The free tier has no expiration and no fee.
Traits
The relevant interfaces are registry_service_trait
and registry_management_trait
. The registry is the contract that
stores the plugins (code-id, registry-id, code hash and versioning). It also stores the subscription status of each
proxy wallet for the users.
The registry provides states that are checked by the proxy during plugin execution.