Skip to content

Commit 8984d74

Browse files
authored
Create specific README files for foundry and hardhat options (#782)
1 parent 988434e commit 8984d74

File tree

3 files changed

+118
-44
lines changed

3 files changed

+118
-44
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# 🏗 Scaffold-ETH 2
1+
import { withDefaults } from "../utils.js";
2+
3+
const contents = ({ solidityFrameWork, quickStart }) =>
4+
`# 🏗 Scaffold-ETH 2
25
36
<h4 align="center">
47
<a href="https://docs.scaffoldeth.io">Documentation</a> |
@@ -7,9 +10,14 @@
710
811
🧪 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.
912
10-
⚙️ Built using NextJS, RainbowKit, Hardhat, Wagmi, Viem, and Typescript.
11-
12-
-**Contract Hot Reload**: Your frontend auto-adapts to your smart contract as you edit it.
13+
⚙️ Built using NextJS, RainbowKit, ${
14+
Boolean(solidityFrameWork[0]) ? solidityFrameWork[0] + ", " : ""
15+
}Wagmi, Viem, and Typescript.
16+
${
17+
Boolean(solidityFrameWork[0])
18+
? "\n- ✅ **Contract Hot Reload**: Your frontend auto-adapts to your smart contract as you edit it."
19+
: ""
20+
}
1321
- 🪝 **[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.
1422
- 🧱 [**Components**](https://docs.scaffoldeth.io/components/): Collection of common web3 components to quickly build your frontend.
1523
- 🔥 **Burner Wallet & Local Faucet**: Quickly test your application with a burner wallet and local faucet.
@@ -25,56 +33,38 @@ Before you begin, you need to install the following tools:
2533
- Yarn ([v1](https://classic.yarnpkg.com/en/docs/install/) or [v2+](https://yarnpkg.com/getting-started/install))
2634
- [Git](https://git-scm.com/downloads)
2735
28-
## Quickstart
29-
30-
To get started with Scaffold-ETH 2, follow the steps below:
31-
32-
1. Clone this repo & install dependencies
33-
34-
```
35-
git clone https://github.com/scaffold-eth/scaffold-eth-2.git
36-
cd scaffold-eth-2
37-
yarn install
38-
```
36+
${quickStart[0]}
3937
40-
2. Run a local network in the first terminal:
41-
42-
```
43-
yarn chain
44-
```
45-
46-
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 `hardhat.config.ts`.
47-
48-
3. On a second terminal, deploy the test contract:
49-
50-
```
51-
yarn deploy
52-
```
38+
## Documentation
5339
54-
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.
40+
Visit our [docs](https://docs.scaffoldeth.io) to learn how to start building with Scaffold-ETH 2.
5541
56-
4. On a third terminal, start your NextJS app:
42+
To know more about its features, check out our [website](https://scaffoldeth.io).
5743
58-
```
59-
yarn start
60-
```
44+
## Contributing to Scaffold-ETH 2
6145
62-
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`.
46+
We welcome contributions to Scaffold-ETH 2!
6347
64-
Run smart contract test with `yarn hardhat:test`
48+
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.`;
6549

66-
- Edit your smart contract `YourContract.sol` in `packages/hardhat/contracts`
67-
- Edit your frontend in `packages/nextjs/pages`
68-
- Edit your deployment scripts in `packages/hardhat/deploy`
50+
export default withDefaults(contents, {
51+
solidityFrameWork: "",
52+
quickStart: `## Quickstart
6953
70-
## Documentation
54+
To get started with Scaffold-ETH 2, follow the steps below:
7155
72-
Visit our [docs](https://docs.scaffoldeth.io) to learn how to start building with Scaffold-ETH 2.
56+
1. Install dependencies if it was skipped in CLI:
7357
74-
To know more about its features, check out our [website](https://scaffoldeth.io).
58+
\`\`\`
59+
cd my-dapp-example
60+
yarn install
61+
\`\`\`
7562
76-
## Contributing to Scaffold-ETH 2
63+
2. Start your NextJS app:
7764
78-
We welcome contributions to Scaffold-ETH 2!
65+
\`\`\`
66+
yarn start
67+
\`\`\`
7968
80-
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.
69+
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\`.`,
70+
});
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
export const quickStart = `## Quickstart
2+
3+
To get started with Scaffold-ETH 2, follow the steps below:
4+
5+
1. Install dependencies if it was skipped in CLI:
6+
7+
\`\`\`
8+
cd my-dapp-example
9+
yarn install
10+
\`\`\`
11+
12+
2. Run a local network in the first terminal:
13+
14+
\`\`\`
15+
yarn chain
16+
\`\`\`
17+
18+
This command starts a local Ethereum network using Foundry. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in \`packages/foundry/foundry.toml\`.
19+
20+
3. On a second terminal, deploy the test contract:
21+
22+
\`\`\`
23+
yarn deploy
24+
\`\`\`
25+
26+
This command deploys a test smart contract to the local network. The contract is located in \`packages/foundry/contracts\` and can be modified to suit your needs. The \`yarn deploy\` command uses the deploy script located in \`packages/foundry/script\` to deploy the contract to the network. You can also customize the deploy script.
27+
28+
4. On a third terminal, start your NextJS app:
29+
30+
\`\`\`
31+
yarn start
32+
\`\`\`
33+
34+
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\`.
35+
36+
Run smart contract test with \`yarn foundry:test\`
37+
38+
- Edit your smart contract \`YourContract.sol\` in \`packages/foundry/contracts\`
39+
- 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.
40+
- Edit your deployment scripts in \`packages/foundry/script\``;
41+
42+
export const solidityFrameWork = "Foundry";
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
export const quickStart = `## Quickstart
2+
3+
To get started with Scaffold-ETH 2, follow the steps below:
4+
5+
1. Install dependencies if it was skipped in CLI:
6+
7+
\`\`\`
8+
cd my-dapp-example
9+
yarn install
10+
\`\`\`
11+
12+
2. Run a local network in the first terminal:
13+
14+
\`\`\`
15+
yarn chain
16+
\`\`\`
17+
18+
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\`.
19+
20+
3. On a second terminal, deploy the test contract:
21+
22+
\`\`\`
23+
yarn deploy
24+
\`\`\`
25+
26+
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.
27+
28+
4. On a third terminal, start your NextJS app:
29+
30+
\`\`\`
31+
yarn start
32+
\`\`\`
33+
34+
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\`.
35+
36+
Run smart contract test with \`yarn hardhat:test\`
37+
38+
- Edit your smart contract \`YourContract.sol\` in \`packages/hardhat/contracts\`
39+
- 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.
40+
- Edit your deployment scripts in \`packages/hardhat/deploy\``;
41+
42+
export const solidityFrameWork = "Hardhat";

0 commit comments

Comments
 (0)