This PoC is heavily inspired on Hephyrius.eth's article written on Immunefi's blog.
The Hundred Finance protocol is a Compound fork that was also deployed on Gnosis Chain. Due to Gnosis's Omnibridge functionality, all bridged ERC20s are ERC677 - an extension to ERC20 that adds a callback to the transfer
method. Because of that, the borrow
function on the CToken
will allow for a reentrance into the protocol, to allow borrowing on another market with the same collateral and no registered debt.
This PoC uses UniswapV2 contracts (Sushiswap flashloan), Compound contracts (Hundred Finance) and the CurveFinance protocol (curve 3 pool swap).
forge test --fork-url FORK_URL --fork-block-number 21120000
You can create a Gnosis Chain endpoint in Quicknode and have access to archival node states.