You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
4.2 KiB
Solidity

// 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 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) {
// src/Unaboomer.sol: function kill(uint256 tokenId) external {
// src/Unaboomer.sol: function totalSupply() public view returns (uint256 supply) {
// src/Unaboomer.sol: function tokenURI
// =========================================================================
// 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 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);
uint256[] memory bombs = new uint256[](3);
bombs[0] = 1;
bombs[1] = 2;
bombs[2] = 3;
main.sendBombs(bombs);
}
function testUnaboomerMainMint() public {}
function testUnaboomerMainKill() public {}
function testUnaboomerSupply() public {}
function testUnaboomerTokenURIs() public {}
// function testX() public {}
}