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.
50 lines
1.4 KiB
Solidity
50 lines
1.4 KiB
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity ^0.8.13;
|
|
|
|
import "forge-std/Test.sol";
|
|
import "../src/Unaboomer.sol";
|
|
|
|
contract UnaboomerTest is Test {
|
|
Unaboomer public boomr;
|
|
address alice = address(1);
|
|
address bob = address(2);
|
|
address[] admins = new address[](2);
|
|
|
|
function setUp() public {
|
|
boomr = new Unaboomer();
|
|
admins[0] = address(1);
|
|
admins[1] = address(2);
|
|
boomr.updateAdmins(admins);
|
|
}
|
|
|
|
function testUpdatingAdmins() public {
|
|
// confirm admin on 1 and 2
|
|
assertEq(boomr.adminWallets(boomr.deployer()), true);
|
|
assertEq(boomr.adminWallets(address(1)), true);
|
|
assertEq(boomr.adminWallets(address(2)), true);
|
|
assertEq(boomr.adminWallets(address(3)), false);
|
|
hoax(address(1));
|
|
boomr.removeAdmin(address(2));
|
|
assertEq(boomr.adminWallets(address(2)), false);
|
|
hoax(address(2));
|
|
vm.expectRevert();
|
|
boomr.withdraw();
|
|
}
|
|
|
|
function testWithdraws() public {
|
|
// confirm payouts divvy equally
|
|
vm.deal(address(boomr), 11.5 ether);
|
|
vm.prank(address(1));
|
|
boomr.withdraw();
|
|
assertEq(address(1).balance, 5.75 ether);
|
|
assertEq(address(2).balance, 5.75 ether);
|
|
}
|
|
|
|
function testMint() public {
|
|
vm.startPrank(alice);
|
|
boomr.mint(5);
|
|
assertEq(boomr.totalSupply(), 5);
|
|
assertEq(boomr.tokenDead(1), false);
|
|
}
|
|
}
|