Skip to content

Commit

Permalink
#359: Charisma lowers minimum bid price in market
Browse files Browse the repository at this point in the history
  • Loading branch information
loothero committed Jun 3, 2023
1 parent d94e7bf commit bb9a228
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions contracts/loot/loot/LootMarketArcade.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ from starkware.starknet.common.syscalls import (
)

from contracts.loot.loot.stats.item import ItemStats
from contracts.loot.utils.constants import ModuleIds, ExternalContractIds, STARTING_GOLD
from contracts.loot.utils.constants import (
ModuleIds,
ExternalContractIds,
STARTING_GOLD,
MINIMUM_MARKET_FLOOR_PRICE,
)
from contracts.loot.adventurer.interface import IAdventurer
from openzeppelin.token.erc721.IERC721 import IERC721
from contracts.loot.adventurer.library import AdventurerLib
Expand Down Expand Up @@ -1078,9 +1083,8 @@ func bid_on_item{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr
let item_rank = item.Rank;
let base_price = BASE_PRICE * (6 - item_rank);


// assert bid is higher than required minimum (3 at the time of this writing)
let higer_than_base_price = is_le(base_price, original_bid);
let higer_than_base_price = is_le(MINIMUM_MARKET_FLOOR_PRICE, original_bid);
with_attr error_message("Item Market: Bid is lower than minimum") {
assert higer_than_base_price = TRUE;
}
Expand Down
1 change: 1 addition & 0 deletions contracts/loot/utils/constants.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const SECOND_PLACE_REWARD = 3000000000000000000;
const THIRD_PLACE_REWARD = 2000000000000000000;

const STARTING_GOLD = 20;
const MINIMUM_MARKET_FLOOR_PRICE = 3;

const VITALITY_HEALTH_BOOST = 20;
const SUFFIX_STAT_BOOST = 3;
Expand Down

0 comments on commit bb9a228

Please sign in to comment.