Unit ID
TmVS666mEOor8p0XbEvtIeZSZBmzWZo8M1BFELCaWwM=
Received
27.10.2019 16:41:01
Confirmation delay (full node)
6 minutes 3 seconds
Confirmation delay (light node)
7 minutes 26 seconds
Messages
Definition
Definition: [ "autonomous agent", { "bounce_fees": { "base": 10000 }, "init": "{ $PERCENT = 0.01; $SECOND = 1; $MINUTES = 60; $HOUR = 60 * $MINUTES; $DAY = 24 * $HOUR; $WEEK = 7 * $DAY; $YEAR = 364.25 * $DAY; $AA_NAME = "CODAA_ASSET_MANAGER"; $HOW_TO = "I'm made to be used by machine, just review my code to know more"; $AA_ONLY_USER = ""; $CAP = 1e15; $RETURN_PERCENTAGE = 4* $PERCENT; $DEBUG = true; if (!$DEBUG) if ($AA_ONLY_USER !=trigger.address) bounce ("Not owner!"); }", "messages": { "cases": [ { "if": "{ !!trigger.data.get_return }", "init": "{ if (timestamp< parse_date(var[trigger.data.name||"_last_return_time"]) + var[trigger.data.name||"_return_period"]) bounce ("too early"); $return = var[trigger.data.name||"_balance"] * var[trigger.data.name||"_return_percentage"]; }", "messages": [ { "app": "payment", "payload": { "asset": "{ var[trigger.data.name||"_id"] }", "outputs": [ { "address": "{trigger.address}", "amount": "{ $return }" } ] } }, { "app": "state", "state": "{ var[trigger.data.name||"_balance"] -= $return; var[trigger.data.name||"_last_return_time"] = timestamp_to_string(timestamp); var[trigger.data.name||"_next_return"] = var[trigger.data.name||"_balance"] * var[trigger.data.name||"_return_percentage"]; response["message"] = "return percentage sent."; }" } ] }, { "init": "{ if (!!var["asset_id"]) bounce ("already created, use get_return if you are owner"); $return = var[trigger.data.name||"_balance"] * var[trigger.data.name||"_return_percentage"]; }", "messages": [ { "app": "asset", "payload": { "cap": "{ $CAP }", "is_private": false, "is_transferrable": true, "fixed_denominations": false, "auto_destroy": false, "cosigned_by_definer": false, "issued_by_definer_only": true, "spender_attested": false } }, { "app": "state", "state": "{ var["asset_id"] = response_unit; var["creation_time"] = timestamp_to_string(timestamp); var["balance"] = $CAP; var["return_period"] = 1 * $YEAR; var["return_percentage"] = $RETURN_PERCENTAGE; var["last_return_time"] = timestamp_to_string(timestamp); var["next_return_value"] = $CAP * $RETURN_PERCENTAGE; response["message"] = "Asset created"; }" } ] } ] } } ]
Technical information
Fees:
2,951 bytes
(353 headers, 2598 payload)
Level:1125130
Witnessed level:1125123
Main chain index:1123887
Latest included mc index:1123886
Status:stable/confirmed/final