Platform: Code4rena
Start Date: 29/03/2024
Pot Size: $36,500 USDC
Total HM: 5
Participants: 72
Period: 5 days
Judge: 3docSec
Total Solo HM: 1
Id: 357
League: ETH
Rank: 42/72
Findings: 1
Award: $8.28
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: immeas
Also found by: 0xAkira, 0xCiphky, 0xGreyWolf, 0xJaeger, 0xMosh, 0xabhay, 0xlemon, 0xmystery, 0xweb3boy, Aamir, Abdessamed, Aymen0909, Breeje, DanielArmstrong, DarkTower, Dots, EaglesSecurity, FastChecker, HChang26, Honour, IceBear, JC, K42, Krace, MaslarovK, Omik, OxTenma, SAQ, Shubham, Stormreckson, Tigerfrake, Tychai0s, VAD37, ZanyBonzy, albahaca, arnie, ast3ros, asui, b0g0, bareli, baz1ka, btk, caglankaan, carrotsmuggler, cheatc0d3, dd0x7e8, grearlake, igbinosuneric, jaydhales, kaden, kartik_giri_47538, m4ttm, ni8mare, niser93, nonn_ac, oualidpro, pfapostol, pkqs90, popeye, radev_sw, samuraii77, slvDev, zabihullahazadzoi
8.2807 USDC - $8.28
https://github.com/code-423n4/2024-03-ondo-finance/blob/main/contracts/ousg/ousgInstantManager.sol#L63 https://github.com/code-423n4/2024-03-ondo-finance/blob/main/contracts/ousg/ousgInstantManager.sol#L479-#L485
In ousgInstantManager
contract, MINIMUM_OUSG_PRICE
variable is constant variable:
uint256 public constant MINIMUM_OUSG_PRICE = 105e18;
It is used to check if actual price of ousg is below it or not, if yes, it will revert:
function getOUSGPrice() public view returns (uint256 price) { (price, ) = oracle.getPriceData(); require( price > MINIMUM_OUSG_PRICE, "OUSGInstantManager::getOUSGPrice: Price unexpectedly low" ); }
The problem is variable MINIMUM_OUSG_PRICE
is constant, it can not be changed, so it mean if the price is under 105e18
, function will revert.
To convert ousg token to usdc token, function redeem()
need to be called, and it will call _redeem()
function:
function _redeem(uint256 ousgAmountIn) internal returns (uint256 usdcAmountOut) { require( IERC20Metadata(address(usdc)).decimals() == 6, "OUSGInstantManager::_redeem: USDC decimals must be 6" ); require( IERC20Metadata(address(buidl)).decimals() == 6, "OUSGInstantManager::_redeem: BUIDL decimals must be 6" ); uint256 ousgPrice = getOUSGPrice(); // <--- uint256 usdcAmountToRedeem = _getRedemptionAmount(ousgAmountIn, ousgPrice); . . . . . . }
As there is no guarantee that price of ousg is always bigger than 105e18
, which is about 105$, as showed at here, there is a time that price of ousg token is 96.83$, which is lower than 105$. So when ousg price down, or worse, crash, there is no way for user to withdraw usdc.
User are not able to withdraw usdc when ousg price down below MINIMUM_OUSG_PRICE
Manual review
MINIMUM_OUSG_PRICE
variable should be able to be changed by admin.
Other
#0 - c4-pre-sort
2024-04-04T04:30:41Z
0xRobocop marked the issue as duplicate of #245
#1 - c4-judge
2024-04-09T13:01:21Z
3docSec changed the severity to QA (Quality Assurance)
#2 - c4-judge
2024-04-09T13:01:48Z
3docSec marked the issue as grade-b