|
|
|
@ -202,9 +202,10 @@ contract Main is Owned {
|
|
|
|
|
/// @dev The likelihood of killing a boomer decreases as time goes on - i.e. more duds
|
|
|
|
|
/// @param _amount Amount of bombs to send to kill Unaboomers
|
|
|
|
|
function sendBombs(uint256 _amount) external missionNotCompleted {
|
|
|
|
|
require(_amount <= bombBalance(msg.sender), "not enough bombs");
|
|
|
|
|
require(_amount <= unaboomer.totalSupply(), "not enough supply");
|
|
|
|
|
uint256 supply = unaboomer.totalSupply();
|
|
|
|
|
require(_amount <= bombBalance(msg.sender), "not enough bombs");
|
|
|
|
|
require(_amount <= supply, "not enough supply");
|
|
|
|
|
require(_amount <= supply - unaboomersKilled(), "not enough active boomers");
|
|
|
|
|
for (uint256 i; i < _amount; i++) {
|
|
|
|
|
uint256 randomBoomer = uint256(keccak256(abi.encodePacked(i, _amount, block.timestamp, msg.sender))) % supply;
|
|
|
|
|
bool dud = unaboomer.tokenDead(randomBoomer);
|
|
|
|
|