Instrumenting Transaction Trace Properties in Smart Contracts: �Extending EVM for Real-Time Security
Zhiyang Chen, Zircuit & University of Toronto
Jan Gorzny, Zircuit
Martin Derka, Zircuit
{jeff, jan, martin}@zircuit.com�
March, 2025. SANER IWBOSE 2025
Growing DeFi
2
But also growing security incidents
3
Security incidents in 2025 (Until 22 Feb, 2025)
Name | Date | Classification | Technique | Amount lost | Language |
Bybit | 21 Feb, 2025 | Protocol Logic | Safe Multisig wallet Phishing | $1.4b | Solidity |
Cardex | 18 Feb, 2025 | Infrastructure | Private Key Compromise | $0.4m | Solidity |
Four.Meme | 11 Feb, 2025 | Protocol Logic | Liquidity Pool Exploit | $0.183m | Solidity |
zkLend | 11 Feb, 2025 | Protocol Logic | Empty Market Exploit | $9.55m | Cairo |
Ionic Protocol | 4 Feb, 2025 | Protocol Logic | Fake Collateral Exploit | $4m | Solidity |
DogWifiTools | 28 Jan, 2025 | Infrastructure | Private Key Compromise | $10m | Move |
However, detection is so successful
Almost all hacks detected
Almost zero false positives
Detection metrics are even open-sourced
Idle finance: https://app.forta.network/agents/idle�
i. Deposit or redeem with flashloan
ii. Detect if the tokenPrice of any IDLE token has decreased �
iii. Large change in TVL �
iv. Big deposit or redeem
Detection is so successful!
Protection is so unsuccessful!
Detection is so successful!
Protection is so unsuccessful!
Why DeFi protocol cannot instrument these detection metrics directly in their protocol to stop hack transactions on the fly?
Challenges:
2. High Gas Fee
Example: dForce attack
Curve.Fi gets re-entered, but dForce is the victim.
Which detection metrics may have worked?
i. Re-entrancy Detection
ii. Flashloan Detection�
iii. Large change in TVL
Yes!
Yes!
Yes!
Can they be used to stop the hack?
i. Re-entrancy Detection
ii. Flashloan Detection�
iii. Large change in TVL �
No. EVM Limitations
No. EVM Limitations
Yes. With high gas cost.
Solution: Allow Defining Properties Over Trace
Solution: Logic to All History States
Initial world state (Genesis)
Hook
A logic that can define properties over all past state transitions (transactions)
Solution: Past-time Linear Temporal Logic(PLTL)
X: next
U: until
S: since
X^{-1}: previously
Solution: Expressiveness of PLTL
We systematically collected 188 Forta attack detectors.
Other Ongoing Works
Their Whitepaper:
https://github.com/phylaxsystems/credible-layer-whitepaper/blob/main/ajax_0.1.pdf
The Phylax Credible Layer https://phylax.systems/
Assertion Enforcement
Assertions are enforced at the sequencer level, meaning they can’t be bypassed.
Write in assertions in Solidity with no code changes, redeployment, or downtime for your protocol when signing up. Also: no false positives as you only prevent states you define.
Conclusions