#42487 [SC-Insight] Redundant Slippage Check in `compound` Function
Was this helpful?
Was this helpful?
Submitted on Mar 24th 2025 at 09:14:50 UTC by @Bluedragon for
Report ID: #42487
Report Type: Smart Contract
Report severity: Insight
Target: https://github.com/immunefi-team/audit-comp-yeet/blob/main/src/contracts/MoneyBrinter.sol
Impacts:
The compound
function in the MoneyBrinter
contract includes a redundant slippage check for islandTokensMinted
. This check is already performed in the Kodiak router during the swap process, making it redundant check and useless gas consumption. Removing this check will simplify the code without affecting functionality and gas optimized.
In the compound
function, the following check is performed:
Issue: This check ensures that the amount of islandTokensMinted
meets the minimum required amount (amountSharesMin
) to prevent slippage. However, this check is redundant because the Kodiak router already performs the same slippage check during the swap process.
Root Cause: The slippage check is duplicated in both the MoneyBrinter
contract and the Kodiak router, leading to unnecessary code complexity.
Code Complexity: The redundant check adds unnecessary code complexity to the compound
function.
Gas Overhead: The redundant check incurs a extra gas consumption.
Review the compound
function in the MoneyBrinter
contract.
Observe the redundant slippage check for islandTokensMinted
.
As you as see the already performs the same slippage check during the swap process.