flow-hydraulics / flow-pds

This repository is currently not maintained
4 stars 8 forks source link

Recommendation: Include Interfaces In Implementation Contracts #54

Open rheaplex opened 3 years ago

rheaplex commented 3 years ago

I recommend including the interfaces from the I* contracts directly in the contracts that implement them, rather than having them in separate files.

This would be bad practice in other languages, but I believe that in Cadence it helps with security, by simplifying capability descriptions and discouraging using other implementations of the interfaces.

whalelephant commented 3 years ago

Hi @rheaplex, Do you mean IPackNFT? We have separated the interface because, IIUC, it should be specified so other issuers can use it in the future to interface with PDS. From the requirements

Provides a Capability that references the Issuer’s own Pack NFT implementation, to allow for the creation of Pack instances. (The Pack NFT will have a well-defined interface specification.)

Please let me know if I have misunderstood it or it is still ok for now to not provide a contract interface.