SuperformFactory
Introduction
SuperformFactory
is used for adding vaults to Superform.
Core Concepts
The factory defines the logic for three actions
Adding
Forms
: Forms are effectively yield adapters to support different types of opportunities on Superform.ERC4626Form
is an adapter that supports standard ERC4626 vaults. Forms that are developed in the future can only be added by theProtocolAdmin
role.Creating
Superforms
: Anybody can permissionlessly create aSuperform
by adding vaults toForms.
Emergency Action: This exists as a circuit break, allowing
EmergencyAdmin
to pause deposits/withdrawals and BroadcastRegistry to send that message across chains.
A Superform
is defined by a vault address, the Form which it is added to, and the EVM chain ID it is on.
Adding Forms
This function allows the ProtocolAdmin
to add a Form
implementation to Superform
for a specified formId
.
Name | Description |
---|---|
| address of the implementation contract |
| uint32 id to set the |
Creating Superforms (Adding Vaults)
This function creates the Superform
and returns the resulting superformId
and Superform address
.
Name | Description |
---|---|
| uint32 id of the |
| address of the vault |
Emergency Action
changeFormImplementationPauseStatus
This function allows the EmergencyAdmin
to pause any deposits or withdrawals into any Form
implementation if an exploit is suspected. If put into a paused state, no deposits can go through, and all withdrawals are sent to an EmergencyWithdrawal
queue where withdrawals must be fulfilled by the EmergencyAdmin
keeper which performs off-chain validations.
Name | Description |
---|---|
| uint32 id of the |
| bool that is True if the Form is paused, halting deposits and only allowing emergency withdrawals |
| bytes |
View Functions
Counts
getFormCount
This function returns the number of Forms
that have been added to the specific chain.
getSuperformCount
This function returns the number of Superforms
that have been created on the specific chain.
Forms
getFormImplementation
This function returns the address
of a given Form
implementation id.
Name | Description |
---|---|
| uint32 id of the |
isFormImplementationPaused
This function returns if a Form id has been paused, triggering emergency-only withdrawal mode.
Name | Description |
---|---|
| uint32 id of the |
Superforms
getSuperform
This function decodes any superFormId
, regardless of the chain it was created on, into the Superform address, form id it was added to, and the chain id it was added on.
Name | Description |
---|---|
| uint256 |
getAllSuperformsFromVault
This function returns the superformIds
and associated addresses given a vault address, if there are any. There can be multiple superformIds
for any given vault because vaults can be added to multiple Forms.
Name | Description |
---|---|
| Address of the vault to check |
Last updated