Create Asset / Smart Contract using a Smart Contract - Algorand
Create Asset / Smart Contract using a Smart Contract
post by gidon on Feb 19, 2021
I am new to Algorand and was wondering if it is possible to write a smart contract that is able to create another smart contract (like a factory). Something like Expressions and Control Structures — Solidity 0.5.0 documentation in Solidity.
Similarly, can a smart contract also create a new asset?
Thanks!
post by JasonW on Feb 19, 2021
No contracts cant create other contracts or assets, but a call to a smart contract can be grouped with an asset creation transaction or smart contract creation transaction to approve the creation.
post by fabrice on Feb 19, 2021
To complement @JasonW’s answer, while you can make smart contracts create smart contracts and assets by using group transactions, for many use cases, you most likely do not want to do it this way on Algorand.
The exact pattern you want to use may depend on the actual application.
For example, to create a UniSwap-like smart contract on Algorand, you most likely want to use a single stateful smart contract application and one escrow stateless smart contract for each pair.