This repo contains a POC of a hack that took place on Ethereum Block 14602790, where the hacker ran away with around $84M in ETH. You can find more details in the links below.
You will need to install foundry to run the exploit. Link for installtion foundry.
- Clone the repo
git clone https://github.com/abdulsamijay/Beanstalk-Exploit-POC.git
- Build the example to install all packages
forge build
- Run the test
forge test -vv --fork-url <YOUR_API_PROVER> --fork-block-number 14602789
This will help you understand the basics of how to setup the flashloans in smart contracts, how AMMs work briefly & mitigation.