Skip to content

Code4rena

MANTRA DEX

Every publicly disclosed report for MANTRA DEX and what kind of bugs they were.

disclosed reports
31
most reported class
Business logic
bug classes found
3
first disclosure
2025
Find MANTRA DEX on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what MANTRA DEX chose to make public.

Business logic

Stable swap pools don’t properly handle assets with different decimals, forcing LPs to receive wrong shares

Stable swap pools in Mantra did not normalise token amounts by their decimals when computing the invariant D, so deposits of a high-decimal token produced a much larger D than equivalent deposits of a low-decimal token. An attacker could deposit the high-decimal asset and receive an exaggerated number of LP shares, diluting other liquidity providers.

MANTRA DEX

High
Business logic

Slippage tolerance vulnerability in StableSwap

The slippage tolerance check for StableSwap deposits compared a simple ratio of total pool balances to pool token supply against the deposit ratio, ignoring the StableSwap invariant and amplification factor. This could let deposits through whose real price impact exceeds the user's stated tolerance, causing unexpected losses.

MANTRA DEX

Medium
Business logic

Wrong simulation function used in reverse operation path

The reverse simulation function for multi-hop swaps incorrectly used forward simulation instead of reverse simulation, leading to incorrect price quotes for users trying to determine required input tokens for a desired output amount.

MANTRA DEX

Medium
Business logic

Multi-token stableswap pools allow 0 liquidity for tokens, creating bricked pools

Stableswap pools with more than two tokens did not require every pool token to be supplied during the first liquidity deposit, so a pool could be created with zero liquidity for one token. That left the pool permanently unusable, because later deposits hit a division-by-zero error.

MANTRA DEX

High
Business logic

Amplifiers can’t be ramped allowing loss of funds from the pool

The Mantra DEX stableswap pools have a fixed amplification coefficient (A) that cannot be changed after pool creation, unlike Curve's implementation. This lack of ramping means the pool cannot adapt to changing market conditions, potentially allowing traders to exploit the pool during events like a stablecoin depeg and cause losses to liquidity providers.

MANTRA DEX

Medium
Business logic

Stablepools return wrong price when they do not converge

The StableSwap pool's price calculation using Newton's method may not converge in unbalanced pools, returning a wrong price instead of reverting. An attacker could swap at this incorrect price, potentially profiting at the expense of the pool.

MANTRA DEX

Medium
DoS

User cannot claim rewards or close_position , due to vulnerable division by zero handling

In the farm manager's reward calculation, a user's share is computed by dividing their weight by the contract's total weight for an epoch, but that total can be zero, causing a division-by-zero error. Because pending rewards must be claimed before a position can be closed, affected users cannot claim rewards or close positions without penalty.

MANTRA DEX

High
Business logic

Protocol allows creating broken tri-crypto CPMM pools

The protocol allows creating constant product pools with more than two tokens, even though the swap formula only works for two-token pools. An attacker could arbitrage these broken pools when they become imbalanced.

MANTRA DEX

High
Business logic

User is unable to claim their reward for the expanded epochs if farm is expanded

A user who claims rewards during the preliminary end epoch cannot later claim rewards for that same epoch if the farm owner expands the farm afterwards, because the user's last claimed epoch is set to the preliminary end epoch. This can cause the user to miss rewards for up to two epochs.

MANTRA DEX

Medium
Business logic

Spread calculation does not account for swap fees

The spread calculation in the swap function includes swap fees, making the computed spread larger than the actual slippage. This could allow a swap to pass the slippage tolerance check when it should fail.

MANTRA DEX

Medium
Business logic

Stableswap pool can be skewed free of fees

The stableswap pool implementation does not charge a fee when liquidity is added at a ratio far from the current pool price, unlike Curve's stableswap. An attacker can add single-sided liquidity to skew the pool composition at very low cost, causing high slippage for other users.

MANTRA DEX

High
DoS

Block gas limit can be hit due to loop depth

The claim function in a smart contract farm manager uses three nested loops over a user's positions, farms per liquidity pool, and epochs since the first deposit, giving roughly cubic complexity. A user with many old positions across many farms could exceed the block gas limit, making claim and close_position transactions fail and forcing an emergency withdrawal that loses deposits and rewards.

MANTRA DEX

High
Business logic

Farms can be created to start in past epochs

The farm creation function allowed a start epoch in the past because it only checked that the start epoch was greater than zero and that the end epoch was in the future. An attacker could create a farm retroactively, causing users who had already claimed rewards for past epochs to miss out on additional rewards assigned to those epochs.

MANTRA DEX

High
Business logic

Logical error in validate_fees_are_paid can cause a DoS or allow users to bypass fees if denom_creation_fee includes multiple coins, including pool_creation_fee , and the user attempts to pay all fees using only pool_creation_fee

The fee validation logic in the pool creation function incorrectly handles cases where the pool creation fee and denom creation fee share the same denomination. An attacker could bypass paying one of the fees if the amounts are equal, or cause a denial of service if the amounts differ and they attempt to pay both together.

MANTRA DEX

High
Business logic

Penalty fees can be shared among future farms or expired farms, risks of exploits

When a position is emergency withdrawn, the penalty fee is split equally among all farm owners sharing the same LP denom, including owners of future or expired farms. A malicious farm creator could register a future farm to collect a share of penalty fees without contributing rewards, then close the farm and recover the deposited assets.

MANTRA DEX

Medium
Business logic

When a user single-side deposit into a pool, slippage protection is invalid

When a user makes a single-sided deposit into a pool, the contract performs a swap with belief_price set to None, which disables the intended slippage protection. An attacker could exploit this to cause the user to receive fewer LP tokens than expected due to price movements before the transaction is executed.

MANTRA DEX

Medium
Business logic

Single sided liquidity can’t be used to lock LP tokens in the farm manager

When providing single-sided liquidity with an unlocking duration, the contract calls itself to deposit the swapped amount, causing the receiver check to fail because the sender is the contract address. This prevents users from locking LP tokens in the farm manager in a single action, breaking a core functionality.

MANTRA DEX

Medium
Business logic

Insufficient check on asset decimals input in create_pool allows malicious pool to be created with invalid swap results

The create_pool function allows anyone to create a pool with arbitrary asset decimals, and these incorrect decimals are used in stableswap calculations, leading to invalid swap results. An attacker could create a pool with wrong decimals and potentially sandwich less sophisticated users, as slippage protection may be ineffective.

MANTRA DEX

Medium
Business logic

withdraw_liquidity lacks slippage protection

The withdraw_liquidity function in a Cosmos-based DEX lacks a way for users to specify a minimum acceptable amount of tokens when withdrawing liquidity. This means users could receive fewer tokens than expected due to market changes between transaction submission and execution.

MANTRA DEX

Medium
Business logic

Pool creators can manipulate the slippage calculation for liquidity providers

Pool creators can specify the same token denominations in a different order when creating a pool, which causes the slippage tolerance check to use an inverted ratio. This can lead liquidity providers to accept unfavourable deposit ratios, resulting in a loss of funds.

MANTRA DEX

High
Business logic

Incorrect slippage_tolerance handling in stableswap provide_liquidty function

The stableswap pool's slippage tolerance check only verifies one side of the ratio inequality, so deposits that are imbalanced relative to the pool can pass even with zero tolerance. An attacker or unlucky depositor could receive fewer LP tokens than expected, losing value.

MANTRA DEX

High
Business logic

Emergency unlocking penalty makes long duration positions economically advantageous

The farm-manager contract applies a fixed 2% emergency unlock penalty regardless of how long a position was locked, while longer locks earn much higher reward multipliers. An attacker could lock for the maximum duration to earn boosted rewards, then emergency-unlock cheaply to regain liquidity, undermining the lockup mechanism.

MANTRA DEX

Medium