From e93e6d482e84e76114b9b6ffbc319cbf98e58310 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Mon, 26 Dec 2022 23:37:02 -0800 Subject: [PATCH] save a lil gas --- src/Unaboomer.sol | 6 ++++-- test/Unaboomer.t.sol | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Unaboomer.sol b/src/Unaboomer.sol index d139d2c..50c8fb5 100644 --- a/src/Unaboomer.sol +++ b/src/Unaboomer.sol @@ -72,10 +72,12 @@ contract Unaboomer is ERC721, Owned { function radicalize(address _to, uint256 _amount) external payable onlyMain { require(minted + _amount <= MAX_SUPPLY, "supply reached"); unchecked { + uint256 startToken = minted + 1; for (uint256 i; i < _amount; i++) { - minted++; - _mint(_to, minted); + _mint(_to, startToken); + startToken += 1; } + minted += _amount; } } diff --git a/test/Unaboomer.t.sol b/test/Unaboomer.t.sol index 2d82aac..c1ed0bb 100644 --- a/test/Unaboomer.t.sol +++ b/test/Unaboomer.t.sol @@ -45,7 +45,7 @@ contract UnaboomerTest is Test { assertEq(bomb.balanceOf(t2, 1), 40); // sending bombs should change supplies hoax(t1); - (bool[] memory res, uint256[] memory killed) = main.sendBombs(60); + main.sendBombs(60); // for (uint256 i; i < res.length; i++) { // console.log(res[i]); // console.log(killed[i]);