initialize(string,string,address) :
This function initializes a new protocol token. It sets the name and symbol of the token, sets the protocol state to paused, and sets the address of the new governance contract. It does this by calling the _initialize() function from the superclass and the _setState() and _setGovernance() functions from the current contract. (autogenerated documentation)
setGovernance(address) :
This function allows the governance address of the contract to be changed. It can only be called by the current governance address, and it sets the new governance address to the address passed in as an argument. (autogenerated documentation)
setEmergencyAdmin(address) :
This function sets the emergency admin of the contract. It can only be called by the government, and it requires an address of the new emergency admin as an argument. The function sets the new emergency admin, and emits an event with the sender, the previous emergency admin, the new emergency admin, and the timestamp of the block. (autogenerated documentation)
setState() :
This function allows the Governance or Emergency Admin to set the Protocol State of the contract. If the Emergency Admin attempts to set the Protocol State to Unpaused, the function will revert with an error. Otherwise, the function will call the _setState() function to set the Protocol State to the newState. (autogenerated documentation)
whitelistProfileCreator(address,bool) :
This function whitelists or unwhitelists a profile creator. It takes an address of the profile creator and a boolean value as parameters. The boolean value determines whether the profile creator should be whitelisted or unwhitelisted. The function then sets the value of the profile creator's address in the _profileCreatorWhitelisted mapping to the boolean value. Finally, it emits an event to indicate that the profile creator has been whitelisted or unwhitelisted. (autogenerated documentation)
whitelistFollowModule(address,bool) :
This function allows the governing body of the contract to whitelist or un-whitelist a Follow Module address. This is done by setting the boolean value of the Follow Module address in the _followModuleWhitelisted mapping to either true or false. An event is also emitted to log the change. (autogenerated documentation)
whitelistReferenceModule(address,bool) :
This function allows the government to whitelist or blacklist a reference module address. It sets the value of the referenceModuleWhitelisted mapping to either true or false depending on the value of the whitelist parameter. It also emits an event to log the change. (autogenerated documentation)
whitelistCollectModule(address,bool) :
This function allows the government to whitelist or un-whitelist a CollectModule address. This function is only accessible to the government, and when called, it sets the boolean value of the CollectModule address in the _collectModuleWhitelisted mapping to the value of the whitelist parameter. It also emits an event to log the change. (autogenerated documentation)
createProfile() :
This function creates a new profile on the platform. It first checks if the sender is whitelisted as a profile creator. If so, it increments the profile counter and mints a new profile ID to the specified address. It then calls the createProfile function from the PublishingLogic contract to create the profile, passing in the profile ID, profileIdByHandleHash, profileById, and followModuleWhitelisted variables. Finally, it returns the profile ID. (autogenerated documentation)
setDefaultProfile(uint256) :
This function allows a user to set a default profile for their account. It takes in a uint256 profileId as an argument and sets the default profile for the user who called the function (msg.sender). The function is only accessible when the contract is not paused, and it calls the internal _setDefaultProfile() function to set the default profile. (autogenerated documentation)
setDefaultProfileWithSig() :
This function allows a user to set their default profile using a signature. It takes in a SetDefaultProfileWithSigData struct containing the wallet address, profile ID, and signature of the user. It then validates the signature by calculating the digest of the data and comparing it to the recovered address from the signature. If the signature is valid, the function sets the default profile for the user. (autogenerated documentation)
setFollowModule(uint256,address) :
This function allows the owner of a profile to set a follow module for their profile. The follow module is a smart contract that is responsible for managing the followers of the profile. The function takes in the profile ID, the address of the follow module, and the initialization data for the follow module. It then calls the setFollowModule function from the PublishingLogic contract, which validates that the follow module is whitelisted and sets the follow module for the profile. (autogenerated documentation)
setFollowModuleWithSig() :
This function allows a user to set a follow module on their profile using a signature. It first validates the signature using the _validateRecoveredAddress function, which checks that the signature was created by the owner of the profile. It then calls the PublishingLogic.setFollowModule function to set the follow module on the profile, using the profileId, followModule, followModuleInitData, profile data, and a whitelist of follow modules. (autogenerated documentation)
setDispatcher(uint256,address) :
This function allows the owner of a profile to set a new dispatcher for their profile. The function first validates that the caller is the owner of the profile by calling the _validateCallerIsProfileOwner() function. If the caller is the owner, the function then calls the _setDispatcher() function to set the new dispatcher for the profile. (autogenerated documentation)
setDispatcherWithSig() :
This function allows a user to set the dispatcher of a profileId by providing a signature. It works by first validating the recovered address of the signature against the owner of the profileId, and then incrementing the signature nonce for that owner. Finally, it calls the _setDispatcher function to set the dispatcher. (autogenerated documentation)
setProfileImageURI(uint256,string) :
This function allows the owner of a profile or the dispatcher to set the profile image URI for a given profile. It first validates that the caller is either the profile owner or the dispatcher, and then calls the _setProfileImageURI function to set the profile image URI. (autogenerated documentation)
setProfileImageURIWithSig() :
This function allows a user to set the profile image URI of a profile with a signature. It first checks that the owner of the profile is the same as the address recovered from the signature. It then validates the signature using the calculated digest and the signature provided. Finally, it sets the profile image URI with the provided image URI. (autogenerated documentation)
setFollowNFTURI(uint256,string) :
This function allows the owner of a profile or a dispatcher to set the URI of a Follow NFT associated with the profile. The function first validates that the caller is either the profile owner or a dispatcher. If the validation is successful, the function calls the _setFollowNFTURI function to set the URI of the Follow NFT. (autogenerated documentation)
setFollowNFTURIWithSig() :
This function allows a user to set a followNFTURI for their profileId using a signature. It first checks that the owner of the profileId is the same as the address recovered from the signature. It then validates the signature using the calculated digest, the owner address, and the signature. Finally, it sets the followNFTURI for the profileId. (autogenerated documentation)
post() :
This function allows a profile owner or dispatcher to create a post on the blockchain. It takes in a set of data (vars) which includes the profileId, contentURI, collectModule, collectModuleInitData, referenceModule, and referenceModuleInitData. It then validates that the caller is the profile owner or dispatcher, and creates the post on the blockchain. (autogenerated documentation)
postWithSig() :
This function allows a user to post a contentURI, collectModule, collectModuleInitData, referenceModule, and referenceModuleInitData to the blockchain, provided they have a valid signature. The function first checks that the owner of the profileId is the same as the address associated with the signature. It then calculates a digest of the data to be posted, and uses the signature to validate that the owner of the profileId is the one making the post. Finally, it creates the post on the blockchain. (autogenerated documentation)
comment() :
This function allows a user to create a comment on a profile. It first validates that the caller is either the profile owner or a dispatcher, and then creates the comment using the provided variables. (autogenerated documentation)
commentWithSig() :
This function allows a user to post a comment with a signature. It takes in a CommentWithSigData struct containing the profileId of the user, the contentURI of the comment, the profileIdPointed and pubIdPointed of the comment, the referenceModuleData, collectModule, collectModuleInitData, referenceModule, and referenceModuleInitData of the comment, and the signature of the user. It then validates the signature of the user using the _validateRecoveredAddress function and the _calculateDigest function. Finally, it creates the comment using the _createComment function and the CommentData struct. (autogenerated documentation)
mirror() :
This function allows a user to create a "mirror" of their profile on the blockchain. It takes in a set of variables (vars) as input, which includes the profile ID of the user. It then validates that the caller is either the profile owner or a dispatcher, and then creates the mirror on the blockchain. The function returns a uint256 value, which is the ID of the newly created mirror. (autogenerated documentation)
mirrorWithSig() :
This function creates a mirror with a signature. It takes in a MirrorWithSigData struct containing the profileId, profileIdPointed, pubIdPointed, referenceModuleData, referenceModule, referenceModuleInitData, and a signature. It then calculates a digest using the keccak256 hash of the data, and validates the recovered address of the signature against the owner of the profileId. Finally, it creates a MirrorData struct and calls the _createMirror function to create the mirror. (autogenerated documentation)
burn(uint256) :
This function is used to burn a token with a given tokenId. It first calls the burn function from the superclass, and then clears the handle hash associated with the tokenId. This ensures that the token is completely removed from the system and can no longer be used. (autogenerated documentation)
burnWithSig(uint256) :
This function allows a user to burn a token with a signature. It first calls the burnWithSig function from the superclass, which burns the token and removes it from the user's balance. It then calls the _clearHandleHash function, which removes the token's handle hash from the mapping. This ensures that the token is completely removed from the system. (autogenerated documentation)
follow(uint256[]) :
This function allows a user to follow a list of profiles. It takes two parameters, an array of profile IDs and an array of data bytes. It then calls the InteractionLogic.follow function, passing in the sender's address, the profile IDs, the data bytes, the _profileById mapping, and the _profileIdByHandleHash mapping. The InteractionLogic.follow function returns an array of uint256 values, which is then returned by the follow function. (autogenerated documentation)
followWithSig() :
This function allows a user to follow a list of profiles using a signature. It first calculates the hashes of the data provided, then validates the recovered address of the signature provided. Finally, it calls the InteractionLogic.follow function to update the profiles with the new follower. (autogenerated documentation)
collect(uint256,uint256) :
This function allows a user to collect a Non-Fungible Token (NFT) from a publisher. It takes in three parameters: a profileId, a pubId, and a data payload. It then calls the InteractionLogic.collect() function, passing in the sender's address, the profileId, the pubId, the data payload, the COLLECT_NFT_IMPL constant, the _pubByIdByProfile mapping, and the _profileById mapping. The InteractionLogic.collect() function is responsible for verifying the sender's address, the profileId, and the pubId, and then transferring the NFT to the sender's address. (autogenerated documentation)
collectWithSig() :
This function allows a user to collect a non-fungible token (NFT) from a publisher. It takes in a CollectWithSigData struct containing the collector's address, the profile ID, the publisher ID, the data associated with the NFT, and a signature. It then validates the signature and calculates a digest of the data. Finally, it calls the InteractionLogic.collect function to collect the NFT. (autogenerated documentation)
emitFollowNFTTransferEvent(uint256,uint256,address,address) :
This function emits an event when a FollowNFT is transferred from one address to another. It takes in four parameters: a profileId, a followNFTId, the address of the sender, and the address of the recipient. It first checks that the sender is the expected FollowNFT address associated with the profileId. If so, it emits an event with the provided parameters and the current block timestamp. (autogenerated documentation)
emitCollectNFTTransferEvent(uint256,uint256,uint256,address,address) :
This function emits an event when a Collectible Non-Fungible Token (NFT) is transferred from one address to another. It takes in five parameters: the profile ID, the public ID, the collectible NFT ID, the address of the sender, and the address of the recipient. It first checks that the sender is the expected Collectible NFT address, and if so, it emits an event with the provided parameters, as well as the current block timestamp. (autogenerated documentation)
isProfileCreatorWhitelisted(address) :
This function checks if a given address is whitelisted as a profile creator. It does this by accessing the _profileCreatorWhitelisted mapping, which stores a boolean value for each address. If the address is found in the mapping, the function returns the boolean value associated with it. (autogenerated documentation)
defaultProfile(address) :
This function is used to retrieve the default profile associated with a given wallet address. It works by accessing the mapping _defaultProfileByAddress, which stores the default profile ID associated with each wallet address. The function takes in a wallet address as an argument and returns the corresponding default profile ID. (autogenerated documentation)
isFollowModuleWhitelisted(address) :
This function checks if a given address is whitelisted in the Follow Module. It does this by accessing the _followModuleWhitelisted mapping, which stores a boolean value for each address. If the address is found in the mapping and the boolean value is true, then the address is whitelisted and the function returns true. Otherwise, the function returns false. (autogenerated documentation)
isReferenceModuleWhitelisted(address) :
This function checks if a given address is whitelisted as a reference module. It does this by accessing the _referenceModuleWhitelisted mapping, which stores a boolean value for each address. If the address is found in the mapping, the function returns the boolean value associated with it. (autogenerated documentation)
isCollectModuleWhitelisted(address) :
This function checks if a given address is whitelisted in the _collectModuleWhitelisted mapping. It takes an address as an argument and returns a boolean value indicating whether the address is whitelisted or not. (autogenerated documentation)
getGovernance() :
This function is an external view function that returns the address of the governance contract. It works by simply returning the address stored in the _governance variable. This function allows external contracts to access the address of the governance contract. (autogenerated documentation)
getDispatcher(uint256) :
This function retrieves the address of the dispatcher associated with a given profile ID. It does this by accessing the _dispatcherByProfile mapping, which stores the address of the dispatcher associated with each profile ID. (autogenerated documentation)
getPubCount(uint256) :
This function retrieves the number of publications associated with a given profile ID. It works by accessing the _profileById mapping, which stores the profile information associated with a given profile ID, and then returning the pubCount value associated with that profile. (autogenerated documentation)
getFollowNFT(uint256) :
This function retrieves the address of the Non-Fungible Token (NFT) associated with a given profile ID. It works by accessing the _profileById mapping, which stores the profile ID as the key and the associated NFT address as the value. The function then returns the NFT address associated with the given profile ID. (autogenerated documentation)
getFollowNFTURI(uint256) :
This function retrieves the URI of a Non-Fungible Token (NFT) associated with a given profile ID. It works by accessing the _profileById mapping, which stores the profile data associated with each profile ID, and returning the followNFTURI field from the corresponding profile data. (autogenerated documentation)
getCollectNFT(uint256,uint256) :
This function retrieves the address of the Collectible Non-Fungible Token (NFT) associated with a given profile ID and public ID. It does this by accessing the _pubByIdByProfile mapping, which stores the details of each public ID associated with a given profile ID. The function then returns the address of the associated Collectible NFT. (autogenerated documentation)
getFollowModule(uint256) :
This function is used to retrieve the address of the FollowModule associated with a given profileId. It does this by accessing the _profileById mapping, which stores the profileId as the key and a struct containing the address of the FollowModule as the value. The function then returns the address of the FollowModule associated with the given profileId. (autogenerated documentation)
getCollectModule(uint256,uint256) :
This function retrieves the address of the collect module associated with a given profileId and pubId. It does this by accessing the _pubByIdByProfile mapping, which stores the details of each pub associated with a given profileId. The function then returns the address of the collect module associated with the given profileId and pubId. (autogenerated documentation)
getReferenceModule(uint256,uint256) :
This function retrieves the address of the reference module associated with a given profileId and pubId. It does this by accessing the _pubByIdByProfile mapping, which stores the reference module address associated with a given profileId and pubId. (autogenerated documentation)
getHandle(uint256) :
This function retrieves the handle associated with a given profileId from a mapping of profiles stored in the smart contract. The function is declared as external and view, meaning it can be called from outside the contract and does not modify the state of the contract. The function takes a uint256 profileId as an argument and returns a string memory containing the handle associated with the profileId. (autogenerated documentation)
getPubPointer(uint256,uint256) :
This function retrieves the profileId and pubId of a publication that is pointed to by a given profileId and pubId. It does this by accessing the _pubByIdByProfile mapping, which stores the profileIdPointed and pubIdPointed values for a given profileId and pubId. The function then returns these values as a tuple. (autogenerated documentation)
getContentURI(uint256,uint256) :
This function retrieves the contentURI of a publication given its profileId and pubId. It first checks if the publication is a mirror, and if so, it retrieves the root profileId and rootPubId of the original publication. It then returns the contentURI of the original publication. (autogenerated documentation)
getProfileIdByHandle(string) :
This function takes a string (the handle) as an input and returns a uint256 (the profile ID). It does this by first hashing the handle using the keccak256 algorithm, then using the hashed handle to look up the profile ID in the _profileIdByHandleHash mapping. (autogenerated documentation)
getProfile(uint256) :
This function is a view function that retrieves a profile from the smart contract based on a given profile ID. It takes in a uint256 profileId as an argument and returns a DataTypes.ProfileStruct memory. The function accesses the _profileById mapping, which stores the profile data associated with the given profile ID, and returns the profile data associated with the given profile ID. (autogenerated documentation)
getPub(uint256,uint256) :
This function retrieves a publication from the smart contract based on the provided profileId and pubId. It does this by accessing the _pubByIdByProfile mapping, which stores the publication data associated with a given profileId and pubId. The function returns the publication data as a DataTypes.PublicationStruct memory. (autogenerated documentation)
getPubType(uint256,uint256) :
This function is used to determine the type of a publication (post, comment, or mirror) based on the profileId and pubId of the publication. It does this by first checking if the pubId is 0 or if the profileId has fewer publications than the pubId. If either of these conditions are true, the function returns DataTypes.PubType.Nonexistent. Otherwise, it checks if the collectModule address of the publication is 0. If it is, the function returns DataTypes.PubType.Mirror. If not, it checks if the profileIdPointed of the publication is 0. If it is, the function returns DataTypes.PubType.Post. Otherwise, it returns DataTypes.Pub (autogenerated documentation)
tokenURI(uint256) :
This function is used to generate a URI for a given tokenId. It takes in the tokenId as an argument and returns a string memory. It first retrieves the address of the followNFT associated with the tokenId from the _profileById mapping. It then calls the getProfileTokenURI function from the ProfileTokenURILogic contract, passing in the tokenId, the total supply of the followNFT, the owner of the tokenId, the handle associated with the tokenId, and the imageURI associated with the tokenId. The getProfileTokenURI function then generates a URI based on this information and returns it. (autogenerated documentation)
getFollowNFTImpl() :
This function is used to retrieve the address of the FollowNFT contract implementation. It works by returning the address stored in the FOLLOW_NFT_IMPL variable. This address is used to interact with the FollowNFT contract and access its functions. (autogenerated documentation)
getCollectNFTImpl() :
This function is part of a smart contract that allows users to collect non-fungible tokens (NFTs). It returns the address of the implementation contract that is responsible for managing the collection of NFTs. This implementation contract is responsible for tracking the ownership of the NFTs, as well as providing methods for users to transfer, trade, and manage their collections. (autogenerated documentation)
_setGovernance(address) :
This function sets the address of the governance contract for the current contract. It takes an address of the new governance contract as an argument and stores it in the _governance variable. It also emits an event with the sender, the previous governance address, the new governance address, and the block timestamp. (autogenerated documentation)
_createPost(uint256,string,address,address) :
This function creates a post for a given profile. It takes in the profile ID, content URI, collect module, collect module data, reference module, and reference module data as parameters. It then increments the profile's pubCount and calls the createPost function from the PublishingLogic contract. This function checks if the collect and reference modules are whitelisted, and if so, creates the post and stores it in the _pubByIdByProfile mapping. Finally, it returns the post ID. (autogenerated documentation)
_setDefaultProfile(address,uint256) :
This function sets the default profile for a given wallet address. It takes in two parameters, the wallet address and the profile ID. It first checks to make sure that the profile ID is valid and that the wallet address is the owner of the profile ID. If these conditions are met, the function sets the default profile for the wallet address to the profile ID and emits an event to indicate that the default profile has been set. (autogenerated documentation)
_createComment() :
This function creates a comment for a given profile. It takes in a CommentData memory variable which contains the profileId, the content of the comment, and the parentId (if the comment is a reply). It then increments the profile's pubCount, and calls the createComment function from the PublishingLogic contract to create the comment. This function stores the comment in the _profileById, _pubByIdByProfile, _collectModuleWhitelisted, and _referenceModuleWhitelisted mappings. Finally, it returns the pubId of the comment. (autogenerated documentation)
_createMirror() :
This function creates a new Mirror Data object and stores it in the contract. It takes in a MirrorData object as an argument, which contains the profileId of the user creating the Mirror Data object, and increments the pubCount of the profileId. It then calls the createMirror function from the PublishingLogic contract, passing in the MirrorData object, the incremented pubCount, the _pubByIdByProfile mapping, and the _referenceModuleWhitelisted boolean. The createMirror function stores the MirrorData object in the contract, and returns the pubId of the newly created Mirror Data object. (autogenerated documentation)
_setDispatcher(uint256,address) :
This function sets the address of the dispatcher for a given profileId. It stores the address in the mapping _dispatcherByProfile and emits an event to signal that the dispatcher has been set. (autogenerated documentation)
_setProfileImageURI(uint256,string) :
This function sets the profile image URI for a given profile ID. It takes in two parameters, a profile ID (uint256) and an image URI (string). It first checks to make sure that the image URI is not too long, and if it is not, it sets the image URI for the given profile ID in the _profileById mapping. Finally, it emits an event to indicate that the profile image URI has been set. (autogenerated documentation)
_setFollowNFTURI(uint256,string) :
This function sets the followNFTURI of a profile with the given profileId. It stores the followNFTURI in the _profileById mapping and emits an event to signal that the followNFTURI has been set. (autogenerated documentation)
_clearHandleHash(uint256) :
This function clears the handle hash associated with a given profile ID. It does this by taking the profile ID as an input, using it to look up the associated handle, and then computing the keccak256 hash of the handle. This hash is then used to set the profile ID associated with the handle hash to 0, effectively clearing the handle hash. (autogenerated documentation)
_beforeTokenTransfer(address,address,uint256) :
This function is an internal override of the _beforeTokenTransfer function in the ERC721 contract. It is used to ensure that the token transfer is valid before it is executed. It checks if the tokenId has a dispatcher associated with it, and if so, it sets the dispatcher to 0. It also checks if the tokenId is the default profile for the sender address, and if so, it sets the default profile to 0. Finally, it calls the _beforeTokenTransfer function in the ERC721 contract to complete the token transfer. (autogenerated documentation)
_validateCallerIsProfileOwnerOrDispatcher(uint256) :
This function is used to validate that the caller of a function is either the owner of a profile or the dispatcher associated with that profile. It takes in a profileId as an argument and checks if the msg.sender (the address of the caller) is either the owner of the profile or the dispatcher associated with the profile. If the caller is not either of these, the function reverts with an error. (autogenerated documentation)
_validateCallerIsProfileOwner(uint256) :
This function is used to validate that the caller of the function is the owner of the profile with the given profileId. It does this by using the ownerOf() function to retrieve the owner of the profile and comparing it to the msg.sender, which is the address of the caller. If the two do not match, the function will revert with an error. (autogenerated documentation)
_validateCallerIsGovernance() :
This function is used to validate that the caller of the function is the governance address. It does this by checking if the sender of the message (msg.sender) is equal to the governance address stored in the _governance variable. If the two addresses are not equal, the function will revert with an error message. (autogenerated documentation)
getRevision() :
This function is an override of a virtual function in a parent contract. It returns the value of the REVISION constant, which is a uint256 value. This function allows the contract to access the REVISION constant and use it in other functions. (autogenerated documentation)