Types
Author: Lens Protocol
A standard library of data types used throughout the Lens Protocol.
Structs
TokenData
ERC721Timestamped storage. Contains the owner address and the mint timestamp for every NFT. Note: Instead of the owner address in the _tokenOwners private mapping, we now store it in the _tokenData mapping, alongside the mint timestamp.
struct TokenData {
address owner;
uint96 mintTimestamp;
}
FollowData
A struct containing token follow-related data.
struct FollowData {
uint160 followerProfileId;
uint48 originalFollowTimestamp;
uint48 followTimestamp;
uint256 profileIdAllowedToRecover;
}
EIP712Signature
A struct containing the necessary information to reconstruct an EIP-712 typed data signature.
struct EIP712Signature {
address signer;
uint8 v;
bytes32 r;
bytes32 s;
uint256 deadline;
}
Profile
A struct containing profile data.
struct Profile {
uint256 pubCount;
address followModule;
address followNFT;
string __DEPRECATED__handle;
string __DEPRECATED__imageURI;
string __DEPRECATED__followNFTURI;
string metadataURI;
}
Publication
A struct containing publication data.
struct Publication {
uint256 pointedProfileId;
uint256 pointedPubId;
string contentURI;
address referenceModule;
address __DEPRECATED__collectModule;
address __DEPRECATED__collectNFT;
PublicationType pubType;
uint256 rootProfileId;
uint256 rootPubId;
mapping(address => bool) actionModuleEnabled;
}
PublicationMemory
struct PublicationMemory {
uint256 pointedProfileId;
uint256 pointedPubId;
string contentURI;
address referenceModule;
address __DEPRECATED__collectModule;
address __DEPRECATED__collectNFT;
PublicationType pubType;
uint256 rootProfileId;
uint256 rootPubId;
}
CreateProfileParams
A struct containing the parameters required for the createProfile()
function.
struct CreateProfileParams {
address to;
address followModule;
bytes followModuleInitData;
}
PostParams
A struct containing the parameters required for the post()
function.
struct PostParams {
uint256 profileId;
string contentURI;
address[] actionModules;
bytes[] actionModulesInitDatas;
address referenceModule;
bytes referenceModuleInitData;
}
CommentParams
A struct containing the parameters required for the comment()
function.
struct CommentParams {
uint256 profileId;
string contentURI;
uint256 pointedProfileId;
uint256 pointedPubId;
uint256[] referrerProfileIds;
uint256[] referrerPubIds;
bytes referenceModuleData;
address[] actionModules;
bytes[] actionModulesInitDatas;
address referenceModule;
bytes referenceModuleInitData;
}
QuoteParams
A struct containing the parameters required for the quote()
function.
struct QuoteParams {
uint256 profileId;
string contentURI;
uint256 pointedProfileId;
uint256 pointedPubId;
uint256[] referrerProfileIds;
uint256[] referrerPubIds;
bytes referenceModuleData;
address[] actionModules;
bytes[] actionModulesInitDatas;
address referenceModule;
bytes referenceModuleInitData;
}
ReferencePubParams
A struct containing the parameters required for the comment()
or quote()
internal functions.
struct ReferencePubParams {
uint256 profileId;
string contentURI;
uint256 pointedProfileId;
uint256 pointedPubId;
uint256[] referrerProfileIds;
uint256[] referrerPubIds;
bytes referenceModuleData;
address[] actionModules;
bytes[] actionModulesInitDatas;
address referenceModule;
bytes referenceModuleInitData;
}
MirrorParams
A struct containing the parameters required for the mirror()
function.
struct MirrorParams {
uint256 profileId;
string metadataURI;
uint256 pointedProfileId;
uint256 pointedPubId;
uint256[] referrerProfileIds;
uint256[] referrerPubIds;
bytes referenceModuleData;
}
LegacyCollectParams
Deprecated in V2: Will be removed after some time after upgrading to V2.
A struct containing the parameters required for the legacy collect()
function.
The referrer can only be a mirror of the publication being collected.
struct LegacyCollectParams {
uint256 publicationCollectedProfileId;
uint256 publicationCollectedId;
uint256 collectorProfileId;
uint256 referrerProfileId;
uint256 referrerPubId;
bytes collectModuleData;
}
PublicationActionParams
A struct containing the parameters required for the action()
function.
struct PublicationActionParams {
uint256 publicationActedProfileId;
uint256 publicationActedId;
uint256 actorProfileId;
uint256[] referrerProfileIds;
uint256[] referrerPubIds;
address actionModuleAddress;
bytes actionModuleData;
}
ProcessActionParams
struct ProcessActionParams {
uint256 publicationActedProfileId;
uint256 publicationActedId;
uint256 actorProfileId;
address actorProfileOwner;
address transactionExecutor;
uint256[] referrerProfileIds;
uint256[] referrerPubIds;
Types.PublicationType[] referrerPubTypes;
bytes actionModuleData;
}
ProcessCollectParams
struct ProcessCollectParams {
uint256 publicationCollectedProfileId;
uint256 publicationCollectedId;
uint256 collectorProfileId;
address collectorProfileOwner;
address transactionExecutor;
uint256[] referrerProfileIds;
uint256[] referrerPubIds;
Types.PublicationType[] referrerPubTypes;
bytes data;
}
ProcessCommentParams
struct ProcessCommentParams {
uint256 profileId;
address transactionExecutor;
uint256 pointedProfileId;
uint256 pointedPubId;
uint256[] referrerProfileIds;
uint256[] referrerPubIds;
Types.PublicationType[] referrerPubTypes;
bytes data;
}
ProcessQuoteParams
struct ProcessQuoteParams {
uint256 profileId;
address transactionExecutor;
uint256 pointedProfileId;
uint256 pointedPubId;
uint256[] referrerProfileIds;
uint256[] referrerPubIds;
Types.PublicationType[] referrerPubTypes;
bytes data;
}
ProcessMirrorParams
struct ProcessMirrorParams {
uint256 profileId;
address transactionExecutor;
uint256 pointedProfileId;
uint256 pointedPubId;
uint256[] referrerProfileIds;
uint256[] referrerPubIds;
Types.PublicationType[] referrerPubTypes;
bytes data;
}
DelegatedExecutorsConfig
A struct containing a profile's delegated executors configuration.
struct DelegatedExecutorsConfig {
mapping(uint256 => mapping(address => bool)) isApproved;
uint64 configNumber;
uint64 prevConfigNumber;
uint64 maxConfigNumberSet;
}
TreasuryData
struct TreasuryData {
address treasury;
uint16 treasuryFeeBPS;
}
MigrationParams
struct MigrationParams {
address lensHandlesAddress;
address tokenHandleRegistryAddress;
address legacyFeeFollowModule;
address legacyProfileFollowModule;
address newFeeFollowModule;
address migrationAdmin;
}
Enums
ProtocolState
An enum containing the different states the protocol can be in, limiting certain actions.
enum ProtocolState {
Unpaused,
PublishingPaused,
Paused
}
PublicationType
An enum specifically used in a helper function to easily retrieve the publication type for integrations.
enum PublicationType {
Nonexistent,
Post,
Comment,
Mirror,
Quote
}