Skip to content
Smart contracts Audit finding Beginner

Redundant Slippage Check in compound Function

The compound function in the MoneyBrinter contract contains a slippage check on islandTokensMinted that duplicates a check already performed by the Kodiak router. This redundancy adds unnecessary code complexity and gas overhead, but does not create a security vulnerability.

Bluedragon Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#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

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:

Solidity
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:

  1. Code Complexity: The redundant check adds unnecessary code complexity to the compound function.
  2. Gas Overhead: The redundant check incurs a extra gas consumption.

Proof of Concept

Proof of Concept:

  1. Review the compound function in the MoneyBrinter contract.
  2. Observe the redundant slippage check for islandTokensMinted.
  3. As you as see the Kodiak router._addLiquidity already performs the same slippage check during the swap process.

The original report as published on Immunefi, by Bluedragon. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the developer added a slippage check without realising the external router already enforces the same condition.

Impact

The redundant check adds unnecessary code complexity and extra gas consumption, but does not create a security vulnerability.

What the attacker needed

None

The fix

The redundant slippage check should be removed to simplify the code and save gas.

How it was found

  1. Review the compound function in the MoneyBrinter contract.
  2. Observe the redundant slippage check for islandTokensMinted.
  3. Check the Kodiak router's _addLiquidity function, which already performs the same slippage check.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This report points out that a smart contract function repeats a safety check that another part of the system already does. The repeated check wastes a little gas and makes the code longer, but it does not let an attacker do anything harmful. It is more of a code quality note than a security bug.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by Bluedragon

View all

11 more disclosed reports, best first.

More from Yeet

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.