More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Loading...
Loading
This contract contains unverified libraries: ActionLib, GovernanceLib
Contract Name:
MultirecipientFeeCollectModule
Compiler Version
v0.8.21+commit.d9974bed
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import {Errors} from 'contracts/modules/constants/Errors.sol'; import {BaseFeeCollectModule} from 'contracts/modules/act/collect/base/BaseFeeCollectModule.sol'; import {BaseProfilePublicationData, BaseFeeCollectModuleInitData} from 'contracts/modules/interfaces/IBaseFeeCollectModule.sol'; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import {ICollectModule} from 'contracts/modules/interfaces/ICollectModule.sol'; import {ModuleTypes} from 'contracts/modules/libraries/constants/ModuleTypes.sol'; import {LensModuleMetadata} from 'contracts/modules/LensModuleMetadata.sol'; import {LensModule} from 'contracts/modules/LensModule.sol'; struct RecipientData { address recipient; uint16 split; // fraction of BPS_MAX (10 000) } /** * @notice A struct containing the necessary data to initialize MultirecipientFeeCollectModule. * * @param amount The collecting cost associated with this publication. Cannot be 0. * @param collectLimit The maximum number of collects for this publication. 0 for no limit. * @param currency The currency associated with this publication. * @param referralFee The referral fee associated with this publication. * @param followerOnly True if only followers of publisher may collect the post. * @param endTimestamp The end timestamp after which collecting is impossible. 0 for no expiry. * @param recipients Array of RecipientData items to split collect fees across multiple recipients. */ struct MultirecipientFeeCollectModuleInitData { uint160 amount; uint96 collectLimit; address currency; uint16 referralFee; bool followerOnly; uint72 endTimestamp; RecipientData[] recipients; } /** * @notice A struct containing the necessary data to execute collect actions on a publication. * * @param amount The collecting cost associated with this publication. Cannot be 0. * @param collectLimit The maximum number of collects for this publication. 0 for no limit. * @param currency The currency associated with this publication. * @param currentCollects The current number of collects for this publication. * @param referralFee The referral fee associated with this publication. * @param followerOnly True if only followers of publisher may collect the post. * @param endTimestamp The end timestamp after which collecting is impossible. 0 for no expiry. * @param recipients Array of RecipientData items to split collect fees across multiple recipients. */ struct MultirecipientFeeCollectProfilePublicationData { uint160 amount; uint96 collectLimit; address currency; uint96 currentCollects; uint16 referralFee; bool followerOnly; uint72 endTimestamp; RecipientData[] recipients; } error TooManyRecipients(); error InvalidRecipientSplits(); error RecipientSplitCannotBeZero(); /** * @title MultirecipientCollectModule * @author Lens Protocol * * @notice This is a simple Lens CollectModule implementation, allowing customization of time to collect, number of collects, * splitting collect fee across multiple recipients, and whether only followers can collect. * It is charging a fee for collect and distributing it among (one or up to five) Receivers, Referral, Treasury. */ contract MultirecipientFeeCollectModule is BaseFeeCollectModule, LensModuleMetadata { using SafeERC20 for IERC20; mapping(uint256 => mapping(uint256 => RecipientData[])) internal _recipientsByPublicationByProfile; constructor( address hub, address actionModule, address moduleRegistry, address moduleOwner ) BaseFeeCollectModule(hub, actionModule, moduleRegistry) LensModuleMetadata(moduleOwner) {} /** * @inheritdoc ICollectModule */ function initializePublicationCollectModule( uint256 profileId, uint256 pubId, address /* transactionExecutor */, bytes calldata data ) external override onlyActionModule returns (bytes memory) { MultirecipientFeeCollectModuleInitData memory initData = abi.decode( data, (MultirecipientFeeCollectModuleInitData) ); BaseFeeCollectModuleInitData memory baseInitData = BaseFeeCollectModuleInitData({ amount: initData.amount, collectLimit: initData.collectLimit, currency: initData.currency, referralFee: initData.referralFee, followerOnly: initData.followerOnly, endTimestamp: initData.endTimestamp, recipient: address(0) }); // Zero amount for collect doesn't make sense here (in a module with 5 recipients) // Better use SimpleFeeCollect module instead which allows 0 amount if (baseInitData.amount == 0 || initData.currency == address(0)) { revert Errors.InitParamsInvalid(); } _validateBaseInitData(baseInitData); _validateAndStoreRecipients(initData.recipients, profileId, pubId); _storeBasePublicationCollectParameters(profileId, pubId, baseInitData); return data; } /** * @dev Validates the recipients array and stores them to (a separate from Base) storage. * * @param recipients An array of recipients * @param profileId The profile ID who is publishing the publication. * @param pubId The associated publication's LensHub publication ID. */ function _validateAndStoreRecipients(RecipientData[] memory recipients, uint256 profileId, uint256 pubId) internal { uint256 len = recipients.length; // Check number of recipients is supported if (len < 2) { revert Errors.InitParamsInvalid(); } // Check recipient splits sum to 10 000 BPS (100%) uint256 totalSplits; uint256 i; while (i < len) { if (recipients[i].split == 0) revert RecipientSplitCannotBeZero(); totalSplits += recipients[i].split; // Store each recipient while looping - avoids extra gas costs in successful cases _recipientsByPublicationByProfile[profileId][pubId].push(recipients[i]); unchecked { ++i; } } if (totalSplits != BPS_MAX) { revert InvalidRecipientSplits(); } } /** * @dev Transfers the fee to multiple recipients. * * @inheritdoc BaseFeeCollectModule */ function _transferToRecipients( ModuleTypes.ProcessCollectParams calldata processCollectParams, address currency, uint256 amount ) internal override { RecipientData[] memory recipients = _recipientsByPublicationByProfile[ processCollectParams.publicationCollectedProfileId ][processCollectParams.publicationCollectedId]; uint256 len = recipients.length; uint256 i; while (i < len) { uint256 amountForRecipient = (amount * recipients[i].split) / BPS_MAX; if (amountForRecipient != 0) IERC20(currency).safeTransferFrom( processCollectParams.transactionExecutor, recipients[i].recipient, amountForRecipient ); unchecked { ++i; } } } /** * @notice Returns the publication data for a given publication, or an empty struct if that publication was not * initialized with this module. * * @param profileId The token ID of the profile mapped to the publication to query. * @param pubId The publication ID of the publication to query. * * @return The BaseProfilePublicationData struct mapped to that publication. */ function getPublicationData( uint256 profileId, uint256 pubId ) external view returns (MultirecipientFeeCollectProfilePublicationData memory) { BaseProfilePublicationData memory baseData = getBasePublicationData(profileId, pubId); RecipientData[] memory recipients = _recipientsByPublicationByProfile[profileId][pubId]; return MultirecipientFeeCollectProfilePublicationData({ amount: baseData.amount, collectLimit: baseData.collectLimit, currency: baseData.currency, currentCollects: baseData.currentCollects, referralFee: baseData.referralFee, followerOnly: baseData.followerOnly, endTimestamp: baseData.endTimestamp, recipients: recipients }); } function supportsInterface( bytes4 interfaceID ) public pure override(BaseFeeCollectModule, LensModule) returns (bool) { return BaseFeeCollectModule.supportsInterface(interfaceID) || LensModule.supportsInterface(interfaceID); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; /** * @title IERC721Burnable * @author Lens Protocol * * @notice Extension of ERC-721 including a function that allows the token to be burned. */ interface IERC721Burnable { /** * @notice Burns an NFT, removing it from circulation and essentially destroying it. * @custom:permission Owner of the NFT. * * @param tokenId The token ID of the token to burn. */ function burn(uint256 tokenId) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; /** * @title IERC721MetaTx * @author Lens Protocol * * @notice Extension of ERC-721 including meta-tx signatures related functions. */ interface IERC721MetaTx { /** * @notice Returns the current signature nonce of the given signer. * * @param signer The address for which to query the nonce. * * @return uint256 The current nonce of the given signer. */ function nonces(address signer) external view returns (uint256); /** * @notice Returns the EIP-712 domain separator for this contract. * * @return bytes32 The domain separator. */ function getDomainSeparator() external view returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; import {Types} from 'contracts/libraries/constants/Types.sol'; /** * @title IERC721Timestamped * @author Lens Protocol * * @notice Extension of ERC-721 including a struct for token data, which contains the owner and the mint timestamp, as * well as their associated getters. */ interface IERC721Timestamped { /** * @notice Returns the mint timestamp associated with a given NFT. * * @param tokenId The token ID of the NFT to query the mint timestamp for. * * @return uint256 Mint timestamp, this is stored as a uint96 but returned as a uint256 to reduce unnecessary * padding. */ function mintTimestampOf(uint256 tokenId) external view returns (uint256); /** * @notice Returns the token data associated with a given NFT. This allows fetching the token owner and * mint timestamp in a single call. * * @param tokenId The token ID of the NFT to query the token data for. * * @return TokenData A struct containing both the owner address and the mint timestamp. */ function tokenDataOf(uint256 tokenId) external view returns (Types.TokenData memory); /** * @notice Returns whether a token with the given token ID exists. * * @param tokenId The token ID of the NFT to check existence for. * * @return bool True if the token exists. */ function exists(uint256 tokenId) external view returns (bool); /** * @notice Returns the amount of tokens in circulation. * * @return uint256 The current total supply of tokens. */ function totalSupply() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; import {IERC721} from '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import {IERC721Timestamped} from 'contracts/interfaces/IERC721Timestamped.sol'; import {IERC721Burnable} from 'contracts/interfaces/IERC721Burnable.sol'; import {IERC721MetaTx} from 'contracts/interfaces/IERC721MetaTx.sol'; import {IERC721Metadata} from '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol'; interface ILensERC721 is IERC721, IERC721Timestamped, IERC721Burnable, IERC721MetaTx, IERC721Metadata {}
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; import {Types} from 'contracts/libraries/constants/Types.sol'; /** * @title ILensGovernable * @author Lens Protocol * * @notice This is the interface for the Lens Protocol main governance functions. */ interface ILensGovernable { /** * @notice Sets the privileged governance role. * @custom:permissions Governance. * * @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. * @custom:permissions Governance. * * @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. * @custom:permissions Governance or Emergency Admin. Emergency Admin can only restrict more. * * @param newState The state to set. It can be one of the following: * - Unpaused: The protocol is fully operational. * - PublishingPaused: The protocol is paused for publishing, but it is still operational for others operations. * - Paused: The protocol is paused for all operations. */ function setState(Types.ProtocolState newState) external; /** * @notice Adds or removes a profile creator from the whitelist. * @custom:permissions Governance. * * @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 Sets the treasury address. * @custom:permissions Governance * * @param newTreasury The new treasury address to set. */ function setTreasury(address newTreasury) external; /** * @notice Sets the treasury fee. * @custom:permissions Governance * * @param newTreasuryFee The new treasury fee to set. */ function setTreasuryFee(uint16 newTreasuryFee) external; /** * @notice Returns the currently configured governance address. * * @return address The address of the currently configured governance. */ function getGovernance() external view returns (address); /** * @notice Gets the state currently set in the protocol. It could be a global pause, a publishing pause or an * unpaused state. * @custom:permissions Anyone. * * @return Types.ProtocolState The state currently set in the protocol. */ function getState() external view returns (Types.ProtocolState); /** * @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 the treasury address. * * @return address The treasury address. */ function getTreasury() external view returns (address); /** * @notice Returns the treasury fee. * * @return uint16 The treasury fee. */ function getTreasuryFee() external view returns (uint16); /** * @notice Returns the treasury address and treasury fee in a single call. * * @return tuple First, the treasury address, second, the treasury fee. */ function getTreasuryData() external view returns (address, uint16); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; import {ILensProtocol} from 'contracts/interfaces/ILensProtocol.sol'; import {ILensGovernable} from 'contracts/interfaces/ILensGovernable.sol'; import {ILensHubEventHooks} from 'contracts/interfaces/ILensHubEventHooks.sol'; import {ILensImplGetters} from 'contracts/interfaces/ILensImplGetters.sol'; import {ILensProfiles} from 'contracts/interfaces/ILensProfiles.sol'; import {ILensVersion} from 'contracts/interfaces/ILensVersion.sol'; interface ILensHub is ILensProfiles, ILensProtocol, ILensGovernable, ILensHubEventHooks, ILensImplGetters, ILensVersion {}
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; /** * @title ILensHubEventHooks * @author Lens Protocol * * @notice This is the interface for the LensHub contract's event hooks. As we want most of the core events to be * emitted by the LensHub contract, event hooks are needed for core events generated by pheripheral contracts. */ interface ILensHubEventHooks { /** * @dev Helper function to emit an `Unfollowed` event from the hub, to be consumed by indexers to track unfollows. * @custom:permissions FollowNFT of the Profile unfollowed. * * @param unfollowerProfileId The ID of the profile that executed the unfollow. * @param idOfProfileUnfollowed The ID of the profile that was unfollowed. * @param transactionExecutor The address of the account executing the unfollow operation. */ function emitUnfollowedEvent( uint256 unfollowerProfileId, uint256 idOfProfileUnfollowed, address transactionExecutor ) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; /** * @title ILensImplGetters * @author Lens Protocol * * @notice This is the interface for the LensHub contract's implementation getters. These implementations will be used * for deploying each respective contract for each profile. */ interface ILensImplGetters { /** * @notice Returns the Follow NFT implementation address that is used for all deployed Follow NFTs. * * @return address The Follow NFT implementation address. */ function getFollowNFTImpl() external view returns (address); /** * @notice Returns the Collect NFT implementation address that is used for each new deployed Collect NFT. * @custom:pending-deprecation * * @return address The Collect NFT implementation address. */ function getLegacyCollectNFTImpl() external view returns (address); /** * @notice Returns the address of the registry that stores all modules that are used by the Lens Protocol. * * @return address The address of the Module Registry contract. */ function getModuleRegistry() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; import {ILensERC721} from 'contracts/interfaces/ILensERC721.sol'; interface ILensProfiles is ILensERC721 { /** * @notice DANGER: Triggers disabling the profile protection mechanism for the msg.sender, which will allow * transfers or approvals over profiles held by it. * Disabling the mechanism will have a timelock before it becomes effective, allowing the owner to re-enable * the protection back in case of being under attack. * The protection layer only applies to EOA wallets. */ function DANGER__disableTokenGuardian() external; /** * @notice Enables back the profile protection mechanism for the msg.sender, preventing profile transfers or * approvals (except when revoking them). * The protection layer only applies to EOA wallets. */ function enableTokenGuardian() external; /** * @notice Returns the timestamp at which the Token Guardian will become effectively disabled. * * @param wallet The address to check the timestamp for. * * @return uint256 The timestamp at which the Token Guardian will become effectively disabled. Zero if enabled. */ function getTokenGuardianDisablingTimestamp(address wallet) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; import {Types} from 'contracts/libraries/constants/Types.sol'; /** * @title ILensProtocol * @author Lens Protocol * * @notice This is the interface for Lens Protocol's core functions. It contains all the entry points for performing * social operations. */ interface ILensProtocol { /** * @notice Creates a profile with the specified parameters, minting a Profile NFT to the given recipient. * @custom:permissions Any whitelisted profile creator. * * @param createProfileParams A CreateProfileParams struct containing the needed params. */ function createProfile(Types.CreateProfileParams calldata createProfileParams) external returns (uint256); /** * @notice Sets the metadata URI for the given profile. * @custom:permissions Profile Owner or Delegated Executor. * * @param profileId The token ID of the profile to set the metadata URI for. * @param metadataURI The metadata URI to set for the given profile. */ function setProfileMetadataURI(uint256 profileId, string calldata metadataURI) external; /** * @custom:meta-tx setProfileMetadataURI. */ function setProfileMetadataURIWithSig( uint256 profileId, string calldata metadataURI, Types.EIP712Signature calldata signature ) external; /** * @notice Sets the follow module for the given profile. * @custom:permissions Profile Owner or Delegated Executor. * * @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; /** * @custom:meta-tx setFollowModule. */ function setFollowModuleWithSig( uint256 profileId, address followModule, bytes calldata followModuleInitData, Types.EIP712Signature calldata signature ) external; /** * @notice Changes the delegated executors configuration for the given profile. It allows setting the approvals for * delegated executors in the specified configuration, as well as switching to it. * @custom:permissions Profile Owner. * * @param delegatorProfileId The ID of the profile to which the delegated executor is being changed for. * @param delegatedExecutors The array of delegated executors to set the approval for. * @param approvals The array of booleans indicating the corresponding executor's new approval status. * @param configNumber The number of the configuration where the executor approval state is being set. * @param switchToGivenConfig A boolean indicating if the configuration must be switched to the one with the given * number. */ function changeDelegatedExecutorsConfig( uint256 delegatorProfileId, address[] calldata delegatedExecutors, bool[] calldata approvals, uint64 configNumber, bool switchToGivenConfig ) external; /** * @notice Changes the delegated executors configuration for the given profile under the current configuration. * @custom:permissions Profile Owner. * * @param delegatorProfileId The ID of the profile to which the delegated executor is being changed for. * @param delegatedExecutors The array of delegated executors to set the approval for. * @param approvals The array of booleans indicating the corresponding executor's new approval status. */ function changeDelegatedExecutorsConfig( uint256 delegatorProfileId, address[] calldata delegatedExecutors, bool[] calldata approvals ) external; /** * @custom:meta-tx changeDelegatedExecutorsConfig. */ function changeDelegatedExecutorsConfigWithSig( uint256 delegatorProfileId, address[] calldata delegatedExecutors, bool[] calldata approvals, uint64 configNumber, bool switchToGivenConfig, Types.EIP712Signature calldata signature ) external; /** * @notice Publishes a post. * Post is the most basic publication type, and can be used to publish any kind of content. * Posts can have these types of modules initialized: * - Action modules: any number of publication actions (e.g. collect, tip, etc.) * - Reference module: a module handling the rules when referencing this post (e.g. token-gated comments) * @custom:permissions Profile Owner or Delegated Executor. * * @param postParams A PostParams struct containing the needed parameters. * * @return uint256 An integer representing the post's publication ID. */ function post(Types.PostParams calldata postParams) external returns (uint256); /** * @custom:meta-tx post. */ function postWithSig( Types.PostParams calldata postParams, Types.EIP712Signature calldata signature ) external returns (uint256); /** * @notice Publishes a comment on the given publication. * Comment is a type of reference publication that points to another publication. * Comments can have these types of modules initialized: * - Action modules: any number of publication actions (e.g. collect, tip, etc.) * - Reference module: a module handling the rules when referencing this comment (e.g. token-gated mirrors) * Comments can have referrers (e.g. publications or profiles that helped to discover the pointed publication). * @custom:permissions Profile Owner or Delegated Executor. * * @param commentParams A CommentParams struct containing the needed parameters. * * @return uint256 An integer representing the comment's publication ID. */ function comment(Types.CommentParams calldata commentParams) external returns (uint256); /** * @custom:meta-tx comment. */ function commentWithSig( Types.CommentParams calldata commentParams, Types.EIP712Signature calldata signature ) external returns (uint256); /** * @notice Publishes a mirror of the given publication. * Mirror is a type of reference publication that points to another publication but doesn't have content. * Mirrors don't have any modules initialized. * Mirrors can have referrers (e.g. publications or profiles that allowed to discover the pointed publication). * You cannot mirror a mirror, comment on a mirror, or quote a mirror. * @custom:permissions Profile Owner or Delegated Executor. * * @param mirrorParams A MirrorParams struct containing the necessary parameters. * * @return uint256 An integer representing the mirror's publication ID. */ function mirror(Types.MirrorParams calldata mirrorParams) external returns (uint256); /** * @custom:meta-tx mirror. */ function mirrorWithSig( Types.MirrorParams calldata mirrorParams, Types.EIP712Signature calldata signature ) external returns (uint256); /** * @notice Publishes a quote of the given publication. * Quote is a type of reference publication similar to mirror, but it has content and modules. * Quotes can have these types of modules initialized: * - Action modules: any number of publication actions (e.g. collect, tip, etc.) * - Reference module: a module handling the rules when referencing this quote (e.g. token-gated comments on quote) * Quotes can have referrers (e.g. publications or profiles that allowed to discover the pointed publication). * Unlike mirrors, you can mirror a quote, comment on a quote, or quote a quote. * @custom:permissions Profile Owner or Delegated Executor. * * @param quoteParams A QuoteParams struct containing the needed parameters. * * @return uint256 An integer representing the quote's publication ID. */ function quote(Types.QuoteParams calldata quoteParams) external returns (uint256); /** * @custom:meta-tx quote. */ function quoteWithSig( Types.QuoteParams calldata quoteParams, Types.EIP712Signature calldata signature ) external returns (uint256); /** * @notice Follows given profiles, executing each profile's follow module logic (if any). * @custom:permissions Profile Owner or Delegated Executor. * * @dev Both the `idsOfProfilesToFollow`, `followTokenIds`, and `datas` arrays must be of the same length, * regardless if the profiles do not have a follow module set. * * @param followerProfileId The ID of the profile the follows are being executed for. * @param idsOfProfilesToFollow The array of IDs of profiles to follow. * @param followTokenIds The array of follow token IDs to use for each follow (0 if you don't own a follow token). * @param datas The arbitrary data array to pass to the follow module for each profile if needed. * * @return uint256[] An array of follow token IDs representing the follow tokens created for each follow. */ function follow( uint256 followerProfileId, uint256[] calldata idsOfProfilesToFollow, uint256[] calldata followTokenIds, bytes[] calldata datas ) external returns (uint256[] memory); /** * @custom:meta-tx follow. */ function followWithSig( uint256 followerProfileId, uint256[] calldata idsOfProfilesToFollow, uint256[] calldata followTokenIds, bytes[] calldata datas, Types.EIP712Signature calldata signature ) external returns (uint256[] memory); /** * @notice Unfollows given profiles. * @custom:permissions Profile Owner or Delegated Executor. * * @param unfollowerProfileId The ID of the profile the unfollows are being executed for. * @param idsOfProfilesToUnfollow The array of IDs of profiles to unfollow. */ function unfollow(uint256 unfollowerProfileId, uint256[] calldata idsOfProfilesToUnfollow) external; /** * @custom:meta-tx unfollow. */ function unfollowWithSig( uint256 unfollowerProfileId, uint256[] calldata idsOfProfilesToUnfollow, Types.EIP712Signature calldata signature ) external; /** * @notice Sets the block status for the given profiles. Changing a profile's block status to `true` (i.e. blocked), * when will also force them to unfollow. * Blocked profiles cannot perform any actions with the profile that blocked them: they cannot comment or mirror * their publications, they cannot follow them, they cannot collect, tip them, etc. * @custom:permissions Profile Owner or Delegated Executor. * * @dev Both the `idsOfProfilesToSetBlockStatus` and `blockStatus` arrays must be of the same length. * * @param byProfileId The ID of the profile that is blocking/unblocking somebody. * @param idsOfProfilesToSetBlockStatus The array of IDs of profiles to set block status. * @param blockStatus The array of block statuses to use for each (true is blocked). */ function setBlockStatus( uint256 byProfileId, uint256[] calldata idsOfProfilesToSetBlockStatus, bool[] calldata blockStatus ) external; /** * @custom:meta-tx setBlockStatus. */ function setBlockStatusWithSig( uint256 byProfileId, uint256[] calldata idsOfProfilesToSetBlockStatus, bool[] calldata blockStatus, Types.EIP712Signature calldata signature ) external; /** * @notice Collects a given publication via signature with the specified parameters. * Collect can have referrers (e.g. publications or profiles that allowed to discover the pointed publication). * @custom:permissions Collector Profile Owner or its Delegated Executor. * @custom:pending-deprecation Collect modules were replaced by PublicationAction Collect modules in V2. This method * is left here for backwards compatibility with posts made in V1 that had Collect modules. * * @param collectParams A CollectParams struct containing the parameters. * * @return uint256 An integer representing the minted token ID. */ function collectLegacy(Types.LegacyCollectParams calldata collectParams) external returns (uint256); /** * @custom:meta-tx collect. * @custom:pending-deprecation */ function collectLegacyWithSig( Types.LegacyCollectParams calldata collectParams, Types.EIP712Signature calldata signature ) external returns (uint256); /** * @notice Acts on a given publication with the specified parameters. * You can act on a publication except a mirror (if it has at least one action module initialized). * Actions can have referrers (e.g. publications or profiles that allowed to discover the pointed publication). * @custom:permissions Actor Profile Owner or its Delegated Executor. * * @param publicationActionParams A PublicationActionParams struct containing the parameters. * * @return bytes Arbitrary data the action module returns. */ function act(Types.PublicationActionParams calldata publicationActionParams) external returns (bytes memory); /** * @custom:meta-tx act. */ function actWithSig( Types.PublicationActionParams calldata publicationActionParams, Types.EIP712Signature calldata signature ) external returns (bytes memory); /** * @dev This function is used to invalidate signatures by incrementing the nonce of the signer. * @param increment The amount to increment the nonce by (max 255). */ function incrementNonce(uint8 increment) external; ///////////////////////////////// /// VIEW FUNCTIONS /// ///////////////////////////////// /** * @notice Returns whether or not `followerProfileId` is following `followedProfileId`. * * @param followerProfileId The ID of the profile whose following state should be queried. * @param followedProfileId The ID of the profile whose followed state should be queried. * * @return bool True if `followerProfileId` is following `followedProfileId`, false otherwise. */ function isFollowing(uint256 followerProfileId, uint256 followedProfileId) external view returns (bool); /** * @notice Returns whether the given address is approved as delegated executor, in the configuration with the given * number, to act on behalf of the given profile. * * @param delegatorProfileId The ID of the profile to check the delegated executor approval for. * @param delegatedExecutor The address to query the delegated executor approval for. * @param configNumber The number of the configuration where the executor approval state is being queried. * * @return bool True if the address is approved as a delegated executor to act on behalf of the profile in the * given configuration, false otherwise. */ function isDelegatedExecutorApproved( uint256 delegatorProfileId, address delegatedExecutor, uint64 configNumber ) external view returns (bool); /** * @notice Returns whether the given address is approved as delegated executor, in the current configuration, to act * on behalf of the given profile. * * @param delegatorProfileId The ID of the profile to check the delegated executor approval for. * @param delegatedExecutor The address to query the delegated executor approval for. * * @return bool True if the address is approved as a delegated executor to act on behalf of the profile in the * current configuration, false otherwise. */ function isDelegatedExecutorApproved( uint256 delegatorProfileId, address delegatedExecutor ) external view returns (bool); /** * @notice Returns the current delegated executor config number for the given profile. * * @param delegatorProfileId The ID of the profile from which the delegated executors config number is being queried * * @return uint256 The current delegated executor configuration number. */ function getDelegatedExecutorsConfigNumber(uint256 delegatorProfileId) external view returns (uint64); /** * @notice Returns the previous used delegated executor config number for the given profile. * * @param delegatorProfileId The ID of the profile from which the delegated executors' previous configuration number * set is being queried. * * @return uint256 The delegated executor configuration number previously set. It will coincide with the current * configuration set if it was never switched from the default one. */ function getDelegatedExecutorsPrevConfigNumber(uint256 delegatorProfileId) external view returns (uint64); /** * @notice Returns the maximum delegated executor config number for the given profile. * This is the maximum config number that was ever used by this profile. * When creating a new clean configuration, you can only use a number that is maxConfigNumber + 1. * * @param delegatorProfileId The ID of the profile from which the delegated executors' maximum configuration number * set is being queried. * * @return uint256 The delegated executor maximum configuration number set. */ function getDelegatedExecutorsMaxConfigNumberSet(uint256 delegatorProfileId) external view returns (uint64); /** * @notice Returns whether `profileId` is blocked by `byProfileId`. * See setBlockStatus() for more information on how blocking works on the platform. * * @param profileId The ID of the profile whose blocked status should be queried. * @param byProfileId The ID of the profile whose blocker status should be queried. * * @return bool True if `profileId` is blocked by `byProfileId`, false otherwise. */ function isBlocked(uint256 profileId, uint256 byProfileId) external view returns (bool); /** * @notice Returns the URI associated with a given publication. * This is used to store the publication's metadata, e.g.: content, images, etc. * * @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 full profile struct associated with a given profile token ID. * * @param profileId The token ID of the profile to query. * * @return Profile The profile struct of the given profile. */ function getProfile(uint256 profileId) external view returns (Types.Profile 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 Publication The publication struct associated with the queried publication. */ function getPublication(uint256 profileId, uint256 pubId) external view returns (Types.PublicationMemory memory); /** * @notice Returns the type of a given publication. * The type can be one of the following (see PublicationType enum): * - Nonexistent * - Post * - Comment * - Mirror * - Quote * * @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 PublicationType The publication type of the queried publication. */ function getPublicationType(uint256 profileId, uint256 pubId) external view returns (Types.PublicationType); /** * @notice Returns wether a given Action Module is enabled 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. * @param module The address of the Action Module to query. * * @return bool True if the Action Module is enabled for the queried publication, false if not. */ function isActionModuleEnabledInPublication( uint256 profileId, uint256 pubId, address module ) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; /** * @title ILensVersion * @author Lens Protocol * * @notice This is the interface for the LensHub Version getters and emitter. * It allows to emit a LensHub version during an upgrade, and also to get the current version. */ interface ILensVersion { /** * @notice Returns the LensHub current Version. * * @return version The LensHub current Version. */ function getVersion() external view returns (string memory); /** * @notice Returns the LensHub current Git Commit. * * @return gitCommit The LensHub current Git Commit. */ function getGitCommit() external view returns (bytes20); /** * @notice Emits the LensHub current Version. Used in upgradeAndCall(). */ function emitVersion() external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.15; interface IModuleRegistry { enum ModuleType { __, // Just to avoid 0 as valid ModuleType PUBLICATION_ACTION_MODULE, REFERENCE_MODULE, FOLLOW_MODULE } // Modules functions function verifyModule(address moduleAddress, uint256 moduleType) external returns (bool); function registerModule(address moduleAddress, uint256 moduleType) external returns (bool); function getModuleTypes(address moduleAddress) external view returns (uint256); function isModuleRegistered(address moduleAddress) external view returns (bool); function isModuleRegisteredAs(address moduleAddress, uint256 moduleType) external view returns (bool); // Currencies functions function verifyErc20Currency(address currencyAddress) external returns (bool); function registerErc20Currency(address currencyAddress) external returns (bool); function isErc20CurrencyRegistered(address currencyAddress) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; library Errors { error CannotInitImplementation(); error Initialized(); error SignatureExpired(); error SignatureInvalid(); error InvalidOwner(); error NotOwnerOrApproved(); error NotHub(); error TokenDoesNotExist(); error NotGovernance(); error NotGovernanceOrEmergencyAdmin(); error EmergencyAdminCanOnlyPauseFurther(); error NotProfileOwner(); error PublicationDoesNotExist(); error CallerNotFollowNFT(); error CallerNotCollectNFT(); // Legacy error ArrayMismatch(); error NotWhitelisted(); error NotRegistered(); error InvalidParameter(); error ExecutorInvalid(); error Blocked(); error SelfBlock(); error NotFollowing(); error SelfFollow(); error InvalidReferrer(); error InvalidPointedPub(); error NonERC721ReceiverImplementer(); error AlreadyEnabled(); // Module Errors error InitParamsInvalid(); error ActionNotAllowed(); error CollectNotAllowed(); // Used in LegacyCollectLib (pending deprecation) // MultiState Errors error Paused(); error PublishingPaused(); // Profile Guardian Errors error GuardianEnabled(); error NotEOA(); error DisablingAlreadyTriggered(); // Migration Errors error NotMigrationAdmin(); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; /** * @title Types * @author Lens Protocol * * @notice A standard library of data types used throughout the Lens Protocol. */ library Types { /** * @notice 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. * * @param owner The token owner. * @param mintTimestamp The mint timestamp. */ struct TokenData { address owner; uint96 mintTimestamp; } /** * @notice A struct containing token follow-related data. * * @param followerProfileId The ID of the profile using the token to follow. * @param originalFollowTimestamp The timestamp of the first follow performed with the token. * @param followTimestamp The timestamp of the current follow, if a profile is using the token to follow. * @param profileIdAllowedToRecover The ID of the profile allowed to recover the follow ID, if any. */ struct FollowData { uint160 followerProfileId; uint48 originalFollowTimestamp; uint48 followTimestamp; uint256 profileIdAllowedToRecover; } /** * @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 Nonexistent An indicator showing the queried publication does not exist. * @param Post A standard post, having an URI, action modules and no pointer to another publication. * @param Comment A comment, having an URI, action modules and a pointer to another publication. * @param Mirror A mirror, having a pointer to another publication, but no URI or action modules. * @param Quote A quote, having an URI, action modules, and a pointer to another publication. */ enum PublicationType { Nonexistent, Post, Comment, Mirror, Quote } /** * @notice A struct containing the necessary information to reconstruct an EIP-712 typed data signature. * * @param signer The address of the signer. Specially needed as a parameter to support EIP-1271. * @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 { address signer; 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 address(0) in none. * @param followNFT The address of the followNFT associated with this profile. It can be address(0) if the * profile has not been followed yet, as the collection is lazy-deployed upon the first follow. * @param __DEPRECATED__handle DEPRECATED in V2: handle slot, was replaced with LensHandles. * @param __DEPRECATED__imageURI DEPRECATED in V2: The URI to be used for the profile image. * @param __DEPRECATED__followNFTURI DEPRECATED in V2: The URI used for the follow NFT image. * @param metadataURI MetadataURI is used to store the profile's metadata, for example: displayed name, description, * interests, etc. */ struct Profile { uint256 pubCount; // offset 0 address followModule; // offset 1 address followNFT; // offset 2 string __DEPRECATED__handle; // offset 3 string __DEPRECATED__imageURI; // offset 4 string __DEPRECATED__followNFTURI; // Deprecated in V2 as we have a common tokenURI for all Follows, offset 5 string metadataURI; // offset 6 } /** * @notice A struct containing publication data. * * @param pointedProfileId The profile token ID to point the publication to. * @param pointedPubId The publication ID to point the publication to. * These are used to implement the "reference" feature of the platform and is used in: * - Mirrors * - Comments * - Quotes * There are (0,0) if the publication is not pointing to any other publication (i.e. the publication is a Post). * @param contentURI The URI to set for the content of publication (can be ipfs, arweave, http, etc). * @param referenceModule Reference module associated with this profile, if any. * @param __DEPRECATED__collectModule Collect module associated with this publication, if any. Deprecated in V2. * @param __DEPRECATED__collectNFT Collect NFT associated with this publication, if any. Deprecated in V2. * @param pubType The type of publication, can be Nonexistent, Post, Comment, Mirror or Quote. * @param rootProfileId The profile ID of the root post (to determine if comments/quotes and mirrors come from it). * Posts, V1 publications and publications rooted in V1 publications don't have it set. * @param rootPubId The publication ID of the root post (to determine if comments/quotes and mirrors come from it). * Posts, V1 publications and publications rooted in V1 publications don't have it set. * @param actionModuleEnabled The action modules enabled in a given publication. */ struct Publication { uint256 pointedProfileId; uint256 pointedPubId; string contentURI; address referenceModule; address __DEPRECATED__collectModule; // Deprecated in V2 address __DEPRECATED__collectNFT; // Deprecated in V2 // Added in Lens V2, so these will be zero for old publications: PublicationType pubType; uint256 rootProfileId; uint256 rootPubId; mapping(address => bool) actionModuleEnabled; } struct PublicationMemory { uint256 pointedProfileId; uint256 pointedPubId; string contentURI; address referenceModule; address __DEPRECATED__collectModule; // Deprecated in V2 address __DEPRECATED__collectNFT; // Deprecated in V2 // Added in Lens V2, so these will be zero for old publications: PublicationType pubType; uint256 rootProfileId; uint256 rootPubId; // bytes32 __ACTION_MODULE_ENABLED_MAPPING; // Mappings are not supported in memory. } /** * @notice A struct containing the parameters required for the `createProfile()` function. * * @param to The address receiving the profile. * @param followModule The follow module to use, can be the zero address. * @param followModuleInitData The follow module initialization data, if any. */ struct CreateProfileParams { address to; address followModule; bytes followModuleInitData; } /** * @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 actionModules The action modules to set for this new publication. * @param actionModulesInitDatas The data to pass to the action modules' 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 PostParams { uint256 profileId; string contentURI; address[] actionModules; bytes[] actionModulesInitDatas; address referenceModule; bytes referenceModuleInitData; } /** * @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 pointedProfileId The profile token ID to point the comment to. * @param pointedPubId The publication ID to point the comment to. * @param referrerProfileId The profile token ID of the publication that referred to the publication being commented on/quoted. * @param referrerPubId The ID of the publication that referred to the publication being commented on/quoted. * @param referenceModuleData The data passed to the reference module. * @param actionModules The action modules to set for this new publication. * @param actionModulesInitDatas The data to pass to the action modules' 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 CommentParams { uint256 profileId; string contentURI; uint256 pointedProfileId; uint256 pointedPubId; uint256[] referrerProfileIds; uint256[] referrerPubIds; bytes referenceModuleData; address[] actionModules; bytes[] actionModulesInitDatas; address referenceModule; bytes referenceModuleInitData; } /** * @notice A struct containing the parameters required for the `quote()` function. * * @param profileId The token ID of the profile to publish to. * @param contentURI The URI to set for this new publication. * @param pointedProfileId The profile token ID of the publication author that is quoted. * @param pointedPubId The publication ID that is quoted. * @param referrerProfileId The profile token ID of the publication that referred to the publication being commented on/quoted. * @param referrerPubId The ID of the publication that referred to the publication being commented on/quoted. * @param referenceModuleData The data passed to the reference module. * @param actionModules The action modules to set for this new publication. * @param actionModulesInitDatas The data to pass to the action modules' 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 QuoteParams { uint256 profileId; string contentURI; uint256 pointedProfileId; uint256 pointedPubId; uint256[] referrerProfileIds; uint256[] referrerPubIds; bytes referenceModuleData; address[] actionModules; bytes[] actionModulesInitDatas; address referenceModule; bytes referenceModuleInitData; } /** * @notice A struct containing the parameters required for the `comment()` or `quote()` internal functions. * * @param profileId The token ID of the profile to publish to. * @param contentURI The URI to set for this new publication. * @param pointedProfileId The profile token ID of the publication author that is commented on/quoted. * @param pointedPubId The publication ID that is commented on/quoted. * @param referrerProfileId The profile token ID of the publication that referred to the publication being commented on/quoted. * @param referrerPubId The ID of the publication that referred to the publication being commented on/quoted. * @param referenceModuleData The data passed to the reference module. * @param actionModules The action modules to set for this new publication. * @param actionModulesInitDatas The data to pass to the action modules' 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 ReferencePubParams { uint256 profileId; string contentURI; uint256 pointedProfileId; uint256 pointedPubId; uint256[] referrerProfileIds; uint256[] referrerPubIds; bytes referenceModuleData; address[] actionModules; bytes[] actionModulesInitDatas; address referenceModule; bytes referenceModuleInitData; } /** * @notice A struct containing the parameters required for the `mirror()` function. * * @param profileId The token ID of the profile to publish to. * @param metadataURI the URI containing metadata attributes to attach to this mirror publication. * @param pointedProfileId The profile token ID to point the mirror to. * @param pointedPubId The publication ID to point the mirror to. * @param referenceModuleData The data passed to the reference module. */ struct MirrorParams { uint256 profileId; string metadataURI; uint256 pointedProfileId; uint256 pointedPubId; uint256[] referrerProfileIds; uint256[] referrerPubIds; bytes referenceModuleData; } /** * Deprecated in V2: Will be removed after some time after upgrading to V2. * @notice A struct containing the parameters required for the legacy `collect()` function. * @dev The referrer can only be a mirror of the publication being collected. * * @param publicationCollectedProfileId The token ID of the profile that published the publication to collect. * @param publicationCollectedId The publication to collect's publication ID. * @param collectorProfileId The collector profile. * @param referrerProfileId The ID of a profile that authored a mirror that helped discovering the collected pub. * @param referrerPubId The ID of the mirror that helped discovering the collected pub. * @param collectModuleData The arbitrary data to pass to the collectModule if needed. */ struct LegacyCollectParams { uint256 publicationCollectedProfileId; uint256 publicationCollectedId; uint256 collectorProfileId; uint256 referrerProfileId; uint256 referrerPubId; bytes collectModuleData; } /** * @notice A struct containing the parameters required for the `action()` function. * * @param publicationActedProfileId The token ID of the profile that published the publication to action. * @param publicationActedId The publication to action's publication ID. * @param actorProfileId The actor profile. * @param referrerProfileId * @param referrerPubId * @param actionModuleAddress * @param actionModuleData The arbitrary data to pass to the actionModule if needed. */ struct PublicationActionParams { uint256 publicationActedProfileId; uint256 publicationActedId; uint256 actorProfileId; uint256[] referrerProfileIds; uint256[] referrerPubIds; address actionModuleAddress; bytes actionModuleData; } struct ProcessActionParams { uint256 publicationActedProfileId; uint256 publicationActedId; uint256 actorProfileId; address actorProfileOwner; address transactionExecutor; uint256[] referrerProfileIds; uint256[] referrerPubIds; Types.PublicationType[] referrerPubTypes; bytes actionModuleData; } struct ProcessCommentParams { uint256 profileId; uint256 pubId; address transactionExecutor; uint256 pointedProfileId; uint256 pointedPubId; uint256[] referrerProfileIds; uint256[] referrerPubIds; Types.PublicationType[] referrerPubTypes; bytes data; } struct ProcessQuoteParams { uint256 profileId; uint256 pubId; address transactionExecutor; uint256 pointedProfileId; uint256 pointedPubId; uint256[] referrerProfileIds; uint256[] referrerPubIds; Types.PublicationType[] referrerPubTypes; bytes data; } struct ProcessMirrorParams { uint256 profileId; uint256 pubId; address transactionExecutor; uint256 pointedProfileId; uint256 pointedPubId; uint256[] referrerProfileIds; uint256[] referrerPubIds; Types.PublicationType[] referrerPubTypes; bytes data; } /** * @notice A struct containing a profile's delegated executors configuration. * * @param isApproved Tells when an address is approved as delegated executor in the given configuration number. * @param configNumber Current configuration number in use. * @param prevConfigNumber Previous configuration number set, before switching to the current one. * @param maxConfigNumberSet Maximum configuration number ever used. */ struct DelegatedExecutorsConfig { mapping(uint256 => mapping(address => bool)) isApproved; // isApproved[configNumber][delegatedExecutor] uint64 configNumber; uint64 prevConfigNumber; uint64 maxConfigNumberSet; } struct TreasuryData { address treasury; uint16 treasuryFeeBPS; } struct MigrationParams { address lensHandlesAddress; address tokenHandleRegistryAddress; address legacyFeeFollowModule; address legacyProfileFollowModule; address newFeeFollowModule; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.15; import {Errors} from 'contracts/modules/constants/Errors.sol'; /** * @title ActionRestricted * @author Lens Protocol * * @notice This abstract contract adds a public `ACTION_MODULE` immutable field, and `onlyActionModule` modifier, * to inherit from contracts that have functions restricted to be only called by the Action Modules. */ abstract contract ActionRestricted { address public immutable ACTION_MODULE; modifier onlyActionModule() { if (msg.sender != ACTION_MODULE) { revert Errors.NotActionModule(); } _; } constructor(address actionModule) { ACTION_MODULE = actionModule; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import {Errors} from 'contracts/modules/constants/Errors.sol'; import {ILensHub} from 'contracts/interfaces/ILensHub.sol'; import {IModuleRegistry} from 'contracts/interfaces/IModuleRegistry.sol'; /** * @title FeeModuleBase * @author Lens Protocol * * @notice This is an abstract contract to be inherited from by modules that require basic fee functionality. * It contains getters for module globals parameters as well as a validation function to check expected data. */ abstract contract FeeModuleBase { uint16 internal constant BPS_MAX = 10000; ILensHub private immutable HUB; IModuleRegistry public immutable MODULE_REGISTRY; constructor(address hub, address moduleRegistry) { HUB = ILensHub(hub); MODULE_REGISTRY = IModuleRegistry(moduleRegistry); } function _verifyErc20Currency(address currency) internal { if (currency != address(0)) { MODULE_REGISTRY.verifyErc20Currency(currency); } } function _treasuryData() internal view returns (address, uint16) { return HUB.getTreasuryData(); } function _validateDataIsExpected(bytes calldata data, address currency, uint256 amount) internal pure { (address decodedCurrency, uint256 decodedAmount) = abi.decode(data, (address, uint256)); if (decodedAmount != amount || decodedCurrency != currency) { revert Errors.ModuleDataMismatch(); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import {ILensModule} from 'contracts/modules/interfaces/ILensModule.sol'; abstract contract LensModule is ILensModule { /// @inheritdoc ILensModule function supportsInterface(bytes4 interfaceID) public pure virtual override returns (bool) { return interfaceID == bytes4(keccak256(abi.encodePacked('LENS_MODULE'))); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {LensModule} from 'contracts/modules/LensModule.sol'; contract LensModuleMetadata is LensModule, Ownable { string public metadataURI; constructor(address owner_) Ownable() { _transferOwnership(owner_); } function setModuleMetadataURI(string memory _metadataURI) external onlyOwner { metadataURI = _metadataURI; } function getModuleMetadataURI() external view returns (string memory) { return metadataURI; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import {Errors} from 'contracts/modules/constants/Errors.sol'; import {FeeModuleBase} from 'contracts/modules/FeeModuleBase.sol'; import {ICollectModule} from 'contracts/modules/interfaces/ICollectModule.sol'; import {ActionRestricted} from 'contracts/modules/ActionRestricted.sol'; import {ModuleTypes} from 'contracts/modules/libraries/constants/ModuleTypes.sol'; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import {IERC721} from '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import {FollowValidationLib} from 'contracts/modules/libraries/FollowValidationLib.sol'; import {BaseFeeCollectModuleInitData, BaseProfilePublicationData, IBaseFeeCollectModule} from 'contracts/modules/interfaces/IBaseFeeCollectModule.sol'; /** * @title BaseFeeCollectModule * @author Lens Protocol * * @notice This is base Lens CollectModule implementation, allowing customization of time to collect, number of collects * and Followers-only restriction. Charges a fee for collect and distributing it among Receiver/Referrals/Treasury. * @dev Here we use "Base" terminology to anything that represents this base functionality (base structs, * base functions, base storage). Other collect modules can be built on top of the "Base" by inheriting from this * contract and overriding functions. * This contract is marked "abstract" as it requires you to implement initializePublicationCollectModule and * getPublicationData functions when you inherit from it. See SimpleFeeCollectModule as an example implementation. */ abstract contract BaseFeeCollectModule is FeeModuleBase, ActionRestricted, IBaseFeeCollectModule { using SafeERC20 for IERC20; address immutable HUB; mapping(uint256 => mapping(uint256 => BaseProfilePublicationData)) internal _dataByPublicationByProfile; constructor( address hub, address actionModule, address moduleRegistry ) ActionRestricted(actionModule) FeeModuleBase(hub, moduleRegistry) { HUB = hub; } function supportsInterface(bytes4 interfaceID) public pure virtual returns (bool) { return interfaceID == type(ICollectModule).interfaceId; } /** * @inheritdoc ICollectModule * @notice Processes a collect by: * 1. Validating that collect action meets all needed criteria * 2. Processing the collect action either with or without referral * * @param processCollectParams Collect action parameters (see ModuleTypes.ProcessCollectParams struct) */ function processCollect( ModuleTypes.ProcessCollectParams calldata processCollectParams ) external virtual onlyActionModule returns (bytes memory) { _validateAndStoreCollect(processCollectParams); if (processCollectParams.referrerProfileIds.length == 0) { _processCollect(processCollectParams); } else { _processCollectWithReferral(processCollectParams); } return ''; } /// @inheritdoc IBaseFeeCollectModule function getBasePublicationData( uint256 profileId, uint256 pubId ) public view virtual returns (BaseProfilePublicationData memory) { return _dataByPublicationByProfile[profileId][pubId]; } /// @inheritdoc IBaseFeeCollectModule function calculateFee( ModuleTypes.ProcessCollectParams calldata processCollectParams ) public view virtual returns (uint160) { return _dataByPublicationByProfile[processCollectParams.publicationCollectedProfileId][ processCollectParams.publicationCollectedId ].amount; } /** * @dev Validates the Base parameters like: * 1) Is the currency whitelisted * 2) Is the referralFee in valid range * 3) Is the end of collects timestamp in valid range * * This should be called during initializePublicationCollectModule() * * @param baseInitData Module initialization data (see BaseFeeCollectModuleInitData struct) */ function _validateBaseInitData(BaseFeeCollectModuleInitData memory baseInitData) internal virtual { if ( (baseInitData.amount == 0 && baseInitData.currency != address(0)) || (baseInitData.amount != 0 && baseInitData.currency == address(0)) || baseInitData.referralFee > BPS_MAX || (baseInitData.endTimestamp != 0 && baseInitData.endTimestamp < block.timestamp) ) { revert Errors.InitParamsInvalid(); } _verifyErc20Currency(baseInitData.currency); } /** * @dev Stores the initial module parameters * * This should be called during initializePublicationCollectModule() * * @param profileId The token ID of the profile publishing the publication. * @param pubId The publication ID. * @param baseInitData Module initialization data (see BaseFeeCollectModuleInitData struct) */ function _storeBasePublicationCollectParameters( uint256 profileId, uint256 pubId, BaseFeeCollectModuleInitData memory baseInitData ) internal virtual { _dataByPublicationByProfile[profileId][pubId].amount = baseInitData.amount; _dataByPublicationByProfile[profileId][pubId].collectLimit = baseInitData.collectLimit; _dataByPublicationByProfile[profileId][pubId].currency = baseInitData.currency; _dataByPublicationByProfile[profileId][pubId].recipient = baseInitData.recipient; _dataByPublicationByProfile[profileId][pubId].referralFee = baseInitData.referralFee; _dataByPublicationByProfile[profileId][pubId].followerOnly = baseInitData.followerOnly; _dataByPublicationByProfile[profileId][pubId].endTimestamp = baseInitData.endTimestamp; } /** * @dev Validates the collect action by checking that: * 1) the collector is a follower (if enabled) * 2) the number of collects after the action doesn't surpass the collect limit (if enabled) * 3) the current block timestamp doesn't surpass the end timestamp (if enabled) * * This should be called during processCollect() */ function _validateAndStoreCollect(ModuleTypes.ProcessCollectParams calldata processCollectParams) internal virtual { uint96 collectsAfter = ++_dataByPublicationByProfile[processCollectParams.publicationCollectedProfileId][ processCollectParams.publicationCollectedId ].currentCollects; if ( _dataByPublicationByProfile[processCollectParams.publicationCollectedProfileId][ processCollectParams.publicationCollectedId ].followerOnly ) { FollowValidationLib.validateIsFollowingOrSelf({ hub: HUB, followerProfileId: processCollectParams.collectorProfileId, followedProfileId: processCollectParams.publicationCollectedProfileId }); } uint256 endTimestamp = _dataByPublicationByProfile[processCollectParams.publicationCollectedProfileId][ processCollectParams.publicationCollectedId ].endTimestamp; uint256 collectLimit = _dataByPublicationByProfile[processCollectParams.publicationCollectedProfileId][ processCollectParams.publicationCollectedId ].collectLimit; if (collectLimit != 0 && collectsAfter > collectLimit) { revert Errors.MintLimitExceeded(); } if (endTimestamp != 0 && block.timestamp > endTimestamp) { revert Errors.CollectExpired(); } } /** * @dev Internal processing of a collect: * 1. Calculation of fees * 2. Validation that fees are what collector expected * 3. Transfer of fees to recipient(-s) and treasury * * @param processCollectParams Parameters of the collect */ function _processCollect(ModuleTypes.ProcessCollectParams calldata processCollectParams) internal virtual { uint256 amount = calculateFee(processCollectParams); address currency = _dataByPublicationByProfile[processCollectParams.publicationCollectedProfileId][ processCollectParams.publicationCollectedId ].currency; _validateDataIsExpected(processCollectParams.data, currency, amount); (address treasury, uint16 treasuryFee) = _treasuryData(); uint256 treasuryAmount = (amount * treasuryFee) / BPS_MAX; if (treasuryAmount > 0) { IERC20(currency).safeTransferFrom(processCollectParams.transactionExecutor, treasury, treasuryAmount); } // Send amount after treasury cut, to all recipients _transferToRecipients(processCollectParams, currency, amount - treasuryAmount); } /** * @dev Internal processing of a collect with a referrals (if any). * * Same as _processCollect, but also includes transfer to referrals (if any): * 1. Calculation of fees * 2. Validation that fees are what collector expected * 3. Transfer of fees to treasury, referrals (if any) and recipients * * @param processCollectParams Parameters of the collect */ function _processCollectWithReferral( ModuleTypes.ProcessCollectParams calldata processCollectParams ) internal virtual { uint256 amount = calculateFee(processCollectParams); address currency = _dataByPublicationByProfile[processCollectParams.publicationCollectedProfileId][ processCollectParams.publicationCollectedId ].currency; _validateDataIsExpected(processCollectParams.data, currency, amount); (address treasury, uint16 treasuryFee) = _treasuryData(); uint256 treasuryAmount = (amount * treasuryFee) / BPS_MAX; if (treasuryAmount > 0) { IERC20(currency).safeTransferFrom(processCollectParams.transactionExecutor, treasury, treasuryAmount); } uint256 amountAfterReferrals = _transferToReferrals(processCollectParams, currency, amount - treasuryAmount); _transferToRecipients(processCollectParams, currency, amountAfterReferrals); } /** * @dev Tranfers the fee to recipient(-s) * * Override this to add additional functionality (e.g. multiple recipients) * * @param processCollectParams Parameters of the collect * @param currency Currency of the transaction * @param amount Amount to transfer to recipient(-s) */ function _transferToRecipients( ModuleTypes.ProcessCollectParams calldata processCollectParams, address currency, uint256 amount ) internal virtual { address recipient = _dataByPublicationByProfile[processCollectParams.publicationCollectedProfileId][ processCollectParams.publicationCollectedId ].recipient; if (amount > 0) { IERC20(currency).safeTransferFrom(processCollectParams.transactionExecutor, recipient, amount); } } /** * @dev Tranfers the part of fee to referral(-s) * * Override this to add additional functionality (e.g. different amounts to different referrals, etc) * * @param processCollectParams Parameters of the collect * @param currency Currency of the transaction * @param amount Amount of the fee after subtracting the Treasury part. */ function _transferToReferrals( ModuleTypes.ProcessCollectParams calldata processCollectParams, address currency, uint256 amount ) internal virtual returns (uint256) { uint256 referralFee = _dataByPublicationByProfile[processCollectParams.publicationCollectedProfileId][ processCollectParams.publicationCollectedId ].referralFee; uint256 totalReferralsAmount; if (referralFee != 0) { // The reason we levy the referral fee on the adjusted amount is so that referral fees // don't bypass the treasury fee, in essence referrals pay their fair share to the treasury. totalReferralsAmount = (amount * referralFee) / BPS_MAX; uint256 numberOfReferrals = processCollectParams.referrerProfileIds.length; uint256 amountPerReferral = totalReferralsAmount / numberOfReferrals; if (amountPerReferral > 0) { uint256 i; while (i < numberOfReferrals) { address referralRecipient = IERC721(HUB).ownerOf(processCollectParams.referrerProfileIds[i]); // Send referral fee in ERC20 tokens IERC20(currency).safeTransferFrom( processCollectParams.transactionExecutor, referralRecipient, amountPerReferral ); unchecked { ++i; } } } } return amount - totalReferralsAmount; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; library Errors { error FollowInvalid(); error ModuleDataMismatch(); error NotHub(); error InitParamsInvalid(); error InvalidParams(); error MintLimitExceeded(); error CollectExpired(); error NotActionModule(); error CollectNotAllowed(); error AlreadyInitialized(); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; import {ICollectModule} from 'contracts/modules/interfaces/ICollectModule.sol'; import {ModuleTypes} from 'contracts/modules/libraries/constants/ModuleTypes.sol'; /** * @notice A struct containing the necessary data to execute collect actions on a publication. * * @param amount The collecting cost associated with this publication. 0 for free collect. * @param collectLimit The maximum number of collects for this publication. 0 for no limit. * @param currency The currency associated with this publication. * @param currentCollects The current number of collects for this publication. * @param referralFee The referral fee associated with this publication. * @param followerOnly True if only followers of publisher may collect the post. * @param endTimestamp The end timestamp after which collecting is impossible. 0 for no expiry. * @param recipient Recipient of collect fees. */ struct BaseProfilePublicationData { uint160 amount; uint96 collectLimit; address currency; uint96 currentCollects; address recipient; uint16 referralFee; bool followerOnly; uint72 endTimestamp; } /** * @notice A struct containing the necessary data to initialize this Base Collect Module. * * @param amount The collecting cost associated with this publication. 0 for free collect. * @param collectLimit The maximum number of collects for this publication. 0 for no limit. * @param currency The currency associated with this publication. * @param referralFee The referral fee associated with this publication. * @param followerOnly True if only followers of publisher may collect the post. * @param endTimestamp The end timestamp after which collecting is impossible. 0 for no expiry. * @param recipient Recipient of collect fees. */ struct BaseFeeCollectModuleInitData { uint160 amount; uint96 collectLimit; address currency; uint16 referralFee; bool followerOnly; uint72 endTimestamp; address recipient; } interface IBaseFeeCollectModule is ICollectModule { /** * @notice Returns the Base publication data for a given publication, or an empty struct if that publication was not * initialized with this module. * * @param profileId The token ID of the profile mapped to the publication to query. * @param pubId The publication ID of the publication to query. * * @return The BaseProfilePublicationData struct mapped to that publication. */ function getBasePublicationData( uint256 profileId, uint256 pubId ) external view returns (BaseProfilePublicationData memory); /** * @notice Calculates and returns the collect fee of a publication. * @dev Override this function to use a different formula for the fee. * * @return The collect fee of the specified publication. */ function calculateFee( ModuleTypes.ProcessCollectParams calldata processCollectParams ) external view returns (uint160); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; import {ModuleTypes} from 'contracts/modules/libraries/constants/ModuleTypes.sol'; /** * @title ICollectModule * @author Lens Protocol * * @notice This is the standard interface for all Lens-compatible CollectModules. * Collect modules allow users to execute custom logic upon a collect action over a publication, like: * - Only allow the collect if the collector is following the publication author. * - Only allow the collect if the collector has made a payment to * - Allow any collect but only during the first 24 hours. * - Etc. */ interface ICollectModule { /** * @notice Initializes data for a given publication being published. * @custom:permissions LensHub. * * @param profileId The token ID of the profile publishing the publication. * @param pubId The associated publication's LensHub publication ID. * @param transactionExecutor The owner or an approved delegated executor. * @param data Arbitrary data __passed from the user!__ to be decoded. * * @return bytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by * indexers or UIs. */ function initializePublicationCollectModule( uint256 profileId, uint256 pubId, address transactionExecutor, bytes calldata data ) external returns (bytes memory); /** * @notice Processes a collect action for a given publication. * @custom:permissions LensHub. * * @param processCollectParams The parameters for the collect action. * * @return bytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by * indexers or UIs. */ function processCollect( ModuleTypes.ProcessCollectParams calldata processCollectParams ) external returns (bytes memory); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; import {IERC165} from '@openzeppelin/contracts/utils/introspection/IERC165.sol'; interface ILensModule is IERC165 { /// @dev for now we check for keccak('LENS_MODULE'); /// Override this and add the type(IModuleInterface).interfaceId for corresponding module type function supportsInterface(bytes4 interfaceID) external view returns (bool); /// @notice Human-readable description of the module // Can be JSON // Can be contract source code // Can be github link // Can be ipfs with documentation // etc function getModuleMetadataURI() external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import {ILensHub} from 'contracts/interfaces/ILensHub.sol'; import {Errors} from 'contracts/libraries/constants/Errors.sol'; /** * @title FollowValidationLib * @author Lens Protocol * * @notice A library contract that verifies that a user is following another user and reverts if not. */ library FollowValidationLib { function validateIsFollowing(address hub, uint256 followerProfileId, uint256 followedProfileId) internal view { if (!ILensHub(hub).isFollowing(followerProfileId, followedProfileId)) { revert Errors.NotFollowing(); } } function validateIsFollowingOrSelf( address hub, uint256 followerProfileId, uint256 followedProfileId ) internal view { // We treat following yourself is always true if (followerProfileId == followedProfileId) { return; } validateIsFollowing(hub, followerProfileId, followedProfileId); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; import {Types} from 'contracts/libraries/constants/Types.sol'; /** * @title Types * @author Lens Protocol * * @notice A standard library of data types used throughout the Lens Protocol modules. */ library ModuleTypes { struct ProcessCollectParams { uint256 publicationCollectedProfileId; uint256 publicationCollectedId; uint256 collectorProfileId; address collectorProfileOwner; address transactionExecutor; uint256[] referrerProfileIds; uint256[] referrerPubIds; Types.PublicationType[] referrerPubTypes; bytes data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "remappings": [ "@ensdomains/=node_modules/@ensdomains/", "@openzeppelin/=lib/openzeppelin-contracts/", "@seadrop/=lib/seadrop/src/", "ERC721A-Upgradeable/=lib/seadrop/lib/ERC721A-Upgradeable/contracts/", "ERC721A/=lib/seadrop/lib/ERC721A/contracts/", "create2-helpers/=lib/seadrop/lib/create2-helpers/", "create2-scripts/=lib/seadrop/lib/create2-helpers/script/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/seadrop/lib/operator-filter-registry/lib/openzeppelin-contracts/lib/erc4626-tests/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "forge-std/=lib/forge-std/src/", "hardhat/=node_modules/hardhat/", "murky/=lib/seadrop/lib/murky/src/", "openzeppelin-contracts-upgradeable/=lib/seadrop/lib/openzeppelin-contracts-upgradeable/contracts/", "openzeppelin-contracts/=lib/seadrop/lib/openzeppelin-contracts/contracts/", "operator-filter-registry/=lib/seadrop/lib/operator-filter-registry/src/", "seadrop/=lib/seadrop/", "solady/=lib/solady/src/", "solmate/=lib/seadrop/lib/solmate/src/", "utility-contracts/=lib/seadrop/lib/utility-contracts/src/" ], "optimizer": { "enabled": true, "runs": 10 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": true, "libraries": { "contracts/libraries/ActionLib.sol": { "ActionLib": "0x7990dac84e3241fe314b980bba1466ac08715c4f" }, "contracts/libraries/FollowLib.sol": { "FollowLib": "0xe280cb21fb36b6b2d584428b809a6b822a5c2260" }, "contracts/libraries/GovernanceLib.sol": { "GovernanceLib": "0x5268512d20bf7653cf6d54b7c485ae3fbc658451" }, "contracts/libraries/LegacyCollectLib.sol": { "LegacyCollectLib": "0x5f0f24377c00f1517b4de496cf49eec8beb4ecb4" }, "contracts/libraries/MetaTxLib.sol": { "MetaTxLib": "0xf191c489e4ba0f448ea08a5fd27e9c928643f5c7" }, "contracts/libraries/MigrationLib.sol": { "MigrationLib": "0x0deced9ac3833b687d69d4eac6655f0f1279acee" }, "contracts/libraries/ProfileLib.sol": { "ProfileLib": "0x3fce2475a92c185f9634f5638f6b33306d77bb10" }, "contracts/libraries/PublicationLib.sol": { "PublicationLib": "0x90654f24a2c164a4da8f763ac8bc032d3d083a1b" }, "contracts/libraries/ValidationLib.sol": { "ValidationLib": "0x9cafd24d2851d9eb56e5a8fd394ab2ac0ef99849" }, "contracts/libraries/token-uris/FollowTokenURILib.sol": { "FollowTokenURILib": "0xc58f0e2a361e35c08619ef5f6122dc15180d783e" }, "contracts/libraries/token-uris/HandleTokenURILib.sol": { "HandleTokenURILib": "0x0e20f112689c7894ab8142108574e45d2650f529" }, "contracts/libraries/token-uris/ProfileTokenURILib.sol": { "ProfileTokenURILib": "0xf167835e74eecfe4bc571701d34fd38f4b61a830" } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"hub","type":"address"},{"internalType":"address","name":"actionModule","type":"address"},{"internalType":"address","name":"moduleRegistry","type":"address"},{"internalType":"address","name":"moduleOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CollectExpired","type":"error"},{"inputs":[],"name":"InitParamsInvalid","type":"error"},{"inputs":[],"name":"InvalidRecipientSplits","type":"error"},{"inputs":[],"name":"MintLimitExceeded","type":"error"},{"inputs":[],"name":"ModuleDataMismatch","type":"error"},{"inputs":[],"name":"NotActionModule","type":"error"},{"inputs":[],"name":"NotFollowing","type":"error"},{"inputs":[],"name":"RecipientSplitCannotBeZero","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"ACTION_MODULE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MODULE_REGISTRY","outputs":[{"internalType":"contract IModuleRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"publicationCollectedProfileId","type":"uint256"},{"internalType":"uint256","name":"publicationCollectedId","type":"uint256"},{"internalType":"uint256","name":"collectorProfileId","type":"uint256"},{"internalType":"address","name":"collectorProfileOwner","type":"address"},{"internalType":"address","name":"transactionExecutor","type":"address"},{"internalType":"uint256[]","name":"referrerProfileIds","type":"uint256[]"},{"internalType":"uint256[]","name":"referrerPubIds","type":"uint256[]"},{"internalType":"enum Types.PublicationType[]","name":"referrerPubTypes","type":"uint8[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct ModuleTypes.ProcessCollectParams","name":"processCollectParams","type":"tuple"}],"name":"calculateFee","outputs":[{"internalType":"uint160","name":"","type":"uint160"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"profileId","type":"uint256"},{"internalType":"uint256","name":"pubId","type":"uint256"}],"name":"getBasePublicationData","outputs":[{"components":[{"internalType":"uint160","name":"amount","type":"uint160"},{"internalType":"uint96","name":"collectLimit","type":"uint96"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint96","name":"currentCollects","type":"uint96"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint16","name":"referralFee","type":"uint16"},{"internalType":"bool","name":"followerOnly","type":"bool"},{"internalType":"uint72","name":"endTimestamp","type":"uint72"}],"internalType":"struct BaseProfilePublicationData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getModuleMetadataURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"profileId","type":"uint256"},{"internalType":"uint256","name":"pubId","type":"uint256"}],"name":"getPublicationData","outputs":[{"components":[{"internalType":"uint160","name":"amount","type":"uint160"},{"internalType":"uint96","name":"collectLimit","type":"uint96"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint96","name":"currentCollects","type":"uint96"},{"internalType":"uint16","name":"referralFee","type":"uint16"},{"internalType":"bool","name":"followerOnly","type":"bool"},{"internalType":"uint72","name":"endTimestamp","type":"uint72"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint16","name":"split","type":"uint16"}],"internalType":"struct RecipientData[]","name":"recipients","type":"tuple[]"}],"internalType":"struct MultirecipientFeeCollectProfilePublicationData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"profileId","type":"uint256"},{"internalType":"uint256","name":"pubId","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"initializePublicationCollectModule","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"metadataURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"publicationCollectedProfileId","type":"uint256"},{"internalType":"uint256","name":"publicationCollectedId","type":"uint256"},{"internalType":"uint256","name":"collectorProfileId","type":"uint256"},{"internalType":"address","name":"collectorProfileOwner","type":"address"},{"internalType":"address","name":"transactionExecutor","type":"address"},{"internalType":"uint256[]","name":"referrerProfileIds","type":"uint256[]"},{"internalType":"uint256[]","name":"referrerPubIds","type":"uint256[]"},{"internalType":"enum Types.PublicationType[]","name":"referrerPubTypes","type":"uint8[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct ModuleTypes.ProcessCollectParams","name":"processCollectParams","type":"tuple"}],"name":"processCollect","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_metadataURI","type":"string"}],"name":"setModuleMetadataURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
61010034620000f857601f62001d8f38819003918201601f19168301916001600160401b03831184841017620000fd57808492608094604052833981010312620000f8578062000053620000a89262000113565b620000616020830162000113565b6200007d6060620000756040860162000113565b940162000113565b6001600160a01b0383811660805290931660a05260c05260e052620000a23362000128565b62000128565b604051611c1d90816200017282396080518161170a015260a051818181610274015261081a015260c05181818161030601528181610a0b01526111e1015260e051818181610ccd0152610e130152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620000f857565b600180546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a356fe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146112105750806303ee438c1461022a578063397a2a88146111cb5780633f50389214610f8c578063681591c114610e3c5780636fb71661146109f2578063715018a6146109a75780638da5cb5b1461097e57806391027b53146102a3578063b95ddb521461025e578063ce90d52e1461022a578063f2fde38b14610177578063f8d7758c1461014d5763fcdd2347146100b957600080fd5b34610148576101006100d36100cd3661141f565b9061155b565b6040519060018060a01b03808251168352602082015160018060601b0380911660208501528160408401511660408501526060830151166060840152608082015116608083015261ffff60a08201511660a083015260c0810151151560c083015260e060018060481b039101511660e0820152f35b600080fd5b3461014857602061016561016036611487565b611616565b6040516001600160a01b039091168152f35b34610148576020366003190112610148576004356001600160a01b0381811691829003610148576101a661198b565b81156101d657600180546001600160a01b03198116841790915516600080516020611bc8833981519152600080a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346101485760003660031901126101485761025a61024661133d565b6040519182916020835260208301906113df565b0390f35b34610148576000366003190112610148576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b34610148576080366003190112610148576044356001600160a01b03811603610148576064356001600160401b0381116101485736602382011215610148576001600160401b0360048201351161014857366024826004013583010111610148577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361096c576020818060040135810103126101485760248101356001600160401b0381116101485760e08183018360040135840103126101485760405190610376826112ff565b828101602401356001600160a01b0381168103610148578252828101604401356001600160601b038116900361014857828101604481013560208401526103bf906064016114b9565b60408301526103d26084828501016114cd565b606083015260a48184010135801515810361014857608083015282810160c401356001600160481b03811681036101485760a083015282810160e40135906001600160401b03821161014857602484600401358501016043838387010101121561014857602482828601010135610448816114dc565b92610456604051948561131a565b81845260208401926024876004013588010160448460061b84848b010101011161014857868101820160440193915b60448460061b82848b0101010185106109205760c08701869052865160208801516040808a015160608b015160808c015160a08d015193518e9690958e956001600160a01b03928316956001600160481b03909116949315159361ffff169216906001600160601b03166104f8886112ff565b858852602088015260408701526060860152608085015260a0840152600060c084015215801561090b575b6107e95781516001600160a01b03161580806108f4575b81156108d0575b5080156108bd575b8015610894575b6107e95760408201516001600160a01b031690816107fb575b60c0015180519150600282106107e9576000906000925b8084106106d95750506127109150036106c75780516004356000908152602081815260408083206024358452825290912080546001600160a01b039093166001600160a01b03199384161781559083015161025a9461024694909360a093919290916105f5916001600160601b031690611656565b60408281015160043560009081526020818152838220602435835290529190912060018082018054851660001992881b9290920193841691909117905560c0840151600290910180549093169116178155606082015161065b9161ffff90911690611507565b6080810151600480356000908152602081815260408083206024803585529252909120600201805495909401516001600160b01b0390951692151560b01b60ff60b01b169290921760b89490941b6001600160b81b031916939093179091553692918201359101611450565b60405163195f90f160e21b8152600490fd5b909161ffff60206106ea86866114f3565b51015116156107d75761ffff602061070286866114f3565b5101511681018091116107c157926004356000526003602052604060002060243560005260205260406000209061073981856114f3565b5182549290600160401b8410156107ab57600184018083558410156107955761ffff602060019561078c94600052816000200192868060a01b03815116878060a01b031985541617845501511690611507565b01929190610580565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60405163409bab8160e01b8152600490fd5b6040516348be0eb360e01b8152600490fd5b604051633f8ecfd360e21b8152600481019290925260208260248160007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af19182156108885760c092610859575b50610569565b61087a9060203d602011610881575b610872818361131a565b81019061163e565b5084610853565b503d610868565b6040513d6000823e3d90fd5b5060a08201516001600160481b031680151590816108b3575b50610550565b90504211846108ad565b5061271061ffff60608401511611610549565b905015806108df575b84610541565b5060408201516001600160a01b0316156108d9565b60408401516001600160a01b03161515915061053a565b5060408101516001600160a01b031615610523565b60406024868a600401358b0103011261014857604060206044948251610945816112e4565b61094e896114b9565b815261095b838a016114cd565b838201528152019501949250610485565b604051632fc56e1160e21b8152600490fd5b34610148576000366003190112610148576001546040516001600160a01b039091168152602090f35b34610148576000366003190112610148576109c061198b565b600180546001600160a01b031981169091556000906001600160a01b0316600080516020611bc88339815191528280a3005b3461014857610a0036611487565b6001600160a01b03907f00000000000000000000000000000000000000000000000000000000000000008216330361096c5780359081600052602091600083526040600020838301359081600052845260019081604060002001805460a01c9060018060601b03918281146107c15784610a7c91018092611656565b8460005260008752604060002083600052875260ff60026040600020015460b01c16610e08575b8460005260008752604060002083600052875260026040600020015460b81c918560005260008852604060002084600052885260406000205460a01c908115159283610dfc575b505050610dea578015159081610de0575b50610dce5760a08401610b0e8186611526565b15159050610be2575085610b8b9261ffff92610b919798610b2e88611616565b1695600052600089526040600020906000528852604060002001541692610b648185610b5e610100890189611679565b906117a6565b612710610b7b610b726116f3565b909416836116ab565b04918280610bc5575b50506116d2565b91611804565b604051908082016001600160401b038111838210176107ab576040526000825261025a6040519282849384528301906113df565b610bdb91610bd5608089016116be565b876119e3565b8782610b84565b90929186610bef86611616565b169683600052600087526040600020856000528752610c558183604060002001541695610c258a88610b5e6101008c018c611679565b610c2d6116f3565b92906127109b8a8d610c4461ffff809816846116ab565b04809381610db7575b5050506116d2565b9560005260008952604060002090600052885260026040600020015460a01c169760009880610c97575b5050505050610c929394610b8b916116d2565b610b91565b610ca6919293949950856116ab565b0496610cb28187611526565b8092915015610da157818904908115610c7f576000939293927f0000000000000000000000000000000000000000000000000000000000000000169060808901935b858110610d02575050610c7f565b610d0c828b611526565b829192101561079557604051916331a9108f60e11b83528160051b013560048301528b82602481875afa9182156108885788928691600091610d64575b5090610d5e91610d58896116be565b8d6119e3565b01610cf4565b935050508b82813d8311610d9a575b610d7d818361131a565b8101031261014857610d5e85610d938a946116df565b9091610d49565b503d610d73565b634e487b7160e01b600052601260045260246000fd5b610d586080610dc694016116be565b8a828f610c4d565b6040516304cd703960e51b8152600490fd5b9050421187610afb565b604051635b21dfd360e11b8152600490fd5b16119050888080610aea565b610e378560408801357f0000000000000000000000000000000000000000000000000000000000000000611907565b610aa3565b3461014857602080600319360112610148576001600160401b03600435818111610148573660238201121561014857610e7f903690602481600401359101611450565b91610e8861198b565b82519182116107ab57610e9c60025461128e565b601f8111610f45575b5080601f8311600114610ee157508192600092610ed6575b5050600019600383901b1c191660019190911b17600255005b015190508280610ebd565b90601f19831693600260005282600020926000905b868210610f2d5750508360019510610f14575b505050811b01600255005b015160001960f88460031b161c19169055828080610f09565b80600185968294968601518155019501930190610ef6565b600260005281600020601f840160051c810191838510610f82575b601f0160051c01905b818110610f765750610ea5565b60008155600101610f69565b9091508190610f60565b3461014857610f9a3661141f565b606060e0604051610faa816112c8565b60008152600060208201526000604082015260008382015260006080820152600060a0820152600060c08201520152610fe3818361155b565b91600052600360205260406000209060005260205260406000208054611008816114dc565b91611016604051938461131a565b818352602083019060005260206000206000915b838310611194578551602087015160408089015160608a015160a08b015160c08c015160e0808e01519551909790968d966001600160481b0316959215159461ffff909416936001600160601b03908116936001600160a01b0390811693919092169116611097896112c8565b8852602088015260408701526060860152608085015260a084015260c0830152828201526040519182916020835260018060a01b03815116602084015260018060601b03602082015116604084015260018060a01b03604082015116606084015260018060601b03606082015116608084015261ffff60808201511660a084015260a0810151151560c084015260018060481b0360c082015116828401520151610100808301528051806101208401526020610140840192019060005b818110611162575050500390f35b825180516001600160a01b0316855260209081015161ffff168186015286955060409094019390920191600101611154565b6001602081926040516111a6816112e4565b61ffff8654858060a01b038116835260a01c168382015281520192019201919061102a565b34610148576000366003190112610148576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b34610148576020366003190112610148576001600160e01b0319906004358281169081900361014857602092637f5ab69960e11b821492831561125b575b5050506040519015158152f35b90919250838101906a4c454e535f4d4f44554c4560a81b8252600b8152611281816112e4565b519020161482808061124e565b90600182811c921680156112be575b60208310146112a857565b634e487b7160e01b600052602260045260246000fd5b91607f169161129d565b61010081019081106001600160401b038211176107ab57604052565b604081019081106001600160401b038211176107ab57604052565b60e081019081106001600160401b038211176107ab57604052565b601f909101601f19168101906001600160401b038211908210176107ab57604052565b60405190600082600254916113518361128e565b8083526020936001908181169081156113bf575060011461137d575b505061137b9250038361131a565b565b90939150600260005281600020936000915b8183106113a757505061137b9350820101388061136d565b8554888401850152948501948794509183019161138f565b91505061137b94925060ff191682840152151560051b820101388061136d565b919082519283825260005b84811061140b575050826000602080949584010152601f8019910116010190565b6020818301810151848301820152016113ea565b6040906003190112610148576004359060243590565b6001600160401b0381116107ab57601f01601f191660200190565b92919261145c82611435565b9161146a604051938461131a565b829481845281830111610148578281602093846000960137010152565b6003199060208183011261014857600435916001600160401b0383116101485782610120920301126101485760040190565b35906001600160a01b038216820361014857565b359061ffff8216820361014857565b6001600160401b0381116107ab5760051b60200190565b80518210156107955760209160051b010190565b805461ffff60a01b191660a09290921b61ffff60a01b16919091179055565b903590601e198136030182121561014857018035906001600160401b03821161014857602001918160051b3603831361014857565b60e06040928392835161156d816112c8565b600093818580935282602082015282878201528260608201528260808201528260a08201528260c08201520152825281602052828220908252602052209060028151926115b9846112c8565b80549260018060a01b0393848116865260a01c60208601526001820154908482169086015260a01c60608501520154908116608083015261ffff8160a01c1660a083015260ff8160b01c16151560c083015260b81c60e082015290565b803560009081526020818152604080832093820135835292905220546001600160a01b031690565b90816020910312610148575180151581036101485790565b80546001600160a01b031660a09290921b6001600160a01b031916919091179055565b903590601e198136030182121561014857018035906001600160401b0382116101485760200191813603831361014857565b818102929181159184041417156107c157565b356001600160a01b03811681036101485790565b919082039182116107c157565b51906001600160a01b038216820361014857565b604080516398f965d160e01b8152919080836004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa92831561179b57600091829461174b575b50509190565b9080929450813d8311611794575b611763818361131a565b81010312611790576020611776826116df565b9101519261ffff8416840361178d57503880611745565b80fd5b8280fd5b503d611759565b50513d6000823e3d90fd5b908160409194939481010312610148576001600160a01b03813581811693919290849003610148576020013514928315936117f7575b5050506117e557565b6040516346308bd560e01b8152600490fd5b16141590503880806117dc565b909160009282358452602091600383526040928386208186013587528152838620805490611831826114dc565b9561183e8151978861131a565b8287529088528288208891848089015b8585106118d0575050505050508351955b86811061186f5750505050505050565b8061271061189061ffff856118866001968b6114f3565b51015116866116ab565b048061189e575b500161185f565b6118ca90838060a01b036118b460808b016116be565b816118bf868c6114f3565b5151169189166119e3565b38611897565b600191829184516118e0816112e4565b61ffff8754858060a01b038116835260a01c1683820152815201930193019291859061184e565b91808214611986576040516347720ebb60e01b81526004810192909252602482015290602090829060449082906001600160a01b03165afa90811561088857600091611968575b501561195657565b6040516322d9eef360e21b8152600490fd5b611980915060203d811161088157610872818361131a565b3861194e565b505050565b6001546001600160a01b0316330361199f57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6040516323b872dd60e01b60208083019182526001600160a01b039485166024840152948416604483015260648083019690965294815292939260a081019290916001600160401b038411838510176107ab57611aaa946000928392866040521693611a4e866112e4565b8786527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460c0820152519082855af13d15611b26573d91611a8e83611435565b92611a9c604051948561131a565b83523d60008785013e611b2a565b80519081611ab757505050565b8280611ac793830101910161163e565b15611acf5750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b6060915b91929015611b8c5750815115611b3e575090565b3b15611b475790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015611b9f5750805190602001fd5b60405162461bcd60e51b815260206004820152908190611bc39060248301906113df565b0390fdfe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a264697066735822122026dbd51c30d76a14266e58ae875d349b425835ca1b9d6a667ed780e737eb65c264736f6c63430008150033000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d0000000000000000000000000d90c58cbe787cd70b5effe94ce58185d72143fb0000000000000000000000001ed5983f0c883b96f7c35528a1e22eea67de3ff9000000000000000000000000f94b90bbeee30996019babd12cecddccf68331de
Deployed Bytecode
0x608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146112105750806303ee438c1461022a578063397a2a88146111cb5780633f50389214610f8c578063681591c114610e3c5780636fb71661146109f2578063715018a6146109a75780638da5cb5b1461097e57806391027b53146102a3578063b95ddb521461025e578063ce90d52e1461022a578063f2fde38b14610177578063f8d7758c1461014d5763fcdd2347146100b957600080fd5b34610148576101006100d36100cd3661141f565b9061155b565b6040519060018060a01b03808251168352602082015160018060601b0380911660208501528160408401511660408501526060830151166060840152608082015116608083015261ffff60a08201511660a083015260c0810151151560c083015260e060018060481b039101511660e0820152f35b600080fd5b3461014857602061016561016036611487565b611616565b6040516001600160a01b039091168152f35b34610148576020366003190112610148576004356001600160a01b0381811691829003610148576101a661198b565b81156101d657600180546001600160a01b03198116841790915516600080516020611bc8833981519152600080a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346101485760003660031901126101485761025a61024661133d565b6040519182916020835260208301906113df565b0390f35b34610148576000366003190112610148576040517f0000000000000000000000001ed5983f0c883b96f7c35528a1e22eea67de3ff96001600160a01b03168152602090f35b34610148576080366003190112610148576044356001600160a01b03811603610148576064356001600160401b0381116101485736602382011215610148576001600160401b0360048201351161014857366024826004013583010111610148577f0000000000000000000000000d90c58cbe787cd70b5effe94ce58185d72143fb6001600160a01b0316330361096c576020818060040135810103126101485760248101356001600160401b0381116101485760e08183018360040135840103126101485760405190610376826112ff565b828101602401356001600160a01b0381168103610148578252828101604401356001600160601b038116900361014857828101604481013560208401526103bf906064016114b9565b60408301526103d26084828501016114cd565b606083015260a48184010135801515810361014857608083015282810160c401356001600160481b03811681036101485760a083015282810160e40135906001600160401b03821161014857602484600401358501016043838387010101121561014857602482828601010135610448816114dc565b92610456604051948561131a565b81845260208401926024876004013588010160448460061b84848b010101011161014857868101820160440193915b60448460061b82848b0101010185106109205760c08701869052865160208801516040808a015160608b015160808c015160a08d015193518e9690958e956001600160a01b03928316956001600160481b03909116949315159361ffff169216906001600160601b03166104f8886112ff565b858852602088015260408701526060860152608085015260a0840152600060c084015215801561090b575b6107e95781516001600160a01b03161580806108f4575b81156108d0575b5080156108bd575b8015610894575b6107e95760408201516001600160a01b031690816107fb575b60c0015180519150600282106107e9576000906000925b8084106106d95750506127109150036106c75780516004356000908152602081815260408083206024358452825290912080546001600160a01b039093166001600160a01b03199384161781559083015161025a9461024694909360a093919290916105f5916001600160601b031690611656565b60408281015160043560009081526020818152838220602435835290529190912060018082018054851660001992881b9290920193841691909117905560c0840151600290910180549093169116178155606082015161065b9161ffff90911690611507565b6080810151600480356000908152602081815260408083206024803585529252909120600201805495909401516001600160b01b0390951692151560b01b60ff60b01b169290921760b89490941b6001600160b81b031916939093179091553692918201359101611450565b60405163195f90f160e21b8152600490fd5b909161ffff60206106ea86866114f3565b51015116156107d75761ffff602061070286866114f3565b5101511681018091116107c157926004356000526003602052604060002060243560005260205260406000209061073981856114f3565b5182549290600160401b8410156107ab57600184018083558410156107955761ffff602060019561078c94600052816000200192868060a01b03815116878060a01b031985541617845501511690611507565b01929190610580565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60405163409bab8160e01b8152600490fd5b6040516348be0eb360e01b8152600490fd5b604051633f8ecfd360e21b8152600481019290925260208260248160007f0000000000000000000000001ed5983f0c883b96f7c35528a1e22eea67de3ff96001600160a01b03165af19182156108885760c092610859575b50610569565b61087a9060203d602011610881575b610872818361131a565b81019061163e565b5084610853565b503d610868565b6040513d6000823e3d90fd5b5060a08201516001600160481b031680151590816108b3575b50610550565b90504211846108ad565b5061271061ffff60608401511611610549565b905015806108df575b84610541565b5060408201516001600160a01b0316156108d9565b60408401516001600160a01b03161515915061053a565b5060408101516001600160a01b031615610523565b60406024868a600401358b0103011261014857604060206044948251610945816112e4565b61094e896114b9565b815261095b838a016114cd565b838201528152019501949250610485565b604051632fc56e1160e21b8152600490fd5b34610148576000366003190112610148576001546040516001600160a01b039091168152602090f35b34610148576000366003190112610148576109c061198b565b600180546001600160a01b031981169091556000906001600160a01b0316600080516020611bc88339815191528280a3005b3461014857610a0036611487565b6001600160a01b03907f0000000000000000000000000d90c58cbe787cd70b5effe94ce58185d72143fb8216330361096c5780359081600052602091600083526040600020838301359081600052845260019081604060002001805460a01c9060018060601b03918281146107c15784610a7c91018092611656565b8460005260008752604060002083600052875260ff60026040600020015460b01c16610e08575b8460005260008752604060002083600052875260026040600020015460b81c918560005260008852604060002084600052885260406000205460a01c908115159283610dfc575b505050610dea578015159081610de0575b50610dce5760a08401610b0e8186611526565b15159050610be2575085610b8b9261ffff92610b919798610b2e88611616565b1695600052600089526040600020906000528852604060002001541692610b648185610b5e610100890189611679565b906117a6565b612710610b7b610b726116f3565b909416836116ab565b04918280610bc5575b50506116d2565b91611804565b604051908082016001600160401b038111838210176107ab576040526000825261025a6040519282849384528301906113df565b610bdb91610bd5608089016116be565b876119e3565b8782610b84565b90929186610bef86611616565b169683600052600087526040600020856000528752610c558183604060002001541695610c258a88610b5e6101008c018c611679565b610c2d6116f3565b92906127109b8a8d610c4461ffff809816846116ab565b04809381610db7575b5050506116d2565b9560005260008952604060002090600052885260026040600020015460a01c169760009880610c97575b5050505050610c929394610b8b916116d2565b610b91565b610ca6919293949950856116ab565b0496610cb28187611526565b8092915015610da157818904908115610c7f576000939293927f000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d169060808901935b858110610d02575050610c7f565b610d0c828b611526565b829192101561079557604051916331a9108f60e11b83528160051b013560048301528b82602481875afa9182156108885788928691600091610d64575b5090610d5e91610d58896116be565b8d6119e3565b01610cf4565b935050508b82813d8311610d9a575b610d7d818361131a565b8101031261014857610d5e85610d938a946116df565b9091610d49565b503d610d73565b634e487b7160e01b600052601260045260246000fd5b610d586080610dc694016116be565b8a828f610c4d565b6040516304cd703960e51b8152600490fd5b9050421187610afb565b604051635b21dfd360e11b8152600490fd5b16119050888080610aea565b610e378560408801357f000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d611907565b610aa3565b3461014857602080600319360112610148576001600160401b03600435818111610148573660238201121561014857610e7f903690602481600401359101611450565b91610e8861198b565b82519182116107ab57610e9c60025461128e565b601f8111610f45575b5080601f8311600114610ee157508192600092610ed6575b5050600019600383901b1c191660019190911b17600255005b015190508280610ebd565b90601f19831693600260005282600020926000905b868210610f2d5750508360019510610f14575b505050811b01600255005b015160001960f88460031b161c19169055828080610f09565b80600185968294968601518155019501930190610ef6565b600260005281600020601f840160051c810191838510610f82575b601f0160051c01905b818110610f765750610ea5565b60008155600101610f69565b9091508190610f60565b3461014857610f9a3661141f565b606060e0604051610faa816112c8565b60008152600060208201526000604082015260008382015260006080820152600060a0820152600060c08201520152610fe3818361155b565b91600052600360205260406000209060005260205260406000208054611008816114dc565b91611016604051938461131a565b818352602083019060005260206000206000915b838310611194578551602087015160408089015160608a015160a08b015160c08c015160e0808e01519551909790968d966001600160481b0316959215159461ffff909416936001600160601b03908116936001600160a01b0390811693919092169116611097896112c8565b8852602088015260408701526060860152608085015260a084015260c0830152828201526040519182916020835260018060a01b03815116602084015260018060601b03602082015116604084015260018060a01b03604082015116606084015260018060601b03606082015116608084015261ffff60808201511660a084015260a0810151151560c084015260018060481b0360c082015116828401520151610100808301528051806101208401526020610140840192019060005b818110611162575050500390f35b825180516001600160a01b0316855260209081015161ffff168186015286955060409094019390920191600101611154565b6001602081926040516111a6816112e4565b61ffff8654858060a01b038116835260a01c168382015281520192019201919061102a565b34610148576000366003190112610148576040517f0000000000000000000000000d90c58cbe787cd70b5effe94ce58185d72143fb6001600160a01b03168152602090f35b34610148576020366003190112610148576001600160e01b0319906004358281169081900361014857602092637f5ab69960e11b821492831561125b575b5050506040519015158152f35b90919250838101906a4c454e535f4d4f44554c4560a81b8252600b8152611281816112e4565b519020161482808061124e565b90600182811c921680156112be575b60208310146112a857565b634e487b7160e01b600052602260045260246000fd5b91607f169161129d565b61010081019081106001600160401b038211176107ab57604052565b604081019081106001600160401b038211176107ab57604052565b60e081019081106001600160401b038211176107ab57604052565b601f909101601f19168101906001600160401b038211908210176107ab57604052565b60405190600082600254916113518361128e565b8083526020936001908181169081156113bf575060011461137d575b505061137b9250038361131a565b565b90939150600260005281600020936000915b8183106113a757505061137b9350820101388061136d565b8554888401850152948501948794509183019161138f565b91505061137b94925060ff191682840152151560051b820101388061136d565b919082519283825260005b84811061140b575050826000602080949584010152601f8019910116010190565b6020818301810151848301820152016113ea565b6040906003190112610148576004359060243590565b6001600160401b0381116107ab57601f01601f191660200190565b92919261145c82611435565b9161146a604051938461131a565b829481845281830111610148578281602093846000960137010152565b6003199060208183011261014857600435916001600160401b0383116101485782610120920301126101485760040190565b35906001600160a01b038216820361014857565b359061ffff8216820361014857565b6001600160401b0381116107ab5760051b60200190565b80518210156107955760209160051b010190565b805461ffff60a01b191660a09290921b61ffff60a01b16919091179055565b903590601e198136030182121561014857018035906001600160401b03821161014857602001918160051b3603831361014857565b60e06040928392835161156d816112c8565b600093818580935282602082015282878201528260608201528260808201528260a08201528260c08201520152825281602052828220908252602052209060028151926115b9846112c8565b80549260018060a01b0393848116865260a01c60208601526001820154908482169086015260a01c60608501520154908116608083015261ffff8160a01c1660a083015260ff8160b01c16151560c083015260b81c60e082015290565b803560009081526020818152604080832093820135835292905220546001600160a01b031690565b90816020910312610148575180151581036101485790565b80546001600160a01b031660a09290921b6001600160a01b031916919091179055565b903590601e198136030182121561014857018035906001600160401b0382116101485760200191813603831361014857565b818102929181159184041417156107c157565b356001600160a01b03811681036101485790565b919082039182116107c157565b51906001600160a01b038216820361014857565b604080516398f965d160e01b8152919080836004817f000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d6001600160a01b03165afa92831561179b57600091829461174b575b50509190565b9080929450813d8311611794575b611763818361131a565b81010312611790576020611776826116df565b9101519261ffff8416840361178d57503880611745565b80fd5b8280fd5b503d611759565b50513d6000823e3d90fd5b908160409194939481010312610148576001600160a01b03813581811693919290849003610148576020013514928315936117f7575b5050506117e557565b6040516346308bd560e01b8152600490fd5b16141590503880806117dc565b909160009282358452602091600383526040928386208186013587528152838620805490611831826114dc565b9561183e8151978861131a565b8287529088528288208891848089015b8585106118d0575050505050508351955b86811061186f5750505050505050565b8061271061189061ffff856118866001968b6114f3565b51015116866116ab565b048061189e575b500161185f565b6118ca90838060a01b036118b460808b016116be565b816118bf868c6114f3565b5151169189166119e3565b38611897565b600191829184516118e0816112e4565b61ffff8754858060a01b038116835260a01c1683820152815201930193019291859061184e565b91808214611986576040516347720ebb60e01b81526004810192909252602482015290602090829060449082906001600160a01b03165afa90811561088857600091611968575b501561195657565b6040516322d9eef360e21b8152600490fd5b611980915060203d811161088157610872818361131a565b3861194e565b505050565b6001546001600160a01b0316330361199f57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6040516323b872dd60e01b60208083019182526001600160a01b039485166024840152948416604483015260648083019690965294815292939260a081019290916001600160401b038411838510176107ab57611aaa946000928392866040521693611a4e866112e4565b8786527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460c0820152519082855af13d15611b26573d91611a8e83611435565b92611a9c604051948561131a565b83523d60008785013e611b2a565b80519081611ab757505050565b8280611ac793830101910161163e565b15611acf5750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b6060915b91929015611b8c5750815115611b3e575090565b3b15611b475790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015611b9f5750805190602001fd5b60405162461bcd60e51b815260206004820152908190611bc39060248301906113df565b0390fdfe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a264697066735822122026dbd51c30d76a14266e58ae875d349b425835ca1b9d6a667ed780e737eb65c264736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d0000000000000000000000000d90c58cbe787cd70b5effe94ce58185d72143fb0000000000000000000000001ed5983f0c883b96f7c35528a1e22eea67de3ff9000000000000000000000000f94b90bbeee30996019babd12cecddccf68331de
-----Decoded View---------------
Arg [0] : hub (address): 0xDb46d1Dc155634FbC732f92E853b10B288AD5a1d
Arg [1] : actionModule (address): 0x0D90C58cBe787CD70B5Effe94Ce58185D72143fB
Arg [2] : moduleRegistry (address): 0x1eD5983F0c883B96f7C35528a1e22EEA67DE3Ff9
Arg [3] : moduleOwner (address): 0xf94b90BbEee30996019bABD12cEcdDCcf68331DE
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000db46d1dc155634fbc732f92e853b10b288ad5a1d
Arg [1] : 0000000000000000000000000d90c58cbe787cd70b5effe94ce58185d72143fb
Arg [2] : 0000000000000000000000001ed5983f0c883b96f7c35528a1e22eea67de3ff9
Arg [3] : 000000000000000000000000f94b90bbeee30996019babd12cecddccf68331de
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
POL | 100.00% | $0.036785 | 100 | $3.68 |
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.