@agenticprimitives/contracts 1.0.0-alpha.11 → 1.0.0-alpha.13

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/AUDIT.md CHANGED
@@ -65,7 +65,8 @@ This package ships the **on-chain enforcement layer** for the agenticprimitives
65
65
 
66
66
  ### 3.2 `agency/DelegationManager.sol` + `enforcers/*`
67
67
 
68
- - **5 enforcers.** AllowedMethods, AllowedTargets, Timestamp, Value, Quorum. All five are **stateless validators**: `beforeHook` / `afterHook` are pure / view, no SSTORE, no events. Invariant locked in `test/EnforcerPauseInvariantR67.t.sol` (R6.7) — see § 3.3.
68
+ - **5 stateless enforcers.** AllowedMethods, AllowedTargets, Timestamp, Value, Quorum. All five are **stateless validators**: `beforeHook` / `afterHook` are pure / view, no SSTORE, no events — safe to call externally. Invariant locked in `test/EnforcerPauseInvariantR67.t.sol` (R6.7) — see § 3.3.
69
+ - **PaymentEnforcer is the STATEFUL exception (EXT-PMT-1, was C-NEW-1).** It SSTOREs budget/nonce and writes a settlement receipt, so it is explicitly NOT safe to call externally. It is bound to an immutable `delegationManager` at construction and both hooks carry `onlyDelegationManager`; a direct caller reverts `NotDelegationManager` and can neither forge a `PaymentSettled` receipt nor grief the victim's budget/nonce. Fail-closed regression: `test/PaymentEnforcer.t.sol::test_EXTPMT1_*`. (Pre-fix, the unbound `beforeHook` let any EOA forge receipts + burn nonces — see `docs/audits/findings.yaml` EXT-PMT-1.)
69
70
  - **EIP-712 Caveat typehash** = `keccak256("Caveat(address enforcer,bytes terms)")` — EXCLUDES `args` (audit F-1 — the inclusion bug caused every caveat-carrying delegation to fail on-chain ERC-1271 redeem AND let a redeemer's chosen args ride inside the delegator's signature). `packages/delegation/src/hash.ts` mirrors this.
70
71
  - **Test posture:** DelegationManager 95.8% lines / 88.2% branches (post-R6 aggregator).
71
72
  - **QuorumEnforcer:** payload-hash binding closed in H7 (`QuorumEnforcer.sol` checks `keccak256(args) == decoded_payload_hash`). R6.9 aggregator confirms 95.5% lines / 100% branches.
@@ -5,6 +5,7 @@
5
5
  "agentNameResolver": "0xcC9855A23C7a4D4592E68Fe47E195C2f9D832473",
6
6
  "agentNameUniversalResolver": "0x7d777d2d0bbc1806B9Cc779121C27fbaAaFDb60b",
7
7
  "agentProfileResolver": "0xc448EB159B2a35F07f6E1814CC8d125244d7384B",
8
+ "agentRegistryBase": "0xe320947b18D3C71710DCB75D4bf200147ded18Df",
8
9
  "agentRelationship": "0xE6B8F6C7F1c9857013dA356DF08D0384334A9607",
9
10
  "agreementRegistry": "0x7f4d6A74eda1D6ce251D371566f1c6639F9B0DDa",
10
11
  "allowedMethodsEnforcer": "0xf77cf06aCd8b9e2f3204fe4bE16449B3594c9633",
@@ -29,8 +30,8 @@
29
30
  "timestampEnforcer": "0x7c452434314A5bf2048f9263aeCd0cC20Fa07965",
30
31
  "universalSignatureValidator": "0xe8F3e531429F44D77dC3A331C18032bfa1550D84",
31
32
  "valueEnforcer": "0x7c4533e0A9fB0B1cb5aa70327b222a80d72d52db",
32
- "paymentEnforcer": "0xAF48273e11435cC2D56f4AFBfD091Abb162458E9",
33
- "paymentReceiptRegistry": "0x366616E265cd3cDE0F042A592C17838fe210D1d4",
33
+ "paymentEnforcer": "0xCB5D2dbfc11e146d568764471516C9DB734D2c60",
34
+ "paymentReceiptRegistry": "0x391Ed4D7538f80a221F910539005bB00b996Ff9F",
34
35
  "mockUsdc": "0x8fb56ff3C13347DFC4E1287aE83E88deE5a7211C",
35
- "paymentEscrow": "0x954Ba6B3A02E02c5a3Fcd570943126633071cbdD"
36
+ "paymentEscrow": "0xC85EB1831e9180F5e2cA7854f362f6C9a6D727EA"
36
37
  }
@@ -0,0 +1,588 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "EPOCH_SECONDS",
5
+ "inputs": [],
6
+ "outputs": [
7
+ {
8
+ "name": "",
9
+ "type": "uint64",
10
+ "internalType": "uint64"
11
+ }
12
+ ],
13
+ "stateMutability": "view"
14
+ },
15
+ {
16
+ "type": "function",
17
+ "name": "createRegistry",
18
+ "inputs": [
19
+ {
20
+ "name": "registryId",
21
+ "type": "bytes32",
22
+ "internalType": "bytes32"
23
+ },
24
+ {
25
+ "name": "policy",
26
+ "type": "address",
27
+ "internalType": "address"
28
+ }
29
+ ],
30
+ "outputs": [],
31
+ "stateMutability": "nonpayable"
32
+ },
33
+ {
34
+ "type": "function",
35
+ "name": "getClaim",
36
+ "inputs": [
37
+ {
38
+ "name": "registryId",
39
+ "type": "bytes32",
40
+ "internalType": "bytes32"
41
+ },
42
+ {
43
+ "name": "entryId",
44
+ "type": "bytes32",
45
+ "internalType": "bytes32"
46
+ },
47
+ {
48
+ "name": "claimSlotId",
49
+ "type": "bytes32",
50
+ "internalType": "bytes32"
51
+ }
52
+ ],
53
+ "outputs": [
54
+ {
55
+ "name": "",
56
+ "type": "bytes32",
57
+ "internalType": "bytes32"
58
+ }
59
+ ],
60
+ "stateMutability": "view"
61
+ },
62
+ {
63
+ "type": "function",
64
+ "name": "getEntry",
65
+ "inputs": [
66
+ {
67
+ "name": "registryId",
68
+ "type": "bytes32",
69
+ "internalType": "bytes32"
70
+ },
71
+ {
72
+ "name": "entryId",
73
+ "type": "bytes32",
74
+ "internalType": "bytes32"
75
+ }
76
+ ],
77
+ "outputs": [
78
+ {
79
+ "name": "",
80
+ "type": "tuple",
81
+ "internalType": "struct AgentRegistryBase.Entry",
82
+ "components": [
83
+ {
84
+ "name": "subjectAgent",
85
+ "type": "address",
86
+ "internalType": "address"
87
+ },
88
+ {
89
+ "name": "cardHash",
90
+ "type": "bytes32",
91
+ "internalType": "bytes32"
92
+ },
93
+ {
94
+ "name": "bindingProofHash",
95
+ "type": "bytes32",
96
+ "internalType": "bytes32"
97
+ },
98
+ {
99
+ "name": "claimsRoot",
100
+ "type": "bytes32",
101
+ "internalType": "bytes32"
102
+ },
103
+ {
104
+ "name": "status",
105
+ "type": "uint8",
106
+ "internalType": "enum AgentRegistryBase.EntryStatus"
107
+ },
108
+ {
109
+ "name": "registeredAtBucket",
110
+ "type": "uint64",
111
+ "internalType": "uint64"
112
+ },
113
+ {
114
+ "name": "expiresAt",
115
+ "type": "uint64",
116
+ "internalType": "uint64"
117
+ }
118
+ ]
119
+ }
120
+ ],
121
+ "stateMutability": "view"
122
+ },
123
+ {
124
+ "type": "function",
125
+ "name": "getRegistry",
126
+ "inputs": [
127
+ {
128
+ "name": "registryId",
129
+ "type": "bytes32",
130
+ "internalType": "bytes32"
131
+ }
132
+ ],
133
+ "outputs": [
134
+ {
135
+ "name": "",
136
+ "type": "tuple",
137
+ "internalType": "struct AgentRegistryBase.Registry",
138
+ "components": [
139
+ {
140
+ "name": "controller",
141
+ "type": "address",
142
+ "internalType": "address"
143
+ },
144
+ {
145
+ "name": "policy",
146
+ "type": "address",
147
+ "internalType": "address"
148
+ },
149
+ {
150
+ "name": "exists",
151
+ "type": "bool",
152
+ "internalType": "bool"
153
+ }
154
+ ]
155
+ }
156
+ ],
157
+ "stateMutability": "view"
158
+ },
159
+ {
160
+ "type": "function",
161
+ "name": "isActive",
162
+ "inputs": [
163
+ {
164
+ "name": "registryId",
165
+ "type": "bytes32",
166
+ "internalType": "bytes32"
167
+ },
168
+ {
169
+ "name": "entryId",
170
+ "type": "bytes32",
171
+ "internalType": "bytes32"
172
+ }
173
+ ],
174
+ "outputs": [
175
+ {
176
+ "name": "",
177
+ "type": "bool",
178
+ "internalType": "bool"
179
+ }
180
+ ],
181
+ "stateMutability": "view"
182
+ },
183
+ {
184
+ "type": "function",
185
+ "name": "registerEntry",
186
+ "inputs": [
187
+ {
188
+ "name": "registryId",
189
+ "type": "bytes32",
190
+ "internalType": "bytes32"
191
+ },
192
+ {
193
+ "name": "entryId",
194
+ "type": "bytes32",
195
+ "internalType": "bytes32"
196
+ },
197
+ {
198
+ "name": "subjectAgent",
199
+ "type": "address",
200
+ "internalType": "address"
201
+ },
202
+ {
203
+ "name": "cardHash",
204
+ "type": "bytes32",
205
+ "internalType": "bytes32"
206
+ },
207
+ {
208
+ "name": "bindingProofHash",
209
+ "type": "bytes32",
210
+ "internalType": "bytes32"
211
+ },
212
+ {
213
+ "name": "claimHashes",
214
+ "type": "bytes32[]",
215
+ "internalType": "bytes32[]"
216
+ },
217
+ {
218
+ "name": "expiresAt",
219
+ "type": "uint64",
220
+ "internalType": "uint64"
221
+ }
222
+ ],
223
+ "outputs": [],
224
+ "stateMutability": "nonpayable"
225
+ },
226
+ {
227
+ "type": "function",
228
+ "name": "renewEntry",
229
+ "inputs": [
230
+ {
231
+ "name": "registryId",
232
+ "type": "bytes32",
233
+ "internalType": "bytes32"
234
+ },
235
+ {
236
+ "name": "entryId",
237
+ "type": "bytes32",
238
+ "internalType": "bytes32"
239
+ },
240
+ {
241
+ "name": "expiresAt",
242
+ "type": "uint64",
243
+ "internalType": "uint64"
244
+ }
245
+ ],
246
+ "outputs": [],
247
+ "stateMutability": "nonpayable"
248
+ },
249
+ {
250
+ "type": "function",
251
+ "name": "revokeEntry",
252
+ "inputs": [
253
+ {
254
+ "name": "registryId",
255
+ "type": "bytes32",
256
+ "internalType": "bytes32"
257
+ },
258
+ {
259
+ "name": "entryId",
260
+ "type": "bytes32",
261
+ "internalType": "bytes32"
262
+ },
263
+ {
264
+ "name": "reasonHash",
265
+ "type": "bytes32",
266
+ "internalType": "bytes32"
267
+ }
268
+ ],
269
+ "outputs": [],
270
+ "stateMutability": "nonpayable"
271
+ },
272
+ {
273
+ "type": "function",
274
+ "name": "setRegistryPolicy",
275
+ "inputs": [
276
+ {
277
+ "name": "registryId",
278
+ "type": "bytes32",
279
+ "internalType": "bytes32"
280
+ },
281
+ {
282
+ "name": "policy",
283
+ "type": "address",
284
+ "internalType": "address"
285
+ }
286
+ ],
287
+ "outputs": [],
288
+ "stateMutability": "nonpayable"
289
+ },
290
+ {
291
+ "type": "function",
292
+ "name": "suspendEntry",
293
+ "inputs": [
294
+ {
295
+ "name": "registryId",
296
+ "type": "bytes32",
297
+ "internalType": "bytes32"
298
+ },
299
+ {
300
+ "name": "entryId",
301
+ "type": "bytes32",
302
+ "internalType": "bytes32"
303
+ },
304
+ {
305
+ "name": "reasonHash",
306
+ "type": "bytes32",
307
+ "internalType": "bytes32"
308
+ }
309
+ ],
310
+ "outputs": [],
311
+ "stateMutability": "nonpayable"
312
+ },
313
+ {
314
+ "type": "function",
315
+ "name": "updateClaim",
316
+ "inputs": [
317
+ {
318
+ "name": "registryId",
319
+ "type": "bytes32",
320
+ "internalType": "bytes32"
321
+ },
322
+ {
323
+ "name": "entryId",
324
+ "type": "bytes32",
325
+ "internalType": "bytes32"
326
+ },
327
+ {
328
+ "name": "claimSlotId",
329
+ "type": "bytes32",
330
+ "internalType": "bytes32"
331
+ },
332
+ {
333
+ "name": "claimHash",
334
+ "type": "bytes32",
335
+ "internalType": "bytes32"
336
+ }
337
+ ],
338
+ "outputs": [],
339
+ "stateMutability": "nonpayable"
340
+ },
341
+ {
342
+ "type": "event",
343
+ "name": "RegistryClaimUpdated",
344
+ "inputs": [
345
+ {
346
+ "name": "registryId",
347
+ "type": "bytes32",
348
+ "indexed": true,
349
+ "internalType": "bytes32"
350
+ },
351
+ {
352
+ "name": "entryId",
353
+ "type": "bytes32",
354
+ "indexed": true,
355
+ "internalType": "bytes32"
356
+ },
357
+ {
358
+ "name": "claimSlotId",
359
+ "type": "bytes32",
360
+ "indexed": true,
361
+ "internalType": "bytes32"
362
+ },
363
+ {
364
+ "name": "claimHash",
365
+ "type": "bytes32",
366
+ "indexed": false,
367
+ "internalType": "bytes32"
368
+ }
369
+ ],
370
+ "anonymous": false
371
+ },
372
+ {
373
+ "type": "event",
374
+ "name": "RegistryCreated",
375
+ "inputs": [
376
+ {
377
+ "name": "registryId",
378
+ "type": "bytes32",
379
+ "indexed": true,
380
+ "internalType": "bytes32"
381
+ },
382
+ {
383
+ "name": "controller",
384
+ "type": "address",
385
+ "indexed": true,
386
+ "internalType": "address"
387
+ },
388
+ {
389
+ "name": "policy",
390
+ "type": "address",
391
+ "indexed": false,
392
+ "internalType": "address"
393
+ }
394
+ ],
395
+ "anonymous": false
396
+ },
397
+ {
398
+ "type": "event",
399
+ "name": "RegistryEntryRegistered",
400
+ "inputs": [
401
+ {
402
+ "name": "registryId",
403
+ "type": "bytes32",
404
+ "indexed": true,
405
+ "internalType": "bytes32"
406
+ },
407
+ {
408
+ "name": "entryId",
409
+ "type": "bytes32",
410
+ "indexed": true,
411
+ "internalType": "bytes32"
412
+ },
413
+ {
414
+ "name": "subjectAgent",
415
+ "type": "address",
416
+ "indexed": true,
417
+ "internalType": "address"
418
+ },
419
+ {
420
+ "name": "cardHash",
421
+ "type": "bytes32",
422
+ "indexed": false,
423
+ "internalType": "bytes32"
424
+ },
425
+ {
426
+ "name": "bindingProofHash",
427
+ "type": "bytes32",
428
+ "indexed": false,
429
+ "internalType": "bytes32"
430
+ }
431
+ ],
432
+ "anonymous": false
433
+ },
434
+ {
435
+ "type": "event",
436
+ "name": "RegistryEntryRenewed",
437
+ "inputs": [
438
+ {
439
+ "name": "registryId",
440
+ "type": "bytes32",
441
+ "indexed": true,
442
+ "internalType": "bytes32"
443
+ },
444
+ {
445
+ "name": "entryId",
446
+ "type": "bytes32",
447
+ "indexed": true,
448
+ "internalType": "bytes32"
449
+ },
450
+ {
451
+ "name": "expiresAt",
452
+ "type": "uint64",
453
+ "indexed": false,
454
+ "internalType": "uint64"
455
+ }
456
+ ],
457
+ "anonymous": false
458
+ },
459
+ {
460
+ "type": "event",
461
+ "name": "RegistryEntryRevoked",
462
+ "inputs": [
463
+ {
464
+ "name": "registryId",
465
+ "type": "bytes32",
466
+ "indexed": true,
467
+ "internalType": "bytes32"
468
+ },
469
+ {
470
+ "name": "entryId",
471
+ "type": "bytes32",
472
+ "indexed": true,
473
+ "internalType": "bytes32"
474
+ },
475
+ {
476
+ "name": "reasonHash",
477
+ "type": "bytes32",
478
+ "indexed": false,
479
+ "internalType": "bytes32"
480
+ }
481
+ ],
482
+ "anonymous": false
483
+ },
484
+ {
485
+ "type": "event",
486
+ "name": "RegistryEntrySuspended",
487
+ "inputs": [
488
+ {
489
+ "name": "registryId",
490
+ "type": "bytes32",
491
+ "indexed": true,
492
+ "internalType": "bytes32"
493
+ },
494
+ {
495
+ "name": "entryId",
496
+ "type": "bytes32",
497
+ "indexed": true,
498
+ "internalType": "bytes32"
499
+ },
500
+ {
501
+ "name": "reasonHash",
502
+ "type": "bytes32",
503
+ "indexed": false,
504
+ "internalType": "bytes32"
505
+ }
506
+ ],
507
+ "anonymous": false
508
+ },
509
+ {
510
+ "type": "event",
511
+ "name": "RegistryPolicyUpdated",
512
+ "inputs": [
513
+ {
514
+ "name": "registryId",
515
+ "type": "bytes32",
516
+ "indexed": true,
517
+ "internalType": "bytes32"
518
+ },
519
+ {
520
+ "name": "policy",
521
+ "type": "address",
522
+ "indexed": false,
523
+ "internalType": "address"
524
+ }
525
+ ],
526
+ "anonymous": false
527
+ },
528
+ {
529
+ "type": "error",
530
+ "name": "AlreadyRevoked",
531
+ "inputs": []
532
+ },
533
+ {
534
+ "type": "error",
535
+ "name": "EntryExists",
536
+ "inputs": []
537
+ },
538
+ {
539
+ "type": "error",
540
+ "name": "EntryNotFound",
541
+ "inputs": []
542
+ },
543
+ {
544
+ "type": "error",
545
+ "name": "InvalidExpiry",
546
+ "inputs": []
547
+ },
548
+ {
549
+ "type": "error",
550
+ "name": "MembershipDenied",
551
+ "inputs": []
552
+ },
553
+ {
554
+ "type": "error",
555
+ "name": "NotActive",
556
+ "inputs": []
557
+ },
558
+ {
559
+ "type": "error",
560
+ "name": "NotAuthorized",
561
+ "inputs": []
562
+ },
563
+ {
564
+ "type": "error",
565
+ "name": "NotController",
566
+ "inputs": []
567
+ },
568
+ {
569
+ "type": "error",
570
+ "name": "RegistryExists",
571
+ "inputs": []
572
+ },
573
+ {
574
+ "type": "error",
575
+ "name": "RegistryNotFound",
576
+ "inputs": []
577
+ },
578
+ {
579
+ "type": "error",
580
+ "name": "SubjectMismatch",
581
+ "inputs": []
582
+ },
583
+ {
584
+ "type": "error",
585
+ "name": "ZeroSubject",
586
+ "inputs": []
587
+ }
588
+ ]
@@ -0,0 +1,70 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "canAdminister",
5
+ "inputs": [
6
+ {
7
+ "name": "registryId",
8
+ "type": "bytes32",
9
+ "internalType": "bytes32"
10
+ },
11
+ {
12
+ "name": "entryId",
13
+ "type": "bytes32",
14
+ "internalType": "bytes32"
15
+ },
16
+ {
17
+ "name": "actor",
18
+ "type": "address",
19
+ "internalType": "address"
20
+ }
21
+ ],
22
+ "outputs": [
23
+ {
24
+ "name": "ok",
25
+ "type": "bool",
26
+ "internalType": "bool"
27
+ }
28
+ ],
29
+ "stateMutability": "view"
30
+ },
31
+ {
32
+ "type": "function",
33
+ "name": "canRegister",
34
+ "inputs": [
35
+ {
36
+ "name": "registryId",
37
+ "type": "bytes32",
38
+ "internalType": "bytes32"
39
+ },
40
+ {
41
+ "name": "entryId",
42
+ "type": "bytes32",
43
+ "internalType": "bytes32"
44
+ },
45
+ {
46
+ "name": "subjectAgent",
47
+ "type": "address",
48
+ "internalType": "address"
49
+ },
50
+ {
51
+ "name": "cardHash",
52
+ "type": "bytes32",
53
+ "internalType": "bytes32"
54
+ },
55
+ {
56
+ "name": "claimHashes",
57
+ "type": "bytes32[]",
58
+ "internalType": "bytes32[]"
59
+ }
60
+ ],
61
+ "outputs": [
62
+ {
63
+ "name": "ok",
64
+ "type": "bool",
65
+ "internalType": "bool"
66
+ }
67
+ ],
68
+ "stateMutability": "view"
69
+ }
70
+ ]