@varun-ai07/covenant-mcp 2.3.6 → 2.3.8

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 (84) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/lib/sqlite-store.d.ts.map +1 -1
  4. package/dist/lib/sqlite-store.js +2 -1
  5. package/dist/lib/sqlite-store.js.map +1 -1
  6. package/dist/lib/store.d.ts.map +1 -1
  7. package/dist/lib/store.js +2 -1
  8. package/dist/lib/store.js.map +1 -1
  9. package/dist/server.js +1 -1
  10. package/package.json +1 -1
  11. package/dist/sdk/chunk-3R2WXEXL.mjs +0 -828
  12. package/dist/sdk/chunk-6ORMNSPN.mjs +0 -842
  13. package/dist/sdk/chunk-FH2MCRWQ.mjs +0 -8732
  14. package/dist/sdk/chunk-Y3YIH5K3.mjs +0 -816
  15. package/dist/sdk/config.d.ts +0 -121
  16. package/dist/sdk/config.d.ts.map +0 -1
  17. package/dist/sdk/config.js +0 -196
  18. package/dist/sdk/config.js.map +0 -1
  19. package/dist/sdk/contracts/AgentCollective.json +0 -467
  20. package/dist/sdk/contracts/AgentRegistry.d.ts +0 -144
  21. package/dist/sdk/contracts/AgentRegistry.d.ts.map +0 -1
  22. package/dist/sdk/contracts/AgentRegistry.js +0 -92
  23. package/dist/sdk/contracts/AgentRegistry.js.map +0 -1
  24. package/dist/sdk/contracts/COVENANTRouter.json +0 -206
  25. package/dist/sdk/contracts/CovenantArbitration.json +0 -546
  26. package/dist/sdk/contracts/CovenantAttestation.json +0 -476
  27. package/dist/sdk/contracts/CovenantEscrow.d.ts +0 -70
  28. package/dist/sdk/contracts/CovenantEscrow.d.ts.map +0 -1
  29. package/dist/sdk/contracts/CovenantEscrow.js +0 -3
  30. package/dist/sdk/contracts/CovenantEscrow.js.map +0 -1
  31. package/dist/sdk/contracts/CovenantEscrow.json +0 -783
  32. package/dist/sdk/contracts/CovenantGovernance.json +0 -729
  33. package/dist/sdk/contracts/CovenantIdentity.d.ts +0 -70
  34. package/dist/sdk/contracts/CovenantIdentity.d.ts.map +0 -1
  35. package/dist/sdk/contracts/CovenantIdentity.js +0 -3
  36. package/dist/sdk/contracts/CovenantIdentity.js.map +0 -1
  37. package/dist/sdk/contracts/CovenantIdentity.json +0 -800
  38. package/dist/sdk/contracts/CovenantSettlement.json +0 -609
  39. package/dist/sdk/contracts/DisputeResolution.d.ts +0 -122
  40. package/dist/sdk/contracts/DisputeResolution.d.ts.map +0 -1
  41. package/dist/sdk/contracts/DisputeResolution.js +0 -86
  42. package/dist/sdk/contracts/DisputeResolution.js.map +0 -1
  43. package/dist/sdk/contracts/GrantProgram.json +0 -373
  44. package/dist/sdk/contracts/InsurancePool.d.ts +0 -209
  45. package/dist/sdk/contracts/InsurancePool.d.ts.map +0 -1
  46. package/dist/sdk/contracts/InsurancePool.js +0 -153
  47. package/dist/sdk/contracts/InsurancePool.js.map +0 -1
  48. package/dist/sdk/contracts/InsurancePool.json +0 -456
  49. package/dist/sdk/contracts/MultiTokenEscrow.json +0 -435
  50. package/dist/sdk/contracts/OpenTaskMarket.d.ts +0 -190
  51. package/dist/sdk/contracts/OpenTaskMarket.d.ts.map +0 -1
  52. package/dist/sdk/contracts/OpenTaskMarket.js +0 -117
  53. package/dist/sdk/contracts/OpenTaskMarket.js.map +0 -1
  54. package/dist/sdk/contracts/ParallelTaskBatch.json +0 -511
  55. package/dist/sdk/contracts/ReceiptVerifierV2.d.ts +0 -168
  56. package/dist/sdk/contracts/ReceiptVerifierV2.d.ts.map +0 -1
  57. package/dist/sdk/contracts/ReceiptVerifierV2.js +0 -109
  58. package/dist/sdk/contracts/ReceiptVerifierV2.js.map +0 -1
  59. package/dist/sdk/contracts/RevisionManager.json +0 -489
  60. package/dist/sdk/contracts/TaskEscrow.d.ts +0 -222
  61. package/dist/sdk/contracts/TaskEscrow.d.ts.map +0 -1
  62. package/dist/sdk/contracts/TaskEscrow.js +0 -144
  63. package/dist/sdk/contracts/TaskEscrow.js.map +0 -1
  64. package/dist/sdk/contracts/TrainingMarketplace.json +0 -357
  65. package/dist/sdk/index.d.mts +0 -385
  66. package/dist/sdk/index.d.ts +0 -35
  67. package/dist/sdk/index.d.ts.map +0 -1
  68. package/dist/sdk/index.js +0 -284
  69. package/dist/sdk/index.js.map +0 -1
  70. package/dist/sdk/index.mjs +0 -32
  71. package/dist/sdk/types.d.ts +0 -110
  72. package/dist/sdk/types.d.ts.map +0 -1
  73. package/dist/sdk/types.js +0 -17
  74. package/dist/sdk/types.js.map +0 -1
  75. package/dist/sdk/v2.d.mts +0 -100
  76. package/dist/sdk/v2.d.ts +0 -100
  77. package/dist/sdk/v2.d.ts.map +0 -1
  78. package/dist/sdk/v2.js +0 -2615
  79. package/dist/sdk/v2.js.map +0 -1
  80. package/dist/sdk/v2.mjs +0 -571
  81. package/dist/sdk/v5-extensions.d.ts +0 -133
  82. package/dist/sdk/v5-extensions.d.ts.map +0 -1
  83. package/dist/sdk/v5-extensions.js +0 -993
  84. package/dist/sdk/v5-extensions.js.map +0 -1
package/dist/sdk/v2.js DELETED
@@ -1,2615 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/v2.ts
21
- var v2_exports = {};
22
- __export(v2_exports, {
23
- CovenantSDKV2: () => CovenantSDKV2,
24
- ReceiptType: () => ReceiptType,
25
- toBytes32: () => toBytes32
26
- });
27
- module.exports = __toCommonJS(v2_exports);
28
- var import_viem = require("viem");
29
-
30
- // src/config.ts
31
- var import_shared_types = require("@covenant/shared-types");
32
- var DEFAULT_ADDRESSES = {
33
- // Base Sepolia Testnet
34
- 84532: import_shared_types.BASE_SEPOLIA_ADDRESSES,
35
- // Hardhat Local (placeholder addresses)
36
- 31337: {
37
- AgentRegistry: "0x0000000000000000000000000000000000000000",
38
- TaskEscrow: "0x0000000000000000000000000000000000000000",
39
- ReceiptVerifier: "0x0000000000000000000000000000000000000000",
40
- OpenTaskMarket: "0x0000000000000000000000000000000000000000",
41
- ParallelTaskBatch: "0x0000000000000000000000000000000000000000",
42
- AgentCollective: "0x0000000000000000000000000000000000000000",
43
- AgentInsurance: "0x0000000000000000000000000000000000000000",
44
- DisputeArbitration: "0x0000000000000000000000000000000000000000",
45
- Groth16VerifierCapability: "0x0000000000000000000000000000000000000000",
46
- CapabilityVerifier: "0x0000000000000000000000000000000000000000",
47
- Groth16VerifierReputation: "0x0000000000000000000000000000000000000000",
48
- ReputationVerifier: "0x0000000000000000000000000000000000000000",
49
- COVENANTRouter: "0x0000000000000000000000000000000000000000",
50
- LitProtocolIntegration: "0x0000000000000000000000000000000000000000",
51
- MultiTokenEscrow: "0x0000000000000000000000000000000000000000",
52
- AgentSmartWallet: "0x0000000000000000000000000000000000000000",
53
- CovenantPaymaster: "0x0000000000000000000000000000000000000000",
54
- TrainingMarketplace: "0x0000000000000000000000000000000000000000",
55
- GrantProgram: "0x0000000000000000000000000000000000000000",
56
- AutoVerifier: "0x0000000000000000000000000000000000000000",
57
- MultiPartyReview: "0x0000000000000000000000000000000000000000",
58
- ClientReputation: "0x0000000000000000000000000000000000000000",
59
- StakeSlashing: "0x0000000000000000000000000000000000000000",
60
- MilestoneVerification: "0x0000000000000000000000000000000000000000",
61
- RevisionManager: "0x0000000000000000000000000000000000000000",
62
- AgentWallet: "0x0000000000000000000000000000000000000000",
63
- CovenantIdentity: "0x0000000000000000000000000000000000000000",
64
- CovenantEscrow: "0x0000000000000000000000000000000000000000",
65
- CovenantSettlement: "0x0000000000000000000000000000000000000000",
66
- CovenantArbitration: "0x0000000000000000000000000000000000000000",
67
- CovenantAttestation: "0x0000000000000000000000000000000000000000",
68
- CovenantGovernance: "0x0000000000000000000000000000000000000000",
69
- InsurancePool: "0x0000000000000000000000000000000000000000"
70
- },
71
- // Base Mainnet (placeholder - not deployed yet)
72
- 8453: {
73
- AgentRegistry: "0x0000000000000000000000000000000000000000",
74
- TaskEscrow: "0x0000000000000000000000000000000000000000",
75
- ReceiptVerifier: "0x0000000000000000000000000000000000000000",
76
- OpenTaskMarket: "0x0000000000000000000000000000000000000000",
77
- ParallelTaskBatch: "0x0000000000000000000000000000000000000000",
78
- AgentCollective: "0x0000000000000000000000000000000000000000",
79
- AgentInsurance: "0x0000000000000000000000000000000000000000",
80
- DisputeArbitration: "0x0000000000000000000000000000000000000000",
81
- Groth16VerifierCapability: "0x0000000000000000000000000000000000000000",
82
- CapabilityVerifier: "0x0000000000000000000000000000000000000000",
83
- Groth16VerifierReputation: "0x0000000000000000000000000000000000000000",
84
- ReputationVerifier: "0x0000000000000000000000000000000000000000",
85
- COVENANTRouter: "0x0000000000000000000000000000000000000000",
86
- LitProtocolIntegration: "0x0000000000000000000000000000000000000000",
87
- MultiTokenEscrow: "0x0000000000000000000000000000000000000000",
88
- AgentSmartWallet: "0x0000000000000000000000000000000000000000",
89
- CovenantPaymaster: "0x0000000000000000000000000000000000000000",
90
- TrainingMarketplace: "0x0000000000000000000000000000000000000000",
91
- GrantProgram: "0x0000000000000000000000000000000000000000",
92
- AutoVerifier: "0x0000000000000000000000000000000000000000",
93
- MultiPartyReview: "0x0000000000000000000000000000000000000000",
94
- ClientReputation: "0x0000000000000000000000000000000000000000",
95
- StakeSlashing: "0x0000000000000000000000000000000000000000",
96
- MilestoneVerification: "0x0000000000000000000000000000000000000000",
97
- RevisionManager: "0x0000000000000000000000000000000000000000",
98
- AgentWallet: "0x0000000000000000000000000000000000000000",
99
- CovenantIdentity: "0x0000000000000000000000000000000000000000",
100
- CovenantEscrow: "0x0000000000000000000000000000000000000000",
101
- CovenantSettlement: "0x0000000000000000000000000000000000000000",
102
- CovenantArbitration: "0x0000000000000000000000000000000000000000",
103
- CovenantAttestation: "0x0000000000000000000000000000000000000000",
104
- CovenantGovernance: "0x0000000000000000000000000000000000000000",
105
- InsurancePool: "0x0000000000000000000000000000000000000000"
106
- }
107
- };
108
- var V2_ADDRESSES = {
109
- // Base Sepolia Testnet
110
- 84532: {
111
- AgentRegistry: "0x773d1954997b6A91e917e0c2326ABCcAf36e21E1",
112
- TaskEscrow: "0xf4d0765A935E36F888d899D9A7C9156CeCdEa6F5",
113
- ReceiptVerifier: "0x05cC13692755015FCb11e95d609187b214197edF",
114
- InsurancePool: "0x920f3925122B3Ce9380A220AA748e67bD787BE1d",
115
- DisputeResolution: "0xFA6dd0929a4ACCCC2E083DaDaD89226dd71Ef28F"
116
- },
117
- // Hardhat Local (placeholder addresses)
118
- 31337: {
119
- AgentRegistry: "0x0000000000000000000000000000000000000000",
120
- TaskEscrow: "0x0000000000000000000000000000000000000000",
121
- ReceiptVerifier: "0x0000000000000000000000000000000000000000",
122
- InsurancePool: "0x0000000000000000000000000000000000000000",
123
- DisputeResolution: "0x0000000000000000000000000000000000000000"
124
- },
125
- // Base Mainnet (placeholder - not deployed yet)
126
- 8453: {
127
- AgentRegistry: "0x0000000000000000000000000000000000000000",
128
- TaskEscrow: "0x0000000000000000000000000000000000000000",
129
- ReceiptVerifier: "0x0000000000000000000000000000000000000000",
130
- InsurancePool: "0x0000000000000000000000000000000000000000",
131
- DisputeResolution: "0x0000000000000000000000000000000000000000"
132
- }
133
- };
134
- var CHAIN_CONFIGS = {
135
- 84532: {
136
- chain: {
137
- id: 84532,
138
- name: "Base Sepolia",
139
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
140
- rpcUrls: { default: { http: ["https://sepolia.base.org"] } }
141
- }
142
- },
143
- 8453: {
144
- chain: {
145
- id: 8453,
146
- name: "Base",
147
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
148
- rpcUrls: { default: { http: ["https://mainnet.base.org"] } }
149
- }
150
- },
151
- 31337: {
152
- chain: {
153
- id: 31337,
154
- name: "Hardhat Local",
155
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
156
- rpcUrls: { default: { http: ["http://localhost:8545"] } }
157
- }
158
- }
159
- };
160
- function getContractAddresses(chainId, overrides) {
161
- const defaults = DEFAULT_ADDRESSES[chainId];
162
- if (!defaults) {
163
- throw new Error(`Unsupported chain ID: ${chainId}. Supported: ${Object.keys(DEFAULT_ADDRESSES).join(", ")}`);
164
- }
165
- return { ...defaults, ...overrides };
166
- }
167
- function getV2ContractAddresses(chainId, overrides) {
168
- const defaults = V2_ADDRESSES[chainId];
169
- if (!defaults) {
170
- throw new Error(`Unsupported chain ID for V2: ${chainId}. Supported: ${Object.keys(V2_ADDRESSES).join(", ")}`);
171
- }
172
- return { ...defaults, ...overrides };
173
- }
174
-
175
- // src/contracts/CovenantIdentity.json
176
- var CovenantIdentity_default = {
177
- _format: "hh-sol-artifact-1",
178
- contractName: "CovenantIdentity",
179
- sourceName: "contracts/v5/core/CovenantIdentity.sol",
180
- abi: [
181
- {
182
- inputs: [],
183
- stateMutability: "nonpayable",
184
- type: "constructor"
185
- },
186
- {
187
- inputs: [],
188
- name: "AlreadyRegistered",
189
- type: "error"
190
- },
191
- {
192
- inputs: [],
193
- name: "AlreadyRevoked",
194
- type: "error"
195
- },
196
- {
197
- inputs: [],
198
- name: "CapabilityExpired",
199
- type: "error"
200
- },
201
- {
202
- inputs: [],
203
- name: "CapabilityNotFound",
204
- type: "error"
205
- },
206
- {
207
- inputs: [],
208
- name: "InsufficientStake",
209
- type: "error"
210
- },
211
- {
212
- inputs: [],
213
- name: "InvalidAddress",
214
- type: "error"
215
- },
216
- {
217
- inputs: [],
218
- name: "InvalidSignature",
219
- type: "error"
220
- },
221
- {
222
- inputs: [],
223
- name: "MustSendETH",
224
- type: "error"
225
- },
226
- {
227
- inputs: [],
228
- name: "NotOwner",
229
- type: "error"
230
- },
231
- {
232
- inputs: [],
233
- name: "NotRegistered",
234
- type: "error"
235
- },
236
- {
237
- inputs: [],
238
- name: "StakeBelowMinimum",
239
- type: "error"
240
- },
241
- {
242
- inputs: [],
243
- name: "Unauthorized",
244
- type: "error"
245
- },
246
- {
247
- anonymous: false,
248
- inputs: [
249
- {
250
- indexed: true,
251
- internalType: "address",
252
- name: "agent",
253
- type: "address"
254
- }
255
- ],
256
- name: "AgentDeactivated",
257
- type: "event"
258
- },
259
- {
260
- anonymous: false,
261
- inputs: [
262
- {
263
- indexed: true,
264
- internalType: "address",
265
- name: "agent",
266
- type: "address"
267
- },
268
- {
269
- indexed: false,
270
- internalType: "bytes32",
271
- name: "newRoot",
272
- type: "bytes32"
273
- }
274
- ],
275
- name: "AgentMetadataUpdated",
276
- type: "event"
277
- },
278
- {
279
- anonymous: false,
280
- inputs: [
281
- {
282
- indexed: true,
283
- internalType: "address",
284
- name: "agent",
285
- type: "address"
286
- },
287
- {
288
- indexed: false,
289
- internalType: "uint96",
290
- name: "stake",
291
- type: "uint96"
292
- }
293
- ],
294
- name: "AgentRegistered",
295
- type: "event"
296
- },
297
- {
298
- anonymous: false,
299
- inputs: [
300
- {
301
- indexed: true,
302
- internalType: "address",
303
- name: "agent",
304
- type: "address"
305
- },
306
- {
307
- indexed: false,
308
- internalType: "bytes32",
309
- name: "capabilityHash",
310
- type: "bytes32"
311
- },
312
- {
313
- indexed: false,
314
- internalType: "uint32",
315
- name: "expiry",
316
- type: "uint32"
317
- }
318
- ],
319
- name: "CapabilityGranted",
320
- type: "event"
321
- },
322
- {
323
- anonymous: false,
324
- inputs: [
325
- {
326
- indexed: true,
327
- internalType: "address",
328
- name: "agent",
329
- type: "address"
330
- },
331
- {
332
- indexed: false,
333
- internalType: "bytes32",
334
- name: "capabilityHash",
335
- type: "bytes32"
336
- }
337
- ],
338
- name: "CapabilityRevoked",
339
- type: "event"
340
- },
341
- {
342
- anonymous: false,
343
- inputs: [
344
- {
345
- indexed: true,
346
- internalType: "address",
347
- name: "to",
348
- type: "address"
349
- },
350
- {
351
- indexed: false,
352
- internalType: "uint256",
353
- name: "amount",
354
- type: "uint256"
355
- }
356
- ],
357
- name: "EmergencyWithdraw",
358
- type: "event"
359
- },
360
- {
361
- anonymous: false,
362
- inputs: [
363
- {
364
- indexed: false,
365
- internalType: "uint8",
366
- name: "version",
367
- type: "uint8"
368
- }
369
- ],
370
- name: "Initialized",
371
- type: "event"
372
- },
373
- {
374
- anonymous: false,
375
- inputs: [
376
- {
377
- indexed: true,
378
- internalType: "address",
379
- name: "previousOwner",
380
- type: "address"
381
- },
382
- {
383
- indexed: true,
384
- internalType: "address",
385
- name: "newOwner",
386
- type: "address"
387
- }
388
- ],
389
- name: "OwnershipTransferred",
390
- type: "event"
391
- },
392
- {
393
- anonymous: false,
394
- inputs: [
395
- {
396
- indexed: false,
397
- internalType: "address",
398
- name: "account",
399
- type: "address"
400
- }
401
- ],
402
- name: "Paused",
403
- type: "event"
404
- },
405
- {
406
- anonymous: false,
407
- inputs: [
408
- {
409
- indexed: true,
410
- internalType: "bytes32",
411
- name: "newRoot",
412
- type: "bytes32"
413
- },
414
- {
415
- indexed: false,
416
- internalType: "uint256",
417
- name: "epoch",
418
- type: "uint256"
419
- }
420
- ],
421
- name: "ReputationRootUpdated",
422
- type: "event"
423
- },
424
- {
425
- anonymous: false,
426
- inputs: [
427
- {
428
- indexed: true,
429
- internalType: "address",
430
- name: "agent",
431
- type: "address"
432
- },
433
- {
434
- indexed: false,
435
- internalType: "uint96",
436
- name: "additionalStake",
437
- type: "uint96"
438
- }
439
- ],
440
- name: "StakeIncreased",
441
- type: "event"
442
- },
443
- {
444
- anonymous: false,
445
- inputs: [
446
- {
447
- indexed: true,
448
- internalType: "address",
449
- name: "agent",
450
- type: "address"
451
- },
452
- {
453
- indexed: false,
454
- internalType: "uint96",
455
- name: "amount",
456
- type: "uint96"
457
- }
458
- ],
459
- name: "StakeWithdrawn",
460
- type: "event"
461
- },
462
- {
463
- anonymous: false,
464
- inputs: [
465
- {
466
- indexed: false,
467
- internalType: "address",
468
- name: "account",
469
- type: "address"
470
- }
471
- ],
472
- name: "Unpaused",
473
- type: "event"
474
- },
475
- {
476
- inputs: [],
477
- name: "MAX_REPUTATION",
478
- outputs: [
479
- {
480
- internalType: "uint256",
481
- name: "",
482
- type: "uint256"
483
- }
484
- ],
485
- stateMutability: "view",
486
- type: "function"
487
- },
488
- {
489
- inputs: [],
490
- name: "deactivate",
491
- outputs: [],
492
- stateMutability: "nonpayable",
493
- type: "function"
494
- },
495
- {
496
- inputs: [
497
- {
498
- internalType: "address",
499
- name: "to",
500
- type: "address"
501
- },
502
- {
503
- internalType: "uint256",
504
- name: "amount",
505
- type: "uint256"
506
- }
507
- ],
508
- name: "emergencyWithdraw",
509
- outputs: [],
510
- stateMutability: "nonpayable",
511
- type: "function"
512
- },
513
- {
514
- inputs: [
515
- {
516
- internalType: "address",
517
- name: "agent",
518
- type: "address"
519
- }
520
- ],
521
- name: "getAgent",
522
- outputs: [
523
- {
524
- components: [
525
- {
526
- internalType: "address",
527
- name: "owner",
528
- type: "address"
529
- },
530
- {
531
- internalType: "uint96",
532
- name: "stake",
533
- type: "uint96"
534
- },
535
- {
536
- internalType: "uint16",
537
- name: "reputation",
538
- type: "uint16"
539
- },
540
- {
541
- internalType: "uint32",
542
- name: "registeredAt",
543
- type: "uint32"
544
- },
545
- {
546
- internalType: "uint32",
547
- name: "lastActivity",
548
- type: "uint32"
549
- },
550
- {
551
- internalType: "bool",
552
- name: "active",
553
- type: "bool"
554
- },
555
- {
556
- internalType: "bytes32",
557
- name: "metadataRoot",
558
- type: "bytes32"
559
- }
560
- ],
561
- internalType: "struct CovenantIdentity.AgentRecordStorage",
562
- name: "",
563
- type: "tuple"
564
- }
565
- ],
566
- stateMutability: "view",
567
- type: "function"
568
- },
569
- {
570
- inputs: [
571
- {
572
- internalType: "address",
573
- name: "agent",
574
- type: "address"
575
- },
576
- {
577
- internalType: "bytes32",
578
- name: "capabilityHash",
579
- type: "bytes32"
580
- }
581
- ],
582
- name: "getCapability",
583
- outputs: [
584
- {
585
- components: [
586
- {
587
- internalType: "bytes32",
588
- name: "capabilityHash",
589
- type: "bytes32"
590
- },
591
- {
592
- internalType: "uint32",
593
- name: "expiry",
594
- type: "uint32"
595
- },
596
- {
597
- internalType: "uint128",
598
- name: "valueLimit",
599
- type: "uint128"
600
- },
601
- {
602
- internalType: "bool",
603
- name: "revoked",
604
- type: "bool"
605
- }
606
- ],
607
- internalType: "struct CovenantIdentity.CapabilityStorage",
608
- name: "",
609
- type: "tuple"
610
- }
611
- ],
612
- stateMutability: "view",
613
- type: "function"
614
- },
615
- {
616
- inputs: [
617
- {
618
- internalType: "address",
619
- name: "agent",
620
- type: "address"
621
- },
622
- {
623
- internalType: "bytes32",
624
- name: "capabilityHash",
625
- type: "bytes32"
626
- },
627
- {
628
- internalType: "uint32",
629
- name: "expiry",
630
- type: "uint32"
631
- },
632
- {
633
- internalType: "uint128",
634
- name: "valueLimit",
635
- type: "uint128"
636
- }
637
- ],
638
- name: "grantCapability",
639
- outputs: [],
640
- stateMutability: "nonpayable",
641
- type: "function"
642
- },
643
- {
644
- inputs: [
645
- {
646
- internalType: "address",
647
- name: "agent",
648
- type: "address"
649
- },
650
- {
651
- internalType: "bytes32",
652
- name: "capabilityHash",
653
- type: "bytes32"
654
- }
655
- ],
656
- name: "hasCapability",
657
- outputs: [
658
- {
659
- internalType: "bool",
660
- name: "",
661
- type: "bool"
662
- }
663
- ],
664
- stateMutability: "view",
665
- type: "function"
666
- },
667
- {
668
- inputs: [],
669
- name: "increaseStake",
670
- outputs: [],
671
- stateMutability: "payable",
672
- type: "function"
673
- },
674
- {
675
- inputs: [
676
- {
677
- internalType: "uint96",
678
- name: "_minimumStake",
679
- type: "uint96"
680
- },
681
- {
682
- internalType: "address",
683
- name: "_reputationOracle",
684
- type: "address"
685
- }
686
- ],
687
- name: "initialize",
688
- outputs: [],
689
- stateMutability: "nonpayable",
690
- type: "function"
691
- },
692
- {
693
- inputs: [
694
- {
695
- internalType: "address",
696
- name: "agent",
697
- type: "address"
698
- }
699
- ],
700
- name: "isRegistered",
701
- outputs: [
702
- {
703
- internalType: "bool",
704
- name: "",
705
- type: "bool"
706
- }
707
- ],
708
- stateMutability: "view",
709
- type: "function"
710
- },
711
- {
712
- inputs: [],
713
- name: "minimumStake",
714
- outputs: [
715
- {
716
- internalType: "uint96",
717
- name: "",
718
- type: "uint96"
719
- }
720
- ],
721
- stateMutability: "view",
722
- type: "function"
723
- },
724
- {
725
- inputs: [
726
- {
727
- internalType: "address",
728
- name: "",
729
- type: "address"
730
- }
731
- ],
732
- name: "nonces",
733
- outputs: [
734
- {
735
- internalType: "uint256",
736
- name: "",
737
- type: "uint256"
738
- }
739
- ],
740
- stateMutability: "view",
741
- type: "function"
742
- },
743
- {
744
- inputs: [],
745
- name: "owner",
746
- outputs: [
747
- {
748
- internalType: "address",
749
- name: "",
750
- type: "address"
751
- }
752
- ],
753
- stateMutability: "view",
754
- type: "function"
755
- },
756
- {
757
- inputs: [],
758
- name: "pause",
759
- outputs: [],
760
- stateMutability: "nonpayable",
761
- type: "function"
762
- },
763
- {
764
- inputs: [],
765
- name: "paused",
766
- outputs: [
767
- {
768
- internalType: "bool",
769
- name: "",
770
- type: "bool"
771
- }
772
- ],
773
- stateMutability: "view",
774
- type: "function"
775
- },
776
- {
777
- inputs: [
778
- {
779
- internalType: "uint96",
780
- name: "stake",
781
- type: "uint96"
782
- },
783
- {
784
- internalType: "bytes32",
785
- name: "metadataRoot",
786
- type: "bytes32"
787
- }
788
- ],
789
- name: "register",
790
- outputs: [],
791
- stateMutability: "payable",
792
- type: "function"
793
- },
794
- {
795
- inputs: [],
796
- name: "renounceOwnership",
797
- outputs: [],
798
- stateMutability: "nonpayable",
799
- type: "function"
800
- },
801
- {
802
- inputs: [],
803
- name: "reputationEpoch",
804
- outputs: [
805
- {
806
- internalType: "uint256",
807
- name: "",
808
- type: "uint256"
809
- }
810
- ],
811
- stateMutability: "view",
812
- type: "function"
813
- },
814
- {
815
- inputs: [],
816
- name: "reputationOracle",
817
- outputs: [
818
- {
819
- internalType: "address",
820
- name: "",
821
- type: "address"
822
- }
823
- ],
824
- stateMutability: "view",
825
- type: "function"
826
- },
827
- {
828
- inputs: [],
829
- name: "reputationRoot",
830
- outputs: [
831
- {
832
- internalType: "bytes32",
833
- name: "",
834
- type: "bytes32"
835
- }
836
- ],
837
- stateMutability: "view",
838
- type: "function"
839
- },
840
- {
841
- inputs: [
842
- {
843
- internalType: "address",
844
- name: "agent",
845
- type: "address"
846
- },
847
- {
848
- internalType: "bytes32",
849
- name: "capabilityHash",
850
- type: "bytes32"
851
- }
852
- ],
853
- name: "revokeCapability",
854
- outputs: [],
855
- stateMutability: "nonpayable",
856
- type: "function"
857
- },
858
- {
859
- inputs: [
860
- {
861
- internalType: "uint96",
862
- name: "stake",
863
- type: "uint96"
864
- }
865
- ],
866
- name: "setMinimumStake",
867
- outputs: [],
868
- stateMutability: "nonpayable",
869
- type: "function"
870
- },
871
- {
872
- inputs: [
873
- {
874
- internalType: "address",
875
- name: "oracle",
876
- type: "address"
877
- }
878
- ],
879
- name: "setReputationOracle",
880
- outputs: [],
881
- stateMutability: "nonpayable",
882
- type: "function"
883
- },
884
- {
885
- inputs: [],
886
- name: "totalAgents",
887
- outputs: [
888
- {
889
- internalType: "uint256",
890
- name: "",
891
- type: "uint256"
892
- }
893
- ],
894
- stateMutability: "view",
895
- type: "function"
896
- },
897
- {
898
- inputs: [
899
- {
900
- internalType: "address",
901
- name: "newOwner",
902
- type: "address"
903
- }
904
- ],
905
- name: "transferOwnership",
906
- outputs: [],
907
- stateMutability: "nonpayable",
908
- type: "function"
909
- },
910
- {
911
- inputs: [],
912
- name: "unpause",
913
- outputs: [],
914
- stateMutability: "nonpayable",
915
- type: "function"
916
- },
917
- {
918
- inputs: [
919
- {
920
- internalType: "bytes32",
921
- name: "newRoot",
922
- type: "bytes32"
923
- }
924
- ],
925
- name: "updateMetadata",
926
- outputs: [],
927
- stateMutability: "nonpayable",
928
- type: "function"
929
- },
930
- {
931
- inputs: [
932
- {
933
- internalType: "bytes32",
934
- name: "newRoot",
935
- type: "bytes32"
936
- },
937
- {
938
- internalType: "uint256",
939
- name: "epoch",
940
- type: "uint256"
941
- },
942
- {
943
- internalType: "bytes",
944
- name: "signature",
945
- type: "bytes"
946
- }
947
- ],
948
- name: "updateReputationRoot",
949
- outputs: [],
950
- stateMutability: "nonpayable",
951
- type: "function"
952
- },
953
- {
954
- inputs: [
955
- {
956
- internalType: "uint96",
957
- name: "amount",
958
- type: "uint96"
959
- }
960
- ],
961
- name: "withdrawStake",
962
- outputs: [],
963
- stateMutability: "nonpayable",
964
- type: "function"
965
- },
966
- {
967
- stateMutability: "payable",
968
- type: "receive"
969
- }
970
- ],
971
- bytecode: "0x60808060405234610016576117c7908161001c8239f35b600080fdfe6080604081815260049182361015610022575b505050361561002057600080fd5b005b600092833560e01c9182630a833888146111fe575081631422eab61461108c578163228e3f9b14610fa15781633f4ba83a14610f0b5781634d9852b314610eec5781634f2d777814610e6957816351b42b0014610dc55781635c6065fe14610c485781635c975abb14610c245781635ecea82414610ba95781636d8b763f14610b8a578163715018a614610b3f5781637e1f12e2146109905781637ecebe00146109585781638456cb59146108fd5781638da5cb5b146108d457816395ccea671461080b5781639f3bfef214610688578163b13a8c0714610643578163c3c5a547146105fe578163c5053712146105df578163d080a4951461048c578163d19cfdac14610441578163d213c0f214610424578163d9e257ef1461035d578163ec5ffac214610334578163f2fde38b1461029e57508063fad844c11461027d5763fb3551ff146101715780610012565b346102795760203660031901126102795760e0918161018e6112b6565b918060c0835161019d81611318565b82815282602082015282858201528260608201528260808201528260a0820152015260018060a01b03809316815260c9602052209160028151926101e084611318565b845490811694858552602085019160a01c825284600182015494859361ffff9082840190828716825260c063ffffffff98899760ff60a060608a01998b8d60101c168b528b608082019d60301c168d52019c60501c1615158c5201549a01998a5283519a8b5260018060601b0390511660208b0152511690880152511660608601525116608084015251151560a08301525160c0820152f35b5080fd5b503461027957816003193601126102795760209060cf5460601c9051908152f35b905034610330576020366003190112610330576102b96112b6565b916102c261146c565b6001600160a01b038316156102de57836102db84611508565b80f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b50503461027957816003193601126102795760cf5490516001600160601b039091168152602090f35b83838160031936011261027957610372611416565b33825260c960205260ff6001828420015460501c16156104155734156104065760018060601b03908134169133845260c960205281842083815460a01c019182116103f357906103c191611394565b519081527f1709bb120f4739d5e9db21ca30d845c2990051feac15e7551f4b3275a8fc6c1360203392a2600160655580f35b634e487b7160e01b855260118652602485fd5b5163d73ab2e160e01b81529050fd5b5163aba4733960e01b81529050fd5b505034610279578160031936011261027957602090516103e88152f35b83346104895760203660031901126104895761045b6112b6565b61046361146c565b60cf80546001600160601b031660609290921b6001600160601b03191691909117905580f35b80fd5b9190503461033057602090816003193601126105db576104aa6112d1565b926104b3611416565b33855260c9835260ff6001838720015460501c16156105cd5733855260c98352818520546001600160601b03808616959160a01c86116105bd5733875260c98552610504828589205460a01c6113e7565b60cf5482169116106105ae576105329033875260c9855261052c84882091825460a01c6113e7565b90611394565b8480808087335af16105426113b7565b501561057b5750907ff77522b1ace565ed4af80c1d0e7e54a8843d4cb74df650d78d89e44ffdecddb691519283523392a2600160655580f35b82606492519162461bcd60e51b8352820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152fd5b50905163de588d7360e01b8152fd5b83516378de4a6960e11b81528390fd5b905163aba4733960e01b8152fd5b8380fd5b50503461027957816003193601126102795760209060ce549051908152f35b5050346102795760203660031901126102795760209160ff9060019083906001600160a01b0361062c6112b6565b16815260c9865220015460501c1690519015158152f35b83346104895760203660031901126104895761065d6112d1565b61066561146c565b60cf80546001600160601b0319166001600160601b039290921691909117905580f35b838334610279576080366003190112610279576106a36112b6565b9060243560443563ffffffff93848216809203610807576064356001600160801b0381169590869003610803576106d8611416565b60018060a01b038092169586885260209260c9845260ff6001888b20015460501c16156107f3578733141590816107e4575b506107d557834210156107c5577f341d294f62167dd3c0fade9b22ef10ebbb4b008880ef98641705d2ffb5604558969798508551610747816112e7565b858152838101858152878201928352606082018b81528a8c5260ca8652888c20888d528652888c209251835590516001929092018054935191516001600160a81b0319909416929094169190911790841b600160201b600160a01b03161790151560a01b60ff60a01b161790558351928352820152a2600160655580f35b8551631cb1d7ed60e21b81528990fd5b85516282b42960e81b81528990fd5b9050603354163314158a61070a565b865163aba4733960e01b81528a90fd5b8680fd5b8580fd5b9050346103305781600319360112610330576108256112b6565b916024359161083261146c565b6001600160a01b0384169384156108c5578580808681945af16108536113b7565b501561088757507f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd96959160209151908152a280f35b6020606492519162461bcd60e51b83528201526019602482015278195b595c99d95b98de481dda5d1a191c985dc819985a5b1959603a1b6044820152fd5b50905163e6c4247b60e01b8152fd5b50503461027957816003193601126102795760335490516001600160a01b039091168152602090f35b50503461027957816003193601126102795760207f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589161093b61146c565b6109436114c4565b600160ff19609754161760975551338152a180f35b5050346102795760203660031901126102795760209181906001600160a01b036109806112b6565b16815260cb845220549051908152f35b9050346103305781600319360112610330576109aa6112d1565b60243591906001600160a01b0383168303610b3b5784549260ff8460081c161592838094610b2e575b8015610b17575b15610abd575060ff1984811660011787559383610aac575b50610a0c60ff875460081c16610a078161153f565b61153f565b610a1533611508565b855493610a4260ff8660081c16610a2b8161153f565b610a348161153f565b6001606555610a078161153f565b609780549190911690556001600160601b039190911660609190911b6001600160601b0319161760cf55610a74578280f35b61ff001916825551600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a138808280f35b61ffff1916610101178655386109f2565b608490602087519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156109da5750600160ff8616146109da565b50600160ff8616106109d3565b8480fd5b8334610489578060031936011261048957610b5861146c565b603380546001600160a01b0319811690915581906001600160a01b03166000805160206117728339815191528280a380f35b50503461027957816003193601126102795760209060cc549051908152f35b50503461027957806003193601126102795760209181906001600160a01b03610bd06112b6565b16815260ca8452818120602435825284522090815415159182610c11575b82610bfd575b50519015158152f35b6001015463ffffffff164210915038610bf4565b600181015460a01c60ff16159250610bee565b50503461027957816003193601126102795760209060ff6097541690519015158152f35b9180915060031936011261033057610c5e6112d1565b50610c67611416565b610c6f6114c4565b33835260c960205260ff6001828520015460501c16610db85760cf546001600160601b03929083163410610daa57508134169160028463ffffffff92834216610d50865195610cbd87611318565b3387526020870192898452888801946101f48652610d2160608a019183835260808b0193845260a08b0196600188528c60c08d019a6024358c5233815260c9602052209b60018060a01b0390511660018060a01b03198d5416178c5551168a611394565b61ffff60018a0196511665ffffffff00008754925160101b169165ffffffffffff191617178555511683611371565b51815460ff60501b191690151560501b60ff60501b161790555191015560ce805460010190555190815233907ffc29aa02e655fb9a6c967b371306b0577800df6a7950e859fc875876df08a5a290602090a2600160655580f35b90516378de4a6960e11b8152fd5b51630ea075bf60e21b8152fd5b905034610330578260031936011261033057610ddf611416565b33835260c960205260ff6001838520015460501c16156105cd573380845260c9602052828420546001600160a01b031603610e5b57503380835260c9602052908220600101805460ff60501b191690557fa58c733780f5c1527d6106ff1e731cbf2e9ffc0eb11ad399ca33ea55f057ddf48280a2600160655580f35b90516330cd747160e01b8152fd5b919050346103305760203660031901126103305781359133845260c960205260ff6001838620015460501c16156105cd575033835260c9602052610ebf818420836002820155600163ffffffff42169101611371565b519081527f85e942a9781a2b43f91ddcc93bbcd7da939ed743d3e9d01f2ce765826e7c84d260203392a280f35b50503461027957816003193601126102795760209060cd549051908152f35b905034610330578260031936011261033057610f2561146c565b6097549060ff821615610f67575060ff1916609755513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a180f35b606490602084519162461bcd60e51b8352820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152fd5b905034610330578160031936011261033057610fbb6112b6565b9160243591610fc8611416565b6001600160a01b039384169333851415908161107d575b506110705783855260ca602052818520838652602052818520805415611061576001019081549060ff8260a01c16611053575060ff60a01b1916600160a01b179055519081527f6cc46c13bf9ecc309370a9150165239f833c3742128d77220c49cb4915a07bc790602090a2600160655580f35b835163905e710760e01b8152fd5b509051635ad384df60e11b8152fd5b90516282b42960e81b8152fd5b90506033541633141538610fdf565b90503461033057606036600319011261033057803591602435916001600160401b03604435818111610803573660238201121561080357808301358281116111fa5736602482840101116111fa576110e2611416565b60cf5460601c928333036111eb578551602081019189835288888301528782526060820190828210908211176111d857916111799391611181959389525190207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b8b52601c52896020603c82209280602461115b82611356565b966111688d519889611333565b82885201838701378401015261159f565b9190916115d7565b6001600160a01b0316036111ca57507fe1e93c64c7d8f42950e3178e2c4e4583255fd543836c1ed9dbdf5b0256d0e1fd916020918460cc558160cd5551908152a2600160655580f35b9051638baa579f60e01b8152fd5b634e487b7160e01b8b526041875260248bfd5b85516282b42960e81b81528590fd5b8780fd5b915050346103305781600319360112610330578160809361121d6112b6565b611226846112e7565b81845281606060209582878201528286820152015260018060a01b0316815260ca8352818120602435825283522091805191611261836112e7565b600184549485855201549263ffffffff91808201928086168452600180891b039360ff606087860195878a871c168752019760a01c161515875285519788525116908601525116908301525115156060820152f35b600435906001600160a01b03821682036112cc57565b600080fd5b600435906001600160601b03821682036112cc57565b608081019081106001600160401b0382111761130257604052565b634e487b7160e01b600052604160045260246000fd5b60e081019081106001600160401b0382111761130257604052565b601f909101601f19168101906001600160401b0382119082101761130257604052565b6001600160401b03811161130257601f01601f191660200190565b805463ffffffff60301b191660309290921b63ffffffff60301b16919091179055565b80546001600160a01b031660a09290921b6001600160a01b031916919091179055565b3d156113e2573d906113c882611356565b916113d66040519384611333565b82523d6000602084013e565b606090565b6001600160601b03918216908216039190821161140057565b634e487b7160e01b600052601160045260246000fd5b600260655414611427576002606555565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b6033546001600160a01b0316330361148057565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60ff609754166114d057565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b603380546001600160a01b039283166001600160a01b031982168117909255909116600080516020611772833981519152600080a3565b1561154657565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b9060418151146000146115cd576115c9916020820151906060604084015193015160001a906116ec565b9091565b5050600090600290565b60058110156116d657806115e85750565b600181036116305760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606490fd5b6002810361167d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b60031461168657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291906fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383116117655791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156117585781516001600160a01b03811615611752579190565b50600190565b50604051903d90823e3d90fd5b5050505060009060039056fe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220df15d55637e28a522ebd189c0721c823fae6ed20f488cf291aac5cc7c26fe3b564736f6c63430008180033",
972
- deployedBytecode: "0x6080604081815260049182361015610022575b505050361561002057600080fd5b005b600092833560e01c9182630a833888146111fe575081631422eab61461108c578163228e3f9b14610fa15781633f4ba83a14610f0b5781634d9852b314610eec5781634f2d777814610e6957816351b42b0014610dc55781635c6065fe14610c485781635c975abb14610c245781635ecea82414610ba95781636d8b763f14610b8a578163715018a614610b3f5781637e1f12e2146109905781637ecebe00146109585781638456cb59146108fd5781638da5cb5b146108d457816395ccea671461080b5781639f3bfef214610688578163b13a8c0714610643578163c3c5a547146105fe578163c5053712146105df578163d080a4951461048c578163d19cfdac14610441578163d213c0f214610424578163d9e257ef1461035d578163ec5ffac214610334578163f2fde38b1461029e57508063fad844c11461027d5763fb3551ff146101715780610012565b346102795760203660031901126102795760e0918161018e6112b6565b918060c0835161019d81611318565b82815282602082015282858201528260608201528260808201528260a0820152015260018060a01b03809316815260c9602052209160028151926101e084611318565b845490811694858552602085019160a01c825284600182015494859361ffff9082840190828716825260c063ffffffff98899760ff60a060608a01998b8d60101c168b528b608082019d60301c168d52019c60501c1615158c5201549a01998a5283519a8b5260018060601b0390511660208b0152511690880152511660608601525116608084015251151560a08301525160c0820152f35b5080fd5b503461027957816003193601126102795760209060cf5460601c9051908152f35b905034610330576020366003190112610330576102b96112b6565b916102c261146c565b6001600160a01b038316156102de57836102db84611508565b80f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b50503461027957816003193601126102795760cf5490516001600160601b039091168152602090f35b83838160031936011261027957610372611416565b33825260c960205260ff6001828420015460501c16156104155734156104065760018060601b03908134169133845260c960205281842083815460a01c019182116103f357906103c191611394565b519081527f1709bb120f4739d5e9db21ca30d845c2990051feac15e7551f4b3275a8fc6c1360203392a2600160655580f35b634e487b7160e01b855260118652602485fd5b5163d73ab2e160e01b81529050fd5b5163aba4733960e01b81529050fd5b505034610279578160031936011261027957602090516103e88152f35b83346104895760203660031901126104895761045b6112b6565b61046361146c565b60cf80546001600160601b031660609290921b6001600160601b03191691909117905580f35b80fd5b9190503461033057602090816003193601126105db576104aa6112d1565b926104b3611416565b33855260c9835260ff6001838720015460501c16156105cd5733855260c98352818520546001600160601b03808616959160a01c86116105bd5733875260c98552610504828589205460a01c6113e7565b60cf5482169116106105ae576105329033875260c9855261052c84882091825460a01c6113e7565b90611394565b8480808087335af16105426113b7565b501561057b5750907ff77522b1ace565ed4af80c1d0e7e54a8843d4cb74df650d78d89e44ffdecddb691519283523392a2600160655580f35b82606492519162461bcd60e51b8352820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152fd5b50905163de588d7360e01b8152fd5b83516378de4a6960e11b81528390fd5b905163aba4733960e01b8152fd5b8380fd5b50503461027957816003193601126102795760209060ce549051908152f35b5050346102795760203660031901126102795760209160ff9060019083906001600160a01b0361062c6112b6565b16815260c9865220015460501c1690519015158152f35b83346104895760203660031901126104895761065d6112d1565b61066561146c565b60cf80546001600160601b0319166001600160601b039290921691909117905580f35b838334610279576080366003190112610279576106a36112b6565b9060243560443563ffffffff93848216809203610807576064356001600160801b0381169590869003610803576106d8611416565b60018060a01b038092169586885260209260c9845260ff6001888b20015460501c16156107f3578733141590816107e4575b506107d557834210156107c5577f341d294f62167dd3c0fade9b22ef10ebbb4b008880ef98641705d2ffb5604558969798508551610747816112e7565b858152838101858152878201928352606082018b81528a8c5260ca8652888c20888d528652888c209251835590516001929092018054935191516001600160a81b0319909416929094169190911790841b600160201b600160a01b03161790151560a01b60ff60a01b161790558351928352820152a2600160655580f35b8551631cb1d7ed60e21b81528990fd5b85516282b42960e81b81528990fd5b9050603354163314158a61070a565b865163aba4733960e01b81528a90fd5b8680fd5b8580fd5b9050346103305781600319360112610330576108256112b6565b916024359161083261146c565b6001600160a01b0384169384156108c5578580808681945af16108536113b7565b501561088757507f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd96959160209151908152a280f35b6020606492519162461bcd60e51b83528201526019602482015278195b595c99d95b98de481dda5d1a191c985dc819985a5b1959603a1b6044820152fd5b50905163e6c4247b60e01b8152fd5b50503461027957816003193601126102795760335490516001600160a01b039091168152602090f35b50503461027957816003193601126102795760207f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589161093b61146c565b6109436114c4565b600160ff19609754161760975551338152a180f35b5050346102795760203660031901126102795760209181906001600160a01b036109806112b6565b16815260cb845220549051908152f35b9050346103305781600319360112610330576109aa6112d1565b60243591906001600160a01b0383168303610b3b5784549260ff8460081c161592838094610b2e575b8015610b17575b15610abd575060ff1984811660011787559383610aac575b50610a0c60ff875460081c16610a078161153f565b61153f565b610a1533611508565b855493610a4260ff8660081c16610a2b8161153f565b610a348161153f565b6001606555610a078161153f565b609780549190911690556001600160601b039190911660609190911b6001600160601b0319161760cf55610a74578280f35b61ff001916825551600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a138808280f35b61ffff1916610101178655386109f2565b608490602087519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156109da5750600160ff8616146109da565b50600160ff8616106109d3565b8480fd5b8334610489578060031936011261048957610b5861146c565b603380546001600160a01b0319811690915581906001600160a01b03166000805160206117728339815191528280a380f35b50503461027957816003193601126102795760209060cc549051908152f35b50503461027957806003193601126102795760209181906001600160a01b03610bd06112b6565b16815260ca8452818120602435825284522090815415159182610c11575b82610bfd575b50519015158152f35b6001015463ffffffff164210915038610bf4565b600181015460a01c60ff16159250610bee565b50503461027957816003193601126102795760209060ff6097541690519015158152f35b9180915060031936011261033057610c5e6112d1565b50610c67611416565b610c6f6114c4565b33835260c960205260ff6001828520015460501c16610db85760cf546001600160601b03929083163410610daa57508134169160028463ffffffff92834216610d50865195610cbd87611318565b3387526020870192898452888801946101f48652610d2160608a019183835260808b0193845260a08b0196600188528c60c08d019a6024358c5233815260c9602052209b60018060a01b0390511660018060a01b03198d5416178c5551168a611394565b61ffff60018a0196511665ffffffff00008754925160101b169165ffffffffffff191617178555511683611371565b51815460ff60501b191690151560501b60ff60501b161790555191015560ce805460010190555190815233907ffc29aa02e655fb9a6c967b371306b0577800df6a7950e859fc875876df08a5a290602090a2600160655580f35b90516378de4a6960e11b8152fd5b51630ea075bf60e21b8152fd5b905034610330578260031936011261033057610ddf611416565b33835260c960205260ff6001838520015460501c16156105cd573380845260c9602052828420546001600160a01b031603610e5b57503380835260c9602052908220600101805460ff60501b191690557fa58c733780f5c1527d6106ff1e731cbf2e9ffc0eb11ad399ca33ea55f057ddf48280a2600160655580f35b90516330cd747160e01b8152fd5b919050346103305760203660031901126103305781359133845260c960205260ff6001838620015460501c16156105cd575033835260c9602052610ebf818420836002820155600163ffffffff42169101611371565b519081527f85e942a9781a2b43f91ddcc93bbcd7da939ed743d3e9d01f2ce765826e7c84d260203392a280f35b50503461027957816003193601126102795760209060cd549051908152f35b905034610330578260031936011261033057610f2561146c565b6097549060ff821615610f67575060ff1916609755513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a180f35b606490602084519162461bcd60e51b8352820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152fd5b905034610330578160031936011261033057610fbb6112b6565b9160243591610fc8611416565b6001600160a01b039384169333851415908161107d575b506110705783855260ca602052818520838652602052818520805415611061576001019081549060ff8260a01c16611053575060ff60a01b1916600160a01b179055519081527f6cc46c13bf9ecc309370a9150165239f833c3742128d77220c49cb4915a07bc790602090a2600160655580f35b835163905e710760e01b8152fd5b509051635ad384df60e11b8152fd5b90516282b42960e81b8152fd5b90506033541633141538610fdf565b90503461033057606036600319011261033057803591602435916001600160401b03604435818111610803573660238201121561080357808301358281116111fa5736602482840101116111fa576110e2611416565b60cf5460601c928333036111eb578551602081019189835288888301528782526060820190828210908211176111d857916111799391611181959389525190207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b8b52601c52896020603c82209280602461115b82611356565b966111688d519889611333565b82885201838701378401015261159f565b9190916115d7565b6001600160a01b0316036111ca57507fe1e93c64c7d8f42950e3178e2c4e4583255fd543836c1ed9dbdf5b0256d0e1fd916020918460cc558160cd5551908152a2600160655580f35b9051638baa579f60e01b8152fd5b634e487b7160e01b8b526041875260248bfd5b85516282b42960e81b81528590fd5b8780fd5b915050346103305781600319360112610330578160809361121d6112b6565b611226846112e7565b81845281606060209582878201528286820152015260018060a01b0316815260ca8352818120602435825283522091805191611261836112e7565b600184549485855201549263ffffffff91808201928086168452600180891b039360ff606087860195878a871c168752019760a01c161515875285519788525116908601525116908301525115156060820152f35b600435906001600160a01b03821682036112cc57565b600080fd5b600435906001600160601b03821682036112cc57565b608081019081106001600160401b0382111761130257604052565b634e487b7160e01b600052604160045260246000fd5b60e081019081106001600160401b0382111761130257604052565b601f909101601f19168101906001600160401b0382119082101761130257604052565b6001600160401b03811161130257601f01601f191660200190565b805463ffffffff60301b191660309290921b63ffffffff60301b16919091179055565b80546001600160a01b031660a09290921b6001600160a01b031916919091179055565b3d156113e2573d906113c882611356565b916113d66040519384611333565b82523d6000602084013e565b606090565b6001600160601b03918216908216039190821161140057565b634e487b7160e01b600052601160045260246000fd5b600260655414611427576002606555565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b6033546001600160a01b0316330361148057565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60ff609754166114d057565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b603380546001600160a01b039283166001600160a01b031982168117909255909116600080516020611772833981519152600080a3565b1561154657565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b9060418151146000146115cd576115c9916020820151906060604084015193015160001a906116ec565b9091565b5050600090600290565b60058110156116d657806115e85750565b600181036116305760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606490fd5b6002810361167d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b60031461168657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291906fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383116117655791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156117585781516001600160a01b03811615611752579190565b50600190565b50604051903d90823e3d90fd5b5050505060009060039056fe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220df15d55637e28a522ebd189c0721c823fae6ed20f488cf291aac5cc7c26fe3b564736f6c63430008180033",
973
- linkReferences: {},
974
- deployedLinkReferences: {}
975
- };
976
-
977
- // src/contracts/CovenantIdentity.ts
978
- var CovenantIdentityABI = CovenantIdentity_default.abi;
979
-
980
- // src/contracts/CovenantEscrow.json
981
- var CovenantEscrow_default = {
982
- _format: "hh-sol-artifact-1",
983
- contractName: "CovenantEscrow",
984
- sourceName: "contracts/v5/core/CovenantEscrow.sol",
985
- abi: [
986
- {
987
- inputs: [],
988
- stateMutability: "nonpayable",
989
- type: "constructor"
990
- },
991
- {
992
- inputs: [],
993
- name: "BatchLengthMismatch",
994
- type: "error"
995
- },
996
- {
997
- inputs: [],
998
- name: "BatchTooLarge",
999
- type: "error"
1000
- },
1001
- {
1002
- inputs: [],
1003
- name: "DeadlineExceeded",
1004
- type: "error"
1005
- },
1006
- {
1007
- inputs: [],
1008
- name: "DeadlineTooFar",
1009
- type: "error"
1010
- },
1011
- {
1012
- inputs: [],
1013
- name: "DeadlineTooSoon",
1014
- type: "error"
1015
- },
1016
- {
1017
- inputs: [],
1018
- name: "InsufficientValue",
1019
- type: "error"
1020
- },
1021
- {
1022
- inputs: [],
1023
- name: "InvalidAddress",
1024
- type: "error"
1025
- },
1026
- {
1027
- inputs: [],
1028
- name: "InvalidClientSignature",
1029
- type: "error"
1030
- },
1031
- {
1032
- inputs: [],
1033
- name: "NotActionable",
1034
- type: "error"
1035
- },
1036
- {
1037
- inputs: [],
1038
- name: "NotCancellable",
1039
- type: "error"
1040
- },
1041
- {
1042
- inputs: [],
1043
- name: "NotClient",
1044
- type: "error"
1045
- },
1046
- {
1047
- inputs: [],
1048
- name: "NotCreatable",
1049
- type: "error"
1050
- },
1051
- {
1052
- inputs: [],
1053
- name: "NotDisputable",
1054
- type: "error"
1055
- },
1056
- {
1057
- inputs: [],
1058
- name: "NotFunded",
1059
- type: "error"
1060
- },
1061
- {
1062
- inputs: [],
1063
- name: "NotParty",
1064
- type: "error"
1065
- },
1066
- {
1067
- inputs: [],
1068
- name: "NotSubmitted",
1069
- type: "error"
1070
- },
1071
- {
1072
- inputs: [],
1073
- name: "NotWorker",
1074
- type: "error"
1075
- },
1076
- {
1077
- inputs: [],
1078
- name: "Unauthorized",
1079
- type: "error"
1080
- },
1081
- {
1082
- inputs: [],
1083
- name: "WorkerAssigned",
1084
- type: "error"
1085
- },
1086
- {
1087
- anonymous: false,
1088
- inputs: [
1089
- {
1090
- indexed: false,
1091
- internalType: "uint256",
1092
- name: "totalSettled",
1093
- type: "uint256"
1094
- },
1095
- {
1096
- indexed: false,
1097
- internalType: "uint256",
1098
- name: "count",
1099
- type: "uint256"
1100
- }
1101
- ],
1102
- name: "BatchSettled",
1103
- type: "event"
1104
- },
1105
- {
1106
- anonymous: false,
1107
- inputs: [
1108
- {
1109
- indexed: true,
1110
- internalType: "address",
1111
- name: "to",
1112
- type: "address"
1113
- },
1114
- {
1115
- indexed: false,
1116
- internalType: "uint256",
1117
- name: "amount",
1118
- type: "uint256"
1119
- }
1120
- ],
1121
- name: "EmergencyWithdraw",
1122
- type: "event"
1123
- },
1124
- {
1125
- anonymous: false,
1126
- inputs: [
1127
- {
1128
- indexed: false,
1129
- internalType: "uint8",
1130
- name: "version",
1131
- type: "uint8"
1132
- }
1133
- ],
1134
- name: "Initialized",
1135
- type: "event"
1136
- },
1137
- {
1138
- anonymous: false,
1139
- inputs: [
1140
- {
1141
- indexed: true,
1142
- internalType: "address",
1143
- name: "previousOwner",
1144
- type: "address"
1145
- },
1146
- {
1147
- indexed: true,
1148
- internalType: "address",
1149
- name: "newOwner",
1150
- type: "address"
1151
- }
1152
- ],
1153
- name: "OwnershipTransferred",
1154
- type: "event"
1155
- },
1156
- {
1157
- anonymous: false,
1158
- inputs: [
1159
- {
1160
- indexed: false,
1161
- internalType: "address",
1162
- name: "account",
1163
- type: "address"
1164
- }
1165
- ],
1166
- name: "Paused",
1167
- type: "event"
1168
- },
1169
- {
1170
- anonymous: false,
1171
- inputs: [
1172
- {
1173
- indexed: true,
1174
- internalType: "address",
1175
- name: "to",
1176
- type: "address"
1177
- },
1178
- {
1179
- indexed: false,
1180
- internalType: "uint256",
1181
- name: "amount",
1182
- type: "uint256"
1183
- }
1184
- ],
1185
- name: "RefundIssued",
1186
- type: "event"
1187
- },
1188
- {
1189
- anonymous: false,
1190
- inputs: [
1191
- {
1192
- indexed: true,
1193
- internalType: "uint256",
1194
- name: "taskId",
1195
- type: "uint256"
1196
- }
1197
- ],
1198
- name: "TaskCancelled",
1199
- type: "event"
1200
- },
1201
- {
1202
- anonymous: false,
1203
- inputs: [
1204
- {
1205
- indexed: true,
1206
- internalType: "uint256",
1207
- name: "taskId",
1208
- type: "uint256"
1209
- },
1210
- {
1211
- indexed: false,
1212
- internalType: "uint128",
1213
- name: "payout",
1214
- type: "uint128"
1215
- }
1216
- ],
1217
- name: "TaskCompleted",
1218
- type: "event"
1219
- },
1220
- {
1221
- anonymous: false,
1222
- inputs: [
1223
- {
1224
- indexed: true,
1225
- internalType: "uint256",
1226
- name: "taskId",
1227
- type: "uint256"
1228
- },
1229
- {
1230
- indexed: true,
1231
- internalType: "address",
1232
- name: "client",
1233
- type: "address"
1234
- },
1235
- {
1236
- indexed: false,
1237
- internalType: "bytes32",
1238
- name: "metaHash",
1239
- type: "bytes32"
1240
- }
1241
- ],
1242
- name: "TaskCreated",
1243
- type: "event"
1244
- },
1245
- {
1246
- anonymous: false,
1247
- inputs: [
1248
- {
1249
- indexed: true,
1250
- internalType: "uint256",
1251
- name: "taskId",
1252
- type: "uint256"
1253
- },
1254
- {
1255
- indexed: true,
1256
- internalType: "address",
1257
- name: "disputant",
1258
- type: "address"
1259
- }
1260
- ],
1261
- name: "TaskDisputed",
1262
- type: "event"
1263
- },
1264
- {
1265
- anonymous: false,
1266
- inputs: [
1267
- {
1268
- indexed: true,
1269
- internalType: "uint256",
1270
- name: "taskId",
1271
- type: "uint256"
1272
- },
1273
- {
1274
- indexed: false,
1275
- internalType: "bytes32",
1276
- name: "reason",
1277
- type: "bytes32"
1278
- }
1279
- ],
1280
- name: "TaskFailed",
1281
- type: "event"
1282
- },
1283
- {
1284
- anonymous: false,
1285
- inputs: [
1286
- {
1287
- indexed: true,
1288
- internalType: "uint256",
1289
- name: "taskId",
1290
- type: "uint256"
1291
- },
1292
- {
1293
- indexed: false,
1294
- internalType: "uint128",
1295
- name: "amount",
1296
- type: "uint128"
1297
- }
1298
- ],
1299
- name: "TaskFunded",
1300
- type: "event"
1301
- },
1302
- {
1303
- anonymous: false,
1304
- inputs: [
1305
- {
1306
- indexed: true,
1307
- internalType: "uint256",
1308
- name: "taskId",
1309
- type: "uint256"
1310
- },
1311
- {
1312
- indexed: true,
1313
- internalType: "address",
1314
- name: "worker",
1315
- type: "address"
1316
- },
1317
- {
1318
- indexed: false,
1319
- internalType: "bytes32",
1320
- name: "deliverableHash",
1321
- type: "bytes32"
1322
- }
1323
- ],
1324
- name: "TaskSubmitted",
1325
- type: "event"
1326
- },
1327
- {
1328
- anonymous: false,
1329
- inputs: [
1330
- {
1331
- indexed: false,
1332
- internalType: "address",
1333
- name: "account",
1334
- type: "address"
1335
- }
1336
- ],
1337
- name: "Unpaused",
1338
- type: "event"
1339
- },
1340
- {
1341
- inputs: [],
1342
- name: "MAX_BATCH_SIZE",
1343
- outputs: [
1344
- {
1345
- internalType: "uint256",
1346
- name: "",
1347
- type: "uint256"
1348
- }
1349
- ],
1350
- stateMutability: "view",
1351
- type: "function"
1352
- },
1353
- {
1354
- inputs: [],
1355
- name: "MAX_DEADLINE",
1356
- outputs: [
1357
- {
1358
- internalType: "uint256",
1359
- name: "",
1360
- type: "uint256"
1361
- }
1362
- ],
1363
- stateMutability: "view",
1364
- type: "function"
1365
- },
1366
- {
1367
- inputs: [],
1368
- name: "MIN_DEADLINE",
1369
- outputs: [
1370
- {
1371
- internalType: "uint256",
1372
- name: "",
1373
- type: "uint256"
1374
- }
1375
- ],
1376
- stateMutability: "view",
1377
- type: "function"
1378
- },
1379
- {
1380
- inputs: [],
1381
- name: "authorizedArbitration",
1382
- outputs: [
1383
- {
1384
- internalType: "address",
1385
- name: "",
1386
- type: "address"
1387
- }
1388
- ],
1389
- stateMutability: "view",
1390
- type: "function"
1391
- },
1392
- {
1393
- inputs: [],
1394
- name: "authorizedSettlement",
1395
- outputs: [
1396
- {
1397
- internalType: "address",
1398
- name: "",
1399
- type: "address"
1400
- }
1401
- ],
1402
- stateMutability: "view",
1403
- type: "function"
1404
- },
1405
- {
1406
- inputs: [
1407
- {
1408
- internalType: "uint256[]",
1409
- name: "taskIds",
1410
- type: "uint256[]"
1411
- },
1412
- {
1413
- internalType: "uint128[]",
1414
- name: "amounts",
1415
- type: "uint128[]"
1416
- },
1417
- {
1418
- internalType: "bytes[]",
1419
- name: "signatures",
1420
- type: "bytes[]"
1421
- }
1422
- ],
1423
- name: "batchSettle",
1424
- outputs: [],
1425
- stateMutability: "nonpayable",
1426
- type: "function"
1427
- },
1428
- {
1429
- inputs: [
1430
- {
1431
- internalType: "uint256",
1432
- name: "taskId",
1433
- type: "uint256"
1434
- }
1435
- ],
1436
- name: "cancelTask",
1437
- outputs: [],
1438
- stateMutability: "nonpayable",
1439
- type: "function"
1440
- },
1441
- {
1442
- inputs: [
1443
- {
1444
- internalType: "uint256",
1445
- name: "taskId",
1446
- type: "uint256"
1447
- },
1448
- {
1449
- internalType: "bytes",
1450
- name: "clientSignature",
1451
- type: "bytes"
1452
- }
1453
- ],
1454
- name: "completeTask",
1455
- outputs: [],
1456
- stateMutability: "nonpayable",
1457
- type: "function"
1458
- },
1459
- {
1460
- inputs: [
1461
- {
1462
- internalType: "address",
1463
- name: "worker",
1464
- type: "address"
1465
- },
1466
- {
1467
- internalType: "uint128",
1468
- name: "amount",
1469
- type: "uint128"
1470
- },
1471
- {
1472
- internalType: "uint32",
1473
- name: "deadline",
1474
- type: "uint32"
1475
- },
1476
- {
1477
- internalType: "bytes32",
1478
- name: "metaHash",
1479
- type: "bytes32"
1480
- }
1481
- ],
1482
- name: "createTask",
1483
- outputs: [
1484
- {
1485
- internalType: "uint256",
1486
- name: "taskId",
1487
- type: "uint256"
1488
- }
1489
- ],
1490
- stateMutability: "payable",
1491
- type: "function"
1492
- },
1493
- {
1494
- inputs: [
1495
- {
1496
- internalType: "uint256",
1497
- name: "taskId",
1498
- type: "uint256"
1499
- }
1500
- ],
1501
- name: "disputeTask",
1502
- outputs: [],
1503
- stateMutability: "nonpayable",
1504
- type: "function"
1505
- },
1506
- {
1507
- inputs: [
1508
- {
1509
- internalType: "address",
1510
- name: "to",
1511
- type: "address"
1512
- },
1513
- {
1514
- internalType: "uint256",
1515
- name: "amount",
1516
- type: "uint256"
1517
- }
1518
- ],
1519
- name: "emergencyWithdraw",
1520
- outputs: [],
1521
- stateMutability: "nonpayable",
1522
- type: "function"
1523
- },
1524
- {
1525
- inputs: [
1526
- {
1527
- internalType: "uint256",
1528
- name: "taskId",
1529
- type: "uint256"
1530
- },
1531
- {
1532
- internalType: "bytes32",
1533
- name: "reason",
1534
- type: "bytes32"
1535
- }
1536
- ],
1537
- name: "failTask",
1538
- outputs: [],
1539
- stateMutability: "nonpayable",
1540
- type: "function"
1541
- },
1542
- {
1543
- inputs: [
1544
- {
1545
- internalType: "uint256",
1546
- name: "taskId",
1547
- type: "uint256"
1548
- }
1549
- ],
1550
- name: "fundTask",
1551
- outputs: [],
1552
- stateMutability: "payable",
1553
- type: "function"
1554
- },
1555
- {
1556
- inputs: [
1557
- {
1558
- internalType: "uint256",
1559
- name: "taskId",
1560
- type: "uint256"
1561
- }
1562
- ],
1563
- name: "getTask",
1564
- outputs: [
1565
- {
1566
- components: [
1567
- {
1568
- internalType: "address",
1569
- name: "client",
1570
- type: "address"
1571
- },
1572
- {
1573
- internalType: "address",
1574
- name: "worker",
1575
- type: "address"
1576
- },
1577
- {
1578
- internalType: "uint128",
1579
- name: "amount",
1580
- type: "uint128"
1581
- },
1582
- {
1583
- internalType: "uint32",
1584
- name: "deadline",
1585
- type: "uint32"
1586
- },
1587
- {
1588
- internalType: "enum CovenantEscrow.TaskStatus",
1589
- name: "status",
1590
- type: "uint8"
1591
- },
1592
- {
1593
- internalType: "uint8",
1594
- name: "disputeCount",
1595
- type: "uint8"
1596
- },
1597
- {
1598
- internalType: "bytes32",
1599
- name: "metaHash",
1600
- type: "bytes32"
1601
- }
1602
- ],
1603
- internalType: "struct CovenantEscrow.TaskStorage",
1604
- name: "",
1605
- type: "tuple"
1606
- }
1607
- ],
1608
- stateMutability: "view",
1609
- type: "function"
1610
- },
1611
- {
1612
- inputs: [],
1613
- name: "identity",
1614
- outputs: [
1615
- {
1616
- internalType: "address",
1617
- name: "",
1618
- type: "address"
1619
- }
1620
- ],
1621
- stateMutability: "view",
1622
- type: "function"
1623
- },
1624
- {
1625
- inputs: [
1626
- {
1627
- internalType: "address",
1628
- name: "_identity",
1629
- type: "address"
1630
- }
1631
- ],
1632
- name: "initialize",
1633
- outputs: [],
1634
- stateMutability: "nonpayable",
1635
- type: "function"
1636
- },
1637
- {
1638
- inputs: [],
1639
- name: "owner",
1640
- outputs: [
1641
- {
1642
- internalType: "address",
1643
- name: "",
1644
- type: "address"
1645
- }
1646
- ],
1647
- stateMutability: "view",
1648
- type: "function"
1649
- },
1650
- {
1651
- inputs: [],
1652
- name: "pause",
1653
- outputs: [],
1654
- stateMutability: "nonpayable",
1655
- type: "function"
1656
- },
1657
- {
1658
- inputs: [],
1659
- name: "paused",
1660
- outputs: [
1661
- {
1662
- internalType: "bool",
1663
- name: "",
1664
- type: "bool"
1665
- }
1666
- ],
1667
- stateMutability: "view",
1668
- type: "function"
1669
- },
1670
- {
1671
- inputs: [],
1672
- name: "renounceOwnership",
1673
- outputs: [],
1674
- stateMutability: "nonpayable",
1675
- type: "function"
1676
- },
1677
- {
1678
- inputs: [
1679
- {
1680
- internalType: "address",
1681
- name: "addr",
1682
- type: "address"
1683
- }
1684
- ],
1685
- name: "setAuthorizedArbitration",
1686
- outputs: [],
1687
- stateMutability: "nonpayable",
1688
- type: "function"
1689
- },
1690
- {
1691
- inputs: [
1692
- {
1693
- internalType: "address",
1694
- name: "addr",
1695
- type: "address"
1696
- }
1697
- ],
1698
- name: "setAuthorizedSettlement",
1699
- outputs: [],
1700
- stateMutability: "nonpayable",
1701
- type: "function"
1702
- },
1703
- {
1704
- inputs: [
1705
- {
1706
- internalType: "uint256",
1707
- name: "taskId",
1708
- type: "uint256"
1709
- },
1710
- {
1711
- internalType: "bytes32",
1712
- name: "deliverableHash",
1713
- type: "bytes32"
1714
- }
1715
- ],
1716
- name: "submitWork",
1717
- outputs: [],
1718
- stateMutability: "nonpayable",
1719
- type: "function"
1720
- },
1721
- {
1722
- inputs: [],
1723
- name: "taskCount",
1724
- outputs: [
1725
- {
1726
- internalType: "uint256",
1727
- name: "",
1728
- type: "uint256"
1729
- }
1730
- ],
1731
- stateMutability: "view",
1732
- type: "function"
1733
- },
1734
- {
1735
- inputs: [
1736
- {
1737
- internalType: "address",
1738
- name: "newOwner",
1739
- type: "address"
1740
- }
1741
- ],
1742
- name: "transferOwnership",
1743
- outputs: [],
1744
- stateMutability: "nonpayable",
1745
- type: "function"
1746
- },
1747
- {
1748
- inputs: [],
1749
- name: "unpause",
1750
- outputs: [],
1751
- stateMutability: "nonpayable",
1752
- type: "function"
1753
- },
1754
- {
1755
- stateMutability: "payable",
1756
- type: "receive"
1757
- }
1758
- ],
1759
- bytecode: "0x6080806040523461001657611bac908161001c8239f35b600080fdfe60406080815260049081361015610020575b5050361561001e57600080fd5b005b600090813560e01c80630569862f146113d55780630a9eeded146112e45780631d65e77e146111c05780632c159a1a146111985780633f4ba83a146111025780634759b80514610fda5780635c975abb14610fb75780636f0e530f14610f99578063715018a614610f4e5780637a2ccd3514610dbb5780637eec20a814610c7f5780638456cb5914610c2557806385ae341d14610c095780638c1e7a6414610be15780638da5cb5b14610bb957806395ccea6714610af057806397d9c23e14610ac3578063aacc277014610a9b578063b6cb58a514610a7d578063bd9b72a11461078b578063c4d66de8146105fe578063cfdbf254146105e3578063d1ff21c2146104bb578063ee89db4c14610473578063f2fde38b146103e15763f8adad211461014b5750610011565b60803660031901126103dd5761015f61141a565b916024356001600160801b038116908190036103dd5760443563ffffffff81168091036103d95761018e611829565b610196611916565b610e1042018042116103965781106103c9576301e1338042018042116103965781116103b9578134106103a95760ca5460001981146103965760010160ca819055946001600160a01b03918282161561038f5760025b8651916101f88361147b565b3383526020830191858516835288840191878352606085019081526102216080860192836114ea565b60a0850189815260643560c087019081528c8b5260c96020528b8b20965187546001600160a01b0319908116918b169190911788559551600188018054909716908a161790955592516002860180549251935190949360801b63ffffffff60801b16916001600160801b031690600881101561037c576001600160a81b0319909316171760a09190911b60ff60a01b161782555160209a50600392916102ca9160ff169061162d565b5191015584516064358152867fe04e65a2f2de9844f70a34d2eba1e53ddadaad516fa4d8f5e02ee00df908ebef893393a316610360575b803411610316575b5050600160655551908152f35b61033b8280806103419561032a86346117c4565b335af1610335611527565b50611557565b346117c4565b8151908152600080516020611b37833981519152843392a23880610309565b83600080516020611b17833981519152868551848152a2610301565b634e487b7160e01b8c5260218f5260248cfd5b60016101ec565b634e487b7160e01b845260118752602484fd5b835163044044a560e21b81528690fd5b83516324787d7360e11b81528690fd5b83516325a8637d60e21b81528690fd5b8280fd5b5080fd5b5082346103d95760203660031901126103d9576103fc61141a565b916104056117d1565b6001600160a01b03831615610421578361041e8461187f565b80f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b82346104b85760203660031901126104b85761048d61141a565b6104956117d1565b60cd80546001600160a01b0319166001600160a01b039290921691909117905580f35b80fd5b5060203660031901126103dd5782356104d2611829565b80835260c9602052818320600281019081549060ff8260a01c1660088110156105d0576001036105c057546001600160a01b031633036105b0576001600160801b0392818416913483116105a05760ff60a01b1916600160a11b17835584518281529596509394869490600080516020611b1783398151915290602090a2803411610561575b83600160655580f35b83808061057d9661032a61057595346117c4565b5416346117c4565b9051908152600080516020611b3783398151915260203392a23881818080610558565b855163044044a560e21b81528890fd5b8351630836f21d60e21b81528690fd5b84516396a50dcf60e01b81528790fd5b634e487b7160e01b875260218852602487fd5b50346103dd57816003193601126103dd576020905160148152f35b5082346103d95760203660031901126103d95761061961141a565b9083549160ff8360081c16159182809361077e575b8015610767575b1561070d575060ff19838116600117865592826106fc575b5061066760ff865460081c16610662816118b6565b6118b6565b6106703361187f565b84549261069d60ff8560081c16610686816118b6565b61068f816118b6565b6001606555610662816118b6565b6097541660975560018060a01b031660018060a01b031960cb54161760cb556106c4578280f35b61ff001916825551600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a181808280f35b61ffff19166101011785558561064d565b608490602086519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156106355750600160ff851614610635565b50600160ff85161061062e565b50346103dd5760603660031901126103dd576001600160401b038335818111610a79576107bb903690860161144b565b90602495602435848111610a75576107d6903690830161144b565b604435868111610a71576107ed903690850161144b565b90946107f76117d1565b6107ff611829565b828714801590610a67575b610a575760148711610a475796949392919089978a965b888810610860578b7f0a0af9013a8d9968e4532086fbc7137cf11ee8b8f9d57c8e5e89589b416739088c8c8c82519182526020820152a1600160655580f35b90919293949596986108738a8a8561178a565b358c52602060c981528b8d2090600282019081549060ff8260a01c166008811015610a3357600303610a23578f908f8f928f908b926108b586603c948e61178a565b3590805190868201928352468183015281526108d0816114ac565b5190207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b8252601c5220921015610a0f578e60051b8d01358d601e1990360301811215610a02578d0190813591888311610a085701908036038213610a02579161094461094a92610952979695943691611593565b9061195a565b949094611992565b82546001600160a01b0394908516908516036109f2578f808f8c6109a66109a18e9960016109b89a879a889a600560a01b9060ff60a01b19161790550154169360018060801b039a8b9461178a565b6117b0565b16905af16109b2611527565b506115ca565b6109c66109a18c888a61178a565b1681018091116109e0579860010196959493929190610821565b634e487b7160e01b8c52601187528c8cfd5b8e5163dfd8f8f160e01b81528b90fd5b50508f80fd5b5050508f80fd5b5050634e487b7160e01b8f5260328a528f8ffd5b8e5163448ad72360e01b81528b90fd5b5050634e487b7160e01b8f5260218a528f8ffd5b88516305beb17160e11b81528590fd5b88516305f8ded760e21b81528590fd5b508187141561080a565b8880fd5b8680fd5b8380fd5b50346103dd57816003193601126103dd5760209060ca549051908152f35b50346103dd57816003193601126103dd5760cd5490516001600160a01b039091168152602090f35b8284346103dd5760203660031901126103dd57610ae890610ae2611829565b3561164a565b600160655580f35b5082346103d957816003193601126103d957610b0a61141a565b9160243591610b176117d1565b6001600160a01b038416938415610baa578580808681945af1610b38611527565b5015610b6c57507f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd96959160209151908152a280f35b6020606492519162461bcd60e51b83528201526019602482015278195b595c99d95b98de481dda5d1a191c985dc819985a5b1959603a1b6044820152fd5b50905163e6c4247b60e01b8152fd5b50346103dd57816003193601126103dd5760335490516001600160a01b039091168152602090f35b50346103dd57816003193601126103dd5760cc5490516001600160a01b039091168152602090f35b50346103dd57816003193601126103dd5760209051610e108152f35b50346103dd57816003193601126103dd5760207f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25891610c626117d1565b610c6a611916565b600160ff19609754161760975551338152a180f35b5082346103d95760203660031901126103d9578035610c9c611829565b80845260c960205282842080546001600160a01b0390811694909390338603610dae57600283019283549560ff8760a01c16600881101580610d9b57600182141580610d8e575b610d7e57610d6b576002149182610d5b575b5050610d4e5760ff60a01b198516600760a01b17835586610ae8818080808b8b8b7fc6eacc3aa5b2aa77b5a826b832a804ca0b71830ec74f9aa57a15edd978c31ed68480a26001600160801b0316905af1610335611527565b51636225170560e11b8152fd5b6001015416151590508880610cf5565b634e487b7160e01b8a526021855260248afd5b84516367909b1560e01b81528690fd5b5050896002821415610ce3565b634e487b7160e01b8b526021865260248bfd5b51630836f21d60e21b8152fd5b50346103dd57806003193601126103dd576001600160401b038335602435828111610f4a5736602382011215610f4a5780860135928311610f4a573660248483010111610f4a57610e0a611829565b81855260c960205283852092600284019081549260ff8460a01c166008811015610f3757600303610f275786979891610944610e9592610e9d99516020810190898252468d8201528c8152610e5e816114ac565b5190207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b8d52601c52603c8c20926024369201611593565b969096611992565b84546001600160a01b039690871690871603610f19575060ff60a01b198216600560a01b17905593516001600160801b03909416808552610ae89486948594859485949360019291907f688422e17a93717770f92bce26ccf0cd9ef5fbc6326ecbc45207093882dfed5790602090a20154165af16109b2611527565b865163dfd8f8f160e01b8152fd5b865163448ad72360e01b81528990fd5b634e487b7160e01b895260218a52602489fd5b8480fd5b82346104b857806003193601126104b857610f676117d1565b603380546001600160a01b0319811690915581906001600160a01b0316600080516020611b578339815191528280a380f35b50346103dd57816003193601126103dd57602090516301e133808152f35b50346103dd57816003193601126103dd5760209060ff6097541690519015158152f35b508290346103d957610feb36611435565b9190610ff5611829565b60cd546001600160a01b0393908416331415806110f4575b806110e6575b6110d75781865260c9602052828620926002840180549660ff8860a01c1660088110156110c457600381141590816110b8575b506110aa5788610ae8818080808d8d8d8d7f7a145a42f1a9a0e0893966fdde6a174bcd157b3f935fad1f203303ab638bbf2d60208f8f8f600360a11b60ff60a01b198a1617905551908152a2546001600160801b0390921691165af1610335611527565b8251630889f08360e11b8152fd5b6002915014158a611046565b634e487b7160e01b8a526021825260248afd5b82516282b42960e81b81528590fd5b508360335416331415611013565b508360cc541633141561100d565b5082346103d957826003193601126103d95761111c6117d1565b6097549060ff82161561115e575060ff1916609755513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a180f35b606490602084519162461bcd60e51b8352820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152fd5b50346103dd57816003193601126103dd5760cb5490516001600160a01b039091168152602090f35b50346103dd5760203660031901126103dd578160c082516111e08161147b565b82815282602082015282848201528260608201528260808201528260a082015201528235825260c96020528082209080519261121b8461147b565b60018060a01b0380845416855280600185015416936020860194855285600282015494859360018060801b0390828401908287168252600363ffffffff9660ff60a060608901988a8c60801c168a5261127c83608083019d841c168d6114ea565b019b60a81c168b5201549960c08c019a8b528185519c51168c52511660208b015251169088015251166060860152519060088210156112d15760e0858560ff86866080850152511660a08301525160c0820152f35b634e487b7160e01b815260218652602490fd5b5082346103d9576112f436611435565b9290916112ff611829565b82855260c960205281852090600282019081549060ff8260a01c1660088110156113c2576002036113b45760018401546001600160a01b031633036113a65763ffffffff8260801c164211611398575060ff60a01b1916600360a01b1790556003018390555191825233917f426c8a62b17e201c4e6c6b4364193ae08f72edc8f5e2aa0b9aa3848f5bb5d95490602090a3600160655580f35b845163559895a360e01b8152fd5b845163fb55adaf60e01b8152fd5b8451636af784dd60e11b8152fd5b634e487b7160e01b895260218252602489fd5b82346104b85760203660031901126104b8576113ef61141a565b6113f76117d1565b60cc80546001600160a01b0319166001600160a01b039290921691909117905580f35b600435906001600160a01b038216820361143057565b600080fd5b6040906003190112611430576004359060243590565b9181601f84011215611430578235916001600160401b038311611430576020808501948460051b01011161143057565b60e081019081106001600160401b0382111761149657604052565b634e487b7160e01b600052604160045260246000fd5b606081019081106001600160401b0382111761149657604052565b601f909101601f19168101906001600160401b0382119082101761149657604052565b60088210156114f65752565b634e487b7160e01b600052602160045260246000fd5b6001600160401b03811161149657601f01601f191660200190565b3d15611552573d906115388261150c565b9161154660405193846114c7565b82523d6000602084013e565b606090565b1561155e57565b60405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b6044820152606490fd5b92919261159f8261150c565b916115ad60405193846114c7565b829481845281830111611430578281602093846000960137010152565b156115d157565b60405162461bcd60e51b815260206004820152600d60248201526c1c185e5bdd5d0819985a5b1959609a1b6044820152606490fd5b60ff1660ff81146116175760010190565b634e487b7160e01b600052601160045260246000fd5b805460ff60a81b191660a89290921b60ff60a81b16919091179055565b60009080825260c96020526040822060028101805460ff8160a01c16600881101561176257600414611776575080549160ff8360a01c1660088110156117625760038114159081611756575b50611744578054336001600160a01b0391821614159182611732575b5081611723575b506117115760ff60a01b19909116600160a21b178082556116ea91906116e49060a81c60ff16611606565b9061162d565b7f4c876e9aba8144edd2840298ef3fd0d8735009124d7a0185a41b12680c093782339280a3565b60405163c8ee2d1d60e01b8152600490fd5b905060cd5416331415386116b9565b819250600101541633141590386116b2565b60405163fd57cf8f60e01b8152600490fd5b60029150141538611696565b634e487b7160e01b86526021600452602486fd5b6116ea925060ff6116e49160a81c16611606565b919081101561179a5760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160801b03811681036114305790565b9190820391821161161757565b6033546001600160a01b031633036117e557565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60026065541461183a576002606555565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b603380546001600160a01b039283166001600160a01b031982168117909255909116600080516020611b57833981519152600080a3565b156118bd57565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b60ff6097541661192257565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b90604181511460001461198857611984916020820151906060604084015193015160001a90611a91565b9091565b5050600090600290565b60058110156114f657806119a35750565b600181036119eb5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606490fd5b60028103611a385760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600314611a4157565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b9291906fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311611b0a5791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15611afd5781516001600160a01b03811615611af7579190565b50600190565b50604051903d90823e3d90fd5b5050505060009060039056fed2a92c8db52ba066576be7c690a9eafdfdde21a6d2a215012e1aa9e45547baeca171b6942063c6f2800ce40a780edce37baa2b618571b11eedd1e69e626e7d768be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220233a642c0fdf156d5fb03b434ef6aaa21a072f458208647560bc6c3a9ff6853464736f6c63430008180033",
1760
- deployedBytecode: "0x60406080815260049081361015610020575b5050361561001e57600080fd5b005b600090813560e01c80630569862f146113d55780630a9eeded146112e45780631d65e77e146111c05780632c159a1a146111985780633f4ba83a146111025780634759b80514610fda5780635c975abb14610fb75780636f0e530f14610f99578063715018a614610f4e5780637a2ccd3514610dbb5780637eec20a814610c7f5780638456cb5914610c2557806385ae341d14610c095780638c1e7a6414610be15780638da5cb5b14610bb957806395ccea6714610af057806397d9c23e14610ac3578063aacc277014610a9b578063b6cb58a514610a7d578063bd9b72a11461078b578063c4d66de8146105fe578063cfdbf254146105e3578063d1ff21c2146104bb578063ee89db4c14610473578063f2fde38b146103e15763f8adad211461014b5750610011565b60803660031901126103dd5761015f61141a565b916024356001600160801b038116908190036103dd5760443563ffffffff81168091036103d95761018e611829565b610196611916565b610e1042018042116103965781106103c9576301e1338042018042116103965781116103b9578134106103a95760ca5460001981146103965760010160ca819055946001600160a01b03918282161561038f5760025b8651916101f88361147b565b3383526020830191858516835288840191878352606085019081526102216080860192836114ea565b60a0850189815260643560c087019081528c8b5260c96020528b8b20965187546001600160a01b0319908116918b169190911788559551600188018054909716908a161790955592516002860180549251935190949360801b63ffffffff60801b16916001600160801b031690600881101561037c576001600160a81b0319909316171760a09190911b60ff60a01b161782555160209a50600392916102ca9160ff169061162d565b5191015584516064358152867fe04e65a2f2de9844f70a34d2eba1e53ddadaad516fa4d8f5e02ee00df908ebef893393a316610360575b803411610316575b5050600160655551908152f35b61033b8280806103419561032a86346117c4565b335af1610335611527565b50611557565b346117c4565b8151908152600080516020611b37833981519152843392a23880610309565b83600080516020611b17833981519152868551848152a2610301565b634e487b7160e01b8c5260218f5260248cfd5b60016101ec565b634e487b7160e01b845260118752602484fd5b835163044044a560e21b81528690fd5b83516324787d7360e11b81528690fd5b83516325a8637d60e21b81528690fd5b8280fd5b5080fd5b5082346103d95760203660031901126103d9576103fc61141a565b916104056117d1565b6001600160a01b03831615610421578361041e8461187f565b80f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b82346104b85760203660031901126104b85761048d61141a565b6104956117d1565b60cd80546001600160a01b0319166001600160a01b039290921691909117905580f35b80fd5b5060203660031901126103dd5782356104d2611829565b80835260c9602052818320600281019081549060ff8260a01c1660088110156105d0576001036105c057546001600160a01b031633036105b0576001600160801b0392818416913483116105a05760ff60a01b1916600160a11b17835584518281529596509394869490600080516020611b1783398151915290602090a2803411610561575b83600160655580f35b83808061057d9661032a61057595346117c4565b5416346117c4565b9051908152600080516020611b3783398151915260203392a23881818080610558565b855163044044a560e21b81528890fd5b8351630836f21d60e21b81528690fd5b84516396a50dcf60e01b81528790fd5b634e487b7160e01b875260218852602487fd5b50346103dd57816003193601126103dd576020905160148152f35b5082346103d95760203660031901126103d95761061961141a565b9083549160ff8360081c16159182809361077e575b8015610767575b1561070d575060ff19838116600117865592826106fc575b5061066760ff865460081c16610662816118b6565b6118b6565b6106703361187f565b84549261069d60ff8560081c16610686816118b6565b61068f816118b6565b6001606555610662816118b6565b6097541660975560018060a01b031660018060a01b031960cb54161760cb556106c4578280f35b61ff001916825551600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a181808280f35b61ffff19166101011785558561064d565b608490602086519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156106355750600160ff851614610635565b50600160ff85161061062e565b50346103dd5760603660031901126103dd576001600160401b038335818111610a79576107bb903690860161144b565b90602495602435848111610a75576107d6903690830161144b565b604435868111610a71576107ed903690850161144b565b90946107f76117d1565b6107ff611829565b828714801590610a67575b610a575760148711610a475796949392919089978a965b888810610860578b7f0a0af9013a8d9968e4532086fbc7137cf11ee8b8f9d57c8e5e89589b416739088c8c8c82519182526020820152a1600160655580f35b90919293949596986108738a8a8561178a565b358c52602060c981528b8d2090600282019081549060ff8260a01c166008811015610a3357600303610a23578f908f8f928f908b926108b586603c948e61178a565b3590805190868201928352468183015281526108d0816114ac565b5190207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b8252601c5220921015610a0f578e60051b8d01358d601e1990360301811215610a02578d0190813591888311610a085701908036038213610a02579161094461094a92610952979695943691611593565b9061195a565b949094611992565b82546001600160a01b0394908516908516036109f2578f808f8c6109a66109a18e9960016109b89a879a889a600560a01b9060ff60a01b19161790550154169360018060801b039a8b9461178a565b6117b0565b16905af16109b2611527565b506115ca565b6109c66109a18c888a61178a565b1681018091116109e0579860010196959493929190610821565b634e487b7160e01b8c52601187528c8cfd5b8e5163dfd8f8f160e01b81528b90fd5b50508f80fd5b5050508f80fd5b5050634e487b7160e01b8f5260328a528f8ffd5b8e5163448ad72360e01b81528b90fd5b5050634e487b7160e01b8f5260218a528f8ffd5b88516305beb17160e11b81528590fd5b88516305f8ded760e21b81528590fd5b508187141561080a565b8880fd5b8680fd5b8380fd5b50346103dd57816003193601126103dd5760209060ca549051908152f35b50346103dd57816003193601126103dd5760cd5490516001600160a01b039091168152602090f35b8284346103dd5760203660031901126103dd57610ae890610ae2611829565b3561164a565b600160655580f35b5082346103d957816003193601126103d957610b0a61141a565b9160243591610b176117d1565b6001600160a01b038416938415610baa578580808681945af1610b38611527565b5015610b6c57507f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd96959160209151908152a280f35b6020606492519162461bcd60e51b83528201526019602482015278195b595c99d95b98de481dda5d1a191c985dc819985a5b1959603a1b6044820152fd5b50905163e6c4247b60e01b8152fd5b50346103dd57816003193601126103dd5760335490516001600160a01b039091168152602090f35b50346103dd57816003193601126103dd5760cc5490516001600160a01b039091168152602090f35b50346103dd57816003193601126103dd5760209051610e108152f35b50346103dd57816003193601126103dd5760207f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25891610c626117d1565b610c6a611916565b600160ff19609754161760975551338152a180f35b5082346103d95760203660031901126103d9578035610c9c611829565b80845260c960205282842080546001600160a01b0390811694909390338603610dae57600283019283549560ff8760a01c16600881101580610d9b57600182141580610d8e575b610d7e57610d6b576002149182610d5b575b5050610d4e5760ff60a01b198516600760a01b17835586610ae8818080808b8b8b7fc6eacc3aa5b2aa77b5a826b832a804ca0b71830ec74f9aa57a15edd978c31ed68480a26001600160801b0316905af1610335611527565b51636225170560e11b8152fd5b6001015416151590508880610cf5565b634e487b7160e01b8a526021855260248afd5b84516367909b1560e01b81528690fd5b5050896002821415610ce3565b634e487b7160e01b8b526021865260248bfd5b51630836f21d60e21b8152fd5b50346103dd57806003193601126103dd576001600160401b038335602435828111610f4a5736602382011215610f4a5780860135928311610f4a573660248483010111610f4a57610e0a611829565b81855260c960205283852092600284019081549260ff8460a01c166008811015610f3757600303610f275786979891610944610e9592610e9d99516020810190898252468d8201528c8152610e5e816114ac565b5190207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b8d52601c52603c8c20926024369201611593565b969096611992565b84546001600160a01b039690871690871603610f19575060ff60a01b198216600560a01b17905593516001600160801b03909416808552610ae89486948594859485949360019291907f688422e17a93717770f92bce26ccf0cd9ef5fbc6326ecbc45207093882dfed5790602090a20154165af16109b2611527565b865163dfd8f8f160e01b8152fd5b865163448ad72360e01b81528990fd5b634e487b7160e01b895260218a52602489fd5b8480fd5b82346104b857806003193601126104b857610f676117d1565b603380546001600160a01b0319811690915581906001600160a01b0316600080516020611b578339815191528280a380f35b50346103dd57816003193601126103dd57602090516301e133808152f35b50346103dd57816003193601126103dd5760209060ff6097541690519015158152f35b508290346103d957610feb36611435565b9190610ff5611829565b60cd546001600160a01b0393908416331415806110f4575b806110e6575b6110d75781865260c9602052828620926002840180549660ff8860a01c1660088110156110c457600381141590816110b8575b506110aa5788610ae8818080808d8d8d8d7f7a145a42f1a9a0e0893966fdde6a174bcd157b3f935fad1f203303ab638bbf2d60208f8f8f600360a11b60ff60a01b198a1617905551908152a2546001600160801b0390921691165af1610335611527565b8251630889f08360e11b8152fd5b6002915014158a611046565b634e487b7160e01b8a526021825260248afd5b82516282b42960e81b81528590fd5b508360335416331415611013565b508360cc541633141561100d565b5082346103d957826003193601126103d95761111c6117d1565b6097549060ff82161561115e575060ff1916609755513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a180f35b606490602084519162461bcd60e51b8352820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152fd5b50346103dd57816003193601126103dd5760cb5490516001600160a01b039091168152602090f35b50346103dd5760203660031901126103dd578160c082516111e08161147b565b82815282602082015282848201528260608201528260808201528260a082015201528235825260c96020528082209080519261121b8461147b565b60018060a01b0380845416855280600185015416936020860194855285600282015494859360018060801b0390828401908287168252600363ffffffff9660ff60a060608901988a8c60801c168a5261127c83608083019d841c168d6114ea565b019b60a81c168b5201549960c08c019a8b528185519c51168c52511660208b015251169088015251166060860152519060088210156112d15760e0858560ff86866080850152511660a08301525160c0820152f35b634e487b7160e01b815260218652602490fd5b5082346103d9576112f436611435565b9290916112ff611829565b82855260c960205281852090600282019081549060ff8260a01c1660088110156113c2576002036113b45760018401546001600160a01b031633036113a65763ffffffff8260801c164211611398575060ff60a01b1916600360a01b1790556003018390555191825233917f426c8a62b17e201c4e6c6b4364193ae08f72edc8f5e2aa0b9aa3848f5bb5d95490602090a3600160655580f35b845163559895a360e01b8152fd5b845163fb55adaf60e01b8152fd5b8451636af784dd60e11b8152fd5b634e487b7160e01b895260218252602489fd5b82346104b85760203660031901126104b8576113ef61141a565b6113f76117d1565b60cc80546001600160a01b0319166001600160a01b039290921691909117905580f35b600435906001600160a01b038216820361143057565b600080fd5b6040906003190112611430576004359060243590565b9181601f84011215611430578235916001600160401b038311611430576020808501948460051b01011161143057565b60e081019081106001600160401b0382111761149657604052565b634e487b7160e01b600052604160045260246000fd5b606081019081106001600160401b0382111761149657604052565b601f909101601f19168101906001600160401b0382119082101761149657604052565b60088210156114f65752565b634e487b7160e01b600052602160045260246000fd5b6001600160401b03811161149657601f01601f191660200190565b3d15611552573d906115388261150c565b9161154660405193846114c7565b82523d6000602084013e565b606090565b1561155e57565b60405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b6044820152606490fd5b92919261159f8261150c565b916115ad60405193846114c7565b829481845281830111611430578281602093846000960137010152565b156115d157565b60405162461bcd60e51b815260206004820152600d60248201526c1c185e5bdd5d0819985a5b1959609a1b6044820152606490fd5b60ff1660ff81146116175760010190565b634e487b7160e01b600052601160045260246000fd5b805460ff60a81b191660a89290921b60ff60a81b16919091179055565b60009080825260c96020526040822060028101805460ff8160a01c16600881101561176257600414611776575080549160ff8360a01c1660088110156117625760038114159081611756575b50611744578054336001600160a01b0391821614159182611732575b5081611723575b506117115760ff60a01b19909116600160a21b178082556116ea91906116e49060a81c60ff16611606565b9061162d565b7f4c876e9aba8144edd2840298ef3fd0d8735009124d7a0185a41b12680c093782339280a3565b60405163c8ee2d1d60e01b8152600490fd5b905060cd5416331415386116b9565b819250600101541633141590386116b2565b60405163fd57cf8f60e01b8152600490fd5b60029150141538611696565b634e487b7160e01b86526021600452602486fd5b6116ea925060ff6116e49160a81c16611606565b919081101561179a5760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160801b03811681036114305790565b9190820391821161161757565b6033546001600160a01b031633036117e557565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60026065541461183a576002606555565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b603380546001600160a01b039283166001600160a01b031982168117909255909116600080516020611b57833981519152600080a3565b156118bd57565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b60ff6097541661192257565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b90604181511460001461198857611984916020820151906060604084015193015160001a90611a91565b9091565b5050600090600290565b60058110156114f657806119a35750565b600181036119eb5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606490fd5b60028103611a385760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600314611a4157565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b9291906fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311611b0a5791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15611afd5781516001600160a01b03811615611af7579190565b50600190565b50604051903d90823e3d90fd5b5050505060009060039056fed2a92c8db52ba066576be7c690a9eafdfdde21a6d2a215012e1aa9e45547baeca171b6942063c6f2800ce40a780edce37baa2b618571b11eedd1e69e626e7d768be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220233a642c0fdf156d5fb03b434ef6aaa21a072f458208647560bc6c3a9ff6853464736f6c63430008180033",
1761
- linkReferences: {},
1762
- deployedLinkReferences: {}
1763
- };
1764
-
1765
- // src/contracts/CovenantEscrow.ts
1766
- var CovenantEscrowABI = CovenantEscrow_default.abi;
1767
-
1768
- // src/types.ts
1769
- var import_shared_types2 = require("@covenant/shared-types");
1770
- var ReceiptType = /* @__PURE__ */ ((ReceiptType2) => {
1771
- ReceiptType2[ReceiptType2["TaskCompleted"] = 0] = "TaskCompleted";
1772
- ReceiptType2[ReceiptType2["AgentVerified"] = 1] = "AgentVerified";
1773
- ReceiptType2[ReceiptType2["DisputeResolved"] = 2] = "DisputeResolved";
1774
- ReceiptType2[ReceiptType2["InsuranceClaimed"] = 3] = "InsuranceClaimed";
1775
- ReceiptType2[ReceiptType2["MilestoneReached"] = 4] = "MilestoneReached";
1776
- ReceiptType2[ReceiptType2["ReputationUpdated"] = 5] = "ReputationUpdated";
1777
- return ReceiptType2;
1778
- })(ReceiptType || {});
1779
-
1780
- // src/index.ts
1781
- var ZERO_ADDR = "0x0000000000000000000000000000000000000000";
1782
- var CovenantSDK = class {
1783
- publicClient;
1784
- walletClient;
1785
- addresses;
1786
- chain;
1787
- account;
1788
- constructor(config) {
1789
- this.publicClient = config.publicClient;
1790
- this.walletClient = config.walletClient;
1791
- this.account = config.walletClient?.account;
1792
- this.addresses = getContractAddresses(config.chainId, config.contractAddresses);
1793
- this.chain = CHAIN_CONFIGS[config.chainId]?.chain ?? {
1794
- id: config.chainId,
1795
- name: `Chain ${config.chainId}`,
1796
- nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
1797
- rpcUrls: { default: { http: [] } }
1798
- };
1799
- }
1800
- // =========================================================================
1801
- // Agent Methods (V5 — CovenantIdentity)
1802
- // =========================================================================
1803
- async getAgent(address) {
1804
- const result = await this.publicClient.readContract({
1805
- address: this.addresses.CovenantIdentity,
1806
- abi: CovenantIdentityABI,
1807
- functionName: "getAgent",
1808
- args: [address]
1809
- });
1810
- return this.parseAgentData(address, result);
1811
- }
1812
- async getAgentCount() {
1813
- return await this.publicClient.readContract({
1814
- address: this.addresses.CovenantIdentity,
1815
- abi: CovenantIdentityABI,
1816
- functionName: "totalAgents",
1817
- args: []
1818
- });
1819
- }
1820
- async isRegistered(address) {
1821
- return await this.publicClient.readContract({
1822
- address: this.addresses.CovenantIdentity,
1823
- abi: CovenantIdentityABI,
1824
- functionName: "isRegistered",
1825
- args: [address]
1826
- });
1827
- }
1828
- async findAgents(capability, minReputation, limit = 20) {
1829
- const count = await this.getAgentCount();
1830
- const results = [];
1831
- const capHash = BigInt(
1832
- "0x" + Array.from(new TextEncoder().encode(capability)).map((b) => b.toString(16).padStart(2, "0")).join("")
1833
- ).toString();
1834
- for (let i = 0n; i < count && results.length < limit; i++) {
1835
- try {
1836
- const agentAddr = await this.publicClient.readContract({
1837
- address: this.addresses.CovenantIdentity,
1838
- abi: CovenantIdentityABI,
1839
- functionName: "getAllAgents",
1840
- args: [i, 1n]
1841
- });
1842
- if (agentAddr === ZERO_ADDR) continue;
1843
- const hasCap = await this.publicClient.readContract({
1844
- address: this.addresses.CovenantIdentity,
1845
- abi: CovenantIdentityABI,
1846
- functionName: "hasCapability",
1847
- args: [agentAddr, `0x${capHash.padStart(64, "0")}`]
1848
- });
1849
- if (!hasCap) continue;
1850
- if (minReputation !== void 0) {
1851
- const agent = await this.getAgent(agentAddr);
1852
- if (agent.reputation < BigInt(minReputation)) continue;
1853
- }
1854
- results.push(agentAddr);
1855
- } catch {
1856
- continue;
1857
- }
1858
- }
1859
- return results;
1860
- }
1861
- async getAllAgents(offset = 0, limit = 50) {
1862
- const count = await this.getAgentCount();
1863
- const results = [];
1864
- for (let i = BigInt(offset); i < count && results.length < limit; i++) {
1865
- try {
1866
- const addr = await this.publicClient.readContract({
1867
- address: this.addresses.CovenantIdentity,
1868
- abi: CovenantIdentityABI,
1869
- functionName: "getAllAgents",
1870
- args: [i, 1n]
1871
- });
1872
- if (addr !== ZERO_ADDR) results.push(addr);
1873
- } catch {
1874
- continue;
1875
- }
1876
- }
1877
- return results;
1878
- }
1879
- async registerAgent(stake, metadataRoot) {
1880
- this.requireWallet();
1881
- return await this.walletClient.writeContract({
1882
- address: this.addresses.CovenantIdentity,
1883
- abi: CovenantIdentityABI,
1884
- functionName: "register",
1885
- args: [stake, metadataRoot],
1886
- value: stake,
1887
- chain: this.chain,
1888
- account: this.account
1889
- });
1890
- }
1891
- // =========================================================================
1892
- // Task Methods (V5 — CovenantEscrow)
1893
- // =========================================================================
1894
- async getTask(taskId) {
1895
- const result = await this.publicClient.readContract({
1896
- address: this.addresses.CovenantEscrow,
1897
- abi: CovenantEscrowABI,
1898
- functionName: "getTask",
1899
- args: [taskId]
1900
- });
1901
- return this.parseTaskData(taskId, result);
1902
- }
1903
- async getTaskCount() {
1904
- return await this.publicClient.readContract({
1905
- address: this.addresses.CovenantEscrow,
1906
- abi: CovenantEscrowABI,
1907
- functionName: "taskCount",
1908
- args: []
1909
- });
1910
- }
1911
- async createTask(worker, amount, deadline, metaHash) {
1912
- this.requireWallet();
1913
- return await this.walletClient.writeContract({
1914
- address: this.addresses.CovenantEscrow,
1915
- abi: CovenantEscrowABI,
1916
- functionName: "createTask",
1917
- args: [worker, amount, deadline, metaHash],
1918
- value: amount,
1919
- chain: this.chain,
1920
- account: this.account
1921
- });
1922
- }
1923
- async submitWork(taskId, deliverableHash) {
1924
- this.requireWallet();
1925
- return await this.walletClient.writeContract({
1926
- address: this.addresses.CovenantEscrow,
1927
- abi: CovenantEscrowABI,
1928
- functionName: "submitWork",
1929
- args: [taskId, deliverableHash],
1930
- chain: this.chain,
1931
- account: this.account
1932
- });
1933
- }
1934
- async completeTask(taskId, clientSignature) {
1935
- this.requireWallet();
1936
- return await this.walletClient.writeContract({
1937
- address: this.addresses.CovenantEscrow,
1938
- abi: CovenantEscrowABI,
1939
- functionName: "completeTask",
1940
- args: [taskId, clientSignature],
1941
- chain: this.chain,
1942
- account: this.account
1943
- });
1944
- }
1945
- async disputeTask(taskId) {
1946
- this.requireWallet();
1947
- return await this.walletClient.writeContract({
1948
- address: this.addresses.CovenantEscrow,
1949
- abi: CovenantEscrowABI,
1950
- functionName: "disputeTask",
1951
- args: [taskId],
1952
- chain: this.chain,
1953
- account: this.account
1954
- });
1955
- }
1956
- async cancelTask(taskId) {
1957
- this.requireWallet();
1958
- return await this.walletClient.writeContract({
1959
- address: this.addresses.CovenantEscrow,
1960
- abi: CovenantEscrowABI,
1961
- functionName: "cancelTask",
1962
- args: [taskId],
1963
- chain: this.chain,
1964
- account: this.account
1965
- });
1966
- }
1967
- async fundTask(taskId, amount) {
1968
- this.requireWallet();
1969
- return await this.walletClient.writeContract({
1970
- address: this.addresses.CovenantEscrow,
1971
- abi: CovenantEscrowABI,
1972
- functionName: "fundTask",
1973
- args: [taskId],
1974
- value: amount,
1975
- chain: this.chain,
1976
- account: this.account
1977
- });
1978
- }
1979
- async failTask(taskId, reason) {
1980
- this.requireWallet();
1981
- return await this.walletClient.writeContract({
1982
- address: this.addresses.CovenantEscrow,
1983
- abi: CovenantEscrowABI,
1984
- functionName: "failTask",
1985
- args: [taskId, reason],
1986
- chain: this.chain,
1987
- account: this.account
1988
- });
1989
- }
1990
- // =========================================================================
1991
- // Utility Methods
1992
- // =========================================================================
1993
- async waitForTransaction(hash) {
1994
- return await this.publicClient.waitForTransactionReceipt({ hash });
1995
- }
1996
- getAddresses() {
1997
- return { ...this.addresses };
1998
- }
1999
- // =========================================================================
2000
- // Private Helpers
2001
- // =========================================================================
2002
- requireWallet() {
2003
- if (!this.walletClient) {
2004
- throw new Error("Wallet client required for write operations. Pass walletClient in config.");
2005
- }
2006
- }
2007
- parseAgentData(address, result) {
2008
- return {
2009
- did: address,
2010
- name: "",
2011
- capabilities: [],
2012
- reputation: BigInt(result[2]),
2013
- stakedAmount: result[1],
2014
- tasksCompleted: 0n,
2015
- tasksFailed: 0n,
2016
- totalValueTransferred: 0n,
2017
- isActive: result[5],
2018
- registeredAt: BigInt(result[3]),
2019
- walletAddress: result[0]
2020
- };
2021
- }
2022
- parseTaskData(taskId, result) {
2023
- return {
2024
- taskId,
2025
- client: result[0],
2026
- worker: result[1],
2027
- payment: result[2],
2028
- deadline: BigInt(result[3]),
2029
- descriptionHash: result[6],
2030
- deliverableHash: "",
2031
- status: this.mapV5Status(result[4]),
2032
- createdAt: 0n,
2033
- completedAt: 0n,
2034
- protocolFee: 0n,
2035
- totalValue: result[2]
2036
- };
2037
- }
2038
- mapV5Status(status) {
2039
- const map = {
2040
- 0: "Open",
2041
- 1: "Funded",
2042
- 2: "InProgress",
2043
- 3: "Submitted",
2044
- 4: "Completed",
2045
- 5: "Disputed",
2046
- 6: "Failed",
2047
- 7: "Cancelled"
2048
- };
2049
- return map[status] ?? "Open";
2050
- }
2051
- };
2052
-
2053
- // src/contracts/InsurancePool.ts
2054
- var InsurancePoolABI = [
2055
- // Read functions
2056
- {
2057
- name: "getPoolBalance",
2058
- type: "function",
2059
- stateMutability: "view",
2060
- inputs: [],
2061
- outputs: [{ name: "", type: "uint256" }]
2062
- },
2063
- {
2064
- name: "getMemberInfo",
2065
- type: "function",
2066
- stateMutability: "view",
2067
- inputs: [{ name: "member", type: "address" }],
2068
- outputs: [
2069
- { name: "active", type: "bool" },
2070
- { name: "contributed", type: "uint256" }
2071
- ]
2072
- },
2073
- {
2074
- name: "getClaim",
2075
- type: "function",
2076
- stateMutability: "view",
2077
- inputs: [{ name: "claimId", type: "uint256" }],
2078
- outputs: [
2079
- {
2080
- type: "tuple",
2081
- components: [
2082
- { name: "claimant", type: "address" },
2083
- { name: "taskId", type: "uint256" },
2084
- { name: "amount", type: "uint256" },
2085
- { name: "paid", type: "bool" },
2086
- { name: "timestamp", type: "uint256" }
2087
- ]
2088
- }
2089
- ]
2090
- },
2091
- {
2092
- name: "isMember",
2093
- type: "function",
2094
- stateMutability: "view",
2095
- inputs: [{ name: "", type: "address" }],
2096
- outputs: [{ name: "", type: "bool" }]
2097
- },
2098
- {
2099
- name: "claimCounter",
2100
- type: "function",
2101
- stateMutability: "view",
2102
- inputs: [],
2103
- outputs: [{ name: "", type: "uint256" }]
2104
- },
2105
- {
2106
- name: "memberCount",
2107
- type: "function",
2108
- stateMutability: "view",
2109
- inputs: [],
2110
- outputs: [{ name: "", type: "uint256" }]
2111
- },
2112
- {
2113
- name: "COVERAGE_PERCENT",
2114
- type: "function",
2115
- stateMutability: "view",
2116
- inputs: [],
2117
- outputs: [{ name: "", type: "uint256" }]
2118
- },
2119
- {
2120
- name: "CLAIM_COOLDOWN",
2121
- type: "function",
2122
- stateMutability: "view",
2123
- inputs: [],
2124
- outputs: [{ name: "", type: "uint256" }]
2125
- },
2126
- {
2127
- name: "contributions",
2128
- type: "function",
2129
- stateMutability: "view",
2130
- inputs: [{ name: "", type: "address" }],
2131
- outputs: [{ name: "", type: "uint256" }]
2132
- },
2133
- {
2134
- name: "lastClaimTime",
2135
- type: "function",
2136
- stateMutability: "view",
2137
- inputs: [{ name: "", type: "address" }],
2138
- outputs: [{ name: "", type: "uint256" }]
2139
- },
2140
- // Write functions
2141
- {
2142
- name: "joinPool",
2143
- type: "function",
2144
- stateMutability: "payable",
2145
- inputs: [],
2146
- outputs: []
2147
- },
2148
- {
2149
- name: "fileClaim",
2150
- type: "function",
2151
- stateMutability: "nonpayable",
2152
- inputs: [
2153
- { name: "taskId", type: "uint256" },
2154
- { name: "amount", type: "uint256" }
2155
- ],
2156
- outputs: []
2157
- },
2158
- {
2159
- name: "payClaim",
2160
- type: "function",
2161
- stateMutability: "nonpayable",
2162
- inputs: [
2163
- { name: "claimId", type: "uint256" },
2164
- { name: "", type: "bytes" }
2165
- ],
2166
- outputs: []
2167
- },
2168
- {
2169
- name: "deposit",
2170
- type: "function",
2171
- stateMutability: "payable",
2172
- inputs: [],
2173
- outputs: []
2174
- },
2175
- // Events
2176
- {
2177
- name: "MemberJoined",
2178
- type: "event",
2179
- inputs: [
2180
- { name: "member", type: "address", indexed: true },
2181
- { name: "contribution", type: "uint256", indexed: false }
2182
- ]
2183
- },
2184
- {
2185
- name: "ClaimFiled",
2186
- type: "event",
2187
- inputs: [
2188
- { name: "claimId", type: "uint256", indexed: true },
2189
- { name: "claimant", type: "address", indexed: true },
2190
- { name: "amount", type: "uint256", indexed: false }
2191
- ]
2192
- },
2193
- {
2194
- name: "ClaimPaid",
2195
- type: "event",
2196
- inputs: [
2197
- { name: "claimId", type: "uint256", indexed: true },
2198
- { name: "claimant", type: "address", indexed: true },
2199
- { name: "amount", type: "uint256", indexed: false }
2200
- ]
2201
- }
2202
- ];
2203
-
2204
- // src/contracts/DisputeResolution.ts
2205
- var DisputeResolutionABI = [
2206
- // Read functions
2207
- {
2208
- name: "getDispute",
2209
- type: "function",
2210
- stateMutability: "view",
2211
- inputs: [{ name: "disputeId", type: "uint256" }],
2212
- outputs: [
2213
- {
2214
- type: "tuple",
2215
- components: [
2216
- { name: "taskId", type: "uint256" },
2217
- { name: "filedBy", type: "address" },
2218
- { name: "bondAmount", type: "uint256" },
2219
- { name: "votingEndsAt", type: "uint256" },
2220
- { name: "resolved", type: "bool" },
2221
- { name: "workerWins", type: "bool" },
2222
- { name: "workerShare", type: "uint256" }
2223
- ]
2224
- }
2225
- ]
2226
- },
2227
- {
2228
- name: "disputeCounter",
2229
- type: "function",
2230
- stateMutability: "view",
2231
- inputs: [],
2232
- outputs: [{ name: "", type: "uint256" }]
2233
- },
2234
- {
2235
- name: "DISPUTE_BOND",
2236
- type: "function",
2237
- stateMutability: "view",
2238
- inputs: [],
2239
- outputs: [{ name: "", type: "uint256" }]
2240
- },
2241
- {
2242
- name: "VOTING_DURATION",
2243
- type: "function",
2244
- stateMutability: "view",
2245
- inputs: [],
2246
- outputs: [{ name: "", type: "uint256" }]
2247
- },
2248
- // Write functions
2249
- {
2250
- name: "fileDispute",
2251
- type: "function",
2252
- stateMutability: "payable",
2253
- inputs: [{ name: "taskId", type: "uint256" }],
2254
- outputs: []
2255
- },
2256
- {
2257
- name: "resolveDispute",
2258
- type: "function",
2259
- stateMutability: "nonpayable",
2260
- inputs: [
2261
- { name: "disputeId", type: "uint256" },
2262
- { name: "workerWins", type: "bool" },
2263
- { name: "workerShare", type: "uint256" }
2264
- ],
2265
- outputs: []
2266
- },
2267
- // Events
2268
- {
2269
- name: "DisputeFiled",
2270
- type: "event",
2271
- inputs: [
2272
- { name: "disputeId", type: "uint256", indexed: true },
2273
- { name: "taskId", type: "uint256", indexed: true },
2274
- { name: "filedBy", type: "address", indexed: true }
2275
- ]
2276
- },
2277
- {
2278
- name: "DisputeResolved",
2279
- type: "event",
2280
- inputs: [
2281
- { name: "disputeId", type: "uint256", indexed: true },
2282
- { name: "workerWins", type: "bool", indexed: false },
2283
- { name: "workerShare", type: "uint256", indexed: false }
2284
- ]
2285
- }
2286
- ];
2287
-
2288
- // src/contracts/ReceiptVerifierV2.ts
2289
- var ReceiptVerifierV2ABI = [
2290
- // Read functions
2291
- {
2292
- name: "getReceipt",
2293
- type: "function",
2294
- stateMutability: "view",
2295
- inputs: [{ name: "receiptId", type: "bytes32" }],
2296
- outputs: [
2297
- {
2298
- type: "tuple",
2299
- components: [
2300
- { name: "receiptId", type: "bytes32" },
2301
- { name: "issuer", type: "address" },
2302
- { name: "counterparty", type: "address" },
2303
- { name: "receiptType", type: "uint8" },
2304
- { name: "dataHash", type: "bytes32" },
2305
- { name: "timestamp", type: "uint256" },
2306
- { name: "isValid", type: "bool" }
2307
- ]
2308
- }
2309
- ]
2310
- },
2311
- {
2312
- name: "verifyReceipt",
2313
- type: "function",
2314
- stateMutability: "view",
2315
- inputs: [{ name: "receiptId", type: "bytes32" }],
2316
- outputs: [{ name: "", type: "bool" }]
2317
- },
2318
- {
2319
- name: "batchVerifyReceipts",
2320
- type: "function",
2321
- stateMutability: "view",
2322
- inputs: [{ name: "receiptIds", type: "bytes32[]" }],
2323
- outputs: [{ name: "results", type: "bool[]" }]
2324
- },
2325
- {
2326
- name: "receiptCount",
2327
- type: "function",
2328
- stateMutability: "view",
2329
- inputs: [],
2330
- outputs: [{ name: "", type: "uint256" }]
2331
- },
2332
- {
2333
- name: "authorizedIssuers",
2334
- type: "function",
2335
- stateMutability: "view",
2336
- inputs: [{ name: "", type: "address" }],
2337
- outputs: [{ name: "", type: "bool" }]
2338
- },
2339
- // Write functions
2340
- {
2341
- name: "createReceipt",
2342
- type: "function",
2343
- stateMutability: "nonpayable",
2344
- inputs: [
2345
- { name: "issuer", type: "address" },
2346
- { name: "counterparty", type: "address" },
2347
- { name: "receiptType", type: "uint8" },
2348
- { name: "dataHash", type: "bytes32" }
2349
- ],
2350
- outputs: [{ name: "receiptId", type: "bytes32" }]
2351
- },
2352
- {
2353
- name: "invalidateReceipt",
2354
- type: "function",
2355
- stateMutability: "nonpayable",
2356
- inputs: [{ name: "receiptId", type: "bytes32" }],
2357
- outputs: []
2358
- },
2359
- {
2360
- name: "addAuthorizedIssuer",
2361
- type: "function",
2362
- stateMutability: "nonpayable",
2363
- inputs: [{ name: "issuer", type: "address" }],
2364
- outputs: []
2365
- },
2366
- {
2367
- name: "removeAuthorizedIssuer",
2368
- type: "function",
2369
- stateMutability: "nonpayable",
2370
- inputs: [{ name: "issuer", type: "address" }],
2371
- outputs: []
2372
- },
2373
- // Events
2374
- {
2375
- name: "ReceiptCreated",
2376
- type: "event",
2377
- inputs: [
2378
- { name: "receiptId", type: "bytes32", indexed: true },
2379
- { name: "issuer", type: "address", indexed: true },
2380
- { name: "counterparty", type: "address", indexed: true },
2381
- { name: "receiptType", type: "uint8", indexed: false },
2382
- { name: "timestamp", type: "uint256", indexed: false }
2383
- ]
2384
- },
2385
- {
2386
- name: "ReceiptInvalidated",
2387
- type: "event",
2388
- inputs: [
2389
- { name: "receiptId", type: "bytes32", indexed: true },
2390
- { name: "timestamp", type: "uint256", indexed: false }
2391
- ]
2392
- }
2393
- ];
2394
-
2395
- // src/v2.ts
2396
- var CovenantSDKV2 = class extends CovenantSDK {
2397
- v2Addresses;
2398
- constructor(config) {
2399
- super(config);
2400
- this.v2Addresses = getV2ContractAddresses(
2401
- config.chainId,
2402
- config.v2ContractAddresses
2403
- );
2404
- }
2405
- // =========================================================================
2406
- // Insurance Pool Methods
2407
- // =========================================================================
2408
- /**
2409
- * Join the insurance pool by contributing ETH
2410
- */
2411
- async joinInsurancePool(contribution) {
2412
- this.requireWallet();
2413
- return await this.walletClient.writeContract({
2414
- address: this.v2Addresses.InsurancePool,
2415
- abi: InsurancePoolABI,
2416
- functionName: "joinPool",
2417
- value: contribution,
2418
- chain: this.chain,
2419
- account: this.account
2420
- });
2421
- }
2422
- /**
2423
- * File an insurance claim for a failed task
2424
- */
2425
- async fileClaim(taskId, amount) {
2426
- this.requireWallet();
2427
- return await this.walletClient.writeContract({
2428
- address: this.v2Addresses.InsurancePool,
2429
- abi: InsurancePoolABI,
2430
- functionName: "fileClaim",
2431
- args: [taskId, amount],
2432
- chain: this.chain,
2433
- account: this.account
2434
- });
2435
- }
2436
- /**
2437
- * Get insurance claim details
2438
- */
2439
- async getClaim(claimId) {
2440
- const result = await this.publicClient.readContract({
2441
- address: this.v2Addresses.InsurancePool,
2442
- abi: InsurancePoolABI,
2443
- functionName: "getClaim",
2444
- args: [claimId]
2445
- });
2446
- const data = result;
2447
- return {
2448
- claimant: data.claimant,
2449
- taskId: data.taskId,
2450
- amount: data.amount,
2451
- paid: data.paid,
2452
- timestamp: data.timestamp
2453
- };
2454
- }
2455
- /**
2456
- * Get the current balance of the insurance pool
2457
- */
2458
- async getPoolBalance() {
2459
- return await this.publicClient.readContract({
2460
- address: this.v2Addresses.InsurancePool,
2461
- abi: InsurancePoolABI,
2462
- functionName: "getPoolBalance"
2463
- });
2464
- }
2465
- /**
2466
- * Get insurance membership info for an agent
2467
- */
2468
- async getMemberInfo(member) {
2469
- const result = await this.publicClient.readContract({
2470
- address: this.v2Addresses.InsurancePool,
2471
- abi: InsurancePoolABI,
2472
- functionName: "getMemberInfo",
2473
- args: [member]
2474
- });
2475
- const tuple = result;
2476
- return {
2477
- active: tuple[0],
2478
- contributed: tuple[1]
2479
- };
2480
- }
2481
- // =========================================================================
2482
- // Dispute Resolution Methods
2483
- // =========================================================================
2484
- /**
2485
- * File a formal dispute on a task (requires bond in ETH)
2486
- */
2487
- async fileDispute(taskId, bond) {
2488
- this.requireWallet();
2489
- return await this.walletClient.writeContract({
2490
- address: this.v2Addresses.DisputeResolution,
2491
- abi: DisputeResolutionABI,
2492
- functionName: "fileDispute",
2493
- args: [taskId],
2494
- value: bond,
2495
- chain: this.chain,
2496
- account: this.account
2497
- });
2498
- }
2499
- /**
2500
- * Resolve a dispute (arbiter-only). Sets winner and worker share.
2501
- */
2502
- async resolveDispute(disputeId, workerWins, workerShare) {
2503
- this.requireWallet();
2504
- return await this.walletClient.writeContract({
2505
- address: this.v2Addresses.DisputeResolution,
2506
- abi: DisputeResolutionABI,
2507
- functionName: "resolveDispute",
2508
- args: [disputeId, workerWins, workerShare],
2509
- chain: this.chain,
2510
- account: this.account
2511
- });
2512
- }
2513
- /**
2514
- * Get dispute details
2515
- */
2516
- async getDispute(disputeId) {
2517
- const result = await this.publicClient.readContract({
2518
- address: this.v2Addresses.DisputeResolution,
2519
- abi: DisputeResolutionABI,
2520
- functionName: "getDispute",
2521
- args: [disputeId]
2522
- });
2523
- const data = result;
2524
- return {
2525
- taskId: data.taskId,
2526
- filedBy: data.filedBy,
2527
- bondAmount: data.bondAmount,
2528
- votingEndsAt: data.votingEndsAt,
2529
- resolved: data.resolved,
2530
- workerWins: data.workerWins,
2531
- workerShare: data.workerShare
2532
- };
2533
- }
2534
- // =========================================================================
2535
- // Receipt Verifier V2 Methods
2536
- // =========================================================================
2537
- /**
2538
- * Create an ERC-8004 attestation receipt with enum type
2539
- */
2540
- async createReceiptV2(issuer, counterparty, receiptType, dataHash) {
2541
- this.requireWallet();
2542
- return await this.walletClient.writeContract({
2543
- address: this.v2Addresses.ReceiptVerifier,
2544
- abi: ReceiptVerifierV2ABI,
2545
- functionName: "createReceipt",
2546
- args: [issuer, counterparty, receiptType, dataHash],
2547
- chain: this.chain,
2548
- account: this.account
2549
- });
2550
- }
2551
- /**
2552
- * Verify a single receipt by its bytes32 ID
2553
- */
2554
- async verifyReceipt(receiptId) {
2555
- return await this.publicClient.readContract({
2556
- address: this.v2Addresses.ReceiptVerifier,
2557
- abi: ReceiptVerifierV2ABI,
2558
- functionName: "verifyReceipt",
2559
- args: [receiptId]
2560
- });
2561
- }
2562
- /**
2563
- * Batch verify multiple receipts by their bytes32 IDs
2564
- */
2565
- async batchVerifyReceipts(receiptIds) {
2566
- return await this.publicClient.readContract({
2567
- address: this.v2Addresses.ReceiptVerifier,
2568
- abi: ReceiptVerifierV2ABI,
2569
- functionName: "batchVerifyReceipts",
2570
- args: [receiptIds]
2571
- });
2572
- }
2573
- /**
2574
- * Get full receipt details by bytes32 ID
2575
- */
2576
- async getReceiptV2(receiptId) {
2577
- const result = await this.publicClient.readContract({
2578
- address: this.v2Addresses.ReceiptVerifier,
2579
- abi: ReceiptVerifierV2ABI,
2580
- functionName: "getReceipt",
2581
- args: [receiptId]
2582
- });
2583
- const data = result;
2584
- return {
2585
- receiptId: data.receiptId,
2586
- issuer: data.issuer,
2587
- counterparty: data.counterparty,
2588
- receiptType: data.receiptType,
2589
- dataHash: data.dataHash,
2590
- timestamp: data.timestamp,
2591
- isValid: data.isValid
2592
- };
2593
- }
2594
- // =========================================================================
2595
- // V2 Utility Methods
2596
- // =========================================================================
2597
- /**
2598
- * Get v2 contract addresses being used
2599
- */
2600
- getV2Addresses() {
2601
- return { ...this.v2Addresses };
2602
- }
2603
- };
2604
- function toBytes32(input) {
2605
- if (input.startsWith("0x") && input.length === 66) {
2606
- return input;
2607
- }
2608
- return (0, import_viem.keccak256)((0, import_viem.toBytes)(input));
2609
- }
2610
- // Annotate the CommonJS export names for ESM import in node:
2611
- 0 && (module.exports = {
2612
- CovenantSDKV2,
2613
- ReceiptType,
2614
- toBytes32
2615
- });