'how can I keep track of the owner of each nft in my contract in Cadence?

Someone suggested I should aggregate events in an external db but I'm trying to avoid that and keep all the info in the contract. Any ideas? -spacepluk



Solution 1:[1]

There’s no way to do that on-chain. NFTs in Cadence are resources stored in user’s account instead of the contract (“decentralized storage” / ownership instead of “ledger-style” / centralized storage). Users can freely do whatever they want with their data, including transferring it. That’s not a function of the contract. It’s different by design. -Bastian

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bruno Gonzales