ISuperformFactory

Git Source

Author: ZeroPoint Labs

Interface for Superform Factory

Functions

addFormImplementation

allows an admin to add a Form implementation to the factory

function addFormImplementation(address formImplementation_, uint32 formImplementationId_) external;

Parameters

NameTypeDescription
formImplementation_addressis the address of a form implementation
formImplementationId_uint32is the id of the form implementation (generated off-chain and equal in all chains)

createSuperform

To add new vaults to Form implementations, fusing them together into Superforms

function createSuperform(
    uint32 formImplementationId_,
    address vault_
)
    external
    returns (uint256 superformId_, address superform_);

Parameters

NameTypeDescription
formImplementationId_uint32is the form implementation we want to attach the vault to
vault_addressis the address of the vault

Returns

NameTypeDescription
superformId_uint256is the id of the created superform
superform_addressis the address of the created superform

stateSyncBroadcast

to synchronize superforms added to different chains using broadcast registry

function stateSyncBroadcast(bytes memory data_) external payable;

Parameters

NameTypeDescription
data_bytesis the cross-chain superform id

changeFormImplementationPauseStatus

allows an admin to change the status of a form

function changeFormImplementationPauseStatus(
    uint32 formImplementationId_,
    bool status_,
    bytes memory extraData_
)
    external
    payable;

Parameters

NameTypeDescription
formImplementationId_uint32is the id of the form implementation
status_boolis the new status
extraData_bytesis optional & passed when broadcasting of status is needed

getFormImplementation

returns the address of a form implementation

function getFormImplementation(uint32 formImplementationId_) external view returns (address formImplementation_);

Parameters

NameTypeDescription
formImplementationId_uint32is the id of the form implementation

Returns

NameTypeDescription
formImplementation_addressis the address of the form implementation

isFormImplementationPaused

returns the paused status of form implementation

function isFormImplementationPaused(uint32 formImplementationId_) external view returns (bool paused_);

Parameters

NameTypeDescription
formImplementationId_uint32is the id of the form implementation

Returns

NameTypeDescription
paused_boolis the current paused status of the form formImplementationId_

getSuperform

returns the address of a superform

function getSuperform(uint256 superformId_)
    external
    pure
    returns (address superform_, uint32 formImplementationId_, uint64 chainId_);

Parameters

NameTypeDescription
superformId_uint256is the id of the superform

Returns

NameTypeDescription
superform_addressis the address of the superform
formImplementationId_uint32is the id of the form implementation
chainId_uint64is the chain id

getAllSuperformsFromVault

Reverse query of getSuperform, returns all superforms for a given vault

function getAllSuperformsFromVault(address vault_)
    external
    view
    returns (uint256[] memory superformIds_, address[] memory superforms_);

Parameters

NameTypeDescription
vault_addressis the address of a vault

Returns

NameTypeDescription
superformIds_uint256[]is the id of the superform
superforms_address[]is the address of the superform

getAllSuperforms

Returns all Superforms

function getAllSuperforms() external view returns (uint256[] memory superformIds_, address[] memory vaults_);

Returns

NameTypeDescription
superformIds_uint256[]is the id of the superform
vaults_address[]is the address of the vault

getFormCount

returns the number of forms

function getFormCount() external view returns (uint256 forms_);

Returns

NameTypeDescription
forms_uint256is the number of forms

getSuperformCount

returns the number of superforms

function getSuperformCount() external view returns (uint256 superforms_);

Returns

NameTypeDescription
superforms_uint256is the number of superforms

Events

FormImplementationAdded

emitted when a new formImplementation is entered into the factory

event FormImplementationAdded(address indexed formImplementation, uint256 indexed formImplementationId);

Parameters

NameTypeDescription
formImplementationaddressis the address of the new form implementation
formImplementationIduint256is the id of the formImplementation

SuperformCreated

emitted when a new Superform is created

event SuperformCreated(
    uint256 indexed formImplementationId, address indexed vault, uint256 indexed superformId, address superform
);

Parameters

NameTypeDescription
formImplementationIduint256is the id of the form implementation
vaultaddressis the address of the vault
superformIduint256is the id of the superform
superformaddressis the address of the superform

SuperRegistrySet

emitted when a new SuperRegistry is set

event SuperRegistrySet(address indexed superRegistry);

Parameters

NameTypeDescription
superRegistryaddressis the address of the super registry