Hunt prep
Before you test QuickSwap and StellaSwap contest
What 13 disclosed reports say about QuickSwap and StellaSwap contest: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing
Not written yet for this program. The numbers below are up to date.
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 10 | 0 | – | – | $0 |
| DoS lesson | 1 | 0 | – | – | $0 |
| Race condition lesson | 1 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
Undercounted liquidity leads to increased volumePerLiquidityInBlock and incorrect adaptive fee
The volume per liquidity should be calculated on the entire liquidity required for a swap, using the swap fee amount calculation as a reference.
Disclosed
-
Malicious users can provide liquidity on behalf of others to keep others in the liquidity cooldown
The mint function should only allow users to provide liquidity for themselves, or the liquidityCooldown should be set to zero.
Disclosed
-
Incompatibility with Rebasing/Deflationary/Inflationary tokens
The protocol should check the token balance before and after transfers to account for any rebasing, inflation, or deflation, and only accept such tokens after adding support.
Disclosed
-
Vault set to the zero-address will break swaps and flash loans in all deployed pools
The fix should either prevent setting the vault to the zero address in the factory, add a zero-address check in the pool functions, or use a pull pattern for fee collection.
Disclosed
-
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 should use an equality check (==) instead of <= to ensure the exact required input amount is received.
Disclosed
-
AlgebraPool: swapSupportingFeeOnInputTokens loses exact output functionality
Support for fee-on-transfer tokens should be added through user inputs (e.g., allowing high slippage) or a specialised router.
Disclosed
-
exp() function is not accurate when x/g is not small
The recommendation is to pre-calculate exp(1) through exp(6) as constants and use range reduction, then apply Taylor expansion only for small powers.
Disclosed
-
safeTransfer function does not check for existence of ERC20 token contract
The safeTransfer function should check that the token contract exists before performing the transfer.
Disclosed
-
Swapping can be impaired when activeIncentive is set
The report recommends handling reverts in the external calls and, long term, using a pull pattern so the incentive contract pulls data instead of the pool pushing updates.
Disclosed
-
Flashloan users can be forced to pay higher fees than expected
The report recommends either allowing the flashloan user to specify a maximum fee or using a flat fee for flashloans.
Disclosed
-
A “FrontRunning attack” can be made to the initialize function
The function should be restricted so only an authorised address can call it, or the price should be set in a separate step before initialization.
Disclosed