BondHub

This is the main entry point of the Bond Protocol. It contains governance functionality as well as connecting and profile interaction functionality.

constructor

constructor(address connectNFTImpl, uint256 tokenGuardianCooldown) public

The constructor sets the immutable connect NFT implementations.

initialize

function initialize(string name, string symbol, address newGovernance) external

getRevision

function getRevision() public pure virtual returns (uint256)

returns the revision number of the contract Needs to be defined in the inherited class as a constant.

onlyProfileOwnerOrDelegatedExecutor

modifier onlyProfileOwnerOrDelegatedExecutor(address expectedOwnerOrDelegatedExecutor, uint256 profileId)

createProfile

function createProfile(struct Types.CreateProfileParams createProfileParams) external returns (uint256)

Creates a profile with the specified parameters, minting a Profile NFT to the given recipient.

Parameters

Name
Type
Description

createProfileParams

struct Types.CreateProfileParams

A CreateProfileParams struct containing the needed params.

setProfileMetadataURI

function setProfileMetadataURI(uint256 profileId, string metadataURI) external

Sets the metadata URI for the given profile.

Parameters

Name
Type
Description

profileId

uint256

The token ID of the profile to set the metadata URI for.

metadataURI

string

The metadata URI to set for the given profile.

setProfileMetadataURIWithSig

function setProfileMetadataURIWithSig(uint256 profileId, string metadataURI, struct Types.EIP712Signature signature) external

setConnectModule

function setConnectModule(uint256 profileId, address connectModule, bytes connectModuleInitData) external

Sets the connect module for the given profile.

Parameters

Name
Type
Description

profileId

uint256

The token ID of the profile to set the connect module for.

connectModule

address

The connect module to set for the given profile, must be whitelisted.

connectModuleInitData

bytes

The data to be passed to the connect module for initialization.

setConnectModuleWithSig

function setConnectModuleWithSig(uint256 profileId, address connectModule, bytes connectModuleInitData, struct Types.EIP712Signature signature) external

changeDelegatedExecutorsConfig

function changeDelegatedExecutorsConfig(uint256 delegatorProfileId, address[] delegatedExecutors, bool[] approvals, uint64 configNumber, bool switchToGivenConfig) external

Changes the delegated executors configuration for the given profile. It allows setting the approvals for delegated executors in the specified configuration, as well as switching to it.

Parameters

Name
Type
Description

delegatorProfileId

uint256

The ID of the profile to which the delegated executor is being changed for.

delegatedExecutors

address[]

The array of delegated executors to set the approval for.

approvals

bool[]

The array of booleans indicating the corresponding executor's new approval status.

configNumber

uint64

The number of the configuration where the executor approval state is being set.

switchToGivenConfig

bool

A boolean indicating if the configuration must be switched to the one with the given number.

changeDelegatedExecutorsConfig

function changeDelegatedExecutorsConfig(uint256 delegatorProfileId, address[] delegatedExecutors, bool[] approvals) external

Changes the delegated executors configuration for the given profile under the current configuration.

Parameters

Name
Type
Description

delegatorProfileId

uint256

The ID of the profile to which the delegated executor is being changed for.

delegatedExecutors

address[]

The array of delegated executors to set the approval for.

approvals

bool[]

The array of booleans indicating the corresponding executor's new approval status.

changeDelegatedExecutorsConfigWithSig

function changeDelegatedExecutorsConfigWithSig(uint256 delegatorProfileId, address[] delegatedExecutors, bool[] approvals, uint64 configNumber, bool switchToGivenConfig, struct Types.EIP712Signature signature) external

setProfileImageURI

function setProfileImageURI(uint256 profileId, string imageURI) external

Sets a profile's image URI, which is reflected in the tokenURI() function.

Parameters

Name
Type
Description

profileId

uint256

The token ID of the profile to set the URI for.

imageURI

string

The URI to set for the given profile.

setProfileImageURIWithSig

function setProfileImageURIWithSig(uint256 profileId, string imageURI, struct Types.EIP712Signature signature) external

connectProfile

function connectProfile(uint256 connectorProfileId, enum Types.ConnectType connectType, uint256[] idsOfProfilesToConnect, bytes[] datas) external returns (uint256[])

Connects given profiles, executing each profile's connect module logic (if any).

Both the idsOfProfilesToConnect, connectTokenIds, and datas arrays must be of the same length, regardless if the profiles do not have a connect module set.

Parameters

Name
Type
Description

connectorProfileId

uint256

The ID of the profile the connects are being executed for.

connectType

enum Types.ConnectType

idsOfProfilesToConnect

uint256[]

The array of IDs of profiles to connect.

datas

bytes[]

The arbitrary data array to pass to the connect module for each profile if needed.

Return Values

Name
Type
Description

[0]

uint256[]

uint256[] An array of connect token IDs representing the connect tokens created for each connect.

connectProfileWithSig

function connectProfileWithSig(uint256 connectorProfileId, enum Types.ConnectType connectType, uint256[] idsOfProfilesToConnect, bytes[] datas, struct Types.EIP712Signature signature) external returns (uint256[])

disconnectProfile

function disconnectProfile(uint256 disconnectorProfileId, enum Types.ConnectType connectType, uint256[] idsOfProfilesToDisconnect) external

disconnects given profiles.

Parameters

Name
Type
Description

disconnectorProfileId

uint256

The ID of the profile the unconnects are being executed for.

connectType

enum Types.ConnectType

The Type of connection.

idsOfProfilesToDisconnect

uint256[]

The array of IDs of profiles to unconnect.

disconnectProfileWithSig

function disconnectProfileWithSig(uint256 disconnectorProfileId, enum Types.ConnectType connectType, uint256[] idsOfProfilesToDisconnect, struct Types.EIP712Signature signature) external

isConnecting

function isConnecting(uint256 connectorProfileId, enum Types.ConnectType connectType, uint256 connectedProfileId) external view returns (bool)

Returns whether or not connecterProfileId is connecting connectedProfileId.

Parameters

Name
Type
Description

connectorProfileId

uint256

The ID of the profile whose connecting state should be queried.

connectType

enum Types.ConnectType

The type of Connect .

connectedProfileId

uint256

The ID of the profile whose connected state should be queried.

Return Values

Name
Type
Description

[0]

bool

bool True if connecterProfileId is connecting connectedProfileId, false otherwise.

isDelegatedExecutorApproved

function isDelegatedExecutorApproved(uint256 delegatorProfileId, address delegatedExecutor, uint64 configNumber) external view returns (bool)

Returns whether the given address is approved as delegated executor, in the configuration with the given number, to act on behalf of the given profile.

Parameters

Name
Type
Description

delegatorProfileId

uint256

The ID of the profile to check the delegated executor approval for.

delegatedExecutor

address

The address to query the delegated executor approval for.

configNumber

uint64

The number of the configuration where the executor approval state is being queried.

Return Values

Name
Type
Description

[0]

bool

bool True if the address is approved as a delegated executor to act on behalf of the profile in the given configuration, false otherwise.

isDelegatedExecutorApproved

function isDelegatedExecutorApproved(uint256 delegatorProfileId, address delegatedExecutor) external view returns (bool)

Returns whether the given address is approved as delegated executor, in the current configuration, to act on behalf of the given profile.

Parameters

Name
Type
Description

delegatorProfileId

uint256

The ID of the profile to check the delegated executor approval for.

delegatedExecutor

address

The address to query the delegated executor approval for.

Return Values

Name
Type
Description

[0]

bool

bool True if the address is approved as a delegated executor to act on behalf of the profile in the current configuration, false otherwise.

getDelegatedExecutorsConfigNumber

function getDelegatedExecutorsConfigNumber(uint256 delegatorProfileId) external view returns (uint64)

Returns the current delegated executor config number for the given profile.

Parameters

Name
Type
Description

delegatorProfileId

uint256

The ID of the profile from which the delegated executors config number is being queried

Return Values

Name
Type
Description

[0]

uint64

uint256 The current delegated executor configuration number.

getDelegatedExecutorsPrevConfigNumber

function getDelegatedExecutorsPrevConfigNumber(uint256 delegatorProfileId) external view returns (uint64)

Returns the previous used delegated executor config number for the given profile.

Parameters

Name
Type
Description

delegatorProfileId

uint256

The ID of the profile from which the delegated executors' previous configuration number set is being queried.

Return Values

Name
Type
Description

[0]

uint64

uint256 The delegated executor configuration number previously set. It will coincide with the current configuration set if it was never switched from the default one.

getDelegatedExecutorsMaxConfigNumberSet

function getDelegatedExecutorsMaxConfigNumberSet(uint256 delegatorProfileId) external view returns (uint64)

Returns the maximum delegated executor config number for the given profile. This is the maximum config number that was ever used by this profile. When creating a new clean configuration, you can only use a number that is maxConfigNumber + 1.

Parameters

Name
Type
Description

delegatorProfileId

uint256

The ID of the profile from which the delegated executors' maximum configuration number set is being queried.

Return Values

Name
Type
Description

[0]

uint64

uint256 The delegated executor maximum configuration number set.

getProfile

function getProfile(uint256 profileId) external pure returns (struct Types.Profile)

Returns the full profile struct associated with a given profile token ID.

Parameters

Name
Type
Description

profileId

uint256

The token ID of the profile to query.

Return Values

Name
Type
Description

[0]

struct Types.Profile

Profile The profile struct of the given profile.

getProfileIdByHandle

function getProfileIdByHandle(string handle) external view returns (uint256)

Returns the profile token ID according to a given handle.

Parameters

Name
Type
Description

handle

string

The handle to resolve the profile token ID with.

Return Values

Name
Type
Description

[0]

uint256

uint256 The profile ID the passed handle points to.

getConnectNFT

function getConnectNFT(uint256 connectedProfileId, enum Types.ConnectType connectType) external view returns (address)

Returns the connectNFT associated with a given profile, if any.

Parameters

Name
Type
Description

connectedProfileId

uint256

The token ID of the profile to query the connectNFT for.

connectType

enum Types.ConnectType

The type of Connect .

Return Values

Name
Type
Description

[0]

address

address The connectNFT associated with the given profile.

initApplication

function initApplication(address ownerAddress, string id) external returns (address, address)

Initalised an new application on Bond.

Last updated