@agenticprimitives/contracts 1.0.0-alpha.48 → 1.0.0-alpha.49

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.
Files changed (104) hide show
  1. package/AUDIT.md +36 -4
  2. package/dist/abi/AccountBootstrap.json +99 -0
  3. package/dist/abi/AgentAccount.json +95 -56
  4. package/dist/abi/AgentAccountFactory.json +189 -0
  5. package/dist/abi/AgentNameAttributeResolver.json +188 -0
  6. package/dist/abi/AgentNameRegistry.json +170 -0
  7. package/dist/abi/AgentNameUniversalResolver.json +188 -0
  8. package/dist/abi/AgentProfileResolver.json +188 -0
  9. package/dist/abi/AgentRegistryBase.json +193 -0
  10. package/dist/abi/AgentRelationship.json +193 -0
  11. package/dist/abi/AgenticGovernance.json +123 -0
  12. package/dist/abi/AgreementRegistry.json +193 -0
  13. package/dist/abi/AllowedMethodsEnforcer.json +193 -0
  14. package/dist/abi/AllowedTargetsEnforcer.json +193 -0
  15. package/dist/abi/ApprovedHashRegistry.json +220 -0
  16. package/dist/abi/AttestationRegistry.json +193 -0
  17. package/dist/abi/CallDataHashEnforcer.json +193 -0
  18. package/dist/abi/CustodyPolicy.json +195 -80
  19. package/dist/abi/DelegationManager.json +185 -0
  20. package/dist/abi/DigestBindingEnforcer.json +188 -0
  21. package/dist/abi/Eip7702.json +13 -0
  22. package/dist/abi/EstateProjectionRegistry.json +193 -0
  23. package/dist/abi/Generation5Bridge.json +355 -0
  24. package/dist/abi/GeoFeatureRegistry.json +193 -0
  25. package/dist/abi/ICustodyEpochView.json +28 -0
  26. package/dist/abi/IDelegationManager.json +18 -0
  27. package/dist/abi/IGeneration4Reads.json +143 -0
  28. package/dist/abi/IGeneration5Account.json +33 -0
  29. package/dist/abi/IGeneration5Voucher.json +26 -0
  30. package/dist/abi/IMoveAccountView.json +57 -0
  31. package/dist/abi/IMoveCustodyView.json +169 -0
  32. package/dist/abi/IMoveFactoryView.json +41 -0
  33. package/dist/abi/ITimelockVeto.json +93 -0
  34. package/dist/abi/OntologyTermRegistry.json +211 -0
  35. package/dist/abi/PayloadClassesEnforcer.json +193 -0
  36. package/dist/abi/PaymentEnforcer.json +188 -0
  37. package/dist/abi/PaymentEscrow.json +177 -0
  38. package/dist/abi/PaymentReceiptRegistry.json +206 -0
  39. package/dist/abi/PermissionlessSubregistry.json +188 -0
  40. package/dist/abi/PricedSubregistry.json +215 -0
  41. package/dist/abi/QuorumEnforcer.json +193 -0
  42. package/dist/abi/ReceiptAnchorRegistry.json +193 -0
  43. package/dist/abi/RelationshipTypeRegistry.json +211 -0
  44. package/dist/abi/ShapeRegistry.json +211 -0
  45. package/dist/abi/SignatureVerifier.json +196 -0
  46. package/dist/abi/SkillDefinitionRegistry.json +193 -0
  47. package/dist/abi/SmartAgentPaymaster.json +236 -1
  48. package/dist/abi/StableProxyGoverned.json +190 -0
  49. package/dist/abi/StableProxyGovernedOneShot.json +172 -0
  50. package/dist/abi/TimestampEnforcer.json +193 -0
  51. package/dist/abi/TreasurySpendPolicy.json +193 -0
  52. package/dist/abi/UpgradeVoucher.json +156 -4
  53. package/dist/abi/ValueEnforcer.json +193 -0
  54. package/dist/abi/index.d.ts +14 -0
  55. package/dist/abi/index.js +14 -0
  56. package/package.json +1 -1
  57. package/src/AccountBootstrap.sol +38 -0
  58. package/src/AgentAccount.sol +149 -41
  59. package/src/AgentAccountFactory.sol +52 -13
  60. package/src/ApprovedHashRegistry.sol +98 -9
  61. package/src/SmartAgentPaymaster.sol +96 -12
  62. package/src/UniversalSignatureValidator.sol +7 -0
  63. package/src/UpgradeVoucher.sol +16 -3
  64. package/src/agency/DelegationManager.sol +106 -32
  65. package/src/agency/IDelegationManager.sol +28 -0
  66. package/src/agreement/AgreementRegistry.sol +16 -15
  67. package/src/attestation/AttestationRegistry.sol +39 -16
  68. package/src/custody/CustodyPolicy.sol +36 -35
  69. package/src/custody/TreasurySpendPolicy.sol +10 -1
  70. package/src/enforcers/AllowedMethodsEnforcer.sol +7 -1
  71. package/src/enforcers/AllowedTargetsEnforcer.sol +7 -1
  72. package/src/enforcers/CallDataHashEnforcer.sol +7 -1
  73. package/src/enforcers/DigestBindingEnforcer.sol +5 -2
  74. package/src/enforcers/PayloadClassesEnforcer.sol +7 -1
  75. package/src/enforcers/PaymentEnforcer.sol +5 -2
  76. package/src/enforcers/QuorumEnforcer.sol +7 -1
  77. package/src/enforcers/TimestampEnforcer.sol +7 -1
  78. package/src/enforcers/ValueEnforcer.sol +7 -1
  79. package/src/geo/GeoFeatureRegistry.sol +15 -1
  80. package/src/governance/AgenticGovernance.sol +145 -0
  81. package/src/governance/GovernanceManaged.sol +2 -0
  82. package/src/governance/StableProxyGoverned.sol +79 -0
  83. package/src/governance/StableProxyGovernedOneShot.sol +93 -0
  84. package/src/identity/AgentProfileResolver.sol +11 -2
  85. package/src/libraries/Eip7702.sol +36 -0
  86. package/src/libraries/SignatureSlotRecovery.sol +4 -0
  87. package/src/libraries/SignatureVerifier.sol +52 -0
  88. package/src/libraries/WebAuthnLib.sol +3 -0
  89. package/src/migration/Generation5Bridge.sol +364 -0
  90. package/src/naming/AgentNameAttributeResolver.sol +12 -2
  91. package/src/naming/AgentNameRegistry.sol +84 -10
  92. package/src/naming/AgentNameUniversalResolver.sol +9 -2
  93. package/src/naming/PermissionlessSubregistry.sol +13 -2
  94. package/src/naming/PricedSubregistry.sol +59 -3
  95. package/src/ontology/OntologyTermRegistry.sol +30 -2
  96. package/src/ontology/ShapeRegistry.sol +30 -2
  97. package/src/payments/PaymentEscrow.sol +16 -1
  98. package/src/payments/PaymentReceiptRegistry.sol +28 -3
  99. package/src/provenance/ReceiptAnchorRegistry.sol +13 -1
  100. package/src/registry/AgentRegistryBase.sol +21 -1
  101. package/src/registry/EstateProjectionRegistry.sol +15 -1
  102. package/src/relationships/AgentRelationship.sol +17 -1
  103. package/src/relationships/RelationshipTypeRegistry.sol +30 -2
  104. package/src/skills/SkillDefinitionRegistry.sol +15 -1
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "type": "constructor",
4
+ "inputs": [],
5
+ "stateMutability": "nonpayable"
6
+ },
7
+ {
8
+ "type": "function",
9
+ "name": "UPGRADE_INTERFACE_VERSION",
10
+ "inputs": [],
11
+ "outputs": [
12
+ {
13
+ "name": "",
14
+ "type": "string",
15
+ "internalType": "string"
16
+ }
17
+ ],
18
+ "stateMutability": "view"
19
+ },
2
20
  {
3
21
  "type": "function",
4
22
  "name": "afterHook",
@@ -95,6 +113,181 @@
95
113
  "outputs": [],
96
114
  "stateMutability": "pure"
97
115
  },
116
+ {
117
+ "type": "function",
118
+ "name": "governance",
119
+ "inputs": [],
120
+ "outputs": [
121
+ {
122
+ "name": "",
123
+ "type": "address",
124
+ "internalType": "address"
125
+ }
126
+ ],
127
+ "stateMutability": "view"
128
+ },
129
+ {
130
+ "type": "function",
131
+ "name": "initialize",
132
+ "inputs": [
133
+ {
134
+ "name": "governance_",
135
+ "type": "address",
136
+ "internalType": "address"
137
+ }
138
+ ],
139
+ "outputs": [],
140
+ "stateMutability": "nonpayable"
141
+ },
142
+ {
143
+ "type": "function",
144
+ "name": "proxiableUUID",
145
+ "inputs": [],
146
+ "outputs": [
147
+ {
148
+ "name": "",
149
+ "type": "bytes32",
150
+ "internalType": "bytes32"
151
+ }
152
+ ],
153
+ "stateMutability": "view"
154
+ },
155
+ {
156
+ "type": "function",
157
+ "name": "upgradeToAndCall",
158
+ "inputs": [
159
+ {
160
+ "name": "newImplementation",
161
+ "type": "address",
162
+ "internalType": "address"
163
+ },
164
+ {
165
+ "name": "data",
166
+ "type": "bytes",
167
+ "internalType": "bytes"
168
+ }
169
+ ],
170
+ "outputs": [],
171
+ "stateMutability": "payable"
172
+ },
173
+ {
174
+ "type": "event",
175
+ "name": "GovernanceSet",
176
+ "inputs": [
177
+ {
178
+ "name": "governance",
179
+ "type": "address",
180
+ "indexed": true,
181
+ "internalType": "address"
182
+ }
183
+ ],
184
+ "anonymous": false
185
+ },
186
+ {
187
+ "type": "event",
188
+ "name": "Initialized",
189
+ "inputs": [
190
+ {
191
+ "name": "version",
192
+ "type": "uint64",
193
+ "indexed": false,
194
+ "internalType": "uint64"
195
+ }
196
+ ],
197
+ "anonymous": false
198
+ },
199
+ {
200
+ "type": "event",
201
+ "name": "Upgraded",
202
+ "inputs": [
203
+ {
204
+ "name": "implementation",
205
+ "type": "address",
206
+ "indexed": true,
207
+ "internalType": "address"
208
+ }
209
+ ],
210
+ "anonymous": false
211
+ },
212
+ {
213
+ "type": "error",
214
+ "name": "AddressEmptyCode",
215
+ "inputs": [
216
+ {
217
+ "name": "target",
218
+ "type": "address",
219
+ "internalType": "address"
220
+ }
221
+ ]
222
+ },
223
+ {
224
+ "type": "error",
225
+ "name": "DelegatedEOA",
226
+ "inputs": [
227
+ {
228
+ "name": "account",
229
+ "type": "address",
230
+ "internalType": "address"
231
+ }
232
+ ]
233
+ },
234
+ {
235
+ "type": "error",
236
+ "name": "ERC1967InvalidImplementation",
237
+ "inputs": [
238
+ {
239
+ "name": "implementation",
240
+ "type": "address",
241
+ "internalType": "address"
242
+ }
243
+ ]
244
+ },
245
+ {
246
+ "type": "error",
247
+ "name": "ERC1967NonPayable",
248
+ "inputs": []
249
+ },
250
+ {
251
+ "type": "error",
252
+ "name": "FailedInnerCall",
253
+ "inputs": []
254
+ },
255
+ {
256
+ "type": "error",
257
+ "name": "InvalidInitialization",
258
+ "inputs": []
259
+ },
260
+ {
261
+ "type": "error",
262
+ "name": "NotGovernance",
263
+ "inputs": []
264
+ },
265
+ {
266
+ "type": "error",
267
+ "name": "NotInitializing",
268
+ "inputs": []
269
+ },
270
+ {
271
+ "type": "error",
272
+ "name": "UUPSUnauthorizedCallContext",
273
+ "inputs": []
274
+ },
275
+ {
276
+ "type": "error",
277
+ "name": "UUPSUnsupportedProxiableUUID",
278
+ "inputs": [
279
+ {
280
+ "name": "slot",
281
+ "type": "bytes32",
282
+ "internalType": "bytes32"
283
+ }
284
+ ]
285
+ },
286
+ {
287
+ "type": "error",
288
+ "name": "UpgradeWithoutGovernance",
289
+ "inputs": []
290
+ },
98
291
  {
99
292
  "type": "error",
100
293
  "name": "ValueExceedsLimit",
@@ -1,6 +1,7 @@
1
1
  // Generated by scripts/build-abi.mjs — do not edit by hand.
2
2
  import type { Abi } from 'viem';
3
3
 
4
+ export declare const AccountBootstrap: Abi;
4
5
  export declare const AgentAccount: Abi;
5
6
  export declare const AgentAccountFactory: Abi;
6
7
  export declare const AgenticGovernance: Abi;
@@ -24,7 +25,9 @@ export declare const CaveatEnforcerBase: Abi;
24
25
  export declare const CustodyPolicy: Abi;
25
26
  export declare const DelegationManager: Abi;
26
27
  export declare const DigestBindingEnforcer: Abi;
28
+ export declare const Eip7702: Abi;
27
29
  export declare const EstateProjectionRegistry: Abi;
30
+ export declare const Generation5Bridge: Abi;
28
31
  export declare const GeoFeatureRegistry: Abi;
29
32
  export declare const GovernanceManaged: Abi;
30
33
  export declare const IAgentAccount: Abi;
@@ -37,6 +40,7 @@ export declare const IApprovedHashRegistryView: Abi;
37
40
  export declare const IApprovedHashRegistryWrite: Abi;
38
41
  export declare const IAttributeReader: Abi;
39
42
  export declare const ICaveatEnforcer: Abi;
43
+ export declare const ICustodyEpochView: Abi;
40
44
  export declare const ICustodyPolicyAccountModuleView: Abi;
41
45
  export declare const ICustodyPolicyFactoryView: Abi;
42
46
  export declare const ICustodyPolicyPasskeyView: Abi;
@@ -46,10 +50,17 @@ export declare const IERC7579HookLike: Abi;
46
50
  export declare const IERC7579Module: Abi;
47
51
  export declare const IERC7579ModuleLifecycle: Abi;
48
52
  export declare const IERC7579ModuleLike: Abi;
53
+ export declare const IGeneration4Reads: Abi;
54
+ export declare const IGeneration5Account: Abi;
55
+ export declare const IGeneration5Voucher: Abi;
49
56
  export declare const IGovernanceView: Abi;
57
+ export declare const IMoveAccountView: Abi;
58
+ export declare const IMoveCustodyView: Abi;
59
+ export declare const IMoveFactoryView: Abi;
50
60
  export declare const IPaymentReceiptRegistry: Abi;
51
61
  export declare const IRedemptionContext: Abi;
52
62
  export declare const IRegistryMembershipPolicy: Abi;
63
+ export declare const ITimelockVeto: Abi;
53
64
  export declare const ITreasurySpendPolicyAccountView: Abi;
54
65
  export declare const IUpgradeVoucherView: Abi;
55
66
  export declare const MockUSDC: Abi;
@@ -68,9 +79,12 @@ export declare const ReceiptAnchorRegistry: Abi;
68
79
  export declare const RelationshipTypeRegistry: Abi;
69
80
  export declare const ShapeRegistry: Abi;
70
81
  export declare const SignatureSlotRecovery: Abi;
82
+ export declare const SignatureVerifier: Abi;
71
83
  export declare const SkillDefinitionRegistry: Abi;
72
84
  export declare const SmartAgentModuleTypes: Abi;
73
85
  export declare const SmartAgentPaymaster: Abi;
86
+ export declare const StableProxyGoverned: Abi;
87
+ export declare const StableProxyGovernedOneShot: Abi;
74
88
  export declare const TimestampEnforcer: Abi;
75
89
  export declare const TreasurySpendPolicy: Abi;
76
90
  export declare const UniversalSignatureValidator: Abi;
package/dist/abi/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // Generated by scripts/build-abi.mjs — do not edit by hand.
2
2
  // Each export is a viem-compatible ABI array.
3
3
 
4
+ export { default as AccountBootstrap } from './AccountBootstrap.json' with { type: 'json' };
4
5
  export { default as AgentAccount } from './AgentAccount.json' with { type: 'json' };
5
6
  export { default as AgentAccountFactory } from './AgentAccountFactory.json' with { type: 'json' };
6
7
  export { default as AgenticGovernance } from './AgenticGovernance.json' with { type: 'json' };
@@ -24,7 +25,9 @@ export { default as CaveatEnforcerBase } from './CaveatEnforcerBase.json' with {
24
25
  export { default as CustodyPolicy } from './CustodyPolicy.json' with { type: 'json' };
25
26
  export { default as DelegationManager } from './DelegationManager.json' with { type: 'json' };
26
27
  export { default as DigestBindingEnforcer } from './DigestBindingEnforcer.json' with { type: 'json' };
28
+ export { default as Eip7702 } from './Eip7702.json' with { type: 'json' };
27
29
  export { default as EstateProjectionRegistry } from './EstateProjectionRegistry.json' with { type: 'json' };
30
+ export { default as Generation5Bridge } from './Generation5Bridge.json' with { type: 'json' };
28
31
  export { default as GeoFeatureRegistry } from './GeoFeatureRegistry.json' with { type: 'json' };
29
32
  export { default as GovernanceManaged } from './GovernanceManaged.json' with { type: 'json' };
30
33
  export { default as IAgentAccount } from './IAgentAccount.json' with { type: 'json' };
@@ -37,6 +40,7 @@ export { default as IApprovedHashRegistryView } from './IApprovedHashRegistryVie
37
40
  export { default as IApprovedHashRegistryWrite } from './IApprovedHashRegistryWrite.json' with { type: 'json' };
38
41
  export { default as IAttributeReader } from './IAttributeReader.json' with { type: 'json' };
39
42
  export { default as ICaveatEnforcer } from './ICaveatEnforcer.json' with { type: 'json' };
43
+ export { default as ICustodyEpochView } from './ICustodyEpochView.json' with { type: 'json' };
40
44
  export { default as ICustodyPolicyAccountModuleView } from './ICustodyPolicyAccountModuleView.json' with { type: 'json' };
41
45
  export { default as ICustodyPolicyFactoryView } from './ICustodyPolicyFactoryView.json' with { type: 'json' };
42
46
  export { default as ICustodyPolicyPasskeyView } from './ICustodyPolicyPasskeyView.json' with { type: 'json' };
@@ -46,10 +50,17 @@ export { default as IERC7579HookLike } from './IERC7579HookLike.json' with { typ
46
50
  export { default as IERC7579Module } from './IERC7579Module.json' with { type: 'json' };
47
51
  export { default as IERC7579ModuleLifecycle } from './IERC7579ModuleLifecycle.json' with { type: 'json' };
48
52
  export { default as IERC7579ModuleLike } from './IERC7579ModuleLike.json' with { type: 'json' };
53
+ export { default as IGeneration4Reads } from './IGeneration4Reads.json' with { type: 'json' };
54
+ export { default as IGeneration5Account } from './IGeneration5Account.json' with { type: 'json' };
55
+ export { default as IGeneration5Voucher } from './IGeneration5Voucher.json' with { type: 'json' };
49
56
  export { default as IGovernanceView } from './IGovernanceView.json' with { type: 'json' };
57
+ export { default as IMoveAccountView } from './IMoveAccountView.json' with { type: 'json' };
58
+ export { default as IMoveCustodyView } from './IMoveCustodyView.json' with { type: 'json' };
59
+ export { default as IMoveFactoryView } from './IMoveFactoryView.json' with { type: 'json' };
50
60
  export { default as IPaymentReceiptRegistry } from './IPaymentReceiptRegistry.json' with { type: 'json' };
51
61
  export { default as IRedemptionContext } from './IRedemptionContext.json' with { type: 'json' };
52
62
  export { default as IRegistryMembershipPolicy } from './IRegistryMembershipPolicy.json' with { type: 'json' };
63
+ export { default as ITimelockVeto } from './ITimelockVeto.json' with { type: 'json' };
53
64
  export { default as ITreasurySpendPolicyAccountView } from './ITreasurySpendPolicyAccountView.json' with { type: 'json' };
54
65
  export { default as IUpgradeVoucherView } from './IUpgradeVoucherView.json' with { type: 'json' };
55
66
  export { default as MockUSDC } from './MockUSDC.json' with { type: 'json' };
@@ -68,9 +79,12 @@ export { default as ReceiptAnchorRegistry } from './ReceiptAnchorRegistry.json'
68
79
  export { default as RelationshipTypeRegistry } from './RelationshipTypeRegistry.json' with { type: 'json' };
69
80
  export { default as ShapeRegistry } from './ShapeRegistry.json' with { type: 'json' };
70
81
  export { default as SignatureSlotRecovery } from './SignatureSlotRecovery.json' with { type: 'json' };
82
+ export { default as SignatureVerifier } from './SignatureVerifier.json' with { type: 'json' };
71
83
  export { default as SkillDefinitionRegistry } from './SkillDefinitionRegistry.json' with { type: 'json' };
72
84
  export { default as SmartAgentModuleTypes } from './SmartAgentModuleTypes.json' with { type: 'json' };
73
85
  export { default as SmartAgentPaymaster } from './SmartAgentPaymaster.json' with { type: 'json' };
86
+ export { default as StableProxyGoverned } from './StableProxyGoverned.json' with { type: 'json' };
87
+ export { default as StableProxyGovernedOneShot } from './StableProxyGovernedOneShot.json' with { type: 'json' };
74
88
  export { default as TimestampEnforcer } from './TimestampEnforcer.json' with { type: 'json' };
75
89
  export { default as TreasurySpendPolicy } from './TreasurySpendPolicy.json' with { type: 'json' };
76
90
  export { default as UniversalSignatureValidator } from './UniversalSignatureValidator.json' with { type: 'json' };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticprimitives/contracts",
3
- "version": "1.0.0-alpha.48",
3
+ "version": "1.0.0-alpha.49",
4
4
  "type": "module",
5
5
  "description": "Solidity contracts + ABIs + flattened sources + per-network deployment addresses for the agenticprimitives stack.",
6
6
  "homepage": "https://agenticprimitives.dev",
@@ -0,0 +1,38 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^0.8.28;
3
+
4
+ import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
5
+
6
+ /**
7
+ * @title AccountBootstrap
8
+ * @notice Spec 447 §3.2 — the placeholder implementation every new account proxy is first deployed pointing at, so
9
+ * an account's CREATE2 address depends on the factory, this placeholder and the salt, and NEVER on the account
10
+ * code or any system contract (the ENSv2 verifiable-factory property, reached the ERC-8004 way: a
11
+ * placeholder first, the real implementation after). A new generation of account code therefore never
12
+ * changes where a person's account is.
13
+ *
14
+ * In the same transaction that deploys the proxy, the factory calls {bootstrap}, which upgrades the proxy to
15
+ * the real implementation and runs its initializer. Only the factory may, and only once: after it the proxy
16
+ * runs `AgentAccount`, which has no `bootstrap`.
17
+ */
18
+ contract AccountBootstrap {
19
+ /// @notice The factory allowed to bootstrap a proxy pointing here.
20
+ address public immutable factory;
21
+ /// @dev This placeholder's own address, to tell "still pointing at the placeholder" apart under delegatecall.
22
+ address private immutable _self;
23
+
24
+ error NotFactory();
25
+ error AlreadyBootstrapped();
26
+
27
+ constructor(address factory_) {
28
+ factory = factory_;
29
+ _self = address(this);
30
+ }
31
+
32
+ /// @notice Point the proxy (delegatecalling here) at `implementation` and run `initData` on it.
33
+ function bootstrap(address implementation, bytes calldata initData) external {
34
+ if (msg.sender != factory) revert NotFactory();
35
+ if (address(this) == _self || ERC1967Utils.getImplementation() != _self) revert AlreadyBootstrapped();
36
+ ERC1967Utils.upgradeToAndCall(implementation, initData);
37
+ }
38
+ }