The _getQuoteAmount function will judge whether the fee of PairOverride is 0, if it is 0, take $defaultFee as po.fee. The problem now is that if for a certain PairOverride, the owner wants to set his fee to 0, but it will be set to $defaultFee unexpectedly by _getQuoteAmount.
Impact
It may lead to get an unexpected uniswapV3 pool, which will eventually affect the price
J4de
medium
UniV3OracleImpl.sol#_getQuoteAmount
Ifpo.fee
is 0, there may be unexpected feesSummary
UniV3OracleImpl.sol#_getQuoteAmount
Ifpo.fee
is 0, there may be unexpected feesVulnerability Detail
UniV3OracleImpl.sol
's owner can callsetDefaultFee
function to set$defaultFee
.The
_getQuoteAmount
function will judge whether the fee of PairOverride is0
, if it is0
, take$defaultFee
aspo.fee
. The problem now is that if for a certain PairOverride, the owner wants to set his fee to0
, but it will be set to$defaultFee
unexpectedly by_getQuoteAmount
.Impact
It may lead to get an unexpected uniswapV3 pool, which will eventually affect the price
Code Snippet
https://github.com/0xSplits/splits-oracle/blob/f6628a116d8721289dad2c70d3e3aa14e4815d4e/src/UniV3OracleImpl.sol#L262-L264
Tool used
Manual Review
Recommendation
It is recommended to consider the case where the fee is 0