diff --git a/src/abstracts/SablierFlowBase.sol b/src/abstracts/SablierFlowBase.sol index ce9939e5..3770fba7 100644 --- a/src/abstracts/SablierFlowBase.sol +++ b/src/abstracts/SablierFlowBase.sol @@ -5,6 +5,7 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; +import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import { UD21x18 } from "@prb/math/src/UD21x18.sol"; import { UD60x18 } from "@prb/math/src/UD60x18.sol"; @@ -283,6 +284,12 @@ abstract contract SablierFlowBase is emit BatchMetadataUpdate({ _fromTokenId: 1, _toTokenId: nextStreamId - 1 }); } + /// @inheritdoc ERC721 + function supportsInterface(bytes4 interfaceId) public view override(IERC165, ERC721) returns (bool) { + // 0x49064906 is the ERC-165 interface ID required by ERC-4906 + return interfaceId == 0x49064906 || super.supportsInterface(interfaceId); + } + /*////////////////////////////////////////////////////////////////////////// INTERNAL CONSTANT FUNCTIONS //////////////////////////////////////////////////////////////////////////*/ diff --git a/tests/integration/concrete/constructor.t.sol b/tests/integration/concrete/constructor.t.sol index 0eaff8e7..5f43ed47 100644 --- a/tests/integration/concrete/constructor.t.sol +++ b/tests/integration/concrete/constructor.t.sol @@ -25,6 +25,9 @@ contract Constructor_Integration_Concrete_Test is Integration_Test { address expectedAdmin = users.admin; assertEq(actualAdmin, expectedAdmin, "admin"); + // {SablierV2Lockup.supportsInterface} + assertTrue(constructedFlow.supportsInterface(0x49064906), "ERC-4906 interface ID"); + address actualNFTDescriptor = address(constructedFlow.nftDescriptor()); address expectedNFTDescriptor = address(nftDescriptor); assertEq(actualNFTDescriptor, expectedNFTDescriptor, "nftDescriptor");