Precision Loss in getAmountOut
Function Leads to Incorrect Price Calculations
#174
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
edited-by-warden
🤖_primary
AI based primary recommendation
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/periphery/libraries/KatanaV2Library.sol#L46
Vulnerability details
Summary
The
getAmountOut
function inKatanaV2Library.sol
can return zero due to precision loss when there's a large disparity betweenreserveIn
andreserveOut
. While this doesn't directly cause loss of funds, it can lead to incorrect price calculations that affect other protocol functions.PoC
Assessed type
Other
The text was updated successfully, but these errors were encountered: