CollectPublicationAction

Git Source

Inherits: HubRestricted, IPublicationActionModule

State Variables

COLLECT_NFT_IMPL

address public immutable COLLECT_NFT_IMPL;

_collectModuleRegistered

mapping(address collectModule => bool isWhitelisted) internal _collectModuleRegistered;

_collectDataByPub

mapping(uint256 profileId => mapping(uint256 pubId => CollectData collectData)) internal _collectDataByPub;

Functions

constructor

constructor(address hub, address collectNFTImpl) HubRestricted(hub);

registerCollectModule

function registerCollectModule(address collectModule) public returns (bool);

initializePublicationAction

function initializePublicationAction(uint256 profileId, uint256 pubId, address transactionExecutor, bytes calldata data)
    external
    override
    onlyHub
    returns (bytes memory);

processPublicationAction

function processPublicationAction(Types.ProcessActionParams calldata processActionParams)
    external
    override
    onlyHub
    returns (bytes memory);

_emitCollectedEvent

function _emitCollectedEvent(
    Types.ProcessActionParams calldata processActionParams,
    address collectNftRecipient,
    bytes memory collectData,
    bytes memory collectActionResult,
    address collectNFT,
    uint256 tokenId
) private;

getCollectData

function getCollectData(uint256 profileId, uint256 pubId) external view returns (CollectData memory);

_getOrDeployCollectNFT

function _getOrDeployCollectNFT(
    uint256 publicationCollectedProfileId,
    uint256 publicationCollectedId,
    address collectNFTImpl
) private returns (address);

_processCollect

function _processCollect(
    address collectModule,
    bytes memory collectData,
    Types.ProcessActionParams calldata processActionParams
) private returns (bytes memory);

_deployCollectNFT

function _deployCollectNFT(uint256 profileId, uint256 pubId, address collectNFTImpl) private returns (address);

isCollectModuleRegistered

function isCollectModuleRegistered(address collectModule) external view returns (bool);

Events

CollectModuleRegistered

event CollectModuleRegistered(address collectModule, uint256 timestamp);

CollectNFTDeployed

Emitted when a collectNFT clone is deployed using a lazy deployment pattern.

event CollectNFTDeployed(
    uint256 indexed profileId, uint256 indexed pubId, address indexed collectNFT, uint256 timestamp
);

Collected

Emitted upon a successful collect action.

event Collected(
    uint256 indexed collectedProfileId,
    uint256 indexed collectedPubId,
    uint256 indexed collectorProfileId,
    address nftRecipient,
    bytes collectActionData,
    bytes collectActionResult,
    address collectNFT,
    uint256 tokenId,
    address transactionExecutor,
    uint256 timestamp
);

Structs

CollectData

struct CollectData {
    address collectModule;
    address collectNFT;
}