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

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

setConnectModule

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

changeDelegatedExecutorsConfig

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

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

setProfileImageURI

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

connectProfile

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

disconnectProfile

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

isConnecting

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

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

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

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

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

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

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

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

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

Initalised an new application on Bond.

Last updated