Unit ID
o2/6ni0/weklEo/Sjy1tlFGRlS4ZCeVD4T3az894J5E=
Received
10.10.2019 22:22:23
Confirmation delay (full node)
4 minutes 55 seconds
Confirmation delay (light node)
7 minutes 31 seconds
Messages
Definition
Definition: [ "autonomous agent", { "bounce_fees": { "base": 10000 }, "init": "{ // Store an easy accessible proof that You Were Holding Asset In The Past that can be used by an AA. $name = "DAG 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(trigger.data.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||"("||$first_timestamp||")"); $second_timestamp = unit[trigger.data.second_unit_id].timestamp; if(!$second_timestamp) bounce ('second unit not existing'); if(trigger.data.timestamp>$second_timestamp) bounce("second unit should be older than "||$date_and_time||"("||$second_timestamp||")"); $amount_from_first = unit[trigger.data.first_unit_id].messages[[.app='payment']].payload.outputs[[.address=$address, .asset=$asset]].amount; if(!$amount_from_first)bounce("asset not existing in first unit"); $amount_from_second= unit[trigger.data.second_unit_id].messages[[.app='payment']].payload.outputs[[.address=$address, .asset=$asset] ].amount; if(!$amount_from_second)bounce("asset not existing in second unit"); $prooven_amount = ($amount_from_first<$amount_from_second) ? $amount_from_first : $amount_from_second; $id = sha256($address||$asset||trigger.data.timestamp); // to be able to use different assets and timestamps for a given address.g if (!!var[$id]) bounce ("proof already existing for "||var[$id]||' '||$asset); }", "messages": [ { "app": "state", "state": "{ var[$id] = $prooven_amount; response["message"] = $prooven_amount||' '||$asset||" proof stored"; }" } ] }, { "messages": [ { "app": "state", "state": "{ bounce ("I want to create for you a proof that your actual address was hodling some bytes at a given time. For that, I need a 'first_unit_id', 'second_unit_id' showing your actual address with bytes and the 'timestamp', to store the 'hodling amount proof', the timestamp must be included betwwen the timestamp of the first and the second unit."); }" } ] } ] } } ]
Technical information
Fees:
3,711 bytes
(353 headers, 3358 payload)
Level:1102066
Witnessed level:1102059
Main chain index:1100826
Latest included mc index:1100825
Status:stable/confirmed/final