|
|
@ -2,28 +2,34 @@
|
|
|
|
pragma solidity ^0.8.13;
|
|
|
|
pragma solidity ^0.8.13;
|
|
|
|
|
|
|
|
|
|
|
|
import "forge-std/Test.sol";
|
|
|
|
import "forge-std/Test.sol";
|
|
|
|
|
|
|
|
import {UnaboomerCommon} from "../src/UnaboomerCommon.sol";
|
|
|
|
import {Unaboomer} from "../src/Unaboomer.sol";
|
|
|
|
import {Unaboomer} from "../src/Unaboomer.sol";
|
|
|
|
import {Mailbomb} from "../src/Mailbomb.sol";
|
|
|
|
import {Mailbomb} from "../src/Mailbomb.sol";
|
|
|
|
|
|
|
|
|
|
|
|
contract UnaboomerTest is Test {
|
|
|
|
contract UnaboomerTest is Test {
|
|
|
|
|
|
|
|
UnaboomerCommon public main;
|
|
|
|
Unaboomer public boomr;
|
|
|
|
Unaboomer public boomr;
|
|
|
|
Mailbomb public bomb;
|
|
|
|
Mailbomb public bomb;
|
|
|
|
|
|
|
|
|
|
|
|
function setUp() public {
|
|
|
|
function setUp() public {
|
|
|
|
|
|
|
|
main = new UnaboomerCommon();
|
|
|
|
boomr = new Unaboomer();
|
|
|
|
boomr = new Unaboomer();
|
|
|
|
bomb = new Mailbomb();
|
|
|
|
bomb = new Mailbomb();
|
|
|
|
bomb.setUnaboomerContract(address(boomr));
|
|
|
|
boomr.setMainContract(address(main));
|
|
|
|
|
|
|
|
bomb.setMainContract(address(main));
|
|
|
|
|
|
|
|
main.setUnaboomerContract(address(boomr));
|
|
|
|
|
|
|
|
main.setMailbombContract(address(bomb));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function testWithdraws() public {
|
|
|
|
function testWithdraws() public {
|
|
|
|
vm.deal(address(boomr), 11 ether);
|
|
|
|
vm.deal(address(main), 10 ether);
|
|
|
|
vm.prank(address(boomr.owner()));
|
|
|
|
vm.prank(address(main.owner()));
|
|
|
|
boomr.withdraw();
|
|
|
|
main.withdraw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function testMint() public {
|
|
|
|
function testMint() public {
|
|
|
|
hoax(address(1));
|
|
|
|
hoax(address(1));
|
|
|
|
boomr.mint{value: 0.05 ether}(5);
|
|
|
|
main.radicalizeBoomer{value: 0.05 ether}(5);
|
|
|
|
assertEq(boomr.totalSupply(), 5);
|
|
|
|
assertEq(boomr.totalSupply(), 5);
|
|
|
|
assertEq(boomr.tokenDead(1), false);
|
|
|
|
assertEq(boomr.tokenDead(1), false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|