H-1: Layer Zero dust removal causes fee harvesting DOS
Summary:
The Layer Zero dust removal mechanism can cause slippage checks to revert, resulting in DOS of cross-chain fee harvesting.
Description:
Layer Zero's send() function allows the sender to specify amountLD and minAmountLD. If minAmountLD exceeds amountLD, the transaction reverts to protect users from unexpected fees.
When transferring cross-chain, Layer Zero converts amounts from 18 decimals to 6 decimals and removes dust from the transfer in the _removeDust() function. It ensures the rounded-down amount is still greater than minAmountLD, reverting otherwise.
In collectFees(), both amountLD and minAmountLD are set to the token balance available after calling _convertAndRedeemFees().
In buy(), both values are set to the paymentAmount determined by the dutch auction.
In both cases, the contract determines the value rather than the caller. For 18-decimal tokens, the amount may have values beyond 6 decimals. Layer Zero's dust removal will reduce amountLD, causing it to no longer be greater than minAmountLD, resulting in a revert.
This makes fee harvesting difficult to execute, as it will often revert when the rounded values don't align or if an attacker sends dust to trigger reverts. This causes temporary DOS of fee harvesting and cross-chain transfers.
Impact:
Medium. Fee harvesting and cross-chain transfers can be DOS.
Recommendation:
In buy(), remove dust from paymentAmount before transferring from the caller.
In collectFees(), remove dust from the balance before passing it to Layer Zero and leave the dust in the contract for future calls.