Closed sherlock-admin2 closed 9 months ago
1 comment(s) were left on this issue during the judging contest.
auditsea commented:
The issue describes about DOSing setPool function by manipulating the Curve pool, but it's assumed that the Curve pool deployment, LP deposit, and setPool will be handled in one tx using multicall structure
1 comment(s) were left on this issue during the judging contest.
auditsea commented:
The issue describes about DOSing setPool function by manipulating the Curve pool, but it's assumed that the Curve pool deployment, LP deposit, and setPool will be handled in one tx using multicall structure
nmirchev8
medium
Curve pool may not be set as oracle, because it perfect 1:1 ratio of uAD, which is hardly possible and anyone can break it depositing/swapping 1 wei
Summary
Protocol sets curve uAD/3CRV metapool as an oracle pool. There is function
LibTWAPOracle::setPool
, which set the pool for ubiquity pool, but there is one validation, which is hardly achievablerequire(_reserve0 != 0 && _reserve1 != 0, "TWAPOracle: NO_RESERVES");
Vulnerability Detail
Curve metapools are pools between 3pool (DAI, USDC, USDT) and another stablecoin pair. The pool liquidity aims to be balanced between the pair, but it is almost impossible to have exact 1:1 allocation of funds in metapool. Here is an example for quite stable pool
USD Metapool: Liquity
:For each stable metapool that you check, there won't be 1:1 ratio between two assets, which means that following the current implementation, code cannot be deployed. Tests are working, because mocked metapool doesn't really act as a real one.
Coded PoC:
Impact
LibTWAPOracle
Code Snippet
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibTWAPOracle.sol#L51
Tool used
Manual Review
Recommendation
Duplicate of #14