add simple getter funcs for balances

master
lza_menace 2 years ago
parent 5071fbc5d3
commit 4c5931fbb4

@ -69,6 +69,16 @@ contract Main is Owned {
// Tokens
// =========================================================================
/// Get balance of BOOMR tokens
function unaboomerBalance(address _address) public view returns (uint256) {
return unaboomer.balanceOf(_address);
}
/// Get balance of BOMB tokens
function bombBalance(address _address) public view returns (uint256) {
return mailbomb.balanceOf(_address, 1);
}
/// Radicalize a boomer to become a Unaboomer - start with 2 bombs
function radicalizeBoomers(uint256 _amount) external payable missionNotCompleted {
require(msg.value >= _amount * boomerPrice, "not enough ether");
@ -90,7 +100,7 @@ contract Main is Owned {
bool[] memory results,
uint256[] memory tokensKilled
) {
require(_amount <= mailbomb.balanceOf(msg.sender, 1), "not enough bombs");
require(_amount <= bombBalance(msg.sender), "not enough bombs");
require(_amount <= unaboomer.totalSupply(), "not enough supply");
bool[] memory res = new bool[](_amount);
uint256[] memory killed = new uint256[](_amount);

Loading…
Cancel
Save