Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wickie - Using transferFrom() can lock NFTs in a contract when settling auctions. #178

Open
sherlock-admin2 opened this issue Nov 30, 2024 · 0 comments

Comments

@sherlock-admin2
Copy link

sherlock-admin2 commented Nov 30, 2024

wickie

Medium

Using transferFrom() can lock NFTs in a contract when settling auctions.

Summary

In NounsAuctionHouseV3.sol::_settleAuction(), transferFrom is used to transfer the nouns token to the winner. However, if the winner is a contract that does not handle ERC-721, the nouns token will be locked in the contract forever, and the winner won't be able to cancel his stream in StreamEscrow. This use is discouraged by Openzeppelin and safeTransferFrom() should be used instead. Ref : https://docs.openzeppelin.com/contracts/3.x/api/token/erc721

Root Cause

    function _settleAuction() internal {
        INounsAuctionHouseV3.AuctionV2 memory _auction = auctionStorage;
        .....
        if (_auction.bidder == address(0)) {
            nouns.burn(_auction.nounId);
        } else {
@>            nouns.transferFrom(address(this), _auction.bidder, _auction.nounId);
        }

Internal pre-conditions

A contract that cannot handle ERC-721 must win the auction.

External pre-conditions

No response

Attack Path

No response

Impact

This will lead to Nouns token being stuck in contracts, and winner wont be able to cancel the stream.

PoC

No response

Mitigation

Consider using safeTransferFrom() instead of transferFrom().

@sherlock-admin4 sherlock-admin4 changed the title Sneaky Berry Wolf - Using transferFrom() can lock NFTs in a contract when settling auctions. wickie - Using transferFrom() can lock NFTs in a contract when settling auctions. Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant