Unit ID
GKEn4OWsEdGewGQLonx3rXm0MH3/Qpjgxfkrp1RURbM=
Received
31.08.2024 23:44:38
Confirmation delay (full node)
14 minutes 22 seconds
Confirmation delay (light node)
23 minutes 49 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $asset = var['asset']; $destination_aa = 'WF3ZRL72GCTRSDU64GP42S3FB7GBT7XJ'; $team = 'U+EP3OCBJuPdRBVMGM0gBsMAPce+e9LNEvD4iOaLlUM='; }", "messages": { "cases": [ { "if": "{trigger.data.start AND !$asset}", "messages": [ { "app": "asset", "payload": { "is_private": false, "is_transferrable": true, "auto_destroy": false, "fixed_denominations": false, "issued_by_definer_only": false, "cosigned_by_definer": false, "spender_attested": false } }, { "app": "state", "state": "{ var[response_unit || '_status'] = 'open'; var['asset'] = response_unit; response['asset'] = response_unit; }" } ] }, { "if": "{trigger.output[[asset=base]] >= 1e100 AND $asset}", "init": "{ if (var[$destination_aa]['finished']) bounce('game over'); $amount = trigger.output[[asset=base]] - 1000; // to account for fees we need to respond now and to refund bytes or pay shares later $total_raised = var['total_raised'] + $amount; $missing_amount = ceil((balance[$destination_aa][base] + $total_raised)*0.51) - var[$destination_aa]['team_' || $team || '_amount']; $bDone = ($total_raised > $missing_amount); }", "messages": [ { "app": "payment", "payload": { "asset": "{$asset}", "outputs": [ { "address": "{trigger.address}", "amount": "{$amount}" } ] } }, { "if": "{$bDone}", "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{$destination_aa}", "amount": "{$total_raised}" } ] } }, { "if": "{$bDone}", "app": "data", "payload": { "team": "{$team}" } }, { "app": "state", "state": "{ if ($bDone) var[$asset || '_status'] = 'raised'; else var['total_raised'] = $total_raised; }" } ] }, { "if": "{trigger.output[[asset=var[$destination_aa]['team_' || $team || '_asset']]] AND $asset}", "messages": [ { "app": "state", "state": "{ var[$asset || '_status'] = 'done'; var['asset'] = false; var['total_raised'] = false; }" } ] }, { "if": "{$asset AND trigger.output[[asset=$asset]] > 0}", "init": "{ $amount = trigger.output[[asset=$asset]]; }", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}", "amount": "{$amount}" } ] } }, { "app": "state", "state": "{ var['total_raised'] -= $amount; }" } ] }, { "if": "{ $in_asset = trigger.output[[asset!=base]].asset; var[$in_asset || '_status'] == 'done' }", "messages": [ { "app": "payment", "payload": { "asset": "{var[$destination_aa]['team_' || $team || '_asset']}", "outputs": [ { "address": "{trigger.address}", "amount": "{trigger.output[[asset=$in_asset]]}" } ] } } ] } ] } } ]
Technical information
Fees:
2,954 bytes
(451 headers, 2503 payload)
Level:11219052
Witnessed level:11219035
Main chain index:10831909
Latest included mc index:10831908
Status:stable/confirmed/final