NFT crafting/combining: Where to store burnRef
?
#381
-
Discord user IDarjanjohan Describe your question in detail.tldr: How to burn NFT's? Any code examples of NFT's that are used (to combine/craft into new NFT's) in Aptos Move? We are working on an NFT platform where users can combine 2 NFT's and create a new NFT. The old NFT's should get burned. We started with the Currently I added this. When minting an NFT, the
But when I actually want to burn the NFT's, I cannot dereference the
Source code: What error, if any, are you getting?error[E05001]: ability constraint not satisfied What have you tried or looked at? Or how can we reproduce the error?No response Which operating system are you using?Linux (Ubuntu, Fedora, Windows WSL, etc.) Which SDK or tool are you using? (if any)N/A Describe your environment or tooling in detailNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The easiest way is to put the Here's an example https://github.com/aptos-labs/daily-move/blob/main/snippets/modifying-nfts/sources/modify_nfts.move#L201-L228 |
Beta Was this translation helpful? Give feedback.
-
Great, that is exactly what I needed. I adjusted the code according to the example you gave and it compiles. Thanks for unblocking us! |
Beta Was this translation helpful? Give feedback.
The easiest way is to put the
BurnRef
in the token's object itself with amove_to
with the object's address. You will then need to do amove_from
the object's address to recover theBurnRef
, which must be consumed byburn
. You cannot use a reference of theBurnRef
Here's an example https://github.com/aptos-labs/daily-move/blob/main/snippets/modifying-nfts/sources/modify_nfts.move#L201-L228