Unit ID
7Xi8omGF9lk/wycuMZ4oyEGenUpwd7kp6XZWdTX6ZUw=
Received
01.09.2019 13:26:03
Confirmation delay (full node)
3 minutes 11 seconds
Confirmation delay (light node)
4 minutes 20 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' AND trigger.address == $owner }", "init": "{ $account = trigger.address; $balance = var[$account] otherwise bounce("No such account"); $amount = trigger.data.amount otherwise $balance; if ($amount > $balance) bounce("Invalid withdrawal amount. Maximum balance is " || $balance); if ($amount <= 0) bounce("Invalid withdrawal amount. Enter a number greater than zero."); }", "messages": [ { "app": "payment", "payload": { "outputs": [ { "address": "{$account}", "amount": "{$amount}" }, { "address": "{$account}", "amount": "{$REIMBURSEMENT}" } ] } }, { "app": "state", "state": "{ var[$account] -= $amount; }" } ] }, { "init": "{ bounce("Enter a data field: payer, payee, reference or action"); }", "messages": [ { "app": "state", "state": "{ response['usage'] = 'Enter a data field: payer, payee, reference or action'; }" } ] } ] } } ]
Technical information
Fees:
2,256 bytes
(353 headers, 1903 payload)
Level:1037263
Witnessed level:1037255
Main chain index:1036049
Latest included mc index:1036048
Status:stable/confirmed/final