← Back to home

Uniflash

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

Screenshots

Uniflash screenshot 1
Uniflash screenshot 2
Uniflash screenshot 3

Problem Statement

UniFlash flashloan exampleIt 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

Solution

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 DocsSetup Environment VariablesYou’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>'Install DependenciesRun the following command.yarn installCompile Smart ContractsRun the following command.yarn compileExecute Flash Swaps on Mainnet Fork 🔥Run the following command, and it will run scripts/flashswaps.ts script.yarn flashswaps

Hackathon

UniCode

2024

Prizes

  • 🏆

    Skynet Pool Prize

Contributors