# The price from `StableOracleDAI` is returned with the incorrect number of decimals

StableOracleDAI mis-scales the Chainlink DAI/ETH feed (18 decimals) by 1e10, returning 28-decimal price and letting users mint 1e10x more USSD than intended.

- Payout: Contest reward
- Severity: high
- Program: USSD
- Credited: 0xStalin
- Disclosed: 2023-05-15
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-05-USSD-judging/issues/236
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-05-USSD%3AH-4
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:oracle-manipulation

**Target:** StableOracleDAI.getPriceUSD price oracle
**Root cause:** Code assumes Chainlink DAI/ETH feed has 8 decimals and multiplies by 1e10, but that feed actually returns 18 decimals, inflating the returned price to 28 decimals.
**Steps:**
1. Read StableOracleDAI.getPriceUSD: return (wethPriceUSD * 1e18) / ((DAIWethPrice + uint256(price) * 1e10) / 2).
2. Check Chainlink DAI/ETH feed decimals on docs.chain.link: it is 18, not 8.
3. Observe the `* 1e10` scaling produces a 28-decimal result instead of 18.
4. Call USSD.mintForToken with DAI; the inflated price yields ~1e10x more USSD minted than intended.
**How found:** Manual review of the oracle's decimal assumptions; compared the code's assumed 8-decimal Chainlink feed against the documented 18 decimals for the DAI/ETH feed.
**Exploitation:** Any user calls USSD.mintForToken supplying DAI; the over-scaled oracle price causes the contract to mint roughly 1e10 times more USSD than the DAI is worth, breaking the $1 peg (pegged to $0.0000000001).
**Insight:** Verify each Chainlink feed's actual decimals on docs.chain.link rather than assuming 8; mixed-decimal feeds in one formula are a common source of scaling bugs.
