sablier-labs / v2-core

⏳ Core smart contracts of the Sablier V2 token distribution protocol
https://sablier.com
Other
288 stars 38 forks source link

feat: eip-4906 interface #946

Closed smol-ninja closed 1 week ago

smol-ninja commented 2 weeks ago

Linked issue

I didn't include supportsInterface in interface because its verbose. The Natspec is quite clear.

/// @inheritdoc ERC721
function supportsInterface(bytes4 interfaceId) public view override(ERC721, IERC165) returns (bool) {
    return interfaceId == 0x49064906 || super.supportsInterface(interfaceId);
}
PaulRBerg commented 1 week ago

We can actually put it in the interface by inheriting IERC4906 in ISablierV2Lockup.

This is how it should have always been done.

smol-ninja commented 1 week ago

Any reason why IERC4906 and not just IERC165? Its ERC-165 that defines the standard interface.

PaulRBerg commented 1 week ago

Because IERC4906 interface also contains the MetadataUpdate and the BatchMetadataUpdate events, which we need.