ProfileLib

Git Source

Functions

MODULE_REGISTRY

function MODULE_REGISTRY() internal view returns (IModuleRegistry);

ownerOf

function ownerOf(uint256 profileId) internal view returns (address);

exists

function exists(uint256 profileId) internal view returns (bool);

createProfile

Creates a profile with the given parameters to the given address. Minting happens in the hub.

function createProfile(Types.CreateProfileParams calldata createProfileParams, uint256 profileId) external;

Parameters

NameTypeDescription
createProfileParamsTypes.CreateProfileParamsThe CreateProfileParams struct containing the following parameters: to: The address receiving the profile. followModule: The follow module to use, can be the zero address. followModuleInitData: The follow module initialization data, if any
profileIduint256The profile ID to associate with this profile NFT (token ID).

setFollowModule

Sets the follow module for a given profile.

function setFollowModule(
    uint256 profileId,
    address followModule,
    bytes calldata followModuleInitData,
    address transactionExecutor
) external;

Parameters

NameTypeDescription
profileIduint256The profile ID to set the follow module for.
followModuleaddressThe follow module to set for the given profile, if any.
followModuleInitDatabytesThe data to pass to the follow module for profile initialization.
transactionExecutoraddress

setProfileMetadataURI

function setProfileMetadataURI(uint256 profileId, string calldata metadataURI, address transactionExecutor) external;

_initFollowModule

function _initFollowModule(
    uint256 profileId,
    address transactionExecutor,
    address followModule,
    bytes memory followModuleInitData
) private returns (bytes memory);

setBlockStatus

function setBlockStatus(
    uint256 byProfileId,
    uint256[] calldata idsOfProfilesToSetBlockStatus,
    bool[] calldata blockStatus,
    address transactionExecutor
) external;

switchToNewFreshDelegatedExecutorsConfig

function switchToNewFreshDelegatedExecutorsConfig(uint256 profileId) external;

changeDelegatedExecutorsConfig

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

changeGivenDelegatedExecutorsConfig

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

isExecutorApproved

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

_changeDelegatedExecutorsConfig

function _changeDelegatedExecutorsConfig(
    Types.DelegatedExecutorsConfig storage _delegatedExecutorsConfig,
    uint256 delegatorProfileId,
    address[] memory delegatedExecutors,
    bool[] memory approvals,
    uint64 configNumber,
    bool switchToGivenConfig
) private;

_prepareStorageToApplyChangesUnderGivenConfig

function _prepareStorageToApplyChangesUnderGivenConfig(
    Types.DelegatedExecutorsConfig storage _delegatedExecutorsConfig,
    uint64 configNumber,
    bool switchToGivenConfig
) private returns (bool);

_setFollowModule

function _setFollowModule(
    uint256 profileId,
    address followModule,
    bytes calldata followModuleInitData,
    address transactionExecutor
) private;