Skip to content
DoS Audit finding Intermediate

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.

Jeiwan Follow

Originally disclosed on Code4rena

Submitted by Jeiwan

In situations when calls to AlgebraVirtualPool fail, swapping would fail as well until the issues with AlgebraVirtualPool are resolved or activeIncentive is unset.

Proof of Concept

During swapping, external calls are made to a AlgebraVirtualPool contract when an activeIncentive address is set:

Either of these calls can fail, which will result in a failed swap. In the case when AlgebraVirtualPool fails consistently (due to a misconfiguration or a bug in the contract), swapping would be not possible until the issues in the AlgebraVirtualPool contract are resolved or until activeIncentive is unset.

Recommended Mitigation Steps

Short term, handle reverts in the external calls to AlgebraVirtualPool. Long term, consider using the pull pattern to synchronize changes: instead of pushing changes to AlgebraVirtualPool from AlgebraPool, pull necessary data from AlgebraPool by calling it from AlgebraVirtualPool when needed.

vladyan18 (QuickSwap & StellaSwap) acknowledged


The original report as published on Code4rena, by Jeiwan. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

Swapping could be impossible until the incentive contract is fixed or the active incentive is unset; no direct attacker gain is claimed.

What the attacker needed

ActiveIncentive is set; AlgebraVirtualPool call fails

The fix

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.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract for swapping tokens calls another contract to update incentives. If that other contract fails, the swap fails too. This means a problem in the incentive contract can stop all swaps.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by Jeiwan

View all

69 more disclosed reports, best first.

More from QuickSwap and StellaSwap contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.