GithubHelp home page GithubHelp logo

scaffold-eth / eth-components Goto Github PK

View Code? Open in Web Editor NEW
122.0 122.0 27.0 5.09 MB

๐Ÿ“ฆ React library of commonly used Ethereum components

TypeScript 98.75% JavaScript 0.80% Shell 0.09% CSS 0.37%
ethereum react solidity typescript web3

eth-components'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

eth-components's People

Contributors

austintgriffith avatar codenamejason avatar dvinubius avatar grothem avatar kamikazebr avatar pontus-dev avatar shravansunder 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eth-components's Issues

Account: Improve connect button

The connect button needs:

  • a longer is loading state
  • to be blocked when web3modal is open
  • to prevent people when clicking on it when web3modal is open or page is loading

Component 'Account' does not show web3modal dialog when clicking 'connect' button

Hello there

I am currently building a simple poc app to demonstrate chain access from a webapp. The app is based on next with react/antd and i want to make use of eth-hooks and eth-components to use standard components for display.
I have build a simple page that should use the Account component to handle the wallet connection and show the current account details.
I have implemented the poc in the repository https://github.com/doerfli/eth-components-web3modallogin
The page in question is the index (https://github.com/doerfli/eth-components-web3modallogin/blob/main/pages/index.tsx) using the ShowAccount component (https://github.com/doerfli/eth-components-web3modallogin/blob/main/components/show_account.tsx) to display the data. The configuration for the EthersModalConnector can be found in https://github.com/doerfli/eth-components-web3modallogin/blob/main/utils/appConfig.ts

Now when i run the application, the following problem appears

  • on the desktop it will automatically connect to my Metamask without showing any web3modal dialog. But at least the connection works and i can call be contract in the Counter react component.
  • on the mobile it will show a grey opaque modal without any content.

Screenshot_2022-10-31-16-44-55-54_3aea4af51f236e4932235fdada7d1643

I would like to have a web3modal dialog shown in both situations so the user can choose his wallet as well as the chain to connect to.

Can you please help me and figure out what i am doing wrong? I somehow have the feeling that for some reason the web3modal component is skipped when connecting.

Thanks,
Marc

fixes for esm

  • should be fully compatible with esm
  • should work with nextjs

Local faucet doesn't work

Trying to send eth using the local faucet gives an invalid address error. I can open the wallet and send eth that way though.

Seems like it's not parsing the address correctly, because when I paste it in, it doesn't show the little address icon:

image

Broken layout and ether input in v3.0.9

When running the default scaffold-eth/typescript app, which uses eth-components v3.0.9

  • some of the layout is misaligned
  • the ether input has a faulty check and results in not displaying the switch

Screenshot 2022-01-18 at 13 43 22
Screenshot 2022-01-18 at 13 43 04
Screenshot 2022-01-18 at 13 42 53

I have done the changes in my factory setup but I guess most users would have to do them also.

The result

Screenshot 2022-01-18 at 13 54 15
Screenshot 2022-01-18 at 13 54 36
Screenshot 2022-01-18 at 13 54 45

โš ๏ธ I don't mean the changes in background color or font, but strictly the above mentioned layout issues

I could make the fixes myself and PR

Module not found: Can't resolve 'antd'

Looks like using this library by itself doesn't work.

In my package.json I have:

  "dependencies": {
     // ....
    "eth-components": "^3.0.39",
  },

And I'm using the Address component:

<Address address={'0xblablah'}/>

And I'm getting the following error:

./node_modules/eth-components/chunk-DDPV2RQ2.js:1:103
Module not found: Can't resolve 'antd'

Import trace for requested module:
./node_modules/eth-components/ant/index.js
./components/Addresses.tsx
./pages/index.tsx

https://nextjs.org/docs/messages/module-not-found

Module not found: Can't resolve 'antd'

Looks like using this library by itself doesn't work.

In my package.json I have:

  "dependencies": {
     // ....
    "eth-components": "^3.0.39",
  },

And I'm using the Address component:

<Address address={'0xblablah'}/>

And I'm getting the following error:

./node_modules/eth-components/chunk-DDPV2RQ2.js:1:103
Module not found: Can't resolve 'antd'

Import trace for requested module:
./node_modules/eth-components/ant/index.js
./components/Addresses.tsx
./pages/index.tsx

https://nextjs.org/docs/messages/module-not-found

address prop of Balance component could be optional

Right now, the address input of the Balance component is defined as string | undefined

I think this could just be declared as optional, then it wouldn't have to be explicitly set as undefined if there is no address. This would clean up the templates:
image

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.