Hunt prep
Before you test MANTRA DEX
What 31 disclosed reports say about MANTRA DEX: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing
Not written yet for this program. The numbers below are up to date.
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 26 | 0 | – | – | $0 |
| DoS lesson | 3 | 0 | – | – | $0 |
| Smart contracts lesson | 1 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
Stable swap pools don’t properly handle assets with different decimals, forcing LPs to receive wrong shares
The invariant computation should normalise all deposit amounts to their non-decimal values before summing, as the swap path already does.
Disclosed
-
Slippage tolerance vulnerability in StableSwap
The slippage check should compute the StableSwap invariant before and after the deposit and compare the resulting price impact against the user's tolerance.
Disclosed
-
Wrong simulation function used in reverse operation path
The function should call query_reverse_simulation and use the offer_amount from its response instead of query_simulation and return_amount.
Disclosed
-
Multi-token stableswap pools allow 0 liquidity for tokens, creating bricked pools
The report recommends requiring that when total supply is zero, every token of the pool is provided as liquidity.
Disclosed
-
Amplifiers can’t be ramped allowing loss of funds from the pool
Implement amplifier ramping functionality similar to Curve, with functions to ramp and stop ramping, and safety constraints.
Disclosed
-
Stablepools return wrong price when they do not converge
The code should return an error when the computation does not converge, as suggested in the recommended mitigation.
Disclosed
-
In edge cases, create_pool can either be reverted or allow user underpay fees
The code should be fixed by changing `.any()` to `.all()` and adding logic to handle the pool creation token in the token factory fee iteration.
Disclosed
-
User cannot claim rewards or close_position , due to vulnerable division by zero handling
The division by zero should be handled directly in the reward calculation by skipping the epoch iteration when the contract weight is zero.
Disclosed
-
Protocol allows creating broken tri-crypto CPMM pools
Add an explicit check during pool creation to ensure constant product pools cannot have more than two tokens.
Disclosed
-
User is unable to claim their reward for the expanded epochs if farm is expanded
The farm should only be allowed to expand before the preliminary end epoch minus one, as recommended.
Disclosed
-
Spread calculation does not account for swap fees
The fees should be subtracted from the return amount before calculating the spread amount.
Disclosed
-
query_reverse_simulation doesn’t account for extra fees when simulating stable reversed swaps
The code was fixed to include extra fees in the before_fees calculation.
Disclosed
-
Stableswap does disjoint swaps, breaking the underlying invariant
The invariant calculation should include all token balances in the pool, not just the ask and offer tokens.
Disclosed
-
compute_offer_amount floors the offer_amount when simulating constant product reversed swaps, leading to unexpected results
The offer amount should be rounded up to ensure the user receives the expected amount, though the protocol initially chose to keep rounding down.
Disclosed
-
Attackers can force the rewards to be stuck in the contract with malicious x/tokenfactory denoms
The close_farms function should dispatch refund messages as SubMsg::reply_on_error and ignore errors in the reply handler, so the owner can still close malicious farms.
Disclosed