Hello!
I have few question around algorand smart contracts and ASA creation.
Questions:
Creation of ASA can be done using some sdk or it can be done using smart contracts?
2.The approach i am following in an application is
I created a ASA using normal java transaction.
I created another api to create application and in the approval program wrote a inner trx to check for transfer of asa
next is after compiling approval program the result that is returned i changed that to escrow address.
next i created a group transaction with app call txn,optin asset txn and transfer asa in java and compiled this group tnx to transfer asa
Both can be done. It depends on the use case. But I would say 90% of the applications most likely do not need the ASA to be created by a smart contract. This is only for advanced use cases where ASA need to be dynamically created.
Thanks!
If you could share how to create ASA using smart contracts.
Is it using the goal command?
Binding goal with smart contract to check for the constraints (verifications of constraints passed as arguments in goal command)
And while implementing the use case mentioned above
while creating a group tnx (Application call,OptIn and ASA transfer)
Getting this error
If you have any idea about it
Creating an ASA from a smart contract is an advanced process.
You can do it using inner transactions:
But once again, this is only for advanced use cases where you do not know in advance which assets and how many assets will be created by the smart contract.
ASA can be created either with SDKs (signing the AssetCreate both with a Single Signature or Multi Signature accounts) either with Smart Contract (signing the AssetCreate both with a Smart Signature or an Inner Transaction).
Thanks!
If you could provide me with any sample for the creation of ASA using smart contracts and steps to run the code, please.
unable to run the code defined in docs
Hello @chahat , also was going through this problem, I think still the best way is to create lots of ASAs using the goal command(you can calculate how many your project needs by factoring in how much you will issue on a liquidity pool if you will so as to price your ASA, and then some other for your project’s application), then create a smart contract that algorithmically churns out ASAs based on the logic you prefer and then now manually send the ASAs you created using goal again to this smart contract, then reconfigure that smart contract as the new reserve address. I still think it is a waste creating ASAs purely by a smart contract especially using PyTeal/TEAL, you can use Reach though if you want to have a contract command both creation and issuing of ASAs, at least with Reach you wouldn’t need a security audit
Here you have a complete example dApp that mints NFTs (using Inner Transactions). You have both the PyTEAL source code and a CLI to deploy the dApp and mint the NFTs.
In this specific example the dApp is a mango tree that mints delicious ARC-3 compliant non-fungible-mangos .
The CLI is in Portuguese, but all the commands are very straight forward: you should be able to read the CLI’s source code and understand how to deploy and interact with the dApp.
One note: there is a “specific” word to be passed as CLI argument to withdraw the NFT, but it’s very easy to find it!