ODC

DataPointRegistry

Contract for managing the creation, transfer and access control of DataPoints

DPAccessData

DataPoint access data

Parameters

NameTypeDescription
struct DPAccessData {
  address owner;
  struct EnumerableSet.AddressSet admins;
}

isAdmin

function isAdmin(DataPoint dp, address account) public 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)

On this page