Agave Hack

TOTAL LOST $5.5M
Medium Flashloan Reentrancy Attack / Other gnosis chain

Summarize with AI

Affected Chain gnosis chain Incident surface
Recovered - No recovery reported
All-Time Rank #416 By amount stolen
Protocol Type Lending Target category

Incident Overview

The attacker's address:

https://blockscout.com/xdai/mainnet/address/0xD041Ad9a…79E358/transactions

The attacks were made possible due to the xDAI token's architecture, which includes the function callAfterTransfer(), which creates a reentrancy vulnerability.

Using flash loans as collateral, the attacker(s) layered multiple borrow functions within one another, increasing the amount borrowed before the protocol could update the debt balance. Repeating this approach resulted in borrowing assets that were significantly more valuable than the collateral provided.

Stolen funds were bridged to Ethereum and deposited into Tornado Cash mixer:

https://etherscan.io/txs?a=0xd041ad9a…79e358

Incident Report

Protocol / Project Agave
Date of Incident
Affected Chain(s) gnosis chain
Attack Technique Flashloan Reentrancy Attack / Other
Classification Ecosystem / Borrowing and Lending
Primary Source View Post-Mortem

Protocol Information

Protocol Type Lending
Affected Token AGVE
Smart Contract Language Solidity
Official Website agave.finance/
Protocol Twitter/X @Agave_lending
Team Anonymous
Source Code Unverified

Market Context at Time of Hack

Token Categories
DeFi Lending & Borrowing Arbitrum Ecosystem Gnosis Chain 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 / other and Solidity and EVM internals
Capital Required Seed capital to cover gas and initial position setup
On-Chain Access Ability to interact with gnosis chain smart contracts and deploy a custom exploit contract
Protocol Analysis Identification of the exploitable vulnerability in Agave's contract logic - root cause: ecosystem / borrowing and lending
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 / Other vulnerabilities in code review

If you're auditing a protocol with similar architecture to Agave, these are the critical security checks that could have prevented this incident (March 2022).

  • Verify all logic paths related to Flashloan Reentrancy Attack / Other 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

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

Sources & References

Learn to Prevent the Next Agave

The Agave 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