|
|
|
@ -75,7 +75,7 @@ contract Main is Owned {
|
|
|
|
|
/// Point to the latest leaderboard update
|
|
|
|
|
uint256 public leaderboardPointer;
|
|
|
|
|
/// Price of the Unaboomer ERC-721 token
|
|
|
|
|
uint256 public unaboomerPrice = 0.01 ether;
|
|
|
|
|
uint256 public unaboomerPrice = 0;
|
|
|
|
|
/// Price of the Mailbomb ERC-1155 token
|
|
|
|
|
uint256 public bombPrice = 0.01 ether;
|
|
|
|
|
/// Unaboomer contract
|
|
|
|
@ -176,6 +176,12 @@ contract Main is Owned {
|
|
|
|
|
return unaboomer.MAX_SURVIVOR_COUNT();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Get BOOMR token max mint amount per wallet
|
|
|
|
|
/// @return mintAmount Maximum amount of BOOMR tokens that can be minted per wallet
|
|
|
|
|
function unaboomerMaxMintPerWallet() public view returns (uint256) {
|
|
|
|
|
return unaboomer.MAX_MINT_AMOUNT();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Get BOMB token balance of wallet
|
|
|
|
|
/// @param _address Wallet address to query balance of BOMB token
|
|
|
|
|
/// @return balance Amount of BOMB tokens owned by _address
|
|
|
|
@ -230,12 +236,14 @@ contract Main is Owned {
|
|
|
|
|
for (uint256 i; i < _amount; i++) {
|
|
|
|
|
// Pick a pseudo-random Unaboomer token - imperfectly derives token IDs so that repeats are probable
|
|
|
|
|
uint256 randomBoomer = (uint256(keccak256(abi.encodePacked(i, _amount, killed, block.timestamp, msg.sender))) % supply) + 1;
|
|
|
|
|
// Capture owner
|
|
|
|
|
address _owner = unaboomer.ownerOf(randomBoomer);
|
|
|
|
|
// Check if it was already killed
|
|
|
|
|
bool dud = unaboomer.tokenDead(randomBoomer);
|
|
|
|
|
bool dud = _owner == address(0);
|
|
|
|
|
// Kill it (does nothing if already toggled as dead)
|
|
|
|
|
unaboomer.die(randomBoomer);
|
|
|
|
|
// Check if the sender owns it (misfired, kills own pfp)
|
|
|
|
|
bool senderOwned = msg.sender == unaboomer.ownerOf(randomBoomer);
|
|
|
|
|
bool senderOwned = msg.sender == _owner;
|
|
|
|
|
// Emit event for displaying in web app
|
|
|
|
|
emit SentBomb(msg.sender, randomBoomer, !dud, senderOwned);
|
|
|
|
|
// Increment kill count if successfully killed another player's Unaboomer
|
|
|
|
|