|
|
|
@ -21,6 +21,27 @@ contract UnaboomerTest is Test {
|
|
|
|
|
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()));
|
|
|
|
@ -58,46 +79,46 @@ contract UnaboomerTest is Test {
|
|
|
|
|
// 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 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);
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
// 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);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|