Skip to main content

EndpointV2

lzToken

This stores the address of the LayerZero token, which may be used for paying messaging fees. It enables applications to settle crosschain communication costs using LayerZero’s native token, where applicable.

delegates

A mapping that allows address-based delegation. Applications (OApps) can delegate certain privileges to another address, authorizing the delegate to perform tasks on behalf of the original sender.

constructor

The constructor initializes the LayerZero endpoint on a specific chain. It assigns a unique Endpoint ID (_eid) to this instance, ensuring each chain has a distinct identifier for crosschain messaging.

Parameters

quote

This function returns a fee estimate for sending a crosschain message, based on the parameters specified in _params. The fee quote takes into account the current messaging cost, which might vary over time. Note that the actual messaging cost could differ if the fees change between the quote and the message send operation. MESSAGING STEP 0

Parameters

send

This function sends a message to a destination chain through the LayerZero network. It also processes the associated fees, which can be either in native tokens or LayerZero tokens (lzToken). If excess fees are supplied, the surplus is refunded to the provided _refundAddress. MESSAGING STEP 1 - OApp need to transfer the fees to the endpoint before sending the message

Parameters

_send

An internal version of the send function that handles the underlying mechanics of sending a message. This function is called by external message-sending methods and ensures the message is routed to the appropriate destination with the correct fee management. internal function for sending the messages used by all external send methods

Parameters

verify

On the destination chain, the message needs to be verified before being processed. This function checks the validity of the incoming message by comparing its origin and payload hash with the expected values. MESSAGING STEP 2 - on the destination chain configured receive library verifies a message

Parameters

lzReceive

This is the final step in the message execution process. After the message has been verified, it is delivered to the intended recipient address. The function can pass additional extraData if needed for execution. MESSAGING STEP 3 - the last step execute a verified message to the designated receiver the execution provides the execution context (caller, extraData) to the receiver. the receiver can optionally assert the caller and validate the untrusted extraData cant reentrant because the payload is cleared before execution

Parameters

lzReceiveAlert

This function handles a failure in message delivery and provides an alert to the application. It logs the reason for the failure and the state of the message, allowing developers to debug message processing errors.

Parameters

clear

This function allows an OApp (Omnichain Application) to clear a pending message manually. Instead of pushing the message through the standard delivery flow, the message is cleared from the queue, effectively marking it as processed or ignored. _Oapp uses this interface to clear a message. this is a PULL mode versus the PUSH mode of lzReceive the cleared message can be ignored by the app (effectively burnt) authenticated by oapp_

Parameters

setLzToken

This function allows the owner to set or change the LayerZero token (lzToken). This token may be used to pay for messaging fees. The function is designed to provide flexibility in case the initial configuration of the token was incorrect or needs to be updated. It should only be called by the contract owner. Users should avoid approving non-LayerZero tokens to be spent by the EndpointV2 contract, as this function can override the token used for fees. allows reconfiguration to recover from wrong configurations users should never approve the EndpointV2 contract to spend their non-layerzero tokens override this function if the endpoint is charging ERC20 tokens as native only owner

Parameters

recoverToken

This function allows the owner to recover tokens that were mistakenly sent to the EndpointV2 contract. It supports both native tokens (if _token is set to 0x0) and ERC20 tokens. This ensures that tokens accidentally locked in the contract can be safely retrieved by the owner. recover the token sent to this contract by mistake only owner

Parameters

_payToken

This internal function handles payments in ERC20 tokens. It ensures that the sender has approved the endpoint to spend the specified tokens and processes the payment. If the supplied token amount exceeds the required amount, the excess is refunded to the specified _refundAddress. handling token payments on endpoint. the sender must approve the endpoint to spend the token internal function

Parameters

_payNative

This internal function manages payments in native tokens (such as ETH). It processes the payment and refunds any excess amount to the _refundAddress. If the endpoint charges ERC20 tokens as native, this function can be overridden. handling native token payments on endpoint override this if the endpoint is charging ERC20 tokens as native internal function

Parameters

_suppliedLzToken

This internal view function returns the amount of LayerZero tokens (lzToken) supplied for payment, but only if _payInLzToken is set to true. It checks the balance of the lzToken used to pay for the messaging fee. get the balance of the lzToken as the supplied lzToken fee if payInLzToken is true

_suppliedNative

This internal function returns the amount of native tokens supplied for the payment. If the endpoint charges ERC20 tokens as native tokens, this function can be overridden to handle such cases. override this if the endpoint is charging ERC20 tokens as native

_assertMessagingFee

This internal function verifies that the supplied fees (both native and lzToken) are sufficient to cover the required messaging fees. If the supplied fees are insufficient, the function will assert an error. Assert the required fees and the supplied fees are enough

nativeToken

This external view function returns the address of the native ERC20 token used by the endpoint if it charges ERC20 tokens as native tokens. If the contract uses actual native tokens (like ETH), it returns 0x0. override this if the endpoint is charging ERC20 tokens as native

Return Values

setDelegate

This function allows an OApp to authorize a delegate to act on its behalf. The delegate can configure settings or perform other operations related to the LayerZero endpoint, effectively giving another address certain administrative permissions over the OApp’s endpoint interaction. delegate is authorized by the oapp to configure anything in layerzero

_initializable

This internal view function checks whether a message from a specific origin can be initialized for delivery to the receiver. The function verifies that the message can be safely processed based on the lazyInboundNonce, which controls the message order and flow.

_verifiable

This internal function checks whether a message from the given origin is verifiable for the receiver. It ensures that the message payload is valid and ready for execution based on the provided nonce and other checks. A payload with a hash of bytes(0) can never be submitted. bytes(0) payloadHash can never be submitted

_assertAuthorized

This internal function ensures that the caller is either the OApp or its authorized delegate. It acts as an access control check to verify that only trusted entities can configure or interact with the OApp’s LayerZero-related settings. assert the caller to either be the oapp or the delegate

initializable

This external view function checks whether a message from the given origin is ready to be initialized and processed for the specified receiver. It returns true if the message can be initialized.

verifiable

This external view function checks whether a message from the given origin is verifiable for the receiver. It confirms that the message payload has been received and validated.

EndpointV2Alt

EndpointV2Alt is the LayerZero V2 endpoint contract designed for blockchain networks where ERC20 tokens are used as native tokens (instead of standard native tokens like ETH or BNB). This contract supports altFeeTokens, which are ERC20 tokens that can be used for paying messaging fees. The architecture is optimized to reduce gas costs by making certain configurations immutable.

LZ_OnlyAltToken

This error is thrown when a non-ERC20 token is used in a context where only the altFeeToken (an ERC20 token) is allowed. It enforces that only the designated ERC20 token is used for certain operations in the contract.

nativeErc20

This holds the address of the ERC20 token used as the native currency in this contract. The nativeErc20 token is immutable, meaning that once it’s set, it cannot be changed. This saves gas by preventing unnecessary updates and checks. This token is used for paying fees when the chain doesn’t have a standard native token. the altFeeToken is used for fees when the native token has no value it is immutable for gas saving. only 1 endpoint for such chains

constructor

The constructor initializes the EndpointV2Alt contract, associating it with a unique Endpoint ID (_eid). It also specifies the owner of the contract and the altFeeToken (an ERC20 token) used for fees on the chain.

_payNative

This internal function handles native payments in the context of this contract. Since the contract operates on chains using ERC20 tokens as native tokens, _payNative processes payments in those tokens. If the supplied amount exceeds the required amount, the excess is refunded to the _refundAddress. handling native token payments on endpoint internal function

Parameters

_suppliedNative

This internal view function returns the amount of native tokens (ERC20 tokens, in this case) supplied for the payment. It is used to track the exact amount of tokens provided for a transaction, ensuring that the necessary fees are met. return the balance of the native token

setLzToken

This function allows the contract owner to set or change the LayerZero token (lzToken). The function checks if the new token address matches the current one before applying changes. The lzToken can be used for paying fees when applicable. check if lzToken is set to the same address

nativeToken

This external view function returns the address of the native ERC20 token used by the contract. If the contract uses actual native tokens, it returns 0x0. Otherwise, it returns the address of the ERC20 token acting as the native currency on the chain. override this if the endpoint is charging ERC20 tokens as native

Return Values

EndpointV2View

EndpointV2View is a contract used for viewing the state of LayerZero V2 messages, particularly related to whether a message is verifiable, executable, or initializable. This contract is typically used by other contracts or off-chain services that need to check the status of crosschain messages.

initialize

The initialize function sets the reference to the LayerZero endpoint (_endpoint). This endpoint is used for all subsequent verifications and message status checks. This function must be called before the contract can be used.

ExecutionState

This enum defines the possible execution states for a message within the LayerZero system: NotExecutable: The message is not yet ready for execution. VerifiedButNotExecutable: The message has been verified, but something is preventing its execution (e.g., not enough gas). Executable: The message is ready to be executed. Executed: The message has been successfully executed.

EndpointV2ViewUpgradeable

EndpointV2ViewUpgradeable is an upgradeable version of the EndpointV2View, adding support for certain upgrades while maintaining compatibility with existing state.

EMPTY_PAYLOAD_HASH

This constant represents an empty payload hash, which can be used to signal that no payload is associated with a message.

NIL_PAYLOAD_HASH

This constant represents a “nil” payload hash, often used to indicate that a payload has been intentionally left out or invalidated.

endpoint

This contract reference stores the LayerZero endpoint that the EndpointV2ViewUpgradeable is interacting with. It is used for all message-related queries and verifications.

__EndpointV2View_init

This internal initialization function sets the reference to the LayerZero endpoint. This function must be called during the deployment process to initialize the contract.

__EndpointV2View_init_unchained

This is a version of the initialization function that is not chained. It can be used in scenarios where the contract needs to be initialized without triggering additional logic.

initializable

This function checks if a message from a specific origin can be initialized for the provided receiver. It returns true if the message is ready to be processed (initialized).

verifiable

This function checks if a message from the given origin is verifiable for the provided receiver. It ensures that the payload hash matches and the message has been validated by the correct messaging library. check if a message is verifiable.

executable

This function checks the execution state of a message for a given origin and receiver. It returns the current execution state, whether the message is NotExecutable, VerifiedButNotExecutable, Executable, or Executed. check if a message is executable.

Return Values

MessageLibManager

MessageLibManager manages the messaging libraries (msgLib) that are used for sending and receiving messages in the LayerZero protocol. It controls the libraries that each application (OApp) can use, either by directly assigning libraries or defaulting to LayerZero’s settings.

blockedLibrary

The blockedLibrary is a specific library that is no longer allowed for sending or receiving messages.

registeredLibraries

An array storing the addresses of all libraries that are registered and can be used for message sending or receiving.

isRegisteredLibrary

This mapping tracks whether a given library is registered, providing a quick way to verify if a library is eligible for use.

sendLibrary

A mapping that stores the send libraries for each OApp (address) and endpoint ID (uint32). Each OApp can specify a library it wants to use for sending messages to a specific endpoint.

receiveLibrary

This mapping stores the receive libraries for each OApp (address) and endpoint ID (uint32). Each OApp can specify a library for handling received messages.

receiveLibraryTimeout

This mapping tracks the timeout period for a receive library. After a timeout period, the receive library may need to be updated or replaced. This helps manage library versioning and ensure that OApps can handle breaking changes in a safe manner.

defaultSendLibrary

This mapping holds the default send library for each endpoint (uint32). If an OApp does not specify a send library, the default send library for that endpoint is used.

defaultReceiveLibrary

The default receive library for each endpoint is stored here. If an OApp does not specify a receive library, the system defaults to the configured library for that endpoint.

defaultReceiveLibraryTimeout

This mapping tracks the timeout period for default receive libraries. After this period, the default library may need to be updated or retired.

constructor

The constructor is internal and initializes the MessageLibManager. It ensures that all the necessary mappings and configurations are properly set up when the contract is deployed.

onlyRegistered

This modifier ensures that only libraries registered with MessageLibManager can call certain functions. It restricts access to unregistered libraries, safeguarding the system from misuse.

isSendLib

This modifier ensures that only valid send libraries can call specific functions. It checks if the library is properly configured for sending messages.

isReceiveLib

This modifier ensures that only valid receive libraries can call certain functions. It verifies the library’s eligibility for processing received messages.

onlyRegisteredOrDefault

This modifier allows both registered libraries and default libraries to access certain functions, ensuring that the system works even when custom libraries are not defined.

onlySupportedEid

This modifier ensures that a library supports a specific endpoint ID (_eid). It checks if the library has been configured to handle messages for that endpoint. check if the library supported the eid.

getRegisteredLibraries

This function returns a list of all registered libraries. It allows users and applications to query which libraries are available for use.

getSendLibrary

This function retrieves the send library for a specific OApp (_sender) and destination endpoint (_dstEid). If the OApp has not specified a library, the default one is used. If the Oapp does not have a selected Send Library, this function will resolve to the default library configured by LayerZero

Parameters

Return Values

isDefaultSendLibrary

This function checks if the send library in use for a specific OApp and endpoint is the default one.

getReceiveLibrary

This function retrieves the receive library for a specific OApp (_receiver) and source endpoint (_srcEid). If the OApp has not specified a library, the default one is used. the receiveLibrary can be lazily resolved that if not set it will point to the default configured by LayerZero

isValidReceiveLibrary

This function checks if the specified receive library is valid for a given OApp, ensuring that the OApp can trust the message verification and processing done by the library. called when the endpoint checks if the msgLib attempting to verify the msg is the configured msgLib of the Oapp this check provides the ability for Oapp to lock in a trusted msgLib it will fist check if the msgLib is the currently configured one. then check if the msgLib is the one in grace period of msgLib versioning upgrade

registerLibrary

This function registers a new library with the MessageLibManager. Only the contract owner can register new libraries. all libraries have to implement the erc165 interface to prevent wrong configurations only owner

setDefaultSendLibrary

The contract owner sets the default send library for a specific endpoint. The new library must be registered and have support for the endpoint. owner setting the defaultSendLibrary can set to the blockedLibrary, which is a registered library the msgLib must enable the support before they can be registered to the endpoint as the default only owner

setDefaultReceiveLibrary

The contract owner sets the default receive library for a specific endpoint and may define a grace period during which the old library can still be used. owner setting the defaultSendLibrary must be a registered library (including blockLibrary) with the eid support enabled in version migration, it can add a grace period to the old library. if the grace period is 0, it will delete the timeout configuration. only owner

setDefaultReceiveLibraryTimeout

This function allows the contract owner to set a timeout for the default receive library for a given endpoint. After the timeout, the library may need to be updated or retired. owner setting the defaultSendLibrary must be a registered library (including blockLibrary) with the eid support enabled can used to (1) extend the current configuration (2) force remove the current configuration (3) change to a new configuration

Parameters

isSupportedEid

This function checks if an endpoint is supported, returning true only if both the default send and receive libraries are set. returns true only if both the default send/receive libraries are set

setSendLibrary

This function allows an OApp to set a custom send library for a specific endpoint. The library must be registered and support the endpoint. Oapp setting the sendLibrary must be a registered library (including blockLibrary) with the eid support enabled authenticated by the Oapp

setReceiveLibrary

An OApp can use this function to set a custom receive library, with an optional grace period during which the old library can still be used. Oapp setting the receiveLibrary must be a registered library (including blockLibrary) with the eid support enabled in version migration, it can add a grace period to the old library. if the grace period is 0, it will delete the timeout configuration. authenticated by the Oapp

Parameters

setReceiveLibraryTimeout

This function allows the OApp to set a timeout for its custom receive library. After the timeout, the OApp may need to update the library. Oapp setting the defaultSendLibrary must be a registered library (including blockLibrary) with the eid support enabled can used to (1) extend the current configuration (2) force remove the current configuration (3) change to a new configuration

Parameters

setConfig

This function allows the OApp to configure the messaging libraries with specific parameters. authenticated by the _oapp

getConfig

This function retrieves the current configuration of the OApp’s messaging libraries for a given endpoint and config type. a view function to query the current configuration of the OApp

_assertAuthorized

MessagingChannel

The MessagingChannel contract manages the lifecycle of messages sent across different blockchains using the LayerZero protocol. It tracks the nonces, payloads, and statuses of messages to ensure censorship resistance and reliable crosschain communication.

EMPTY_PAYLOAD_HASH

A constant representing an empty payload hash. This value is used when a message has no payload associated with it.

NIL_PAYLOAD_HASH

A constant representing a “nil” payload hash, used to indicate that a payload is invalidated or should be ignored.

eid

The unique Endpoint ID associated with this deployed messaging channel. It ensures that messages are routed correctly across different endpoints in LayerZero.

lazyInboundNonce

A mapping that tracks the inbound nonces for messages received. The nonces are updated lazily, meaning the nonce is incremented only when messages are processed, ensuring message order is preserved.

inboundPayloadHash

This mapping stores the hash of the payload for inbound messages. Each payload is uniquely identified by its sender, source endpoint, and nonce.

outboundNonce

This mapping tracks the next outbound nonce for a given sender, destination endpoint, and receiver. Nonces ensure that messages are delivered in order and without duplication.

constructor

The internal constructor initializes the messaging channel with the unique Endpoint ID (_eid). This ID is used to identify the channel in LayerZero’s messaging system.

Parameters

_outbound

This internal function increments and returns the next outbound nonce for the sender. It ensures that outbound messages are properly sequenced. increase and return the next outbound nonce

_inbound

The _inbound function updates the inbound message state lazily. It doesn’t immediately increment the nonce, allowing for out-of-order message verification while preserving censorship resistance. inbound won’t update the nonce eagerly to allow unordered verification instead, it will update the nonce lazily when the message is received messages can only be cleared in order to preserve censorship-resistance

inboundNonce

This function returns the highest contiguous verified inbound nonce. It iterates over the nonces, starting from the lazy inbound nonce, to find the last verified message. returns the max index of the longest gapless sequence of verified msg nonces. the uninitialized value is 0. the first nonce is always 1 it starts from the lazyInboundNonce (last checkpoint) and iteratively check if the next nonce has been verified this function can OOG if too many backlogs, but it can be trivially fixed by just clearing some prior messages NOTE: Oapp explicitly skipped nonces count as “verified” for these purposes eg. [1,2,3,4,6,7] => 4, [1,2,6,8,10] => 2, [1,3,4,5,6] => 1

_hasPayloadHash

This function checks if a given payload hash exists for a specific nonce. It assumes that a payload hash of zero means the payload has not been initialized. checks if the storage slot is not initialized. Assumes computationally infeasible that payload can hash to 0

skip

The skip function allows an OApp to skip a specific nonce, preventing the message from being verified or executed. This can be useful in race conditions or when a message is flagged as malicious. After skipping, the lazy inbound nonce is updated. the caller must provide _nonce to prevent skipping the unintended nonce it could happen in some race conditions, e.g. to skip nonce 3, but nonce 3 was consumed first usage: skipping the next nonce to prevent message verification, e.g. skip a message when Precrime throws alerts if the Oapp wants to skip a verified message, it should call the clear() function instead after skipping, the lazyInboundNonce is set to the provided nonce, which makes the inboundNonce also the provided nonce ie. allows the Oapp to increment the lazyInboundNonce without having had that corresponding msg be verified

nilify

This function marks a verified packet as nil, preventing it from being executed. A nilified packet cannot be verified or executed again unless it is re-verified with the correct payload hash. Marks a packet as verified, but disallows execution until it is re-verified. Reverts if the provided _payloadHash does not match the currently verified payload hash. A non-verified nonce can be nilified by passing EMPTY_PAYLOAD_HASH for _payloadHash. Assumes the computational intractability of finding a payload that hashes to bytes32.max. Authenticated by the caller

burn

The burn function permanently marks a packet as unexecutable and un-verifiable. This action is irreversible and can only be performed on packets that have not yet been executed. Marks a nonce as unexecutable and un-verifiable. The nonce can never be re-verified or executed. Reverts if the provided _payloadHash does not match the currently verified payload hash. Only packets with nonces less than or equal to the lazy inbound nonce can be burned. Reverts if the nonce has already been executed. Authenticated by the caller

_clearPayload

This function clears the stored payload for a message and updates the lazy inbound nonce. If there are many queued messages, the payload can be cleared in smaller batches to prevent out-of-gas errors. calling this function will clear the stored message and increment the lazyInboundNonce to the provided nonce if a lot of messages are queued, the messages can be cleared with a smaller step size to prevent OOG NOTE: this function does not change inboundNonce, it only changes the lazyInboundNonce up to the provided nonce

nextGuid

The nextGuid function returns the GUID for the next message in a specific path, providing a unique identifier for the message that can be included in the payload. returns the GUID for the next message given the path the Oapp might want to include the GUID into the message in some cases

_assertAuthorized

This internal function ensures that the caller of specific messaging operations is authorized, either by being the OApp or its delegate.

MessagingComposer

The MessagingComposer contract is responsible for composing LayerZero messages, enabling applications (OApps) to send messages in smaller piecewise operations or add extra steps to messages.

composeQueue

The composeQueue stores composed message fragments for each OApp. It maps the OApp’s address, the receiver’s address, a message GUID, and an index (for multi-part messages) to the hash of the composed message fragment. This ensures that messages can be composed and sent in a fragmented manner.

sendCompose

The sendCompose function allows an OApp to send a composed message fragment to the receiver. The sender must be authenticated, ensuring that only the intended OApp can send the message. Multiple fragments can be sent with the same GUID, allowing for more flexible message composition. the Oapp sends the lzCompose message to the endpoint the composer MUST assert the sender because anyone can send compose msg with this function with the same GUID, the Oapp can send compose to multiple _composer at the same time authenticated by the msg.sender

Parameters

lzCompose

The lzCompose function executes a composed message from the sender to the receiver. It provides the execution context (caller and extraData) to the receiver, allowing for additional validation. execute a composed messages from the sender to the composer (receiver) the execution provides the execution context (caller, extraData) to the receiver. the receiver can optionally assert the caller and validate the untrusted extraData can not re-entrant

Parameters

lzComposeAlert

The lzComposeAlert function is triggered when an issue occurs during message composition. It allows the contract to report why a composed message could not be processed.

Parameters

MessagingContext

The MessagingContext contract acts as a guard for preventing reentrancy and also provides execution context for messages sent and received in LayerZero. this contract acts as a non-reentrancy guard and a source of messaging context the context includes the remote eid and the sender address it separates the send and receive context to allow messaging receipts (send back on receive())

sendContext

The sendContext modifier sets the execution context for the message being sent. It encodes the context as a combination of the destination endpoint ID (_dstEid) and the sender’s address. This context helps track the message’s origin and ensures that only authorized parties can interact with it. the sendContext is set to 8 bytes 0s + 4 bytes eid + 20 bytes sender

isSendingMessage

The isSendingMessage function returns true if the contract is in the process of sending a message. It helps prevent reentrant calls during message processing. returns true if sending message

getSendContext

The getSendContext function retrieves the current send context, returning the destination endpoint ID and sender’s address if a message is being sent. If no message is being sent, it returns (0, 0). returns (eid, sender) if sending message, (0, 0) otherwise

_getSendContext

The _getSendContext function decodes the provided _context into its component parts: the destination endpoint ID and the sender’s address. This function is used internally to reconstruct the message context when needed.

ILayerZeroComposer

ILayerZeroComposer defines the interface for composing messages in LayerZero. It standardizes how OApps send composed messages and ensures non-reentrancy.

lzCompose

The lzCompose function is responsible for composing LayerZero messages from an OApp. To ensure that reentrancy is avoided, this function asserts that msg.sender is the corresponding EndpointV2 contract and from the correct OApp. To ensure non-reentrancy, implementers of this interface MUST assert msg.sender is the corresponding EndpointV2 contract (i.e., onlyEndpointV2).

Parameters

MessagingParams

The MessagingParams struct is used to define the parameters required for sending a LayerZero message. These parameters specify the destination endpoint, the message’s recipient, the actual message payload, and any additional options for the message.

MessagingReceipt

The MessagingReceipt struct provides information about a successfully sent LayerZero message, including a unique identifier (GUID), the nonce, and the fee details.

MessagingFee

The MessagingFee struct details the costs involved in sending a message, specifying the native token fee and the fee in LayerZero tokens (if applicable).

Origin

The Origin struct provides details about the source of a LayerZero message, including the source endpoint ID, the sender’s address, and the message’s nonce.

ILayerZeroEndpointV2

This interface defines the main interaction points for the LayerZero V2 protocol, which includes message quoting, sending, verification, and event logging for the protocol.

PacketSent

Emitted when a message packet is sent to a destination endpoint.

PacketVerified

Emitted when a message packet is verified on the destination endpoint.

PacketDelivered

Emitted when a message packet is successfully delivered to the destination receiver.

LzReceiveAlert

Emitted when an issue occurs during the receipt of a message, such as insufficient gas or a failure in message execution.

LzTokenSet

Emitted when the LayerZero token address is set or updated.

DelegateSet

Emitted when a delegate is authorized by an OApp to configure LayerZero settings.

quote

send

verify

verifiable

initializable

lzReceive

clear

setLzToken

lzToken

nativeToken

setDelegate

ILayerZeroReceiver

This interface defines the core message-receiving functionality on LayerZero to be implemented by receiver applications.

allowInitializePath

Returns whether the path from the origin can be initialized.

nextNonce

Returns the next nonce for a sender on the specified endpoint.

lzReceive

Processes the received message on the destination chain.

MessageLibType

The MessageLibType enum defines the possible types of messaging libraries in LayerZero.
  • Send: A library that only handles sending messages.
  • Receive: A library that only handles receiving messages.
  • SendAndReceive: A library that handles both sending and receiving messages.

IMessageLib

The IMessageLib interface defines functions that allow configuration of messaging libraries, checking endpoint support, and obtaining versioning and library type details.

setConfig

Allows an OApp (Omnichain Application) to set configuration parameters for a specific messaging library.

getConfig

Fetches the configuration of an OApp for a specific endpoint and configuration type.

isSupportedEid

Checks if the messaging library supports a specific endpoint ID (_eid).

version

Returns the version of the messaging library, including the major, minor, and endpoint version numbers.

messageLibType

Returns the type of the messaging library (Send, Receive, or SendAndReceive) as defined in the MessageLibType enum.

SetConfigParam

The SetConfigParam struct defines configuration settings for registered Message Libraries.

IMessageLibManager

The IMessageLibManager interface manages the registration of messaging libraries, setting default libraries, and handling receive library timeouts.

Timeout

The Timeout struct defines the expiration settings for a messaging library that has been changed.

LibraryRegistered

Emitted when a new library is registered.

DefaultSendLibrarySet

Emitted when the default send library is set for a specific endpoint.

DefaultReceiveLibrarySet

Emitted when the default receive library is set for a specific endpoint.

DefaultReceiveLibraryTimeoutSet

Emitted when a timeout is set for the default receive library.

SendLibrarySet

Emitted when a send library is set for an OApp.

ReceiveLibrarySet

Emitted when a receive library is set for an OApp.

ReceiveLibraryTimeoutSet

Emitted when a receive library timeout is set for an OApp.

registerLibrary

Registers a new messaging library that will be available for endpoints.

isRegisteredLibrary

Checks if a messaging library is registered.

getRegisteredLibraries

Returns a list of all registered libraries.

setDefaultSendLibrary

Sets the default send library for a specific endpoint.

defaultSendLibrary

Gets the current default send library for a specific endpoint.

setDefaultReceiveLibrary

Sets the default receive library for a specific endpoint and specifies a grace period for migration.

defaultReceiveLibrary

Gets the current default receive library for a specific endpoint.

setDefaultReceiveLibraryTimeout

Sets the timeout for a default receive library.

defaultReceiveLibraryTimeout

Gets the default receive library timeout for a specific endpoint.

isSupportedEid

isValidReceiveLibrary

setSendLibrary

Sets a send library for an OApp for a specific endpoint.

getSendLibrary

isDefaultSendLibrary

setReceiveLibrary

getReceiveLibrary

setReceiveLibraryTimeout

receiveLibraryTimeout

setConfig

getConfig

IMessagingChannel

InboundNonceSkipped

PacketNilified

PacketBurnt

eid

skip

nilify

burn

nextGuid

inboundNonce

outboundNonce

inboundPayloadHash

lazyInboundNonce

IMessagingComposer

ComposeSent

ComposeDelivered

LzComposeAlert

composeQueue

sendCompose

lzCompose

IMessagingContext

isSendingMessage

getSendContext

Packet

The Packet struct represents the data structure used for LayerZero messaging between endpoints. It includes important metadata such as sender, receiver, nonce, and the message itself.

ISendLib

The ISendLib interface defines the functions necessary for sending packets, estimating messaging fees, and handling fee withdrawals for LayerZero messaging.

send

Sends a LayerZero message packet and returns the required fees and the encoded packet data.
  • _packet: The Packet struct containing the message to be sent.
  • _options: Byte-encoded options for the message.
  • _payInLzToken: Boolean flag indicating whether fees should be paid in LzToken.
Returns:
  • MessagingFee: The fees for the message, divided into native and LzToken fees.
  • encodedPacket: The encoded message packet in bytes.

quote

Estimates the messaging fee for sending a LayerZero packet.

setTreasury

Sets the treasury address to receive collected fees.

withdrawFee

Withdraws native token fees collected by the contract.

withdrawLzTokenFee

Withdraws LayerZero token fees collected by the contract.

AddressCast

The AddressCast library provides utility functions for casting between addresses and their byte representations. It also includes error handling for invalid address sizes.

AddressCast_InvalidSizeForAddress

Thrown when the size of the byte array for an address is invalid.

AddressCast_InvalidAddress

Thrown when an invalid address is provided.

toBytes32

Casts a byte array to a bytes32 representation of an address.

toBytes32

Casts an address to its bytes32 representation.

toBytes

Casts a bytes32 address to its byte array form, with a specified size.

toAddress

Casts a bytes32 representation of an address back to an address.

toAddress

Casts a byte array back to an address.

CalldataBytesLib

The CalldataBytesLib provides functions to convert portions of calldata (byte arrays) into various Solidity types. These functions help when dealing with raw calldata.

toU8

Converts a portion of a byte array to a uint8 starting at the given position.

toU16

Converts a portion of a byte array to a uint16 starting at the given position.

toU32

Converts a portion of a byte array to a uint32 starting at the given position.

toU64

Converts a portion of a byte array to a uint64 starting at the given position.

toU128

Converts a portion of a byte array to a uint128 starting at the given position.

toU256

Converts a portion of a byte array to a uint256 starting at the given position.

toAddr

Converts a portion of a byte array to an address starting at the given position.

toB32

Converts a portion of a byte array to a bytes32 starting at the given position.

Errors

LZ_LzTokenUnavailable

LZ_InvalidReceiveLibrary

LZ_InvalidNonce

LZ_InvalidArgument

LZ_InvalidExpiry

LZ_InvalidAmount

LZ_OnlyRegisteredOrDefaultLib

LZ_OnlyRegisteredLib

LZ_OnlyNonDefaultLib

LZ_Unauthorized

LZ_DefaultSendLibUnavailable

LZ_DefaultReceiveLibUnavailable

LZ_PathNotInitializable

LZ_PathNotVerifiable

LZ_OnlySendLib

LZ_OnlyReceiveLib

LZ_UnsupportedEid

LZ_UnsupportedInterface

LZ_AlreadyRegistered

LZ_SameValue

LZ_InvalidPayloadHash

LZ_PayloadHashNotFound

LZ_ComposeNotFound

LZ_ComposeExists

LZ_SendReentrancy

LZ_NotImplemented

LZ_InsufficientFee

LZ_ZeroLzTokenFee

GUID

generate

Transfer

ADDRESS_ZERO

Transfer_NativeFailed

Transfer_ToAddressIsZero

native

token

nativeOrToken

BlockedMessageLib

supportsInterface

See IERC165 and supportsInterface.

version

messageLibType

isSupportedEid

fallback

BitMaps

get

Returns whether the bit at index is set.

set

Sets the bit at index.

ExecutorOptions

WORKER_ID

OPTION_TYPE_LZRECEIVE

OPTION_TYPE_NATIVE_DROP

OPTION_TYPE_LZCOMPOSE

OPTION_TYPE_ORDERED_EXECUTION

Executor_InvalidLzReceiveOption

Executor_InvalidNativeDropOption

Executor_InvalidLzComposeOption

nextExecutorOption

decode the next executor option from the options starting from the specified cursor

Parameters

Return Values

decodeLzReceiveOption

decodeNativeDropOption

decodeLzComposeOption

encodeLzReceiveOption

encodeNativeDropOption

encodeLzComposeOption

PacketV1Codec

PACKET_VERSION

encode

encodePacketHeader

encodePayload

version

nonce

srcEid

sender

senderAddressB20

dstEid

receiver

receiverB20

guid

message

payload

payloadHash

MessageLibBase

This contract serves as a base for handling the communication between the LayerZero endpoint and a specific chain (referred to by its localEid). It simplifies the initialization and enforcement of endpoint-specific logic. simply a container of endpoint address and local eid

endpoint

Holds the address of the LayerZero endpoint on this chain.

localEid

A unique identifier (Eid) for the local chain.

LZ_MessageLib_OnlyEndpoint

Error thrown when a function is accessed by a non-endpoint address.

onlyEndpoint

A modifier ensuring that only the LayerZero endpoint can call specific functions.

constructor

Initializes the contract with the LayerZero endpoint and localEid.

ReceiveLibBaseE2

This is the base contract for handling the receive-side logic of messages in LayerZero V2. It simplifies the process compared to V1 by removing complexities like nonce management and executor whitelisting. receive-side message library base contract on endpoint v2. it does not have the complication as the one of endpoint v1, such as nonce, executor whitelist, etc.

constructor

Initializes the contract with the LayerZero endpoint.

supportsInterface

Determines whether the contract supports a specific interface.

messageLibType

Specifies the type of the message library being used (e.g., for differentiation between send and receive libraries).

WorkerOptions

Defines options for specific worker configurations (e.g., a worker ID and additional options).

SetDefaultExecutorConfigParam

Used to configure the default settings for an executor, including the executor’s address and max message size for a given chain (eid).

ExecutorConfig

SendLibBase

base contract for both SendLibBaseE1 and SendLibBaseE2

TREASURY_MAX_COPY

treasuryGasLimit

treasuryNativeFeeCap

treasury

executorConfigs

fees

ExecutorFeePaid

TreasurySet

DefaultExecutorConfigsSet

ExecutorConfigSet

TreasuryNativeFeeCapSet

LZ_MessageLib_InvalidMessageSize

LZ_MessageLib_InvalidAmount

LZ_MessageLib_TransferFailed

LZ_MessageLib_InvalidExecutor

LZ_MessageLib_ZeroMessageSize

constructor

setDefaultExecutorConfigs

setTreasuryNativeFeeCap

the new value can not be greater than the old value, i.e. down only

getExecutorConfig

_assertMessageSize

_payExecutor

_payTreasury

_quote

the abstract process for quote() is: 0/ split out the executor options and options of other workers 1/ quote workers 2/ quote executor 3/ quote treasury

Return Values

_quoteTreasury

this interface should be DoS-free if the user is paying with native. properties 1/ treasury can return an overly high lzToken fee 2/ if treasury returns an overly high native fee, it will be capped by maxNativeFee, which can be reasoned with the configurations 3/ the owner can not configure the treasury in a way that force this function to revert

_parseTreasuryResult

_debitFee

authenticated by msg.sender only

_setTreasury

_setExecutorConfig

_quoteVerifier

these two functions will be overridden with specific logics of the library function

_splitOptions

this function will split the options into executorOptions and validationOptions

SendLibBaseE2

send-side message library base contract on endpoint v2. design: the high level logic is the same as SendLibBaseE1 1/ with added interfaces 2/ adapt the functions to the new types, like uint32 for eid, address for sender.

NativeFeeWithdrawn

LzTokenFeeWithdrawn

LZ_MessageLib_NotTreasury

LZ_MessageLib_CannotWithdrawAltToken

constructor

supportsInterface

send

setTreasury

withdrawFee

E2 only

withdrawLzTokenFee

_lzToken is a user-supplied value because lzToken might change in the endpoint before all lzToken can be taken out E2 only treasury only function

quote

messageLibType

_payWorkers

1/ handle executor 2/ handle other workers

_payVerifier

receive

Treasury

nativeBP

lzTokenFee

lzTokenEnabled

LZ_Treasury_LzTokenNotEnabled

getFee

payFee

setLzTokenEnabled

setNativeFeeBP

setLzTokenFee

withdrawLzToken

withdrawNativeFee

withdrawToken

_getFee

Worker

MESSAGE_LIB_ROLE

ALLOWLIST

DENYLIST

ADMIN_ROLE

workerFeeLib

allowlistSize

defaultMultiplierBps

priceFeed

supportedOptionTypes

constructor

Parameters

onlyAcl

hasAcl

_Access control list using allowlist and denylist
  1. if one address is in the denylist -> deny
  2. else if address in the allowlist OR allowlist is empty (allows everyone)-> allow
  3. else deny_

Parameters

setPaused

flag to pause execution of workers (if used with whenNotPaused modifier)

Parameters

setPriceFeed

Parameters

setWorkerFeeLib

Parameters

setDefaultMultiplierBps

Parameters

withdrawFee

supports withdrawing fee from ULN301, ULN302 and more

Parameters

withdrawToken

supports withdrawing token from the contract

Parameters

setSupportedOptionTypes

getSupportedOptionTypes

_grantRole

overrides AccessControl to allow for counting of allowlistSize

Parameters

_revokeRole

overrides AccessControl to allow for counting of allowlistSize

Parameters

renounceRole

overrides AccessControl to disable renouncing of roles

TargetParam

DVNParam

IExecutor

DstConfigParam

DstConfig

ExecutionParams

NativeDropParams

DstConfigSet

NativeDropApplied

dstConfig

IExecutorFeeLib

FeeParams

Executor_NoOptions

Executor_NativeAmountExceedsCap

Executor_UnsupportedOptionType

Executor_InvalidExecutorOptions

Executor_ZeroLzReceiveGasProvided

Executor_ZeroLzComposeGasProvided

Executor_EidNotSupported

getFeeOnSend

getFee

ILayerZeroExecutor

assignJob

getFee

ILayerZeroTreasury

getFee

payFee

IWorker

SetWorkerLib

SetPriceFeed

SetDefaultMultiplierBps

SetSupportedOptionTypes

Withdraw

Worker_NotAllowed

Worker_OnlyMessageLib

Worker_RoleRenouncingDisabled

setPriceFeed

priceFeed

setDefaultMultiplierBps

defaultMultiplierBps

withdrawFee

setSupportedOptionTypes

getSupportedOptionTypes

SafeCall

copied from https://github.com/nomad-xyz/ExcessivelySafeCall/blob/main/src/ExcessivelySafeCall.sol.

safeCall

calls a contract with a specified gas limit and value and captures the return data

Parameters

Return Values

safeStaticCall

Use when you really really really don’t trust the called contract. This prevents the called contract from causing reversion of the caller in as many ways as we can. The main difference between this and a solidity low-level call is that we limit the number of bytes that the callee can cause to be copied to caller memory. This prevents stupid things like malicious contracts returning 10,000,000 bytes causing a local OOG when copying to memory.

Parameters

Return Values

DVNMock

Executed

vid

constructor

execute

verify

ExecutorMock

NativeDropMeta

NativeDropped

Executed301

Executed302

dstEid

constructor

nativeDrop

nativeDropAndExecute301

execute301

nativeDropAndExecute302

_nativeDrop

LzReceiveParam

NativeDropParam

IReceiveUlnView

verifiable

Verification

ReceiveUlnBase

includes the utility functions for checking ULN states and logics

hashLookup

PayloadVerified

LZ_ULN_InvalidPacketHeader

LZ_ULN_InvalidPacketVersion

LZ_ULN_InvalidEid

LZ_ULN_Verifying

verifiable

assertHeader

_verify

per DVN signing function

_verified

_verifyAndReclaimStorage

_assertHeader

_checkVerifiable

for verifiable view function checks if this verification is ready to be committed to the endpoint

SendUlnBase

includes the utility functions for checking ULN states and logics

DVNFeePaid

_splitUlnOptions

_payDVNs

---------- pay and assign jobs ----------

_assignJobs

_quoteDVNs

---------- quote ----------

_getFees

UlnConfig

SetDefaultUlnConfigParam

UlnBase

includes the utility functions for checking ULN states and logics

DEFAULT

NIL_DVN_COUNT

NIL_CONFIRMATIONS

ulnConfigs

LZ_ULN_Unsorted

LZ_ULN_InvalidRequiredDVNCount

LZ_ULN_InvalidOptionalDVNCount

LZ_ULN_AtLeastOneDVN

LZ_ULN_InvalidOptionalDVNThreshold

LZ_ULN_InvalidConfirmations

LZ_ULN_UnsupportedEid

DefaultUlnConfigsSet

UlnConfigSet

setDefaultUlnConfigs

_about the DEFAULT ULN config
  1. its values are all LITERAL (e.g. 0 is 0). whereas in the oapp ULN config, 0 (default value) points to the default ULN config this design enables the oapp to point to DEFAULT config without explicitly setting the config
  2. its configuration is more restrictive than the oapp ULN config that a) it must not use NIL value, where NIL is used only by oapps to indicate the LITERAL 0 b) it must have at least one DVN_

getUlnConfig

getAppUlnConfig

Get the uln config without the default config for the given remoteEid.

_setUlnConfig

_isSupportedEid

a supported Eid must have a valid default uln config, which has at least one dvn

_assertSupportedEid

ExecuteParam

ISendLibBase

fees

IReceiveUln

verify

ReceiveLibParam

DVNAdapterBase

base contract for DVN adapters _limitations:
  • doesn’t accept alt token
  • doesn’t respect block confirmations_

DVNAdapter_InsufficientBalance

DVNAdapter_NotImplemented

DVNAdapter_MissingRecieveLib

ReceiveLibsSet

MAX_CONFIRMATIONS

on change of application config, dvn adapters will not perform any additional verification to avoid messages from being stuck, all verifications from adapters will be done with the maximum possible confirmations

receiveLibs

receive lib to call verify() on at destination

constructor

setReceiveLibs

sets receive lib for destination chains DEFAULT_ADMIN_ROLE can set MESSAGE_LIB_ROLE for sendLibs and use below function to set receiveLibs

_getAndAssertReceiveLib

_encode

_encodeEmpty

_decodeAndVerify

_withdrawFeeFromSendLib

_assertBalanceAndWithdrawFee

receive

to receive refund

DVNAdapterMessageCodec

DVNAdapter_InvalidMessageSize

PACKET_HEADER_SIZE

MESSAGE_SIZE

encode

decode

srcEid

IDVN

DstConfigParam

DstConfig

SetDstConfig

dstConfig

IDVNFeeLib

FeeParams

DVN_UnsupportedOptionType

DVN_EidNotSupported

getFeeOnSend

getFee

ILayerZeroDVN

AssignJobParam

assignJob

getFee

IReceiveUlnE2

should be implemented by the ReceiveUln302 contract and future ReceiveUln contracts on EndpointV2

verify

for each dvn to verify the payload this function signature 0x0223536e

commitVerification

verify the payload at endpoint, will check if all DVNs verified

DVNOptions

WORKER_ID

OPTION_TYPE_PRECRIME

DVN_InvalidDVNIdx

DVN_InvalidDVNOptions

groupDVNOptionsByIdx

group dvn options by its idx

Parameters

Return Values

_insertDVNOptions

getNumDVNs

get the number of unique dvns

Parameters

nextDVNOption

decode the next dvn option from _options starting from the specified cursor

Parameters

Return Values

UlnOptions

TYPE_1

TYPE_2

TYPE_3

LZ_ULN_InvalidWorkerOptions

LZ_ULN_InvalidWorkerId

LZ_ULN_InvalidLegacyType1Option

LZ_ULN_InvalidLegacyType2Option

LZ_ULN_UnsupportedOptionType

decode

decode the options into executorOptions and dvnOptions

Parameters

Return Values

decodeLegacyOptions

decode the legacy options (type 1 or 2) into executorOptions

Parameters

Return Values

AddressSizeConfig

addressSizes

AddressSizeSet

AddressSizeConfig_InvalidAddressSize

AddressSizeConfig_AddressSizeAlreadySet

setAddressSize

ILayerZeroReceiveLibrary

setConfig

getConfig

SetDefaultExecutorParam

ReceiveLibBaseE1

receive-side message library base contract on endpoint v1. design: 1/ it provides an internal execute function that calls the endpoint. It enforces the path definition on V1. 2/ it provides interfaces to configure executors that is whitelisted to execute the msg to prevent grieving

executors

defaultExecutors

PacketDelivered

InvalidDst

DefaultExecutorsSet

ExecutorSet

LZ_MessageLib_InvalidExecutor

LZ_MessageLib_OnlyExecutor

constructor

setDefaultExecutors

getExecutor

_setExecutor

_execute

this function change pack the path as required for EndpointV1

ReceiveUln301

ULN301 will be deployed on EndpointV1 and is for backward compatibility with ULN302 on EndpointV2. 301 can talk to both 301 and 302 This is a gluing contract. It simply parses the requests and forward to the super.impl() accordingly. In this case, it combines the logic of ReceiveUlnBase and ReceiveLibBaseE1

CONFIG_TYPE_EXECUTOR

CONFIG_TYPE_ULN

LZ_ULN_InvalidConfigType

constructor

setConfig

commitVerification

in 301, this is equivalent to execution as in Endpoint V2 dont need to check endpoint verifiable here to save gas, as it will reverts if not verifiable.

verify

getConfig

version

VerificationState

IReceiveUln301

assertHeader

addressSizes

endpoint

verifiable

getUlnConfig

ReceiveUln301View

endpoint

receiveUln301

localEid

initialize

executable

verifiable

keeping the same interface as 302 a verifiable message requires it to be ULN verifiable only, excluding the endpoint verifiable check

SendLibBaseE1

send-side message library base contract on endpoint v1. design: 1/ it enforces the path definition on V1 and interacts with the nonce contract 2/ quote: first executor, then verifier (e.g. DVNs), then treasury 3/ send: first executor, then verifier (e.g. DVNs), then treasury. the treasury pay much be DoS-proof

nonceContract

treasuryFeeHandler

lzToken

PacketSent

NativeFeeWithdrawn

LzTokenSet

constructor

send

the abstract process for send() is: 1/ pay workers, which includes the executor and the validation workers 2/ pay treasury 3/ in EndpointV1, here we handle the fees and refunds

setLzToken

setTreasury

withdrawFee

estimateFees

_assertPath

path = remoteAddress + localAddress.

_payLzTokenFee

_outbound

_outbound does three things
  1. asserts path
  2. increments the nonce
  3. assemble packet_

Return Values

_payWorkers

1/ handle executor 2/ handle other workers

_payVerifier

SendUln301

ULN301 will be deployed on EndpointV1 and is for backward compatibility with ULN302 on EndpointV2. 301 can talk to both 301 and 302 This is a gluing contract. It simply parses the requests and forward to the super.impl() accordingly. In this case, it combines the logic of SendUlnBase and SendLibBaseE1

CONFIG_TYPE_EXECUTOR

CONFIG_TYPE_ULN

LZ_ULN_InvalidConfigType

constructor

setConfig

getConfig

version

isSupportedEid

_quoteVerifier

_payVerifier

_splitOptions

this function will split the options into executorOptions and validationOptions

TreasuryFeeHandler

endpoint

LZ_TreasuryFeeHandler_OnlySendLibrary

LZ_TreasuryFeeHandler_OnlyOnSending

LZ_TreasuryFeeHandler_InvalidAmount

constructor

payFee

IMessageLibE1

extends ILayerZeroMessagingLibrary instead of ILayerZeroMessagingLibraryV2 for reducing the contract size

LZ_MessageLib_InvalidPath

LZ_MessageLib_InvalidSender

LZ_MessageLib_InsufficientMsgValue

LZ_MessageLib_LzTokenPaymentAddressMustBeSender

setLzToken

setTreasury

withdrawFee

version

INonceContract

increment

ITreasuryFeeHandler

payFee

IUltraLightNode301

commitVerification

NonceContractMock

OnlySendLibrary

endpoint

outboundNonce

constructor

increment

ReceiveUln302

This is a gluing contract. It simply parses the requests and forward to the super.impl() accordingly. In this case, it combines the logic of ReceiveUlnBase and ReceiveLibBaseE2

CONFIG_TYPE_ULN

CONFIG_TYPE_ULN=2 here to align with SendUln302/ReceiveUln302/ReceiveUln301

LZ_ULN_InvalidConfigType

constructor

supportsInterface

setConfig

commitVerification

dont need to check endpoint verifiable here to save gas, as it will reverts if not verifiable.

verify

for dvn to verify the payload

getConfig

isSupportedEid

version

VerificationState

IReceiveUln302

assertHeader

verifiable

getUlnConfig

ReceiveUln302View

receiveUln302

localEid

initialize

verifiable

a ULN verifiable requires it to be endpoint verifiable and committable

_endpointVerifiable

checks for endpoint verifiable and endpoint has payload hash

SendUln302

This is a gluing contract. It simply parses the requests and forward to the super.impl() accordingly. In this case, it combines the logic of SendUlnBase and SendLibBaseE2

CONFIG_TYPE_EXECUTOR

CONFIG_TYPE_ULN

LZ_ULN_InvalidConfigType

constructor

setConfig

getConfig

version

isSupportedEid

_quoteVerifier

_payVerifier

_splitOptions

this function will split the options into executorOptions and validationOptions

WorkerUpgradeable

MESSAGE_LIB_ROLE

ALLOWLIST

DENYLIST

ADMIN_ROLE

workerFeeLib

allowlistSize

defaultMultiplierBps

priceFeed

supportedOptionTypes

__Worker_init

Parameters

__Worker_init_unchained

onlyAcl

hasAcl

_Access control list using allowlist and denylist
  1. if one address is in the denylist -> deny
  2. else if address in the allowlist OR allowlist is empty (allows everyone)-> allow
  3. else deny_

Parameters

setPaused

flag to pause execution of workers (if used with whenNotPaused modifier)

Parameters

setPriceFeed

Parameters

setWorkerFeeLib

Parameters

setDefaultMultiplierBps

Parameters

withdrawFee

supports withdrawing fee from ULN301, ULN302 and more

Parameters

withdrawToken

supports withdrawing token from the contract

Parameters

setSupportedOptionTypes

getSupportedOptionTypes

_grantRole

overrides AccessControl to allow for counting of allowlistSize

Parameters

_revokeRole

overrides AccessControl to allow for counting of allowlistSize

Parameters

renounceRole

overrides AccessControl to disable renouncing of roles