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

L1 Sender

Last updated 7 months ago

Was this helpful?

is responsible for sending tokens and messages from Ethereum to Arbitrum. It is called by Distribution to:

  • Wrap and send the deposit token (stETH) to Arbitrum via the native Arbitrum bridge

  • Send instructions to mint MOR to Arbitrum via LayerZero

Variables

Name
Type
Description

unwrappedDepositToken

address

The address of the unwrapped deposit token (stETH).

distribution

address

The Distribution contract address.

rewardTokenConfig

RewardTokenConfig

Configuration settings for the reward token (MOR).

depositTokenConfig

DepositTokenConfig

Configuration settings for the wrapped deposit token (wstETH).

Functions

sendDepositToken

function sendDepositToken(
    uint256 gasLimit_,
    uint256 maxFeePerGas_,
    uint256 maxSubmissionCost_
    ) external payable onlyDistribution returns (bytes memory)

Wraps and sends the deposit token (stETH) to Arbitrum via the Gateway Router. This function can only be called by Distribution.

Parameters

Name
Type
Description

gasLimit_

uint256

The gas limit for the transaction.

maxFeePerGas_

uint256

The maximum fee per gas the sender is willing to pay.

maxSubmissionCost_

uint256

The maximum cost the sender is willing to pay for submission.

Return Values

Type
Description

bytes

The ABI-encoded Arbitrum inbox sequence number.

sendMintMessage

function sendMintMessage(
    address user_,
    uint256 amount_,
    address refundTo_
    ) external payable onlyDistribution

Sends a message to mint reward tokens (MOR) on Arbitrum via LayerZero. This function can only be called by Distribution.

Parameters

Name
Type
Description

user_

address

The user address to receive the minted tokens.

amount_

uint256

The amount of tokens to mint.

refundTo_

address

The address to refund any excess payment.

L1Sender__init

function L1Sender__init(
    address distribution_,
    RewardTokenConfig calldata rewardTokenConfig_,
    DepositTokenConfig calldata depositTokenConfig_
    ) external initializer

Initializes the contract with the Distribution address, reward token configuration, and deposit token configuration.

Parameters

Name
Type
Description

distribution_

address

The address responsible for distributing tokens.

rewardTokenConfig_

RewardTokenConfig

Configuration settings for the reward token.

depositTokenConfig_

DepositTokenConfig

Configuration settings for the deposit token.

setDistribution

function setDistribution(
    address distribution_
    ) public onlyOwner

Sets the Distribution address. This function can only be called by the contract owner.

Parameters

Name
Type
Description

distribution_

address

The address of Distribution to be set.

setRewardTokenConfig

function setRewardTokenConfig(
    RewardTokenConfig calldata newConfig_
    ) public onlyOwner

Updates the reward token configuration. This function can only be called by the contract owner.

Parameters

Name
Type
Description

newConfig_

RewardTokenConfig

The new configuration for the reward token.

setDepositTokenConfig

function setDepositTokenConfig(
    DepositTokenConfig calldata newConfig_
    ) public onlyOwner

Updates the deposit token configuration. This function can only be called by the contract owner.

Parameters

Name
Type
Description

newConfig_

DepositTokenConfig

The new configuration for the deposit token.

Structs

DepositTokenConfig

struct DepositTokenConfig {
    address token;
    address gateway;
    address receiver;
    }

Stores configuration data for the deposit token (stETH) and its bridge.

Fields

Name
Type
Description

token

address

The address of the wrapped deposit token on Ethereum (wsETH).

gateway

address

The address of the Arbitrum Gateway Router.

receiver

address

The address where tokens are received on Arbitrum (L2TokenReceiverV2).

RewardTokenConfig

struct RewardTokenConfig {
    address gateway;
    address receiver;
    uint16 receiverChainId;
    address zroPaymentAddress;
    bytes adapterParams;
    }

Stores configuration data for the LayerZero messaging bridge.

Name
Type
Description

gateway

address

The address of the LayerZero Ethereum endpoint.

receiver

address

The address where messages are received on Arbitrum (L2MessageReceiver).

receiverChainId

uint16

The LayerZero endpointId of Arbitrum (110).

zroPaymentAddress

address

The address of the ZRO token holder who would pay for the transaction.

adapterParams

bytes

LayerZero for custom functionality.

🎓
L1Sender.sol
Adapter Parameters