From 4c5931fbb4b924be5916d1d8a1a13e459ef7c609 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Wed, 28 Dec 2022 01:11:57 -0800 Subject: [PATCH] add simple getter funcs for balances --- src/Main.sol | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Main.sol b/src/Main.sol index 85d5938..c5a1425 100644 --- a/src/Main.sol +++ b/src/Main.sol @@ -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);