Skip to content

Commit

Permalink
Vader: if totalSupply + amount == maxSupply, do not set amount to its…
Browse files Browse the repository at this point in the history
… present value
  • Loading branch information
0xBrian committed May 5, 2021
1 parent 39daaec commit d177dab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/Vader.sol
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ contract Vader is iERC20 {
// Internal mint (upgrading and daily emissions)
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "recipient");
if ((totalSupply + amount) >= maxSupply) {
if ((totalSupply + amount) > maxSupply) {
amount = maxSupply - totalSupply; // Safety, can't mint above maxSupply
}
totalSupply += amount;
Expand Down

0 comments on commit d177dab

Please sign in to comment.