ODCinterfacesdataIndex

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 CounterOverflow()

Error thrown when DataPoint allocation counter overflows

NativeCoinDepositIsNotAccepted

error NativeCoinDepositIsNotAccepted()

Error thrown when native coin is sent in allocation

InvalidOwnerAddress

error InvalidOwnerAddress(address owner)

Error thrown when address passed is not a valid address

Parameters

NameTypeDescription
owneraddressInvalid owner

InvalidDataPointOwner

error InvalidDataPointOwner(DataPoint dp, address owner)

Error thrown when caller is not the owner of the DataPoint

Parameters

NameTypeDescription
dpDataPointDataPoint identifier
owneraddressInvalid owner

DataPointAllocated

event DataPointAllocated(DataPoint dp, address owner)

Event emitted when a DataPoint is allocated

Parameters

NameTypeDescription
dpDataPointDataPoint identifier
owneraddressOwner of the DataPoint

DataPointOwnershipTransferred

event DataPointOwnershipTransferred(DataPoint dp, address previousOwner, address newOwner)

Event emitted when ownership of a DataPoint is transferred

Parameters

NameTypeDescription
dpDataPointDataPoint identifier
previousOwneraddressPrevious owner
newOwneraddressNew owner

DataPointAdminGranted

event DataPointAdminGranted(DataPoint dp, address account)

Event emitted when Admin role is granted

Parameters

NameTypeDescription
dpDataPointDataPoint identifier
accountaddressAccount granted with Admin role

DataPointAdminRevoked

event DataPointAdminRevoked(DataPoint dp, address account)

Event emitted when Admin role is revoked

Parameters

NameTypeDescription
dpDataPointDataPoint identifier
accountaddressAccount revoked from Admin role

isAdmin

function isAdmin(DataPoint dp, address account) external view returns (bool)

Verifies if an address has an Admin role for a DataPoint

Parameters

NameTypeDescription
dpDataPointDataPoint
accountaddressAccount to verify

allocate

function allocate(address owner) external payable returns (DataPoint)

Allocates a DataPoint to an owner

Owner SHOULD be granted Admin role during allocation

Parameters

NameTypeDescription
owneraddressOwner of the new DataPoint

transferOwnership

function transferOwnership(DataPoint dp, address newOwner) external

Transfers ownership of a DataPoint to a new owner

Parameters

NameTypeDescription
dpDataPointDataPoint identifier
newOwneraddressNew owner

grantAdminRole

function grantAdminRole(DataPoint dp, address account) external returns (bool)

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

NameTypeDescription
dpDataPointDataPoint identifier
accountaddressNew admin

Return Values

NameTypeDescription
[0]boolIf the role was granted (otherwise account already had the role)

revokeAdminRole

function revokeAdminRole(DataPoint dp, address account) external returns (bool)

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

NameTypeDescription
dpDataPointDataPoint identifier
accountaddressOld admin

Return Values

NameTypeDescription
[0]boolIf the role was revoked (otherwise account didn't had the role)