Skip to content

Commit

Permalink
fix: underflow issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahilgat authored and ali-bahjati committed Sep 4, 2023
1 parent f7699bb commit 7cbdcb5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ contract OracleSwap {

uint8 priceDecimals = uint8(uint32(-1 * price.expo));

if (targetDecimals - priceDecimals >= 0) {
if (targetDecimals >= priceDecimals) {
return
uint(uint64(price.price)) *
10 ** uint32(targetDecimals - priceDecimals);
Expand Down

0 comments on commit 7cbdcb5

Please sign in to comment.