|
|
|
@ -1,15 +1,6 @@
|
|
|
|
|
// SPDX-License-Identifier: UNLICENSED
|
|
|
|
|
pragma solidity ^0.8.13;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******* Mint Mechanics
|
|
|
|
|
.00 per unaboomer (BOOMR) - 10k supply
|
|
|
|
|
.02 per bomb (BOMB) - infinite supply
|
|
|
|
|
BOMB holders can randomly mail bombs to other owners
|
|
|
|
|
1 BOMB kills 1 BOOMR - BOOMR image switches to explosion after being bombed
|
|
|
|
|
chaos ensues until 1000 survivors - the game stops
|
|
|
|
|
********/
|
|
|
|
|
|
|
|
|
|
import {ERC721A} from "erc721a/ERC721A.sol";
|
|
|
|
|
import {Owned} from "solmate/auth/Owned.sol";
|
|
|
|
|
import {LibString} from "solmate/utils/LibString.sol";
|
|
|
|
@ -58,7 +49,8 @@ contract Unaboomer is ERC721A, Owned {
|
|
|
|
|
// =========================================================================
|
|
|
|
|
// Modifiers
|
|
|
|
|
// =========================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Only main address can mint
|
|
|
|
|
modifier onlyMain {
|
|
|
|
|
require(msg.sender == address(main), "invalid minter");
|
|
|
|
|
_;
|
|
|
|
@ -75,8 +67,8 @@ contract Unaboomer is ERC721A, Owned {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Toggle token state from living to dead
|
|
|
|
|
function kill(uint256 tokenId) external onlyMain {
|
|
|
|
|
require(tokenId <= totalSupply(), "invalid token id");
|
|
|
|
|
function die(uint256 tokenId) external onlyMain {
|
|
|
|
|
require(tokenId < totalSupply(), "invalid token id");
|
|
|
|
|
if (tokenDead[tokenId] == false) {
|
|
|
|
|
killCount++;
|
|
|
|
|
tokenDead[tokenId] = true;
|
|
|
|
@ -84,7 +76,7 @@ contract Unaboomer is ERC721A, Owned {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function tokenURI(uint256 _tokenId) public view override returns (string memory) {
|
|
|
|
|
if (tokenDead[_tokenId]) {
|
|
|
|
|
if (tokenDead[_tokenId] == true) {
|
|
|
|
|
return string(abi.encodePacked(deadURI, _tokenId.toString(), ".json"));
|
|
|
|
|
} else {
|
|
|
|
|
return string(abi.encodePacked(aliveURI, _tokenId.toString(), ".json"));
|
|
|
|
|