IDataPointRegistry
Interface defines functions to manage creation, transfer and access control of DataPoints
In order to prevent locked-ether in allocate(), it is recommended to add a method to withdraw native coin balance.
CounterOverflow
Error thrown when DataPoint allocation counter overflows
NativeCoinDepositIsNotAccepted
Error thrown when native coin is sent in allocation
InvalidOwnerAddress
Error thrown when address passed is not a valid address
Parameters
Name | Type | Description |
---|---|---|
owner | address | Invalid owner |
InvalidDataPointOwner
Error thrown when caller is not the owner of the DataPoint
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
owner | address | Invalid owner |
DataPointAllocated
Event emitted when a DataPoint is allocated
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
owner | address | Owner of the DataPoint |
DataPointOwnershipTransferred
Event emitted when ownership of a DataPoint is transferred
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
previousOwner | address | Previous owner |
newOwner | address | New owner |
DataPointAdminGranted
Event emitted when Admin role is granted
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
account | address | Account granted with Admin role |
DataPointAdminRevoked
Event emitted when Admin role is revoked
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
account | address | Account revoked from Admin role |
isAdmin
Verifies if an address has an Admin role for a DataPoint
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint |
account | address | Account to verify |
allocate
Allocates a DataPoint to an owner
Owner SHOULD be granted Admin role during allocation
Parameters
Name | Type | Description |
---|---|---|
owner | address | Owner of the new DataPoint |
transferOwnership
Transfers ownership of a DataPoint to a new owner
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
newOwner | address | New owner |
grantAdminRole
Grant permission to grant/revoke other roles on the DataPoint inside an Data Index Implementation This is useful if DataManagers are deployed during lifecycle of the application
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
account | address | New admin |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | If the role was granted (otherwise account already had the role) |
revokeAdminRole
Revoke permission to grant/revoke other roles on the DataPoint inside an Data Index Implementation
If an owner revokes Admin role from himself, he can add it again
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
account | address | Old admin |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | If the role was revoked (otherwise account didn't had the role) |