Skip to content
Business logic Audit finding Beginner

Price Granularity Limited by Payment Token Decimals: Cannot List Tokens Cheaper than 0.000001 USDT

The marketplace requires a per-unit price greater than zero expressed in the payment token's smallest unit, so with a six-decimal token such as USDT the lowest possible listing price is one smallest unit. This prevents sellers from listing very low-value tokens at their true market price.

0xNirix Follow with KupiaSec

Originally disclosed on Code4rena

Submitted by 0xNirix, also found by KupiaSec

https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_Marketplace.sol#L256

The SecondSwap marketplace enforces a minimum price floor based on the payment token’s smallest unit which will commonly be USDT. This creates a limitation where tokens cannot be listed for less than 0.000001 USDT (or equivalent smallest unit of other 6 decimal payment tokens).

Root Cause:

  • pricePerUnit must be greater than 0
  • pricePerUnit represents price in payment token’s smallest units for 1 vesting token.
  • For USDT (6 decimals), minimum pricePerUnit is 1 (0.000001 USDT)
  • Prices lower than this cannot be represented

Impact:

  1. Cannot list very low-value tokens at their true market price
  2. Could prevent legitimate trading of extremely low-value tokens

This limitation will be particularly impactful as memecoins with such low values are fairly common.

bobwong (SecondSwap) acknowledged


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

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 price is stored as an integer count of the payment token's smallest units and must be greater than zero, so no value below one smallest unit can be expressed.

Impact

Sellers cannot list very low-value tokens at their true market price, which could prevent legitimate trading of such tokens, and the text notes this matters because very cheap memecoins are common.

What the attacker needed

Payment token with few decimals, e.g. USDT; token value below one smallest unit

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.

A token price is stored as a whole number of the smallest divisible unit of the payment currency. For a currency split into a million parts, the smallest step is one part, so any price below that single step simply cannot be written down. The result is that extremely cheap tokens have no way to be listed at their real value.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by 0xNirix

View all

10 more disclosed reports, best first.

More from SecondSwap

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.