The L1Sender
contract enables cross-chain communication by sending a message from Layer 1 to Layer 2 using the LayerZero
protocol. However, the contract does not estimate the required gas fees for this operation, potentially resulting in users providing insufficient funds to cover gas fees. This can cause the transaction to fail, leading to a loss of tokens with an unsuccessful message delivery.
The contract allows users to specify an arbitrary amount of tokens to cover the gas fees for the cross-chain message delivery. However, without a prior estimation of the required fees (using LayerZero's estimateFees()
function), users are at risk of underfunding the transaction. Enough gas is required to ensure the message delivery on the destination chain. If the provided msg.value is insufficient, the message fails to be delivered, but the tokens may still be deducted from the user's balance, effectively burning the user's tokens.
View the layer zero docs for more details.
Users may experience direct financial loss due to token burn or loss in transactions intended for cross-chain operations. This issue undermines user trust in the contract's reliability for cross-chain functionality and poses a risk of token loss.
Manual review.
Integrate LayerZero's estimateFees()
function to estimate the required gas fees for cross-chain message delivery. This can be used to inform users of the minimum msg.value needed or to automatically include the estimated fees in the transaction.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.