From b186eb5e5d633f706e482ebd3ab68c2fa99dcbcf Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Fri, 7 Jan 2022 23:56:29 +0100 Subject: [PATCH] Update contracts/token/ERC20/ERC20.sol Co-authored-by: Francisco Giordano --- contracts/token/ERC20/ERC20.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index 4d3f84b011e..bfe0fd1bc19 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -153,7 +153,7 @@ contract ERC20 is Context, IERC20, IERC20Metadata { uint256 amount ) public virtual override returns (bool) { uint256 currentAllowance = _allowances[sender][_msgSender()]; - if (currentAllowance != 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) { + if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount);