// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.13; import "forge-std/Test.sol"; import {UnaboomerCommon} from "../src/UnaboomerCommon.sol"; import {Unaboomer} from "../src/Unaboomer.sol"; import {Mailbomb} from "../src/Mailbomb.sol"; contract UnaboomerTest is Test { UnaboomerCommon public main; Unaboomer public boomr; Mailbomb public bomb; function setUp() public { main = new UnaboomerCommon(); boomr = new Unaboomer(); bomb = new Mailbomb(); boomr.setMainContract(address(main)); bomb.setMainContract(address(main)); main.setUnaboomerContract(address(boomr)); main.setMailbombContract(address(bomb)); } function testBasicMechanics() public { address t = address(3); address t2 = address(4); startHoax(t); // mint 20 boomers - should have 20 BOOMR and 40 BOMB main.radicalizeBoomers{value: .2 ether}(20); assertEq(boomr.totalSupply(), 20); assertEq(bomb.bombsAssembled(), 40); assertEq(bomb.balanceOf(t, 1), 40); // mint 20 more bombs - should have 60 BOMB main.assembleBombs{value: .2 ether}(20); assertEq(bomb.bombsAssembled(), 60); assertEq(bomb.balanceOf(t, 1), 60); stopHoax(); vm.prank(t2); main.assembleBombs{value: .2 ether}(20); assertEq(bomb.bombsAssembled(), 80); assertEq(bomb.balanceOf(t2, 1), 20); } // function testWithdraws() public { // vm.deal(address(main), 10 ether); // vm.prank(address(main.owner())); // main.withdraw(); // } // function testMint() public { // hoax(address(1)); // main.radicalizeBoomers{value: 0.05 ether}(5); // assertEq(boomr.totalSupply(), 5); // assertEq(boomr.tokenDead(1), false); // } // src/Mailbomb.sol: function withdraw() external onlyOwner { // src/Mailbomb.sol: function setBaseURI(string calldata _baseURI) external onlyOwner { // src/Mailbomb.sol: /// Set main contract address for executing functions // src/Mailbomb.sol: function setMainContract(address _address) external onlyOwner { // src/Mailbomb.sol: function mint(address _to, uint256 _amount) external payable { // src/Mailbomb.sol: function burn(uint256 tokenId) external { // src/Mailbomb.sol: function totalSupply() public view returns (uint256 supply) { // src/Mailbomb.sol: function tokenURI(uint256 _tokenId) public view override returns (string memory) { // src/Mailbomb.sol: function supportsInterface(bytes4 interfaceId) public view virtual override (ERC721) returns (bool) { // src/UnaboomerCommon.sol: function withdraw() external onlyOwner { // src/UnaboomerCommon.sol: function setBombPrice(uint256 _price) external onlyOwner { // src/UnaboomerCommon.sol: function setBoomerPrice(uint256 _price) external onlyOwner { // src/UnaboomerCommon.sol: function setUnaboomerContract(address _address) external onlyOwner { // src/UnaboomerCommon.sol: function setMailbombContract(address _address) external onlyOwner { // src/UnaboomerCommon.sol: function radicalizeBoomers(uint256 _amount) external payable missionNotCompleted { // src/UnaboomerCommon.sol: function assembleBombs(uint256 _amount) external payable missionNotCompleted { // src/UnaboomerCommon.sol: function sendBombs(uint256[] calldata tokenIds) external missionNotCompleted returns (bool[] memory results) { // function testX() public {} // ========================================================================= // Unaboomer // ========================================================================= // function testWithdrawUnaboomer() public {} // function testUnaboomerSetters() public { // string memory aliveURI = 'ipfs://xxxx/'; // string memory deadURI = 'ipfs://yyyy/'; // boomr.setAliveURI(aliveURI); // boomr.setDeadURI(deadURI); // assertEq(boomr.aliveURI(), aliveURI); // assertEq(boomr.deadURI(), deadURI); // } // function testUnaboomerMainMint() public { // startHoax(address(3)); // main.radicalizeBoomers{value: .1 ether}(10); // assertEq(boomr.totalSupply(), 10); // assertEq(bomb.totalSupply(), 20); // } // function testUnaboomerMainKill() public { // startHoax(address(3)); // main.radicalizeBoomers{value: .01 ether}(1); // uint256[] memory bombs = new uint256[](2); // bombs[0] = 1; // bombs[1] = 2; // main.sendBombs(bombs); // vm.expectRevert(bytes("not enough bombs")); // main.sendBombs(bombs); // main.radicalizeBoomers{value: .01 ether}(1); // main.sendBombs(bombs); // } // function testUnaboomerSupply() public {} // function testUnaboomerTokenURIs() public {} // function testUnaboomerDirectMint() public { // startHoax(address(5)); // vm.expectRevert(bytes("invalid minter")); // boomr.mint(address(5), 2); // } // function testUnaboomerDirectKill() public { // startHoax(address(5)); // main.radicalizeBoomers{value: .05 ether}(5); // vm.expectRevert(bytes("invalid minter")); // boomr.kill(1); // } }