Closed sherlock-admin2 closed 8 months ago
qmdddd
medium
getDollarPriceUsd
The function getDollarPriceUsd may return expired dollar price.
The function getDollarPriceUsd gets the dollar price using LibTWAPOracle.getTwapPrice(). However, it may be an expired price, which misleads users.
LibTWAPOracle.getTwapPrice()
Expired price will be returned.
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L300-L311
Manual Review
Add LibTWAPOracle.update(); before getting price.
LibTWAPOracle.update();
1 comment(s) were left on this issue during the judging contest.
auditsea commented:
REF #034
Invalid, prices are always updated before getDollarPriceUsd() is invoked, as seen here and here
getDollarPriceUsd()
qmdddd
medium
The function
getDollarPriceUsd
may return expired dollar price.Summary
The function
getDollarPriceUsd
may return expired dollar price.Vulnerability Detail
The function
getDollarPriceUsd
gets the dollar price usingLibTWAPOracle.getTwapPrice()
. However, it may be an expired price, which misleads users.Impact
Expired price will be returned.
Code Snippet
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L300-L311
Tool used
Manual Review
Recommendation
Add
LibTWAPOracle.update();
before getting price.