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: docs/deploying/deploy-faucets.mdx
+12-27
Original file line number
Diff line number
Diff line change
@@ -3,43 +3,28 @@ sidebar_position: 3
3
3
toc_max_heading_level: 5
4
4
---
5
5
6
-
# Faucets
7
-
8
-
Faucets for deployment of smart contracts can be requested from the website.
9
-
10
-
- The button is at the bottom left of the [Demo app](https://scaffold-stark-demo.vercel.app/)
6
+
# Faucets
11
7
8
+
Faucets for deployment of smart contracts can be requested from the website. You can access it by clicking the "Faucet" button located at the bottom left of the screen.
12
9
13
10

14
11
15
-
- On clicking on it, You will get a pop up
16
-
17
-

18
-
19
-
20
-
## Starknet Sepolia faucets
21
-
22
-
You can get your faucets in the following websites :
curl -d '{"amount":1000000000000000000, "address":"0x064b48806902a367c8598f4f95c305e8c1a1acba5f082d294a43793113115691"}' -H "Content-Type: application/json" -X POST http://localhost:5050/mint
37
21
38
-
```
22
+
or use our UI to transfer any token to your desired wallet, as shown below.
39
23
40
-
- You can also transfer faucets as shown below
24
+

41
25
42
-
- This is made possible following the installation procedures in the Readme file in [Scaffold-stark-2](https://github.com/Scaffold-Stark/scaffold-stark-2)
26
+
## Starknet Sepolia faucets
43
27
28
+

44
29
45
-

30
+
We provide links to some official faucets that can be used to obtain testnet tokens.
Copy file name to clipboardexpand all lines: docs/eth-stark/eth-stark.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
sidebar_position: 6
3
3
---
4
4
5
-
# 🚩 Using Scaffold Stark with Ethereum Contracts
5
+
# 🚩 (Coming Soon) Using Scaffold Stark with Ethereum Contracts
6
6
7
7
[Scaffold-ETH-Stark](https://github.com/Scaffold-Stark/scaffold-eth-stark) is an innovative toolkit that combines the capabilities of Scaffold-Stark and Scaffold-ETH, providing a unified solution for building decentralized applications (dapps) on both Starknet and EVM-compatible blockchains.
Copy file name to clipboardexpand all lines: docs/hooks/hooks.md
+8-4
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,18 @@ sidebar_position: 4
6
6
7
7
Scaffold-Stark provides a collection of custom React hooks designed to simplify interactions with your deployed smart contracts. These hooks are wrappers around Starknet-React, an easy-to-use interface with typescript autocompletions for reading from, writing to, and monitoring events emitted by your smart contracts.
8
8
9
-
If you need to interact with external contracts (i.e. not deployed with your SS-2 instance) you can add external contract data to your `packages/nextjs/contracts/preDeployedContracts.ts` file, which would let you use Scaffold-Stark hooks.
9
+
If you need to interact with external contracts (i.e. not deployed with your SS-2 instance) you can add external contract data to your `packages/nextjs/contracts/configExternalContracts.ts` file, which would let you use Scaffold-Stark hooks. You can also use our [external contract fetching tool](/quick-start/importing-existing-smart-contracts) that allows you to bring in external contracts with few simple clicks.
10
10
11
-
To achieve this, include the contract name, its `address`, and `abi` in `preDeployedContracts.ts` for each chain ID. Ensure to update the [`targetNetworks`](/deploying/deploy-nextjs-app#--targetnetworks) in `scaffold.config.ts` to your preferred chains to enable hooks typescript autocompletion.
11
+
:::danger
12
+
`predeployedContracts.ts` are reserved for our built-in contracts and should not be edited. `deployedContracts.ts` will be updated when you deploy from starknet-foundry and should not be manually updated either.
13
+
:::
14
+
15
+
To achieve this, include the contract name, its `address`, and `abi` in `configExternalContracts.ts` for each chain ID. Ensure to update the [`targetNetworks`](/deploying/deploy-nextjs-app#--targetnetworks) in `scaffold.config.ts` to your preferred chains to enable hooks typescript autocompletion.
12
16
13
-
This is the structure of `preDeployedContracts` object:
17
+
This is the structure of `configExternalContracts` object:
|**functionName**|`string`| Name of the function to call (in this case, `balance_of`). |
55
+
|**args** (optional) |`unknown[]`| Arguments to pass to the function, such as the target address. |
56
+
|**blockIdentifier**|`BlockNumber`| Specifies the block to query the contract from, set as `"pending"` by default. |
57
57
58
58
You can also pass other arguments accepted by [useReadContract from starknet-react](https://starknet-react.com/docs/hooks/queries/usecontractread).
59
59
@@ -64,15 +64,17 @@ You can also pass other arguments accepted by [useReadContract from starknet-rea
64
64
-**`symbol`**: The token symbol ("ETH").
65
65
- The object also includes properties from the `useReadContract` hook. You can check the [useContractRead return values](https://starknet-react.com/docs/hooks/queries/usecontractread) for additional details.
66
66
67
-
68
67
## Best Practices
68
+
69
69
- Use this hook in any component where you need to display the ETH balance of a specific address.
70
70
- Ensure that the component using this hook is wrapped in a StarkNet React provider for seamless integration with the blockchain context.
71
71
- For a smooth user experience, handle loading and error states in the component using this hook.
72
72
- Consider using the formatted balance for display purposes as it is easier for users to understand compared to the raw bigint value.
73
73
74
74
## Error Handling
75
+
75
76
The hook does not handle errors explicitly, but the `useReadContract` hook from StarkNet React includes an `error` property in the return object. You can leverage this to manage errors in your component like this:
This example configures the hook to read events from the YourEvent event of the YourContract smart contract, starting from block 0. It includes block data, but excludes transaction and receipt data. The hook will watch for new events and refresh the data.
23
+
This example configures the hook to read events from the `YourEvent` event of the `YourContract` smart contract, starting from block 0. It includes block data, but excludes transaction and receipt data. The hook will watch for new events and refresh the data.
|**calls**|`Array`| Array of configuration objects for the contract calls. Each object should contain `contractName`, `functionName`, and `args`. |
51
+
|**calls**|`Calldata[]`| Array of configuration objects for the contract calls. Each object should contain `contractName`, `functionName`, and `args`. |
52
52
|**options** (optional) |`InvocationsDetails`| Additional options for the transactions. |
53
53
54
54
## Call Object Configuration
@@ -59,10 +59,8 @@ This example demonstrates how to use the `sendAsync`function to send multiple tr
59
59
|**functionName**|`string`| Name of the function to call. |
60
60
|**args** (optional) |`unknown[]`| Array of arguments to pass to the function (if any). Types are inferred from the contract's function parameters. |
61
61
62
-
You can also pass other arguments accepted by [writeContractAsync from starknet-react](https://starknet-react.com/hooks/mutation/usecontractwrite).
62
+
You can also pass other arguments accepted by [useSendTransaction#sendAsync from starknet-react](https://www.starknet-react.com/docs/hooks/use-send-transaction#sendasync).
63
63
64
64
## Return Values
65
65
66
-
-`writeContractAsync` function sends the transaction to the smart contract.
67
-
-`isMining` property indicates whether the transaction is currently being mined.
68
-
- The extended object includes properties inherited from the useContractWrite hook from starknet-react. You can check the [useContractWrite return values](https://starknet-react.com/hooks/mutation/usecontractwrite) for the types.
66
+
-`sendAsync` function sends the transaction(s) to the smart contract.
Copy file name to clipboardexpand all lines: docs/hooks/useScaffoldReadContract.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -27,9 +27,9 @@ This example retrieves the data returned by the `userGreetingCounter` function o
27
27
|**watch** (optional) |`boolean`| Watches and refreshes data on new blocks. (default : `true`) |
28
28
| Other arguments |`various`| You can pass other arguments accepted by the useContractRead hook from @starknet-react/core. |
29
29
30
-
You can also pass other arguments accepted by [useContractRead from Starknet-react](https://starknet-react.com/hooks/query/usecontractread).
30
+
You can also pass other arguments accepted by [starknet-react useReadContract](https://www.starknet-react.com/docs/hooks/use-read-contract).
31
31
32
32
## Return Values
33
33
34
34
- The retrieved data is stored in the `data` property of the returned object.
35
-
- The extended object includes properties inherited from the useContractRead hook of starknet-react. You can check the [useContractRead return values](https://starknet-react.com/hooks/query/usecontractread) documentation for the types.
35
+
- The extended object includes properties inherited from the `useReadContract` hook of starknet-react. You can check the [useReadContract return values](https://www.starknet-react.com/docs/hooks/use-read-contract) documentation for the types.
|**contractName**|`string`| Name of the contract to write to. |
46
+
|**functionName**|`string`| Name of the function to call. |
47
+
|**args** (optional) |`unknown[]`| Array of arguments to pass to the function (if any). Types are inferred from the contract's function parameters. |
51
48
52
49
## Return Values
53
50
54
-
- The sendAsync method is used to send the write transaction. It returns a promise that resolves when the transaction is confirmed.
55
-
- The extended object includes properties inherited from the useContractWrite hook of starknet-react. You can check the [useContractWrite return values](https://starknet-react.com/hooks/mutation/usecontractwrite) documentation for the types.
51
+
- The `sendAsync` method is used to send the write transaction. It returns a promise that resolves when the transaction is confirmed.
52
+
- The extended object includes properties inherited from the `useSendTransaction` hook of starknet-react. You can check their [documentation](https://www.starknet-react.com/docs/hooks/use-send-transaction#sendasync)for the the sepcific return values.
0 commit comments