@oceanprotocol/keeper-contracts
Version:
Integration of SEAs, DID and OceanToken in Solidity
122 lines (97 loc) • 2.94 kB
Markdown
# library: DIDRegistryLibrary
Documentation:
```
DID Registry Library
Ocean Protocol Team
* All function calls are currently implemented without side effects
```
## Structs
### public DIDRegister
Members:
* address owner
* bytes32 lastChecksum
* address lastUpdatedBy
* uint256 blockNumberUpdated
* address[] providers
### public DIDRegisterList
Members:
* mapping(bytes32 => struct DIDRegistryLibrary.DIDRegister) didRegisters
* bytes32[] didRegisterIds
## Functions
### external update
Documentation:
```
update the DID store
access modifiers and storage pointer should be implemented in DIDRegistry
_self refers to storage pointer
_did refers to decentralized identifier (a byte32 length ID)
_checksum includes a one-way HASH calculated using the DDO content
```
Parameters:
* struct DIDRegistryLibrary.DIDRegisterList _self
* bytes32 _did
* bytes32 _checksum
### internal addProvider
Documentation:
```
addProvider add provider to DID registry
update the DID registry providers list by adding a new provider
_self refers to storage pointer
_did refers to decentralized identifier (a byte32 length ID)
provider the provider's address
```
Parameters:
* struct DIDRegistryLibrary.DIDRegisterList _self
* bytes32 _did
* address provider
### internal removeProvider
Documentation:
```
removeProvider remove provider from DID registry
update the DID registry providers list by removing an existing provider
_self refers to storage pointer
_did refers to decentralized identifier (a byte32 length ID)
_provider the provider's address
```
Parameters:
* struct DIDRegistryLibrary.DIDRegisterList _self
* bytes32 _did
* address _provider
### internal updateDIDOwner
Documentation:
```
updateDIDOwner transfer DID ownership to a new owner
_self refers to storage pointer
_did refers to decentralized identifier (a byte32 length ID)
_newOwner the new DID owner address
```
Parameters:
* struct DIDRegistryLibrary.DIDRegisterList _self
* bytes32 _did
* address _newOwner
### public isProvider
Documentation:
```
isProvider check whether DID provider exists
_self refers to storage pointer
_did refers to decentralized identifier (a byte32 length ID)
_provider the provider's address
true if the provider already exists
```
Parameters:
* struct DIDRegistryLibrary.DIDRegisterList _self
* bytes32 _did
* address _provider
### private getProviderIndex
Documentation:
```
getProviderIndex get the index of a provider
_self refers to storage pointer
_did refers to decentralized identifier (a byte32 length ID)
provider the provider's address
the index if the provider exists otherwise return -1
```
Parameters:
* struct DIDRegistryLibrary.DIDRegisterList _self
* bytes32 _did
* address provider