Commit f185c7c
feat(account-config): hasSpendingRules flag + multicall view (lambda-parity PR 3)
The on-chain zero-latency gate for per-key spending rules. All additive and
storage-safe: a new mapping appended to the END of root AccountConfigStorage
(not a field on the inline-embedded UsageApiKey struct, which would shift the
Account layout).
- AppStorage: append `mapping(uint256 => bool) usageKeyHasSpendingRules`.
- ViewsFacet: `getSpendingRulesFlag(apiKeyHash)` and
`canExecuteActionWithSpendingRules(apiKeyHash, cidHash) -> (canExecute,
hasSpendingRules)` so the gateway reads both in one RPC.
- WritesFacet: `setSpendingRulesFlag(accountApiKeyHash, usageApiKeyHash, bool)`
+ event, same account-access control as setUsageApiKey.
Source only; `forge build` passes. Regenerate the Rust bindings + diamond ABI
with `make generate` on the canonical toolchain, then deploy via Safe diamond-cut
on Base (both ops steps). The gateway reads the new view through a scoped sol!
interface, so it does not depend on the regenerated giant binding.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 71eb95c commit f185c7c
3 files changed
Lines changed: 57 additions & 0 deletions
File tree
- lit-api-server/blockchain/lit_node_express/contracts/AccountConfigFacets
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
408 | 431 | | |
409 | 432 | | |
410 | 433 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
321 | 326 | | |
322 | 327 | | |
323 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
324 | 351 | | |
325 | 352 | | |
326 | 353 | | |
| |||
0 commit comments