Grim Finance Hack

TOTAL LOST $40.0M
High #148 All-Time Flashloan Reentrancy Attack / Reentrancy fantom

Summarize with AI

Affected Chain fantom Incident surface
Recovered - No recovery reported
All-Time Rank #148 By amount stolen
Auditors 2 Prior security audits

Incident Overview

Grim Finance's GrimBoostVault was exploited due to a reentrancy bug, allowing the attacker to mint large amounts of GB tokens and withdraw more SPIRIT-LP tokens than they deposited.

The attacker initiated the exploit by taking a flash loan from the Balancer vault in WBTC and WFTM tokens. They then added liquidity on SpiritSwap and minted LP tokens. The attacker exploited a reentrancy bug in the depositor () function in GrimBoostVault, using a malicious contract as the token parameter.

This allowed them to mint a large amount of GB tokens and withdraw more SPIRIT-LP tokens than they deposited. The attacker then removed liquidity, gaining more XXX and YYY tokens, and repaid the flash loan. The stolen funds were then bridged to Polygon, BSC, and Ethereum.

The attacker's address:

https://ftmscan.com/address/0xdefc385d…5b206c

The transaction behind the attack:

https://ftmscan.com/tx/0x19315e5b…4a5dd6

Affected vault:

https://ftmscan.com/address/0x660184ce…4136bf#code

The attacker's addresses on other chains:

https://etherscan.io/address/0xdefc385d…5b206c

https://polygonscan.com/address/0xdefc385d…5b206c

https://bscscan.com/address/0xdefc385d…5b206c

Incident Report

Protocol / Project Grim Finance
Date of Incident
Affected Chain(s) fantom
Attack Technique Flashloan Reentrancy Attack / Reentrancy
Classification Ecosystem / Yield Aggregator
Primary Source View Post-Mortem

Protocol Information

Protocol Type Yield
Affected Token GRIM
Smart Contract Language Solidity
Official Website www.grim.finance/
Protocol Twitter/X @financegrim
Team Anonymous
Source Code Unverified

Market Context at Time of Hack

Token Categories
Ethereum Ecosystem Base Ecosystem

What the Attacker Needed to Succeed

Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.

Technical Knowledge Deep understanding of flashloan reentrancy attack / reentrancy and Solidity and EVM internals
Capital Required Seed capital to cover gas and initial position setup
On-Chain Access Ability to interact with fantom smart contracts and deploy a custom exploit contract
Protocol Analysis Identification of the exploitable vulnerability in Grim Finance's contract logic - root cause: ecosystem / yield aggregator
Execution Speed Precise transaction ordering and timing to exploit the vulnerability within a single atomic block
Obfuscation Plan A strategy to launder and move stolen funds - typically through mixers, cross-chain bridges, or decentralized DEX swaps to resist tracing

What Auditors Should Check

Could this have been caught in audit? Yes — skilled auditors routinely flag Flashloan Reentrancy Attack / Reentrancy vulnerabilities in code review
Audited by Audit Report 1, Audit Report 2 — still lost $40.0M. Prior audits don't guarantee safety, especially after post-audit code changes.

If you're auditing a protocol with similar architecture to Grim Finance, these are the critical security checks that could have prevented this incident (December 2021).

  • Verify all logic paths related to Flashloan Reentrancy Attack / Reentrancy are guarded by proper access controls and input validation - see the Flash Loans Attacks attack class for patterns
  • Check that all state-changing functions follow the Checks-Effects-Interactions (CEI) pattern to prevent reentrancy and logic ordering bugs
  • Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs

Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.

Free Trial

Security Audit History

Related Attack Classes

The technique used in this hack maps to these vulnerability classes in our security curriculum:

See all Flash Loans Attacks examples →

Proof-of-Concept Exploits

1 PoC available
poc-exploits - grim finance

Sources & References

Learn to Prevent the Next Grim Finance

The Grim Finance hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.

Recreate exploit patterns safely Free Trial