⚠️ Disclaimer: This repository is strictly for educational and research purposes. It contains Proof of Concept (PoC) implementations of historical blockchain hacks to help developers and auditors understand smart contract security. Unauthorized use of these techniques against live protocols is illegal. Use this information responsibly and at your own risk.
This repository contains proof of concept implementations of historical blockchain hacks. It uses Foundry for mainnet fork testing to simulate attacks in a real-world environment.
Ensure you have Foundry installed. If not, run:
curl -L https://foundry.paradigm.xyz | bash
foundryup- Clone the repository:
git clone https://github.com/yAudit/blockchain_hacks
cd blockchain_hacks- Install dependencies:
forge install- Configure RPC Endpoint:
Open
foundry.tomlin the root directory and add your Ethereum mainnet RPC URL (e.g., from Alchemy or Infura) under the[rpc_endpoints]section:
[rpc_endpoints]
mainnet = "https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY"| # | Project | Test File | Hacked Date |
|---|---|---|---|
| 1 | Balancer V2 | test/BalancerV2.t.sol |
November 03, 2025 |
Once your RPC is configured, you can run the exploit simulation:
# Run all tests
forge test
# Run the Balancer V2 exploit
forge test --match-path test/BalancerV2.t.sol
# Run with traces to see the step-by-step exploit logic
forge test --match-path test/BalancerV2.t.sol -vvvv