@ayanworks/polygon-did-registry-contract 0.0.1 → 1.1.1
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 +2 -0
- package/README.md +11 -12
- package/build/contracts/Migrations.json +1508 -515
- package/build/contracts/PolygonDidRegistry.json +10586 -4949
- package/contracts/PolygonDidRegistry.sol +48 -7
- package/migrations/2_deploy_contract.js +5 -2
- package/package.json +20 -10
- package/sst-config.json +1 -1
- package/test/polygon_did_registry_test.js +322 -17
- package/truffle-config.js +49 -107
package/.env.sample
ADDED
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Polygon
|
|
1
|
+
# Polygon DID Registry Contract
|
|
2
2
|
|
|
3
3
|
This library is an implementation of a registry contract that supports the Polygon DID Method.
|
|
4
4
|
|
|
@@ -12,10 +12,14 @@ The Polygon registry contract acts as a public ledger, where the Polygon-Identit
|
|
|
12
12
|
|
|
13
13
|
* updateDID(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.
|
|
14
14
|
|
|
15
|
-
* deleteDID(address) : The method deleteDID is included in the contract, that only the controller of DID can access, to delete a particular DID from
|
|
15
|
+
* deleteDID(address) : The method deleteDID is included in the contract, that only the controller of DID can access, to delete a particular DID from ledger.
|
|
16
16
|
|
|
17
17
|
* getDID(address) : The method getDID helps, the DID controller to resolve the DID document.
|
|
18
18
|
|
|
19
|
+
* transferOwnership(address) : The method transferOwnership, helps in transferring the ownership of contract to a new owner. Only the current owner can access this function.
|
|
20
|
+
|
|
21
|
+
* getOwner() : the method getOwner helps one to fetch the current owner of the contract.
|
|
22
|
+
|
|
19
23
|
## Example ethers code
|
|
20
24
|
|
|
21
25
|
Using ethers, the following illustrates how one can interact with PolygonRegistry contract, from client side application.
|
|
@@ -96,10 +100,11 @@ Run a ganache instance
|
|
|
96
100
|
ganache-cli
|
|
97
101
|
```
|
|
98
102
|
|
|
99
|
-
Update your
|
|
103
|
+
Update your and RPC URL in .env file.
|
|
100
104
|
|
|
101
105
|
```
|
|
102
|
-
|
|
106
|
+
RPC_URL="<Place your mnemonic here>"
|
|
107
|
+
MNEMONIC="<Place your mnemonic here>"
|
|
103
108
|
```
|
|
104
109
|
|
|
105
110
|
On a new console window run
|
|
@@ -113,13 +118,7 @@ truffle migrate --network matic
|
|
|
113
118
|
For Testing use the command
|
|
114
119
|
|
|
115
120
|
```
|
|
116
|
-
|
|
121
|
+
truffle test
|
|
117
122
|
```
|
|
118
|
-
|
|
119
|
-
Next, run
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
npm run test
|
|
123
|
-
```
|
|
124
|
-
|
|
123
|
+
The test cases run on a ganache setup.
|
|
125
124
|
|