Unit ID
7sYjmy1Ztb5uQqDdS6qPix6C6Mjfgv1DnYjS9hjpC74=
Received
28.09.2019 22:05:54
Confirmation delay (full node)
4 minutes 31 seconds
Confirmation delay (light node)
5 minutes 16 seconds
Messages
Definition
Definition: [ "autonomous agent", { "bounce_fees": { "base": 10000 }, "init": "{ // Store an easy accessible proof that You Were Holding Asset In The Past to be used by an AA. $name = "Snapshot for AA"; // made to be used by an other AA via var[this_aa_address][sha256($address||$asset||$timestamp)] // The user trigger the this AA with information and the AA store a state var linking address and timestamp to amount. // will probably work only for funds on single address wallet :( }", "messages": { "cases": [ { "if": "{ !!trigger.data.first_unit_id and !!trigger.data.second_unit_id and !!trigger.data.timestamp }", "init": "{ $address = trigger.data.address otherwise trigger.address; if(!is_valid_address($address)) bounce ("invalid address"); $asset = trigger.data.asset otherwise "base"; $date_and_time = timestamp_to_string(timestamp); if(!is_integer(trigger.data.timestamp )) bounce("invalid timestamp"); $first_timestamp = unit[trigger.data.first_unit_id].timestamp; if(!$first_timestamp) bounce ('first_unit not existing'); if($first_timestamp>trigger.data.timestamp) bounce("first unit should be earlier than "||$date_and_time); $second_timestamp = unit[trigger.data.second_unit_id].timestamp; if(!$second_timestamp) bounce ('first_unit not existing'); if(trigger.data.timestamp>$second_timestamp) bounce("second unit should be older than "||$date_and_time); $amount = unit[trigger.data.first_unit_id].messages[[.app='payment', .asset=$asset]].payload.outputs[[.address=$address] ].amount; if(!!$amount)bounce("asset not existing in first unit"); $id = sha256($address||$asset||trigger.data.timestamp); // to be able to use different assets and timestamps for a given address. if (!!var[$id]) bounce ("proof already existing for "||var[$id]||' '||$asset); }", "messages": [ { "app": "state", "state": "{ var[$id] = $amount; response["message"] = $amount||' '||$asset||" proof stored"; }" } ] }, { "messages": [ { "app": "state", "state": "{ bounce ("I need a 'first_unit_id', 'second_unit_id' and 'timestamp', to store thr 'own amount proof', the timestamp must be include betwwen the timestamp of the first and the second unit."); }" } ] } ] } } ]
Technical information
Fees:
3,058 bytes
(353 headers, 2705 payload)
Level:1084096
Witnessed level:1084089
Main chain index:1082857
Latest included mc index:1082856
Status:stable/confirmed/final