Skip to content

Commit

Permalink
fix: value checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Vid201 committed Oct 23, 2024
1 parent 0043438 commit 2c7a8ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/market/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ impl Market for Contract {

// Only allow purchases if reserves are negative or if the reserves are less than the target reserves
require(
reserves < I256::zero() || reserves < I256::try_from(storage.market_configuration.read().target_reserves)
reserves < I256::try_from(storage.market_configuration.read().target_reserves)
.unwrap(),
Error::NotForSale,
);
Expand Down Expand Up @@ -1394,7 +1394,7 @@ fn get_price_internal(price_feed_id: PriceFeedId, price_position: PricePosition)
);
}

require(price.price > 0, Error::OraclePriceValidationError);
require(price.price != 0, Error::OraclePriceValidationError);

require(
u256::from(price.confidence) <= (u256::from(price.price) * ORACLE_MAX_CONF_WIDTH / ORACLE_CONF_BASIS_POINTS),
Expand Down

0 comments on commit 2c7a8ad

Please sign in to comment.