LzApp

Git Source

Inherits: Ownable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig

State Variables

DEFAULT_PAYLOAD_SIZE_LIMIT

uint256 public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10_000;

lzEndpoint

ILayerZeroEndpoint public immutable lzEndpoint;

trustedRemoteLookup

mapping(uint16 => bytes) public trustedRemoteLookup;

minDstGasLookup

mapping(uint16 => mapping(uint16 => uint256)) public minDstGasLookup;

payloadSizeLimitLookup

mapping(uint16 => uint256) public payloadSizeLimitLookup;

precrime

address public precrime;

Functions

constructor

constructor(address _endpoint);

lzReceive

function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload)
    public
    virtual
    override;

_blockingLzReceive

function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload)
    internal
    virtual;

_lzSend

function _lzSend(
    uint16 _dstChainId,
    bytes memory _payload,
    address payable _refundAddress,
    address _zroPaymentAddress,
    bytes memory _adapterParams,
    uint256 _nativeFee
) internal virtual;

_checkGasLimit

function _checkGasLimit(uint16 _dstChainId, uint16 _type, bytes memory _adapterParams, uint256 _extraGas)
    internal
    view
    virtual;

_getGasLimit

function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint256 gasLimit);

_checkPayloadSize

function _checkPayloadSize(uint16 _dstChainId, uint256 _payloadSize) internal view virtual;

getConfig

function getConfig(uint16 _version, uint16 _chainId, address, uint256 _configType)
    external
    view
    returns (bytes memory);

setConfig

function setConfig(uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config)
    external
    override
    onlyOwner;

setSendVersion

function setSendVersion(uint16 _version) external override onlyOwner;

setReceiveVersion

function setReceiveVersion(uint16 _version) external override onlyOwner;

forceResumeReceive

function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner;

setTrustedRemote

function setTrustedRemote(uint16 _srcChainId, bytes calldata _path) external onlyOwner;

setTrustedRemoteAddress

function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner;

getTrustedRemoteAddress

function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory);

setPrecrime

function setPrecrime(address _precrime) external onlyOwner;

setMinDstGas

function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint256 _minGas) external onlyOwner;

setPayloadSizeLimit

function setPayloadSizeLimit(uint16 _dstChainId, uint256 _size) external onlyOwner;

isTrustedRemote

function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);

Events

SetPrecrime

event SetPrecrime(address precrime);

SetTrustedRemote

event SetTrustedRemote(uint16 _remoteChainId, bytes _path);

SetTrustedRemoteAddress

event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);

SetMinDstGas

event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint256 _minDstGas);