Giter VIP home page Giter VIP logo

linkswap-1's Introduction

LinkSwap

Local Development

The following assumes the use of node@>=10.

Install Dependencies

yarn

Compile Contracts

yarn compile / yarn c

Run Tests

yarn test / yarn t

or to skip contract recompiling: yarn quicktest / yarn qt

Contract Deployment Order

  1. yYFL
  2. LinkswapPriceOracle
  3. LinkswapFactory
  4. LinkswapRouter
  5. PairNamer
  6. YFLPurchaser

Contract Summaries

yYFL

  • Governance and staking contract.
  • YFL can be staked to participate in voting or make proposals (arbitrary code execution).
  • Anyone can execute a successful proposal.
  • Any tokens sent to this contract can be converted to YFL using convertTokensToYfl (anyone can call this function). All YFL is distributed proportionally to YFL stakers.

LinkswapPriceOracle

  • Provides USD pricing for ETH, LINK, and YFL.
  • Provides token amounts for ETH or LINK, given a USD amount.
  • Based on Uniswap's ExampleOracleSimple.
  • Used by LinkswapFactory for listing fee calculation and minimum listing lockup amount calculation.
  • Can be swapped out via a governance proposal later if necessary.

LinkswapFactory

  • Handles the creation of new pairs, and stores variables that apply to new and existing pairs.
  • All variables can be changed via a governance proposal.

LinkswapPair

  • Contract created via LinkswapFactory for each pair.
  • Based on UniswapV2Pair, with added functionality of timelocking liquidity and a circuit-breaker that prevents slippage of prices beyond a certain percent in either direction in a certain timeframe.
  • Fees are customizable per-pair via a governance proposal.

LinkswapRouter

  • Contract based on UniswapV2Router and used for convenience by front-end.
  • Has been modified to account for dynamic fees (set in LinkswapPair).
  • New function is createPairUsingETH.

YFLPurchaser

  • Contract that handles the conversion of non-YFL tokens to YFL, and then sends all tokens back to the yYFL governance contract.

linkswap-1's People

Contributors

arcsin2000x avatar

Watchers

James Cloos 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.