DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: low
Invalid

`claimLoop` Function Could Improve Efficiency

Description

Currently, the claimAndSwap function processes a single claim amount from the transmuter each time it is called. If there is a large claimable balance, processing it in small amounts could be inefficient.

function claimAndSwap(
uint256 _amountClaim,
uint256 _minOut,
IVeloRouter.route[] calldata _path
) external onlyKeepers {
transmuter.claim(_amountClaim, address(this));
// ...
}

Impact

  • Inefficiency: Claiming and swapping in small increments may result in increased transaction costs and processing time.

  • Missed Opportunities: Delays in processing the entire claimable balance could result in missed opportunities, especially during favorable market conditions.

Recommendation

  • Implement Batch Claiming: Introduce a function that allows claiming and swapping the entire claimable balance or in larger batches.

    function claimAllAndSwap(
    uint256 _minOut,
    IVeloRouter.route[] calldata _path
    ) external onlyKeepers {
    uint256 totalClaimable = transmuter.getClaimableBalance(address(this));
    require(totalClaimable > 0, "No claimable balance");
    transmuter.claim(totalClaimable, address(this));
    // Proceed with swapping and depositing as in claimAndSwap
    }
Updates

Appeal created

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.