Module Factory
The Module Factory is a contract that allows Account owners to install and manage Abstract Modules for their Account. You can install modules by interacting with the Account directly, i.e. via CLI, or by using the Account Console.
To recap from that chapter, there are three types of modules: App, Adapter, and Standalone.
Flow Diagrams
Install Module
When a developer requests the installation of a module, the following internal process is initiated:
Execute on Module
Once the module is installed, there are essentially three ways to interact with it depending on the type of module:
Owner Execution
The owner of an Account can always execute on the module directly, even if the module is installed on a sub-account.
Adapter Execution
In the following example, the abstract:dex
module is installed on an Account and the user requests a swap on a dex. This swap will use the funds held in the Account to execute the swap on the target dex.
App Execution w/ Dependencies
In this example, we use Equilibrium’s Rebalance
permissionless function as an example. Modules with
dependencies (equilibrium:balancer
is dependent on abstract:etf
and abstract:dex
) have their addresses dynamically
resolved when called.