diff --git a/contracts/game/src/game/constants.cairo b/contracts/game/src/game/constants.cairo index 1f5fd5e31..6ed1d2eaa 100644 --- a/contracts/game/src/game/constants.cairo +++ b/contracts/game/src/game/constants.cairo @@ -29,7 +29,7 @@ mod messages { // TODO: Update for mainnet const BLOCKS_IN_A_WEEK: u64 = 1000; -const COST_TO_PLAY: u8 = 25; +const COST_TO_PLAY: u256 = 25000000000000000000; const NUM_STARTING_STATS: u8 = 9; const STARTING_GAME_ENTROPY_ROTATION_INTERVAL: u8 = 6; const MINIMUM_DAMAGE_FROM_BEASTS: u8 = 2; @@ -50,25 +50,25 @@ struct Week { mod REWARD_DISTRIBUTIONS_PHASE1 { const DAO: u256 = 0; const INTERFACE: u256 = 0; - const FIRST_PLACE: u256 = 12; - const SECOND_PLACE: u256 = 8; - const THIRD_PLACE: u256 = 5; + const FIRST_PLACE: u256 = 12000000000000000000; + const SECOND_PLACE: u256 = 8000000000000000000; + const THIRD_PLACE: u256 = 5000000000000000000; } mod REWARD_DISTRIBUTIONS_PHASE2 { - const DAO: u256 = 5; + const DAO: u256 = 5000000000000000000; const INTERFACE: u256 = 0; - const FIRST_PLACE: u256 = 10; - const SECOND_PLACE: u256 = 6; - const THIRD_PLACE: u256 = 4; + const FIRST_PLACE: u256 = 10000000000000000000; + const SECOND_PLACE: u256 = 6000000000000000000; + const THIRD_PLACE: u256 = 4000000000000000000; } mod REWARD_DISTRIBUTIONS_PHASE3 { - const DAO: u256 = 5; - const INTERFACE: u256 = 4; - const FIRST_PLACE: u256 = 9; - const SECOND_PLACE: u256 = 4; - const THIRD_PLACE: u256 = 3; + const DAO: u256 = 5000000000000000000; + const INTERFACE: u256 = 4000000000000000000; + const FIRST_PLACE: u256 = 9000000000000000000; + const SECOND_PLACE: u256 = 4000000000000000000; + const THIRD_PLACE: u256 = 3000000000000000000; } const STARTER_BEAST_ATTACK_DAMAGE: u16 = 10; diff --git a/contracts/game/src/lib.cairo b/contracts/game/src/lib.cairo index 1cb16758d..42506e45f 100644 --- a/contracts/game/src/lib.cairo +++ b/contracts/game/src/lib.cairo @@ -1139,10 +1139,6 @@ mod Game { } } - fn _to_ether(amount: u256) -> u256 { - amount * 10 ^ 18 - } - fn _process_payment_and_distribute_rewards( ref self: ContractState, client_address: ContractAddress ) { @@ -1165,7 +1161,7 @@ mod Game { // without this, there would be an incentive to start and die immediately after contract is deployed // to capture the rewards from the launch hype IERC20CamelDispatcher { contract_address: lords } - .transferFrom(caller, dao_address, _to_ether(COST_TO_PLAY.into())); + .transferFrom(caller, dao_address, COST_TO_PLAY.into()); __event_RewardDistribution( ref self, @@ -1222,26 +1218,26 @@ mod Game { // DAO if (week.DAO != 0) { IERC20CamelDispatcher { contract_address: lords } - .transferFrom(caller, dao_address, _to_ether(week.DAO)); + .transferFrom(caller, dao_address, week.DAO); } // interface if (week.INTERFACE != 0) { IERC20CamelDispatcher { contract_address: lords } - .transferFrom(caller, client_address, _to_ether(week.INTERFACE)); + .transferFrom(caller, client_address, week.INTERFACE); } // first place IERC20CamelDispatcher { contract_address: lords } - .transferFrom(caller, first_place_address, _to_ether(week.FIRST_PLACE)); + .transferFrom(caller, first_place_address, week.FIRST_PLACE); // second place IERC20CamelDispatcher { contract_address: lords } - .transferFrom(caller, second_place_address, _to_ether(week.SECOND_PLACE)); + .transferFrom(caller, second_place_address, week.SECOND_PLACE); // third place IERC20CamelDispatcher { contract_address: lords } - .transferFrom(caller, third_place_address, _to_ether(week.THIRD_PLACE)); + .transferFrom(caller, third_place_address, week.THIRD_PLACE); __event_RewardDistribution( ref self, diff --git a/contracts/game/src/tests/test_game.cairo b/contracts/game/src/tests/test_game.cairo index 8fa5c40e6..3f8516224 100644 --- a/contracts/game/src/tests/test_game.cairo +++ b/contracts/game/src/tests/test_game.cairo @@ -52,8 +52,8 @@ mod tests { const ADVENTURER_ID: felt252 = 1; - const MAX_LORDS: u256 = 500000000000000000000; - const APPROVE: u256 = 50000000000000000000; + const MAX_LORDS: u256 = 1000000000000000000000; + const APPROVE: u256 = 100000000000000000000; const NAME: felt252 = 111; const SYMBOL: felt252 = 222;