From 061bb06ba9063b7c646cfd44e5fbe6c3e036dc18 Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Fri, 15 Dec 2023 11:48:56 -0500 Subject: [PATCH] refactor: set max uint256 value dynamically --- contracts/interchain-token/ERC20.sol | 2 +- contracts/token-manager/TokenManager.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/interchain-token/ERC20.sol b/contracts/interchain-token/ERC20.sol index 71b7f10d..722021e0 100644 --- a/contracts/interchain-token/ERC20.sol +++ b/contracts/interchain-token/ERC20.sol @@ -34,7 +34,7 @@ contract ERC20 is IERC20 { mapping(address => mapping(address => uint256)) public override allowance; uint256 public override totalSupply; - uint256 internal constant UINT256_MAX = 2 ** 256 - 1; + uint256 internal constant UINT256_MAX = type(uint256).max; /** * @dev See {IERC20-transfer}. diff --git a/contracts/token-manager/TokenManager.sol b/contracts/token-manager/TokenManager.sol index b99ae0ef..2db0eaa4 100644 --- a/contracts/token-manager/TokenManager.sol +++ b/contracts/token-manager/TokenManager.sol @@ -21,7 +21,7 @@ contract TokenManager is ITokenManager, Operator, FlowLimit, Implementation { using AddressBytes for bytes; using SafeTokenCall for IERC20; - uint256 internal constant UINT256_MAX = 2 ** 256 - 1; + uint256 internal constant UINT256_MAX = type(uint256).max; address public immutable interchainTokenService;