# Incorrect proportional reward splits when an operator has been slashed

StakingBase proportional reward split ignores slashed operator bonds, so a fully-slashed operator still earns an equal reward share, diluting active operators.

- Payout: Contest reward
- Severity: medium
- Program: Olas
- Credited: santipu_
- Disclosed: 2026-05-18
- Write-up quality: 6/10
- Original: https://code4rena.com/reports/2026-01-olas#m-08
- Library page: https://bugbountylibrary.com/r/c4%3A2026-01-olas%3AM-08
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:reward-distribution

**Target:** StakingBase.sol reward distribution (_getRewardReceiversAndAmounts)
**Root cause:** Proportional distribution divides reward equally by receiver count assuming equal bonds, never querying actual bond amounts, so slashed (reduced/zero) bonds are not reflected.
**Steps:**
1. Service has 3 agent instances (Bob, Alice, Charlie), each bonded 100 OLAS; service owner gets 25%, each operator 25%.
2. Bob's instance malfunctions and is fully slashed via ServiceRegistry::slash, bond reduced to zero.
3. StakingBase remains unaware of slashing; `_getRewardReceiversAndAmounts` computes `operatorReward = reward / (numInstances + 1)` equally.
4. Bob still receives 25% of rewards despite zero bond, diluting Alice and Charlie.
5. Only mitigation is unstake/restake, possibly blocked by minStakingDuration and forfeiting rewards.
**How found:** Code reading of the Proportional branch: comment 'Default setup implies that all bonds are equal' and equal division by receiver count revealed the assumption breaks after slashing.
**Exploitation:** A slashed operator passively continues collecting an equal reward share each distribution round without contributing stake, siphoning rewards from honest operators; no active attacker action beyond being slashed.
**Insight:** When reward math divides by receiver count, check whether the underlying weights (bonds/stake) can change independently of that count—slashing, withdrawals, or partial unstakes silently skew proportional splits.
