OAppAuthReceiver
Inherits: IOAppReceiver, OAppAuthCore
Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.
This Auth version of OAppCore uses solmate's Auth instead of OZ's Ownable for compatibility purposes
State Variables
RECEIVER_VERSION
Functions
oAppVersion
Retrieves the OApp version information.
Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented. ie. this is a RECEIVE only OApp.
If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.
Returns
isComposeMsgSender
Indicates whether an address is an approved composeMsg sender to the Endpoint.
*_origin The origin information containing the source endpoint and sender address.
srcEid: The source chain endpoint ID.
sender: The sender address on the src chain.
nonce: The nonce of the message.*
_message The lzReceive payload.
Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.
The default sender IS the OAppReceiver implementer.
Parameters
Returns
allowInitializePath
Checks if the path initialization is allowed based on the provided origin.
This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.
This defaults to assuming if a peer has been set, its initialized. Can be overridden by the OApp if there is other logic to determine this.
Parameters
Returns
nextNonce
Retrieves the next nonce for a given source endpoint and sender address.
_srcEid The source endpoint ID.
_sender The sender address.
The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.
Is required by the off-chain executor to determine the OApp expects msg execution is ordered.
This is also enforced by the OApp.
By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.
Returns
lzReceive
Entry point for receiving messages or packets from the endpoint.
Entry point for receiving msg/packet from the LayerZero endpoint.
Parameters
_lzReceive
Internal function to implement lzReceive logic without needing to copy the basic parameter validation.