From 203ebd3e97f3c9a332108c1fb90521558fb96d4d Mon Sep 17 00:00:00 2001 From: Mitja Belak Date: Sat, 26 Oct 2024 13:14:43 +0200 Subject: [PATCH] Removed RAID_WAIT because it was just getting in way of UX --- src/RaidGeld.sol | 2 -- test/RaidGeld.t.sol | 8 +------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/RaidGeld.sol b/src/RaidGeld.sol index 52c96a4..f9f707f 100644 --- a/src/RaidGeld.sol +++ b/src/RaidGeld.sol @@ -11,7 +11,6 @@ contract RaidGeld is ERC20, Ownable { uint256 public constant BUY_IN_AMOUNT = 0.00005 ether; uint256 public constant INITIAL_GELD = 50 * MANTISSA; - uint256 public constant RAID_WAIT = 15 seconds; mapping(address => Player) private players; mapping(address => Army) private armies; @@ -56,7 +55,6 @@ contract RaidGeld is ERC20, Ownable { // Manual minting for itchy fingers function raid() external onlyPlayer { - require(block.timestamp >= players[msg.sender].last_raided_at + RAID_WAIT, "Tried minting too soon"); performRaid(msg.sender); } diff --git a/test/RaidGeld.t.sol b/test/RaidGeld.t.sol index 375fb31..d1f5d48 100644 --- a/test/RaidGeld.t.sol +++ b/test/RaidGeld.t.sol @@ -151,8 +151,6 @@ contract raid_geldTest is Test { uint256 balance = raid_geld.balanceOf(player1); - // Warp time a bit so first raid doesnt fail - vm.warp(block.timestamp + raid_geld.RAID_WAIT()); // Trigger raid funds minting raid_geld.raid(); @@ -162,11 +160,7 @@ contract raid_geldTest is Test { uint256 last_raided_at = player.last_raided_at; assertLt(balance, newBalance); - // Expect fail if we raid again, we need to wait a bit - vm.expectRevert(); - raid_geld.raid(); - - // After wait time passes raid should work again + // After wait time passes raid should bring in profits again vm.warp(block.timestamp + raid_geld.RAID_WAIT()); raid_geld.raid();