# The state variable `BondToken.globalPool` is updated incorrectly via `Pool.startAuction()`

BondToken.increaseIndexedAssetPeriod records the stale globalPool.sharesPerToken instead of the new value, so coupon claims are computed with outdated shares after setSharesPerToken changes.

- Payout: Audit contest
- Severity: medium
- Program: Plaza Finance
- Found by: 0xmystery
- Disclosed: 2024-12-16
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-12-plaza-finance-judging/issues/972
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-12-plaza-finance%3AM-17
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error

**Target:** Pool.startAuction / BondToken.increaseIndexedAssetPeriod (Solidity smart contract)
**Root cause:** increaseIndexedAssetPeriod pushes a PoolAmount using the old globalPool.sharesPerToken rather than the newly passed sharesPerToken, so the period snapshot lags one update behind the pool's configured value.
**Steps:**
1. Governance calls `Pool.setSharesPerToken(newValue)` (allowed only when NotInAuction).
2. `Pool.startAuction()` calls `bondToken.increaseIndexedAssetPeriod(sharesPerToken)` with the new value.
3. Inside, `previousPoolAmounts.push` stores `globalPool.sharesPerToken` (the old value), then `globalPool.sharesPerToken = sharesPerToken`.
4. `getIndexedUserAmount` iterates `previousPoolAmounts[i].sharesPerToken`, using the stale value for the just-closed period.
5. Bondholders' claimable coupon amounts are computed with the outdated sharesPerToken.
**How found:** Code reading of the startAuction -> increaseIndexedAssetPeriod flow; noticed the pushed struct reads globalPool.sharesPerToken before it is overwritten, and cross-referenced setSharesPerToken allowing mid-life changes.
**Insight:** When a function both snapshots a state variable and then overwrites it, check whether the snapshot should use the incoming argument instead of the stored value; mutable config (setSharesPerToken) makes the ordering bug exploitable.

