# Account contract does not gracefully handle panics in called contracts

Kakarot's execute_starknet_call uses Cairo 0 call_contract which panics instead of returning failure, so any reverting DualVmToken call bricks the whole transaction at RPC level.

- Payout: Audit contest
- Severity: medium
- Program: Kakarot
- Found by: RadiantLabs
- Disclosed: 2024-12-10
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-09-kakarot-findings/issues/49
- Library page: https://bugbountylibrary.com/r/c4%3A2024-09-kakarot%3AM-07
- Tags: area:web3 domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:dos

**Target:** Cairo account_contract execute_starknet_call / DualVmToken precompile
**Root cause:** execute_starknet_call invokes the Cairo 0 call_contract syscall, which panics on target failure rather than returning a success flag, so reverts in called Starknet ERC-20s propagate as RPC-level reverts instead of graceful FALSE returns.
**Steps:**
1. Call DualVmToken.transfer() from an EVM contract with amount > balance
2. CairoLib routes to kakarot_precompiles.cairo then account_contract.cairo execute_starknet_call
3. call_contract syscall at L347 panics when OZ ERC-20 reverts on insufficient balance
4. Whole transaction reverts at RPC level; ExcessivelySafeCall cannot catch it
5. Repro: edit test_should_transfer in test_dual_vm_token.py to transfer balance_owner_before + amount
**How found:** Code review of execute_starknet_call: noticed the function declares a success return value for graceful failures but the actual call_contract syscall has no failure path, then mapped standard ERC-20 revert behaviors to RPC-level reverts.
**Exploitation:** Any contract calling DualVmToken with a reverting operation (over-transfer, zero-value transfer, paused token, blocklist) causes the entire transaction to revert at RPC level, bypassing EVM-side safe-call protections and bricking contracts that depend on the call succeeding.
**Insight:** When a wrapper exposes a success flag but delegates to a syscall/host call that panics on error, the flag is dead code — enumerate every standard revert path of the wrapped contract (OZ ERC-20 zero-value, over-transfer, pause, blocklist) and check whether EVM-side safe-call patterns can actually intercept them.

## Proof of concept (copied exactly from the original report)

**Edit test to over-transfer balance**

```
The RPC-level panic can be proved by simply editing the `test_should_transfer` in `test_dual_vm_token.py` end-to-end test to transfer `balance_owner_before + amount` instead of `amount` at [L110]
```

