Skip to content

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.

Notifications You must be signed in to change notification settings

Jonathan5122827/Ethereum_Smart_Contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏗 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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published