Streamlined Token Standards Proposal

With the upcoming release of Secure Cadence, and the changes to taking references to optionals, the collection borrow function should probably be updated to return an optional reference now, instead of aborting execution when the NFT with the given ID does not exist:

pub fun borrowNFT(id: UInt64): &NFT?

This will also allow users to quickly check if an NFT with a certain ID exists in the collection.

Likewise, maybe also the withdraw function should be changed to return an optional:

pub fun withdraw(withdrawID: UInt64): @NFT?
3 Likes