Platform: Code4rena
Start Date: 07/04/2023
Pot Size: $47,000 USDC
Total HM: 20
Participants: 120
Period: 6 days
Judge: GalloDaSballo
Total Solo HM: 4
Id: 230
League: ETH
Rank: 81/120
Findings: 2
Award: $26.07
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: sashik_eth
Also found by: 0x4non, 0x6980, 0xAgro, Cryptor, Kaysoft, Kenshin, Madalad, SaeedAlipoor01988, Sathish9098, W0RR1O, adriro, ayden, btk, catellatech, codeslide, devscrooge, georgits, giovannidisiena, lukris02, matrix_0wl, sayan, tnevler, tsvetanovv
23.0813 USDC - $23.08
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
#0 - c4-judge
2023-05-04T16:55:57Z
GalloDaSballo marked the issue as duplicate of #167
#1 - c4-judge
2023-05-04T16:56:34Z
GalloDaSballo marked the issue as satisfactory
2.9913 USDC - $2.99
https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L736
Let's say when the ERC20 token is USDC with a decimal value of 6, dividing by 1e18 would result in a value that is too small
function changeFeeQuote(uint256 inputAmount) public view returns (uint256 feeAmount, uint256 protocolFeeAmount) { // multiply the changeFee to get the fee per NFT (4 decimals of accuracy) uint256 exponent = baseToken == address(0) ? 18 - 4 : ERC20(baseToken).decimals() - 4; uint256 feePerNft = changeFee * 10 ** exponent; feeAmount = inputAmount * feePerNft / 1e18; protocolFeeAmount = feeAmount * Factory(factory).protocolFeeRate() / 10_000; }
Manual
function changeFeeQuote(uint256 inputAmount) public view returns (uint256 feeAmount, uint256 protocolFeeAmount) { // multiply the changeFee to get the fee per NFT (4 decimals of accuracy) uint256 exponent = baseToken == address(0) ? 18 - 4 : ERC20(baseToken).decimals() - 4; uint256 feePerNft = changeFee * 10 ** exponent; feeAmount = inputAmount * feePerNft / 10 ** (exponent+4); protocolFeeAmount = feeAmount * Factory(factory).protocolFeeRate() / 10_000; }
#0 - c4-pre-sort
2023-04-20T10:19:49Z
0xSorryNotSorry marked the issue as low quality report
#1 - c4-judge
2023-05-01T19:16:12Z
GalloDaSballo marked the issue as duplicate of #858
#2 - c4-judge
2023-05-01T19:16:19Z
GalloDaSballo marked the issue as partial-50
#3 - GalloDaSballo
2023-05-01T19:16:28Z
Would have benefitted by having more details, 50%