Closed c4-judge closed 1 year ago
Judge has assessed an item in Issue #344 as 3 risk. The relevant finding follows:
https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L230#L231 https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L323#L324 To ensure that there is no overflow when converting uint256 to uint128,and the totalNetInputAmount can be extracted so that it does not need to be calculated again later
virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);
virtualNftReserves -= uint128(weightSum);
uint256 totalNetInputAmount = netInputAmount - feeAmount - protocolFeeAmount;
require(uint128(totalNetInputAmount) == totalNetInputAmount, "totalNetInputAmount is not an int");
require(uint128(weightSum) == weightSum, "weightSum is not an int");
GalloDaSballo marked the issue as duplicate of #167
GalloDaSballo marked the issue as satisfactory
Judge has assessed an item in Issue #344 as 3 risk. The relevant finding follows:
https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L230#L231 https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L323#L324 To ensure that there is no overflow when converting uint256 to uint128,and the totalNetInputAmount can be extracted so that it does not need to be calculated again later
virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);
virtualNftReserves -= uint128(weightSum);
uint256 totalNetInputAmount = netInputAmount - feeAmount - protocolFeeAmount;
require(uint128(totalNetInputAmount) == totalNetInputAmount, "totalNetInputAmount is not an int");
require(uint128(weightSum) == weightSum, "weightSum is not an int");