Skip to content

Commit

Permalink
misc: TODO solved - isImmutable storage replaced by _contentURISnapsh…
Browse files Browse the repository at this point in the history
…ot length check
  • Loading branch information
donosonaumczuk committed Jan 7, 2025
1 parent 1520a6d commit 20139fd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions contracts/actions/post/collect/LensCollectedPost.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ contract LensCollectedPost is LensERC721, IERC7572 {
string internal _contractURI;
address internal immutable _feed;
uint256 internal immutable _postId;
bool internal immutable _isImmutable; // TODO: This can be replaced with bytes(_contentURISnapshot).length
address internal immutable _collectAction;

constructor(address feed, uint256 postId, bool isImmutable) {
Expand All @@ -33,7 +32,6 @@ contract LensCollectedPost is LensERC721, IERC7572 {
require(bytes(contentURI).length > 0, "Post content URI is empty");
_feed = feed;
_postId = postId;
_isImmutable = isImmutable;
_contractURI = contentURI;
_collectAction = msg.sender;
if (isImmutable) {
Expand All @@ -54,7 +52,7 @@ contract LensCollectedPost is LensERC721, IERC7572 {
}

function tokenURI(uint256 /*tokenId*/ ) public view override returns (string memory) {
if (_isImmutable) {
if (bytes(_contentURISnapshot).length > 0) {
return _contentURISnapshot;
} else {
string memory contentURI = IFeed(_feed).getPost(_postId).contentURI;
Expand Down

0 comments on commit 20139fd

Please sign in to comment.