@agenticprimitives/contracts 1.0.0-alpha.28 → 1.0.0-alpha.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abi/PricedSubregistry.json +869 -0
- package/dist/abi/index.d.ts +1 -0
- package/dist/abi/index.js +1 -0
- package/package.json +1 -1
- package/src/naming/PricedSubregistry.sol +209 -0
|
@@ -0,0 +1,869 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "constructor",
|
|
4
|
+
"inputs": [
|
|
5
|
+
{
|
|
6
|
+
"name": "registry",
|
|
7
|
+
"type": "address",
|
|
8
|
+
"internalType": "contract AgentNameRegistry"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "parentNode",
|
|
12
|
+
"type": "bytes32",
|
|
13
|
+
"internalType": "bytes32"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "defaultResolver",
|
|
17
|
+
"type": "address",
|
|
18
|
+
"internalType": "address"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "coin",
|
|
22
|
+
"type": "address",
|
|
23
|
+
"internalType": "contract IERC20"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "governor_",
|
|
27
|
+
"type": "address",
|
|
28
|
+
"internalType": "address"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "feeTreasury_",
|
|
32
|
+
"type": "address",
|
|
33
|
+
"internalType": "address"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "base_",
|
|
37
|
+
"type": "uint256",
|
|
38
|
+
"internalType": "uint256"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "multipliersX10_",
|
|
42
|
+
"type": "uint16[5]",
|
|
43
|
+
"internalType": "uint16[5]"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "cap_",
|
|
47
|
+
"type": "uint256",
|
|
48
|
+
"internalType": "uint256"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"stateMutability": "nonpayable"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "function",
|
|
55
|
+
"name": "CLAIM_TICKET_TYPEHASH",
|
|
56
|
+
"inputs": [],
|
|
57
|
+
"outputs": [
|
|
58
|
+
{
|
|
59
|
+
"name": "",
|
|
60
|
+
"type": "bytes32",
|
|
61
|
+
"internalType": "bytes32"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"stateMutability": "view"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"type": "function",
|
|
68
|
+
"name": "COIN",
|
|
69
|
+
"inputs": [],
|
|
70
|
+
"outputs": [
|
|
71
|
+
{
|
|
72
|
+
"name": "",
|
|
73
|
+
"type": "address",
|
|
74
|
+
"internalType": "contract IERC20"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"stateMutability": "view"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"type": "function",
|
|
81
|
+
"name": "DEFAULT_RESOLVER",
|
|
82
|
+
"inputs": [],
|
|
83
|
+
"outputs": [
|
|
84
|
+
{
|
|
85
|
+
"name": "",
|
|
86
|
+
"type": "address",
|
|
87
|
+
"internalType": "address"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"stateMutability": "view"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"type": "function",
|
|
94
|
+
"name": "MIN_LABEL_LENGTH",
|
|
95
|
+
"inputs": [],
|
|
96
|
+
"outputs": [
|
|
97
|
+
{
|
|
98
|
+
"name": "",
|
|
99
|
+
"type": "uint256",
|
|
100
|
+
"internalType": "uint256"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"stateMutability": "view"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "function",
|
|
107
|
+
"name": "PARENT_NODE",
|
|
108
|
+
"inputs": [],
|
|
109
|
+
"outputs": [
|
|
110
|
+
{
|
|
111
|
+
"name": "",
|
|
112
|
+
"type": "bytes32",
|
|
113
|
+
"internalType": "bytes32"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"stateMutability": "view"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"type": "function",
|
|
120
|
+
"name": "REGISTRY",
|
|
121
|
+
"inputs": [],
|
|
122
|
+
"outputs": [
|
|
123
|
+
{
|
|
124
|
+
"name": "",
|
|
125
|
+
"type": "address",
|
|
126
|
+
"internalType": "contract AgentNameRegistry"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"stateMutability": "view"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"type": "function",
|
|
133
|
+
"name": "base",
|
|
134
|
+
"inputs": [],
|
|
135
|
+
"outputs": [
|
|
136
|
+
{
|
|
137
|
+
"name": "",
|
|
138
|
+
"type": "uint256",
|
|
139
|
+
"internalType": "uint256"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"stateMutability": "view"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"type": "function",
|
|
146
|
+
"name": "cap",
|
|
147
|
+
"inputs": [],
|
|
148
|
+
"outputs": [
|
|
149
|
+
{
|
|
150
|
+
"name": "",
|
|
151
|
+
"type": "uint256",
|
|
152
|
+
"internalType": "uint256"
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"stateMutability": "view"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"type": "function",
|
|
159
|
+
"name": "claim",
|
|
160
|
+
"inputs": [
|
|
161
|
+
{
|
|
162
|
+
"name": "t",
|
|
163
|
+
"type": "tuple",
|
|
164
|
+
"internalType": "struct PricedSubregistry.ClaimTicket",
|
|
165
|
+
"components": [
|
|
166
|
+
{
|
|
167
|
+
"name": "parentNode",
|
|
168
|
+
"type": "bytes32",
|
|
169
|
+
"internalType": "bytes32"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "label",
|
|
173
|
+
"type": "string",
|
|
174
|
+
"internalType": "string"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"name": "owner",
|
|
178
|
+
"type": "address",
|
|
179
|
+
"internalType": "address"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "payer",
|
|
183
|
+
"type": "address",
|
|
184
|
+
"internalType": "address"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "price",
|
|
188
|
+
"type": "uint256",
|
|
189
|
+
"internalType": "uint256"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "domain",
|
|
193
|
+
"type": "bytes32",
|
|
194
|
+
"internalType": "bytes32"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"name": "expiry",
|
|
198
|
+
"type": "uint256",
|
|
199
|
+
"internalType": "uint256"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "nonce",
|
|
203
|
+
"type": "bytes32",
|
|
204
|
+
"internalType": "bytes32"
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "gateSig",
|
|
210
|
+
"type": "bytes",
|
|
211
|
+
"internalType": "bytes"
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
"outputs": [
|
|
215
|
+
{
|
|
216
|
+
"name": "childNode",
|
|
217
|
+
"type": "bytes32",
|
|
218
|
+
"internalType": "bytes32"
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
"stateMutability": "nonpayable"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"type": "function",
|
|
225
|
+
"name": "claimCount",
|
|
226
|
+
"inputs": [],
|
|
227
|
+
"outputs": [
|
|
228
|
+
{
|
|
229
|
+
"name": "",
|
|
230
|
+
"type": "uint256",
|
|
231
|
+
"internalType": "uint256"
|
|
232
|
+
}
|
|
233
|
+
],
|
|
234
|
+
"stateMutability": "view"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"type": "function",
|
|
238
|
+
"name": "claimedBy",
|
|
239
|
+
"inputs": [
|
|
240
|
+
{
|
|
241
|
+
"name": "",
|
|
242
|
+
"type": "address",
|
|
243
|
+
"internalType": "address"
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"outputs": [
|
|
247
|
+
{
|
|
248
|
+
"name": "",
|
|
249
|
+
"type": "bytes32",
|
|
250
|
+
"internalType": "bytes32"
|
|
251
|
+
}
|
|
252
|
+
],
|
|
253
|
+
"stateMutability": "view"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"type": "function",
|
|
257
|
+
"name": "eip712Domain",
|
|
258
|
+
"inputs": [],
|
|
259
|
+
"outputs": [
|
|
260
|
+
{
|
|
261
|
+
"name": "fields",
|
|
262
|
+
"type": "bytes1",
|
|
263
|
+
"internalType": "bytes1"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "name",
|
|
267
|
+
"type": "string",
|
|
268
|
+
"internalType": "string"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"name": "version",
|
|
272
|
+
"type": "string",
|
|
273
|
+
"internalType": "string"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"name": "chainId",
|
|
277
|
+
"type": "uint256",
|
|
278
|
+
"internalType": "uint256"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"name": "verifyingContract",
|
|
282
|
+
"type": "address",
|
|
283
|
+
"internalType": "address"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "salt",
|
|
287
|
+
"type": "bytes32",
|
|
288
|
+
"internalType": "bytes32"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "extensions",
|
|
292
|
+
"type": "uint256[]",
|
|
293
|
+
"internalType": "uint256[]"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"stateMutability": "view"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"type": "function",
|
|
300
|
+
"name": "feeTreasury",
|
|
301
|
+
"inputs": [],
|
|
302
|
+
"outputs": [
|
|
303
|
+
{
|
|
304
|
+
"name": "",
|
|
305
|
+
"type": "address",
|
|
306
|
+
"internalType": "address"
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"stateMutability": "view"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"type": "function",
|
|
313
|
+
"name": "gates",
|
|
314
|
+
"inputs": [
|
|
315
|
+
{
|
|
316
|
+
"name": "",
|
|
317
|
+
"type": "address",
|
|
318
|
+
"internalType": "address"
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
"outputs": [
|
|
322
|
+
{
|
|
323
|
+
"name": "",
|
|
324
|
+
"type": "bool",
|
|
325
|
+
"internalType": "bool"
|
|
326
|
+
}
|
|
327
|
+
],
|
|
328
|
+
"stateMutability": "view"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"type": "function",
|
|
332
|
+
"name": "governor",
|
|
333
|
+
"inputs": [],
|
|
334
|
+
"outputs": [
|
|
335
|
+
{
|
|
336
|
+
"name": "",
|
|
337
|
+
"type": "address",
|
|
338
|
+
"internalType": "address"
|
|
339
|
+
}
|
|
340
|
+
],
|
|
341
|
+
"stateMutability": "view"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"type": "function",
|
|
345
|
+
"name": "hasClaimed",
|
|
346
|
+
"inputs": [
|
|
347
|
+
{
|
|
348
|
+
"name": "owner",
|
|
349
|
+
"type": "address",
|
|
350
|
+
"internalType": "address"
|
|
351
|
+
}
|
|
352
|
+
],
|
|
353
|
+
"outputs": [
|
|
354
|
+
{
|
|
355
|
+
"name": "",
|
|
356
|
+
"type": "bool",
|
|
357
|
+
"internalType": "bool"
|
|
358
|
+
}
|
|
359
|
+
],
|
|
360
|
+
"stateMutability": "view"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"type": "function",
|
|
364
|
+
"name": "multipliersX10",
|
|
365
|
+
"inputs": [
|
|
366
|
+
{
|
|
367
|
+
"name": "",
|
|
368
|
+
"type": "uint256",
|
|
369
|
+
"internalType": "uint256"
|
|
370
|
+
}
|
|
371
|
+
],
|
|
372
|
+
"outputs": [
|
|
373
|
+
{
|
|
374
|
+
"name": "",
|
|
375
|
+
"type": "uint16",
|
|
376
|
+
"internalType": "uint16"
|
|
377
|
+
}
|
|
378
|
+
],
|
|
379
|
+
"stateMutability": "view"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"type": "function",
|
|
383
|
+
"name": "paid",
|
|
384
|
+
"inputs": [
|
|
385
|
+
{
|
|
386
|
+
"name": "",
|
|
387
|
+
"type": "bytes32",
|
|
388
|
+
"internalType": "bytes32"
|
|
389
|
+
}
|
|
390
|
+
],
|
|
391
|
+
"outputs": [
|
|
392
|
+
{
|
|
393
|
+
"name": "",
|
|
394
|
+
"type": "uint256",
|
|
395
|
+
"internalType": "uint256"
|
|
396
|
+
}
|
|
397
|
+
],
|
|
398
|
+
"stateMutability": "view"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"type": "function",
|
|
402
|
+
"name": "paidAt",
|
|
403
|
+
"inputs": [
|
|
404
|
+
{
|
|
405
|
+
"name": "",
|
|
406
|
+
"type": "bytes32",
|
|
407
|
+
"internalType": "bytes32"
|
|
408
|
+
}
|
|
409
|
+
],
|
|
410
|
+
"outputs": [
|
|
411
|
+
{
|
|
412
|
+
"name": "",
|
|
413
|
+
"type": "uint64",
|
|
414
|
+
"internalType": "uint64"
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
"stateMutability": "view"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"type": "function",
|
|
421
|
+
"name": "priceOf",
|
|
422
|
+
"inputs": [
|
|
423
|
+
{
|
|
424
|
+
"name": "label",
|
|
425
|
+
"type": "string",
|
|
426
|
+
"internalType": "string"
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
"outputs": [
|
|
430
|
+
{
|
|
431
|
+
"name": "",
|
|
432
|
+
"type": "uint256",
|
|
433
|
+
"internalType": "uint256"
|
|
434
|
+
}
|
|
435
|
+
],
|
|
436
|
+
"stateMutability": "view"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"type": "function",
|
|
440
|
+
"name": "setFeeTreasury",
|
|
441
|
+
"inputs": [
|
|
442
|
+
{
|
|
443
|
+
"name": "feeTreasury_",
|
|
444
|
+
"type": "address",
|
|
445
|
+
"internalType": "address"
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
"outputs": [],
|
|
449
|
+
"stateMutability": "nonpayable"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"type": "function",
|
|
453
|
+
"name": "setGate",
|
|
454
|
+
"inputs": [
|
|
455
|
+
{
|
|
456
|
+
"name": "gate",
|
|
457
|
+
"type": "address",
|
|
458
|
+
"internalType": "address"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"name": "allowed",
|
|
462
|
+
"type": "bool",
|
|
463
|
+
"internalType": "bool"
|
|
464
|
+
}
|
|
465
|
+
],
|
|
466
|
+
"outputs": [],
|
|
467
|
+
"stateMutability": "nonpayable"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"type": "function",
|
|
471
|
+
"name": "setPriceTable",
|
|
472
|
+
"inputs": [
|
|
473
|
+
{
|
|
474
|
+
"name": "base_",
|
|
475
|
+
"type": "uint256",
|
|
476
|
+
"internalType": "uint256"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"name": "multipliersX10_",
|
|
480
|
+
"type": "uint16[5]",
|
|
481
|
+
"internalType": "uint16[5]"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"name": "cap_",
|
|
485
|
+
"type": "uint256",
|
|
486
|
+
"internalType": "uint256"
|
|
487
|
+
}
|
|
488
|
+
],
|
|
489
|
+
"outputs": [],
|
|
490
|
+
"stateMutability": "nonpayable"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"type": "function",
|
|
494
|
+
"name": "ticketDigest",
|
|
495
|
+
"inputs": [
|
|
496
|
+
{
|
|
497
|
+
"name": "t",
|
|
498
|
+
"type": "tuple",
|
|
499
|
+
"internalType": "struct PricedSubregistry.ClaimTicket",
|
|
500
|
+
"components": [
|
|
501
|
+
{
|
|
502
|
+
"name": "parentNode",
|
|
503
|
+
"type": "bytes32",
|
|
504
|
+
"internalType": "bytes32"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"name": "label",
|
|
508
|
+
"type": "string",
|
|
509
|
+
"internalType": "string"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"name": "owner",
|
|
513
|
+
"type": "address",
|
|
514
|
+
"internalType": "address"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"name": "payer",
|
|
518
|
+
"type": "address",
|
|
519
|
+
"internalType": "address"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"name": "price",
|
|
523
|
+
"type": "uint256",
|
|
524
|
+
"internalType": "uint256"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"name": "domain",
|
|
528
|
+
"type": "bytes32",
|
|
529
|
+
"internalType": "bytes32"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"name": "expiry",
|
|
533
|
+
"type": "uint256",
|
|
534
|
+
"internalType": "uint256"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"name": "nonce",
|
|
538
|
+
"type": "bytes32",
|
|
539
|
+
"internalType": "bytes32"
|
|
540
|
+
}
|
|
541
|
+
]
|
|
542
|
+
}
|
|
543
|
+
],
|
|
544
|
+
"outputs": [
|
|
545
|
+
{
|
|
546
|
+
"name": "",
|
|
547
|
+
"type": "bytes32",
|
|
548
|
+
"internalType": "bytes32"
|
|
549
|
+
}
|
|
550
|
+
],
|
|
551
|
+
"stateMutability": "view"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"type": "function",
|
|
555
|
+
"name": "transferGovernor",
|
|
556
|
+
"inputs": [
|
|
557
|
+
{
|
|
558
|
+
"name": "newGovernor",
|
|
559
|
+
"type": "address",
|
|
560
|
+
"internalType": "address"
|
|
561
|
+
}
|
|
562
|
+
],
|
|
563
|
+
"outputs": [],
|
|
564
|
+
"stateMutability": "nonpayable"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"type": "function",
|
|
568
|
+
"name": "usedNonce",
|
|
569
|
+
"inputs": [
|
|
570
|
+
{
|
|
571
|
+
"name": "",
|
|
572
|
+
"type": "bytes32",
|
|
573
|
+
"internalType": "bytes32"
|
|
574
|
+
}
|
|
575
|
+
],
|
|
576
|
+
"outputs": [
|
|
577
|
+
{
|
|
578
|
+
"name": "",
|
|
579
|
+
"type": "bool",
|
|
580
|
+
"internalType": "bool"
|
|
581
|
+
}
|
|
582
|
+
],
|
|
583
|
+
"stateMutability": "view"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"type": "event",
|
|
587
|
+
"name": "EIP712DomainChanged",
|
|
588
|
+
"inputs": [],
|
|
589
|
+
"anonymous": false
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"type": "event",
|
|
593
|
+
"name": "FeeTreasurySet",
|
|
594
|
+
"inputs": [
|
|
595
|
+
{
|
|
596
|
+
"name": "feeTreasury",
|
|
597
|
+
"type": "address",
|
|
598
|
+
"indexed": true,
|
|
599
|
+
"internalType": "address"
|
|
600
|
+
}
|
|
601
|
+
],
|
|
602
|
+
"anonymous": false
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
"type": "event",
|
|
606
|
+
"name": "GateSet",
|
|
607
|
+
"inputs": [
|
|
608
|
+
{
|
|
609
|
+
"name": "gate",
|
|
610
|
+
"type": "address",
|
|
611
|
+
"indexed": true,
|
|
612
|
+
"internalType": "address"
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
"name": "allowed",
|
|
616
|
+
"type": "bool",
|
|
617
|
+
"indexed": false,
|
|
618
|
+
"internalType": "bool"
|
|
619
|
+
}
|
|
620
|
+
],
|
|
621
|
+
"anonymous": false
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"type": "event",
|
|
625
|
+
"name": "GovernorTransferred",
|
|
626
|
+
"inputs": [
|
|
627
|
+
{
|
|
628
|
+
"name": "oldGovernor",
|
|
629
|
+
"type": "address",
|
|
630
|
+
"indexed": true,
|
|
631
|
+
"internalType": "address"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"name": "newGovernor",
|
|
635
|
+
"type": "address",
|
|
636
|
+
"indexed": true,
|
|
637
|
+
"internalType": "address"
|
|
638
|
+
}
|
|
639
|
+
],
|
|
640
|
+
"anonymous": false
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
"type": "event",
|
|
644
|
+
"name": "NamePurchased",
|
|
645
|
+
"inputs": [
|
|
646
|
+
{
|
|
647
|
+
"name": "owner",
|
|
648
|
+
"type": "address",
|
|
649
|
+
"indexed": true,
|
|
650
|
+
"internalType": "address"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"name": "payer",
|
|
654
|
+
"type": "address",
|
|
655
|
+
"indexed": true,
|
|
656
|
+
"internalType": "address"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"name": "childNode",
|
|
660
|
+
"type": "bytes32",
|
|
661
|
+
"indexed": true,
|
|
662
|
+
"internalType": "bytes32"
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
"name": "label",
|
|
666
|
+
"type": "string",
|
|
667
|
+
"indexed": false,
|
|
668
|
+
"internalType": "string"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"name": "price",
|
|
672
|
+
"type": "uint256",
|
|
673
|
+
"indexed": false,
|
|
674
|
+
"internalType": "uint256"
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"name": "domain",
|
|
678
|
+
"type": "bytes32",
|
|
679
|
+
"indexed": false,
|
|
680
|
+
"internalType": "bytes32"
|
|
681
|
+
}
|
|
682
|
+
],
|
|
683
|
+
"anonymous": false
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
"type": "event",
|
|
687
|
+
"name": "PriceTableSet",
|
|
688
|
+
"inputs": [
|
|
689
|
+
{
|
|
690
|
+
"name": "base",
|
|
691
|
+
"type": "uint256",
|
|
692
|
+
"indexed": false,
|
|
693
|
+
"internalType": "uint256"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"name": "multipliersX10",
|
|
697
|
+
"type": "uint16[5]",
|
|
698
|
+
"indexed": false,
|
|
699
|
+
"internalType": "uint16[5]"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"name": "cap",
|
|
703
|
+
"type": "uint256",
|
|
704
|
+
"indexed": false,
|
|
705
|
+
"internalType": "uint256"
|
|
706
|
+
}
|
|
707
|
+
],
|
|
708
|
+
"anonymous": false
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"type": "error",
|
|
712
|
+
"name": "AddressEmptyCode",
|
|
713
|
+
"inputs": [
|
|
714
|
+
{
|
|
715
|
+
"name": "target",
|
|
716
|
+
"type": "address",
|
|
717
|
+
"internalType": "address"
|
|
718
|
+
}
|
|
719
|
+
]
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"type": "error",
|
|
723
|
+
"name": "AddressInsufficientBalance",
|
|
724
|
+
"inputs": [
|
|
725
|
+
{
|
|
726
|
+
"name": "account",
|
|
727
|
+
"type": "address",
|
|
728
|
+
"internalType": "address"
|
|
729
|
+
}
|
|
730
|
+
]
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"type": "error",
|
|
734
|
+
"name": "AlreadyClaimed",
|
|
735
|
+
"inputs": [
|
|
736
|
+
{
|
|
737
|
+
"name": "existingNode",
|
|
738
|
+
"type": "bytes32",
|
|
739
|
+
"internalType": "bytes32"
|
|
740
|
+
}
|
|
741
|
+
]
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"type": "error",
|
|
745
|
+
"name": "ECDSAInvalidSignature",
|
|
746
|
+
"inputs": []
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
"type": "error",
|
|
750
|
+
"name": "ECDSAInvalidSignatureLength",
|
|
751
|
+
"inputs": [
|
|
752
|
+
{
|
|
753
|
+
"name": "length",
|
|
754
|
+
"type": "uint256",
|
|
755
|
+
"internalType": "uint256"
|
|
756
|
+
}
|
|
757
|
+
]
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
"type": "error",
|
|
761
|
+
"name": "ECDSAInvalidSignatureS",
|
|
762
|
+
"inputs": [
|
|
763
|
+
{
|
|
764
|
+
"name": "s",
|
|
765
|
+
"type": "bytes32",
|
|
766
|
+
"internalType": "bytes32"
|
|
767
|
+
}
|
|
768
|
+
]
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"type": "error",
|
|
772
|
+
"name": "EmptyLabel",
|
|
773
|
+
"inputs": []
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
"type": "error",
|
|
777
|
+
"name": "FailedInnerCall",
|
|
778
|
+
"inputs": []
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"type": "error",
|
|
782
|
+
"name": "InvalidShortString",
|
|
783
|
+
"inputs": []
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
"type": "error",
|
|
787
|
+
"name": "LabelTooShort",
|
|
788
|
+
"inputs": []
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
"type": "error",
|
|
792
|
+
"name": "NonceUsed",
|
|
793
|
+
"inputs": []
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"type": "error",
|
|
797
|
+
"name": "NotAGate",
|
|
798
|
+
"inputs": [
|
|
799
|
+
{
|
|
800
|
+
"name": "signer",
|
|
801
|
+
"type": "address",
|
|
802
|
+
"internalType": "address"
|
|
803
|
+
}
|
|
804
|
+
]
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"type": "error",
|
|
808
|
+
"name": "NotGovernor",
|
|
809
|
+
"inputs": []
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
"type": "error",
|
|
813
|
+
"name": "NotPayer",
|
|
814
|
+
"inputs": []
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
"type": "error",
|
|
818
|
+
"name": "ReentrancyGuardReentrantCall",
|
|
819
|
+
"inputs": []
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
"type": "error",
|
|
823
|
+
"name": "SafeERC20FailedOperation",
|
|
824
|
+
"inputs": [
|
|
825
|
+
{
|
|
826
|
+
"name": "token",
|
|
827
|
+
"type": "address",
|
|
828
|
+
"internalType": "address"
|
|
829
|
+
}
|
|
830
|
+
]
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"type": "error",
|
|
834
|
+
"name": "StringTooLong",
|
|
835
|
+
"inputs": [
|
|
836
|
+
{
|
|
837
|
+
"name": "str",
|
|
838
|
+
"type": "string",
|
|
839
|
+
"internalType": "string"
|
|
840
|
+
}
|
|
841
|
+
]
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"type": "error",
|
|
845
|
+
"name": "TicketExpired",
|
|
846
|
+
"inputs": []
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
"type": "error",
|
|
850
|
+
"name": "WrongPrice",
|
|
851
|
+
"inputs": [
|
|
852
|
+
{
|
|
853
|
+
"name": "expected",
|
|
854
|
+
"type": "uint256",
|
|
855
|
+
"internalType": "uint256"
|
|
856
|
+
}
|
|
857
|
+
]
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
"type": "error",
|
|
861
|
+
"name": "WrongRoot",
|
|
862
|
+
"inputs": []
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
"type": "error",
|
|
866
|
+
"name": "ZeroAddress",
|
|
867
|
+
"inputs": []
|
|
868
|
+
}
|
|
869
|
+
]
|
package/dist/abi/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export declare const PaymentEnforcer: Abi;
|
|
|
57
57
|
export declare const PaymentEscrow: Abi;
|
|
58
58
|
export declare const PaymentReceiptRegistry: Abi;
|
|
59
59
|
export declare const PermissionlessSubregistry: Abi;
|
|
60
|
+
export declare const PricedSubregistry: Abi;
|
|
60
61
|
export declare const QuorumEnforcer: Abi;
|
|
61
62
|
export declare const ReceiptAnchorRegistry: Abi;
|
|
62
63
|
export declare const RelationshipTypeRegistry: Abi;
|
package/dist/abi/index.js
CHANGED
|
@@ -57,6 +57,7 @@ export { default as PaymentEnforcer } from './PaymentEnforcer.json' with { type:
|
|
|
57
57
|
export { default as PaymentEscrow } from './PaymentEscrow.json' with { type: 'json' };
|
|
58
58
|
export { default as PaymentReceiptRegistry } from './PaymentReceiptRegistry.json' with { type: 'json' };
|
|
59
59
|
export { default as PermissionlessSubregistry } from './PermissionlessSubregistry.json' with { type: 'json' };
|
|
60
|
+
export { default as PricedSubregistry } from './PricedSubregistry.json' with { type: 'json' };
|
|
60
61
|
export { default as QuorumEnforcer } from './QuorumEnforcer.json' with { type: 'json' };
|
|
61
62
|
export { default as ReceiptAnchorRegistry } from './ReceiptAnchorRegistry.json' with { type: 'json' };
|
|
62
63
|
export { default as RelationshipTypeRegistry } from './RelationshipTypeRegistry.json' with { type: 'json' };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/contracts",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.29",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Solidity contracts + ABIs + flattened sources + per-network deployment addresses for the agenticprimitives stack.",
|
|
6
6
|
"homepage": "https://agenticprimitives.dev",
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.28;
|
|
3
|
+
|
|
4
|
+
import "./AgentNameRegistry.sol";
|
|
5
|
+
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
|
|
6
|
+
import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
|
|
7
|
+
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
|
|
8
|
+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
9
|
+
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @title PricedSubregistry
|
|
13
|
+
* @notice A subregistry for one typed root where a claim COSTS a coin and needs a ticket (spec 431; the contract
|
|
14
|
+
* spec is 432). The successor of `PermissionlessSubregistry` for a root whose names are purchased.
|
|
15
|
+
*
|
|
16
|
+
* One signed operation, one receipt:
|
|
17
|
+
* - The PAYER calls `claim(ticket, gateSig)`. The payer is a treasury Smart Agent (assets live only in treasuries);
|
|
18
|
+
* it approved this contract for the price beforehand, in the same user operation.
|
|
19
|
+
* - The TICKET is signed (EIP-712) by an estate's naming GATE — the key a Home holds. A gate signs only after its
|
|
20
|
+
* own rules passed (the domain rule: a protected label needs a verified email at that domain). The contract
|
|
21
|
+
* checks the signature against the gates the governor named; it stores nothing about why the gate agreed
|
|
22
|
+
* beyond `domain` (a label, never an email).
|
|
23
|
+
* - The PRICE is a pure function of the label's length and this root's base, computed here and checked against
|
|
24
|
+
* the ticket, so the Home, the naming service and the chain agree on the number.
|
|
25
|
+
* - The fee moves from the payer to the fee treasury; the name is registered to `ticket.owner`; the owner is
|
|
26
|
+
* recorded as having claimed under this root (one name per owner per root, never released); the price and the
|
|
27
|
+
* time are stored so a reader never needs a log.
|
|
28
|
+
*
|
|
29
|
+
* What this is NOT (spec 431 D6): no expiry, no renewal, no resale, no refund. A paid name is an address card and
|
|
30
|
+
* grants nobody authority.
|
|
31
|
+
*
|
|
32
|
+
* Authority model: the registry sees `msg.sender == address(this)` AND `r.subregistry == this`; the child is owned
|
|
33
|
+
* by `ticket.owner`, never by this contract. Governance (gates, fee treasury, the price table) is the governor's —
|
|
34
|
+
* meant to be the root owner / the town's governor, and transferable.
|
|
35
|
+
*/
|
|
36
|
+
contract PricedSubregistry is ReentrancyGuard, EIP712 {
|
|
37
|
+
using SafeERC20 for IERC20;
|
|
38
|
+
|
|
39
|
+
AgentNameRegistry public immutable REGISTRY;
|
|
40
|
+
bytes32 public immutable PARENT_NODE;
|
|
41
|
+
address public immutable DEFAULT_RESOLVER;
|
|
42
|
+
IERC20 public immutable COIN;
|
|
43
|
+
|
|
44
|
+
uint256 public constant MIN_LABEL_LENGTH = 3;
|
|
45
|
+
|
|
46
|
+
/// @dev keccak256("ClaimTicket(bytes32 parentNode,string label,address owner,address payer,uint256 price,bytes32 domain,uint256 expiry,bytes32 nonce)")
|
|
47
|
+
bytes32 public constant CLAIM_TICKET_TYPEHASH =
|
|
48
|
+
keccak256("ClaimTicket(bytes32 parentNode,string label,address owner,address payer,uint256 price,bytes32 domain,uint256 expiry,bytes32 nonce)");
|
|
49
|
+
|
|
50
|
+
struct ClaimTicket {
|
|
51
|
+
bytes32 parentNode;
|
|
52
|
+
string label;
|
|
53
|
+
address owner;
|
|
54
|
+
address payer;
|
|
55
|
+
uint256 price;
|
|
56
|
+
/// @dev keccak256 of the domain the gate vouched for (`ibm.com`), or zero for an unprotected label.
|
|
57
|
+
bytes32 domain;
|
|
58
|
+
uint256 expiry;
|
|
59
|
+
bytes32 nonce;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
address public governor;
|
|
63
|
+
address public feeTreasury;
|
|
64
|
+
/// @notice Estate naming gates whose tickets this root accepts.
|
|
65
|
+
mapping(address => bool) public gates;
|
|
66
|
+
|
|
67
|
+
/// @notice The price table: `base` in coin units for a label of 8+ characters; multipliers ×10 for lengths
|
|
68
|
+
/// 3, 4, 5, 6, 7 (an 8+ label is ×1); `cap` in coin units. Spec 431 §2.
|
|
69
|
+
uint256 public base;
|
|
70
|
+
uint16[5] public multipliersX10;
|
|
71
|
+
uint256 public cap;
|
|
72
|
+
|
|
73
|
+
/// @notice owner → the child node already claimed under this root (one per owner).
|
|
74
|
+
mapping(address => bytes32) public claimedBy;
|
|
75
|
+
/// @notice node → what was paid, and when. Readable without a log scan.
|
|
76
|
+
mapping(bytes32 => uint256) public paid;
|
|
77
|
+
mapping(bytes32 => uint64) public paidAt;
|
|
78
|
+
mapping(bytes32 => bool) public usedNonce;
|
|
79
|
+
uint256 public claimCount;
|
|
80
|
+
|
|
81
|
+
event NamePurchased(address indexed owner, address indexed payer, bytes32 indexed childNode, string label, uint256 price, bytes32 domain);
|
|
82
|
+
event GateSet(address indexed gate, bool allowed);
|
|
83
|
+
event FeeTreasurySet(address indexed feeTreasury);
|
|
84
|
+
event PriceTableSet(uint256 base, uint16[5] multipliersX10, uint256 cap);
|
|
85
|
+
event GovernorTransferred(address indexed oldGovernor, address indexed newGovernor);
|
|
86
|
+
|
|
87
|
+
error NotGovernor();
|
|
88
|
+
error ZeroAddress();
|
|
89
|
+
error WrongRoot();
|
|
90
|
+
error NotPayer();
|
|
91
|
+
error TicketExpired();
|
|
92
|
+
error NonceUsed();
|
|
93
|
+
error WrongPrice(uint256 expected);
|
|
94
|
+
error NotAGate(address signer);
|
|
95
|
+
error AlreadyClaimed(bytes32 existingNode);
|
|
96
|
+
error LabelTooShort();
|
|
97
|
+
error EmptyLabel();
|
|
98
|
+
|
|
99
|
+
modifier onlyGovernor() {
|
|
100
|
+
if (msg.sender != governor) revert NotGovernor();
|
|
101
|
+
_;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
constructor(
|
|
105
|
+
AgentNameRegistry registry,
|
|
106
|
+
bytes32 parentNode,
|
|
107
|
+
address defaultResolver,
|
|
108
|
+
IERC20 coin,
|
|
109
|
+
address governor_,
|
|
110
|
+
address feeTreasury_,
|
|
111
|
+
uint256 base_,
|
|
112
|
+
uint16[5] memory multipliersX10_,
|
|
113
|
+
uint256 cap_
|
|
114
|
+
) EIP712("PricedSubregistry", "1") {
|
|
115
|
+
if (governor_ == address(0) || feeTreasury_ == address(0) || address(coin) == address(0)) revert ZeroAddress();
|
|
116
|
+
REGISTRY = registry;
|
|
117
|
+
PARENT_NODE = parentNode;
|
|
118
|
+
DEFAULT_RESOLVER = defaultResolver;
|
|
119
|
+
COIN = coin;
|
|
120
|
+
governor = governor_;
|
|
121
|
+
feeTreasury = feeTreasury_;
|
|
122
|
+
base = base_;
|
|
123
|
+
multipliersX10 = multipliersX10_;
|
|
124
|
+
cap = cap_;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ── the price ───────────────────────────────────────────────────────────────────────────────────────────
|
|
128
|
+
|
|
129
|
+
/// @notice What `label` costs under this root: `min(cap, base × multiplier(length))`. Pure in the label.
|
|
130
|
+
function priceOf(string calldata label) public view returns (uint256) {
|
|
131
|
+
uint256 len = bytes(label).length;
|
|
132
|
+
if (len < MIN_LABEL_LENGTH) revert LabelTooShort();
|
|
133
|
+
uint256 x10 = len >= 8 ? 10 : multipliersX10[len - 3];
|
|
134
|
+
uint256 p = (base * x10) / 10;
|
|
135
|
+
return p > cap ? cap : p;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// ── the claim ───────────────────────────────────────────────────────────────────────────────────────────
|
|
139
|
+
|
|
140
|
+
/// @notice The EIP-712 digest a gate signs for `t`.
|
|
141
|
+
function ticketDigest(ClaimTicket calldata t) public view returns (bytes32) {
|
|
142
|
+
return _hashTypedDataV4(keccak256(abi.encode(
|
|
143
|
+
CLAIM_TICKET_TYPEHASH, t.parentNode, keccak256(bytes(t.label)), t.owner, t.payer, t.price, t.domain, t.expiry, t.nonce
|
|
144
|
+
)));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @notice Buy `<label>.<root>` for `t.owner`, paid by `msg.sender` (= `t.payer`) with a ticket a gate signed.
|
|
149
|
+
* Reverts when the ticket is for another root, expired, re-used, carries the wrong price, is signed by
|
|
150
|
+
* nobody the governor named, when the owner already holds a name here, or when the registry refuses
|
|
151
|
+
* (the label is taken).
|
|
152
|
+
*/
|
|
153
|
+
function claim(ClaimTicket calldata t, bytes calldata gateSig) external nonReentrant returns (bytes32 childNode) {
|
|
154
|
+
if (bytes(t.label).length == 0) revert EmptyLabel();
|
|
155
|
+
if (t.parentNode != PARENT_NODE) revert WrongRoot();
|
|
156
|
+
if (t.payer != msg.sender) revert NotPayer();
|
|
157
|
+
if (t.owner == address(0)) revert ZeroAddress();
|
|
158
|
+
if (block.timestamp > t.expiry) revert TicketExpired();
|
|
159
|
+
if (usedNonce[t.nonce]) revert NonceUsed();
|
|
160
|
+
uint256 price = priceOf(t.label);
|
|
161
|
+
if (t.price != price) revert WrongPrice(price);
|
|
162
|
+
bytes32 prior = claimedBy[t.owner];
|
|
163
|
+
if (prior != bytes32(0)) revert AlreadyClaimed(prior);
|
|
164
|
+
address signer = ECDSA.recover(ticketDigest(t), gateSig);
|
|
165
|
+
if (!gates[signer]) revert NotAGate(signer);
|
|
166
|
+
|
|
167
|
+
usedNonce[t.nonce] = true;
|
|
168
|
+
if (price > 0) COIN.safeTransferFrom(msg.sender, feeTreasury, price);
|
|
169
|
+
// The registry is an immutable contract we control and does not call back here; the guard holds anyway.
|
|
170
|
+
// slither-disable-next-line reentrancy-no-eth
|
|
171
|
+
childNode = REGISTRY.register(PARENT_NODE, t.label, t.owner, DEFAULT_RESOLVER, 0);
|
|
172
|
+
claimedBy[t.owner] = childNode;
|
|
173
|
+
paid[childNode] = price;
|
|
174
|
+
paidAt[childNode] = uint64(block.timestamp);
|
|
175
|
+
unchecked { claimCount += 1; }
|
|
176
|
+
emit NamePurchased(t.owner, msg.sender, childNode, t.label, price, t.domain);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function hasClaimed(address owner) external view returns (bool) {
|
|
180
|
+
return claimedBy[owner] != bytes32(0);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// ── governance ──────────────────────────────────────────────────────────────────────────────────────────
|
|
184
|
+
|
|
185
|
+
function setGate(address gate, bool allowed) external onlyGovernor {
|
|
186
|
+
if (gate == address(0)) revert ZeroAddress();
|
|
187
|
+
gates[gate] = allowed;
|
|
188
|
+
emit GateSet(gate, allowed);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function setFeeTreasury(address feeTreasury_) external onlyGovernor {
|
|
192
|
+
if (feeTreasury_ == address(0)) revert ZeroAddress();
|
|
193
|
+
feeTreasury = feeTreasury_;
|
|
194
|
+
emit FeeTreasurySet(feeTreasury_);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function setPriceTable(uint256 base_, uint16[5] calldata multipliersX10_, uint256 cap_) external onlyGovernor {
|
|
198
|
+
base = base_;
|
|
199
|
+
multipliersX10 = multipliersX10_;
|
|
200
|
+
cap = cap_;
|
|
201
|
+
emit PriceTableSet(base_, multipliersX10_, cap_);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function transferGovernor(address newGovernor) external onlyGovernor {
|
|
205
|
+
if (newGovernor == address(0)) revert ZeroAddress();
|
|
206
|
+
emit GovernorTransferred(governor, newGovernor);
|
|
207
|
+
governor = newGovernor;
|
|
208
|
+
}
|
|
209
|
+
}
|