create-stylus 0.1.4 ā 0.1.5
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/dist/cli.js +27 -0
- package/dist/cli.js.map +1 -1
- package/package.json +11 -2
- package/src/main.ts +11 -0
- package/src/tasks/config-to-sepolia.ts +25 -0
- package/src/tasks/index.ts +1 -0
- package/templates/base/package.json +10 -1
- package/templates/base/packages/nextjs/app/debug/_components/DebugContracts.tsx +15 -5
- package/templates/base/packages/nextjs/app/debug/_components/contract/ContractInput.tsx +3 -3
- package/templates/base/packages/nextjs/app/debug/_components/contract/ContractUI.tsx +103 -27
- package/templates/base/packages/nextjs/app/debug/_components/contract/DisplayVariable.tsx +15 -2
- package/templates/base/packages/nextjs/app/debug/_components/contract/ReadOnlyFunctionForm.tsx +11 -4
- package/templates/base/packages/nextjs/app/debug/_components/contract/TxReceipt.tsx +37 -21
- package/templates/base/packages/nextjs/app/debug/_components/contract/WriteOnlyFunctionForm.tsx +18 -16
- package/templates/base/packages/nextjs/app/layout.tsx +10 -4
- package/templates/base/packages/nextjs/components/AngularBorder.tsx +41 -0
- package/templates/base/packages/nextjs/components/Footer.tsx +153 -44
- package/templates/base/packages/nextjs/components/Header.tsx +73 -10
- package/templates/base/packages/nextjs/components/SwitchTheme.tsx +34 -3
- package/templates/base/packages/nextjs/components/scaffold-eth/Faucet.tsx +40 -5
- package/templates/base/packages/nextjs/components/scaffold-eth/Input/InputBase.tsx +1 -1
- package/templates/base/packages/nextjs/components/scaffold-eth/Input/IntegerInput.tsx +35 -25
- package/templates/base/packages/nextjs/components/scaffold-eth/RainbowKitCustomConnectButton/AngularWalletAddress.tsx +223 -0
- package/templates/base/packages/nextjs/components/scaffold-eth/RainbowKitCustomConnectButton/index.tsx +2 -1
- package/templates/base/packages/nextjs/icons/EthIcon.tsx +28 -0
- package/templates/base/packages/nextjs/package.json +9 -0
- package/templates/base/packages/nextjs/public/logo.svg +20 -7
- package/templates/base/packages/nextjs/styles/globals.css +333 -2
- package/templates/base/packages/nextjs/tailwind.config.js +3 -2
- package/templates/base/packages/nextjs/utils/scaffold-stylus/supportedChains.ts +1 -1
- package/templates/base/packages/stylus/package.json +9 -0
- package/templates/base/packages/stylus/scripts/deploy_contract.ts +1 -0
- package/templates/base/packages/stylus/scripts/test_network.ts +6 -7
- package/templates/base/packages/stylus/scripts/utils/contract.ts +6 -2
- package/templates/base/packages/stylus/scripts/utils/deployment.ts +1 -0
- package/templates/base/packages/stylus/scripts/utils/network.ts +23 -5
- package/templates/base/yarn.lock +837 -849
|
@@ -24,11 +24,11 @@ p {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.btn {
|
|
27
|
-
|
|
27
|
+
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.btn.btn-ghost {
|
|
31
|
-
|
|
31
|
+
box-shadow: none;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.border-color {
|
|
@@ -87,3 +87,334 @@ p {
|
|
|
87
87
|
linear-gradient(270deg, #e3066e 0%, #203147 108.63%) padding-box,
|
|
88
88
|
linear-gradient(90deg, var(--gradient-start) 0%, var(--gradient-end) 100%) border-box;
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
/* Figma Design Variables */
|
|
92
|
+
:root {
|
|
93
|
+
--spacing-md: 8px;
|
|
94
|
+
--spacing-lg: 12px;
|
|
95
|
+
--spacing-xl: 16px;
|
|
96
|
+
--spacing-2xl: 16px;
|
|
97
|
+
--spacing-4xl: 24px;
|
|
98
|
+
--spacing-7xl: 40px;
|
|
99
|
+
--stroke-sub-20: rgba(255, 255, 255, 0.20);
|
|
100
|
+
--bg-surface-surface-40: rgba(2, 2, 2, 0.40);
|
|
101
|
+
--bg-surface-input-20: rgba(255, 255, 255, 0.04);
|
|
102
|
+
--text-sub-600: rgba(255, 255, 255, 0.60);
|
|
103
|
+
--text-soft-400: rgba(255, 255, 255, 0.40);
|
|
104
|
+
--text-strong-950: #FFFFFF;
|
|
105
|
+
--figma-pink: #FF50A2;
|
|
106
|
+
--figma-sky-blue: #30B4ED;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Contract Card Styles */
|
|
110
|
+
.contract-card {
|
|
111
|
+
display: flex;
|
|
112
|
+
padding: var(--spacing-4xl, 24px);
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
align-items: center;
|
|
116
|
+
gap: var(--spacing-4xl, 24px);
|
|
117
|
+
align-self: stretch;
|
|
118
|
+
border-radius: var(--spacing-2xl, 16px);
|
|
119
|
+
border: 1px solid var(--stroke-sub-20, rgba(255, 255, 255, 0.20));
|
|
120
|
+
background: var(--bg-surface-surface-40, rgba(2, 2, 2, 0.40));
|
|
121
|
+
backdrop-filter: blur(25px);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.contract-title {
|
|
125
|
+
color: var(--figma-sky-blue);
|
|
126
|
+
font-size: 1.25rem;
|
|
127
|
+
font-weight: bold;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.contract-address {
|
|
131
|
+
color: white;
|
|
132
|
+
font-size: 0.875rem;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.contract-label {
|
|
136
|
+
color: white;
|
|
137
|
+
font-weight: bold;
|
|
138
|
+
font-size: 0.875rem;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.contract-value {
|
|
142
|
+
color: var(--figma-pink);
|
|
143
|
+
font-size: 0.875rem;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.variable-name {
|
|
147
|
+
color: var(--figma-sky-blue);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
[data-theme="light"] .variable-name {
|
|
151
|
+
color: rgba(24, 24, 24, 1);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Reusable Typography */
|
|
155
|
+
.typography-uppercase {
|
|
156
|
+
color: var(--text-sub-600, rgba(255, 255, 255, 0.60));
|
|
157
|
+
text-align: center;
|
|
158
|
+
font-family: var(--font-orbitron), sans-serif;
|
|
159
|
+
font-size: 14px;
|
|
160
|
+
font-style: normal;
|
|
161
|
+
font-weight: 700;
|
|
162
|
+
line-height: normal;
|
|
163
|
+
letter-spacing: -0.28px;
|
|
164
|
+
text-transform: uppercase;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Tab Container */
|
|
168
|
+
.tab-container {
|
|
169
|
+
border-radius: var(--spacing-md, 8px);
|
|
170
|
+
background: var(--bg-surface-input-20, rgba(255, 255, 255, 0.04));
|
|
171
|
+
backdrop-filter: blur(25px);
|
|
172
|
+
padding: 4px;
|
|
173
|
+
display: flex;
|
|
174
|
+
gap: 4px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Tab Button */
|
|
178
|
+
.tab-button {
|
|
179
|
+
flex: 1;
|
|
180
|
+
padding: 8px 16px;
|
|
181
|
+
border-radius: var(--spacing-md, 8px);
|
|
182
|
+
background: transparent;
|
|
183
|
+
border: none;
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
transition: all 0.2s ease;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.tab-button.active {
|
|
189
|
+
background: white;
|
|
190
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
[data-theme="light"] .tab-button.active {
|
|
194
|
+
background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(213, 213, 213, 1) 100%);
|
|
195
|
+
box-shadow: 0 2px 4px rgba(171, 171, 171, 1);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.tab-button.active .tab-text {
|
|
199
|
+
color: #333;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.tab-button:not(.active) .tab-text {
|
|
203
|
+
color: var(--text-sub-600, rgba(255, 255, 255, 0.60));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Function Styling */
|
|
207
|
+
.function-name {
|
|
208
|
+
color: var(--figma-sky-blue);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.param-type {
|
|
212
|
+
color: var(--text-sub-600, rgba(255, 255, 255, 0.60));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
[data-theme="light"] .param-name {
|
|
216
|
+
color: rgba(24, 24, 24, 1);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* Input Styling */
|
|
220
|
+
.input-container {
|
|
221
|
+
padding: var(--spacing-lg, 12px) var(--spacing-xl, 16px);
|
|
222
|
+
align-items: center;
|
|
223
|
+
gap: 8px;
|
|
224
|
+
align-self: stretch;
|
|
225
|
+
border-radius: var(--spacing-md, 8px);
|
|
226
|
+
background: var(--bg-surface-input-20, rgba(255, 255, 255, 0.04));
|
|
227
|
+
backdrop-filter: blur(25px);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* Light mode input styling */
|
|
231
|
+
[data-theme="light"] .input-container {
|
|
232
|
+
background: rgba(0, 0, 0, 0.04);
|
|
233
|
+
backdrop-filter: none;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.input-text {
|
|
237
|
+
color: var(--text-soft-400, rgba(255, 255, 255, 0.40));
|
|
238
|
+
text-align: center;
|
|
239
|
+
font-family: Inter, sans-serif;
|
|
240
|
+
font-size: 14px;
|
|
241
|
+
font-style: normal;
|
|
242
|
+
font-weight: 500;
|
|
243
|
+
line-height: 20px;
|
|
244
|
+
letter-spacing: -0.14px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* Light mode input text styling */
|
|
248
|
+
[data-theme="light"] .input-text {
|
|
249
|
+
color: rgba(24, 24, 24, 0.4);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Input field overrides */
|
|
253
|
+
.input-container .flex.border-2.border-base-300.bg-base-200.rounded-full {
|
|
254
|
+
border-radius: var(--spacing-md, 8px) !important;
|
|
255
|
+
background: var(--bg-surface-input-20, rgba(255, 255, 255, 0.04)) !important;
|
|
256
|
+
backdrop-filter: blur(25px) !important;
|
|
257
|
+
border: none !important;
|
|
258
|
+
padding: var(--spacing-lg, 12px) var(--spacing-xl, 16px) !important;
|
|
259
|
+
gap: 8px !important;
|
|
260
|
+
align-items: center !important;
|
|
261
|
+
align-self: stretch !important;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/* Light mode input field overrides */
|
|
265
|
+
[data-theme="light"] .input-container .flex.border-2.border-base-300.bg-base-200.rounded-full {
|
|
266
|
+
background: rgba(0, 0, 0, 0.04) !important;
|
|
267
|
+
backdrop-filter: none !important;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.input-container .input.input-ghost {
|
|
271
|
+
background: transparent !important;
|
|
272
|
+
border: none !important;
|
|
273
|
+
color: white !important;
|
|
274
|
+
font-family: Inter, sans-serif !important;
|
|
275
|
+
font-size: 14px !important;
|
|
276
|
+
font-weight: 500 !important;
|
|
277
|
+
line-height: 20px !important;
|
|
278
|
+
letter-spacing: -0.14px !important;
|
|
279
|
+
text-align: left !important;
|
|
280
|
+
padding: 0 !important;
|
|
281
|
+
height: auto !important;
|
|
282
|
+
min-height: auto !important;
|
|
283
|
+
flex: 1 !important;
|
|
284
|
+
box-shadow: none !important;
|
|
285
|
+
outline: none !important;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/* Light mode input text color */
|
|
289
|
+
[data-theme="light"] .input-container .input.input-ghost {
|
|
290
|
+
color: rgba(24, 24, 24, 0.4) !important;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.input-container .input.input-ghost:focus,
|
|
294
|
+
.input-container .input.input-ghost::placeholder {
|
|
295
|
+
background: transparent !important;
|
|
296
|
+
border: none !important;
|
|
297
|
+
box-shadow: none !important;
|
|
298
|
+
outline: none !important;
|
|
299
|
+
color: var(--text-soft-400, rgba(255, 255, 255, 0.40)) !important;
|
|
300
|
+
font-family: Inter, sans-serif !important;
|
|
301
|
+
font-size: 14px !important;
|
|
302
|
+
font-weight: 500 !important;
|
|
303
|
+
line-height: 20px !important;
|
|
304
|
+
letter-spacing: -0.14px !important;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/* Light mode input placeholder and focus color */
|
|
308
|
+
[data-theme="light"] .input-container .input.input-ghost::placeholder {
|
|
309
|
+
color: rgba(24, 24, 24, 0.4) !important;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* Input text color when typing - light mode */
|
|
313
|
+
[data-theme="light"] .input-container .input.input-ghost:focus,
|
|
314
|
+
[data-theme="light"] .input-container .input.input-ghost:not(:placeholder-shown) {
|
|
315
|
+
color: rgba(24, 24, 24, 1) !important;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/* Input text color when typing - dark mode */
|
|
319
|
+
[data-theme="dark"] .input-container .input.input-ghost:focus,
|
|
320
|
+
[data-theme="dark"] .input-container .input.input-ghost:not(:placeholder-shown) {
|
|
321
|
+
color: white !important;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/* Button Styles */
|
|
325
|
+
.send-button {
|
|
326
|
+
display: flex;
|
|
327
|
+
padding: 8px var(--spacing-7xl, 40px);
|
|
328
|
+
justify-content: center;
|
|
329
|
+
align-items: center;
|
|
330
|
+
gap: 10px;
|
|
331
|
+
border-radius: var(--spacing-md, 8px);
|
|
332
|
+
background: linear-gradient(180deg, #FC3592 0%, #E3066E 100%);
|
|
333
|
+
color: var(--text-strong-950, #FFF);
|
|
334
|
+
text-align: center;
|
|
335
|
+
font-family: var(--font-orbitron), sans-serif;
|
|
336
|
+
font-size: 14px;
|
|
337
|
+
font-style: normal;
|
|
338
|
+
font-weight: 700;
|
|
339
|
+
line-height: normal;
|
|
340
|
+
letter-spacing: -0.28px;
|
|
341
|
+
text-transform: uppercase;
|
|
342
|
+
border: none;
|
|
343
|
+
cursor: pointer;
|
|
344
|
+
transition: all 0.2s ease;
|
|
345
|
+
position: relative;
|
|
346
|
+
box-shadow: 0 2px 0 #FF9CCB, 0 4px 8px rgba(255, 156, 203, 0.3);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.send-button:hover {
|
|
350
|
+
opacity: 0.9;
|
|
351
|
+
transform: translateY(-1px);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.send-button:disabled {
|
|
355
|
+
opacity: 0.6;
|
|
356
|
+
cursor: not-allowed;
|
|
357
|
+
transform: none;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.read-button {
|
|
361
|
+
display: flex;
|
|
362
|
+
padding: 8px var(--spacing-7xl, 40px);
|
|
363
|
+
justify-content: center;
|
|
364
|
+
align-items: center;
|
|
365
|
+
gap: 10px;
|
|
366
|
+
border-radius: var(--spacing-md, 8px);
|
|
367
|
+
background: linear-gradient(180deg, #FC3592 0%, #E3066E 100%);
|
|
368
|
+
color: var(--text-strong-950, #FFF);
|
|
369
|
+
text-align: center;
|
|
370
|
+
font-family: var(--font-orbitron), sans-serif;
|
|
371
|
+
font-size: 14px;
|
|
372
|
+
font-style: normal;
|
|
373
|
+
font-weight: 700;
|
|
374
|
+
line-height: normal;
|
|
375
|
+
letter-spacing: -0.28px;
|
|
376
|
+
text-transform: uppercase;
|
|
377
|
+
border: none;
|
|
378
|
+
cursor: pointer;
|
|
379
|
+
transition: all 0.2s ease;
|
|
380
|
+
position: relative;
|
|
381
|
+
box-shadow: 0 2px 0 #FF9CCB, 0 4px 8px rgba(255, 156, 203, 0.3);
|
|
382
|
+
margin-left: auto;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.read-button:hover {
|
|
386
|
+
opacity: 0.9;
|
|
387
|
+
transform: translateY(-1px);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.read-button:disabled {
|
|
391
|
+
opacity: 0.6;
|
|
392
|
+
cursor: not-allowed;
|
|
393
|
+
transform: none;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* Typography Utilities */
|
|
397
|
+
.text-inter {
|
|
398
|
+
font-family: Inter, sans-serif;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.text-inter-14 {
|
|
402
|
+
font-family: Inter, sans-serif;
|
|
403
|
+
font-size: 14px;
|
|
404
|
+
font-weight: 500;
|
|
405
|
+
line-height: 20px;
|
|
406
|
+
letter-spacing: -0.14px;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/* Contract Tab Button Styles */
|
|
410
|
+
.contract-tab-button {
|
|
411
|
+
padding: 8px 16px;
|
|
412
|
+
border-radius: 9999px;
|
|
413
|
+
font-family: Inter, sans-serif;
|
|
414
|
+
font-weight: 500;
|
|
415
|
+
transition: all 0.2s ease;
|
|
416
|
+
cursor: pointer;
|
|
417
|
+
display: flex;
|
|
418
|
+
align-items: center;
|
|
419
|
+
gap: 8px;
|
|
420
|
+
}
|
|
@@ -88,7 +88,8 @@ module.exports = {
|
|
|
88
88
|
theme: {
|
|
89
89
|
extend: {
|
|
90
90
|
fontFamily: {
|
|
91
|
-
sans: ["var(--font-
|
|
91
|
+
sans: ["var(--font-inter)", "system-ui", "sans-serif"],
|
|
92
|
+
orbitron: ["var(--font-orbitron)", "sans-serif"],
|
|
92
93
|
},
|
|
93
94
|
boxShadow: {
|
|
94
95
|
center: "0 0 12px -2px rgb(0 0 0 / 0.05)",
|
|
@@ -98,4 +99,4 @@ module.exports = {
|
|
|
98
99
|
},
|
|
99
100
|
},
|
|
100
101
|
},
|
|
101
|
-
};
|
|
102
|
+
};
|
|
@@ -25,6 +25,15 @@
|
|
|
25
25
|
],
|
|
26
26
|
"author": "",
|
|
27
27
|
"license": "MIT",
|
|
28
|
+
"overrides": {
|
|
29
|
+
"chalk": "5.3.0",
|
|
30
|
+
"strip-ansi": "7.1.0",
|
|
31
|
+
"color-convert": "2.0.1",
|
|
32
|
+
"color-name": "1.1.4",
|
|
33
|
+
"is-core-module": "2.13.1",
|
|
34
|
+
"error-ex": "1.3.2",
|
|
35
|
+
"has-ansi": "5.0.1"
|
|
36
|
+
},
|
|
28
37
|
"devDependencies": {
|
|
29
38
|
"@types/node": "^20.0.0",
|
|
30
39
|
"@types/yargs": "^17.0.32",
|
|
@@ -110,6 +110,7 @@ export default async function deployStylusContract(
|
|
|
110
110
|
address: deploymentInfo.address,
|
|
111
111
|
abi: contractData.abi as Abi,
|
|
112
112
|
functionName: "initialize",
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
113
114
|
args: deployOptions.constructorArgs as any[],
|
|
114
115
|
});
|
|
115
116
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getChain, getRpcUrlFromChain } from "./utils/";
|
|
1
|
+
import { getChain, getRpcUrlFromChain, ALIASES } from "./utils/";
|
|
2
2
|
import { SUPPORTED_NETWORKS } from "./utils/";
|
|
3
3
|
|
|
4
4
|
function testNetworkFunctionality() {
|
|
@@ -18,14 +18,13 @@ function testNetworkFunctionality() {
|
|
|
18
18
|
console.log("\nš Usage examples:");
|
|
19
19
|
Object.keys(SUPPORTED_NETWORKS).forEach((network) => {
|
|
20
20
|
const chain = getChain(network);
|
|
21
|
+
// Find the alias for this network (reverse lookup)
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
|
+
const alias = Object.entries(ALIASES).find(([_, value]) => value === network)?.[0];
|
|
24
|
+
const networkName = alias || network;
|
|
21
25
|
console.log(
|
|
22
|
-
` yarn deploy --network ${
|
|
26
|
+
` yarn deploy --network ${networkName}\t# Deploy to ${chain?.name}`,
|
|
23
27
|
);
|
|
24
|
-
|
|
25
|
-
// TODO: determine which one to use later, for now we use all original names
|
|
26
|
-
// console.log(
|
|
27
|
-
// ` yarn deploy --network ${chain?.alias}\t\t# Deploy to ${chain?.name} (alias)`,
|
|
28
|
-
// );
|
|
29
28
|
});
|
|
30
29
|
}
|
|
31
30
|
|
|
@@ -27,6 +27,7 @@ export function getContractNameFromCargoToml(contractFolder: string): string {
|
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
29
|
const tomlContent = fs.readFileSync(cargoTomlPath, "utf8");
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
31
|
let parsed: any;
|
|
31
32
|
try {
|
|
32
33
|
parsed = toml.parse(tomlContent);
|
|
@@ -163,6 +164,7 @@ export async function generateTsAbi(
|
|
|
163
164
|
abi: abiJson,
|
|
164
165
|
};
|
|
165
166
|
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
168
|
let deployedContractsObj: any = {};
|
|
167
169
|
const fileHeader = generatedContractComment + "\n\n";
|
|
168
170
|
|
|
@@ -240,7 +242,7 @@ export function handleSolcError(
|
|
|
240
242
|
* This is useful when the file has been updated during runtime
|
|
241
243
|
* @returns The deployed contracts object
|
|
242
244
|
*/
|
|
243
|
-
export function loadDeployedContracts()
|
|
245
|
+
export function loadDeployedContracts() {
|
|
244
246
|
const deployedContractsPath = "../nextjs/contracts/deployedContracts.ts";
|
|
245
247
|
|
|
246
248
|
if (!fs.existsSync(deployedContractsPath)) {
|
|
@@ -266,7 +268,7 @@ export function loadDeployedContracts(): any {
|
|
|
266
268
|
* @param contractName - The contract name
|
|
267
269
|
* @returns The contract data with address, txHash, and abi
|
|
268
270
|
*/
|
|
269
|
-
export function getContractData(chainId: string, contractName: string)
|
|
271
|
+
export function getContractData(chainId: string, contractName: string) {
|
|
270
272
|
const deployedContracts = loadDeployedContracts();
|
|
271
273
|
|
|
272
274
|
if (
|
|
@@ -289,6 +291,8 @@ export function getContractData(chainId: string, contractName: string): any {
|
|
|
289
291
|
return contractData;
|
|
290
292
|
}
|
|
291
293
|
|
|
294
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
292
295
|
export function contractHasInitializeFunction(contractData: any): boolean {
|
|
296
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
293
297
|
return contractData.abi.some((abi: any) => abi.name === "initialize");
|
|
294
298
|
}
|
|
@@ -104,6 +104,7 @@ export function saveDeployment(
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// Read existing deployments or start fresh
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
107
108
|
let deployments: Record<string, any> = {};
|
|
108
109
|
if (fs.existsSync(networkPath)) {
|
|
109
110
|
const content = fs.readFileSync(networkPath, "utf8");
|
|
@@ -32,10 +32,10 @@ export const ALIASES: Record<string, string> = {
|
|
|
32
32
|
sepolia: "arbitrumSepolia",
|
|
33
33
|
devnet: "arbitrumNitro",
|
|
34
34
|
nova: "arbitrumNova",
|
|
35
|
-
|
|
35
|
+
educhainTesnet: "eduChainTestnet",
|
|
36
36
|
educhain: "eduChain",
|
|
37
37
|
superposition: "superposition",
|
|
38
|
-
|
|
38
|
+
superpositionTestnet: "superpositionTestnet",
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
// TODO: add more compatible Orbit Chains here
|
|
@@ -48,7 +48,13 @@ export const ORBIT_CHAINS: Chain[] = [
|
|
|
48
48
|
|
|
49
49
|
export function getChain(networkName: string): Chain | null {
|
|
50
50
|
try {
|
|
51
|
-
|
|
51
|
+
// First try exact match (for camelCase aliases)
|
|
52
|
+
let actualNetworkName = ALIASES[networkName] || networkName;
|
|
53
|
+
|
|
54
|
+
// If no exact match, try lowercase match (for backward compatibility)
|
|
55
|
+
if (actualNetworkName === networkName) {
|
|
56
|
+
actualNetworkName = ALIASES[networkName.toLowerCase()] || networkName;
|
|
57
|
+
}
|
|
52
58
|
|
|
53
59
|
const chainEntry = Object.entries(SUPPORTED_NETWORKS).find(
|
|
54
60
|
([key]) => key.toLowerCase() === actualNetworkName.toLowerCase(),
|
|
@@ -68,7 +74,13 @@ export function getChain(networkName: string): Chain | null {
|
|
|
68
74
|
}
|
|
69
75
|
|
|
70
76
|
export function getPrivateKey(networkName: string): string {
|
|
71
|
-
|
|
77
|
+
// First try exact match (for camelCase aliases)
|
|
78
|
+
let actualNetworkName = ALIASES[networkName] || networkName;
|
|
79
|
+
|
|
80
|
+
// If no exact match, try lowercase match (for backward compatibility)
|
|
81
|
+
if (actualNetworkName === networkName) {
|
|
82
|
+
actualNetworkName = ALIASES[networkName.toLowerCase()] || networkName;
|
|
83
|
+
}
|
|
72
84
|
|
|
73
85
|
switch (actualNetworkName.toLowerCase()) {
|
|
74
86
|
case "arbitrum":
|
|
@@ -122,7 +134,13 @@ export function getPrivateKey(networkName: string): string {
|
|
|
122
134
|
}
|
|
123
135
|
|
|
124
136
|
export const getAccountAddress = (networkName: string): Address | undefined => {
|
|
125
|
-
|
|
137
|
+
// First try exact match (for camelCase aliases)
|
|
138
|
+
let actualNetworkName = ALIASES[networkName] || networkName;
|
|
139
|
+
|
|
140
|
+
// If no exact match, try lowercase match (for backward compatibility)
|
|
141
|
+
if (actualNetworkName === networkName) {
|
|
142
|
+
actualNetworkName = ALIASES[networkName.toLowerCase()] || networkName;
|
|
143
|
+
}
|
|
126
144
|
|
|
127
145
|
switch (actualNetworkName.toLowerCase()) {
|
|
128
146
|
case "arbitrum":
|