Integrating with the Project Registry
There are two ways to interact with the Project Registry.
- Through the
Registry.sol
contract - Through the Indexer
Writing to the Project Registry
Create a Profile
Creating a profile is required to create a pool. Some pools may also require
recipients or allocators to have a profile.
createProfile
will return a profileId
type bytes32
. This value will be needed for
future calls to the registry.
createProfile(nonce, name, metadata, signer.address, []);
Parameters
name | data type | notes |
---|---|---|
_nonce | uint256 | nonce is used to create the profile profileId. By providing a nonce projects can ensure having the same id across chains. |
_name | string | The profile name. This is used to generate the anchor. |
_metadata | Metadata | See the metadata section below for more details. |
_owner | address | The owner of the profile. See Roles for more details about profile owners. |
_members | address[] | Array of profile member address. Roles for more details about profile members. |
Metadata
Offchain metadata can be stored in the project registry using the Metadata struct.
struct Metadata {
uint256 protocol;
string pointer;
}
Field | Data Type | Notes |
---|---|---|
protocol | uint256 | An id from the list of available protocols. |
pointer | string | The pointer to the off chain data. |
Currently, the only protocol id available is '1' for IPFS. Others may be added later.
Updating a Profile
addMembers
Adds member addresses to the members array. Only the profile owner can add members.
addMembers(profileId, members)
Field | Data Type | Notes |
---|---|---|
profileId | bytes32 | The id of the profile to update. |
members | address[] | Array of member address(es) to add. |
removeMembers
Removes member addresses to the members array.
Only the profile owner can remove members.
removeMembers(profileId, members)
Field | Data Type | Notes |
---|---|---|
profileId | bytes32 | The id of the profile to update. |
members | address[] | Array of member address(es) to remove. |
updateProfileMetadata
Will overwrite the existing profile metadata. Only the owner can update profile metadata.
updateProfileMetadata(profileId, metadata)
Field | Data Type | Notes |
---|---|---|
profileId | bytes32 | The id of the profile to update. |
metadata | Metadata | Metadata to add to the profile. |
updateProfileName
Will set a new name for the profile. Only the owner can update profile metadata. This action will create a new anchorId.
updateProfileName(profileId, name)
Field | Data Type | Notes |
---|---|---|
profileId | bytes32 | The id of the profile to update. |
name | string | New name for the profile. |
updateProfilePendingOwner
Will set a new pending owner. The pending owner will need to call
acceptProfileOwnership
in order for the ownership transfer to be complete.
Only the profile owner can set a pending owner.
updateProfilePendingOwner(profileId, pendingOwner)
Field | Data Type | Notes |
---|---|---|
profileId | bytes32 | The id of the profile to update. |
pendingOwner | address | The address for the new profile owner. |
Reading Project Registry Data Using Indexer
Project registry data is publicly available through Indexer. See the Indexer Project page.