Unit ID
D10PPDp6do01MkCiGzBeQOA215lLXxudB2U1tb83aI8=
Received
24.05.2024 17:24:55
Confirmation delay (full node)
24 minutes 34 seconds
Confirmation delay (light node)
34 minutes 23 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $control_address = 'JPQKPRI5FMTQRJF4ZZMYZYDQVRD55OTC'; // controled by the fundraiser, used to finish the ICO $fundraiser_address = 'SPYPQV5VD5W5NTHBBQ7CGQ4BGTNL6YDB'; // this address receives the milestone payments $auditor_address = 'FOPUBEUPBC6YLIQDLKL6EW775BMV7YOH'; $price = 10.24; // gbytes per @ $target = 100e18; // if raised less, will refund $expiry_ts = 2905203300; // $milestone1 = 12.50; // in % $milestone2 = 12.25; $milestone3 = 12.25; $milestone4 = 12.25; $milestone5 = 12.25; $milestone6 = 12.25; $milestone7 = 12.25; $milestone8 = 12.25; $asset = var['asset']; $finished = var['finished']; $is_active = ($asset AND $price AND !$finished); }", "messages": { "cases": [ { "if": "{trigger.data.define AND !$asset}", "messages": [ { "app": "asset", "payload": { "is_private": false, "is_transferrable": true, "auto_destroy": false, "fixed_denominations": false, "issued_by_definer_only": true, "cosigned_by_definer": false, "spender_attested": false } }, { "app": "state", "state": "{ var['asset'] = response_unit; response['asset'] = response_unit; }" } ] }, { "if": "{ trigger.output[[asset=base]] >= 1e18 AND $is_active }", "init": "{ $amount = round(trigger.output[[asset=base]] / $price); }", "messages": [ { "app": "payment", "payload": { "asset": "{$asset}", "outputs": [ { "address": "{trigger.address}", "amount": "{$amount}" } ] } } ] }, { "if": "{ trigger.data.finish AND (trigger.address == $control_address OR timestamp > $expiry_ts) }", "messages": [ { "app": "state", "state": "{ var['finished'] = 1; var['total'] = balance[base]; response['total'] = balance[base]; }" } ] }, { "if": "{trigger.data.milestone AND trigger.address == $auditor_address AND $finished AND var['total'] >= $target}", "init": "{ $share = ${'milestone' || trigger.data.milestone} / 1000; if (!$share) bounce('no such milestone'); if (var['milestone' || trigger.data.milestone || '_released']) bounce('milestone ' || trigger.data.milestone || ' already released'); }", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{$fundraiser_address}", "amount": "{round(var['total'] * $share)}" } ] } }, { "app": "state", "state": "{ var['milestone' || trigger.data.milestone || 'released'] = 1; response['released'] = 1; }" } ] }, { "if": "{$asset AND trigger.output[[asset=$asset]] > 0 AND $finished AND var['total'] < $target}", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}", "amount": "{ round(trigger.output[[asset=$asset]] * $price) }" } ] } } ] } ] } } ]
Technical information
Fees:
3,222 bytes
(544 headers, 2678 payload)
Level:11003898
Witnessed level:11003888
Main chain index:10623734
Latest included mc index:10623732
Status:stable/confirmed/final