System underpays cashback on BNB: hardcoded “USDC = 6 decimals” causes 1e12× underpayment when USDC is 18-dec
The cashback contract assumes USDC has 6 decimals and divides amounts by 1e12, but on BNB Chain the configured USDC has 18 decimals, so every cashback claim is underpaid by a factor of 1e12. No attacker is needed; the protocol deterministically miscalculates payouts.
0x11singh99 Follow with 0xCrypt0nite, 4Nescient and 24 others
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-09-super-dca-judging/issues/1045
Found by
0x11singh99, 0xCrypt0nite, 4Nescient, Aamirusmani1552, Al-Qa-qa, AlexCzm, AuditorPraise, BADROBINX, BengalCatBalu, Boy2000, Kirkeelee, PASCAL, Pro_King, SMB62, Sa1ntRobi, SarveshLimaye, VCeb, Xmanuel, ZeroEx, bXiv, dani3l526, heavyw8t, jayjoshix, kangaroo, lucky-gru, rsam_eth, tobi0x18
Summary
Root cause: Cashback math assumes USDC has 6 decimals and converts from 1e18 precision by dividing / 1e12. Impact: On BNB Chain, where the widely used USDC is 18-dec, every cashback claim is scaled down by 1e12 (orders-of-magnitude underpayment). Affected party: All users claiming cashback on chains where USDC ≠ 6 decimals (notably BNB). Attack path: No attacker required; the protocol miscalculates payouts deterministically upon claim.
Root Cause
In SuperDCACashback.sol, amounts computed in 1e18 precision are converted to “USDC precision” via a fixed divider:
function _convertToUSDCPrecision(uint256 amount) internal pure returns (uint256) {
return amount / 1e12; // assumes USDC has 6 decimals
}
Comments and storage semantics also bake in “USDC (6 decimals)”. This breaks on chains where the configured USDC token uses 18 decimals (e.g., BNB), producing amounts 1e12× too small.
Internal Pre-conditions
- Cashback math internally uses 1e18 precision for rates/amounts.
- The contract calls
_convertToUSDCPrecision(amount)which divides by 1e12 unconditionally. - USDC token address is set to a token whose decimals() can differ from 6.
External Pre-conditions
- Deployment targets a chain where the configured USDC has 18 decimals (BNB’s common USDC).
- Users run trades and later claim cashback.
Attack Path
- A user completes eligible epochs and calls
claim…()on BNB. - The contract computes the correct 1e18-scaled amount (say,
1e18for “1 token”). - It divides by
1e12, yielding1e6base units. - Because
the token has 18 decimals, 1e6 base units = 1e-12 tokens, not 1 token → the user is underpaid by 1e12×.
Impact
High: Users on BNB receive 1e12× less cashback than owed (direct, systemic loss of user funds). This is chain-wide and persists until fixed.
Concrete Example (BNB)
- Internal calculation says the user earned 1e18 “USDC units” (meant to represent 1 full token).
_convertToUSDCPrecisionreturns1e18 / 1e12 = 1e6.- On an 18-dec token,
1e6base units = 0.000000000001 tokens, not1.0. - Underpayment factor: 1,000,000,000,000×.
PoC
No response
Mitigation
Make conversion token-decimal-aware and remove the 6-dec assumption:
import {IERC20Metadata} from "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {Math} from "openzeppelin-contracts/contracts/utils/math/Math.sol";
IERC20 public USDC;
uint8 public immutable usdcDecimals;
constructor(address _usdc, /*...*/) {
USDC = IERC20(_usdc);
usdcDecimals = IERC20Metadata(_usdc).decimals();
// ...
}
// Convert from 1e18 internal precision to token decimals exactly
function _toTokenDecimals(uint256 amt1e18) internal view returns (uint256) {
return Math.mulDiv(amt1e18, 10 ** usdcDecimals, 1e18);
}
Replace all calls to _convertToUSDCPrecision with _toTokenDecimals. Update comments/storage semantics to refer to “token decimals”, not “USDC(6)”.
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/Super-DCA-Tech/super-dca-cashback/pull/26
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
The conversion function unconditionally divides by 1e12, hardcoding the assumption that USDC has 6 decimals instead of reading the token's actual decimals.
Impact
Users on BNB receive 1e12 times less cashback than owed, a systemic loss of user funds that persists until fixed.
What the attacker needed
Deployment on a chain where USDC has 18 decimals; user completes eligible epochs and claims cashback
The fix
The protocol team fixed this issue by making the conversion token-decimal-aware and removing the 6-decimal assumption.
How it was found
- A user completes eligible epochs and calls the claim function on BNB.
- The contract computes the correct 1e18-scaled cashback amount.
- It divides by 1e12, yielding a much smaller number of base units.
- Because the token has 18 decimals, those base units represent a far smaller token amount, so the user is underpaid.
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's 'decimals' setting says how many decimal places its smallest unit has. The contract assumed the USDC token always uses 6 decimals, but on BNB Chain the USDC token uses 18, so the conversion divided by the wrong factor and paid out a tiny fraction of what was owed.
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.