Contract
0x420f0257D43145bb002E69B14FF2Eb9630Fc4736
3
Contract Overview
Balance:
0 MATIC
Token:
My Name Tag:
Not Available
[ Download CSV Export ]
Contract Name:
MockProfileCreationProxy
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import {ILensHub} from '../interfaces/ILensHub.sol'; import {DataTypes} from '../libraries/DataTypes.sol'; import {Errors} from '../libraries/Errors.sol'; /** * @title MockProfileCreationProxy * @author Lens Protocol * * @notice This is an ownable proxy contract that enforces ".test" handle suffixes at profile creation. */ contract MockProfileCreationProxy { ILensHub immutable LENS_HUB; constructor(ILensHub hub) { LENS_HUB = hub; } function proxyCreateProfile(DataTypes.CreateProfileData memory vars) external { uint256 handleLength = bytes(vars.handle).length; if (handleLength < 5) revert Errors.HandleLengthInvalid(); bytes1 firstByte = bytes(vars.handle)[0]; if (firstByte == '-' || firstByte == '_' || firstByte == '.') revert Errors.HandleFirstCharInvalid(); for (uint256 i = 1; i < handleLength; ) { if (bytes(vars.handle)[i] == '.') revert Errors.HandleContainsInvalidCharacters(); unchecked { ++i; } } vars.handle = string(abi.encodePacked(vars.handle, '.test')); LENS_HUB.createProfile(vars); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import {DataTypes} from '../libraries/DataTypes.sol'; /** * @title ILensHub * @author Lens Protocol * * @notice This is the interface for the LensHub contract, the main entry point for the Lens Protocol. * You'll find all the events and external functions, as well as the reasoning behind them here. */ interface ILensHub { /** * @notice Initializes the LensHub NFT, setting the initial governance address as well as the name and symbol in * the LensNFTBase contract. * * @param name The name to set for the hub NFT. * @param symbol The symbol to set for the hub NFT. * @param newGovernance The governance address to set. */ function initialize( string calldata name, string calldata symbol, address newGovernance ) external; /** * @notice Sets the privileged governance role. This function can only be called by the current governance * address. * * @param newGovernance The new governance address to set. */ function setGovernance(address newGovernance) external; /** * @notice Sets the emergency admin, which is a permissioned role able to set the protocol state. This function * can only be called by the governance address. * * @param newEmergencyAdmin The new emergency admin address to set. */ function setEmergencyAdmin(address newEmergencyAdmin) external; /** * @notice Sets the protocol state to either a global pause, a publishing pause or an unpaused state. This function * can only be called by the governance address or the emergency admin address. * * Note that this reverts if the emergency admin calls it if: * 1. The emergency admin is attempting to unpause. * 2. The emergency admin is calling while the protocol is already paused. * * @param newState The state to set, as a member of the ProtocolState enum. */ function setState(DataTypes.ProtocolState newState) external; /** * @notice Adds or removes a profile creator from the whitelist. This function can only be called by the current * governance address. * * @param profileCreator The profile creator address to add or remove from the whitelist. * @param whitelist Whether or not the profile creator should be whitelisted. */ function whitelistProfileCreator(address profileCreator, bool whitelist) external; /** * @notice Adds or removes a follow module from the whitelist. This function can only be called by the current * governance address. * * @param followModule The follow module contract address to add or remove from the whitelist. * @param whitelist Whether or not the follow module should be whitelisted. */ function whitelistFollowModule(address followModule, bool whitelist) external; /** * @notice Adds or removes a reference module from the whitelist. This function can only be called by the current * governance address. * * @param referenceModule The reference module contract to add or remove from the whitelist. * @param whitelist Whether or not the reference module should be whitelisted. */ function whitelistReferenceModule(address referenceModule, bool whitelist) external; /** * @notice Adds or removes a collect module from the whitelist. This function can only be called by the current * governance address. * * @param collectModule The collect module contract address to add or remove from the whitelist. * @param whitelist Whether or not the collect module should be whitelisted. */ function whitelistCollectModule(address collectModule, bool whitelist) external; /** * @notice Creates a profile with the specified parameters, minting a profile NFT to the given recipient. This * function must be called by a whitelisted profile creator. * * @param vars A CreateProfileData struct containing the following params: * to: The address receiving the profile. * handle: The handle to set for the profile, must be unique and non-empty. * imageURI: The URI to set for the profile image. * followModule: The follow module to use, can be the zero address. * followModuleInitData: The follow module initialization data, if any. */ function createProfile(DataTypes.CreateProfileData calldata vars) external returns (uint256); /** * @notice Sets the mapping between wallet and its main profile identity. * * @param profileId The token ID of the profile to set as the main profile identity. */ function setDefaultProfile(uint256 profileId) external; /** * @notice Sets the mapping between wallet and its main profile identity via signature with the specified parameters. * * @param vars A SetDefaultProfileWithSigData struct, including the regular parameters and an EIP712Signature struct. */ function setDefaultProfileWithSig(DataTypes.SetDefaultProfileWithSigData calldata vars) external; /** * @notice Sets a profile's follow module, must be called by the profile owner. * * @param profileId The token ID of the profile to set the follow module for. * @param followModule The follow module to set for the given profile, must be whitelisted. * @param followModuleInitData The data to be passed to the follow module for initialization. */ function setFollowModule( uint256 profileId, address followModule, bytes calldata followModuleInitData ) external; /** * @notice Sets a profile's follow module via signature with the specified parameters. * * @param vars A SetFollowModuleWithSigData struct, including the regular parameters and an EIP712Signature struct. */ function setFollowModuleWithSig(DataTypes.SetFollowModuleWithSigData calldata vars) external; /** * @notice Sets a profile's dispatcher, giving that dispatcher rights to publish to that profile. * * @param profileId The token ID of the profile of the profile to set the dispatcher for. * @param dispatcher The dispatcher address to set for the given profile ID. */ function setDispatcher(uint256 profileId, address dispatcher) external; /** * @notice Sets a profile's dispatcher via signature with the specified parameters. * * @param vars A SetDispatcherWithSigData struct, including the regular parameters and an EIP712Signature struct. */ function setDispatcherWithSig(DataTypes.SetDispatcherWithSigData calldata vars) external; /** * @notice Sets a profile's URI, which is reflected in the `tokenURI()` function. * * @param profileId The token ID of the profile of the profile to set the URI for. * @param imageURI The URI to set for the given profile. */ function setProfileImageURI(uint256 profileId, string calldata imageURI) external; /** * @notice Sets a profile's URI via signature with the specified parameters. * * @param vars A SetProfileImageURIWithSigData struct, including the regular parameters and an EIP712Signature struct. */ function setProfileImageURIWithSig(DataTypes.SetProfileImageURIWithSigData calldata vars) external; /** * @notice Sets a followNFT URI for a given profile's follow NFT. * * @param profileId The token ID of the profile for which to set the followNFT URI. * @param followNFTURI The follow NFT URI to set. */ function setFollowNFTURI(uint256 profileId, string calldata followNFTURI) external; /** * @notice Sets a followNFT URI via signature with the specified parameters. * * @param vars A SetFollowNFTURIWithSigData struct, including the regular parameters and an EIP712Signature struct. */ function setFollowNFTURIWithSig(DataTypes.SetFollowNFTURIWithSigData calldata vars) external; /** * @notice Publishes a post to a given profile, must be called by the profile owner. * * @param vars A PostData struct containing the needed parameters. * * @return uint256 An integer representing the post's publication ID. */ function post(DataTypes.PostData calldata vars) external returns (uint256); /** * @notice Publishes a post to a given profile via signature with the specified parameters. * * @param vars A PostWithSigData struct containing the regular parameters and an EIP712Signature struct. * * @return uint256 An integer representing the post's publication ID. */ function postWithSig(DataTypes.PostWithSigData calldata vars) external returns (uint256); /** * @notice Publishes a comment to a given profile, must be called by the profile owner. * * @param vars A CommentData struct containing the needed parameters. * * @return uint256 An integer representing the comment's publication ID. */ function comment(DataTypes.CommentData calldata vars) external returns (uint256); /** * @notice Publishes a comment to a given profile via signature with the specified parameters. * * @param vars A CommentWithSigData struct containing the regular parameters and an EIP712Signature struct. * * @return uint256 An integer representing the comment's publication ID. */ function commentWithSig(DataTypes.CommentWithSigData calldata vars) external returns (uint256); /** * @notice Publishes a mirror to a given profile, must be called by the profile owner. * * @param vars A MirrorData struct containing the necessary parameters. * * @return uint256 An integer representing the mirror's publication ID. */ function mirror(DataTypes.MirrorData calldata vars) external returns (uint256); /** * @notice Publishes a mirror to a given profile via signature with the specified parameters. * * @param vars A MirrorWithSigData struct containing the regular parameters and an EIP712Signature struct. * * @return uint256 An integer representing the mirror's publication ID. */ function mirrorWithSig(DataTypes.MirrorWithSigData calldata vars) external returns (uint256); /** * @notice Follows the given profiles, executing each profile's follow module logic (if any) and minting followNFTs to the caller. * * NOTE: Both the `profileIds` and `datas` arrays must be of the same length, regardless if the profiles do not have a follow module set. * * @param profileIds The token ID array of the profiles to follow. * @param datas The arbitrary data array to pass to the follow module for each profile if needed. * * @return uint256[] An array of integers representing the minted follow NFTs token IDs. */ function follow(uint256[] calldata profileIds, bytes[] calldata datas) external returns (uint256[] memory); /** * @notice Follows a given profile via signature with the specified parameters. * * @param vars A FollowWithSigData struct containing the regular parameters as well as the signing follower's address * and an EIP712Signature struct. * * @return uint256[] An array of integers representing the minted follow NFTs token IDs. */ function followWithSig(DataTypes.FollowWithSigData calldata vars) external returns (uint256[] memory); /** * @notice Collects a given publication, executing collect module logic and minting a collectNFT to the caller. * * @param profileId The token ID of the profile that published the publication to collect. * @param pubId The publication to collect's publication ID. * @param data The arbitrary data to pass to the collect module if needed. * * @return uint256 An integer representing the minted token ID. */ function collect( uint256 profileId, uint256 pubId, bytes calldata data ) external returns (uint256); /** * @notice Collects a given publication via signature with the specified parameters. * * @param vars A CollectWithSigData struct containing the regular parameters as well as the collector's address and * an EIP712Signature struct. * * @return uint256 An integer representing the minted token ID. */ function collectWithSig(DataTypes.CollectWithSigData calldata vars) external returns (uint256); /** * @dev Helper function to emit a detailed followNFT transfer event from the hub, to be consumed by frontends to track * followNFT transfers. * * @param profileId The token ID of the profile associated with the followNFT being transferred. * @param followNFTId The followNFT being transferred's token ID. * @param from The address the followNFT is being transferred from. * @param to The address the followNFT is being transferred to. */ function emitFollowNFTTransferEvent( uint256 profileId, uint256 followNFTId, address from, address to ) external; /** * @dev Helper function to emit a detailed collectNFT transfer event from the hub, to be consumed by frontends to track * collectNFT transfers. * * @param profileId The token ID of the profile associated with the collect NFT being transferred. * @param pubId The publication ID associated with the collect NFT being transferred. * @param collectNFTId The collectNFT being transferred's token ID. * @param from The address the collectNFT is being transferred from. * @param to The address the collectNFT is being transferred to. */ function emitCollectNFTTransferEvent( uint256 profileId, uint256 pubId, uint256 collectNFTId, address from, address to ) external; /// ************************ /// *****VIEW FUNCTIONS***** /// ************************ /** * @notice Returns whether or not a profile creator is whitelisted. * * @param profileCreator The address of the profile creator to check. * * @return bool True if the profile creator is whitelisted, false otherwise. */ function isProfileCreatorWhitelisted(address profileCreator) external view returns (bool); /** * @notice Returns default profile for a given wallet address * * @param wallet The address to find the default mapping * * @return uint256 The default profile id, which will be 0 if not mapped. */ function defaultProfile(address wallet) external view returns (uint256); /** * @notice Returns whether or not a follow module is whitelisted. * * @param followModule The address of the follow module to check. * * @return bool True if the the follow module is whitelisted, false otherwise. */ function isFollowModuleWhitelisted(address followModule) external view returns (bool); /** * @notice Returns whether or not a reference module is whitelisted. * * @param referenceModule The address of the reference module to check. * * @return bool True if the the reference module is whitelisted, false otherwise. */ function isReferenceModuleWhitelisted(address referenceModule) external view returns (bool); /** * @notice Returns whether or not a collect module is whitelisted. * * @param collectModule The address of the collect module to check. * * @return bool True if the the collect module is whitelisted, false otherwise. */ function isCollectModuleWhitelisted(address collectModule) external view returns (bool); /** * @notice Returns the currently configured governance address. * * @return address The address of the currently configured governance. */ function getGovernance() external view returns (address); /** * @notice Returns the dispatcher associated with a profile. * * @param profileId The token ID of the profile to query the dispatcher for. * * @return address The dispatcher address associated with the profile. */ function getDispatcher(uint256 profileId) external view returns (address); /** * @notice Returns the publication count for a given profile. * * @param profileId The token ID of the profile to query. * * @return uint256 The number of publications associated with the queried profile. */ function getPubCount(uint256 profileId) external view returns (uint256); /** * @notice Returns the followNFT associated with a given profile, if any. * * @param profileId The token ID of the profile to query the followNFT for. * * @return address The followNFT associated with the given profile. */ function getFollowNFT(uint256 profileId) external view returns (address); /** * @notice Returns the followNFT URI associated with a given profile. * * @param profileId The token ID of the profile to query the followNFT URI for. * * @return string The followNFT URI associated with the given profile. */ function getFollowNFTURI(uint256 profileId) external view returns (string memory); /** * @notice Returns the collectNFT associated with a given publication, if any. * * @param profileId The token ID of the profile that published the publication to query. * @param pubId The publication ID of the publication to query. * * @return address The address of the collectNFT associated with the queried publication. */ function getCollectNFT(uint256 profileId, uint256 pubId) external view returns (address); /** * @notice Returns the follow module associated witha given profile, if any. * * @param profileId The token ID of the profile to query the follow module for. * * @return address The address of the follow module associated with the given profile. */ function getFollowModule(uint256 profileId) external view returns (address); /** * @notice Returns the collect module associated with a given publication. * * @param profileId The token ID of the profile that published the publication to query. * @param pubId The publication ID of the publication to query. * * @return address The address of the collect module associated with the queried publication. */ function getCollectModule(uint256 profileId, uint256 pubId) external view returns (address); /** * @notice Returns the reference module associated witha given profile, if any. * * @param profileId The token ID of the profile that published the publication to querythe reference module for. * @param pubId The publication ID of the publication to query the reference module for. * * @return address The address of the reference module associated with the given profile. */ function getReferenceModule(uint256 profileId, uint256 pubId) external view returns (address); /** * @notice Returns the handle associated with a profile. * * @param profileId The token ID of the profile to query the handle for. * * @return string The handle associated with the profile. */ function getHandle(uint256 profileId) external view returns (string memory); /** * @notice Returns the publication pointer (profileId & pubId) associated with a given publication. * * @param profileId The token ID of the profile that published the publication to query the pointer for. * @param pubId The publication ID of the publication to query the pointer for. * * @return tuple First, the profile ID of the profile the current publication is pointing to, second, the * publication ID of the publication the current publication is pointing to. */ function getPubPointer(uint256 profileId, uint256 pubId) external view returns (uint256, uint256); /** * @notice Returns the URI associated with a given publication. * * @param profileId The token ID of the profile that published the publication to query. * @param pubId The publication ID of the publication to query. * * @return string The URI associated with a given publication. */ function getContentURI(uint256 profileId, uint256 pubId) external view returns (string memory); /** * @notice Returns the profile token ID according to a given handle. * * @param handle The handle to resolve the profile token ID with. * * @return uint256 The profile ID the passed handle points to. */ function getProfileIdByHandle(string calldata handle) external view returns (uint256); /** * @notice Returns the full profile struct associated with a given profile token ID. * * @param profileId The token ID of the profile to query. * * @return ProfileStruct The profile struct of the given profile. */ function getProfile(uint256 profileId) external view returns (DataTypes.ProfileStruct memory); /** * @notice Returns the full publication struct for a given publication. * * @param profileId The token ID of the profile that published the publication to query. * @param pubId The publication ID of the publication to query. * * @return PublicationStruct The publication struct associated with the queried publication. */ function getPub(uint256 profileId, uint256 pubId) external view returns (DataTypes.PublicationStruct memory); /** * @notice Returns the publication type associated with a given publication. * * @param profileId The token ID of the profile that published the publication to query. * @param pubId The publication ID of the publication to query. * * @return PubType The publication type, as a member of an enum (either "post," "comment" or "mirror"). */ function getPubType(uint256 profileId, uint256 pubId) external view returns (DataTypes.PubType); /** * @notice Returns the follow NFT implementation address. * * @return address The follow NFT implementation address. */ function getFollowNFTImpl() external view returns (address); /** * @notice Returns the collect NFT implementation address. * * @return address The collect NFT implementation address. */ function getCollectNFTImpl() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; /** * @title DataTypes * @author Lens Protocol * * @notice A standard library of data types used throughout the Lens Protocol. */ library DataTypes { /** * @notice An enum containing the different states the protocol can be in, limiting certain actions. * * @param Unpaused The fully unpaused state. * @param PublishingPaused The state where only publication creation functions are paused. * @param Paused The fully paused state. */ enum ProtocolState { Unpaused, PublishingPaused, Paused } /** * @notice An enum specifically used in a helper function to easily retrieve the publication type for integrations. * * @param Post A standard post, having a URI, a collect module but no pointer to another publication. * @param Comment A comment, having a URI, a collect module and a pointer to another publication. * @param Mirror A mirror, having a pointer to another publication, but no URI or collect module. * @param Nonexistent An indicator showing the queried publication does not exist. */ enum PubType { Post, Comment, Mirror, Nonexistent } /** * @notice A struct containing the necessary information to reconstruct an EIP-712 typed data signature. * * @param v The signature's recovery parameter. * @param r The signature's r parameter. * @param s The signature's s parameter * @param deadline The signature's deadline */ struct EIP712Signature { uint8 v; bytes32 r; bytes32 s; uint256 deadline; } /** * @notice A struct containing profile data. * * @param pubCount The number of publications made to this profile. * @param followModule The address of the current follow module in use by this profile, can be empty. * @param followNFT The address of the followNFT associated with this profile, can be empty.. * @param handle The profile's associated handle. * @param imageURI The URI to be used for the profile's image. * @param followNFTURI The URI to be used for the follow NFT. */ struct ProfileStruct { uint256 pubCount; address followModule; address followNFT; string handle; string imageURI; string followNFTURI; } /** * @notice A struct containing data associated with each new publication. * * @param profileIdPointed The profile token ID this publication points to, for mirrors and comments. * @param pubIdPointed The publication ID this publication points to, for mirrors and comments. * @param contentURI The URI associated with this publication. * @param referenceModule The address of the current reference module in use by this profile, can be empty. * @param collectModule The address of the collect module associated with this publication, this exists for all publication. * @param collectNFT The address of the collectNFT associated with this publication, if any. */ struct PublicationStruct { uint256 profileIdPointed; uint256 pubIdPointed; string contentURI; address referenceModule; address collectModule; address collectNFT; } /** * @notice A struct containing the parameters required for the `createProfile()` function. * * @param to The address receiving the profile. * @param handle The handle to set for the profile, must be unique and non-empty. * @param imageURI The URI to set for the profile image. * @param followModule The follow module to use, can be the zero address. * @param followModuleInitData The follow module initialization data, if any. * @param followNFTURI The URI to use for the follow NFT. */ struct CreateProfileData { address to; string handle; string imageURI; address followModule; bytes followModuleInitData; string followNFTURI; } /** * @notice A struct containing the parameters required for the `setDefaultProfileWithSig()` function. Parameters are * the same as the regular `setDefaultProfile()` function, with an added EIP712Signature. * * @param wallet The address of the wallet setting the default profile. * @param profileId The token ID of the profile which will be set as default, or zero. * @param sig The EIP712Signature struct containing the profile owner's signature. */ struct SetDefaultProfileWithSigData { address wallet; uint256 profileId; EIP712Signature sig; } /** * @notice A struct containing the parameters required for the `setFollowModuleWithSig()` function. Parameters are * the same as the regular `setFollowModule()` function, with an added EIP712Signature. * * @param profileId The token ID of the profile to change the followModule for. * @param followModule The followModule to set for the given profile, must be whitelisted. * @param followModuleInitData The data to be passed to the followModule for initialization. * @param sig The EIP712Signature struct containing the profile owner's signature. */ struct SetFollowModuleWithSigData { uint256 profileId; address followModule; bytes followModuleInitData; EIP712Signature sig; } /** * @notice A struct containing the parameters required for the `setDispatcherWithSig()` function. Parameters are the same * as the regular `setDispatcher()` function, with an added EIP712Signature. * * @param profileId The token ID of the profile to set the dispatcher for. * @param dispatcher The dispatcher address to set for the profile. * @param sig The EIP712Signature struct containing the profile owner's signature. */ struct SetDispatcherWithSigData { uint256 profileId; address dispatcher; EIP712Signature sig; } /** * @notice A struct containing the parameters required for the `setProfileImageURIWithSig()` function. Parameters are the same * as the regular `setProfileImageURI()` function, with an added EIP712Signature. * * @param profileId The token ID of the profile to set the URI for. * @param imageURI The URI to set for the given profile image. * @param sig The EIP712Signature struct containing the profile owner's signature. */ struct SetProfileImageURIWithSigData { uint256 profileId; string imageURI; EIP712Signature sig; } /** * @notice A struct containing the parameters required for the `setFollowNFTURIWithSig()` function. Parameters are the same * as the regular `setFollowNFTURI()` function, with an added EIP712Signature. * * @param profileId The token ID of the profile for which to set the followNFT URI. * @param followNFTURI The follow NFT URI to set. * @param sig The EIP712Signature struct containing the followNFT's associated profile owner's signature. */ struct SetFollowNFTURIWithSigData { uint256 profileId; string followNFTURI; EIP712Signature sig; } /** * @notice A struct containing the parameters required for the `post()` function. * * @param profileId The token ID of the profile to publish to. * @param contentURI The URI to set for this new publication. * @param collectModule The collect module to set for this new publication. * @param collectModuleInitData The data to pass to the collect module's initialization. * @param referenceModule The reference module to set for the given publication, must be whitelisted. * @param referenceModuleInitData The data to be passed to the reference module for initialization. */ struct PostData { uint256 profileId; string contentURI; address collectModule; bytes collectModuleInitData; address referenceModule; bytes referenceModuleInitData; } /** * @notice A struct containing the parameters required for the `postWithSig()` function. Parameters are the same as * the regular `post()` function, with an added EIP712Signature. * * @param profileId The token ID of the profile to publish to. * @param contentURI The URI to set for this new publication. * @param collectModule The collectModule to set for this new publication. * @param collectModuleInitData The data to pass to the collectModule's initialization. * @param referenceModule The reference module to set for the given publication, must be whitelisted. * @param referenceModuleInitData The data to be passed to the reference module for initialization. * @param sig The EIP712Signature struct containing the profile owner's signature. */ struct PostWithSigData { uint256 profileId; string contentURI; address collectModule; bytes collectModuleInitData; address referenceModule; bytes referenceModuleInitData; EIP712Signature sig; } /** * @notice A struct containing the parameters required for the `comment()` function. * * @param profileId The token ID of the profile to publish to. * @param contentURI The URI to set for this new publication. * @param profileIdPointed The profile token ID to point the comment to. * @param pubIdPointed The publication ID to point the comment to. * @param referenceModuleData The data passed to the reference module. * @param collectModule The collect module to set for this new publication. * @param collectModuleInitData The data to pass to the collect module's initialization. * @param referenceModule The reference module to set for the given publication, must be whitelisted. * @param referenceModuleInitData The data to be passed to the reference module for initialization. */ struct CommentData { uint256 profileId; string contentURI; uint256 profileIdPointed; uint256 pubIdPointed; bytes referenceModuleData; address collectModule; bytes collectModuleInitData; address referenceModule; bytes referenceModuleInitData; } /** * @notice A struct containing the parameters required for the `commentWithSig()` function. Parameters are the same as * the regular `comment()` function, with an added EIP712Signature. * * @param profileId The token ID of the profile to publish to. * @param contentURI The URI to set for this new publication. * @param profileIdPointed The profile token ID to point the comment to. * @param pubIdPointed The publication ID to point the comment to. * @param referenceModuleData The data passed to the reference module. * @param collectModule The collectModule to set for this new publication. * @param collectModuleInitData The data to pass to the collectModule's initialization. * @param referenceModule The reference module to set for the given publication, must be whitelisted. * @param referenceModuleInitData The data to be passed to the reference module for initialization. * @param sig The EIP712Signature struct containing the profile owner's signature. */ struct CommentWithSigData { uint256 profileId; string contentURI; uint256 profileIdPointed; uint256 pubIdPointed; bytes referenceModuleData; address collectModule; bytes collectModuleInitData; address referenceModule; bytes referenceModuleInitData; EIP712Signature sig; } /** * @notice A struct containing the parameters required for the `mirror()` function. * * @param profileId The token ID of the profile to publish to. * @param profileIdPointed The profile token ID to point the mirror to. * @param pubIdPointed The publication ID to point the mirror to. * @param referenceModuleData The data passed to the reference module. * @param referenceModule The reference module to set for the given publication, must be whitelisted. * @param referenceModuleInitData The data to be passed to the reference module for initialization. */ struct MirrorData { uint256 profileId; uint256 profileIdPointed; uint256 pubIdPointed; bytes referenceModuleData; address referenceModule; bytes referenceModuleInitData; } /** * @notice A struct containing the parameters required for the `mirrorWithSig()` function. Parameters are the same as * the regular `mirror()` function, with an added EIP712Signature. * * @param profileId The token ID of the profile to publish to. * @param profileIdPointed The profile token ID to point the mirror to. * @param pubIdPointed The publication ID to point the mirror to. * @param referenceModuleData The data passed to the reference module. * @param referenceModule The reference module to set for the given publication, must be whitelisted. * @param referenceModuleInitData The data to be passed to the reference module for initialization. * @param sig The EIP712Signature struct containing the profile owner's signature. */ struct MirrorWithSigData { uint256 profileId; uint256 profileIdPointed; uint256 pubIdPointed; bytes referenceModuleData; address referenceModule; bytes referenceModuleInitData; EIP712Signature sig; } /** * @notice A struct containing the parameters required for the `followWithSig()` function. Parameters are the same * as the regular `follow()` function, with the follower's (signer) address and an EIP712Signature added. * * @param follower The follower which is the message signer. * @param profileIds The array of token IDs of the profiles to follow. * @param datas The array of arbitrary data to pass to the followModules if needed. * @param sig The EIP712Signature struct containing the follower's signature. */ struct FollowWithSigData { address follower; uint256[] profileIds; bytes[] datas; EIP712Signature sig; } /** * @notice A struct containing the parameters required for the `collectWithSig()` function. Parameters are the same as * the regular `collect()` function, with the collector's (signer) address and an EIP712Signature added. * * @param collector The collector which is the message signer. * @param profileId The token ID of the profile that published the publication to collect. * @param pubId The publication to collect's publication ID. * @param data The arbitrary data to pass to the collectModule if needed. * @param sig The EIP712Signature struct containing the collector's signature. */ struct CollectWithSigData { address collector; uint256 profileId; uint256 pubId; bytes data; EIP712Signature sig; } /** * @notice A struct containing the parameters required for the `setProfileMetadataWithSig()` function. * * @param profileId The profile ID for which to set the metadata. * @param metadata The metadata string to set for the profile and user. * @param sig The EIP712Signature struct containing the user's signature. */ struct SetProfileMetadataWithSigData { uint256 profileId; string metadata; EIP712Signature sig; } /** * @notice A struct containing the parameters required for the `toggleFollowWithSig()` function. * * @param follower The follower which is the message signer. * @param profileIds The token ID array of the profiles. * @param enables The array of booleans to enable/disable follows. * @param sig The EIP712Signature struct containing the follower's signature. */ struct ToggleFollowWithSigData { address follower; uint256[] profileIds; bool[] enables; EIP712Signature sig; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; library Errors { error CannotInitImplementation(); error Initialized(); error SignatureExpired(); error ZeroSpender(); error SignatureInvalid(); error NotOwnerOrApproved(); error NotHub(); error TokenDoesNotExist(); error NotGovernance(); error NotGovernanceOrEmergencyAdmin(); error EmergencyAdminCannotUnpause(); error CallerNotWhitelistedModule(); error CollectModuleNotWhitelisted(); error FollowModuleNotWhitelisted(); error ReferenceModuleNotWhitelisted(); error ProfileCreatorNotWhitelisted(); error NotProfileOwner(); error NotProfileOwnerOrDispatcher(); error NotDispatcher(); error PublicationDoesNotExist(); error HandleTaken(); error HandleLengthInvalid(); error HandleContainsInvalidCharacters(); error HandleFirstCharInvalid(); error ProfileImageURILengthInvalid(); error CallerNotFollowNFT(); error CallerNotCollectNFT(); error BlockNumberInvalid(); error ArrayMismatch(); error CannotCommentOnSelf(); error NotWhitelisted(); // Module Errors error InitParamsInvalid(); error CollectExpired(); error FollowInvalid(); error ModuleDataMismatch(); error FollowNotApproved(); error MintLimitExceeded(); error CollectNotAllowed(); // MultiState Errors error Paused(); error PublishingPaused(); }
{ "optimizer": { "enabled": true, "runs": 200, "details": { "yul": true } }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"contract ILensHub","name":"hub","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"HandleContainsInvalidCharacters","type":"error"},{"inputs":[],"name":"HandleFirstCharInvalid","type":"error"},{"inputs":[],"name":"HandleLengthInvalid","type":"error"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"string","name":"handle","type":"string"},{"internalType":"string","name":"imageURI","type":"string"},{"internalType":"address","name":"followModule","type":"address"},{"internalType":"bytes","name":"followModuleInitData","type":"bytes"},{"internalType":"string","name":"followNFTURI","type":"string"}],"internalType":"struct DataTypes.CreateProfileData","name":"vars","type":"tuple"}],"name":"proxyCreateProfile","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b506040516105fd3803806105fd83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161057261008b600039600061018d01526105726000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c806307e5f94814610030575b600080fd5b61004361003e3660046102f3565b610045565b005b602081015151600581101561006d57604051633eb64ab360e01b815260040160405180910390fd5b60008260200151600081518110610086576100866103ee565b01602001516001600160f81b0319169050602d60f81b8114806100b65750605f60f81b6001600160f81b03198216145b806100ce5750601760f91b6001600160f81b03198216145b156100ec57604051632f2c22a760e11b815260040160405180910390fd5b60015b82811015610149578360200151818151811061010d5761010d6103ee565b6020910101516001600160f81b031916601760f91b141561014157604051630bb7f19b60e21b815260040160405180910390fd5b6001016100ef565b5060208084015160405161015d9201610430565b60408051601f198184030181529181526020850191909152516001620af63960e11b031981526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ffea138e906101c2908690600401610485565b6020604051808303816000875af11580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610523565b50505050565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff811182821017156102445761024461020b565b60405290565b80356001600160a01b038116811461026157600080fd5b919050565b600082601f83011261027757600080fd5b813567ffffffffffffffff808211156102925761029261020b565b604051601f8301601f19908116603f011681019082821181831017156102ba576102ba61020b565b816040528381528660208588010111156102d357600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561030557600080fd5b813567ffffffffffffffff8082111561031d57600080fd5b9083019060c0828603121561033157600080fd5b610339610221565b6103428361024a565b815260208301358281111561035657600080fd5b61036287828601610266565b60208301525060408301358281111561037a57600080fd5b61038687828601610266565b6040830152506103986060840161024a565b60608201526080830135828111156103af57600080fd5b6103bb87828601610266565b60808301525060a0830135828111156103d357600080fd5b6103df87828601610266565b60a08301525095945050505050565b634e487b7160e01b600052603260045260246000fd5b60005b8381101561041f578181015183820152602001610407565b838111156102055750506000910152565b60008251610442818460208701610404565b640b9d195cdd60da1b920191825250600501919050565b60008151808452610471816020860160208601610404565b601f01601f19169290920160200192915050565b60208152600060018060a01b03808451166020840152602084015160c060408501526104b460e0850182610459565b90506040850151601f19808684030160608701526104d28383610459565b925083606088015116608087015260808701519350808684030160a08701526104fb8385610459565b935060a08701519250808685030160c0870152505061051a8282610459565b95945050505050565b60006020828403121561053557600080fd5b505191905056fea2646970667358221220f814ff4c64538d0e39b966222b5df7c63f438655f6c0af8b20301b32ea30de8b64736f6c634300080a003300000000000000000000000060ae865ee4c725cd04353b5aab364553f56cef82
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000060ae865ee4c725cd04353b5aab364553f56cef82
-----Decoded View---------------
Arg [0] : hub (address): 0x60ae865ee4c725cd04353b5aab364553f56cef82
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000060ae865ee4c725cd04353b5aab364553f56cef82
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|