Unit ID
FkAdOMccNRRC3iGzlO101WfOvSm50dEfRuDBiP3OgoY=
Received
13.09.2019 06:12:09
Confirmation delay (full node)
9 minutes 41 seconds
Confirmation delay (light node)
12 minutes 33 seconds
Messages
Definition
Definition: [ "autonomous agent", { "messages": [ { "init": "{ $who = "HFNBIQTUNVMRM7PDP6NT2QRKLR62FOGR" ; $day = 13 ; $month = 9 ; // Time for Birthday Fiddle AA by [email protected] // usage: // friends or strangers can contribute to the annual fiddle fund anytime // the person who has birthday can release the fiddle every year on their birthday to fulfil their wishes // to release - need to send two 10,000 transactions, one to blow out the candle and one to withdraw // the AA will also keep track of lifetime accumulated amount // setup: // set the person who has birthday address, day and month ( year might be a secret ) above // maybe better to use real attestation, but let's keep it simple for now $today = timestamp ; $storage = 1000 ; $present = var[ "present" ] otherwise $storage ; $fiddle = var[ "fiddle" ] otherwise 0 ; }", "app": "data", "payload": { "friend": "{trigger.address}" } }, { "if": "{ trigger.address == $who AND ( balance[ base ] - $present ) > 0 }", "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{$who}", "amount": "{ balance[ base ] - $present }" } ] } }, { "app": "state", "state": "{ if( $today > $fiddle ){ // THE FIDDLE PLAYED var[ "present" ] = 0 ; // START NEW PRESENT var[ "fiddle" ] = $today + 60 * 3 ; // TESTING $year = substring( timestamp_to_string( $today , "date" ) , 0 , 4 ) + 1 ; response[ "year" ] = $year; //var[ "fiddle" ] = parse_date( $year || "-" || $month || "-" || $day ); // MOVE FIDDLE TO NEXT BIRTHDAY if( trigger.address == $who ) response[ "happy_birthday" ] = "send one more transaction to get your present"; } else var[ "present" ] += trigger.output[[asset=base]] - $storage ; // ADD TO PRESENT var[ "lifetime_amount" ] += trigger.output[[asset=base]] ; response[ "fiddle" ] = "will be played on " || timestamp_to_string( var[ "fiddle" ] ) ; }" } ] } ]
Technical information
Fees:
2,452 bytes
(353 headers, 2099 payload)
Level:1057708
Witnessed level:1057698
Main chain index:1056481
Latest included mc index:1056480
Status:stable/confirmed/final