HubCoreFactory
Inherits: AccessManagedUpgradeable, CaliberFactory, BridgeAdapterFactory, IHubCoreFactory
Constants
HubCoreFactoryStorageLocation
bytes32 private constant HubCoreFactoryStorageLocation =
0xa73526acc519facb543e3fac63cbe361155292db6c01a81eec358613ec9ee100;Functions
_getHubCoreFactoryStorage
function _getHubCoreFactoryStorage() internal pure returns (HubCoreFactoryStorage storage $);Returns
| Name | Type | Description |
|---|---|---|
| $ | HubCoreFactoryStorage |
constructor
constructor(address _registry) MakinaContext(_registry);Parameters
| Name | Type | Description |
|---|---|---|
| _registry | address |
initialize
function initialize(address initialAuthority) external initializer;Parameters
| Name | Type | Description |
|---|---|---|
| initialAuthority | address |
isMachine
Address => Whether this is a Machine instance deployed by this factory.
function isMachine(address machine) external view override returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| machine | address |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
isPreDepositVault
Address => Whether this is a PreDepositVault instance deployed by this factory.
function isPreDepositVault(address preDepositVault) external view override returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| preDepositVault | 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 override restricted returns (address);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 |
|---|---|---|
| <none> | 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 override restricted returns (address);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 |
|---|---|---|
| <none> | 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 override restricted returns (address);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 |
|---|---|---|
| <none> | address | The address of the deployed Machine instance. |
createBridgeAdapter
Deploys a bridge adapter instance.
function createBridgeAdapter(address controller, BridgeAdapterInitParams calldata baParams)
external
override
restricted
returns (address);Parameters
| Name | Type | Description |
|---|---|---|
| controller | address | The address of the bridge controller for which to deploy the adapter. |
| baParams | BridgeAdapterInitParams | The bridge adapter initialization parameters and controller configuration. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | address | The address of the deployed bridge adapter. |
_createShareToken
Deploys a machine share token.
function _createShareToken(string memory name, string memory symbol, address initialOwner)
internal
returns (address);Parameters
| Name | Type | Description |
|---|---|---|
| name | string | |
| symbol | string | |
| initialOwner | address |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
_setupPreDepositVaultAMFunctionRoles
Sets function roles for a deployed pre-deposit vault instance in the provided authority.
function _setupPreDepositVaultAMFunctionRoles(address _authority, address _preDepositVault) internal;Parameters
| Name | Type | Description |
|---|---|---|
| _authority | address | |
| _preDepositVault | address |
_setupMachineBundleAMFunctionRoles
Sets function roles for a deployed machine instance, its hub caliber, and its initial fee manager if applicable, in the provided authority.
function _setupMachineBundleAMFunctionRoles(
address _authority,
address _machine,
address _caliber,
address _initialFeeManager
) internal;Parameters
| Name | Type | Description |
|---|---|---|
| _authority | address | |
| _machine | address | |
| _caliber | address | |
| _initialFeeManager | address |
_setupMachineAMFunctionRoles
Sets function roles for a deployed machine instance.
function _setupMachineAMFunctionRoles(address _authority, address _machine) internal;Parameters
| Name | Type | Description |
|---|---|---|
| _authority | address | |
| _machine | address |
_setupInitialFeeManagerAMFunctionRoles
Sets function roles for the initial fee manager of a deployed machine instance if applicable.
function _setupInitialFeeManagerAMFunctionRoles(address _authority, address _feeManager) internal;Parameters
| Name | Type | Description |
|---|---|---|
| _authority | address | |
| _feeManager | address |
_checkAuthority
Checks that the provided authority matches the current authority.
function _checkAuthority(address _authority) internal view;Parameters
| Name | Type | Description |
|---|---|---|
| _authority | address |
Structs
HubCoreFactoryStorage
Note:
- storage-location: erc7201:makina.storage.HubCoreFactory
struct HubCoreFactoryStorage {
mapping(address preDepositVault => bool isPreDepositVault) _isPreDepositVault;
mapping(address machine => bool isMachine) _isMachine;
mapping(address machine => bytes32 salt) _instanceSalts;
}Properties
| Name | Type | Description |
|---|---|---|
| _isPreDepositVault | mapping(address preDepositVault => bool isPreDepositVault) | |
| _isMachine | mapping(address machine => bool isMachine) | |
| _instanceSalts | mapping(address machine => bytes32 salt) |