Platform: Code4rena
Start Date: 26/09/2022
Pot Size: $50,000 USDC
Total HM: 13
Participants: 113
Period: 5 days
Judge: 0xean
Total Solo HM: 6
Id: 166
League: ETH
Rank: 43/113
Findings: 2
Award: $77.33
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: 0xNazgul
Also found by: 0x1f8b, 0x52, 0xDecorativePineapple, 0xSmartContract, 0xmatt, Aeros, Aymen0909, Bnke0x0, Chom, CodingNameKiki, Deivitto, DimitarDimitrov, IllIllI, JC, Jeiwan, Lambda, Matin, Migue, Mukund, Ocean_Sky, Olivierdem, RaymondFam, RockingMiles, Rolezn, Ruhum, Satyam_Sharma, Shinchan, Tomo, Trabajo_de_mates, V_B, Waze, __141345__, a12jmx, ajtra, asutorufos, aysha, brgltd, bulej93, carrotsmuggler, catchup, cccz, chrisdior4, cryptonue, cryptphi, d3e4, defsec, delfin454000, durianSausage, erictee, fatherOfBlocks, gogo, kaden, karanctf, ladboy233, lukris02, mahdikarimi, martin, mics, natzuu, oyc_109, p_crypt0, pedr02b2, rbserver, reassor, rotcivegaf, rvierdiiev, sikorico, slowmoses, sorrynotsorry, tnevler, trustindistrust
53.3143 USDC - $53.31
AlgebraFactory
L2 - All the audited files use the pragma solidity =0.7.6; statement. This implies that an old solidity version is being used which may lead into hitting already fixed bugs.
L60/62/63/78/85/92 - When we use a require and throw an exception it is important to show a message, this is important because it makes the user better understand the reason why it is reverted.
L23/84 - The variable farmingAddress is created and a setter function is created, but it is not used at all. In the event that a contract inherits this contract and needs that variable, it should be created in that contract.
AlgebraPoolDeployer
L2 - All the audited files use the pragma solidity =0.7.6; statement. This implies that an old solidity version is being used which may lead into hitting already fixed bugs.
L22/27/37/38 - When we use a require and throw an exception it is important to show a message, this is important because it makes the user better understand the reason why it is reverted.
L36/38 - If the factory can only be set once, it is less expensive to set it directly in the constructor and not create a function to be used only once.
L21/26 - It is not necessary to create a modifier if it is only going to be used once.
DataStorageOperator
L2 - All the audited files use the pragma solidity =0.7.6; statement. This implies that an old solidity version is being used which may lead into hitting already fixed bugs.
L12 - The constants file is imported, but it is not used throughout the contract.
L43 - When we use a require and throw an exception it is important to show a message, this is important because it makes the user better understand the reason why it is reverted.
libraries/AdaptiveFee
L2 - All the audited files use the pragma solidity =0.7.6; statement. This implies that an old solidity version is being used which may lead into hitting already fixed bugs.
L4 - The constants file is imported, but it is not used throughout the contract.
libraries/Constant
libraries/DataStorage
L2 - All the audited files use the pragma solidity =0.7.6; statement. This implies that an old solidity version is being used which may lead into hitting already fixed bugs.
L4 - The FullMath file is imported, but it is not used in the entire contract.
L369 - When we use a require and throw an exception it is important to show a message, this is important because it makes the user better understand the reason why it is reverted.
libraries/PriceMovementMath.sol
L2 - All the audited files use the pragma solidity =0.7.6; statement. This implies that an old solidity version is being used which may lead into hitting already fixed bugs.
L52/53/70/71/87 - When we use a require and throw an exception it is important to show a message, this is important because it makes the user understand better the reason why it is reverted.
L10/11 - The LowGasSafeMath and SafeCast libraries are used but their libraries are not imported, this would not compile and would generate problems in the deploy.
libraries/TickManager
libraries/TickTable
libraries/TokenDeltaMath
L2 - All the audited files use the pragma solidity =0.7.6; statement. This implies that an old solidity version is being used which may lead into hitting already fixed bugs.
L30/51 - When we use a require and throw an exception it is important to show a message, this is important because it makes the user better understand the reason why it is reverted.
base/PoolImmutables
base/PoolState
AlgebraPool
L2 - All the audited files use the pragma solidity =0.7.6; statement. This implies that an old solidity version is being used which may lead into hitting already fixed bugs.
L25 - The IAlgebraPoolDeployer file is imported, but it is not used in the entire contract.
L55/122/134/229/953/960/968 - When we use a require and throw an exception it is important to show a message, this is important because it makes the user understand better the reason why it is reverted.
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0x5rings, 0xNazgul, 0xRoxas, 0xSmartContract, 0xbepresent, 0xmatt, Aeros, Amithuddar, Awesome, Aymen0909, B2, Bnke0x0, ChristianKuri, CodingNameKiki, Deivitto, Diraco, Fitraldys, HardlyCodeMan, JC, Mukund, Noah3o6, Olivierdem, RaymondFam, ReyAdmirado, RockingMiles, Rolezn, Ruhum, Saintcode_, Shinchan, SnowMan, TomJ, Tomio, Tomo, V_B, Waze, __141345__, ajtra, asutorufos, aysha, beardofginger, bobirichman, brgltd, bulej93, c3phas, ch0bu, cryptonue, defsec, delfin454000, dharma09, durianSausage, emrekocak, erictee, fatherOfBlocks, francoHacker, gianganhnguyen, gogo, imare, kaden, karanctf, ladboy233, lukris02, m_Rassska, martin, medikko, mics, natzuu, oyc_109, peiw, rbserver, ret2basic, rotcivegaf, saian, shark, slowmoses, tnevler, trustindistrust, zeesaw, zishansami
24.0179 USDC - $24.02
Algebra Factory
AlgebraPoolDeployer
DataStorageOperator
L27/43/45/46 - It is less expensive to use ifs and custom errors instead of requires.
L138/139 - It is less expensive to do uint256() != 0, than uint256() > 0;
libraries/DataStorage
L80 - It is less expensive to make uint() != 0, than uint256() > 0;
L51/52/119/165/172/179/184/228/301/307/335/400/411 - Instead of doing "a = b + 1;" or "a = a - 1;" or "x -= 1;" it is less expensive to do --a or a = ++b;
L307 - When we initialize a variable and we want to set its default value, it is not necessary to set it, since it has that value by default.
L294/295/296/297/307 - When we are going through an array in a for loop, it is less expensive to create a uint variable and store the length there and not be in each iteration consulting the length.
L238/369 - It is less expensive to use ifs and custom errors instead of requires.
libraries/PriceMovementMath.sol
L52/53/70/71/87 - It is less expensive to use ifs and custom errors instead of requires.
L52/53 - It is less expensive to make uint256() != 0, than uint256() > 0;
libraries/TokenDeltaMath
base/PoolState
L41 - It is less expensive to use ifs and custom errors instead of requires.
L15/42/44 - It is less expensive to use 0 and 1 of uint256 instead of bool with true and false.
AlgebraPool
L55/60/61/62/122/134/224/229/434/454/455/469/474/475/608/614/636/641/645/731/733/739/743/898/921 /935/953/960/968 - It is less expensive to use ifs and custom errors instead of requires.
L224/228/237/434/451/452/454/455/469/505/506/617/667/808/814/898/904/911/924/927/938/941 - Less expensive to do uint256 () != 0, which uint256() > 0;