#42487 [SC-Insight] Redundant Slippage Check in `compound` Function
Submitted on Mar 24th 2025 at 09:14:50 UTC by @Bluedragon for Audit Comp | Yeet
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:
Description
Summary:
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.
Vulnerability Details:
In the compound
function, the following check is performed:
require(islandTokensMinted >= stakingParams.amountSharesMin, "MoneyBrinter: not enough island tokens minted");
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.
Impact:
Code Complexity: The redundant check adds unnecessary code complexity to the
compound
function.Gas Overhead: The redundant check incurs a extra gas consumption.
Proof of Concept
Proof of Concept:
Review the
compound
function in theMoneyBrinter
contract.Observe the redundant slippage check for
islandTokensMinted
.As you as see the Kodiak router._addLiquidity already performs the same slippage check during the swap process.
Was this helpful?