Giter Site home page Giter Site logo

nezz0746 / typescript-eth-starter Goto Github PK

View Code? Open in Web Editor NEW
134.0 3.0 22.0 4.75 MB

๐Ÿ”Œ Ethereum Dapp Basic Typescript Starter

Home Page: https://typescript-eth-starter-web.vercel.app

TypeScript 95.13% JavaScript 1.82% CSS 0.06% Solidity 2.60% HTML 0.39%
ethereum smart-contracts nextjs react typescript tailwindcss hardhat redux-toolkit polygon matic

typescript-eth-starter's Introduction

๐Ÿ”Œ ETH Basic Typescript Starter

โœจ New version (V3!) โœจ

This monorepo should allow you to get started with a simple Counter smart contract on your local anvil instance, and a dapp

  • React / Typescript (Vite โšก)
  • ๐ŸŽ๏ธ Turborepo
  • โš’๏ธ Foundry, with tests & local anvil instance:
    • Multi chain deployments utils
    • Upgradeable Counter example
  • Subgraph to index your smart contracts
  • ๐Ÿ‹ Docker Compose file to run you anvil & graph-node locally quickly
  • ๐Ÿš€ wagmi & ๐ŸŒˆ RainbowKit !
    • Generated custom hooks with the wagmi-cli !
  • graphql-codegen generated hooks to query your subgraph from your apps quickly
  • Tailwind CSS with DaisyUI ๐ŸŒผ !

Recommended:

  • Rivet: Developper wallet & devtool for you local developpement

Get Started

0. Set environment variables (Optional)

1. Install dependencies

yarn

2. Start developement process

Will concurrently:

  • launch your anvil instance
  • start your react app dev server
yarn run dev

3. Deploy

yarn run deploy:local

Will:

  • Run your deploy script on your local chain
  • Regenerate your custom hooks stright into your wagmi-config
/apps
  # You foundry project
  /contracts
  # Your dapp
  /web
/packages
  # Contains wagmi & rainbowkit config and generated code with the wagmi-cli
  /wagmi-config
  # Hosting app constants
  /shared-config

typescript-eth-starter's People

Contributors

nezz0746 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

typescript-eth-starter's Issues

npm run dev Error issue

Thanks for your current project

When I run npm run dev, but met following error

error - TypeError: Cannot read properties of undefined (reading 'id')
web:dev: TypeError: Cannot read properties of undefined (reading 'id')

const wagmiClient = createClient({
  autoConnect: true,
  connectors,
  provider,
});

Could you fix this?

Thank you

Incompatible Contract type between frontend and hardhat

Thank you for putting together this helpful repo.

I'm running into a strange issue. I am unable to run yarn build and it looks like it is not finding a compatible Contract type from the hardhat generated types.

./hooks/useListPiece.ts:20:46
Type error: Argument of type 'MyNFT' is not assignable to parameter of type 'Contract'.

I believe it is because of the fixed version of ethers in frontend/package.json:

 "resolutions": {
    "ethers": "5.4.5 "
 }

When I remove that line from the frontend/package.json, and re-instsall everything, it works.

But, then I get a different issue with yarn build where it is complaining about an incompatibility with bn.js.

../../node_modules/@ethersproject/bignumber/src.ts/bignumber.ts:12:17
Type error: Property 'BN' does not exist on type 'typeof BN'.

  10 |
  11 | import _BN from "bn.js";
> 12 | import BN = _BN.BN;

Do you know how to resolve this?

npm run dev error "must have at least one chain"

$npm run dev

[email protected] dev
turbo run dev --parallel

โ€ข Packages in scope: my-eth-starter-hardhat-project, tsconfig, types, web
โ€ข Running dev in 4 packages
โ€ข Remote caching disabled
web:dev: cache bypass, force executing bdd8d83355057db2
my-eth-starter-hardhat-project:dev: cache bypass, force executing 339d2ba8cbd1efa7
web:dev: yarn run v1.22.17
my-eth-starter-hardhat-project:dev: yarn run v1.22.17
my-eth-starter-hardhat-project:dev: $ npm run chain
web:dev: $ next dev
web:dev: ready - started server on 0.0.0.0:3000, url: http://localhost:3000
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: > [email protected] chain
my-eth-starter-hardhat-project:dev: > hardhat node
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: (node:55198) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
my-eth-starter-hardhat-project:dev: (Use node --trace-warnings ... to show where the warning was created)
my-eth-starter-hardhat-project:dev: Nothing to compile
my-eth-starter-hardhat-project:dev: No need to generate any newer typings.
my-eth-starter-hardhat-project:dev: deploying "Greeter" (tx: 0xdeedfd85757680892e2aef29091afa121782fe69d06dae259bc5af4ba36425b2)...: deployed at 0x3d3593927228553b349767ABa68d4fb1514678CB with 345230 gas
my-eth-starter-hardhat-project:dev: Started HTTP and WebSocket JSON-RPC server at http://127.0.0.1:8545/
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Accounts
my-eth-starter-hardhat-project:dev: ========
web:dev: wait - compiling...
web:dev: event - compiled client and server successfully in 683 ms (957 modules)
my-eth-starter-hardhat-project:dev: Account #0: 0x75E480dB528101a381Ce68544611C169Ad7EB342 (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #1: 0x0085560b24769dAC4ed057F1B2ae40746AA9aAb6 (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #2: 0x0294350d7cF2C145446358B6461C1610927B3A87 (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #3: 0xA76F290C490C70F2d816D286eFE47Fd64a35800B (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #4: 0x4f9c798553D207536b79E886b54F169264A7A155 (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #5: 0xA1B04C9cbb449d13C4FC29c7E6bE1f810e6f35e9 (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #6: 0xaD9fbD38281F615e7DF3DeF2Aad18935a9e0fFeE (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #7: 0x0783094aAdfB8ae9915fD712d28664c8d7D26AFA (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #8: 0xe860947813C207aBF9bF6722C49cdA515d24971a (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #9: 0x8BffC896D42F07776561A5814D6E4240950d6D3a (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #10: 0x009bAF2033647a6F9f56869B8dDA5a80967A9edf (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #11: 0xE7320E016230f0E8AA3B5F22895FC49dc101c2cB (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #12: 0x7a2E1f7792FF25637aA3F0E727072e3A821695e9 (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #13: 0x9A0B5903C85210fC5E3c7c822746EbA44Ee0ADc6 (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #14: 0x6820e97b5A81b9fBC972350Cac7A281bd572d991 (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #15: 0xc331046820eF6d011141c1C7f0f6C76cbaF46413 (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #16: 0xBD7608Dc5AC9319b340ea56364863276FF5bf4e7 (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #17: 0xa16B07BaB2Cf1C3606ca33BF55038412b17eFDee (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #18: 0x180551696b2bA02E16A3b0E88Ff7c6b06757076f (10000 ETH)
my-eth-starter-hardhat-project:dev:
my-eth-starter-hardhat-project:dev: Account #19: 0xAA507B16081D5F79A4BC82bB8Df143cb5C5c67A5 (10000 ETH)
my-eth-starter-hardhat-project:dev:

^[[A^[[A^[[Aweb:dev: wait - compiling / (client and server)...
web:dev: wait - compiling...
web:dev: event - compiled client and server successfully in 438 ms (977 modules)
web:dev: wait - compiling /_error (client and server)...
web:dev: wait - compiling...
web:dev: event - compiled client and server successfully in 85 ms (978 modules)
web:dev: Error: must have at least one chain
web:dev: at configureChains (/Users/aodhgan/typescript-eth-starter/node_modules/@wagmi/core/dist/wagmi-core.cjs.dev.js:30:36)
web:dev: at eval (webpack-internal:///./pages/_app.tsx:28:86)
web:dev: at processTicksAndRejections (node:internal/process/task_queues:96:5)
web:dev: Error: must have at least one chain
web:dev: at configureChains (/Users/aodhgan/typescript-eth-starter/node_modules/@wagmi/core/dist/wagmi-core.cjs.dev.js:30:36)
web:dev: at eval (webpack-internal:///./pages/_app.tsx:28:86)
web:dev: at processTicksAndRejections (node:internal/process/task_queues:96:5)
web:dev: error - Error: must have at least one chain

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.