Unit ID
MAlg6vc9eo+3OB8TBFwT4FPa+3+bgmGwnxWodBcOapI=
Received
02.09.2020 12:01:16
Confirmation delay (full node)
4 minutes 32 seconds
Confirmation delay (light node)
8 minutes 18 seconds
Messages
Definition
Definition: [ "autonomous agent", { "bounce_fees": { "base": 10000 }, "init": "{ // admin stuff $this = { name: "NUDGER", owner:"O7NYCFUL5XIJTYE3O4MKGMGMTN6ATQAJ", use_cases: "Be first to use 'token = <received token>' after the request time and before the acceptable delay to receive the associated reward. To subscribe as an helper and have a chance to be picked up later use: 'subscribe = true'. To unsubscribe use: 'unsubscribe = true'. If your are an AA use at minimum 'ask_help = <true>'.", how_to: "Use 'ask_help = <true>' with optionaly 'helper = <address>' if you want to propose an helper. Use 'private_mode = true' to force the triggering to be done by the specific helper. If you need to be trigger after a given time, use 'request_time = <timestamp>' and if you want to give a dead line use 'acceptable_delay = <delay in seconds>'. " }; // to collect the dust }", "messages": { "cases": [ { "if": "{ !!trigger.data.nudge_with_tag }", "init": "{ $tag = trigger.data.nudge_with_tag; $nudge = json_parse(var[$tag] otherwise bounce ("Too late or wrong tag")); // validity tests if ($nudge.time > timestamp) bounce ("Too early, try at "||timestamp_to_string($nudge.time)); if (!!$nudge.is_private and $nudge.is_private != trigger.address) bounce ("Private reward!"); $late_nudge = timestamp > $nudge.deadline; $reward_destination = $late_nudge ? $nudge.aa : trigger.address; }", "messages": [ { "app": "data", "payload": { "tag": "{$tag}" } }, { "if": "{ !!$nudge.reward_asset != "base" }", "app": "payment", "payload": { "asset": "{$nudge.reward_asset}", "outputs": [ { "address": "{ $reward_destination }", "amount": "{ $nudge.reward_amount }" } ] } }, { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{ $reward_destination }", "amount": "{ $nudge.reward_amount }" }, { "if": "{ !$late_nudge }", "address": "{ $nudge.aa }", "amount": "{ 1 }" } ] } }, { "app": "state", "state": "{ var[$tag] = false; response['message'] = $late_nudge ? "Too late, sorry !" : trigger.address||" has been rewarded ^^"; }" } ] }, { "messages": [ { "app": "state", "state": "{ $requested_time = trigger.data.requested_time otherwise timestamp; $request = { address: trigger.data.requested_address otherwise trigger.address, time: $requested_time, deadline: $requested_time + trigger.data.requested_acceptable_delay otherwise 10*24*60*60, is_private: trigger.data.requested_nudger, reward_amount: trigger.output[[asset!=base]].amount otherwise trigger.output[[asset=base]].amount-2000, reward_asset: trigger.output[[asset!=base]].asset != "none"? trigger.output[[asset!=base]].asset: "base", }; $request_tag = trigger.data.requested_tag otherwise sha256($request.address||$request.time); if (!!var[$request_tag]) bounce ("this tag already exist!"); var[$request_tag] = json_stringify($request); response['message'] = "Trigger-Request "||$request_tag||" created"; }" } ] } ] } } ]
Technical information
Fees:
3,622 bytes
(452 headers, 3170 payload)
Level:1591382
Witnessed level:1591374
Main chain index:1584141
Latest included mc index:1584140
Status:stable/confirmed/final