You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/rules/scaffold-eth.mdc
+12-5Lines changed: 12 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
1
---
2
-
description:
3
-
globs:
2
+
description:
3
+
globs:
4
4
alwaysApply: true
5
5
---
6
+
6
7
This codebase contains Scaffold-ETH 2 (SE-2), everything you need to build dApps on Ethereum. Its tech stack is NextJS, RainbowKit, Wagmi and Typescript. Supports Hardhat and Foundry.
7
8
8
9
It's a yarn monorepo that contains two main packages:
@@ -31,6 +32,7 @@ The usual dev flow is:
31
32
SE-2 provides a set of hooks that facilitates contract interactions from the UI. It reads the contract data from `deployedContracts.ts` and `externalContracts.ts`, located in `packages/nextjs/contracts`.
32
33
33
34
### Reading data from a contract
35
+
34
36
Use the `useScaffoldReadContract` (`packages/nextjs/hooks/scaffold-eth/useScaffoldReadContract.ts`) hook. Example:
@@ -100,15 +104,18 @@ The `data` property consists of an array of events and can be displayed as:
100
104
```
101
105
102
106
### Other Hooks
107
+
103
108
SE-2 also provides other hooks to interact with blockchain data: `useScaffoldWatchContractEvent`, `useScaffoldEventHistory`, `useDeployedContractInfo`, `useScaffoldContract`, `useTransactor`. They live under `packages/nextjs/hooks/scaffold-eth`.
104
109
105
110
## Display Components guidelines
106
-
SE-2 provides a set of pre-built React components for common Ethereum use cases:
111
+
112
+
With the `@scaffold-ui/components` library, SE-2 provides a set of pre-built React components for common Ethereum use cases:
113
+
107
114
- `Address`: Always use this when displaying an ETH address
108
115
- `AddressInput`: Always use this when users need to input an ETH address
109
116
- `Balance`: Display the ETH/USDC balance of a given address
110
117
- `EtherInput`: An extended number input with ETH/USD conversion.
111
118
112
-
They live under `packages/nextjs/components/scaffold-eth`.
119
+
For fully customizable components, you can use the hooks from the `@scaffold-ui/hooks` library to get the data you need.
113
120
114
121
Find the relevant information from the documentation and the codebase. Think step by step before answering the question.
0 commit comments