Skip to content
LogoLogo

SpokeCoreFactory

Git Source

Inherits: AccessManagedUpgradeable, CaliberFactory, BridgeAdapterFactory, ISpokeCoreFactory

Constants

CaliberMailboxSaltDomain

bytes32 private constant CaliberMailboxSaltDomain =
        0x4b3676c1328bb93bf4cdb2e4a60e8517fd898e78bd01e7956950c3ff62d3872f;

SpokeCoreFactoryStorageLocation

bytes32 private constant SpokeCoreFactoryStorageLocation =
        0xcb1a6cd67f0aa55e138668b826a3a98a6a6ef973cbafe7a0845e7a69c97a6000;

Functions

_getSpokeCoreFactoryStorage

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

Returns

NameTypeDescription
$SpokeCoreFactoryStorage

constructor

constructor(address _registry) MakinaContext(_registry);

Parameters

NameTypeDescription
_registryaddress

initialize

function initialize(address initialAuthority) external initializer;

Parameters

NameTypeDescription
initialAuthorityaddress

isCaliberMailbox

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

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

Parameters

NameTypeDescription
caliberMailboxaddress

Returns

NameTypeDescription
<none>bool

createCaliber

Deploys a new Caliber instance with an associated CaliberMailbox.

function createCaliber(
        ICaliber.CaliberInitParams calldata cParams,
        IMakinaGovernable.MakinaGovernableInitParams calldata mgParams,
        BridgeAdapterInitParams[] calldata baParams,
        address accountingToken,
        bytes32 salt,
        bool setupAMFunctionRoles
    ) external override restricted returns (address);

Parameters

NameTypeDescription
cParamsICaliber.CaliberInitParamsThe caliber initialization parameters.
mgParamsIMakinaGovernable.MakinaGovernableInitParamsThe makina governable initialization parameters.
baParamsBridgeAdapterInitParams[]The list of bridge adapter initialization parameters and controller configuration.
accountingTokenaddressThe address of the accounting token.
saltbytes32The salt used to deploy the Caliber deterministically.
setupAMFunctionRolesboolWhether to set roles for restricted functions on the deployed instance.

Returns

NameTypeDescription
<none>addressThe address of the deployed Caliber instance.

createBridgeAdapter

Deploys a bridge adapter instance.

function createBridgeAdapter(address controller, BridgeAdapterInitParams calldata baParams)
        external
        override
        restricted
        returns (address);

Parameters

NameTypeDescription
controlleraddressThe address of the bridge controller for which to deploy the adapter.
baParamsBridgeAdapterInitParamsThe bridge adapter initialization parameters and controller configuration.

Returns

NameTypeDescription
<none>addressThe 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,
        uint256 initialCooldownDuration,
        bytes32 salt
    ) internal returns (address);

Parameters

NameTypeDescription
mgParamsIMakinaGovernable.MakinaGovernableInitParams
initialCooldownDurationuint256
saltbytes32

Returns

NameTypeDescription
<none>address

_setupSpokeCaliberBundleAMFunctionRoles

Sets function roles for a deployed caliber mailbox instance and its associated caliber in the provided authority.

function _setupSpokeCaliberBundleAMFunctionRoles(address _authority, address _mailbox, address _caliber) internal;

Parameters

NameTypeDescription
_authorityaddress
_mailboxaddress
_caliberaddress

_setupCaliberMailboxAMFunctionRoles

Sets function roles in associated access manager for a deployed caliber mailbox instance.

function _setupCaliberMailboxAMFunctionRoles(address _authority, address _mailbox) internal;

Parameters

NameTypeDescription
_authorityaddress
_mailboxaddress

_checkAuthority

Checks that the provided authority matches the current authority.

function _checkAuthority(address _authority) internal view;

Parameters

NameTypeDescription
_authorityaddress

Structs

SpokeCoreFactoryStorage

Note:

  • storage-location: erc7201:makina.storage.SpokeCoreFactory
struct SpokeCoreFactoryStorage {
        mapping(address mailbox => bool isMailbox) _isCaliberMailbox;
        mapping(address mailbox => bytes32 salt) _instanceSalts;
    }

Properties

NameTypeDescription
_isCaliberMailboxmapping(address mailbox => bool isMailbox)
_instanceSaltsmapping(address mailbox => bytes32 salt)