πŸ— forkable Ethereum dev stack focused on fast product iterations

  • By scaffold-eth
  • Last update: Dec 25, 2022
  • Comments: 15

πŸ— Scaffold-ETH

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 plus Yarn and Git

clone/fork πŸ— scaffold-eth:

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

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

cd scaffold-eth
yarn install
yarn chain

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

cd scaffold-eth
yarn start

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

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

πŸ“š Documentation

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

πŸ”­ 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 production deployments/Apps, create an Alchemy account and replace the value of ALCHEMY_KEY = xxx in packages/react-app/src/constants.js

Automated with Gitpod

Open in Gitpod****

πŸ’¬ Support Chat

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


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

Github

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

Comments(15)

  • 1

    Sensible defaults for RPC calls

    This PR aims to reduce the RPC calls made by scaffold-eth on a clean install (around 60/80 per minute) by providing some sensible defaults on polling times (vs onBlock) and reusing providers (if localProvider is mainnet).

    There are two new constants (with sensible defaults) that config this behavior: LOCAL_RPC_POLL_TIME and MAINNET_RPC_POLL_TIME.

    On the localhost (hardhat chain) the polling is disabled (uses onBlock) to keep allowing a fast feedback loop. (We don't care about RPC requests to the localnode)

    Great work @Naim-Bijapure & @technophile-04

  • 2

    "yarn mint" fails

    Describe the bug the last command as mentioned on github page, "Yarn mint" fails.

    To Reproduce Steps to reproduce the behavior:

    1. yarn mint

    Expected behavior should do usual mint code path

    Screenshots image

    Desktop (please complete the following information):

    • OS: windows 10
    • Browser [chrome]
    • Version [22]
  • 3

    Created typescript versions of the app and hardhat folder

    I've created a branch of scaffold eth based on master that runs on Typescript and vite and react.

    • The hardhat deployment/publish/ etc files are also in TS

    Notes:

    • i refactored most of the components to typescript
    • the views are also in typescript
    • it has the components from buidlGuidlv2 feature branch
    • currently, all the views open
    • since its based of vite instead of webpack, its much faster to load (vite runs on esbuild), it takes about 5 seconds from a cold start in my laptop

    Format:

    • There's 2 new package folders called hartdhat-ts and vite-app-ts that have the ts version
    • I didn't modify the react-app and hardhat folders

    Has the latest changes from the hardhat-deploy additionally.

  • 4

    Create Chainlink Starter Kit

    Would be great to have both the scaffold-eth and chainlink-starter-kit productivity boost in one and the same project.

    The Chainlink Starter Kit gets you going fast with VRF, API requests, PriceFeeds and Keeper Contracts. Mocks for unit tests are included

    Describe the solution you'd like Change the hardhat project in scaffold-eth in order to be used just like https://github.com/smartcontractkit/hardhat-starter-kit.

    Some work is needed with

    • dependencies (check for compatibility issues - chainlink uses some older beta-release packages but not documented why)
    • yarn scripts
    • possibly es-lint exceptions (chainlink code contains expressions like a == b in order to have "31337" == 31337 pass as true)
    • readme updates
  • 5

    Stuck in deploying "YourContract"

    Hi there,

    Thanks for creating such a great tool for Ethereum solidity/dapps learner.

    I think it is quite demotivating for any new user of the tool to hit few speed bumps just to "Quick Start".

    My environment: Ubuntu 20.04.4 LTS Node v16.14.0 Npm 8.3.1

    I run yarn deploy after yarn chain, the deploying "YourContract"... seems take forever.

    Then I went ahead to make a small amendment to YourContract.sol, then run yarn deploy again, it prompt me the following message:

    It used a gas pricing config of (gasPrice: 875000000 wei) ,
                  current gas price is 1768762328 wei
                  
                  
    ? Choose what to do with the pending transaction: … 
    β–Έ increase gas
      continue waiting
      skip (forget tx)
    

    I choose the iincrease gas option, the command is exit with the following error:

    nonce has already been used
    

    Please advice. Thank you.

  • 6

    Cannot find third part package in vscode

    ~~We have a workspace named "hardhat", but this is also the name a third-part library hardhat we are depending on. That makes IDE confused when it comes to code references..~~

    ~~For example~~ in VSCode: image

  • 7

    Add support for multiple node providers

    Right now Infura is hardcoded in some places where you can only change the API key. Ideally, we should do a bit of refactoring so the developer can easily change the node provider in constants.js.

  • 8

    Testing Challenge Branch

    There is not good documentation or a good tutorial/branch around testing. It would be very valuable to have a good challenge around testing in order to tech the common experienced with smart contracts.

  • 9

    "yarn graph-run-node" container failing to start on Apple M1

    Following Austin's tutorial at https://www.youtube.com/watch?v=T5ylzOTkn-Q&t=77s.

    At minute 7:06 (running yarn graph-run-node) I'm running into a problem where the graph-node_1 container isn't starting up successfully.

    image

    I'm running the Apple M1 Tech Preview of Docker, maybe that has something to do with it. Check the "Known issues" of here: https://docs.docker.com/docker-for-mac/apple-m1/

  • 10

    Adding Docker setup

    This PR adds a Docker alternative setup to spin up the stack inside a container.

    If it makes sense to have, I'll need guidance about where to add current docker/README.md content.

  • 11

    Issues with transaction nonce

    Describe the bug Nonce state on-chain is different from nonce kept in storage in react state

    Transaction Error Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"code":-32000,"message":"Nonce too high. Expected nonce to be 0 but got 1. Note that transactions can't be queued when automining."}}}'

    To Reproduce Steps to reproduce the behavior: Try any contract interaction after redeploying

    Expected behavior The contract should change as expected

  • 12

    feat: upgradeable contracts starter kit, complete with upgrade-safe c…

    Purpose:

    This PR introduces a new starter kit for upgradeable contracts using the OpenZeppelin Upgrades API (since there is no starter kits right now for this yet, it seems).

    Includes:

    • Upgrade-safe contract (UUPS)
    • Upgradeable contract deploy script
    • Updated readme instructions to get contracts deployed, ready for frontend
    • Script for upgrading function implementation

    Testing:

    • Contracts wise, trivial modifications were made to the original scaffold-eth contract
    • Otherwise, all upgrade-related items (deployment, upgrade script) was tested by following the readme instructions from start to finish on localhost

    Suggestion:

    • To include this inside a new branch of this repo, or the scaffold eth examples repo.
    • Feedback welcome, wondering if we should also do a Typescript version of this (wouldn't be too difficult)
  • 13

    insufficient funds for intrinsic transaction cost

    I switch network from local to Mumbai, but get this error when I enter yarn deploy

    PS C:\Users\nick_\VSCodeProjects\scaffold-eth> yarn deploy
    yarn run v1.22.19
    $ yarn workspace @scaffold-eth/hardhat deploy
    $ hardhat deploy --export-all ../react-app/src/contracts/hardhat_contracts.json
    Nothing to compile
    deploying "YourContract"insufficient funds for intrinsic transaction cost (error={"name":"ProviderError","_stack":"ProviderError: HttpProviderError\n    at HttpProvider.request (C:\\Users\\nick_
    \\VSCodeProjects\\scaffold-eth\\packages\\hardhat\\node_modules\\hardhat\\src\\internal\\core\\providers\\http.ts:78:19)\n    at HDWalletProvider.request (C:\\Users\\nick_\\VSCodeProjects\\scaff
    old-eth\\packages\\hardhat\\node_modules\\hardhat\\src\\internal\\core\\providers\\accounts.ts:181:36)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)","code":-32000,"
    _isProviderError":true}, method="sendTransaction", transaction=undefined, code=INSUFFICIENT_FUNDS, version=providers/5.4.4) {"reason":"insufficient funds for intrinsic transaction cost","code":"
    INSUFFICIENT_FUNDS","error":{"name":"ProviderError","_stack":"ProviderError: HttpProviderError\n    at HttpProvider.request (C:\\Users\\nick_\\VSCodeProjects\\scaffold-eth\\packages\\hardhat\\no
    de_modules\\hardhat\\src\\internal\\core\\providers\\http.ts:78:19)\n    at HDWalletProvider.request (C:\\Users\\nick_\\VSCodeProjects\\scaffold-eth\\packages\\hardhat\\node_modules\\hardhat\\sr
    c\\internal\\core\\providers\\accounts.ts:181:36)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)","code":-32000,"_isProviderError":true},"method":"sendTransaction"} E
    rror: insufficient funds for intrinsic transaction cost (error={"name":"ProviderError","_stack":"ProviderError: HttpProviderError\n    at HttpProvider.request (C:\\Users\\nick_\\VSCodeProjects\\
    scaffold-eth\\packages\\hardhat\\node_modules\\hardhat\\src\\internal\\core\\providers\\http.ts:78:19)\n    at HDWalletProvider.request (C:\\Users\\nick_\\VSCodeProjects\\scaffold-eth\\packages\
    \hardhat\\node_modules\\hardhat\\src\\internal\\core\\providers\\accounts.ts:181:36)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)","code":-32000,"_isProviderError":
    true}, method="sendTransaction", transaction=undefined, code=INSUFFICIENT_FUNDS, version=providers/5.4.4)
        at Logger.makeError (C:\Users\nick_\VSCodeProjects\scaffold-eth\packages\hardhat\node_modules\@ethersproject\logger\src.ts\index.ts:213:28)
        at Logger.throwError (C:\Users\nick_\VSCodeProjects\scaffold-eth\packages\hardhat\node_modules\@ethersproject\logger\src.ts\index.ts:225:20)
        at checkError (C:\Users\nick_\VSCodeProjects\scaffold-eth\packages\hardhat\node_modules\hardhat-deploy\node_modules\@ethersproject\providers\src.ts\json-rpc-provider.ts:53:16)
        at C:\Users\nick_\VSCodeProjects\scaffold-eth\packages\hardhat\node_modules\hardhat-deploy\node_modules\@ethersproject\providers\src.ts\json-rpc-provider.ts:215:24
        at processTicksAndRejections (node:internal/process/task_queues:96:5) {
      reason: 'insufficient funds for intrinsic transaction cost',
      code: 'INSUFFICIENT_FUNDS',
      error: ProviderError: HttpProviderError
          at HttpProvider.request (C:\Users\nick_\VSCodeProjects\scaffold-eth\packages\hardhat\node_modules\hardhat\src\internal\core\providers\http.ts:78:19)
          at HDWalletProvider.request (C:\Users\nick_\VSCodeProjects\scaffold-eth\packages\hardhat\node_modules\hardhat\src\internal\core\providers\accounts.ts:181:36)
          at processTicksAndRejections (node:internal/process/task_queues:96:5),
      method: 'sendTransaction',
      transaction: undefined
    }
    An unexpected error occurred:
    

    I have lower the gas fees in constant.js, but why still hitting this exception?

      mumbai: {
        name: "mumbai",
        color: "#92D9FA",
        chainId: 80001,
        price: 1,
        gasPrice: 0.00001,
        rpcUrl: "https://rpc-mumbai.maticvigil.com",
        faucet: "https://faucet.polygon.technology/",
        blockExplorer: "https://mumbai.polygonscan.com/",
      },
    
  • 14

    Enable CORS so safeApp manifest can be read by Gnosis App

    The following files were added to enable CORS when using a SafeApp for development & production:

    To enable CORS In development mode

    • packages/react-app/src/setupProxy.js

    To enable CORS when deploying to Surge:

    • packages/react-app/public/CORS
  • 15

    Bump express from 4.17.1 to 4.18.2

    Bumps express from 4.17.1 to 4.18.2.

    Release notes

    Sourced from express's releases.

    4.18.2

    4.18.1

    • Fix hanging on large stack of sync routes

    4.18.0

    ... (truncated)

    Changelog

    Sourced from express's changelog.

    4.18.2 / 2022-10-08

    4.18.1 / 2022-04-29

    • Fix hanging on large stack of sync routes

    4.18.0 / 2022-04-25

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.