# evm_hooks ignores some important errors

evm_hooks processEvents swallows errors and returns early, so later Turnstile Register/Assign events in a tx are never recorded, permanently locking contracts out of CSR fees.

- Payout: Contest reward
- Severity: medium
- Program: Canto
- Credited: hihen
- Disclosed: 2023-03-31
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-11-canto-findings/issues/55
- Library page: https://bugbountylibrary.com/r/c4%3A2022-11-canto%3AM-01
- Tags: domain:web3 impact:dos impact:integrity kind:contest platform:code4rena sev:medium tech:evm technique:source-review vuln:accounting-error vuln:business-logic

**Target:** Cosmos SDK EVM hooks (x/csr/keeper/evm_hooks.go) PostTxProcessing
**Root cause:** processEvents returns no error and returns early on the first RegisterEvent/UpdateEvent failure, so subsequent events in the same receipt are silently skipped while PostTxProcessing continues normally.
**Steps:**
1. Submit a tx emitting Turnstile events: Register C1/token1, Register C2/token2, Assign C3/token1.
2. Make the first RegisterEvent fail (e.g. register() with a recipient that doesn't exist yet).
3. processEvents logs the error and returns; C2 and C3 events are never processed into the csr store.
4. C1/C2/C3 are marked registered in Turnstile (evm store) but absent from csr store; onlyUnregistered reverts re-registration, so they can never receive CSR fees.
**How found:** Code reading of evm_hooks.go: noticed processEvents has no return value yet contains an error path that returns early, then traced RegisterEvent/UpdateEvent error conditions (nonexistent recipient, missing NFT) to show realistic triggers.
**Exploitation:** Attacker or unlucky user bundles a failing Register/Assign event first in a multi-event tx; all later events are dropped, permanently bricking those contracts'/NFTs' CSR fee eligibility since Turnstile state says registered but csr store has no record.
**Insight:** In Cosmos EVM hooks, per-event handlers that log-and-return on error silently drop the rest of a receipt's logs; check whether hook state (csr store) can diverge from EVM contract state (Turnstile) leaving records unrecoverable due to onlyUnregistered guards.
