Platform: Code4rena
Start Date: 20/01/2023
Pot Size: $90,500 USDC
Total HM: 10
Participants: 59
Period: 7 days
Judge: Picodes
Total Solo HM: 4
Id: 206
League: ETH
Rank: 25/59
Findings: 2
Award: $113.89
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: rbserver
Also found by: 0x1f8b, 0xAgro, 0xGusMcCrae, 0xSmartContract, Awesome, Breeje, DadeKuma, Diana, IllIllI, Josiah, Moksha, RaymondFam, Rolezn, SaeedAlipoor01988, Udsen, Viktor_Cortess, brgltd, btk, chaduke, cryptonue, ddimitrov22, delfin454000, descharre, fatherOfBlocks, georgits, hansfriese, lukris02, luxartvinsec, martin, matrix_0wl, mookimgo, oberon, popular00, shark, tnevler
65.3481 USDC - $65.35
packages/v2-library/src/Math.sol
packages/v2-library/src/Ownership.sol
L22/30/38 - The three functions have the functionality of modifying the behavior of a function, therefore the correct thing would be for them to be modifiers.
packages/v2-library/src/StrikeConversion.sol
L16/17 - The first variable that is used is zeroToOne, therefore it should be the input that is passed first, this is intuitive. Then amount, strike and roundUp.
L26/27 - The first variable that is used is strike, therefore it should be the input that is passed first, this is intuitive. Then toOne, amount and roundUp.
L35/36 - The first variable that is used is strike, therefore it should be the input that is passed first, this is intuitive. Then amount0, amount1 and roundUp.
L46/48/49/50 - The first variable that is used is strike, therefore it should be the input that is passed first, this is intuitive. Then zeroToOne, base, amount and roundUp.
packages/v2-pool/src/TimeswapV2Pool.sol
L21 - ITimeswapV2PoolBurnCallback is imported, but it is never used, so it should be removed.
L32 - TimeswapV2PoolMintChoiceCallbackParam, TimeswapV2PoolBurnChoiceCallbackParam, TimeswapV2PoolDeleverageChoiceCallbackParam and TimeswapV2PoolLeverageChoiceCallbackParam are imported, but they are never used, so they should be removed.
L34 - TransactionLibrary is imported, but it is never used, so it should be removed.
L231 - The first variable that is used is long0Amount, therefore it should be the input that is passed first, this is intuitive. Then strike, maturity, long0To, long1To, shortTo, long1Amount and shortAmount.
L252/254/255 - The first variable that is used is param, therefore it should be the input that is passed first, this is intuitive. Then durationForward and isQuote.
packages/v2-pool/src/structs/Pool.sol
L8 - ITimeswapV2Option is imported, but it is never used, so it should be removed.
L27 - TimeswapV2PoolCollectParam is imported, but it is never used, so it should be removed.
packages/v2-pool/src/libraries/ConstantProduct.sol
packages/v2-pool/src/libraries/ConstantSum.sol
packages/v2-pool/src/libraries/DurationCalculation.sol
packages/v2-token/src/TimeswapV2Token.sol
packages/v2-option/src/structs/Option.sol
packages/v2-option/src/TimeswapV2Option.sol
#0 - c4-judge
2023-02-01T23:45:39Z
Picodes marked the issue as grade-b
🌟 Selected for report: 0xSmartContract
Also found by: 0x1f8b, 0xackermann, Aymen0909, Beepidibop, IllIllI, Iurii3, Rageur, RaymondFam, ReyAdmirado, Rolezn, SaeedAlipoor01988, Udsen, Viktor_Cortess, W0RR1O, W_Max, atharvasama, c3phas, chaduke, descharre, fatherOfBlocks, kaden, matrix_0wl, shark
48.5424 USDC - $48.54
packages/v2-pool/src/TimeswapV2Pool.sol
packages/v2-pool/src/structs/Pool.sol
packages/v2-pool/src/libraries/ConstantProduct.sol
packages/v2-token/src/TimeswapV2LiquidityToken.sol
packages/v2-token/src/TimeswapV2Token.sol
L61/62/81/87/259/268 - A variable is created in memory, but it is only used once, therefore the variable should be removed and the operation used directly where it is needed.
L109 - REQUIRE()/REVERT() STRINGS LONGER THAN 32 BYTES COST EXTRA GAS
packages/v2-option/src/TimeswapV2Option.sol
#0 - c4-judge
2023-02-02T12:15:31Z
Picodes marked the issue as grade-b