LayerZeroV2BridgeConfig
Inherits: AccessManagedUpgradeable, ILayerZeroV2BridgeConfig
Constants
LayerZeroV2BridgeConfigStorageLocation
bytes32 private constant LayerZeroV2BridgeConfigStorageLocation =
0x9968c8893e7d72567bf0ce47e55989cd61e749404314ded743fba239bde60b00;Functions
_getLayerZeroV2BridgeConfigStorage
function _getLayerZeroV2BridgeConfigStorage() private pure returns (LayerZeroV2BridgeConfigStorage storage $);Returns
| Name | Type | Description |
|---|---|---|
| $ | LayerZeroV2BridgeConfigStorage |
constructor
constructor();initialize
function initialize(address initialAuthority) external initializer;Parameters
| Name | Type | Description |
|---|---|---|
| initialAuthority | address |
isRouteSupported
Returns whether a bridge transfer route is supported for the associated bridge.
function isRouteSupported(address inputToken, uint256 foreignChainId, address outputToken)
external
view
override
returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| inputToken | address | The token being sent from the source chain. |
| foreignChainId | uint256 | The destination chain ID. |
| outputToken | address | The token being received on the destination chain. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool | True if the route is supported, false otherwise. |
getLzEndpointId
EVM chain ID => LayerZero endpoint ID
function getLzEndpointId(uint256 evmChainId) external view override returns (uint32);Parameters
| Name | Type | Description |
|---|---|---|
| evmChainId | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint32 |
getOft
Local token address => LayerZero OFT address
function getOft(address localToken) external view override returns (address);Parameters
| Name | Type | Description |
|---|---|---|
| localToken | address |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
getForeignToken
Local token address => Foreign EVM chain ID => Foreign Token address
function getForeignToken(address localToken, uint256 foreignEvmChainId) external view override returns (address);Parameters
| Name | Type | Description |
|---|---|---|
| localToken | address | |
| foreignEvmChainId | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
setLzEndpointId
Associates an EVM chain ID with a LayerZero endpoint ID in the contract storage.
function setLzEndpointId(uint256 evmChainId, uint32 lzEndpointId) external override restricted;Parameters
| Name | Type | Description |
|---|---|---|
| evmChainId | uint256 | The EVM chain ID. |
| lzEndpointId | uint32 | The LayerZero endpoint ID. |
setOft
Registers a LayerZero OFT for its associated token.
Assumes that an OFT's associated token is immutable.
Overwrites any previously registered OFT for the provided OFT's associated token.
function setOft(address oft) external override restricted;Parameters
| Name | Type | Description |
|---|---|---|
| oft | address | The address of the LayerZero OFT. |
setForeignToken
Associates a local token with its foreign counterpart used in LayerZero bridging.
function setForeignToken(address localToken, uint256 foreignEvmChainId, address foreignToken)
external
override
restricted;Parameters
| Name | Type | Description |
|---|---|---|
| localToken | address | The local token address. |
| foreignEvmChainId | uint256 | The foreign EVM chain ID. |
| foreignToken | address | The foreign token address. |
Structs
LayerZeroV2BridgeConfigStorage
Note:
- storage-location: erc7201:makina.storage.LayerZeroV2BridgeConfig
struct LayerZeroV2BridgeConfigStorage {
mapping(uint256 evmChainId => uint32 lzEndpointId) _evmToLzId;
mapping(uint32 lzEndpointId => uint256 evmChainId) _lzToEvmId;
mapping(address localToken => address oft) _localTokenToOft;
mapping(address localToken => mapping(uint256 foreignEvmChainId => address foreignToken)) _localToForeignToken;
mapping(address foreignToken => mapping(uint256 foreignEvmChainId => address localToken)) _foreignToLocalToken;
}Properties
| Name | Type | Description |
|---|---|---|
| _evmToLzId | mapping(uint256 evmChainId => uint32 lzEndpointId) | |
| _lzToEvmId | mapping(uint32 lzEndpointId => uint256 evmChainId) | |
| _localTokenToOft | mapping(address localToken => address oft) | |
| _localToForeignToken | mapping(address localToken => mapping(uint256 foreignEvmChainId => address foreignToken)) | |
| _foreignToLocalToken | mapping(address foreignToken => mapping(uint256 foreignEvmChainId => address localToken)) |