For educational purposes, here's a contract that executes:
- A DAI/sUSD batch flashloan on Aave V2
- Uses DAI batch to short the smart contract security of Project X by buying up hack insurance from Cover Protocol
- Uses sUSD batch to 'interact' with Project X
- Repays the flash loan using gains from 'interacting' with Project X
- Now just sit back and wait for the insurance payout from Cover Protocol
- Then you can philanthropically return surplus 'interaction' funds back to Project X
- [optional] Ask Project X for grey hat bounty
Note:
- Any references to existing projects are for demonstration purposes only
- Probably more efficient if this is flashmint powered
- Don't try and run this in prod
An end to end atomic execution of this contract looks like this on kovan.