Skip to content

Code4rena

QuickSwap and StellaSwap contest

Every publicly disclosed report for QuickSwap and StellaSwap contest and what kind of bugs they were.

disclosed reports
13
most reported class
Business logic
bug classes found
3
first disclosure
2023
Find QuickSwap and StellaSwap contest on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what QuickSwap and StellaSwap contest chose to make public.

Business logic

Incompatibility with Rebasing/Deflationary/Inflationary tokens

The Algebra protocol does not support rebasing, deflationary, or inflationary tokens because it does not verify the actual token balance change during transfers. An attacker could exploit this to cause accounting errors or steal funds when such tokens are used.

QuickSwap and StellaSwap contest

Medium
Business logic

It is possible that, after swapping, extra input token amount is transferred from user to pool but pool does not give user output token amount that corresponds to the extra input token amount

The swap function only checks that the pool's balance increased by at least the required input amount, so a caller can send extra input tokens without receiving corresponding output tokens. An attacker could exploit this to cause users to lose funds if they interact with a malicious or buggy contract.

QuickSwap and StellaSwap contest

Medium
Audit finding

exp() function is not accurate when x/g is not small

The exp() function in AdaptiveFee.sol uses a Taylor series that is inaccurate when x/g is large, causing errors up to 15% in exp() and 18% in sigmoid(), which affects fee calculation. The calculation also consumes significant gas due to computing up to the 8th term.

QuickSwap and StellaSwap contest

Medium
Business logic

safeTransfer function does not check for existence of ERC20 token contract

The safeTransfer function in TransferHelper.sol uses a low-level call to transfer tokens without first checking that the token contract exists. An attacker could create a pair with a token that can be self-destructed, and after destruction, deposits into the pool would be lost because the transfer call would still succeed.

QuickSwap and StellaSwap contest

Medium
DoS

Swapping can be impaired when activeIncentive is set

Swapping in AlgebraPool fails if external calls to the active incentive contract (AlgebraVirtualPool) revert. An attacker could not directly exploit this, but a misconfiguration or bug in the incentive contract would block all swaps until it is fixed or the incentive is unset.

QuickSwap and StellaSwap contest

Medium
Business logic

Flashloan users can be forced to pay higher fees than expected

The flashloan fee in AlgebraPool is set by the first swap in each block, so a swap before a flashloan can change the fee. An attacker could frontrun a flashloan with a swap to force the borrower to pay a higher fee.

QuickSwap and StellaSwap contest

Medium
Business logic

Biased estimator for volatility used

The volatility estimator used in the smart contract is biased and underestimates volatility for finite sample sizes. This leads to lower fees than intended, which harms users.

QuickSwap and StellaSwap contest

Medium
Race condition

A “FrontRunning attack” can be made to the initialize function

The initialize function of a new liquidity pool can be front-run by a bot that sees the pending transaction and calls initialize first with a different initial price. This lets the attacker set the pool's starting price, potentially causing the original creator to deposit at an unfavourable price.

QuickSwap and StellaSwap contest

Medium