-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 01c9dfb
Showing
143 changed files
with
23,026 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [lts/*] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Setup node env | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Run hardhat node, deploy contracts (& generate contracts typescript output) | ||
run: yarn chain & yarn deploy | ||
|
||
- name: Run hardhat lint | ||
run: yarn hardhat:lint --max-warnings=0 | ||
|
||
- name: Run nextjs lint | ||
run: yarn next:lint --max-warnings=0 | ||
|
||
- name: Check typings on nextjs | ||
run: yarn next:check-types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# dependencies | ||
node_modules | ||
|
||
# yarn | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# eslint | ||
.eslintcache | ||
|
||
# misc | ||
.DS_Store | ||
|
||
# IDE | ||
.vscode | ||
.idea | ||
|
||
# cli | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
yarn lint-staged --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const path = require("path"); | ||
|
||
const buildNextEslintCommand = (filenames) => | ||
`yarn next:lint --fix --file ${filenames | ||
.map((f) => path.relative(path.join("packages", "nextjs"), f)) | ||
.join(" --file ")}`; | ||
|
||
const checkTypesNextCommand = () => "yarn next:check-types"; | ||
|
||
const buildHardhatEslintCommand = (filenames) => | ||
`yarn hardhat:lint-staged --fix ${filenames | ||
.map((f) => path.relative(path.join("packages", "hardhat"), f)) | ||
.join(" ")}`; | ||
|
||
module.exports = { | ||
"packages/nextjs/**/*.{ts,tsx}": [ | ||
buildNextEslintCommand, | ||
checkTypesNextCommand, | ||
], | ||
"packages/hardhat/**/*.{ts,tsx}": [buildHardhatEslintCommand], | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
enableColors: true | ||
|
||
nmHoistingLimits: workspaces | ||
|
||
nodeLinker: node-modules | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs | ||
spec: "@yarnpkg/plugin-typescript" | ||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs | ||
spec: "@yarnpkg/plugin-interactive-tools" | ||
|
||
yarnPath: .yarn/releases/yarn-3.2.3.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Welcome to Scaffold-ETH 2 Contributing Guide | ||
|
||
Thank you for investing your time in contributing to Scaffold-ETH 2! | ||
|
||
This guide aims to provide an overview of the contribution workflow to help us make the contribution process effective for everyone involved. | ||
|
||
## About the Project | ||
|
||
Scaffold-ETH 2 is a minimal and forkable repo providing builders with a starter kit to build decentralized applications on Ethereum. | ||
|
||
Read the [README](README.md) to get an overview of the project. | ||
|
||
### Vision | ||
|
||
The goal of Scaffold-ETH 2 is to provide the primary building blocks for a decentralized application. | ||
|
||
The repo can be forked to include integrations and more features, but we want to keep the master branch simple and minimal. | ||
|
||
### Project Status | ||
|
||
The project is under active development. | ||
|
||
You can view the open Issues, follow the development process and contribute to the project. | ||
|
||
## Getting started | ||
|
||
You can contribute to this repo in many ways: | ||
|
||
- Solve open issues | ||
- Report bugs or feature requests | ||
- Improve the documentation | ||
|
||
Contributions are made via Issues and Pull Requests (PRs). A few general guidelines for contributions: | ||
|
||
- Search for existing Issues and PRs before creating your own. | ||
- Contributions should only fix/add the functionality in the issue OR address style issues, not both. | ||
- If you're running into an error, please give context. Explain what you're trying to do and how to reproduce the error. | ||
- Please use the same formatting in the code repository. You can configure your IDE to do it by using the prettier / linting config files included in each package. | ||
- If applicable, please edit the README.md file to reflect the changes. | ||
|
||
### Issues | ||
|
||
Issues should be used to report problems, request a new feature, or discuss potential changes before a PR is created. | ||
|
||
#### Solve an issue | ||
|
||
Scan through our [existing issues](https://github.com/scaffold-eth/scaffold-eth-2/issues) to find one that interests you. | ||
|
||
If a contributor is working on the issue, they will be assigned to the individual. If you find an issue to work on, you are welcome to assign it to yourself and open a PR with a fix for it. | ||
|
||
#### Create a new issue | ||
|
||
If a related issue doesn't exist, you can open a new issue. | ||
|
||
Some tips to follow when you are creating an issue: | ||
|
||
- Provide as much context as possible. Over-communicate to give the most details to the reader. | ||
- Include the steps to reproduce the issue or the reason for adding the feature. | ||
- Screenshots, videos etc., are highly appreciated. | ||
|
||
### Pull Requests | ||
|
||
#### Pull Request Process | ||
|
||
We follow the ["fork-and-pull" Git workflow](https://github.com/susam/gitpr) | ||
|
||
1. Fork the repo | ||
2. Clone the project | ||
3. Create a new branch with a descriptive name | ||
4. Commit your changes to the new branch | ||
5. Push changes to your fork | ||
6. Open a PR in our repository and tag one of the maintainers to review your PR | ||
|
||
Here are some tips for a high-quality pull request: | ||
|
||
- Create a title for the PR that accurately defines the work done. | ||
- Structure the description neatly to make it easy to consume by the readers. For example, you can include bullet points and screenshots instead of having one large paragraph. | ||
- Add the link to the issue if applicable. | ||
- Have a good commit message that summarises the work done. | ||
|
||
Once you submit your PR: | ||
|
||
- We may ask questions, request additional information or ask for changes to be made before a PR can be merged. Please note that these are to make the PR clear for everyone involved and aims to create a frictionless interaction process. | ||
- As you update your PR and apply changes, mark each conversation resolved. | ||
|
||
Once the PR is approved, we'll "squash-and-merge" to keep the git commit history clean. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 BuidlGuidl | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# 🏗 Scaffold-ETH 2 | ||
|
||
<h4 align="center"> | ||
<a href="https://docs.scaffoldeth.io">Documentation</a> | | ||
<a href="https://scaffoldeth.io">Website</a> | ||
</h4> | ||
|
||
🧪 An open-source, up-to-date toolkit for building decentralized applications (dapps) on the Ethereum blockchain. It's designed to make it easier for developers to create and deploy smart contracts and build user interfaces that interact with those contracts. | ||
|
||
⚙️ Built using NextJS, RainbowKit, Hardhat, Wagmi, Viem, and Typescript. | ||
|
||
- ✅ **Contract Hot Reload**: Your frontend auto-adapts to your smart contract as you edit it. | ||
- 🪝 **[Custom hooks](https://docs.scaffoldeth.io/hooks/)**: Collection of React hooks wrapper around [wagmi](https://wagmi.sh/) to simplify interactions with smart contracts with typescript autocompletion. | ||
- 🧱 [**Components**](https://docs.scaffoldeth.io/components/): Collection of common web3 components to quickly build your frontend. | ||
- 🔥 **Burner Wallet & Local Faucet**: Quickly test your application with a burner wallet and local faucet. | ||
- 🔐 **Integration with Wallet Providers**: Connect to different wallet providers and interact with the Ethereum network. | ||
|
||
![Debug Contracts tab](https://github.com/scaffold-eth/scaffold-eth-2/assets/55535804/b237af0c-5027-4849-a5c1-2e31495cccb1) | ||
|
||
## Requirements | ||
|
||
Before you begin, you need to install the following tools: | ||
|
||
- [Node (>= v18.18)](https://nodejs.org/en/download/) | ||
- Yarn ([v1](https://classic.yarnpkg.com/en/docs/install/) or [v2+](https://yarnpkg.com/getting-started/install)) | ||
- [Git](https://git-scm.com/downloads) | ||
|
||
## Quickstart | ||
|
||
To get started with Scaffold-ETH 2, follow the steps below: | ||
|
||
1. Install dependencies if it was skipped in CLI: | ||
|
||
``` | ||
cd my-dapp-example | ||
yarn install | ||
``` | ||
|
||
2. Run a local network in the first terminal: | ||
|
||
``` | ||
yarn chain | ||
``` | ||
|
||
This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in `packages/hardhat/hardhat.config.ts`. | ||
|
||
3. On a second terminal, deploy the test contract: | ||
|
||
``` | ||
yarn deploy | ||
``` | ||
|
||
This command deploys a test smart contract to the local network. The contract is located in `packages/hardhat/contracts` and can be modified to suit your needs. The `yarn deploy` command uses the deploy script located in `packages/hardhat/deploy` to deploy the contract to the network. You can also customize the deploy script. | ||
|
||
4. On a third terminal, start your NextJS app: | ||
|
||
``` | ||
yarn start | ||
``` | ||
|
||
Visit your app on: `http://localhost:3000`. You can interact with your smart contract using the `Debug Contracts` page. You can tweak the app config in `packages/nextjs/scaffold.config.ts`. | ||
|
||
Run smart contract test with `yarn hardhat:test` | ||
|
||
- Edit your smart contracts in `packages/hardhat/contracts` | ||
- Edit your frontend homepage at `packages/nextjs/app/page.tsx`. For guidance on [routing](https://nextjs.org/docs/app/building-your-application/routing/defining-routes) and configuring [pages/layouts](https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts) checkout the Next.js documentation. | ||
- Edit your deployment scripts in `packages/hardhat/deploy` | ||
|
||
|
||
## Documentation | ||
|
||
Visit our [docs](https://docs.scaffoldeth.io) to learn how to start building with Scaffold-ETH 2. | ||
|
||
To know more about its features, check out our [website](https://scaffoldeth.io). | ||
|
||
## Contributing to Scaffold-ETH 2 | ||
|
||
We welcome contributions to Scaffold-ETH 2! | ||
|
||
Please see [CONTRIBUTING.MD](https://github.com/scaffold-eth/scaffold-eth-2/blob/main/CONTRIBUTING.md) for more information and guidelines for contributing to Scaffold-ETH 2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "se-2", | ||
"version": "0.0.1", | ||
"private": true, | ||
"workspaces": { | ||
"packages": [ | ||
"packages/*" | ||
] | ||
}, | ||
"scripts": { | ||
"account": "yarn workspace @se-2/hardhat account", | ||
"chain": "yarn workspace @se-2/hardhat chain", | ||
"compile": "yarn workspace @se-2/hardhat compile", | ||
"deploy": "yarn workspace @se-2/hardhat deploy", | ||
"flatten": "yarn workspace @se-2/hardhat flatten", | ||
"fork": "yarn workspace @se-2/hardhat fork", | ||
"format": "yarn next:format && yarn hardhat:format", | ||
"generate": "yarn workspace @se-2/hardhat generate", | ||
"hardhat-verify": "yarn workspace @se-2/hardhat hardhat-verify", | ||
"hardhat:format": "yarn workspace @se-2/hardhat format", | ||
"hardhat:lint": "yarn workspace @se-2/hardhat lint", | ||
"hardhat:lint-staged": "yarn workspace @se-2/hardhat lint-staged", | ||
"hardhat:test": "yarn workspace @se-2/hardhat test", | ||
"postinstall": "husky install", | ||
"next:build": "yarn workspace @se-2/nextjs build", | ||
"next:check-types": "yarn workspace @se-2/nextjs check-types", | ||
"next:format": "yarn workspace @se-2/nextjs format", | ||
"next:lint": "yarn workspace @se-2/nextjs lint", | ||
"next:serve": "yarn workspace @se-2/nextjs serve", | ||
"precommit": "lint-staged", | ||
"start": "yarn workspace @se-2/nextjs dev", | ||
"test": "yarn hardhat:test", | ||
"vercel": "yarn workspace @se-2/nextjs vercel", | ||
"vercel:yolo": "yarn workspace @se-2/nextjs vercel:yolo", | ||
"verify": "yarn workspace @se-2/hardhat verify" | ||
}, | ||
"devDependencies": { | ||
"husky": "~8.0.3", | ||
"lint-staged": "~13.2.2" | ||
}, | ||
"packageManager": "yarn@3.2.3", | ||
"engines": { | ||
"node": ">=18.18.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Template for Hardhat environment variables. | ||
|
||
# To use this template, copy this file, rename it .env, and fill in the values. | ||
|
||
# If not set, we provide default values (check `hardhat.config.ts`) so developers can start prototyping out of the box, | ||
# but we recommend getting your own API Keys for Production Apps. | ||
|
||
# To access the values stored in this .env file you can use: process.env.VARIABLENAME | ||
ALCHEMY_API_KEY= | ||
DEPLOYER_PRIVATE_KEY= | ||
ETHERSCAN_API_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# folders | ||
artifacts | ||
cache | ||
contracts | ||
node_modules/ | ||
typechain-types | ||
# files | ||
**/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"env": { | ||
"node": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"extends": ["plugin:prettier/recommended", "plugin:@typescript-eslint/recommended"], | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"prettier/prettier": [ | ||
"warn", | ||
{ | ||
"endOfLine": "auto" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.