Skip to content

Commit

Permalink
Revert when amount too big
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-CZ committed Dec 16, 2024
1 parent d5b40d2 commit 0cde51e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contracts/sfc/SFCLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ contract SFCLib is SFCBase {
}

function _burnFTM(uint256 amount) internal {
if (amount != 0 && totalSupply >= amount) {
if (amount != 0) {
require(totalSupply >= amount, "Amount to burn too large");
totalSupply -= amount;
address(0).transfer(amount);
emit BurntFTM(amount);
Expand Down

0 comments on commit 0cde51e

Please sign in to comment.