The FERC1155.sol don’t respect the EIP2981
The FERC1155 contract implements the EIP-2981 royalty getter but does not register the ERC2981 interface in its ERC-165 supportsInterface function. As a result, external marketplaces that check interface support cannot detect that the NFT supports royalties, so royalty enforcement may fail.
Submitted by 0x29A
The EIP-2981: NFT Royalty Standard implementation is incomplete, missing the implementation of function supportsInterface(bytes4 interfaceID) external view returns (bool); from the EIP-165: Standard Interface Detection.
Proof of Concept
A marketplace that implemented royalties could check if the NFT has royalties, but if they don’t, add the interface of ERC2981 on the _registerInterface, the marketplace can’t know if this NFT has royalties.
Recommended Mitigation Steps
Like in solmate ERC1155.sol add the ERC2981 interfaceId on the FERC1155 contract
/*//////////////////////////////////////////////////////////////
ERC165 LOGIC
//////////////////////////////////////////////////////////////*/
function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
return
super.supportsInterface(interfaceId) ||
interfaceId == 0x2a55205a; // ERC165 Interface ID for ERC2981
}
aklatham (Fractional) confirmed
HardlyDifficult (judge) commented:
The contract implements the ERC2981 getter but does not register it as a 165 interface. Agree with the warden that this is a Medium risk issue. This is a function of the protocol and it may not work with many external marketplaces because it does not yet follow the standard as expected.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The contract's supportsInterface function does not include the ERC2981 interface ID, so ERC-165 detection of royalty support fails.
Impact
Marketplaces that rely on ERC-165 to detect royalty support may not recognise this NFT as royalty-bearing, so royalties may not be enforced.
What the attacker needed
NFT used on an external marketplace; marketplace checks ERC-165 support
The fix
The contract should override supportsInterface to also return true for the ERC2981 interface ID, as shown in the recommended mitigation.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
ERC-165 is a standard way for smart contracts to say which interfaces they support, so other contracts can ask 'do you support X?' before calling functions. This NFT contract can return royalty information, but it never tells marketplaces that it supports the royalty standard, so those marketplaces may not know to ask for royalties. The fix is to add the royalty interface ID to the list of supported interfaces.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.