diff --git a/foundry.toml b/foundry.toml index e6810b2..2ade45a 100644 --- a/foundry.toml +++ b/foundry.toml @@ -2,5 +2,3 @@ src = 'src' out = 'out' libs = ['lib'] - -# See more config options https://github.com/foundry-rs/foundry/tree/master/config \ No newline at end of file diff --git a/src/Main.sol b/src/Main.sol index bcf7507..050f246 100644 --- a/src/Main.sol +++ b/src/Main.sol @@ -93,8 +93,8 @@ contract Main is Owned { require(_amount <= mailbomb.balanceOf(msg.sender, 1), "not enough bombs"); bool[] memory res = new bool[](_amount); uint256[] memory killed = new uint256[](_amount); + uint256 boomerSupply = unaboomer.totalSupply(); for (uint256 i; i < _amount; i++) { - uint256 boomerSupply = unaboomer.totalSupply(); uint256 randomBoomer = uint256(keccak256(abi.encodePacked(i, block.timestamp, msg.sender))) % boomerSupply; bool dud = unaboomer.tokenDead(randomBoomer); unaboomer.kill(randomBoomer); diff --git a/test/Unaboomer.t.sol b/test/Unaboomer.t.sol index c1ed0bb..a483e0f 100644 --- a/test/Unaboomer.t.sol +++ b/test/Unaboomer.t.sol @@ -43,13 +43,12 @@ contract UnaboomerTest is Test { assertEq(boomr.balanceOf(t2), 20); assertEq(bomb.bombsAssembled(), 100); assertEq(bomb.balanceOf(t2, 1), 40); - // sending bombs should change supplies + // sending bombs should change supplies and update kill count hoax(t1); - main.sendBombs(60); - // for (uint256 i; i < res.length; i++) { - // console.log(res[i]); - // console.log(killed[i]); - // } + main.sendBombs(40); + assertEq(bomb.balanceOf(t1, 1), 20); + assertEq(boomr.killCount() > 0, true); + console.log(boomr.killCount()); } // function testX() public {}