DocumentRegistry
Inherits: ContextUpgradeable, HubOwnableUUPSUpgradeable, IDocumentRegistry
Author: Daniel Yamagata & Jerry Qi
A registry that keeps track of documents for departments and treasuries
ContextUpgradeable's _msgSender() is used instead of msg.sender to support gas relayers in the future if needed Document indices and versions are indexed at zero
State Variables
DocumentRegistryStorageLocation
Functions
_getDocumentRegistryStorage
constructor
addDocument
Adds a document to the registry for the caller
This function is not access controlled: any account can add a document to the registry if desired
Returns
Name | Type | Description |
---|---|---|
|
| The document index, which is incremented sequentially for the caller |
updateDocument
Updates the document associated with 'documentIndex' in the registry for the caller
This function will revert if the 'documentIndex' is invalid
Parameters
Name | Type | Description |
---|---|---|
|
| The index of the document to update |
|
| The updated name of the document |
|
| The updated URI of the document |
Returns
Name | Type | Description |
---|---|---|
|
| The version of the document, which is incremented sequentially upon each update |
getLatestDocuments
Returns all of the latest documents associated with an 'owner'
Parameters
Name | Type | Description |
---|---|---|
|
| The owner of the documents |
Returns
Name | Type | Description |
---|---|---|
|
| A list of documents as a 'DataTypes.Document' array |
getLatestDocumentByIndex
Returns the latest document given an 'owner' and 'documentIndex'
getDocumentByVersion
Returns a document given an 'owner', 'documentIndex', and 'documentVersion'
This function will revert if the document does not exist
Parameters
Name | Type | Description |
---|---|---|
|
| The owner of the document |
|
| The index of the document |
|
| The version of the document |
Returns
Name | Type | Description |
---|---|---|
|
| The document as a 'DataTypes.Document' struct |
_validateDocumentExistence
Validates that the document exists, reverts if it does not
Structs
DocumentRegistryStorage
Last updated