@ayanworks/polygon-did-registry-contract 2.0.1-alpha.8 → 3.0.0
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/.env.sample +4 -3
- package/.openzeppelin/polygon.json +4 -4
- package/.openzeppelin/unknown-80002.json +4 -454
- package/README.md +19 -67
- package/package.json +1 -1
package/.env.sample
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"manifestVersion": "3.2",
|
|
3
3
|
"proxies": [
|
|
4
4
|
{
|
|
5
|
-
"address": "
|
|
6
|
-
"txHash": "
|
|
5
|
+
"address": "0x0C16958c4246271622201101C83B9F0Fc7180d15",
|
|
6
|
+
"txHash": "0xa14cd6a823161901ef272283a60b796d976cc56ac4e90073e7c39d071e4aa261",
|
|
7
7
|
"kind": "transparent"
|
|
8
8
|
}
|
|
9
9
|
],
|
|
10
10
|
"impls": {
|
|
11
11
|
"4ea697d213312244614a688367167de1e84d9fd58fa073c2461c24e28152def1": {
|
|
12
|
-
"address": "
|
|
13
|
-
"txHash": "
|
|
12
|
+
"address": "0xD084c9772Dc6F644Dbe1831d5039BF2e516AEfdc",
|
|
13
|
+
"txHash": "0x3e047df9361c0d6d64075007cd71d0137d61b9df07bb90d5a84db66d1d28b969",
|
|
14
14
|
"layout": {
|
|
15
15
|
"solcVersion": "0.8.16",
|
|
16
16
|
"storage": [
|
|
@@ -2,465 +2,15 @@
|
|
|
2
2
|
"manifestVersion": "3.2",
|
|
3
3
|
"proxies": [
|
|
4
4
|
{
|
|
5
|
-
"address": "
|
|
6
|
-
"txHash": "
|
|
7
|
-
"kind": "transparent"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"address": "0xC1c392DC1073a86821B4ae37f1F0faCDcFFf45bF",
|
|
11
|
-
"txHash": "0x82f79c38e7d6c943e76deb166a87515c32441708443abf1b410944fcb848a448",
|
|
12
|
-
"kind": "transparent"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"address": "0x8e8E732a564735C18b84F6d51f1F58599EE48211",
|
|
16
|
-
"txHash": "0x8e1bd9439bff5a69fa632d9801702adf9da77df2cd1c4d9aedc29dc520f28430",
|
|
17
|
-
"kind": "transparent"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"address": "0xD73D85F203bbE43f6541eF0177251A74fF151914",
|
|
21
|
-
"txHash": "0x004700259c28e402d7aa6727dec874a9bcd6faec651c9abadbe0b0f02fbdd72e",
|
|
22
|
-
"kind": "transparent"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"address": "0x1adeA199dCf07E17232415Cb232442BE52517Add",
|
|
26
|
-
"txHash": "0xd1591882691d2945fe906e6ffdc701155d8ae99860ede28dda4a0eca6019ae25",
|
|
5
|
+
"address": "0xcB80F37eDD2bE3570c6C9D5B0888614E04E1e49E",
|
|
6
|
+
"txHash": "0x4816779d34173119141afed8604b591eff112911a3b952273686436d9be03470",
|
|
27
7
|
"kind": "transparent"
|
|
28
8
|
}
|
|
29
9
|
],
|
|
30
10
|
"impls": {
|
|
31
|
-
"dadc513cd81ce3e765b05219a9f956799b5405d497cd25e1342ce5b4b08463df": {
|
|
32
|
-
"address": "0x7DcCBBaEcAED517AB8c283C70774676D4479c7C4",
|
|
33
|
-
"txHash": "0x95b06c40580baf441c23699fe4ebdefcb5916b4886e4e9846a0032fa8d6066d9",
|
|
34
|
-
"layout": {
|
|
35
|
-
"solcVersion": "0.8.16",
|
|
36
|
-
"storage": [
|
|
37
|
-
{
|
|
38
|
-
"label": "totalDIDs",
|
|
39
|
-
"offset": 0,
|
|
40
|
-
"slot": "0",
|
|
41
|
-
"type": "t_uint256",
|
|
42
|
-
"contract": "PolygonDidRegistry",
|
|
43
|
-
"src": "contracts/PolygonDidRegistry.sol:9"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"label": "owner",
|
|
47
|
-
"offset": 0,
|
|
48
|
-
"slot": "1",
|
|
49
|
-
"type": "t_address",
|
|
50
|
-
"contract": "PolygonDidRegistry",
|
|
51
|
-
"src": "contracts/PolygonDidRegistry.sol:10"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"label": "polyDIDs",
|
|
55
|
-
"offset": 0,
|
|
56
|
-
"slot": "2",
|
|
57
|
-
"type": "t_mapping(t_address,t_struct(PolyDID)48_storage)",
|
|
58
|
-
"contract": "PolygonDidRegistry",
|
|
59
|
-
"src": "contracts/PolygonDidRegistry.sol:25"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"label": "activeDIDs",
|
|
63
|
-
"offset": 0,
|
|
64
|
-
"slot": "3",
|
|
65
|
-
"type": "t_mapping(t_uint256,t_address)",
|
|
66
|
-
"contract": "PolygonDidRegistry",
|
|
67
|
-
"src": "contracts/PolygonDidRegistry.sol:26"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"label": "activeAddress",
|
|
71
|
-
"offset": 0,
|
|
72
|
-
"slot": "4",
|
|
73
|
-
"type": "t_mapping(t_address,t_uint256)",
|
|
74
|
-
"contract": "PolygonDidRegistry",
|
|
75
|
-
"src": "contracts/PolygonDidRegistry.sol:27"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"label": "resourceData",
|
|
79
|
-
"offset": 0,
|
|
80
|
-
"slot": "5",
|
|
81
|
-
"type": "t_mapping(t_address,t_mapping(t_string_memory_ptr,t_string_storage))",
|
|
82
|
-
"contract": "PolygonDidRegistry",
|
|
83
|
-
"src": "contracts/PolygonDidRegistry.sol:28"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"label": "keysById",
|
|
87
|
-
"offset": 0,
|
|
88
|
-
"slot": "6",
|
|
89
|
-
"type": "t_mapping(t_address,t_array(t_string_storage)dyn_storage)",
|
|
90
|
-
"contract": "PolygonDidRegistry",
|
|
91
|
-
"src": "contracts/PolygonDidRegistry.sol:29"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"label": "initialized",
|
|
95
|
-
"offset": 0,
|
|
96
|
-
"slot": "7",
|
|
97
|
-
"type": "t_bool",
|
|
98
|
-
"contract": "PolygonDidRegistry",
|
|
99
|
-
"src": "contracts/PolygonDidRegistry.sol:35"
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
"types": {
|
|
103
|
-
"t_address": {
|
|
104
|
-
"label": "address",
|
|
105
|
-
"numberOfBytes": "20"
|
|
106
|
-
},
|
|
107
|
-
"t_array(t_string_storage)dyn_storage": {
|
|
108
|
-
"label": "string[]",
|
|
109
|
-
"numberOfBytes": "32"
|
|
110
|
-
},
|
|
111
|
-
"t_bool": {
|
|
112
|
-
"label": "bool",
|
|
113
|
-
"numberOfBytes": "1"
|
|
114
|
-
},
|
|
115
|
-
"t_mapping(t_address,t_array(t_string_storage)dyn_storage)": {
|
|
116
|
-
"label": "mapping(address => string[])",
|
|
117
|
-
"numberOfBytes": "32"
|
|
118
|
-
},
|
|
119
|
-
"t_mapping(t_address,t_mapping(t_string_memory_ptr,t_string_storage))": {
|
|
120
|
-
"label": "mapping(address => mapping(string => string))",
|
|
121
|
-
"numberOfBytes": "32"
|
|
122
|
-
},
|
|
123
|
-
"t_mapping(t_address,t_struct(PolyDID)48_storage)": {
|
|
124
|
-
"label": "mapping(address => struct PolygonDidRegistry.PolyDID)",
|
|
125
|
-
"numberOfBytes": "32"
|
|
126
|
-
},
|
|
127
|
-
"t_mapping(t_address,t_uint256)": {
|
|
128
|
-
"label": "mapping(address => uint256)",
|
|
129
|
-
"numberOfBytes": "32"
|
|
130
|
-
},
|
|
131
|
-
"t_mapping(t_string_memory_ptr,t_string_storage)": {
|
|
132
|
-
"label": "mapping(string => string)",
|
|
133
|
-
"numberOfBytes": "32"
|
|
134
|
-
},
|
|
135
|
-
"t_mapping(t_uint256,t_address)": {
|
|
136
|
-
"label": "mapping(uint256 => address)",
|
|
137
|
-
"numberOfBytes": "32"
|
|
138
|
-
},
|
|
139
|
-
"t_string_memory_ptr": {
|
|
140
|
-
"label": "string",
|
|
141
|
-
"numberOfBytes": "32"
|
|
142
|
-
},
|
|
143
|
-
"t_string_storage": {
|
|
144
|
-
"label": "string",
|
|
145
|
-
"numberOfBytes": "32"
|
|
146
|
-
},
|
|
147
|
-
"t_struct(PolyDID)48_storage": {
|
|
148
|
-
"label": "struct PolygonDidRegistry.PolyDID",
|
|
149
|
-
"members": [
|
|
150
|
-
{
|
|
151
|
-
"label": "controller",
|
|
152
|
-
"type": "t_address",
|
|
153
|
-
"offset": 0,
|
|
154
|
-
"slot": "0"
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"label": "created",
|
|
158
|
-
"type": "t_uint256",
|
|
159
|
-
"offset": 0,
|
|
160
|
-
"slot": "1"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"label": "updated",
|
|
164
|
-
"type": "t_uint256",
|
|
165
|
-
"offset": 0,
|
|
166
|
-
"slot": "2"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"label": "didDoc",
|
|
170
|
-
"type": "t_string_storage",
|
|
171
|
-
"offset": 0,
|
|
172
|
-
"slot": "3"
|
|
173
|
-
}
|
|
174
|
-
],
|
|
175
|
-
"numberOfBytes": "128"
|
|
176
|
-
},
|
|
177
|
-
"t_uint256": {
|
|
178
|
-
"label": "uint256",
|
|
179
|
-
"numberOfBytes": "32"
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
"namespaces": {}
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
"c303544cc3632546a76b656533d155e9d46213d28204aec1815e9ce2006085c9": {
|
|
186
|
-
"address": "0x1c10e4CF0a8914cf2E632D2762085D8C61dB4cCb",
|
|
187
|
-
"txHash": "0x07b8b1055c4d182e564f941e6c255cf473ca91920131a254f1e00d2aeec9721c",
|
|
188
|
-
"layout": {
|
|
189
|
-
"solcVersion": "0.8.16",
|
|
190
|
-
"storage": [
|
|
191
|
-
{
|
|
192
|
-
"label": "totalDIDs",
|
|
193
|
-
"offset": 0,
|
|
194
|
-
"slot": "0",
|
|
195
|
-
"type": "t_uint256",
|
|
196
|
-
"contract": "PolygonDidRegistry",
|
|
197
|
-
"src": "contracts/PolygonDidRegistry.sol:9"
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
"label": "owner",
|
|
201
|
-
"offset": 0,
|
|
202
|
-
"slot": "1",
|
|
203
|
-
"type": "t_address",
|
|
204
|
-
"contract": "PolygonDidRegistry",
|
|
205
|
-
"src": "contracts/PolygonDidRegistry.sol:10"
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
"label": "polyDIDs",
|
|
209
|
-
"offset": 0,
|
|
210
|
-
"slot": "2",
|
|
211
|
-
"type": "t_mapping(t_address,t_struct(PolyDID)15_storage)",
|
|
212
|
-
"contract": "PolygonDidRegistry",
|
|
213
|
-
"src": "contracts/PolygonDidRegistry.sol:18"
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"label": "activeDIDs",
|
|
217
|
-
"offset": 0,
|
|
218
|
-
"slot": "3",
|
|
219
|
-
"type": "t_mapping(t_uint256,t_address)",
|
|
220
|
-
"contract": "PolygonDidRegistry",
|
|
221
|
-
"src": "contracts/PolygonDidRegistry.sol:19"
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
"label": "activeAddress",
|
|
225
|
-
"offset": 0,
|
|
226
|
-
"slot": "4",
|
|
227
|
-
"type": "t_mapping(t_address,t_uint256)",
|
|
228
|
-
"contract": "PolygonDidRegistry",
|
|
229
|
-
"src": "contracts/PolygonDidRegistry.sol:20"
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
"label": "resourceData",
|
|
233
|
-
"offset": 0,
|
|
234
|
-
"slot": "5",
|
|
235
|
-
"type": "t_mapping(t_address,t_mapping(t_string_memory_ptr,t_string_storage))",
|
|
236
|
-
"contract": "PolygonDidRegistry",
|
|
237
|
-
"src": "contracts/PolygonDidRegistry.sol:21"
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"label": "keysById",
|
|
241
|
-
"offset": 0,
|
|
242
|
-
"slot": "6",
|
|
243
|
-
"type": "t_mapping(t_address,t_array(t_string_storage)dyn_storage)",
|
|
244
|
-
"contract": "PolygonDidRegistry",
|
|
245
|
-
"src": "contracts/PolygonDidRegistry.sol:22"
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
"label": "initialized",
|
|
249
|
-
"offset": 0,
|
|
250
|
-
"slot": "7",
|
|
251
|
-
"type": "t_bool",
|
|
252
|
-
"contract": "PolygonDidRegistry",
|
|
253
|
-
"src": "contracts/PolygonDidRegistry.sol:32"
|
|
254
|
-
}
|
|
255
|
-
],
|
|
256
|
-
"types": {
|
|
257
|
-
"t_address": {
|
|
258
|
-
"label": "address",
|
|
259
|
-
"numberOfBytes": "20"
|
|
260
|
-
},
|
|
261
|
-
"t_array(t_string_storage)dyn_storage": {
|
|
262
|
-
"label": "string[]",
|
|
263
|
-
"numberOfBytes": "32"
|
|
264
|
-
},
|
|
265
|
-
"t_bool": {
|
|
266
|
-
"label": "bool",
|
|
267
|
-
"numberOfBytes": "1"
|
|
268
|
-
},
|
|
269
|
-
"t_mapping(t_address,t_array(t_string_storage)dyn_storage)": {
|
|
270
|
-
"label": "mapping(address => string[])",
|
|
271
|
-
"numberOfBytes": "32"
|
|
272
|
-
},
|
|
273
|
-
"t_mapping(t_address,t_mapping(t_string_memory_ptr,t_string_storage))": {
|
|
274
|
-
"label": "mapping(address => mapping(string => string))",
|
|
275
|
-
"numberOfBytes": "32"
|
|
276
|
-
},
|
|
277
|
-
"t_mapping(t_address,t_struct(PolyDID)15_storage)": {
|
|
278
|
-
"label": "mapping(address => struct PolygonDidRegistry.PolyDID)",
|
|
279
|
-
"numberOfBytes": "32"
|
|
280
|
-
},
|
|
281
|
-
"t_mapping(t_address,t_uint256)": {
|
|
282
|
-
"label": "mapping(address => uint256)",
|
|
283
|
-
"numberOfBytes": "32"
|
|
284
|
-
},
|
|
285
|
-
"t_mapping(t_string_memory_ptr,t_string_storage)": {
|
|
286
|
-
"label": "mapping(string => string)",
|
|
287
|
-
"numberOfBytes": "32"
|
|
288
|
-
},
|
|
289
|
-
"t_mapping(t_uint256,t_address)": {
|
|
290
|
-
"label": "mapping(uint256 => address)",
|
|
291
|
-
"numberOfBytes": "32"
|
|
292
|
-
},
|
|
293
|
-
"t_string_memory_ptr": {
|
|
294
|
-
"label": "string",
|
|
295
|
-
"numberOfBytes": "32"
|
|
296
|
-
},
|
|
297
|
-
"t_string_storage": {
|
|
298
|
-
"label": "string",
|
|
299
|
-
"numberOfBytes": "32"
|
|
300
|
-
},
|
|
301
|
-
"t_struct(PolyDID)15_storage": {
|
|
302
|
-
"label": "struct PolygonDidRegistry.PolyDID",
|
|
303
|
-
"members": [
|
|
304
|
-
{
|
|
305
|
-
"label": "controller",
|
|
306
|
-
"type": "t_address",
|
|
307
|
-
"offset": 0,
|
|
308
|
-
"slot": "0"
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
"label": "created",
|
|
312
|
-
"type": "t_uint256",
|
|
313
|
-
"offset": 0,
|
|
314
|
-
"slot": "1"
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
"label": "updated",
|
|
318
|
-
"type": "t_uint256",
|
|
319
|
-
"offset": 0,
|
|
320
|
-
"slot": "2"
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
"label": "didDoc",
|
|
324
|
-
"type": "t_string_storage",
|
|
325
|
-
"offset": 0,
|
|
326
|
-
"slot": "3"
|
|
327
|
-
}
|
|
328
|
-
],
|
|
329
|
-
"numberOfBytes": "128"
|
|
330
|
-
},
|
|
331
|
-
"t_uint256": {
|
|
332
|
-
"label": "uint256",
|
|
333
|
-
"numberOfBytes": "32"
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
"namespaces": {}
|
|
337
|
-
}
|
|
338
|
-
},
|
|
339
|
-
"75b86adb6471aac29a596c2ab95b6cc3ffb19eb6c1bc7aafd10402d4762a892a": {
|
|
340
|
-
"address": "0xddBC6C77E7AA2E220C845b365b3CF76455157aaF",
|
|
341
|
-
"txHash": "0x82c4ad2dac45630071255f9171e2fb01767ff4ddc85b7b59bab26029b7552532",
|
|
342
|
-
"layout": {
|
|
343
|
-
"solcVersion": "0.8.16",
|
|
344
|
-
"storage": [
|
|
345
|
-
{
|
|
346
|
-
"label": "owner",
|
|
347
|
-
"offset": 0,
|
|
348
|
-
"slot": "0",
|
|
349
|
-
"type": "t_address",
|
|
350
|
-
"contract": "PolygonDidRegistry",
|
|
351
|
-
"src": "contracts/PolygonDidRegistry.sol:9"
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
"label": "polyDIDs",
|
|
355
|
-
"offset": 0,
|
|
356
|
-
"slot": "1",
|
|
357
|
-
"type": "t_mapping(t_address,t_struct(PolyDID)13_storage)",
|
|
358
|
-
"contract": "PolygonDidRegistry",
|
|
359
|
-
"src": "contracts/PolygonDidRegistry.sol:17"
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
"label": "resourceData",
|
|
363
|
-
"offset": 0,
|
|
364
|
-
"slot": "2",
|
|
365
|
-
"type": "t_mapping(t_address,t_mapping(t_string_memory_ptr,t_string_storage))",
|
|
366
|
-
"contract": "PolygonDidRegistry",
|
|
367
|
-
"src": "contracts/PolygonDidRegistry.sol:18"
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
"label": "keysById",
|
|
371
|
-
"offset": 0,
|
|
372
|
-
"slot": "3",
|
|
373
|
-
"type": "t_mapping(t_address,t_array(t_string_storage)dyn_storage)",
|
|
374
|
-
"contract": "PolygonDidRegistry",
|
|
375
|
-
"src": "contracts/PolygonDidRegistry.sol:19"
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
"label": "initialized",
|
|
379
|
-
"offset": 0,
|
|
380
|
-
"slot": "4",
|
|
381
|
-
"type": "t_bool",
|
|
382
|
-
"contract": "PolygonDidRegistry",
|
|
383
|
-
"src": "contracts/PolygonDidRegistry.sol:29"
|
|
384
|
-
}
|
|
385
|
-
],
|
|
386
|
-
"types": {
|
|
387
|
-
"t_address": {
|
|
388
|
-
"label": "address",
|
|
389
|
-
"numberOfBytes": "20"
|
|
390
|
-
},
|
|
391
|
-
"t_array(t_string_storage)dyn_storage": {
|
|
392
|
-
"label": "string[]",
|
|
393
|
-
"numberOfBytes": "32"
|
|
394
|
-
},
|
|
395
|
-
"t_bool": {
|
|
396
|
-
"label": "bool",
|
|
397
|
-
"numberOfBytes": "1"
|
|
398
|
-
},
|
|
399
|
-
"t_mapping(t_address,t_array(t_string_storage)dyn_storage)": {
|
|
400
|
-
"label": "mapping(address => string[])",
|
|
401
|
-
"numberOfBytes": "32"
|
|
402
|
-
},
|
|
403
|
-
"t_mapping(t_address,t_mapping(t_string_memory_ptr,t_string_storage))": {
|
|
404
|
-
"label": "mapping(address => mapping(string => string))",
|
|
405
|
-
"numberOfBytes": "32"
|
|
406
|
-
},
|
|
407
|
-
"t_mapping(t_address,t_struct(PolyDID)13_storage)": {
|
|
408
|
-
"label": "mapping(address => struct PolygonDidRegistry.PolyDID)",
|
|
409
|
-
"numberOfBytes": "32"
|
|
410
|
-
},
|
|
411
|
-
"t_mapping(t_string_memory_ptr,t_string_storage)": {
|
|
412
|
-
"label": "mapping(string => string)",
|
|
413
|
-
"numberOfBytes": "32"
|
|
414
|
-
},
|
|
415
|
-
"t_string_memory_ptr": {
|
|
416
|
-
"label": "string",
|
|
417
|
-
"numberOfBytes": "32"
|
|
418
|
-
},
|
|
419
|
-
"t_string_storage": {
|
|
420
|
-
"label": "string",
|
|
421
|
-
"numberOfBytes": "32"
|
|
422
|
-
},
|
|
423
|
-
"t_struct(PolyDID)13_storage": {
|
|
424
|
-
"label": "struct PolygonDidRegistry.PolyDID",
|
|
425
|
-
"members": [
|
|
426
|
-
{
|
|
427
|
-
"label": "controller",
|
|
428
|
-
"type": "t_address",
|
|
429
|
-
"offset": 0,
|
|
430
|
-
"slot": "0"
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
"label": "created",
|
|
434
|
-
"type": "t_uint256",
|
|
435
|
-
"offset": 0,
|
|
436
|
-
"slot": "1"
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
"label": "updated",
|
|
440
|
-
"type": "t_uint256",
|
|
441
|
-
"offset": 0,
|
|
442
|
-
"slot": "2"
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
"label": "didDoc",
|
|
446
|
-
"type": "t_string_storage",
|
|
447
|
-
"offset": 0,
|
|
448
|
-
"slot": "3"
|
|
449
|
-
}
|
|
450
|
-
],
|
|
451
|
-
"numberOfBytes": "128"
|
|
452
|
-
},
|
|
453
|
-
"t_uint256": {
|
|
454
|
-
"label": "uint256",
|
|
455
|
-
"numberOfBytes": "32"
|
|
456
|
-
}
|
|
457
|
-
},
|
|
458
|
-
"namespaces": {}
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
11
|
"4ea697d213312244614a688367167de1e84d9fd58fa073c2461c24e28152def1": {
|
|
462
|
-
"address": "
|
|
463
|
-
"txHash": "
|
|
12
|
+
"address": "0x6203b92447BF0A3260e5Ee643b472B2D5BeD7Bb6",
|
|
13
|
+
"txHash": "0xd8abad4e72a8509796ca15095d591d2cb8e5751d7071bb2ca141537cfa9e0e4f",
|
|
464
14
|
"layout": {
|
|
465
15
|
"solcVersion": "0.8.16",
|
|
466
16
|
"storage": [
|
package/README.md
CHANGED
|
@@ -8,10 +8,10 @@ The Polygon registry contract acts as a public ledger, where the Polygon-Identit
|
|
|
8
8
|
|
|
9
9
|
## Contract Deployment
|
|
10
10
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
| Polygon Testnet |
|
|
11
|
+
| Network | ChainId | Registry Address |
|
|
12
|
+
| :--------------------: | :-----: | :----------------------------------------: |
|
|
13
|
+
| Polygon Mainnet | 137 | 0x0C16958c4246271622201101C83B9F0Fc7180d15 |
|
|
14
|
+
| Polygon Testnet (amoy) | 80002 | 0xcB80F37eDD2bE3570c6C9D5B0888614E04E1e49E |
|
|
15
15
|
|
|
16
16
|
## Methods
|
|
17
17
|
|
|
@@ -19,19 +19,17 @@ The Polygon registry contract acts as a public ledger, where the Polygon-Identit
|
|
|
19
19
|
|
|
20
20
|
- `updateDIDDoc(address, string)` : The method updateDID is included in contract, which will facilitate the controller, and only the controller of the did, to update the document if need arises. Though the Polygon DID method, defines how the DID doc is defined as per standards, and that can be resolved.
|
|
21
21
|
|
|
22
|
-
- `deleteDIDDoc(address)` : The method deleteDID is included in the contract, that only the controller of DID can access, to delete a particular DID from ledger.
|
|
23
|
-
|
|
24
22
|
- `getDIDDoc(address)` : The method getDID helps to resolve the DID document.
|
|
25
23
|
|
|
26
24
|
- `transferOwnership(address)` : The method transferOwnership, helps in transferring the ownership of contract to a new owner. Only the current owner can access this function.
|
|
27
25
|
|
|
28
26
|
- `getOwner()` : the method getOwner helps one to fetch the current owner of the contract.
|
|
29
27
|
|
|
30
|
-
- `
|
|
28
|
+
- `addResource(address, string, string)` : The addResource method allows the controller of a DID to add a linked resource to the DID document. This method ensures that only authorized controllers can add resources by requiring the caller to be the controller of the DID.
|
|
31
29
|
|
|
32
|
-
- `
|
|
30
|
+
- `getResource(address, string)` : The getResource method fetches a specific linked resource from the blockchain that is associated with a given DID document.
|
|
33
31
|
|
|
34
|
-
- `
|
|
32
|
+
- `getAllResources(address)` : The getAllResources method retrieves all resources linked to a specific DID document. This provides a comprehensive list of all resources associated with a given DID.
|
|
35
33
|
|
|
36
34
|
## Example ethers code
|
|
37
35
|
|
|
@@ -41,7 +39,7 @@ Using ethers, the following illustrates how one can interact with PolygonRegistr
|
|
|
41
39
|
|
|
42
40
|
```
|
|
43
41
|
const ethers = require('ethers');
|
|
44
|
-
const url = https://rpc-
|
|
42
|
+
const url = https://rpc-amoy.polygon.technology; // For amoy testnet
|
|
45
43
|
const DID_ADDRESS = `<Contract Address>`;
|
|
46
44
|
const provider = new ethers.providers.JsonRpcProvider(url);
|
|
47
45
|
|
|
@@ -49,85 +47,41 @@ let wallet = new ethers.Wallet(`<Signer Key/Private Key>`, provider);
|
|
|
49
47
|
let registry = new ethers.Contract(DID_ADDRESS, <Contract ABI>, wallet);
|
|
50
48
|
```
|
|
51
49
|
|
|
52
|
-
## Creating a DID
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
let returnHashValues = await registry.functions.createDID(<DID address>, DidDoc);
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Updating a DID
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
let returnHashValues = await registry.functions.updateDIDDoc(<DID address>, DidDoc)
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Delete a DID
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
let returnHashValues = await registry.functions.deleteDIDDoc(<DID address>)
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Resolving a DID
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
let returnDidDoc = await registry.functions.getDIDDoc(<DID address>);
|
|
74
|
-
```
|
|
75
|
-
|
|
76
50
|
# Deploying the Contract on Matic network
|
|
77
51
|
|
|
78
52
|
Pre-requisites
|
|
79
53
|
|
|
80
|
-
- NodeJS
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
https://nodejs.org/en/download/
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
- Truffle
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
https://www.trufflesuite.com/docs/truffle/getting-started/truffle-with-metamask
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
- Ganache
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
https://www.trufflesuite.com/ganache
|
|
96
|
-
```
|
|
97
|
-
|
|
54
|
+
- NodeJS - https://nodejs.org/en/download/
|
|
55
|
+
- Hardhat - https://hardhat.org
|
|
98
56
|
- A wallet connected to polygon network, with Matic token in it. One can receive the Matic Test Tokens from their faucet.
|
|
99
57
|
|
|
100
58
|
## Deployment
|
|
101
59
|
|
|
102
|
-
Clone the
|
|
60
|
+
Clone the repository
|
|
103
61
|
|
|
104
62
|
```
|
|
105
|
-
git clone https://
|
|
63
|
+
git clone https://github.com/ayanworks/polygon-did-registry-contract.git
|
|
106
64
|
```
|
|
107
65
|
|
|
108
66
|
Install Dependencies
|
|
109
67
|
|
|
110
68
|
```
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Run a ganache instance (only required for Local Deployment)
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
ganache-cli
|
|
69
|
+
pnpm i
|
|
118
70
|
```
|
|
119
71
|
|
|
120
72
|
Update your and RPC URL in .env file.
|
|
121
73
|
|
|
122
74
|
```
|
|
123
|
-
|
|
124
|
-
|
|
75
|
+
MAINNET_RPCURL="<Place your Mainnet RPC URL here>"
|
|
76
|
+
AMOY_RPCURL="<Place your Amoy RPC URL here>"
|
|
77
|
+
SIGNER_TESTNET="<Place your Testnet Signer Key here>"
|
|
78
|
+
SIGNER_MAINNET="<Place your Mainnet Signer Key here>"
|
|
125
79
|
```
|
|
126
80
|
|
|
127
81
|
On a new console window run
|
|
128
82
|
|
|
129
83
|
```
|
|
130
|
-
|
|
84
|
+
npx hardhat run deploy --network <network name>
|
|
131
85
|
```
|
|
132
86
|
|
|
133
87
|
## Testing
|
|
@@ -135,7 +89,5 @@ truffle migrate --network <network name>
|
|
|
135
89
|
For Testing use the command
|
|
136
90
|
|
|
137
91
|
```
|
|
138
|
-
|
|
92
|
+
pnpm test
|
|
139
93
|
```
|
|
140
|
-
|
|
141
|
-
The test cases run on a ganache setup.
|