Unverified Commit 1b37c21d by Francisco Giordano Committed by GitHub

reserve unchecked for when guarded by explicit require (#2685)

parent 7144ec8d
...@@ -267,8 +267,8 @@ contract ERC20 is Context, IERC20, IERC20Metadata { ...@@ -267,8 +267,8 @@ contract ERC20 is Context, IERC20, IERC20Metadata {
require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked { unchecked {
_balances[account] = accountBalance - amount; _balances[account] = accountBalance - amount;
_totalSupply -= amount;
} }
_totalSupply -= amount;
emit Transfer(account, address(0), amount); emit Transfer(account, address(0), amount);
} }
......
...@@ -421,8 +421,8 @@ contract ERC777 is Context, IERC777, IERC20 { ...@@ -421,8 +421,8 @@ contract ERC777 is Context, IERC777, IERC20 {
require(fromBalance >= amount, "ERC777: burn amount exceeds balance"); require(fromBalance >= amount, "ERC777: burn amount exceeds balance");
unchecked { unchecked {
_balances[from] = fromBalance - amount; _balances[from] = fromBalance - amount;
_totalSupply -= amount;
} }
_totalSupply -= amount;
emit Burned(operator, from, amount, data, operatorData); emit Burned(operator, from, amount, data, operatorData);
emit Transfer(from, address(0), amount); emit Transfer(from, address(0), amount);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment