Skip to content

Commit

Permalink
feat: move max_uint to type(...).max
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenvaleri committed May 3, 2024
1 parent 471bfb0 commit 4e0ff49
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions contracts/PointTokenVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall
bytes32 public constant REDEMPTION_RIGHTS_PREFIX = keccak256("REDEMPTION_RIGHTS");
bytes32 public constant MERKLE_UPDATER_ROLE = keccak256("MERKLE_UPDATER_ROLE");
bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");

uint256 public constant MAX_UINT_256 = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

// Deposit asset balancess.
mapping(address => mapping(ERC20 => uint256)) public balances; // user => point-earning token => balance
Expand Down Expand Up @@ -89,7 +87,7 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall
function deposit(ERC20 _token, uint256 _amount, address _receiver) public {
uint256 cap = caps[address(_token)];

if (cap != MAX_UINT_256) {
if (cap != type(uint256).max) {
if (_amount + _token.balanceOf(address(this)) > cap) {
revert DepositExceedsCap();
}
Expand Down

0 comments on commit 4e0ff49

Please sign in to comment.