NFTBridge
60,000 USDC
View results
Submission Details
Severity: low
Invalid

Incorrect Check for NFT Collections That Support Both `ERC721` and `ERC1155` Interfaces

Vulnerability Details

function detectInterface(
address collection
)
internal
view
returns (CollectionType)
{
bool supportsERC721 = ERC165Checker.supportsInterface(
collection,
type(IERC721).interfaceId
);
if (supportsERC721) {
return CollectionType.ERC721;
}
bool supportsERC1155 = ERC165Checker.supportsInterface(
collection,
type(IERC1155).interfaceId
);
if (supportsERC1155) {
return CollectionType.ERC1155;
}
revert UnsupportedTokenStandard();
}

When detecting interface of NFT collection, it first checks if the collection is ERC721.
This assumption is wrong for collections that support both ERC721 and ERC1155.

For these collections, ERC1155 type should be used.

As a recommendation, it should check ERC1155 interface before ERC721.

Updates

Lead Judging Commences

n0kto Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Out of scope
Assigned finding tags:

invalid-both-standard-same-nft

Great catch ! Unfortunately only ERC721 are in scope. Tokens with both standard are not supported and the collection and using it that way would be a user error.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.