I have a smart contract that has a number of inner transactions, which the contract account has to pay for. The contract account also must maintain a min. balance as it holds an ASA. I was hoping to group any application calls that trigger the inner transactions with a payment transaction, which would supply the required fees for the inner transaction. I was under the impression that if the payment transaction was before the application call transaction in the group it would be executed first, therefore the application call transaction would observe the added funds, but this appears not to be the case. Is there any way to replenish funds for subsequent inner transactions?
It is definitely the case.
Can you show an example where you have an issue (with a minimum working example in Python/JS on TestNet so that we call all easily execute it)?
Or show the exact error?
I will try to find time to create a separate repo to demonstrate. Essentially, the group transaction that triggers the inner txn fails with the following error:
Error: Network request error. Received status 400: TransactionPool.Remember: transaction PT4YI7BK2ME6CCF4IFXFK4LSWQF2RXNLUTUGPVPTSHLJ4RY2XL5A: account K6WCFN6PB2LSXJTUHI6A4B7D6EZBWH55H3IXRV66WHYXBQIQ7C56T5KCLQ balance 199201 below min 200000 (1 assets)
If I instead transfer 1000 microalgos in a separate txn before the appcall txn, the transaction is successful (as it remains above the min 200000 after the itxn).