ValidationLib

Git Source

Author: Lens Protocol

Functions

validatePointedPub

function validatePointedPub(uint256 profileId, uint256 pubId) internal view;

validateAddressIsProfileOwner

function validateAddressIsProfileOwner(address expectedProfileOwner, uint256 profileId) internal view;

validateAddressIsProfileOwnerOrDelegatedExecutor

function validateAddressIsProfileOwnerOrDelegatedExecutor(address expectedOwnerOrDelegatedExecutor, uint256 profileId)
    internal
    view;

validateAddressIsDelegatedExecutor

function validateAddressIsDelegatedExecutor(address expectedDelegatedExecutor, uint256 delegatorProfileId)
    internal
    view;

validateProfileCreatorWhitelisted

function validateProfileCreatorWhitelisted(address profileCreator) internal view;

validateNotBlocked

function validateNotBlocked(uint256 profile, uint256 byProfile) internal view;

validateNotBlocked

function validateNotBlocked(uint256 profile, uint256 byProfile, bool unidirectionalCheck) internal view;

validateProfileExists

function validateProfileExists(uint256 profileId) internal view;

validateCallerIsGovernance

function validateCallerIsGovernance() internal view;

validateReferrersAndGetReferrersPubTypes

function validateReferrersAndGetReferrersPubTypes(
    uint256[] memory referrerProfileIds,
    uint256[] memory referrerPubIds,
    uint256 targetedProfileId,
    uint256 targetedPubId
) internal view returns (Types.PublicationType[] memory);

validateLegacyCollectReferrer

function validateLegacyCollectReferrer(
    uint256 referrerProfileId,
    uint256 referrerPubId,
    uint256 publicationCollectedProfileId,
    uint256 publicationCollectedId
) external view;

_validateReferrerAndGetReferrerPubType

function _validateReferrerAndGetReferrerPubType(
    uint256 referrerProfileId,
    uint256 referrerPubId,
    uint256 targetedProfileId,
    uint256 targetedPubId
) private view returns (Types.PublicationType);

_validateReferrerAsPost

function _validateReferrerAsPost(
    uint256 referrerProfileId,
    uint256 referrerPubId,
    uint256 targetedProfileId,
    uint256 targetedPubId
) private view;

_validateReferrerAsMirrorOrCommentOrQuote

Validates that the referrer publication and the interacted publication are linked.

function _validateReferrerAsMirrorOrCommentOrQuote(
    uint256 referrerProfileId,
    uint256 referrerPubId,
    uint256 targetedProfileId,
    uint256 targetedPubId
) private view;

Parameters

NameTypeDescription
referrerProfileIduint256The profile id of the referrer.
referrerPubIduint256The publication id of the referrer.
targetedProfileIduint256The ID of the profile who authored the publication being acted or referenced.
targetedPubIduint256The pub ID being acted or referenced.