GithubHelp home page GithubHelp logo

alphadataomega / poly-flash Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yuichiroaoki/poly-flash

0.0 0.0 0.0 2.28 MB

Flashloan on Polygon

Home Page: https://yuichiroaoki.medium.com/no-flashloan-fee-with-dodo-cc78215d7f93

License: MIT License

Shell 0.18% Solidity 35.95% TypeScript 63.87%

poly-flash's Introduction

Poly-Flash

test

An open source flashloan smart contract on polygon network

Installation

1. Install Node.js & yarn, if you haven't already.

2. Clone This Repo

Run the following command.

git clone https://github.com/yuichiroaoki/poly-flash.git
cd poly-flash

Quickstart

1. Setup Environment Variables

You'll need an ALCHEMY_POLYGON_RPC_URL environment variable. You can get one from Alchemy website for free.

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

ALCHEMY_POLYGON_RPC_URL='<your-own-alchemy-polygon-mainnet-rpc-url>'

Add your Private Key

If you want to execute flashloan on the polygon mainnet, you need to add your PRIVATE_KEY environment variable, with a private key from your wallet.

PRIVATE_KEY='your-PRIVATE_KEY'

*Note: If using metamask, you'll have to add a 0x to the start of your private key)

2. Install Dependencies

Run the following command.

yarn install

3. Compile Smart Contracts

Run the following command.

yarn compile

4. Test on Polygon Mainnet Fork ๐Ÿ”ฅ

Run the following command.

yarn test test/flashloan.test.ts

Deploy

Once you have successfully done the above quickstart and added your private key to .env file, you can deploy your smart contract with the following command:

yarn deploy --network polygon

It costs about 0.2 MATIC to deploy Flashloan contract.

Example Contract

https://polygonscan.com/address/0xb6c4448386c4ecf4e5eab057351f8a6a8a465a0d

poly-flash's People

Contributors

metanynja avatar yuichiroaoki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.