save a lil gas

master
lza_menace 2 years ago
parent a1b12dcd6b
commit e93e6d482e

@ -72,10 +72,12 @@ contract Unaboomer is ERC721, Owned {
function radicalize(address _to, uint256 _amount) external payable onlyMain { function radicalize(address _to, uint256 _amount) external payable onlyMain {
require(minted + _amount <= MAX_SUPPLY, "supply reached"); require(minted + _amount <= MAX_SUPPLY, "supply reached");
unchecked { unchecked {
uint256 startToken = minted + 1;
for (uint256 i; i < _amount; i++) { for (uint256 i; i < _amount; i++) {
minted++; _mint(_to, startToken);
_mint(_to, minted); startToken += 1;
} }
minted += _amount;
} }
} }

@ -45,7 +45,7 @@ contract UnaboomerTest is Test {
assertEq(bomb.balanceOf(t2, 1), 40); assertEq(bomb.balanceOf(t2, 1), 40);
// sending bombs should change supplies // sending bombs should change supplies
hoax(t1); hoax(t1);
(bool[] memory res, uint256[] memory killed) = main.sendBombs(60); main.sendBombs(60);
// for (uint256 i; i < res.length; i++) { // for (uint256 i; i < res.length; i++) {
// console.log(res[i]); // console.log(res[i]);
// console.log(killed[i]); // console.log(killed[i]);

Loading…
Cancel
Save