Unit ID
0z2TWZmafPQFohDBRObS5Cea4AAe5VUIKuDV0iVzxCo=
Received
04.09.2019 17:30:43
Confirmation delay (full node)
1 minute 58 seconds
Confirmation delay (light node)
11 minutes 32 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 }", "init": "{ $seller = trigger.address; $start_price = trigger.data.start_price otherwise bounce ("start price is missing"); $lowest_price = trigger.data.lowest_price otherwise bounce ("lowest price is missing"); $time_steps = trigger.data.time_steps otherwise bounce ("time steps 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": "{ $time = timestamp; 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 balance[$owner]; if ($amount > balance[$owner]) bounce("Invalid withdrawal amount. Maximum balance is " || balance[$owner]); if ($amount <= 0) bounce("Invalid withdrawal amount. Enter a number greater than zero."); if (trigger.address != $owner) bounce("Unauthorized"); }", "messages": [ { "app": "payment", "payload": { "outputs": [ { "address": "{$owner}", "amount": "{$amount}" }, { "address": "{$owner}", "amount": "{$REIMBURSEMENT}" } ] } }, { "app": "state", "state": "{ var[$owner] -= $amount; }" } ] }, { "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,480 bytes
(353 headers, 2127 payload)
Level:1045749
Witnessed level:1045742
Main chain index:1044522
Latest included mc index:1044521
Status:stable/confirmed/final