I’m trying to write a stateful smart contract application that can
- Create an NFT (therefore, unique ASA Id per user)
- Have the user opt-in to receive the NFT
- And transfer the NFT to the user
I know you can do this with two separate groups: one for asset creation and another for opting in and transferring the ASA but if possible, I want to do this in a single transaction or at the very least, in an atomic transfer.
The problem I’m running into is that the created ASA is not being a part of the foreign ASA array so I’m unable to have the user opt-in. I tried to use group transfers but I don’t have access to the ASA Id.
Is the only way to do this to have two separate transaction groups?