This repository has been archived by the owner on Oct 27, 2024. It is now read-only.
ZdravkoHr. - Edition.supportsInterface
is not EIP1155 compliant
#287
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
ZdravkoHr.
medium
Edition.supportsInterface
is not EIP1155 compliantSummary
According to the ERC-1155 specification, the smart contracts that are implementing it
MUST
have asupportsInferface(bytes4)
function that returns true for values0xd9b67a26
and0x0e89341c
. The current implementation of Edition.sol will returnfalse
for both these values.Vulnerability Detail
The contract inherits from
ERC1155
andERC2981
.The supportsInterface() function of
Edition
returns the result of executingsuper.supportsInterface()
Since both ERC1155 and ERC2981 implement that function and
ERC2981
is the more derived contract of the two,Edition.supportsInterface()
will end up executing onlyERC2981.supportsInterface()
.Impact
Medium. The contract is to be a strict implementation of
ERC1155
, but it does not implement the mandatoryERC1155.supportsInterface()
function.Code Snippet
PoC for Edition.t.sol
Tool used
Foundry
Recommendation
Instead of relying on
super
, return the union ofERC1155.supportsInterface(interfaceId)
andERC2981.supportsInterface(interfaceId)
.The text was updated successfully, but these errors were encountered: