Skip to content
Business logic Audit finding Advanced

Claiming delegation rewards via the precompile can result in a loss of ZETA rewards due to state synchronization issues

When a ZEVM contract claims Cosmos delegation rewards via the precompile, the received ZETA rewards are not added to the EVM state database. This causes the EVM state to overwrite the Cosmos ZETA balance at commit, resulting in a loss of the claimed ZETA rewards.

berndartmueller Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-04-zetachain-cross-chain-judging/issues/316

This issue has been acknowledged by the team but won't be fixed at this time.

Found by

berndartmueller

Summary

When claiming Cosmos delegation rewards, both explicitly and implicitly, the ZETA rewards are not added to the EVM statedb of the caller contract. This leads to a loss of ZETA rewards when the EVM state is committed to the Cosmos state.

Root Cause

When withdrawing Cosmos delegation rewards via the claimRewards precompile method by calling c.distributionKeeper.WithdrawDelegationRewards(), ZETA rewards will be skipped from the ZRC20 unlocking process.

However, the received ZETA bank coins are not added to the EVM statedb, which is then out-of-sync with the Cosmos state. And as the EVM state is committed to the Cosmos state at the end of the EVM execution, it will overwrite the ZETA bank balance in the Cosmos state with the EVM state, resulting in a loss of ZETA reward coins.

This is similar to the mitigation in the Stake() precompile method that subtracts the staked ZETA coins from the EVM statedb to ensure that the EVM state is in sync with the Cosmos state and to prevent double-spending.

Internal Pre-conditions

N/A

External Pre-conditions

  • A ZEVM contract interacts with the staking precompile

Attack Path

N/A

Impact

The claimed ZETA bank coin rewards are lost.

PoC

  1. A ZEVM contract delegates ZETA coins to a validator
  2. After a while, when delegation rewards are accumulated, the contract
    • updates its storage variable (so that a state object is added to the EVM statedb). This leads to the ZETA balance at the time of the state change being cached.
    • calls the claimRewards precompile method.
  3. ZETA coin rewards are received in the Cosmos state
  4. The EVM execution finishes, and the EVM state is committed to the Cosmos state
  5. The EVM state overwrites the Cosmos ZETA bank balance of the contract with the previously cached balance
  6. ZETA rewards are lost

Mitigation

Similar to Evmos, explicitly add the claimed ZETA coin rewards to the withdraw address balance in the EVM statedb.

Similarly, this is also required for the stake and unstake precompile functions, as they will implicitly auto-withdraw delegation rewards.

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

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

The claimed ZETA bank coin rewards are lost.

What the attacker needed

A ZEVM contract interacts with the staking precompile

The fix

The issue was acknowledged but won't be fixed at this time; the recommended mitigation is to explicitly add the claimed ZETA coin rewards to the withdraw address balance in the EVM statedb, similar to Evmos.

How it was found

  1. A ZEVM contract delegates ZETA coins to a validator
  2. The contract updates its storage variable, caching its ZETA balance in the EVM statedb
  3. The contract calls the claimRewards precompile method
  4. ZETA coin rewards are received in the Cosmos state
  5. The EVM execution finishes and the EVM state is committed to the Cosmos state
  6. The EVM state overwrites the Cosmos ZETA bank balance with the cached balance, losing the rewards

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 on ZetaChain can earn rewards by delegating tokens. When it claims those rewards, the reward tokens are not properly recorded in the contract's balance on the EVM side. Later, when the EVM state is saved, it overwrites the correct balance with the old one, so the rewards disappear.

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 berndartmueller

View all

97 more disclosed reports, best first.

More from ZetaChain Cross-Chain

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.