# The default Governor Anastasius is unable to call resetStakes

Governance's era check runs after execution, so resetStakes increments the era and reverts, making the emergency reset uncallable by the default Governor Anastasius.

- Payout: Audit contest
- Severity: medium
- Program: Reserve
- Found by: krikolkk
- Disclosed: 2024-10-03
- Write-up quality: 7/10
- Original: https://code4rena.com/reports/2024-07-reserve#m-03
- Library page: https://bugbountylibrary.com/r/c4%3A2024-07-reserve%3AM-03
- Tags: domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:access-control vuln:governance

**Target:** Governance/StRSR staking contracts (Solidity)
**Root cause:** Governance::_execute calls super._execute (which invokes resetStakes and increments the era) before checking startedInSameEra(proposalId), so the post-execution era check fails and reverts the whole transaction.
**Steps:**
1. Deploy Governance with TimelockController, grant proposer/executor/canceller roles to governor, transfer OWNER role to governor.
2. Make stake rate unsafe by transferring large RSR to StRSR and calling payoutRewards until exchangeRate >= 1e6.
3. Delegate votes, propose `resetStakes()` on StRSRP1Votes, vote, queue, advance past MIN_DELAY.
4. Call `governor.execute([stRSRVotes],[0],[resetStakes calldata],descHash)` — reverts with 'TimelockController: underlying transaction reverted' because era changed mid-execution.
**How found:** Noticed resetStakes increments the staking era, then read Governance::_execute ordering and hypothesized the startedInSameEra check would fail after execution; confirmed with a Foundry/Hardhat test.
**Insight:** When a governance guard checks state that the executed call itself mutates (like an era counter), verify check ordering relative to execution — post-execution invariant checks can brick the very emergency functions they guard.
