create-stylus 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/templates/base/readme.md
CHANGED
|
@@ -26,6 +26,16 @@ Before you begin, you need to install the following tools:
|
|
|
26
26
|
- [Git](https://git-scm.com/downloads)
|
|
27
27
|
- [Docker](https://docs.docker.com/engine/install/)
|
|
28
28
|
- [Foundry Cast](https://getfoundry.sh/)
|
|
29
|
+
- [Solc (Solidity compiler)](https://docs.soliditylang.org/en/latest/installing-solidity.html)
|
|
30
|
+
|
|
31
|
+
> **Note: Windows Compatibility**
|
|
32
|
+
>
|
|
33
|
+
> Scaffold-Stylus currently does not support Windows natively. If you're using Windows, we recommend:
|
|
34
|
+
>
|
|
35
|
+
> - **Use WSL (Windows Subsystem for Linux)** - Install WSL2 and run Scaffold-Stylus within the Linux environment
|
|
36
|
+
> - **Switch to Linux or macOS** - For the best development experience
|
|
37
|
+
>
|
|
38
|
+
> For WSL setup, follow the [Microsoft WSL installation guide](https://docs.microsoft.com/en-us/windows/wsl/install).
|
|
29
39
|
|
|
30
40
|
## Quickstart
|
|
31
41
|
|
|
@@ -161,7 +171,30 @@ yarn new-module <contract-name>
|
|
|
161
171
|
|
|
162
172
|
The generated contract will be located in `packages/stylus/<contract-name>`.
|
|
163
173
|
|
|
164
|
-
### Step 2:
|
|
174
|
+
### Step 2: Validate Your Contract Before Deployment
|
|
175
|
+
|
|
176
|
+
Before deploying, it's recommended to validate your contract size using `cargo stylus check`:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
cd packages/stylus/<contract-name>
|
|
180
|
+
cargo stylus check
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
This command performs several important checks:
|
|
184
|
+
|
|
185
|
+
- **Contract size validation**: Ensures your contract doesn't exceed size limitations
|
|
186
|
+
- **WASM compilation**: Verifies your Rust code compiles to WebAssembly
|
|
187
|
+
- **Deployment hash computation**: Calculates the deployment hash
|
|
188
|
+
- **WASM data fee estimation**: Estimates the cost of deploying your contract
|
|
189
|
+
|
|
190
|
+
**Contract Size Indicators:**
|
|
191
|
+
|
|
192
|
+
- 🔴 **Red indicator**: Contract size exceeds limitations - **DO NOT DEPLOY**
|
|
193
|
+
- 🟡 **Yellow/🟢 Green indicator**: Contract size within acceptable limits - **OK to deploy**
|
|
194
|
+
|
|
195
|
+
> **Important:** When using constructors, error logs from constructor execution may not be visible. Consider using `initialize()` functions instead for better error visibility.
|
|
196
|
+
|
|
197
|
+
### Step 3: Deploy Your Contract
|
|
165
198
|
|
|
166
199
|
```bash
|
|
167
200
|
yarn deploy [...options]
|
|
@@ -221,6 +254,14 @@ To deploy your contracts to other networks (other than the default local Nitro d
|
|
|
221
254
|
targetNetworks: [chains.arbitrumSepolia],
|
|
222
255
|
```
|
|
223
256
|
|
|
257
|
+
### Arbitrum Testnet Faucets (Optional)
|
|
258
|
+
|
|
259
|
+
For Arbitrum testnets, you may need testnet ETH to deploy contracts. You can obtain testnet tokens from these faucets:
|
|
260
|
+
|
|
261
|
+
- [Chainlink Faucet](https://faucets.chain.link/arbitrum-sepolia)
|
|
262
|
+
- [QuickNode Faucet](https://faucet.quicknode.com/arbitrum/sepolia)
|
|
263
|
+
- [Alchemy Faucet](https://sepoliafaucet.com/)
|
|
264
|
+
|
|
224
265
|
### Available Networks
|
|
225
266
|
|
|
226
267
|
This template supports Arbitrum networks only. You can test which networks are available and their RPC URLs:
|