GithubHelp home page GithubHelp logo

scaffold-eth / scaffold-eth-defi-challenges Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 8.0 11.35 MB

License: MIT License

Shell 0.24% JavaScript 26.60% Solidity 61.88% TypeScript 5.20% CSS 0.01% Makefile 0.06% Nix 0.01% Ruby 5.82% Python 0.18%

scaffold-eth-defi-challenges's Introduction

πŸ— Scaffold-ETH

🚨🚨 This repository has been archived and is now read-only 🚨🚨

You are still welcome to fork and use as a template but no more changes will be made to this repository.

πŸŽ– Scaffold-ETH 2 is the latest version, we recommend you fork: https://github.com/scaffold-eth/scaffold-eth-2


everything you need to build on Ethereum! πŸš€

πŸ§ͺ Quickly experiment with Solidity using a frontend that adapts to your smart contract:

image

πŸ„β€β™‚οΈ Quick Start

Prerequisites: Node (v18 LTS) plus Yarn (v1.x) and Git

🚨 If you are using a version < v18 you will need to remove openssl-legacy-provider from the start script in package.json

1️⃣ clone/fork πŸ— scaffold-eth:

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

2️⃣ install and start your πŸ‘·β€ Hardhat chain:

cd scaffold-eth
yarn install
yarn chain

3️⃣ in a second terminal window, start your πŸ“± frontend:

🚨 if your contracts are not deployed to localhost, you will need to update the default network in App.jsx to match your default network in hardhat-config.js.

cd scaffold-eth
yarn start

4️⃣ in a third terminal window, πŸ›° deploy your contract:

🚨 if you are not deploying to localhost, you will need to run yarn generate first and then fund the deployer account. To view account balances, run yarn account. You will also need to update hardhat-config.js with the correct default network.

cd scaffold-eth
yarn deploy

πŸ” Edit your smart contract YourContract.sol in packages/hardhat/contracts

πŸ“ Edit your frontend App.jsx in packages/react-app/src

πŸ’Ό Edit your deployment scripts in packages/hardhat/deploy

πŸ“± Open http://localhost:3000 to see the app

πŸš¨πŸ“‘ To deploy to a public domain, use yarn surge. You will need to have a surge account and have the surge CLI installed. There is also the option to deploy to IPFS using yarn ipfs and yarn s3 to deploy to an AWS bucket πŸͺ£ There are scripts in the packages/react-app/src/scripts folder to help with this.`

πŸ“š Documentation

Documentation, tutorials, challenges, and many more resources, visit: docs.scaffoldeth.io

🍦 Other Flavors

πŸ”­ Learning Solidity

πŸ“• Read the docs: https://docs.soliditylang.org

πŸ“š Go through each topic from solidity by example editing YourContract.sol in πŸ— scaffold-eth

πŸ“§ Learn the Solidity globals and units

πŸ›  Buidl

Check out all the active branches, open issues, and join/fund the 🏰 BuidlGuidl!

πŸ’Œ P.S.

🌍 You need an RPC key for testnets and production deployments, create an Alchemy account and replace the value of ALCHEMY_KEY = xxx in packages/react-app/src/constants.js with your new key.

πŸ“£ Make sure you update the InfuraID before you go to production. Huge thanks to Infura for our special account that fields 7m req/day!

πŸƒπŸ’¨ Speedrun Ethereum

Register as a builder here and start on some of the challenges and build a portfolio.

πŸ’¬ Support Chat

Join the telegram support chat πŸ’¬ or buidlguidl discord to ask questions and find others building with πŸ— scaffold-eth!


πŸ™ Please check out our Gitcoin grant too!

Automated with Gitpod

Open in Gitpod

scaffold-eth-defi-challenges's People

Contributors

mattpereira avatar solidoracle avatar steve0xp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scaffold-eth-defi-challenges's Issues

Failing CI due to SE-2 Import

As seen in PR #22 right now, the CI is failing as there is an open issue here that SE-2 devs are working to resolve. Once that is resolved, we need to just bring in any particular fixes for it into this repo. Steps include:

  • Bring in fixes via a PR to main
  • git pull fixes from main into other branches (challenges)

Yield Farming on Compound Challange

This post is primarily a survey rather than an actual issue. My objective is to devise a challenge that will enlighten everyone in the DeFi community on how to conduct yield farming using Solidity. Here's how I envision the course of this challenge:

  • Learning the architecture
  • This will be an extension of the Flash Loan Challange #18 section since we'll incorporate Flash loans
  • Integration with Compound
  • Procedures for opening and closing positions
  • Deployment and testing on the testnet

Update README.md for Challenge 1 - Yearn Simple Strategy

Challenge 1 - Yearn Simple Strategy

  • Add emojis and walk through cleaning up copy and format (first pass)
  • Add checklists for tutorials like past challenge write-ups
  • Possibly remove disclaimers and information about how this strategy was written up (or move them to main branch)
  • Final read through to ensure copy makes sense && back end challenge works as each steps outline
  • Move onto new issue of coordinating front-end and scaffold-eth v2 into this challenge

Integration with with uniswap

In my opinion, it's impossible to discuss DeFi without mentioning Uniswap. Creating a channel where future Ethereum developers can navigate and learn to integrate Uniswap into their contracts sounds like a fantastic idea. I believe we should opt for version 3, as Uniswap is already working on version 4. This is merely a suggestion to @solidoracle. If necessary, I'm more than willing to take the initiative in implementing this.

Todo

  • Contacts
  • Explian Uniswap Routing, UInswap Factory and ERC 20 Swapping
  • Testing
  • UI
  • Demo

Challenge 2: Transplant existing foundry project into Scaffold Eth 2

Overview

The challenge-2-sommelier-erc4626-adaptor branch currently contains only a foundry project. We want to transplant the code into Scaffold ETH 2

Items

  • Transfer all the contracts and interfaces from source
  • Figure out adding the cellar-contracts submodule to the packages/foundry/lib of scaffold eth
  • Carry over the REAMDE.md, remappings.txt, ect.
  • Make sure the tests run with forge test

Resources

ERC-4626 Challenge

I propose to create a challenge about the ERC-4626 standard. The goal would be for those who embark on the challenge to understand how the standard works. For example, differences between assets and shares, deposits, withdraws, borrow and redeem. And why this standard is so necessary.

FrontEnd - Figure out Mainnet Persistent Fork as a Testnet for DeFi Challenges

After some discussion, @solidoracle and I think we need to have a mainnet persistent fork as a testnet so students can use a UI and their contracts to simulate actual DeFi interactions.

ex.) challenge-1-simple-yearn-strategy's main lesson is to teach students how to implement a basic yearn strategy on yearn v2 vaults where DAI is lent out using Compound protocol. A testnet that is a fork of mainnet and persistent would allow a user to actually see yield accumulate from this lending strategy after so many blocks. The frontend UI idea we have is to simply showcase:

  • The vault and its total assets, APY for the last X period (if time), function calls for deposit and withdraw
  • The strategy and its total assets, APY for the last X period (if time), external function calls that are deemed relevant

TODO

  • Discuss w/ Austin and others about possible service providers that we can use for this
  • Implement into challenge-1 branch
  • Consider implementing into main branch

Bring in Scaffold-ETH v1 AND/OR v2 and Combine with Foundry Setup

Detail

There are challenges associated to bringing in foundry in combination with the hardhat default frameworks used with ScaffoldETH v1. It is assumed that this type of conflict will arise with ScaffoldETH v2 as well, but it is yet to be seen.

TODOs:

  • Incorporate Scaffold-ETH v2 into the mix
    • Deploy localhost, edit deployment scripts to make it work with yearn strategies (may have to pull reference from the deploy scripts used with foundry and convert them over to whatever format is used for ScaffoldETH and hardhat)
    • Troubleshoot until the yearn strategy solutions show up in the troubleshooting UI for localhost
    • Test with its function calls && come up with a good workflow to showcase how it works

Flashloans Challenge

I propose that we incorporate the concept of flash loans into the Scaffold-ETH-DeFi-Challenges. The primary objective of this challenge should encapsulate several key aspects, one of which includes an in-depth exploration of flash loans.

Here are the main concepts I believe our flash loans challenge should address:

  • Understanding what flash loans are
  • Discussing flash loan providers
  • Exploring the execution of flash loans
  • Examining ERC-3156: Flash Loans
  • Investigating FlashLoan Smart Contract
  • Performing tests on testnet
  • Discause Applications of flash loans

Collaborate and Coordinate with Yearn

The level of collaboration with Yearn needs to be better defined. At the moment they onboard potential strategists through their gated telegram chat YFI Boarding School.

Students going through the Scaffold-ETH yearn tutorial will likely be between beginner and intermediate smart contract levels. They may not be at the point of competence to handle jumping onto their own strategy just yet.

Currently, my take is that students would take any questions around this tutorial to the Scaffold-ETH / SRE TG chat for this tutorial. From there, if they can't get any answers then they would go ahead and ask in the Yearn general TG chat for now. If their questions are so heavily pointed and abstract enough, Yearn can add them to the YFI Boarding school TG chat.

The big thing here is that this tutorial (and future ones with other protocols) will increase the inflow of potential devs helping out with a respective protocol. This means more questions and more upkeep for said protocol though. Ideally we line up this inflow increase in an iterative manner with the respective protocol so as to not overwhelm them.

Fix Challenge 2 imports

Overview

We want to fix the imports for the Somm challenge so that the contracts compile and forge test works properly

Notes From Steve

warning: the way I went was trying to get the submodule of sommelier’s repo (PeggyJV/cellar-contracts) in and use those dependencies in the test. The problem there is that the submodule has its own remappings with overlapping / conflicting dependencies as the challenge repo itself (solmate for example).

Out of feat of how deep the dependencies could go I was really hoping just having the remapping point to the cellar-contracts submodule would work for the test file. If you can get that working cool, but I haven’t had much luck (albeit I did it at late evenings after work lol).

So the other option is to just bring in the necessary files you need from Sommelier’s repo and their submodules that they remap to for the tests to run. There are a lot of unecessary files or aspects within the TestStarter file or something (forget what it’s named)

Resources

Tasks

No tasks being tracked yet.

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.