Skip to main content

HubCoreFactory

Git Source

Inherits: AccessManagedUpgradeable, CaliberFactory, BridgeAdapterFactory, IHubCoreFactory

State Variables

HubCoreFactoryStorageLocation

bytes32 private constant HubCoreFactoryStorageLocation =
0xa73526acc519facb543e3fac63cbe361155292db6c01a81eec358613ec9ee100;

Functions

_getHubCoreFactoryStorage

function _getHubCoreFactoryStorage() internal pure returns (HubCoreFactoryStorage storage $);

constructor

constructor(address _registry) MakinaContext(_registry);

initialize

function initialize(address _initialAuthority) external initializer;

isMachine

Address => Whether this is a Machine instance deployed by this factory.

function isMachine(address machine) external view override returns (bool);

isPreDepositVault

Address => Whether this is a PreDepositVault instance deployed by this factory.

function isPreDepositVault(address preDepositVault) external view override returns (bool);

createPreDepositVault

Deploys a new PreDepositVault instance.

function createPreDepositVault(
IPreDepositVault.PreDepositVaultInitParams calldata params,
address depositToken,
address accountingToken,
string memory tokenName,
string memory tokenSymbol
) external override restricted returns (address);

Parameters

NameTypeDescription
paramsIPreDepositVault.PreDepositVaultInitParamsThe initialization parameters.
depositTokenaddressThe address of the deposit token.
accountingTokenaddressThe address of the accounting token.
tokenNamestringThe name of the share token.
tokenSymbolstringThe symbol of the share token.

Returns

NameTypeDescription
<none>addresspreDepositVault 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,
address preDepositVault,
bytes32 salt
) external override restricted returns (address);

Parameters

NameTypeDescription
mParamsIMachine.MachineInitParamsThe machine initialization parameters.
cParamsICaliber.CaliberInitParamsThe caliber initialization parameters.
mgParamsIMakinaGovernable.MakinaGovernableInitParamsThe makina governable initialization parameters.
preDepositVaultaddressThe address of the PreDepositVault instance to migrate.
saltbytes32The salt used to deploy the Hub Caliber deterministically.

Returns

NameTypeDescription
<none>addressmachine 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,
address accountingToken,
string memory tokenName,
string memory tokenSymbol,
bytes32 salt
) external override restricted returns (address);

Parameters

NameTypeDescription
mParamsIMachine.MachineInitParamsThe machine initialization parameters.
cParamsICaliber.CaliberInitParamsThe caliber initialization parameters.
mgParamsIMakinaGovernable.MakinaGovernableInitParamsThe makina governable initialization parameters.
accountingTokenaddressThe address of the accounting token.
tokenNamestringThe name of the share token.
tokenSymbolstringThe symbol of the share token.
saltbytes32The salt used to deploy the Hub Caliber deterministically.

Returns

NameTypeDescription
<none>addressmachine The address of the deployed Machine instance.

createBridgeAdapter

Deploys a bridge adapter instance.

function createBridgeAdapter(uint16 bridgeId, bytes calldata initData) external returns (address);

Parameters

NameTypeDescription
bridgeIduint16The ID of the bridge for which the adapter is being created.
initDatabytesThe optional initialization data for the bridge adapter.

Returns

NameTypeDescription
<none>addressadapter 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);

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;
}