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
|**address**|`string`|`undefined`| Address in `0x___` format, it will resolve its Starknet Domain if it has one associated(coming soon). |
34
-
|**className** (optional) |`string`|`""`| Prop to pass additional CSS styling to the component. You can use Tailwind / daisyUI classes like `text-3xl` for styling. |
35
-
|**usdMode** (optional) |`boolean`|`false`| If true, the balance is displayed in USD. Otherwise, it defaults to ETH/STRK. |
|**address**|`string`|`undefined`| Address in `0x___` format, it will resolve its Starknet Domain if it has one associated(coming soon). |
34
+
|**className** (optional) |`string`|`""`| Prop to pass additional CSS styling to the component. You can use Tailwind / daisyUI classes like `text-3xl` for styling. |
35
+
|**usdMode** (optional) |`boolean`|`false`| If true, the balance is displayed in USD. Otherwise, it defaults to ETH/STRK. |
37
36
38
37
## Example
39
38
40
39
The `Balance` component can be easily customized using Tailwind or daisyUI classes. Here’s a more detailed example of its usage:
|**address**|`Address \| string`| The STRK address to fetch the balance for. If not provided, it will attempt to fetch the balance for the current connected account. |
|**address**|`Address \| string`| The STRK address to fetch the balance for. If not provided, it will attempt to fetch the balance for the current connected account. |
Copy file name to clipboardexpand all lines: docs/quick-start/customize-your-own-dApp.mdx
+55
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,61 @@ These two directories together form the complete project structure, with `snfoun
19
19
2.**Deployment Scripts**:
20
20
The deployment scripts are located in `packages/snfoundry/scripts-ts/deploy.ts`. This script is used to deploy your smart contract to the specified blockchain network. By editing this script, you can adjust the deployment process, such as specifying different networks or contract parameters.
21
21
22
+
#### Deployment Command Line Flags
23
+
24
+
The deployment script supports several command line flags to customize the deployment process:
25
+
26
+
#### --network
27
+
28
+
- Type: string
29
+
- Default: "devnet"
30
+
- Description: Specifies the network for deployment
31
+
- Example: `--network mainnet`
32
+
33
+
<br />
34
+
35
+
#### --fee
36
+
37
+
- Type: string
38
+
- Default: "eth"
39
+
- Choices:
40
+
- "eth": Use ETH as the fee token
41
+
- "strk": Use STRK as the fee token
42
+
- Example: `--fee strk`
43
+
44
+
<br />
45
+
46
+
#### --reset
47
+
48
+
- Type: boolean
49
+
- Default: true
50
+
- Description: Controls whether to reset existing deployments
51
+
- When true: Keeps existing deployments
52
+
- When false: Resets deployments before new deployment
53
+
- Example: `--reset false`
54
+
55
+
<br />
56
+
57
+
#### Example Commands
58
+
59
+
2.1. Deploy to devnet using ETH fees (default settings):
60
+
61
+
```bash
62
+
yarn deploy
63
+
```
64
+
65
+
2.2. Deploy to testnet using STRK fees:
66
+
67
+
```bash
68
+
yarn deploy --network sepolia --fee strk
69
+
```
70
+
71
+
2.3. Deploy with reset:
72
+
73
+
```bash
74
+
yarn deploy --network sepolia --reset false
75
+
```
76
+
22
77
3.**Test Smart Contracts**:
23
78
To ensure your smart contracts work correctly, write and run tests in the `packages/snfoundry/contracts/src/test` directory. These tests can be executed using the `yarn test` command. This helps catch and fix potential errors before deployment.
2. Update `scaffoldConfig` in scaffold.config.ts as:
13
+
2. After running yarn chain fork, there will be a block number in console:
14
+
15
+
```bash
16
+
Forking from block: number=1047693
17
+
```
18
+
19
+
3. If you wanna use events, **MAKE SURE** the fromBlock : is > the number in console + 1, otherwise the events data will always be empty. i.e. do not capture the first block of the fork
Copy file name to clipboardexpand all lines: docs/recipes/MultiWriteFeature.md
+14-29
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ description: Learn how to perform multiple write operations to StarkNet smart co
9
9
This recipe shows how to perform multiple contract write operations in a single transaction using the [`useScaffoldMultiWriteContract`](https://github.com/Scaffold-Stark/scaffold-stark-2/blob/main/packages/nextjs/hooks/scaffold-stark/useScaffoldMultiWriteContract.ts) hook from Scaffold-Stark.
10
10
11
11
## Overview
12
+
12
13
In this guide, we will implement a feature that allows writing to multiple contracts or executing multiple transactions in a single action. This is particularly useful when your decentralized application (dApp) requires multiple state changes at once.
13
14
14
15
This documentation will walk through the code and steps necessary to create a button that triggers the multi-write contract interaction.
Create a new component in your `component` folder, named `MultiContractInteraction.tsx`. This component will handle multiple write operations on different contracts
- The `isPending` variable will manage the loading state of the button, and `sendAsync` will handle the contract transaction.
141
132
142
133
### Step 5: Handle Submission
134
+
143
135
- Create a `handleSetData` function that triggers the multi-write action. If successful, display a success notification; otherwise, log the error and display a failure message.
0 commit comments