This repo contains a POC of a hack that took place on Ethereum Block 14684685, where the hacker ran away with around $79M in different assests. 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/Rari-Capital-Exploit-POC.git
- Build the example to install all packages
forge build
- Run the test
forge test -vv --fork-url <YOUR_API_PROVIDER> --fork-block-number 14684684
This is an example of a classic re-entrancy attack. The main reason behind the infamous DAO hack was re-entrancy where the hacker repeatedly called withdraw() function before the balance was updated.