Unit ID
Zbh/yko4Knx09gqPOFurgdXJq0CEab2PUZGVRcbbNeU=
Received
29.09.2019 12:27:11
Confirmation delay (full node)
4 minutes 35 seconds
Confirmation delay (light node)
5 minutes 52 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 = "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(timestamp); if(!is_integer(trigger.data.timestamp )) bounce("invalid timestamp"); $first_timestamp = unit[trigger.data.second_unit_id].timestamp; response['nts'] = 'kGQZkIj3gRclCp2vw9LMg0jVnPKYCebXHxm8XYPxbQ4='; response['ts'] = unit['kGQZkIj3gRclCp2vw9LMg0jVnPKYCebXHxm8XYPxbQ4='].timestamp; response['mts'] = trigger.data.first_unit_id; response['mts'] = 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||")"); $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||"("||$second_timestamp||")"); $amount_from_first = unit[trigger.data.first_unit_id].messages[[.app='payment', .asset=$asset]].payload.outputs[[.address=$address] ].amount; if(!$amount_from_first)bounce("asset not existing in first unit"); $amount_from_second= unit[trigger.data.second_unit_id].messages[[.app='payment', .asset=$asset]].payload.outputs[[.address=$address] ].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. 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 the 'hodling amount proof', the timestamp must be include betwwen the timestamp of the first and the second unit."); }" } ] } ] } } ]
Technical information
Fees:
3,804 bytes
(353 headers, 3451 payload)
Level:1084865
Witnessed level:1084858
Main chain index:1083626
Latest included mc index:1083625
Status:stable/confirmed/final