|
|
@ -20,6 +20,7 @@ error TooMany();
|
|
|
|
error NoContract();
|
|
|
|
error NoContract();
|
|
|
|
error WrongEtherAmount();
|
|
|
|
error WrongEtherAmount();
|
|
|
|
error MaxAmountReached();
|
|
|
|
error MaxAmountReached();
|
|
|
|
|
|
|
|
error NoAdmins();
|
|
|
|
|
|
|
|
|
|
|
|
contract Unaboomer is Owned, ERC721 {
|
|
|
|
contract Unaboomer is Owned, ERC721 {
|
|
|
|
using LibString for uint256;
|
|
|
|
using LibString for uint256;
|
|
|
@ -30,26 +31,52 @@ contract Unaboomer is Owned, ERC721 {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mapping(uint256 => TokenState) public tokenState;
|
|
|
|
mapping(uint256 => TokenState) public tokenState;
|
|
|
|
|
|
|
|
mapping(address => bool) public adminWallets;
|
|
|
|
|
|
|
|
|
|
|
|
uint256 public constant MAX_SUPPLY = 10000;
|
|
|
|
uint256 public constant MAX_SUPPLY = 10000;
|
|
|
|
uint256 public minted;
|
|
|
|
uint256 public minted;
|
|
|
|
string public livingURI;
|
|
|
|
string public livingURI;
|
|
|
|
string public deadURI;
|
|
|
|
string public deadURI;
|
|
|
|
|
|
|
|
address[] public payoutWallets;
|
|
|
|
|
|
|
|
|
|
|
|
constructor() ERC721("Unaboomer", "BOOMR") Owned(msg.sender) {}
|
|
|
|
constructor() ERC721("Unaboomer", "BOOMR") Owned(msg.sender) {}
|
|
|
|
|
|
|
|
|
|
|
|
function mint(uint256 amount) external payable {
|
|
|
|
// =========================================================================
|
|
|
|
if (msg.sender == tx.origin) {
|
|
|
|
// Admin
|
|
|
|
revert NoContract();
|
|
|
|
// =========================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///@dev Specify team wallets for payouts and contract administration
|
|
|
|
|
|
|
|
function updateAdmins(address[] calldata _admins) external onlyOwner {
|
|
|
|
|
|
|
|
payoutWallets = _admins;
|
|
|
|
|
|
|
|
for (uint256 i; i < _admins.length; i++) {
|
|
|
|
|
|
|
|
adminWallets[_admins[i]] = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (amount > 20) {
|
|
|
|
|
|
|
|
revert TooMany();
|
|
|
|
///@dev Remove admins if needed
|
|
|
|
|
|
|
|
function removeAdmin(address _admin) external onlyOwner {
|
|
|
|
|
|
|
|
adminWallets[_admin] = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (minted + amount > MAX_SUPPLY) {
|
|
|
|
|
|
|
|
revert MaxSupplyReached();
|
|
|
|
///@dev Split payments to team
|
|
|
|
|
|
|
|
function withdraw() external onlyOwner {
|
|
|
|
|
|
|
|
if (payoutWallets.length == 0) revert NoAdmins();
|
|
|
|
|
|
|
|
uint256 balance = address(this).balance;
|
|
|
|
|
|
|
|
for (uint256 i; i < payoutWallets.length; i++) {
|
|
|
|
|
|
|
|
payable(payoutWallets[i]).transfer(balance / payoutWallets.length);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// =========================================================================
|
|
|
|
|
|
|
|
// Tokens
|
|
|
|
|
|
|
|
// =========================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mint(uint256 _amount) external payable {
|
|
|
|
|
|
|
|
if (msg.sender == tx.origin) revert NoContract();
|
|
|
|
|
|
|
|
if (_amount > 20) revert TooMany();
|
|
|
|
|
|
|
|
if (minted + _amount > MAX_SUPPLY) revert MaxSupplyReached();
|
|
|
|
unchecked {
|
|
|
|
unchecked {
|
|
|
|
for (uint256 i; i < amount; i++) {
|
|
|
|
for (uint256 i; i < _amount; i++) {
|
|
|
|
_mint(msg.sender, minted + 1);
|
|
|
|
_mint(msg.sender, minted + 1);
|
|
|
|
minted++;
|
|
|
|
minted++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|