Skip to content
Business logic Audit finding Intermediate

Users of Migration.sol may forfeit rebase rewards

The migration function calls instantUnstake with the rebase flag set to false, so any pending rebase is skipped. A user migrating funds at that moment would forfeit the rewards from that pending rebase.

0x52 Follow

Originally disclosed on Code4rena

Submitted by 0x52, also found by berndartmueller

Users of moveFundsToUpgradedContract() in migration.sol may forfeit rebase rewards.

Proof of Concept

L54 calls instantUnstake(false) meaning that it skips the optional rebase. If there is a pending rebase then the user calling the function will not get this rebase and miss out on potential rewards.

Recommended Mitigation Steps

Add an input bool \_trigger then add the following code to the start of the function:

if (_trigger) { rebase(); }

This allows users to optionally call rebase if they are concerned about losing pending rebase rewards.

0xean (Yieldy) acknowledged


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

A user calling the migration function while a rebase is pending could miss out on the rewards from that rebase.

What the attacker needed

Pending rebase at time of call; user calls moveFundsToUpgradedContract()

The fix

The function should accept a flag and call rebase() at the start when the caller wants to capture pending rewards before migrating.

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 rebase is a periodic adjustment that credits rewards to holders. The migration function unstakes funds without first applying a pending rebase, so the user loses those rewards. The report suggests letting the caller choose to trigger the rebase first.

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 0x52

View all

211 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.