#Do i need iTxn?

4 messages · Page 1 of 1 (latest)

tardy badger
#

i have an app where a users can launch their own ASAs through the app, i tried using the itxn.AssetConfig to create the ASA upon app call, but it looks like the contract has to pay for it by itself. how do i make the user cover everything and not have to set a fixed fee, etc.

glossy hornet
#

Then you would of course add assets for that payment transaction in the contract logic; eg; assert payment_txn.receiver == Global.current_application_address and assert payment_txn.amount == 100_000

#

Eg;

@abimethod
def create_asset(
    asset_name: str,
    mbr_payment: gtxn.Payment
) -> UInt64:

    # assertions about payment here

    create_asset_tx = itxn.AssetConfig(
    . . .
    )

    return create_asset_tx.created_asset.id```