QuickSwap and StellaSwap contest - 8olidity'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: 12/113

Findings: 1

Award: $593.27

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: berndartmueller

Also found by: 0xbepresent, 8olidity, tonisives

Labels

bug
duplicate
2 (Med Risk)

Awards

593.2734 USDC - $593.27

External Links

Lines of code

https://github.com/code-423n4/2022-09-quickswap/blob/main/src/core/contracts/AlgebraFactory.sol#L91

Vulnerability details

Impact

Improper vaultAddress Settings can cause financial damage

Proof of Concept

// src/core/contracts/AlgebraFactory.sol function setVaultAddress(address _vaultAddress) external override onlyOwner { require(vaultAddress != _vaultAddress); emit VaultAddress(_vaultAddress); vaultAddress = _vaultAddress; }

In the pool, _payCommunityFee() is called to transfer the processing fee to the Vault address.

if (communityFee > 0) { _payCommunityFee(zeroToOne ? token0 : token1, communityFee); }

If Vault is 0 address, then communityFee will be lost

If vault is the address of token0 or token1, then balanceToken0(),balanceToken1() in the pool will be affected.

function _payCommunityFee(address token, uint256 amount) private { address vault = IAlgebraFactory(factory).vaultAddress(); TransferHelper.safeTransfer(token, vault, amount); }

Tools Used

vscode

check vault address

#0 - IliaAzhel

2022-10-04T13:41:29Z

duplicate of #210

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