|
|
|
@ -22,103 +22,36 @@ contract UnaboomerTest is Test {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function testBasicMechanics() public {
|
|
|
|
|
address t = address(3);
|
|
|
|
|
address t2 = address(4);
|
|
|
|
|
startHoax(t);
|
|
|
|
|
address t1 = address(1);
|
|
|
|
|
address t2 = address(2);
|
|
|
|
|
// mint 20 boomers - should have 20 BOOMR and 40 BOMB
|
|
|
|
|
hoax(t1);
|
|
|
|
|
main.radicalizeBoomers{value: .2 ether}(20);
|
|
|
|
|
assertEq(boomr.totalSupply(), 20);
|
|
|
|
|
assertEq(boomr.balanceOf(t1), 20);
|
|
|
|
|
assertEq(bomb.bombsAssembled(), 40);
|
|
|
|
|
assertEq(bomb.balanceOf(t, 1), 40);
|
|
|
|
|
assertEq(bomb.balanceOf(t1, 1), 40);
|
|
|
|
|
// mint 20 more bombs - should have 60 BOMB
|
|
|
|
|
hoax(t1);
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
assertEq(bomb.balanceOf(t1, 1), 60);
|
|
|
|
|
// mint 20 more boomers as other address - supplies should line up
|
|
|
|
|
hoax(t2);
|
|
|
|
|
main.radicalizeBoomers{value: .2 ether}(20);
|
|
|
|
|
assertEq(boomr.totalSupply(), 40);
|
|
|
|
|
assertEq(boomr.balanceOf(t2), 20);
|
|
|
|
|
assertEq(bomb.bombsAssembled(), 100);
|
|
|
|
|
assertEq(bomb.balanceOf(t2, 1), 40);
|
|
|
|
|
// sending bombs should change supplies
|
|
|
|
|
hoax(t1);
|
|
|
|
|
(bool[] memory res, uint256[] memory killed) = main.sendBombs(60);
|
|
|
|
|
for (uint256 i; i < res.length; i++) {
|
|
|
|
|
console.log(res[i]);
|
|
|
|
|
console.log(killed[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 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);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|