QuickSwap and StellaSwap contest - fatherOfBlocks's results

A concentrated liquidity DEX with dynamic fees.

General Information

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

QuickSwap and StellaSwap

Findings Distribution

Researcher Performance

Rank: 43/113

Findings: 2

Award: $77.33

🌟 Selected for report: 0

🚀 Solo Findings: 0

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

  • 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.

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

  • 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.

libraries/TickTable

  • 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.

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

  • 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.

base/PoolState

  • 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.

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.

Algebra Factory

  • L43/60/62/63/78/85/92/109/110 - It is less expensive to use ifs and custom errors instead of requires.

AlgebraPoolDeployer

  • L22/27/37/38 - It is less expensive to use ifs and custom errors instead of requires.

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

  • L30/51 - It is less expensive to use ifs and custom errors instead of requires.

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;

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter