Unit ID
C8l1x2Mod4Axdi0IUpHuYkmjnYmknghndN/yEZqNgzE=
Received
30.07.2019 22:21:43
Confirmation delay (full node)
4 minutes 36 seconds
Confirmation delay (light node)
7 minutes 2 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $banker = 'JBGMJI7XSKLKNHZF26BUBWHVUZSDV3P5'; $f = 1000; if(trigger.data.account) $acct_key = trigger.data.account; else $acct_key = ''; $base_key = 'balance_' || trigger.address || $acct_key; $secret_key = 'secret_' || trigger.address || $acct_key; $inp = trigger.output[[asset=base]]; }", "messages": { "cases": [ { "if": "{ $secret = trigger.data.secret; $secret AND trigger.data.receiver AND var[$secret_key] AND sha256($secret) == var[$secret_key] }", "messages": [ { "init": "{ $total = var[$base_key] + $inp - $f; }", "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.data.receiver}", "amount": "{$total}" } ] } }, { "app": "state", "state": "{ var['total'] = var['total'] - var[$base_key]; var[$base_key] = 0; var[$secret_key] = false; response['message'] = 'withdrawn from account ' || $acct_key || ': ' || $total || ' bytes'; }" } ] }, { "if": "{trigger.data.set_proof AND !var[$secret_key]}", "messages": [ { "app": "state", "state": "{ var[$secret_key] = trigger.data.set_proof; response['sec'] = 'secret set for account' || $acct_key; var['total'] = var['total'] + $inp; var[$base_key] = var[$base_key] + $inp; response['message'] = 'accepted on account ' || $acct_key || ': ' || $inp || ' bytes'; }" } ] }, { "if": "{ $allowed = balance[base] - $inp - var['total'] - $f; $banker == trigger.address AND trigger.data.withdraw AND $allowed > 0 }", "messages": [ { "init": "{ $total = $allowed + $inp; }", "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}", "amount": "{$total}" } ] } } ] }, { "messages": [ { "app": "state", "state": "{ var['total'] += $inp; var[$base_key] += $inp; response['message'] = 'accepted on account '|| $acct_key || ': ' || $inp || ' bytes' ; }" } ] } ] } } ]
Technical information
Fees:
2,134 bytes
(353 headers, 1781 payload)
Level:977139
Witnessed level:977132
Main chain index:975959
Latest included mc index:975958
Status:stable/confirmed/final