algorand / algorand/go-algorand

Support the ability to specify 'gaid t' as an app ID or asset ID

Aperta
#3,701 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
new-feature-request Team Scytale
Lingua principale
Go
Stelle
1.4k
Fork
537
Merge medio
1g 6h
PR unite (30g)
17

Descrizione

## Problem

Imagine that we have a smart contract that someone can call, and it will mint a new NFT asset for them. If the user wants the NFT to be in their wallet, they will have to sign a minimum of two transactions. This makes for a poor experience asking the user to sign a transaction, wait 15 seconds, then immediately sign another transaction.

## Solution

The solution is adding support for a transaction to specify the asset/app ID that was created earlier in the group transaction, similar to how [gaid t](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/#gaid-t) works in TEAL. The user could then sign a single group transaction and the end result would be a new asset is minted, opted into, and transferred to their wallet. An example of how this could be done using goal is below:

```bash
goal app call --app-id $APP_ID --app-arg "str:mintAsset" -f $ACCOUNT -o txn0.txn
goal asset send --assetid 'gaid 0' -f $ACCOUNT -a 0 -t $ACCOUNT -o txn1.txn
goal app call --app-id $APP_ID --app-arg "str:sendAsset" -f $ACCOUNT -o txn2.txn
```

If this worked for app IDs, then it would also handle the situation where you create a contract and want to fund it as an account in a single transaction.

## Dependencies

No dependencies.

## Urgency

The sooner this is implemented, the slicker Algorand becomes.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.