Commit e54dc37
committed
perf(contracts): optimize on-chain storage usage to reduce gas costs
Refactors Soroban contract storage patterns across the CrowdPass contracts
to minimize ledger entry count and storage rent costs.
- Replace string-based keys with symbol_short! equivalents
- Consolidate related data fields into packed storage structs
- Migrate transient data from persistent to temporary storage
- Add instance storage for frequently-read contract configuration
- Remove redundant storage reads via local variable caching
- Add TTL extension calls to prevent unintended entry expiration
Closes #2031 parent 10f5078 commit e54dc37
8 files changed
Lines changed: 324 additions & 233 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| |||
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
110 | | - | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
323 | 325 | | |
324 | 326 | | |
325 | 327 | | |
326 | | - | |
327 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
328 | 341 | | |
329 | 342 | | |
330 | 343 | | |
331 | | - | |
332 | | - | |
333 | 344 | | |
334 | 345 | | |
335 | 346 | | |
336 | 347 | | |
337 | 348 | | |
338 | 349 | | |
339 | | - | |
340 | 350 | | |
341 | 351 | | |
342 | 352 | | |
| |||
345 | 355 | | |
346 | 356 | | |
347 | 357 | | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
| |||
0 commit comments