Standard way in FA2: invert the control
The standard way in FA2 is to reverse the logic.
From (what you expected to do):
-
Alice calls
transfer
onFA2
. -
Contract
C
reacts to the receive.
To (what is recommended to do):
-
Alice calls
update_operators
onFA2
to addC
as operator. -
Alice calls
C
to start the logic. -
C
reacts to call by callingtransfer
onFA2
from Alice’s token to itself. -
Alice calls
update_operators
onFA2
to removeC
as operator.
Step 1, 2 and 4 starts a transaction. Those three transactions can be batched in one big batch-transaction.