The setNewTokenAndReplace function removes a token's data but leaves its index in a mapping, so the token cannot be added again. This prevents re-adding the old token using standard methods.
A typo in the quota calculation loop of D3UserQuote#getUserQuote uses the wrong variable when fetching the exchange rate, leading to an incorrect quota being returned. This can dramatically underestimate the quota, allowing oversized and overly risky positions that could cause loss to the system.
The D3Oracle contract's getPrice and getOriginalPrice functions do not check whether the Arbitrum sequencer is down, so they may return stale prices from Chainlink feeds. An attacker could exploit this to gain an unfair advantage in trades.
The liquidate function does not decrement the totalBorrows state variable for the debt token, so the exchange rate of the corresponding pToken remains artificially high. This causes depositors to receive more interest than they should, and the last withdrawer may be unable to redeem their pTokens due to insufficient underlying tokens.
The liquidation function uses ERC20 transferFrom without checking the return value, so transfers may silently fail. This could let a liquidator receive collateral without paying debt, or pay debt without receiving collateral.
The vault's exchange rate increases when the owner calls withdrawReserves, so an attacker can deposit just before the withdrawal and withdraw just after to profit from the rate change. This lets them steal value from other users.
The getRangeOrderState function in D3Trading incorrectly assigns cumulativeAsk to cumulativeBid for the toToken, causing incorrect accounting state. This can lead to reverts in PMMRangeOrder when the wrongly assigned cumulativeBid exceeds B0.
The finishLiquidation() function in D3VaultLiquidation.sol fails to update the pool's token balance after a liquidation, causing a mismatch between the recorded balance and the actual token balance. This could lead to serious problems, though the specific exploit is not detailed.
The finishLiquidation() function calculates realDebt by dividing before multiplying, causing precision loss due to Solidity's truncation. This leads to incorrect updates of totalBorrows, potentially affecting the protocol's accounting.
The bad debt check in D3VaultFunding incorrectly uses collateral and debt weights, so a pool with a collateral ratio below 1e18 is flagged as having bad debt even when it is still profitable to liquidate. This prevents other participants from liquidating, potentially causing real losses for LPs and market makers.
The protocol's approval logic for USDT is flawed because it does not reset the allowance to zero before setting a new non-zero approval, and a wrong allowance check causes repeated approvals. This could make it impossible to liquidate or borrow USDT.
When a token with few decimals is borrowed, the vault's stored total borrows loses precision compared with the per-borrower records, so the aggregate becomes smaller than the sum of individual debts. The final repayment or liquidation then underflows and is blocked.
A price calculation in the DODO V3 range-order contract divides by a value that can round to zero when a token has few decimals, a high price and a small bid factor. This makes the swap model invalid and causes swaps to revert for that token.
The vault's internal balance was decreased instead of increased when a pool repaid all borrowed funds, creating a mismatch between recorded and actual token balances. An attacker could deposit the difference and withdraw it, stealing double the repaid amount from the vault.
A smart contract function that registers a new token stores the token's decimal value as a maker-supplied input without checking it against the token itself. If a maker enters the wrong decimal, swaps involving that token would transfer more or less than the expected amount.
The withdrawReserves() function does not update the vault balance after transferring reserves out, leading to an incorrect exchange rate calculation. This could impact many funding-related functions.
The price parsing function in DODOv3 fails when a token has more than 18 decimals because it subtracts the token's decimals from 18, causing an underflow. This prevents users from trading such tokens, even though they are standard ERC20 tokens.
The vault's recorded balance of a debt token is not updated when a liquidation transfers that token into the vault. A user who deposits the same token immediately after can receive more dTokens than they should, diluting existing LP holders.
The D3Proxy contract's sellTokens function allows an attacker to specify any user as the payer in the callback data, so the attacker can sell that user's tokens and receive the output tokens themselves. This is possible because the payer address is never checked against the actual seller.
When removing a pool, the vault's startLiquidation function is called directly without setting liquidationTarget, so later the team cannot finish liquidation and balance the vault's borrow recording. This may prevent the pool from being removed successfully.
The MarginTrading contract deposits the entire token balance into Aave when opening a trade, rather than only the funds acquired from the swap. This can unintentionally lock pre-existing funds as margin, increasing potential losses.
The MarginTrading contract's flash loan callback did not verify that the flash loan was initiated by the contract itself, allowing an attacker to initiate a flash loan with MarginTrading as the receiver and use a malicious swap to steal funds or close trades.
The contract used ERC20 transfer and transferFrom without checking their boolean return values, so failed transfers could be treated as successful. Tokens that do not return a boolean, such as USDT, would cause transactions to revert, making them unusable in the protocol.
The DODO RouterProxy's externalSwap function fails to wrap native ETH to WETH when handling trades where the output token is native ETH, causing the balance check to always see zero WETH change. This makes many external swap methods that settle in native ETH uncallable.
The split-swap calculation in `_multiSwap` ignores integer rounding, so the sum of transferred amounts can be less than the total input. This can cause a transaction to revert if a strict minimum return is set, or leave a small amount of tokens stranded for the sender.
The smart contract uses the deprecated transfer() function to send Ether, which forwards a fixed 2300 gas. This can cause transactions to fail if the recipient is a contract that requires more gas, such as a multisig wallet or a proxy.
DV
DODO V3 update
Medium
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.