From 0cde51e815d3518ce17c6566c7b4c671da92cc9c Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 16 Dec 2024 16:58:48 +0100 Subject: [PATCH] Revert when amount too big --- contracts/sfc/SFCLib.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/sfc/SFCLib.sol b/contracts/sfc/SFCLib.sol index ce782a2..09b1d4b 100644 --- a/contracts/sfc/SFCLib.sol +++ b/contracts/sfc/SFCLib.sol @@ -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);