IHubCoreFactory
Inherits: IBridgeAdapterFactory
Functions
isPreDepositVault
Address => Whether this is a PreDepositVault instance deployed by this factory.
function isPreDepositVault(address preDepositVault) external view returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| preDepositVault | address |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
isMachine
Address => Whether this is a Machine instance deployed by this factory.
function isMachine(address machine) external view returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| machine | address |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
createPreDepositVault
Deploys a new PreDepositVault instance.
function createPreDepositVault(
IPreDepositVault.PreDepositVaultInitParams calldata params,
address depositToken,
address accountingToken,
string memory tokenName,
string memory tokenSymbol,
bool setupAMFunctionRoles
) external returns (address preDepositVault);Parameters
| Name | Type | Description |
|---|---|---|
| params | IPreDepositVault.PreDepositVaultInitParams | The initialization parameters. |
| depositToken | address | The address of the deposit token. |
| accountingToken | address | The address of the accounting token. |
| tokenName | string | The name of the share token. |
| tokenSymbol | string | The symbol of the share token. |
| setupAMFunctionRoles | bool | Whether to set roles for restricted functions on the deployed instance. |
Returns
| Name | Type | Description |
|---|---|---|
| preDepositVault | address | The address of the deployed PreDepositVault instance. |
createMachineFromPreDeposit
Deploys a new Machine instance and migrates an existing PreDepositVault instance to it.
function createMachineFromPreDeposit(
IMachine.MachineInitParams calldata mParams,
ICaliber.CaliberInitParams calldata cParams,
IMakinaGovernable.MakinaGovernableInitParams calldata mgParams,
ISpokeSnapshotConsumer.SpokeSnapshotConsumerInitParams calldata sscParams,
BridgeAdapterInitParams[] calldata baParams,
address preDepositVault,
bytes32 salt,
bool setupAMFunctionRoles
) external returns (address machine);Parameters
| Name | Type | Description |
|---|---|---|
| mParams | IMachine.MachineInitParams | The machine initialization parameters. |
| cParams | ICaliber.CaliberInitParams | The caliber initialization parameters. |
| mgParams | IMakinaGovernable.MakinaGovernableInitParams | The makina governable initialization parameters. |
| sscParams | ISpokeSnapshotConsumer.SpokeSnapshotConsumerInitParams | The spoke snapshot consumer initialization parameters. |
| baParams | BridgeAdapterInitParams[] | The list of bridge adapter initialization parameters and controller configuration. |
| preDepositVault | address | The address of the PreDepositVault instance to migrate. |
| salt | bytes32 | The salt used to deploy the hub caliber deterministically. |
| setupAMFunctionRoles | bool | Whether to set roles for restricted functions on the deployed instance. |
Returns
| Name | Type | Description |
|---|---|---|
| machine | address | The address of the deployed Machine instance. |
createMachine
Deploys a new Machine instance.
function createMachine(
IMachine.MachineInitParams calldata mParams,
ICaliber.CaliberInitParams calldata cParams,
IMakinaGovernable.MakinaGovernableInitParams calldata mgParams,
ISpokeSnapshotConsumer.SpokeSnapshotConsumerInitParams calldata sscParams,
BridgeAdapterInitParams[] calldata baParams,
address accountingToken,
string memory tokenName,
string memory tokenSymbol,
bytes32 salt,
bool setupAMFunctionRoles
) external returns (address machine);Parameters
| Name | Type | Description |
|---|---|---|
| mParams | IMachine.MachineInitParams | The machine initialization parameters. |
| cParams | ICaliber.CaliberInitParams | The caliber initialization parameters. |
| mgParams | IMakinaGovernable.MakinaGovernableInitParams | The makina governable initialization parameters. |
| sscParams | ISpokeSnapshotConsumer.SpokeSnapshotConsumerInitParams | The spoke snapshot consumer initialization parameters. |
| baParams | BridgeAdapterInitParams[] | The list of bridge adapter initialization parameters and controller configuration. |
| accountingToken | address | The address of the accounting token. |
| tokenName | string | The name of the share token. |
| tokenSymbol | string | The symbol of the share token. |
| salt | bytes32 | The salt used to deploy the hub caliber deterministically. |
| setupAMFunctionRoles | bool | Whether to set roles for restricted functions on the deployed instance. |
Returns
| Name | Type | Description |
|---|---|---|
| machine | address | The address of the deployed Machine instance. |
Events
MachineCreated
event MachineCreated(address indexed machine, address indexed shareToken);Parameters
| Name | Type | Description |
|---|---|---|
| machine | address | |
| shareToken | address |
PreDepositVaultCreated
event PreDepositVaultCreated(address indexed preDepositVault, address indexed shareToken);Parameters
| Name | Type | Description |
|---|---|---|
| preDepositVault | address | |
| shareToken | address |
ShareTokenCreated
event ShareTokenCreated(address indexed shareToken);Parameters
| Name | Type | Description |
|---|---|---|
| shareToken | address |
Structs
MachineBundle
The core components of a new machine instance.
struct MachineBundle {
address machine;
address shareToken;
address caliber;
}Properties
| Name | Type | Description |
|---|---|---|
| machine | address | |
| shareToken | address | |
| caliber | address |