ERC721Full and ERC165


#1

Hey guys,
Working on a little crypto card project and am inheriting the 721Full interface on my contract as it looks like it will bring along the metadata and enumerable pieces.

What do I need to do as far as 165 and supportedInterfaces? Do I just need to make the supportedInterfaces declarations for the 721, metadata, and enumerable functions?

Is there a good reference for how those look? I tried dropping this into my constructor to see if I was on the right track but got an undeclared error on supportedInterfaces when I tried to compile it in Truffle:
supportedInterfaces [
this.balanceOf.selector ^
this.ownerOf.selector ^
] = true;

Any advice would be greatly appreciated,
Kevin


#2

No need, this is done automatically for you in the constructors.

Are you trying to add your own custom functions to the declared interfaces? If you, doing functionA.selector ^ functionB.selector will return the bytes4 value that you need to pass to _registerInterface: there’s no need to store those in an array.

_registerInterface(this.balanceOf.selector ^ this.ownerOf.selector);

#3

Thanks Nicolas! That’s fantastic.

Loving OpenZeppelin, makes learning this so much easier.