master
lza_menace 2 years ago
parent e93e6d482e
commit 432571325d

@ -2,5 +2,3 @@
src = 'src'
out = 'out'
libs = ['lib']
# See more config options https://github.com/foundry-rs/foundry/tree/master/config

@ -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);

@ -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 {}

Loading…
Cancel
Save