diff --git a/src/Main.sol b/src/Main.sol index 8ee4abe..4917606 100644 --- a/src/Main.sol +++ b/src/Main.sol @@ -236,10 +236,11 @@ contract Main is Owned { function sendBombs(uint256 _amount) external missionNotCompleted { // Ensure _amount will not exceed wallet balance of bombs, Unaboomer supply, and active Unaboomers uint256 supply = unaboomersRadicalized(); - require(_amount <= bombBalance(msg.sender), "not enough bombs"); + uint256 bal = bombBalance(msg.sender); + require(_amount <= bal, "not enough bombs"); for (uint256 i; i < _amount; i++) { // Pick a pseudo-random Unaboomer token - imperfectly derives token IDs so that repeats are probable - uint256 randomBoomer = (uint256(keccak256(abi.encodePacked(i, block.timestamp, msg.sender))) % supply) + 1; + uint256 randomBoomer = (uint256(keccak256(abi.encodePacked(i, supply, bal, msg.sender))) % supply) + 1; // Capture owner address _owner = unaboomer.ownerOf(randomBoomer); // Check if it was already killed