Unit ID
c+QGroc/QRo5CFs2AV6HySeL5icDHeVtDTJcMyOfTMY=
Received
15.08.2019 21:14:33
Confirmation delay (full node)
4 minutes 36 seconds
Confirmation delay (light node)
7 minutes 51 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $f = 1000; if(!trigger.data.safe) bounce ('please specifcy a safe name'); $balance = 'balance_' || trigger.data.safe; $secret_hashed = 'secret_' || trigger.data.safe; $input = trigger.output[[asset=base]]; }", "messages": { "cases": [ { "if": "{trigger.data.set_proof}", "init": "{ if (var[$secret_hashed]) bounce ("Safe already exists"); }", "messages": [ { "app": "state", "state": "{ var[$secret_hashed] = trigger.data.set_proof; response['sec'] = 'Secret set for account' || trigger.data.safe; var[$balance] = var[$balance] + $input; response['message'] = 'accepted on account ' || trigger.data.safe || ': ' || $input || ' bytes'; }" } ] }, { "if": "{trigger.data.secret}", "init": "{ if (!var[$secret_hashed]) bounce ("safe doesn't exists"); if (sha256(trigger.data.secret) != var[$secret_hashed]) bounce ("Wrong secret!"); }", "messages": [ { "init": "{ $total = var[$balance] + $input - $f; }", "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}", "amount": "{$total}" } ] } }, { "app": "state", "state": "{ var[$balance] = 0; var[$secret_hashed] = false; response['message'] = 'withdrawn from account ' || trigger.data.safe || '. '; }" } ] } ] } } ]
Technical information
Fees:
1,664 bytes
(353 headers, 1311 payload)
Level:1002059
Witnessed level:1002052
Main chain index:1000877
Latest included mc index:1000876
Status:stable/confirmed/final