1
0
forked from mico/idle_moloch

Removed RAID_WAIT because it was just getting in way of UX

This commit is contained in:
mic0 2024-10-26 13:14:43 +02:00
parent c1e6494937
commit 203ebd3e97
Signed by: mico
GPG Key ID: A3F8023524CF1C8D
2 changed files with 1 additions and 9 deletions

View File

@ -11,7 +11,6 @@ contract RaidGeld is ERC20, Ownable {
uint256 public constant BUY_IN_AMOUNT = 0.00005 ether; uint256 public constant BUY_IN_AMOUNT = 0.00005 ether;
uint256 public constant INITIAL_GELD = 50 * MANTISSA; uint256 public constant INITIAL_GELD = 50 * MANTISSA;
uint256 public constant RAID_WAIT = 15 seconds;
mapping(address => Player) private players; mapping(address => Player) private players;
mapping(address => Army) private armies; mapping(address => Army) private armies;
@ -56,7 +55,6 @@ contract RaidGeld is ERC20, Ownable {
// Manual minting for itchy fingers // Manual minting for itchy fingers
function raid() external onlyPlayer { function raid() external onlyPlayer {
require(block.timestamp >= players[msg.sender].last_raided_at + RAID_WAIT, "Tried minting too soon");
performRaid(msg.sender); performRaid(msg.sender);
} }

View File

@ -151,8 +151,6 @@ contract raid_geldTest is Test {
uint256 balance = raid_geld.balanceOf(player1); 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 // Trigger raid funds minting
raid_geld.raid(); raid_geld.raid();
@ -162,11 +160,7 @@ contract raid_geldTest is Test {
uint256 last_raided_at = player.last_raided_at; uint256 last_raided_at = player.last_raided_at;
assertLt(balance, newBalance); assertLt(balance, newBalance);
// Expect fail if we raid again, we need to wait a bit // After wait time passes raid should bring in profits again
vm.expectRevert();
raid_geld.raid();
// After wait time passes raid should work again
vm.warp(block.timestamp + raid_geld.RAID_WAIT()); vm.warp(block.timestamp + raid_geld.RAID_WAIT());
raid_geld.raid(); raid_geld.raid();