Morpheus
GitHubDiscordX/Twitter
Infohub
Infohub
  • 🙌Meet Morpheus
    • What is Morpheus?
    • MySuperAgent
      • Difference Between an LLM and an AI Agent
    • Key Use Cases
    • Launch Phases
    • Morpheus Contributors
    • Atomic Governance
    • 10 Reasons to be Excited About Morpheus
  • 📶Tokenomics
    • MOR Utility
    • MOR Emissions
    • Techno Capital Machine
      • MOR 20 Fair Launch Standard
    • Protocol-Owned Liquidity (PoL)
    • MOR Rewards Staking
    • stETH Referral System
  • 🎓Smart Contracts
    • Documentation
      • Distribution V4
      • L1 Sender
      • L2 Message Receiver
      • L2 Token Receiver V2
      • Linear Distribution Interval Decrease
      • MOR OFT
      • MOR 20 Contracts
    • Multisignature account
  • 🛡️Security Audits
    • Morpheus Bug Bounty Program
    • Protection Fund
  • ❓FAQs
    • MOR Token and Liquidity
    • MOR Rewards Staking
    • Capital Providers
    • Code Providers
    • Compute Providers
    • Application Builders
  • 🔗Verified Links
  • 🌟Brand Assets
Powered by GitBook
LogoLogo

Socials

  • X/Twitter
  • Discord
  • Telegram
  • Youtube

GitHub

  • Documentation
  • Morpheus Local Agents
  • Compute Node
  • Smart Contracts

Dashboards

  • mor.org
  • mor.software
  • morlord.com
  1. Smart Contracts
  2. Documentation

L2 Message Receiver

Last updated 7 months ago

Was this helpful?

is an implementation of the interface used to receive messages via LayerZero. It receives instructions to mint MOR tokens (e.g. to Capital Providers) from L1Sender on Ethereum.

Variables

Name
Type
Description

rewardToken

address

The address of the wrapped reward token (wstETH) on Arbitrum.

config

Config

Configuration data for LayerZero messaging.

Functions

lzReceive

function lzReceive(
    uint16 senderChainId_,
    bytes memory senderAndReceiverAddresses_,
    uint64 nonce_,
    bytes memory payload_
    ) external

Mints MOR tokens according to instructions sent by L1Sender via LayerZero. This function is .

Parameters:

Name
Type
Description

senderChainId_

uint16

The LayerZero endpointId of the sender (101/Ethereum)

senderAndReceiverAddresses_

bytes

Concatenated addresses of the sender L1Sender and receiver L2MessageReceiver.

nonce_

uint64

Nonce of the message.

payload_

bytes

Minting instructions sent by L1Sender, consisting of an address to mint MOR tokens to and an amount. ABI encoded as (address, uint256).

nonblockingLzReceive

function nonblockingLzReceive(
    uint16 senderChainId_,
    bytes memory senderAndReceiverAddresses_,
    bytes memory payload_
    ) public

Parameters:

Name
Type
Description

senderChainId_

uint16

The LayerZero endpointId of the sender (101/Ethereum)

senderAndReceiverAddresses_

bytes

Concatenated addresses of the sender L1Sender and receiver L2MessageReceiver.

payload_

bytes

Minting instructions sent by L1Sender, consisting of an address to mint MOR tokens to and an amount. ABI encoded as (address, uint256).

retryMessage

function retryMessage(
    uint16 senderChainId_,
    bytes memory senderAndReceiverAddresses_,
    uint64 nonce_,
    bytes memory payload_
    ) external

Retries the processing of a previously failed message.

Parameters

Name
Type
Description

senderChainId_

uint16

The LayerZero endpointId of the sender (101/Ethereum)

senderAndReceiverAddresses_

bytes

Concatenated addresses of the sender L1Sender and receiver L2MessageReceiver.

nonce_

uint64

Nonce of the failed message.

payload_

bytes

Minting instructions sent by L1Sender, consisting of an address to mint MOR tokens to and an amount. ABI encoded as (address, uint256).

L2MessageReceiver__init

function L2MessageReceiver__init() external initializer {
    __Ownable_init();
    __UUPSUpgradeable_init();
    }

Initializes the contract for ownership and upgradeability.

setParams

function setParams(
    address rewardToken_,
    Config calldata config_
    ) external onlyOwner

Sets the parameters of the contract, including the address of the wrapped reward token (wstETH) on Arbitrum and LayerZero configuration settings.

Parameters:

Name
Type
Description

rewardToken_

address

The address of the wrapped reward token on Arbitrum.

config_

Config

Config struct containing various parameters.

Structs

Config

struct Config {
    address gateway;
    address sender;
    uint16 senderChainId;
    }

Configuration data for LayerZero messaging.

Fields

Name
Type
Description

gateway

address

The address of the LayerZero gateway on Arbitrum.

sender

address

The address of L1Sender.

senderChainId

uint16

The LayerZero endpointId of the sender (101/Ethereum)

Mints MOR tokens according to instructions sent by L1Sender via LayerZero. This function is .

🎓
L2MessageReceiver.sol
ILayerZeroReceiver
blocking
non-blocking