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
.
formImplementation_
address of the implementation contract
formImplementationId_
uint32 id to set the Form
implementation to
Creating Superforms (Adding Vaults)
This function creates the Superform
and returns the resulting superformId
and Superform address
.
formImplementationId_
uint32 id of the Form
implementation
vault_
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.
formImplementationId_
uint32 id of the Form
implementation
paused_
bool that is True if the Form is paused, halting deposits and only allowing emergency withdrawals
extraData_
bytes extradata
if broadcasting of the message is required
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.
formImplementationId_
uint32 id of the Form
implementation
isFormImplementationPaused
This function returns if a Form id has been paused, triggering emergency-only withdrawal mode.
formImplementationId_
uint32 id of the Form
implementation
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.
superformId
uint256 superformId
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.
vault_
Address of the vault to check
Last updated