Unit ID
0JpFlm9gP2Dkw1tOwx8BQ/l2ZyQv1VqocnJthY86muM=
Received
06.09.2019 11:45:00
Confirmation delay (full node)
3 minutes 25 seconds
Confirmation delay (light node)
6 minutes 38 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $department = var['department']; $default_asset = var['default_asset']; $sent_asset = trigger.output[[asset!=base]].asset; $address = trigger.data.address; $amount = trigger.data.amount; if ($sent_asset == 'ambiguous') { bounce('multiple assets sent, send only one'); } }", "messages": { "cases": [ { "if": "{$department AND $address AND $amount}", "init": "{ $asset = ($sent_asset != 'none') ? $sent_asset : $default_asset; $allowance_now = var[trigger.address || '_' || $asset] otherwise 50; $sent_amount = trigger.output[[asset=$sent_asset]].amount; $allowance_left = $allowance_now + $sent_amount - $amount; if ($allowance_left < 0) { bounce('cannot spend that much'); } }", "messages": [ { "app": "payment", "payload": { "asset": "{$asset}", "outputs": [ { "address": "{$address}", "amount": "{$amount}" } ] } }, { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}", "amount": "{trigger.output[[asset=base]] - 1000}" } ] } }, { "app": "state", "state": "{ var[trigger.address || '_' || $asset] = $allowance_left; }" } ] }, { "if": "{!!$department != true OR $asset != 'none'}", "messages": [ { "app": "state", "state": "{ var['department'] = trigger.address; var['default_asset'] = $sent_asset; }" } ] } ] } } ]
Technical information
Fees:
1,626 bytes
(353 headers, 1273 payload)
Level:1049228
Witnessed level:1049221
Main chain index:1048001
Latest included mc index:1048000
Status:stable/confirmed/final