# if Slash Validator occurs, UNSTAKING_QUEUE's unstake amount will not be accurate

Andromeda validator-staking records unstake amount from initial_balance; after a validator slash, actual balance is lower, causing withdraw_fund to fail and block the queue.

- Payout: Contest reward
- Severity: medium
- Program: Andromeda Ado
- Credited: J4X_
- Disclosed: 2024-05-14
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-05-andromeda-ado-judging/issues/44
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-05-andromeda-ado%3AM-7
- Tags: domain:web3 impact:dos kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:business-logic

**Target:** Cosmos SDK validator staking contract (andromeda-validator-staking)
**Root cause:** UNSTAKING_QUEUE stores UnbondingDelegationEntry.initial_balance instead of the actual balance after slashing, so the recorded amount exceeds the funds received.
**Steps:**
1. Call `execute_unstake(100)`; contract pushes 100 to UNSTAKING_QUEUE based on initial_balance.
2. Validator is slashed; Cosmos SDK reduces UnbondingDelegationEntry.balance below initial_balance.
3. After unbonding, contract receives less than 100.
4. Call `execute_withdraw_fund()`; it pops 100 from queue and attempts to transfer 100, failing due to insufficient balance.
**How found:** Code review of the unstaking queue logic and comparison with Cosmos SDK slashing behavior, noting that initial_balance and balance diverge after a slash.
**Exploitation:** A validator slash reduces the actual unbonded amount; the contract's queue still expects the original amount, causing withdrawal to revert and blocking subsequent queue entries.
**Insight:** When integrating with Cosmos SDK unbonding, use the actual balance field rather than initial_balance for accounting, because slashing can reduce the received amount.
