Skip to main content

SpokeCoreFactory

Git Source

Inherits: AccessManagedUpgradeable, CaliberFactory, BridgeAdapterFactory, ISpokeCoreFactory

State Variables

CaliberMailboxSaltDomain

bytes32 private constant CaliberMailboxSaltDomain = 0x4b3676c1328bb93bf4cdb2e4a60e8517fd898e78bd01e7956950c3ff62d3872f;

SpokeCoreFactoryStorageLocation

bytes32 private constant SpokeCoreFactoryStorageLocation =
0xcb1a6cd67f0aa55e138668b826a3a98a6a6ef973cbafe7a0845e7a69c97a6000;

Functions

_getSpokeCoreFactoryStorage

function _getSpokeCoreFactoryStorage() internal pure returns (SpokeCoreFactoryStorage storage $);

constructor

constructor(address _registry) MakinaContext(_registry);

initialize

function initialize(address _initialAuthority) external initializer;

isCaliberMailbox

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

function isCaliberMailbox(address caliberMailbox) external view override returns (bool);

createCaliber

Deploys a new Caliber instance.

function createCaliber(
ICaliber.CaliberInitParams calldata cParams,
IMakinaGovernable.MakinaGovernableInitParams calldata mgParams,
address accountingToken,
address hubMachine,
bytes32 salt
) external override restricted returns (address);

Parameters

NameTypeDescription
cParamsICaliber.CaliberInitParamsThe caliber initialization parameters.
mgParamsIMakinaGovernable.MakinaGovernableInitParamsThe makina governable initialization parameters.
accountingTokenaddressThe address of the accounting token.
hubMachineaddressThe address of the hub machine.
saltbytes32The salt used to deploy the Caliber deterministically.

Returns

NameTypeDescription
<none>addresscaliber The address of the deployed Caliber 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.

_createCaliberMailbox

Internal logic for caliber mailbox deployment via create3. This function only performs the deployment. It does not update factory storage nor emit an event.

function _createCaliberMailbox(
IMakinaGovernable.MakinaGovernableInitParams calldata mgParams,
address hubMachine,
bytes32 salt
) internal returns (address);

Structs

SpokeCoreFactoryStorage

Note: storage-location: erc7201:makina.storage.SpokeCoreFactory

struct SpokeCoreFactoryStorage {
mapping(address mailbox => bool isMailbox) _isCaliberMailbox;
mapping(address mailbox => bytes32 salt) _instanceSalts;
}