Platform: Code4rena
Start Date: 21/08/2023
Pot Size: $36,500 USDC
Total HM: 1
Participants: 43
Period: 7 days
Judge: Dravee
Id: 277
League: ETH
Rank: 40/43
Findings: 1
Award: $9.16
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: Udsen
Also found by: 0xSmartContract, 0xmystery, 0xprinc, Fulum, JP_Courses, MatricksDeCoder, Mirror, MohammedRizwan, MrPotatoMagic, Rolezn, Shubham, Testerbot, ast3ros, chainsnake, lanrebayode77, lsaudit, nisedo, plainshift, pontifex, prapandey031
9.1555 USDC - $9.16
Notice line is wrong, you need to change it.
/** -- @notice Calculates the b variable in the curve eq which is basically a sq. root of the inverse of x instantaneous price ++ @notice Calculates the b variable in the curve eq which is basically a sq. root of x instantaneous price @param self config instance */ function b(Config storage self) public view returns (int128) { return p_min(self).sqrt(); }
The comment doesn't match the code.
-- // at all times x price should be less than y price ++ // at all times y price should be less than x price if (py_init <= px_init) revert InvalidPrice(); if (py_final <= px_final) revert InvalidPrice();
In some functions, the amount must be less than 0 because the sign is inverted just after it. These comment lines doesn't match the code.
-- // amount cannot be less than 0 ++ // amount cannot be more than 0 require(result < 0);
The comment doesn't match the code.
-- * @dev We use FEE_UP because we want to increase the perceived amount of -- * reserve tokens leaving the pool and to increase the observed amount of -- * LP tokens being burned. ++ * @dev We use FEE_DOWN because we want to decrease the perceived amount of ++ * reserve tokens leaving the pool and to decrease the observed amount of ++ * LP tokens. */ function withdrawGivenInputAmount( uint256 xBalance, uint256 yBalance, uint256 totalSupply, uint256 burnedAmount, SpecifiedToken withdrawnToken ) external view returns (uint256 withdrawnAmount) { ... int256 result = _lpTokenSpecified( withdrawnToken, -int256(burnedAmount), FEE_DOWN, int256(totalSupply), int256(xBalance), int256(yBalance) );
#0 - c4-pre-sort
2023-08-30T04:00:56Z
0xRobocop marked the issue as low quality report
#1 - c4-judge
2023-09-11T19:49:52Z
JustDravee marked the issue as grade-b