master
lza_menace 2 years ago
parent e93e6d482e
commit 432571325d

@ -2,5 +2,3 @@
src = 'src' src = 'src'
out = 'out' out = 'out'
libs = ['lib'] 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"); require(_amount <= mailbomb.balanceOf(msg.sender, 1), "not enough bombs");
bool[] memory res = new bool[](_amount); bool[] memory res = new bool[](_amount);
uint256[] memory killed = new uint256[](_amount); uint256[] memory killed = new uint256[](_amount);
for (uint256 i; i < _amount; i++) {
uint256 boomerSupply = unaboomer.totalSupply(); uint256 boomerSupply = unaboomer.totalSupply();
for (uint256 i; i < _amount; i++) {
uint256 randomBoomer = uint256(keccak256(abi.encodePacked(i, block.timestamp, msg.sender))) % boomerSupply; uint256 randomBoomer = uint256(keccak256(abi.encodePacked(i, block.timestamp, msg.sender))) % boomerSupply;
bool dud = unaboomer.tokenDead(randomBoomer); bool dud = unaboomer.tokenDead(randomBoomer);
unaboomer.kill(randomBoomer); unaboomer.kill(randomBoomer);

@ -43,13 +43,12 @@ contract UnaboomerTest is Test {
assertEq(boomr.balanceOf(t2), 20); assertEq(boomr.balanceOf(t2), 20);
assertEq(bomb.bombsAssembled(), 100); assertEq(bomb.bombsAssembled(), 100);
assertEq(bomb.balanceOf(t2, 1), 40); assertEq(bomb.balanceOf(t2, 1), 40);
// sending bombs should change supplies // sending bombs should change supplies and update kill count
hoax(t1); hoax(t1);
main.sendBombs(60); main.sendBombs(40);
// for (uint256 i; i < res.length; i++) { assertEq(bomb.balanceOf(t1, 1), 20);
// console.log(res[i]); assertEq(boomr.killCount() > 0, true);
// console.log(killed[i]); console.log(boomr.killCount());
// }
} }
// function testX() public {} // function testX() public {}

Loading…
Cancel
Save