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: 46/59
Findings: 1
Award: $65.35
🌟 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
There’s a standard sanity check to maintain a unique optionPair
in the pools. However, for every true case of sanity check the error reason would be zeroAddress
which is misleading and should be changed to something like pair already exist.
Affected Line https://github.com/code-423n4/2023-01-timeswap/blob/main/packages/v2-pool/src/TimeswapV2PoolFactory.sol#L63
The override keyword can be omitted since the project uses solidity version 0.8.8. See ref https://github.com/ethereum/solidity/blob/v0.8.8/Changelog.md Also, use the latest version of solidity
There is a named return variable poolPair
in specification see line (https://github.com/code-423n4/2023-01-timeswap/blob/ef4c84fb8535aad8abd6b67cc45d994337ec4514/packages/v2-pool/src/interfaces/ITimeswapV2PoolFactory.sol#L41) and while implementing TimeswapV2PoolFactory.sol (https://github.com/code-423n4/2023-01-timeswap/blob/ef4c84fb8535aad8abd6b67cc45d994337ec4514/packages/v2-pool/src/TimeswapV2PoolFactory.sol#L59) has pair
instead of poolPair
. Furthermore, a similar kind of inconsistency is also with the get() function of the same file (https://github.com/code-423n4/2023-01-timeswap/blob/ef4c84fb8535aad8abd6b67cc45d994337ec4514/packages/v2-pool/src/interfaces/ITimeswapV2PoolFactory.sol#L29). Similarly, there is a small typo @return/@param
in the documentation see (https://github.com/code-423n4/2023-01-timeswap/blob/ef4c84fb8535aad8abd6b67cc45d994337ec4514/packages/v2-pool/src/interfaces/ITimeswapV2PoolFactory.sol#L40)of ITimeswapV2PoolFactory.sol.
It’s generally a good practice to use curly braces for if/else blocks. It significantly increases code readability and potentially lowers the possibility of bugs. Like popular goto fail bug(outside this project context)
#0 - c4-judge
2023-02-01T23:48:40Z
Picodes marked the issue as grade-b