L1 Sender
L1Sender.sol
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
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
Wraps and sends the deposit token (stETH) to Arbitrum via the Gateway Router. This function can only be called by Distribution
.
Parameters
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
bytes
The ABI-encoded Arbitrum inbox sequence number.
sendMintMessage
Sends a message to mint reward tokens (MOR) on Arbitrum via LayerZero. This function can only be called by Distribution
.
Parameters
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
Initializes the contract with the Distribution
address, reward token configuration, and deposit token configuration.
Parameters
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
Sets the Distribution
address. This function can only be called by the contract owner.
Parameters
distribution_
address
The address of Distribution
to be set.
setRewardTokenConfig
Updates the reward token configuration. This function can only be called by the contract owner.
Parameters
newConfig_
RewardTokenConfig
The new configuration for the reward token.
setDepositTokenConfig
Updates the deposit token configuration. This function can only be called by the contract owner.
Parameters
newConfig_
DepositTokenConfig
The new configuration for the deposit token.
Structs
DepositTokenConfig
Stores configuration data for the deposit token (stETH) and its bridge.
Fields
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
Stores configuration data for the LayerZero messaging bridge.
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
Last updated
Was this helpful?