PublicationLib

Git Source

Functions

MODULE_REGISTRY

function MODULE_REGISTRY() internal view returns (IModuleRegistry);

post

Publishes a post to a given profile.

function post(Types.PostParams calldata postParams, address transactionExecutor) external returns (uint256);

Parameters

NameTypeDescription
postParamsTypes.PostParamsThe PostParams struct.
transactionExecutoraddress

Returns

NameTypeDescription
<none>uint256uint256 The created publication's pubId.

comment

Publishes a comment to a given profile via signature.

function comment(Types.CommentParams calldata commentParams, address transactionExecutor) external returns (uint256);

Parameters

NameTypeDescription
commentParamsTypes.CommentParamsthe CommentParams struct.
transactionExecutoraddress

Returns

NameTypeDescription
<none>uint256uint256 The created publication's pubId.

mirror

Publishes a mirror to a given profile.

function mirror(Types.MirrorParams calldata mirrorParams, address transactionExecutor) external returns (uint256);

Parameters

NameTypeDescription
mirrorParamsTypes.MirrorParamsthe MirrorParams struct.
transactionExecutoraddress

Returns

NameTypeDescription
<none>uint256uint256 The created publication's pubId.

quote

Publishes a quote publication to a given profile via signature.

function quote(Types.QuoteParams calldata quoteParams, address transactionExecutor) external returns (uint256);

Parameters

NameTypeDescription
quoteParamsTypes.QuoteParamsthe QuoteParams struct.
transactionExecutoraddress

Returns

NameTypeDescription
<none>uint256uint256 The created publication's pubId.

getPublicationType

function getPublicationType(uint256 profileId, uint256 pubId) internal view returns (Types.PublicationType);

getContentURI

function getContentURI(uint256 profileId, uint256 pubId) external view returns (string memory);

_asReferencePubParams

function _asReferencePubParams(Types.QuoteParams calldata quoteParams)
    private
    pure
    returns (Types.ReferencePubParams calldata referencePubParams);

_asReferencePubParams

function _asReferencePubParams(Types.CommentParams calldata commentParams)
    private
    pure
    returns (Types.ReferencePubParams calldata referencePubParams);

_createReferencePublication

function _createReferencePublication(
    Types.ReferencePubParams calldata referencePubParams,
    address transactionExecutor,
    Types.PublicationType referencePubType
) private returns (uint256, bytes[] memory, bytes memory, Types.PublicationType[] memory);

_fillReferencePublicationStorage

function _fillReferencePublicationStorage(
    Types.ReferencePubParams calldata referencePubParams,
    Types.PublicationType referencePubType
) private returns (uint256, uint256);

_fillRootOfPublicationInStorage

function _fillRootOfPublicationInStorage(
    Types.Publication storage _publication,
    uint256 pointedProfileId,
    uint256 pointedPubId
) internal returns (uint256);

_processCommentIfNeeded

function _processCommentIfNeeded(
    Types.CommentParams calldata commentParams,
    address transactionExecutor,
    Types.PublicationType[] memory referrerPubTypes
) private returns (bytes memory);

_processQuoteIfNeeded

Equivalent to reverting with the returned error selector if the length is not zero.

function _processQuoteIfNeeded(
    Types.QuoteParams calldata quoteParams,
    address transactionExecutor,
    Types.PublicationType[] memory referrerPubTypes
) private returns (bytes memory);

_processMirrorIfNeeded

Equivalent to reverting with the returned error selector if the length is not zero.

function _processMirrorIfNeeded(
    Types.MirrorParams calldata mirrorParams,
    address transactionExecutor,
    Types.PublicationType[] memory referrerPubTypes
) private returns (bytes memory);

_initPubActionModules

function _initPubActionModules(InitActionModuleParams memory params) private returns (bytes[] memory);

_initPubReferenceModule

function _initPubReferenceModule(InitReferenceModuleParams memory params) private returns (bytes memory);

Structs

InitActionModuleParams

Equivalent to reverting with the returned error selector if the length is not zero.

struct InitActionModuleParams {
    uint256 profileId;
    address transactionExecutor;
    uint256 pubId;
    address[] actionModules;
    bytes[] actionModulesInitDatas;
}

InitReferenceModuleParams

struct InitReferenceModuleParams {
    uint256 profileId;
    address transactionExecutor;
    uint256 pubId;
    address referenceModule;
    bytes referenceModuleInitData;
}