USDV and VADER rate can be wrong
The TWAP oracle's rate calculation can return zero when one internal price is smaller than another, leading to an incorrect rate. An attacker could potentially exploit this to manipulate the reported rate.
Submitted by xYrYuYx
Impact
https://github.com/code-423n4/2021-11-vader/blob/main/contracts/twap/TwapOracle.sol#L166
tUSDInUSDV can be smaller than tUSDInVader, and then getRate will return 0. This will lead wrong rate calculation.
Tools Used
Manually
Recommended Mitigation Steps
Multiple enough decimals before division
The TWAP oracle module has been completely removed and redesigned from scratch as LBTwap that is subject of the new audit.
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
Likely integer division truncation causes the rate to become zero when the numerator is smaller than the denominator.
Impact
The rate calculation can be wrong, potentially allowing an attacker to exploit the incorrect rate.
What the attacker needed
None
The fix
The issue was fixed by removing and redesigning the TWAP oracle module.
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.
This report is about a smart contract that calculates an exchange rate between two tokens. The calculation can produce zero because of how numbers are divided, which makes the rate wrong. Someone could use this wrong rate to their advantage.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.