Closed c4-submissions closed 1 year ago
raymondfam marked the issue as sufficient quality report
raymondfam marked the issue as duplicate of #75
MiloTruck marked the issue as not a duplicate
MiloTruck marked the issue as duplicate of #226
MiloTruck marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/open-dollar/od-contracts/blob/v1.5.5-audit/src/contracts/oracles/UniV3Relayer.sol#L74 https://github.com/open-dollar/od-contracts/blob/v1.5.5-audit/src/contracts/oracles/CamelotRelayer.sol#L68
Vulnerability details
Impact
There are tradeoffs when choosing the length of the period of time to calculate a TWAP. Longer periods are better to protect against price manipulation, but come at the expense of a slower, and potentially less accurate, price.
Proof of Concept
Both the
UniV3Relayer.sol
andCamelotRelayer.sol
contract havegetResultWithValidity()
function that uses TWAP Mechanism that can lead to loss of funds during unfavourable conditions.Tools Used
Manual Review
Recommended Mitigation Steps
Implement a proper TWAP that provides the average value of a security over a specified time. The time period/windows of the TWAP must be explicitly defined (e.g. 15 minutes, 1 hour, 24 hours) in the contract.
Assessed type
Oracle