That is a good point.
A minor caveat is that right now in many cases where Ethereum use a factory design, I personally believe it is cleaner on Algorand to use local storage of fresh accounts rekeyed to the application account address (or controlled by a LogicSig).
This is what tinyman is using for example: GitHub - tinymanorg/tinyman-contracts-v1: Tinyman AMM Contracts V1.1
I don’t think there is another way. Why do you want another way?
Apart from CallerApplicationID
and CallerApplicationAddress
, everything looks like the transaction was made at top-level from Contract C point of view. Txn
and Gtxn
refer to the inner transaction and inner transaction group that called Contract C (that is in your notation group txn2).
It can use gtxn
.
gitxn
is to inspect inner transactions made by contract C.