Skip to content
This repository was archived by the owner on Jan 25, 2026. It is now read-only.

Macho Sangria Python - Mint charges unreasonable fee when there is only one asset in vault #665

@sherlock-admin3

Description

@sherlock-admin3

Macho Sangria Python

Medium

Mint charges unreasonable fee when there is only one asset in vault

Summary

When the vault has only one asset, every mint except the first might incur a significant fee, since the newRatio is always 1e27, which is above mintKinkRatio and optimalRatio, which causes high amount of fee.

Root Cause

The issue is at https://github.com/sherlock-audit/2025-07-cap/blob/main/cap-contracts/contracts/vault/libraries/MinterLogic.sol#L94

The _amountOutBeforeFee function in MinterLogic.sol calculates the newRatio of the asset relative to the total value, which is used to determine the fee. During the minting process, a high newRatio is intended to indicate an imbalance in asset composition and results in a higher fee. However, when there is only one asset in the vault, the minter should not be penalized, as they have no option to supply other assets.

Internal Pre-conditions

  1. User is not on the whitelist for the fee exemption.
  2. This is not the first mint.
  3. The feeData has been set with a non-zero slope0 or slope1.

External Pre-conditions

No External Pre-conditions

Attack Path

The high fee occurs during minting when the capToken supply is greater than zero.

Impact

The high fee will make the minter unwilling to deposit tokens in a vault that contains only one asset.

PoC

No response

Mitigation

Add another check to exempt the high fee in cases where the vault has only one asset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions