Unit ID
T+Sqzx9YQ1IDiOW3gZ9teHQV3ZNSQjymVX4Q34poD4A=
Received
15.08.2019 22:41:01
Confirmation delay (full node)
6 minutes 34 seconds
Confirmation delay (light node)
8 minutes 54 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $f = 1000; if(!trigger.data.safe) bounce ('please specifcy a safe name'); $balance_key = 'balance_' || trigger.data.safe; $code_hashed_key = 'code_' || trigger.data.safe; $input = trigger.output[[asset=base]]; }", "messages": { "cases": [ { "if": "{trigger.data.set}", "init": "{ if (var[$code_hashed_key]) bounce ("Safe already exists"); }", "messages": [ { "app": "state", "state": "{ var[$code_hashed_key] = trigger.data.set; response['sec'] = 'Code set for safe ' || trigger.data.safe; var[$balance_key] = var[$balance_key] + $input; response['message'] = 'accepted in safe ' || trigger.data.safe || ': ' || $input || ' bytes'; }" } ] }, { "if": "{trigger.data.code}", "init": "{ if (!var[$code_hashed_key]) bounce ("safe doesn't exists"); if (sha256(trigger.data.code) != var[$code_hashed_key]) response['message'] = sha256(trigger.data.code) ||" "||var[$code_hashed_key]; //bounce ("Wrong code!"); }", "messages": [ { "init": "{ $total = var[$balance_key] + $input - $f; }", "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}", "amount": "{$total}" } ] } }, { "app": "state", "state": "{ var[$balance_key] = false; var[$code_hashed_key] = false; response['message'] = 'withdrawn from safe ' || trigger.data.safe || '. '; }" } ] } ] } } ]
Technical information
Fees:
1,763 bytes
(353 headers, 1410 payload)
Level:1002280
Witnessed level:1002273
Main chain index:1001098
Latest included mc index:1001097
Status:stable/confirmed/final