Hunt prep
Before you test USSD - Autonomous Secure Dollar
What 22 disclosed reports say about USSD - Autonomous Secure Dollar: 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 | 8 | 0 | – | – | $0 |
| DoS lesson | 2 | 0 | – | – | $0 |
| Smart contracts lesson | 2 | 0 | – | – | $0 |
| Access control lesson | 1 | 0 | – | – | $0 |
| Race condition 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.
-
`StableOracleDAI` calculates `getPriceUSD` with inverted base/rate tokens for Chainlink price
The Chainlink price should be inverted before averaging so both sources use the same base/quote orientation.
Disclosed
-
Wrong computation of the amountToSellUnit variable
The extra 1e18 factor should be removed from the formula so the units cancel correctly.
Disclosed
-
The price from `StableOracleDAI` is returned with the incorrect number of decimals
Remove the `* 1e10` from the return statement.
Disclosed
-
Uniswap v3 pool token balance proportion does not necessarily correspond to the price, and it is easy to manipulate
Instead of using the pool balances to calculate the delta amount required to restore the peg, a more complex formula that considers the liquidity range should be used.
Disclosed
-
Wrong Oracle feed addresses
The addresses should be corrected to point to the proper oracle feeds.
Disclosed
-
rebalance process incase of selling the collateral, could revert because of underflow calculation
The code should check if the received amount exceeds the remaining amount and set it to zero in that case, otherwise subtract.
Disclosed
-
Inaccurate collateral factor calculation due to missing collateral asset
The collateralFactor calculation should be updated to include the value of removed collateral assets, or the removal process should ensure that such assets are properly accounted for.
Disclosed
-
Using the collateral assets' oracle price at 100% of its value to mint USSD without a fee can be used for arbitrage
The protocol should be fixed by adding a minting fee of 0.5% to 1%, which should be higher than the oracle deviation threshold.
Disclosed
-
`BuyUSSDSellCollateral()` always sells 0 amount if need to sell part of collateral
The formula for amountToSellUnits should be refactored to correctly compute the amount of collateral to sell based on its decimals and price.
Disclosed
-
Lack of access control for `mintRebalancer()` and `burnRebalancer()`
The mint function should be restricted to the rebalancer contract, and the burn function should be similarly guarded.
Disclosed
-
Inconsistency handling of DAI as collateral in the BuyUSSDSellCollateral function
The code should be fixed to handle DAI as collateral in the else branch by checking if a sell path exists, similar to the if branch.
Disclosed
-
Oracle price should be denominated in DAI instead of USD
The oracle price unit should be changed from USD to DAI, or the peg target should be changed from DAI to USD.
Disclosed
-
If collateral factor is high enough, flutter ends up being out of bounds
The code should check that flutter is less than flutterRatios.length before using it to index the ratios array.
Disclosed
-
Price calculation susceptible to flashloan exploits
The contract should use a TWAP price instead of the slot0 price.
Disclosed
-
Because of missing slippage parameter, mintForToken() can be front-runned
The function should be fixed by adding a minAmountOut parameter to let users specify the minimum acceptable USSD output.
Disclosed