SpokeCoreFactory
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
| Name | Type | Description |
|---|---|---|
| $ | SpokeCoreFactoryStorage |
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 |
isCaliberMailbox
Address => Whether this is a CaliberMailbox instance deployed by this factory.
function isCaliberMailbox(address caliberMailbox) external view override returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| caliberMailbox | address |
Returns
| Name | Type | Description |
|---|---|---|
| <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
| Name | Type | Description |
|---|---|---|
| cParams | ICaliber.CaliberInitParams | The caliber initialization parameters. |
| mgParams | IMakinaGovernable.MakinaGovernableInitParams | The makina governable initialization parameters. |
| baParams | BridgeAdapterInitParams[] | The list of bridge adapter initialization parameters and controller configuration. |
| accountingToken | address | The address of the accounting token. |
| salt | bytes32 | The salt used to deploy the 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 Caliber 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. |
_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
| Name | Type | Description |
|---|---|---|
| mgParams | IMakinaGovernable.MakinaGovernableInitParams | |
| initialCooldownDuration | uint256 | |
| salt | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| <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
| Name | Type | Description |
|---|---|---|
| _authority | address | |
| _mailbox | address | |
| _caliber | address |
_setupCaliberMailboxAMFunctionRoles
Sets function roles in associated access manager for a deployed caliber mailbox instance.
function _setupCaliberMailboxAMFunctionRoles(address _authority, address _mailbox) internal;Parameters
| Name | Type | Description |
|---|---|---|
| _authority | address | |
| _mailbox | address |
_checkAuthority
Checks that the provided authority matches the current authority.
function _checkAuthority(address _authority) internal view;Parameters
| Name | Type | Description |
|---|---|---|
| _authority | address |
Structs
SpokeCoreFactoryStorage
Note:
- storage-location: erc7201:makina.storage.SpokeCoreFactory
struct SpokeCoreFactoryStorage {
mapping(address mailbox => bool isMailbox) _isCaliberMailbox;
mapping(address mailbox => bytes32 salt) _instanceSalts;
}Properties
| Name | Type | Description |
|---|---|---|
| _isCaliberMailbox | mapping(address mailbox => bool isMailbox) | |
| _instanceSalts | mapping(address mailbox => bytes32 salt) |