State of AssetHolding.balance


I’m trying to understand the order of execution of transactions.

Suppose I have an account “accountA” which has an asset balance 10 for some ASA “assetA”.

Then I create an atomic transaction group with two transactions.
Txn1 = transfer 5 assetA to accountA (so if these succeed the balance would be 15)
Txn2 = applicationCallTxn (passing accountA as account argument)

If Txn2 calls assetHolding.balance(Int(1),assetA_id) it seems to return 15 even if the logic rejects the transaction (so Txn1 fails).

I haven’t tested this extensively though, so I’m not sure if it holds in general.

Would the same behavior hold if we reversed the order of the transactions?

the logic will assume any transactions before it are successful. That is why you are seeing 15. If it fails obviously the change will not be pushed. Atomics are quite nice :slight_smile: