I am building kind of a platform to create ASA, where users will be able to create their own ASA.
They create ASA, then send them all to contract accounts, where other people can buy them directly from the contract with their wallets.
My problem is that I found out that those creators cannot use “closeTo” in the transactions of the ASA when sending them all. The error being “cannot close asset ID in allocating account”.
So basically the more they create ASA, the more they have “assets” in their account, even tho they are empty and the user might never get some of those ASA back. So it can grow infinitely.
Is there a way to “clear” those empty ASA ? Even tho they are the creator of them ?
Maybe optOut AFTER having them send to the contract or something ?
Thank you guys very much
The creator can only destroy the asset if the manager address is set and all the assets are sent back to the creator address. This means the creator still needs to keep a certain minimum balance (0.1 Algo) until they destroy the asset.
This is because you need to “pay” for the space used by the properties of the asset. This “payment” is through the minimum balance and is reimbursed when the asset is destroyed, that is when there is no more need to store the asset properties.
If you never plan to destroy the asset, you can see the minimum balance of the creator as a fee/payment that is never returned.
Note that minting/creating assets cost also on other blockchains like Ethereum (for which it costs much more than $1 which is much more than 0.1 Algo).
And contrary to Algorand, there is not way to get back this “fee” by destroying the blockchain.
See also the related question Asset Limit Account and Minimum Balance - #2 by fabrice (which talks about minimum balance for holding assets, but the ideas are similar).