diff --git a/contracts/LensHub.sol b/contracts/LensHub.sol index 20b4990..905606e 100644 --- a/contracts/LensHub.sol +++ b/contracts/LensHub.sol @@ -540,6 +540,15 @@ contract LensHub is return StorageLib.getPublicationMemory(profileId, pubId); } + /// @inheritdoc ILensProtocol + function isActionModuleEnabledInPublication( + uint256 profileId, + uint256 pubId, + address module + ) external view returns (bool) { + return StorageLib.getPublication(profileId, pubId).actionModuleEnabled[module]; + } + /// @inheritdoc ILensProtocol function getPublicationType( uint256 profileId, diff --git a/contracts/interfaces/ILensProtocol.sol b/contracts/interfaces/ILensProtocol.sol index 400e054..7804316 100644 --- a/contracts/interfaces/ILensProtocol.sol +++ b/contracts/interfaces/ILensProtocol.sol @@ -450,4 +450,19 @@ interface ILensProtocol { * @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); }