project screenshot 1
project screenshot 2
project screenshot 3

Uniflash

Testing the uniswap flashloans. Deployed the flashloan contract with hardhat and tested with main net ethereum fork with hardhat

Uniflash

Created At

UniCode

Winner of

Skynet Pool Prize

Project Description

UniFlash flashloan example

It borrows from Uniswap DAI/USDC 0.05% pool fee Swaps 1500 DAI for 55.66 UNI on Kyber Swap 55.66 UNI for 1505.61 DAI on Uniswap Payback 4.86 DAI (profit) to deployer and give back 1500 DAI + 0.05% fee to Uniswap. Deployed the flashloan contract with hardhat and tested with main net ethereum fork with hardhat. Added homescreen button for skynet and github action deploy-to-skynet

How it's Made

It's made with solidity, javascript (and typescript), alchemy, hardhat. This repo only works with hardhat mainnet fork. With hardhat, you can run your smart contracts on mainnet fork. For more: Harhdat Docs

Setup Environment Variables

You’ll need an ALCHEMY_MAINNET_RPC_URL environment variable. You can get one from Alchemy website for free.

Then, you can create a .env file with the following.

ALCHEMY_MAINNET_RPC_URL='<your-own-alchemy-mainnet-rpc-url>'

  1. Install Dependencies

Run the following command.

yarn install

  1. Compile Smart Contracts

Run the following command.

yarn compile

  1. Execute Flash Swaps on Mainnet Fork 🔥

Run the following command, and it will run scripts/flashswaps.ts script.

yarn flashswaps

background image mobile

Join the mailing list

Get the latest news and updates