25YGTN3XDWY2ZTJPPDODOAW22M63GJNE
[
"autonomous agent",
{
"messages": {
"cases": [
{
"if": "{
$base_key = 'balance_'||trigger.address;
$secret_key = 'secret_'||trigger.address;
$amount = trigger.data.amount;
$secret = trigger.data.secret;
$total = $amount+trigger.output[[asset=base]]-600;
$amount AND var[$secret_key] AND $amount <= var[$base_key] AND sha256($secret) == var[$secret_key]
}",
"messages": [
{
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{trigger.address}",
"amount": "{$total}"
}
]
}
},
{
"app": "state",
"state": "{
var[$base_key] = var[$base_key] - $amount;
response['message'] = 'withdrawn:' || $total|| ' bytes';
}"
}
]
},
{
"if": "{trigger.data.set_secret}",
"messages": [
{
"app": "state",
"state": "{
$base_key = 'balance_'||trigger.address;
$secret_key = 'secret_'||trigger.address;
var[$secret_key]=trigger.data.set_secret;
if(!var[$base_key])
var[$base_key] = 0;
var[$base_key] = var[$base_key] + trigger.output[[asset=base]];
response['sec'] = 'secret setted ok';
response['message'] = 'accepted:' || trigger.output[[asset=base]] || ' bytes' ;
}"
}
]
},
{
"messages": [
{
"app": "state",
"state": "{
$base_key = 'balance_'||trigger.address;
if(!var[$base_key])
var[$base_key] = 0;
var[$base_key] = var[$base_key] + trigger.output[[asset=base]];
response['message'] = 'accepted:' || trigger.output[[asset=base]] || ' bytes' ;
}"
}
]
}
]
}
}
]
- MCI: 970808
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"message": "withdrawn:29400 bytes"
}
}
- MCI: 970790
- Not bounced
- Response: {
"responseVars": {
"sec": "secret setted ok",
"message": "accepted:10000 bytes"
},
"error": "no messages after filtering"
}
- MCI: 970678
- Not bounced
- Response: {
"responseVars": {
"sec": "secret setted ok",
"message": "accepted:10000 bytes"
},
"error": "no messages after filtering"
}
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount
28.07.2019 02:33:36
25YGTN3XDWY2ZTJPPDODOAW22M63GJNE
out
28.07.2019 02:33:36
in
25YGTN3XDWY2ZTJPPDODOAW22M63GJNE
28.07.2019 02:28:49
in
25YGTN3XDWY2ZTJPPDODOAW22M63GJNE
28.07.2019 01:54:54
in
25YGTN3XDWY2ZTJPPDODOAW22M63GJNE