Unit ID
jvQarz9HHwwui9FRpDq+bVAeEF20IExrrF9oZEiqER4=
Received
02.09.2019 09:55:25
Confirmation delay (full node)
3 minutes 41 seconds
Messages
Definition
Definition: [ "autonomous agent", { "bounce_fees": { "base": 10000 }, "init": "{ $BOUNCE_FEE = 10000; $TYPICAL_FEE = 1000; $REIMBURSEMENT = $BOUNCE_FEE - $TYPICAL_FEE; }", "messages": { "cases": [ { "if": "{ trigger.data.owner }", "init": "{ $owner = trigger.data.owner otherwise bounce("owner field is missing"); $period = trigger.data.period otherwise bounce("period field is missing"); $reference = sha256($owner || $period ); if (var[$reference]) bounce("pension plan already exists"); }", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}", "amount": "{$REIMBURSEMENT}" } ] } }, { "app": "state", "state": "{ var[$reference] = 'requested'; var[$reference||'.owner'] = $owner; var[$reference||'.period'] = $period; response['reference'] = $reference; response['status'] = var[$reference]; response['message'] = 'pension plan created'; }" } ] }, { "if": "{ $deposit = trigger.output[[asset = base]]; $deposit > $BOUNCE_FEE }", "messages": [ { "app": "state", "state": "{ response['message'] = 'Added ' || $deposit || ' bytes to the private pension plan'; }" } ] }, { "if": "{ trigger.data.action AND trigger.data.action == 'withdraw'}", "init": "{ $amount = trigger.data.amount otherwise bounce("define amount to withdraw"); $reference = trigger.data.reference otherwise bounce("reference field is missing"); $owner = var[$reference||'.owner']; if (trigger.address != $owner) bounce("Unauthorized"); }", "messages": [ { "app": "payment", "payload": { "outputs": [ { "address": "{trigger.address}", "amount": "{$amount}" }, { "address": "{trigger.address}", "amount": "{$REIMBURSEMENT}" } ] } } ] }, { "init": "{ bounce("Enter a data field: owner, reference or action"); }", "messages": [ { "app": "state", "state": "{ response['usage'] = 'Enter a data field: owner, reference or action'; }" } ] } ] } } ]
Technical information
Fees:
2,101 bytes
(353 headers, 1748 payload)
Level:1040195
Witnessed level:1040188
Main chain index:1038980
Latest included mc index:1038979
Status:stable/confirmed/final