Coder Social home page Coder Social logo

jonathan5122827 / ethereum_smart_contracts Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 597 KB

Allows Decentralized Autonomous Organizations (DAOs) to vote on which Diamond Contract Faucets to add. Implemented from combining components from the Scaffold Eth and Hardhat tech stacks.

Dockerfile 1.32% Shell 4.88% JavaScript 64.36% Solidity 27.83% HTML 1.00% CSS 0.08% TypeScript 0.53%
ethereum hardhat javascript react reactjs smart-contract smart-contracts solidity solidity-contracts

ethereum_smart_contracts's Introduction

๐Ÿ— scaffold-eth

is everything you need to get started building decentralized applications powered by smart contracts


quickstart

git clone https://github.com/austintgriffith/scaffold-eth.git

cd scaffold-eth
yarn install
yarn start

in a second terminal window:

cd scaffold-eth
yarn chain

in a third terminal window:

cd scaffold-eth
yarn deploy


You can interact with the initial version of the DeFi Facet which demonstrates 2x leverage through v1 Aave Uniswap Market.



A sample defi facet zap transaction on ropsten.

What is Diamond Standard ?

Basically it enables people to write contracts with virtually no size limit in a modular and gas-efficient way.

Diamonds can be upgraded on the fly without having to redeploy existing functionality.

Now in a real scenario a diamond has many faces known as facets so just like that facets here are contracts that you interact with, upgrade etc through the diamond contract.

Diamond Cut is a style guide used to shape diamonds just like that to add, remove, modify any facet. We have a Diamond Cut Facet used to do the same so you can upgrade facets without any hassle.

Before diving into the UI and contracts, I will recommend to go through the EIP to have a complete understanding of the same.

Facets

For demonstration purposes, the current Facet linked with the UI is a DeFi which uses Aave Uniswap Market to leverage 2x by just depositing ETH, and it can be upgraded by redeploying it again(go through deploy.js in detail) after changes and choosing the right upgrade action in UI.

The upgrades are done currently by directly calling the Diamond Cut Facet.

The leverage logic is as follows:

  1. swap half of eth to stable coin
  2. add liquidity to uniswap
  3. deposit a-uni tokens to aave
  4. safe borrow stable coin
  5. swap half of stable coin to eth
  6. add liquidity again to uniswap in same pool
  7. deposit a-uni token again to aave

Ethereum_Smart_Contracts

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.