Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: medium
Invalid

ERC-1155 Compliance Issue in MembershipERC1155 Contract

Summary

The MembershipERC1155 contract, designed to function as an ERC-1155-compliant contract for membership tokens, does not fully implement the ERC-1155 standard. Specifically, the IMembershipERC1155 interface used in this contract lacks direct inheritance from IERC1155, which means it does not provide explicit support for the ERC-1155 interface ID (0xd9b67a26) as required by the ERC-165 standard.

Vulnerability Details

ERC-1155 contracts are required to implement the supportsInterface function from the ERC-165 standard and return true when the ERC-1155 interface ID (0xd9b67a26) is passed as an argument. However, the MembershipERC1155 contract uses a custom IMembershipERC1155 interface that does not inherit from IERC1155. As a result, the supportsInterface function only checks for IMembershipERC1155 but not the standard ERC-1155 interface, which causes incompatibility with ERC-1155-compliant applications, wallets, and other protocols.

function supportsInterface(bytes4 interfaceId)
public
view
override(ERC1155Upgradeable, AccessControlUpgradeable)
returns (bool)
{
return
interfaceId == type(IMembershipERC1155).interfaceId ||
super.supportsInterface(interfaceId);
}

In this code, only the IMembershipERC1155 interface ID is checked, without accounting for the IERC1155 interface ID (0xd9b67a26), which leads to incompatibility with standard ERC-1155 interface expectations.

Impact

Any applications, protocols, or wallets that rely on standard ERC-1155 interfaces will not recognize the MembershipERC1155 contract as ERC-1155 compliant.

Tools Used

Manual review

Recommendations

function supportsInterface(bytes4 interfaceId)
public
view
override(ERC1155Upgradeable, AccessControlUpgradeable)
returns (bool)
{
return
+ interfaceId == type(IERC1155).interfaceId || // Explicit ERC-1155 support
interfaceId == type(IMembershipERC1155).interfaceId || // Membership-specific interface
super.supportsInterface(interfaceId);
}
Updates

Lead Judging Commences

0xbrivan2 Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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