bit of a refactor #1
@ -109,13 +109,13 @@ contract RaidGeld is ERC20, Ownable {
|
||||
}
|
||||
|
||||
uint256 cost = RaidGeldUtils.calculateUnitPrice(unit, currentLevel, n_units);
|
||||
// First trigger a raid so player receives what he is due at to this moment
|
||||
performRaid(msg.sender);
|
||||
require(balanceOf(msg.sender) > cost, "Not enough GELD to add this much");
|
||||
|
||||
// TODO: Since we are first minting then burning the token, this could be simplified
|
||||
// by first calculating the difference and then minting / burning in just one operation
|
||||
|
||||
// First trigger a raid so player receives what he is due at to this moment
|
||||
performRaid(msg.sender);
|
||||
// then burn the cost of the new army
|
||||
_burn(msg.sender, cost);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user