Skip to content
Business logic Audit finding Intermediate

No way to set CURVE_POOL approval after setting new curve pool address

The Staking contract allows the owner to change the CURVE_POOL address, but token approvals are only set in the constructor, so the new pool cannot spend tokens. All calls to exchange() on the new pool will fail.

0xDjango Follow

Originally disclosed on Code4rena

Submitted by 0xDjango, also found by BowTiedWardens, cccz, hansfriese, Metatron, shung, ych18, and zzzitron

Staking.setCurvePool() allows the owner to set a new CURVE_POOL address, however, there is no way to set token approvals to the new address. The only calls to token.approve() are found in the constructor. Therefore, there’s no true way to set a new curve pool. All calls to ICurvePool(CURVE_POOL).exchange() will fail.

Recommended Mitigation Steps

Set approvals for the new curve pool address in the same setCurvePool() function.

0xean (Yieldy) acknowledged


The original report as published on Code4rena, by 0xDjango. 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

After the owner sets a new curve pool, all calls to exchange() will fail, making the new pool unusable.

What the attacker needed

Owner calls setCurvePool()

The fix

Set approvals for the new curve pool address inside the setCurvePool() function.

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.

This is a smart contract bug. The contract lets the owner point to a new Curve pool, but it never gives that new pool permission to move the contract's tokens. Without that permission, any attempt to trade via the new pool will be rejected.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by 0xDjango

View all

23 more disclosed reports, best first.

More from Yieldy contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.