Hunt prep
Before you test DODO V3 update
What 29 disclosed reports say about DODO V3 update: 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 | 18 | 0 | – | – | $0 |
| Access control lesson | 2 | 0 | – | – | $0 |
| DoS lesson | 2 | 0 | – | – | $0 |
| Smart contracts lesson | 2 | 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.
-
Inability to Re-add `oldToken` After Execution of `D3MakerFreeSlot.setNewTokenAndReplace()`
The setNewTokenAndReplace function should be modified to remove the old token from the tokenIndexMap.
Disclosed
-
When a D3MM pool repays all of the borrowed funds to vault using `D3Funding.sol repayAll`, an attacker can steal double the amount of those funds from vault
The code was fixed by changing the subtraction to an addition when updating the vault's recorded balance.
Disclosed
-
liquidationTarget is not set when removing pool
The fix should calculate liquidationTarget in removeD3Pool() and call finishLiquidation() before finishPoolRemove(); also, when balance exceeds debt, transfer realDebt instead of debt.
Disclosed
-
D3Oracle.getPrice() and D3Oracle.getOriginalPrice() doesn't check If Arbitrum sequencer is down for Chainlink feeds
Should be fixed by adding a check for the Chainlink L2 sequencer uptime feed before using price data.
Disclosed
-
Calls to liquidate don't write down totalBorrows which breaks exchange rate
The liquidate method should decrement totalBorrows by the debtToCover amount.
Disclosed
-
Possible loss of Funds
Use safeTransferFrom as in other functions of the same contract.
Disclosed
-
User can perform sandwich attack on withdrawReserves for profit
The exchange rate calculation should be changed so that increasing reserves does not increase the rate, for example by adjusting the balance accounting when reserves accrue.
Disclosed
-
Wrong assignment of `cumulativeBid` for RangeOrder state in getRangeOrderState function
The error should be fixed by assigning cumulativeBid instead of cumulativeAsk.
Disclosed
-
traceurl - miss updating pool's token balance after finishLiquidation()
The fix is to call updateReserveByVault after the pool transfers tokens to the vault.
Disclosed
-
possible precision loss in D3VaultLiquidation.finishLiquidation() function when calculating realDebt because of division before multiplication
The code should be fixed by multiplying before dividing to avoid precision loss.
Disclosed
-
D3VaultFunding#checkBadDebtAfterAccrue is inaccurate and can lead to further damage to both LP's and MM
The bad debt check should be changed to exclude collateral and debt weights so it accurately reflects bad debt.
Disclosed
-
Protocol is completely incompatible with USDT due to lack of 0 approval
The recommendation is to use the OZ safeERC20 library and safeApprove, and the discussion indicates the allowance check should be corrected.
Disclosed
-
borrow amount recorded in AssetInfo and BorrowRecord unmatched due to the precision loss
The recommendation is to check whether the aggregate totalBorrows is smaller than the debt and, if so, set it to zero before subtracting.
Disclosed
-
Calculation B0 meets devision 0 error when a token has small decimal and high price with a small kBid
The formula should handle this corner case, for example by avoiding a zero divisor, and calculations should use consistent 18-decimal precision; a fix pull request is linked.
Disclosed
-
D3UserQuote#getUserQuote queries incorrect token for exchangeRate leading to inaccurate quota calculations
The variable should be changed from token to _token in the getExchangeRate call.
Disclosed