Due to the if statement in line 134 of ERC721 contract, the transferFrom() call would always revert.
The if-statement would only pass when the owner of the token operatorApprovals to themself , however upon the call to _afterTokenTransfer , this would revert due to the check in ERC721Votes._moveDelegateVotes() that ensures there is no delegation to same from and to address.
Lines of code
https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/lib/token/ERC721.sol#L134
Vulnerability details
Impact
Due to the if statement in line 134 of ERC721 contract, the
transferFrom()
call would always revert.The if-statement would only pass when the owner of the token
operatorApprovals
to themself , however upon the call to _afterTokenTransfer , this would revert due to the check in ERC721Votes._moveDelegateVotes() that ensures there is no delegation to same from and to address.Proof of Concept
https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/lib/token/ERC721.sol#L134
Tools Used
Manual review
Recommended Mitigation Steps
It would be quite easier to use a require check similar in the OZ ERC71 library in https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol#L241