My Farm Pet Hack

TOTAL LOST $31K
Low Flash Loan Attack

Summarize with AI

Affected Chain 2021 Incident surface
Recovered - No recovery reported
All-Time Rank #1818 By amount stolen
Protocol Type Exploit/Flash Loan Attack Target category

Incident Overview

A flashloan attack was made on the My Farm Pet project with a profit of $31k gained by the attacker

My farm pet is a blockchain farming game, where anyone can buy and own virtual farms.

The attacker created a contract in which there was a flashloan function to perform arbitration on the marketplace between versions V2 and V3. The attacker used 340k $BUSD to exchange for 22k $MYFARMPET, of which 1k were used to buy 70k $ChickenFood on My Farm Pets Marketplace V2. The contract then exchanged 21k $MYFARMPET tokens for 337k$BUSD, thereby increasing the pool on PancakeSwap, and exchanged 70k $ChickenFood on the V3 market for 34k $BUSD. Then, when the deposit of 340k was repaid, the attacker received a net profit of 31k $BUSD.

Incident Report

Protocol / Project My Farm Pet
Date of Incident
Attack Technique Flash Loan Attack
Classification Gaming / Metaverse / Gaming / Metaverse / Gaming / Metaverse / Gaming / Metaverse / Gaming / Metaverse / Gaming / Metaverse / Gaming / Metaverse / Gaming / Metaverse / Gaming / Metaverse / Gaming / Metaverse / Gaming / Metaverse / Gaming / Metaverse / Gam
Primary Source View Post-Mortem

Protocol Information

Protocol Type Exploit/Flash Loan Attack
Affected Token MYFARMPET
Official Website www.myfarmpet.io/#
Protocol Twitter/X @Myfarmpet1
Team Public / Doxxed
Source Code Unverified

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 flash loan attack and Solidity and EVM internals
Capital Required Flash loan capital (borrowed atomically, zero upfront cost)
On-Chain Access Ability to interact with smart contracts and deploy a custom exploit contract
Protocol Analysis Identification of the exploitable vulnerability in My Farm Pet's contract logic - root cause: gaming / metaverse / gaming / metaverse / gaming / metaverse / gaming / metaverse / gaming / metaverse / gaming / metaverse / gaming / metaverse / gaming / metaverse / gaming / metaverse / gaming / metaverse / gaming / metaverse / gaming / metaverse / gam
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 Flash Loan Attack vulnerabilities in code review

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

  • Verify all logic paths related to Flash Loan Attack are guarded by proper access controls and input validation - see the Flash Loans Attacks attack class for patterns
  • 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 →

Sources & References

Learn to Prevent the Next My Farm Pet

The My Farm Pet 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