diff --git a/src/Claimer.sol b/src/Claimer.sol index 6468732..05d118e 100644 --- a/src/Claimer.sol +++ b/src/Claimer.sol @@ -141,8 +141,8 @@ contract Claimer is Multicall { uint32[][] calldata _prizeIndices ) internal view returns (uint256) { uint256 claimCount; - uint length = _winners.length; - for (uint i = 0; i < length; i++) { + uint256 length = _winners.length; + for (uint256 i = 0; i < length; i++) { claimCount += _prizeIndices[i].length; } @@ -197,7 +197,7 @@ contract Claimer is Multicall { /// @param _tier The tier to claim prizes from /// @param _claimCount The number of claims /// @return The total fees for those claims - function computeTotalFees(uint8 _tier, uint _claimCount) external view returns (uint256) { + function computeTotalFees(uint8 _tier, uint256 _claimCount) external view returns (uint256) { return _computeFeePerClaim( _computeMaxFee(_tier), @@ -213,8 +213,8 @@ contract Claimer is Multicall { /// @return The total fees for those claims function computeTotalFees( uint8 _tier, - uint _claimCount, - uint _claimedCount + uint256 _claimCount, + uint256 _claimedCount ) external view returns (uint256) { return _computeFeePerClaim( @@ -228,7 +228,7 @@ contract Claimer is Multicall { /// @param _maxFee the maximum fee that can be charged /// @param _claimCount the number of claims to check /// @return The fees for the claims - function computeFeePerClaim(uint256 _maxFee, uint _claimCount) external view returns (uint256) { + function computeFeePerClaim(uint256 _maxFee, uint256 _claimCount) external view returns (uint256) { return _computeFeePerClaim(_maxFee, _claimCount, prizePool.claimCount()); } @@ -239,8 +239,8 @@ contract Claimer is Multicall { /// @return The total fees for the claims function _computeFeePerClaim( uint256 _maxFee, - uint _claimCount, - uint _claimedCount + uint256 _claimCount, + uint256 _claimedCount ) internal view returns (uint256) { if (_claimCount == 0) { return 0; @@ -252,7 +252,7 @@ contract Claimer is Multicall { uint256 elapsed = block.timestamp - (prizePool.lastClosedDrawAwardedAt()); uint256 fee; - for (uint i = 0; i < _claimCount; i++) { + for (uint256 i = 0; i < _claimCount; i++) { fee += _computeFeeForNextClaim( minimumFee, decayConstant, diff --git a/src/libraries/LinearVRGDALib.sol b/src/libraries/LinearVRGDALib.sol index 097113b..ddbe0ce 100644 --- a/src/libraries/LinearVRGDALib.sol +++ b/src/libraries/LinearVRGDALib.sol @@ -35,7 +35,7 @@ library LinearVRGDALib { /// @param _perTimeUnit The target number of claims to sell per second /// @param _decayConstant The decay constant for the VRGDA formula /// @return The price of a token according to VRGDA, scaled by 1e18 - /// @dev This function has some cases where some calculations might overflow. If an overflow will occur and the calculation would have resulted in a high price, then the max uint value is returned. If an overflow would happen where a low price would be returned, then zero is returned. + /// @dev This function has some cases where some calculations might overflow. If an overflow will occur and the calculation would have resulted in a high price, then the max uint256 value is returned. If an overflow would happen where a low price would be returned, then zero is returned. function getVRGDAPrice( uint256 _targetPrice, uint256 _timeSinceStart, @@ -78,13 +78,13 @@ library LinearVRGDALib { // If exponential result is greater than 1, then don't worry about extra precision to avoid extra risk of overflow if (expResult > 1e18) { - // Check if multiplication will overflow and return max uint if it will. + // Check if multiplication will overflow and return max uint256 if it will. if (targetPriceInt > type(int256).max / expResult) { return type(uint256).max; } return uint256(unsafeWadMul(targetPriceInt, expResult)); } else { - // Check if multiplication will overflow and return max uint if it will. + // Check if multiplication will overflow and return max uint256 if it will. int256 extraPrecisionExpResult = int128(expResult * 1e18); if (targetPriceInt > type(int256).max / extraPrecisionExpResult) { return type(uint256).max;