Post

Truster - Damn Vulnerable DeFi Writeup

Writeup for truster challenge from Damn Vulnerable DeFi

the flashLoan() implementation in TrusterLenderPool contract:

image.png

target is the address of the contract/borrower which the Trustedlenderpool contract lends tokens to. The functionCall() allows arbitrary external calls without any restrictions. we can make a malicious contract, where, we can make the pool contract approve our attaceker contract to spend the entire pool token balance.

image-1.png

We then use transferFrom() to transfer the approved tokens from the pool to the target address.

image-2.png

This post is licensed under CC BY 4.0 by the author.