Commit a7e7e3f
Add SKALE on Base network support and fix facilitator fee calculation (#197)
* Add SKALE on Base network support and fix facilitator fee calculation
## Network Configuration
- Add SKALE on Base (eip155:1187947933, chainId: 1187947933)
- Add SKALE Base Sepolia (eip155:324705682, chainId: 324705682)
- Configure USDC (Bridged USDC with EIP-712 verification)
- Configure CREDIT token pricing: $0.25 (1 USD = 4 CREDIT)
## Shared Network Configuration
- Create networks.json generation script from TypeScript source
- Update deploy-contract.sh to support CAIP-2 network identifiers
- Add getNetworkAlias import for network name matching
## Facilitator Improvements
- Fix native token price matching for SKALE networks
- Convert CAIP-2 IDs to aliases before price matching
- Add CREDIT token price configuration
## Deployed Contracts (SKALE on Base)
- SettlementRouter: 0x1Ae0E196dC18355aF3a19985faf67354213F833D
- TransferHook: 0x2f05fe5674aE756E25C26855258B4877E9e021Fd
- NFTMintHook: 0x73fc659Cd5494E69852bE8D9D23FE05Aab14b29B
- RandomNFT: 0x081258287F692D61575387ee2a4075f34dd7Aef7
- RewardHook: 0xC20634ea518985901e32Fbc1bA27fa673D37601A
- RewardToken: 0x9Fc2c199170B039f093ABCd54008038F0C0a31d6
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Fix review comments: standardize native token naming and alias precedence
## Fix 1: Standardize nativeToken to "CREDIT" for SKALE networks
- Change SKALE Base Sepolia nativeToken from "Credits" to "CREDIT"
- Update chains.ts nativeCurrency.symbol from "sFUEL" to "CREDIT"
- Update networks.ts metadata.nativeToken to "CREDIT"
- Ensure consistency across all SKALE network configurations
## Fix 2: Ensure canonical network aliases take precedence
- Reorder NETWORK_ALIASES_V1_TO_V2 to place canonical aliases after legacy ones
- This ensures "x-layer-testnet" and "x-layer" override "xlayer-testnet" and "xlayer"
- Prevents non-canonical aliases from being returned by getNetworkAlias()
## Impact
These changes ensure:
1. Consistent native token naming across all SKALE networks
2. Reverse mapping (CAIP-2 -> alias) returns canonical aliases
3. Generated networks.json uses correct token symbols
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Fix network alignment tests for legacy aliases support
## Changes
### Update test expectations for legacy aliases
- Add "skale-base" to EXPECTED_V1_NETWORKS (was missing)
- Add LEGACY_V1_ALIASES constant for backward compatibility aliases
- Create ALL_EXPECTED_ALIASES combining canonical and legacy
### Update test logic to handle non-bijective mappings
- "should have v2 mappings" test: Verify total alias count includes legacy ones
- "should have no duplicate" test: Allow CAIP-2 duplicates for legacy aliases
- "should have bijective relationship" test: Only test canonical aliases
- "toCanonicalNetworkKey" test: Add legacy alias test cases
## Rationale
Legacy aliases (xlayer-testnet, xlayer) are intentionally supported for
backward compatibility. This means v1 names are no longer in a strict
one-to-one relationship with CAIP-2 IDs. Tests now reflect this reality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: jolestar <host-user@example.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent e2edc3b commit a7e7e3f
File tree
14 files changed
+1544
-252
lines changed- contracts
- facilitator/src
- typescript/packages/extensions
- scripts
- src
14 files changed
+1544
-252
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
20 | 77 | | |
21 | 78 | | |
22 | 79 | | |
23 | 80 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 81 | + | |
| 82 | + | |
32 | 83 | | |
33 | 84 | | |
34 | 85 | | |
| |||
45 | 96 | | |
46 | 97 | | |
47 | 98 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
56 | 108 | | |
57 | 109 | | |
58 | 110 | | |
| |||
76 | 128 | | |
77 | 129 | | |
78 | 130 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 131 | | |
84 | 132 | | |
85 | 133 | | |
| |||
127 | 175 | | |
128 | 176 | | |
129 | 177 | | |
130 | | - | |
| 178 | + | |
131 | 179 | | |
132 | 180 | | |
133 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
134 | 187 | | |
135 | 188 | | |
136 | 189 | | |
| |||
141 | 194 | | |
142 | 195 | | |
143 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
144 | 214 | | |
145 | 215 | | |
146 | 216 | | |
147 | 217 | | |
148 | 218 | | |
149 | 219 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
235 | 228 | | |
236 | 229 | | |
237 | 230 | | |
| |||
243 | 236 | | |
244 | 237 | | |
245 | 238 | | |
246 | | - | |
| 239 | + | |
247 | 240 | | |
248 | 241 | | |
249 | 242 | | |
250 | | - | |
| 243 | + | |
251 | 244 | | |
252 | | - | |
| 245 | + | |
253 | 246 | | |
254 | 247 | | |
255 | 248 | | |
| |||
342 | 335 | | |
343 | 336 | | |
344 | 337 | | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
358 | 343 | | |
359 | 344 | | |
360 | 345 | | |
361 | 346 | | |
362 | 347 | | |
363 | 348 | | |
364 | 349 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
| 350 | + | |
| 351 | + | |
370 | 352 | | |
371 | 353 | | |
372 | 354 | | |
373 | | - | |
| 355 | + | |
| 356 | + | |
374 | 357 | | |
375 | 358 | | |
376 | 359 | | |
377 | 360 | | |
378 | 361 | | |
379 | 362 | | |
380 | 363 | | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
| 364 | + | |
| 365 | + | |
391 | 366 | | |
392 | 367 | | |
393 | 368 | | |
394 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
395 | 374 | | |
396 | 375 | | |
397 | 376 | | |
398 | 377 | | |
399 | 378 | | |
400 | 379 | | |
401 | | - | |
| 380 | + | |
402 | 381 | | |
403 | | - | |
| 382 | + | |
404 | 383 | | |
405 | 384 | | |
406 | 385 | | |
| |||
561 | 540 | | |
562 | 541 | | |
563 | 542 | | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
| 543 | + | |
587 | 544 | | |
588 | 545 | | |
0 commit comments