CctpV2BridgeEncoder
Inherits: AccessManagedUpgradeable, ICctpV2BridgeEncoder
Constants
MAINNET_CHAIN_ID
uint256 private constant MAINNET_CHAIN_ID = 1;MAINNET_CCTP_DOMAIN
uint32 private constant MAINNET_CCTP_DOMAIN = 0;FORWARD_HOOK_DATA
bytes private constant FORWARD_HOOK_DATA = hex"636374702d666f72776172640000000000000000000000000000000000000000";cctpV2TokenMessenger
Address of the CCTP TokenMessengerV2
address public immutable cctpV2TokenMessenger;Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
State Variables
_evmToCctpId
mapping(uint256 evmChainId => uint32 cctpDomain) private _evmToCctpId;_cctpToEvmId
mapping(uint32 cctpDomain => uint256 evmChainId) private _cctpToEvmId;Functions
constructor
constructor(address _cctpV2TokenMessenger);Parameters
| Name | Type | Description |
|---|---|---|
| _cctpV2TokenMessenger | address |
initialize
function initialize(address initialAuthority) external initializer;Parameters
| Name | Type | Description |
|---|---|---|
| initialAuthority | address |
getCctpDomain
EVM chain ID => CCTP domain
function getCctpDomain(uint256 evmChainId) public view override returns (uint32);Parameters
| Name | Type | Description |
|---|---|---|
| evmChainId | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint32 |
getBridgeTransferData
Returns targets, value, and calldata to execute a bridge transfer.
Intended to be called only by a MakinaXModule instance, from which implementations may read caller state via msg.sender.
function getBridgeTransferData(IBridgeComponent.BridgeOrder calldata order)
external
view
override
returns (address, address, uint256, bytes memory);Parameters
| Name | Type | Description |
|---|---|---|
| order | IBridgeComponent.BridgeOrder | The bridge transfer params. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | address | The address of the approval target. |
| <none> | address | The address of the execution target. |
| <none> | uint256 | The value to pass along with the calldata. |
| <none> | bytes | The calldata to execute. |
setCctpDomain
Associates an EVM chain ID with a CCTP domain in the contract storage.
function setCctpDomain(uint256 evmChainId, uint32 cctpDomain) external override restricted;Parameters
| Name | Type | Description |
|---|---|---|
| evmChainId | uint256 | The EVM chain ID. |
| cctpDomain | uint32 | The CCTP domain. |