[
"autonomous agent",
{
"bounce_fees": {
"base": 10000
},
"init": "{
$aa = trigger.data.aa otherwise "
XYK5Q3T57HEZO46ANT2ZLVDHZTM6DDD4"; // AA address to test
$to_aa_price = 1000;
$from_aa_price = 3000;
$to_user_price = 1000;
// rooting;
$from_aa = trigger.address == $loopaa;
$from_user = !$from_randomiser;
$user = ($from_aa) ? trigger.data.address : trigger.address;
$count = var['count'] otherwise 0;
}",
"messages": {
"cases": [
{
"if": "{ $from_user }",
"init": "{}",
"messages": [
{
"app": "data",
"payload": {
"input": "{trigger.data.input}",
"address": "{$user}"
}
},
{
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{$loopaa}",
"amount": "{$from_aa_price}"
}
]
}
},
{
"app": "state",
"state": "{
var['count'] = $count +1;
}"
}
]
},
{
"init": "{}",
"messages": [
{
"app": "data",
"payload": {
"input": "{trigger.data.input}"
}
},
{
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{$user}",
"amount": "{balance[base]}"
}
]
}
},
{
"app": "state",
"state": "{
var['count'] = false;
}"
}
]
}
]
}
}
]