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: 58/59
Findings: 1
Award: $48.54
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 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
Comparison operations are match cheaper that loading. In case of wrong zero address or amount it will revert with less gas consumption.
Consider moving hasLiquidity check lower then zero checks: TimeswapV2Pool.sol#152
Consider moving hasInteracted check lower then zero checks: TimeswapV2Option.sol#97
While creating and getting the option pair there are two places with the checkCorrectFormat check that will revert transaction in case token0 < token1.
TimeswapV2OptionFactory.sol#L30 TimeswapV2OptionFactory.sol#L46
Consider using Uniswap v2 code in both instances to be sure that transaction wouldn't fail
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
There are two same NoDelegateCall.sol contracts. One in pool folder, another in options. Consider moving it to v2-library and use same for both parts of the product and thus save gas on deployments.
#0 - c4-judge
2023-02-02T12:30:36Z
Picodes marked the issue as grade-b