Submitted by hyh
In case when zero collection module be white listed and then zero collection module set to a post (done by different actors), its functionality will be partially broken: every collecting and mirroring of it will be reverted with Errors.PublicationDoesNotExist, while getPubType will return its type as a Mirror.
Setting severity to Medium per function of the protocol or its availability could be impacted, as either the behavior of rejecting collects/mirrors is desired and to be implemented explicitly, or such a scenario shouldnt exist in a system, i.e. now zero address absence in white list cannot be guaranteed as its setting is manual and possible
Collect module isnt checked additionally on init, any white listed address can be set:
PublishingLogic.sol#L308-309
While zero address also can be white listed:
LensHub.sol#L128-135
If zero address is white listed and then set as collectModule for a post, a getPointedIfMirror helper function called on it will revert with Errors.PublicationDoesNotExist:
Helpers.sol#L47
This way all attempts to collect and mirror this post will also revert:
InteractionLogic.sol#L108
PublishingLogic.sol#L258
Also, getContentURI view will fail with the same error:
LensHub.sol#L785
And getPubType will return Mirror as a publication type:
LensHub.sol#L829
Consider prohibiting zero collection module to be white listed.
If rejecting collects/mirrors is desired for a special post type, the corresponding error path can be implemented
Zer0dot (Aave Lens) acknowledged and commented:
Zer0dot (Aave Lens) commented:
0xleastwood (judge) commented:
Zer0dot (Aave Lens) commented:
