Closed code423n4 closed 1 year ago
https://github.com/code-423n4/2023-07-lens/blob/main/contracts/FollowNFT.sol#L168-L185
Cannot unwrap token after recovering through wrapping.
FollowNFT#unwrap checks if followerProfileId for the token is not 0:
FollowNFT#unwrap
followerProfileId
0
if (_followDataByFollowTokenId[followTokenId].followerProfileId == 0) { revert NotFollowing(); }
while after recovering token through FollowNFT#wrap, its followerProfileId is not updated.
FollowNFT#wrap
if (followerProfileId == 0) { followerProfileId = _followDataByFollowTokenId[followTokenId].profileIdAllowedToRecover; if (followerProfileId == 0) { revert FollowTokenDoesNotExist(); } delete _followDataByFollowTokenId[followTokenId].profileIdAllowedToRecover; }
Update followerProfileId for the wrapped token if recovering through wrapping it.
Error
141345 marked the issue as low quality report
invalid
followerProfileId is not set to 0
Picodes marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-07-lens/blob/main/contracts/FollowNFT.sol#L168-L185
Vulnerability details
Impact
Cannot unwrap token after recovering through wrapping.
Proof of Concept
FollowNFT#unwrap
checks iffollowerProfileId
for the token is not0
:while after recovering token through
FollowNFT#wrap
, itsfollowerProfileId
is not updated.Recommended Mitigation Steps
Update
followerProfileId
for the wrapped token if recovering through wrapping it.Assessed type
Error