Deploying Flash Loan Smart Contract
For testing purpose we always recommend using one of testnets.
1. Visit Remix - Ethereum IDE
Remix IDE is a powerful open source tool that helps you write Solidity contracts straight from the browser. It is written in JavaScript and supports both usage in the browser, in the browser but run locally and in a desktop version.
2. Create New Workspace and File
Start with a new workspace in Remix IDE, so that you do not clutter your existing work with UniLend Flashloan smart contract.
Click on New File and name it as MyUniLendFlashloan.sol (or anything preferred by you). Also copy the smart contract from previous section with your trading logic here.
3. Compile the smart contract
From the sidebar select the version 0.8.0+ in the solidity compiler and compile the code by clicking the Compile button.
4. Deploying smart contract
Select Injected Web 3 Ropsten under environment and the account in Metamask (or from any other wallet) is shown here under Account with balance ether as well.
5. Add balance to your newly deployed smart contract
Use your wallet to add balance of token equivalent or more than fee (0.05%) charged by UniLend protocol.
6. Call the flashloan function
Under the Deployed Contracts sidebar find the flashloanCall function and enter the _asset
(address of token with LP on UniLend) _amount
and execute transact.
Last updated