A potential issue related to the handling of gas limits in the sendMintMessage
function of the L1Sender.sol
contract was found. Currently it utilizes a default gas limit of 200,000, potentially leading to suboptimal gas usage. To address this issue, it is recommended to implement the use of adapterParams
to allow users to set a custom gas limit, providing more flexibility and cost optimization.
The vulnerability lies in the sendMintMessage
function of the L1Sender.sol
, where a default gas limit of 200,000
will be used by default. This fixed gas limit may not be optimal for all transactions, potentially leading to either overpayment for unused gas or insufficient gas for complex transactions. By not allowing users to customize the gas limit, the contract misses an opportunity for gas optimization.
The impact of the current implementation is primarily related to potential suboptimal gas usage. In scenarios where transactions have varying gas requirements, users may incur unnecessary costs or face delays due to inadequate gas limits. The issue does not pose a direct security threat but affects the efficiency and cost-effectiveness of protocol transactions.
Manual review.
Implement adapterParams
for Custom Gas Limit:
Introduce a parameter for adapterParams
in the sendMintMessage
function to allow users to set a custom gas limit.
Ensure proper encoding and decoding of adapterParams
according to the LayerZero documentation.
E.g the code can be changed like this
and from Distribution claim function you can pass the custom settings in adapterParams
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.