Verify Token Ownership
For certain applications, it may be necessary to perform a 2FA process to verify that the person scanning the physical BoyoTag is the legitimate owner of the corresponding digital token. To ensure this, you can employ an assert statement that checks the authenticity of the transaction initiator.
Consider using the following assert statement:
require( tx.origin == ownerOf[tokenId] ,"Only current holder can use the BoyoTag");It's important to note that while tx.origin is generally discouraged for NFTs that solely handle on-chain operations, it becomes a recommended practice for NFTs associated with physical items, as it enables verification of the actual address of the transaction initiator and the holder of the physical item.
Last updated
Was this helpful?