Unit ID
F2NiNTp3v/xO5BpPxAZCje2DGPgCYsv3qf9y8yfM/FQ=
Received
24.08.2019 20:48:58
Confirmation delay (full node)
2 minutes 55 seconds
Confirmation delay (light node)
6 minutes 50 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $aa_name = "AAAA"; // Dynamic Asset Names Autonomous Agent; $owner = "O7NYCFUL5XIJTYE3O4MKGMGMTN6ATQAJ"; // could withdraw the dust is calculable. $i = trigger.data; }", "messages": { "cases": [ { "if": "{ $i.create }", "init": "{ $list_name = $i.create; if (var[$list_name]) bounce ("'"||$list_name||"' already exist!"); }", "messages": [ { "app": "state", "state": "{ var[$list_name] = trigger.address; //owner of the list; var[$list_name||"_count"] = 0 ; var[$list_name||"_is_public"] = $i.public; response['message'] = $list_name||" created ^^."; }" } ] }, { "if": "{ $i.add }", "init": "{ $list_name = $i.list_name; if (!$list_name) bounce ("Need 'list_name'!"); if (!(var[$list_name])) bounce ("'"||$list_name||"' do not exist !"); if (!(var[$list_name||"_is_public"])) if (trigger.address != var[$list_name]) bounce ("You don't own this private list"); $new_entry = $i.add; }", "messages": [ { "app": "state", "state": "{ var[$list_name||"_count"] +=1; var[$list_name||"_"||$new_entry] = var[$list_name||"_count"]; var[$list_name||"_"||var[$list_name||"_count"]] = $new_entry; response['message']= $new_entry||" added ^^."; }" } ] }, { "if": "{ $i.delete }", "init": "{ $list_name = $i.delete; if (!(var[$list_name])) bounce ("'"||$i.list_name||"' did not exist at the first place!"); if (trigger.address != var[$list_name]) bounce ("Must be owner to delete the list"); if (var[$list_name||"_count"] > 0) bounce ("List must be empty to be deleted, use 'remove_last' as much as needed"); }", "messages": [ { "app": "state", "state": "{ var[$list_name] = false; var[$list_name||"_count"] = false; response['message']= $list_name||" delete ^^."; }" } ] }, { "if": "{ $i.remove_last }", "init": "{ $list_name = $i.remove_last; if (!(var[$list_name])) bounce ("'"||$i.list_name||"' did not exist !"); if (trigger.address != var[$list_name]) bounce ("Must be owner to remove last entry of the list"); if (var[$list_name||"_count"] == 0) bounce ("List is empty!"); }", "messages": [ { "app": "state", "state": "{ // get last entry $last_entry = var[$list_name||"_"||var[$list_name||"_count"]]; // remove it var[$list_name||"_"||$last_entry] = false; var[$list_name||"_"||var[$list_name||"_count"]] = false; var[$list_name||"_count"] -= 1; response['message']= $last_entry||" removed ^^."; }" } ] }, { "messages": [ { "app": "state", "state": "{ bounce ("default case"); }" } ] } ] } } ]
Technical information
Fees:
3,717 bytes
(353 headers, 3364 payload)
Level:1023998
Witnessed level:1023990
Main chain index:1022811
Latest included mc index:1022810
Status:stable/confirmed/final