I am trying to write a simple anchor program that will burn the SPL tokens that the user sends to my anchor program. I followed the guide below on QuickNode to build a new program that allows minting.
I then modified the code a bit so that when the user sends SOL to the program, it calculates how much of the SPL Token to mint and sends it back to the users ATA account they provded.
I am now trying to do it the other way around. I want to have the user send the SPL token to the function in the program. Burn the token, and then send sol back.
I followed a couple guides, however, I cant seem to find if it is possible to burn the SPL token right then and there, or if I have to have them transfer the SPL to another program owned PDA and then burn it there.
Is there a way to just have instruction for the SPL token to be burned right when its sent to the program function without first sending it to a program owned ata? Just a simple burn with the sender signature?
I followed a couple guides including Burning Guide but they all seem to need the program to own the token before they are burned.
I also checked out this documentation and it just seems like gibberish to me without someone to explain it. Burn Information Solana