Exploring Flash Loan Vulnerabilities: Crafting Unique Exploits from Scratch

In this article, our focus shifts to comprehending a flash loan attack through the process of independently re-crafting its Proof of Concept (PoC) test case, employing the Foundry project [1]. We strongly advise perusing the preceding article before delving into the technical intricacies outlined here.

Prerequisite: Understanding Flash Loan Attacks Through a Practical Example

Note: LW and GGG are equivalent in this article!

Case Study

Screenshot from https://github.com/SunWeb3Sec/DeFiHackLabs#20230512-lw---flashloan-price-manipulation

We are trying to re-write the test case for LW — FlashLoan Price Manipulation attack without looking into the source code.

Step 1: Structure

In the DeFiHackLabs repository, create a new file under the name myexp (src/test/myexp.sol). Proceed by outlining the attack template’s structure within this newly created file.

Visit Now