Skip to content

Commit

Permalink
Code423n4 #87, correct maxSumOfPrices calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Splidge committed Jun 21, 2021
1 parent a43e7f1 commit 10dfc77
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contracts/RCMarket.sol
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,12 @@ contract RCMarket is Initializable, NativeMetaTransaction, IRCMarket {
// check that not being front run
uint256 _actualSumOfPrices;
for (uint256 i = 0; i < numberOfCards; i++) {
_actualSumOfPrices = _actualSumOfPrices + (cardPrice[i]);
if (cardPrice[i] == 0){
_actualSumOfPrices += MIN_RENTAL_VALUE;
} else {
_actualSumOfPrices += (cardPrice[i] *
(minimumPriceIncreasePercent + 100)) / 100;
}
}
require(_actualSumOfPrices <= _maxSumOfPrices, "Prices too high");

Expand Down

0 comments on commit 10dfc77

Please sign in to comment.