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

pull/2687/head
Francisco Giordano 4 years ago committed by GitHub
parent 7144ec8db4
commit 1b37c21da5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      contracts/token/ERC20/ERC20.sol
  2. 2
      contracts/token/ERC777/ERC777.sol

@ -267,8 +267,8 @@ contract ERC20 is Context, IERC20, IERC20Metadata {
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}

@ -421,8 +421,8 @@ contract ERC777 is Context, IERC777, IERC20 {
require(fromBalance >= amount, "ERC777: burn amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
_totalSupply -= amount;
}
_totalSupply -= amount;
emit Burned(operator, from, amount, data, operatorData);
emit Transfer(from, address(0), amount);

Loading…
Cancel
Save