Skip to content
Business logic Audit finding Intermediate

Staking contract is not able to support native USDB/WETH

The staking contract tracks rewards with internal accounting, so rebasing tokens such as USDB and WETH that accrue yield automatically cannot have that yield claimed. Any yield generated by these tokens as reward tokens would be lost.

yixxas Follow

Originally disclosed on Code4rena

Submitted by yixxas

Loss of yield if USDB/WETH is used as reward token.

Proof of Concept

From what I understood from the protocol team, they want to support any ERC20 tokens that are considered safe/well known. I believe USDB/WETH falls into this category.

Both USDB and WETH yield mode are AUTOMATIC by default. LockingMultiRewards.sol uses internal accounting to track all rewards that are accrued for users. For instance, when users stake amount, stakingTokenBalance will increase by amount and user’s balance will increase by amount accordingly. Rewards that are distributed to users are based on these internal accounting values.

The issue here is that,

  1. If USDB/WETH tokens are used as reward tokens, the accrued yield due to automatic rebasing are lost as they cannot be claimed.
  2. If protocol team has not used such tokens as reward tokens yet and becomes aware of this, then it means that they will not be able to use these tokens as reward tokens.

Recommended Mitigation Steps

Add the ability to set native RebasingERC20 token to CLAIMABLE and implement a way to claim the yields to the staking contract.

0xCalibur (Abracadabra) confirmed and commented:

It’s fixed here:

https://github.com/Abracadabra-money/abracadabra-money-contracts/blob/main/src/blast/BlastLockingMultiRewards.sol


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

Root cause

Likely the contract relies on internal accounting of reward balances instead of reading actual token balances, so automatic rebasing increases are not captured.

What the attacker needed

USDB or WETH used as a reward token

The fix

The team says it was fixed by adding the ability to set native rebasing tokens to a claimable mode and claim the yield to the staking contract.

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.

Some tokens automatically increase everyone's balance over time, a bit like interest being added to a savings account. This staking contract keeps its own record of how many tokens each person has, so it never notices those automatic increases. As a result, the extra tokens that appear cannot be handed out as rewards and are effectively stuck.

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 yixxas

View all

13 more disclosed reports, best first.

More from Abracadabra Mimswap

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.