SuperformFactory
Last updated
Was this helpful?
Last updated
Was this helpful?
SuperformFactory
is used for adding vaults to Superform.
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 the ProtocolAdmin
role.
Creating Superforms
: Anybody can permissionlessly create a Superform
by adding vaults to Forms.
Emergency Action: This exists as a circuit break, allowing EmergencyAdmin
to pause deposits/withdrawals and 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.
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
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
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
This function returns the number of Forms
that have been added to the specific chain.
This function returns the number of Superforms
that have been created on the specific chain.
This function returns the address
of a given Form
implementation id.
formImplementationId_
uint32 id of the Form
implementation
This function returns if a Form id has been paused, triggering emergency-only withdrawal mode.
formImplementationId_
uint32 id of the Form
implementation
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
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