JCFDOVY7NQ43FVAQGS53YIO5BFK5CKXN
[
"autonomous agent",
{
"bounce_fees": {
"base": 10000
},
"init": "{
$vrf = 'IFCSZYF6SLPC7IYNEIDEHMI6SEVDJOFM';
$pubkey = var['pubkey'];
}",
"messages": {
"cases": [
{
"if": "{trigger.data.type == 'set_pubkey' AND trigger.data.pubkey}",
"messages": [
{
"app": "state",
"state": "{
if (exists($pubkey)) {
bounce('already init');
}
var['pubkey'] = trigger.data.pubkey;
}"
}
]
},
{
"if": "{
trigger.data.type == 'walk'
}",
"messages": [
{
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{$vrf}",
"amount": "{1000000}"
}
]
}
},
{
"app": "state",
"state": "{
if (trigger.output[[asset=base]] < 1010000) {
bounce('Min amount: ' || 1010000 || 'bytes');
}
var['rid_' || response_unit] = trigger.address;
}"
}
]
},
{
"if": "{trigger.data.id AND trigger.data.proof}",
"messages": [
{
"app": "state",
"state": "{
$id = trigger.data.id;
$proof = trigger.data.proof;
$address = var['rid_' || $id];
if (!exists($address)) {
bounce('Random request not found');
}
if (!vrf_verify($id, $proof, $pubkey)) {
bounce('Not valid vrf');
}
$steps = number_from_seed($proof, 0, 20);
var['user_' || $address] += $steps;
response['result'] = 'User ' || $address || ' walked ' || $steps || ' steps';
}"
}
]
}
]
}
}
]
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount