Unit ID
v2RHEc9KP8YPdGsVYbv9sldhh7LncRnLY/Hu8hiDxks=
Received
04.08.2019 01:57:30
Confirmation delay (full node)
4 minutes 57 seconds
Confirmation delay (light node)
6 minutes 14 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $owner = 'JBGMJI7XSKLKNHZF26BUBWHVUZSDV3P5'; $fee = 1500; $addr = trigger.address; $base_inp = trigger.output[[asset=base]]; if(trigger.output[[asset!=base]].asset != 'none') $asset = trigger.output[[asset!=base]].asset; if($asset){ if($asset == 'ambiguous'){ bounce("only 1 asset per tx"); } if(trigger.output[[asset!=base]] ==0) bounce("zero asset tx"); $asset_inp = trigger.output[[asset!=base]]; } if(var['asset']){ if($asset and var['asset'] != $asset) bounce("not a previously defined asset"); } else{ if(!trigger.data.define) bounce("a asset must be defined first time"); } $ratio = round(10000000/data_feed[[oracles='F4KHJUCLJKY4JV7M5F754LAJX4EB7M4N', feed_name='GBYTE_USD']]); //bytes per 1 asset-centUSD- }", "messages": { "cases": [ { "if": "{trigger.data.define and $addr == $owner}", "messages": [ { "app": "asset", "payload": { "is_private": false, "is_transferrable": true, "auto_destroy": true, "fixed_denominations": false, "issued_by_definer_only": false, "cosigned_by_definer": false, "spender_attested": false } }, { "app": "state", "state": "{ var['asset'] = response_unit; }" } ] }, { "if": "{ $asset }", "messages": [ { "init": "{ $byte_amount = round($asset_inp*(0.97*$ratio)); }", "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}", "amount": "{$byte_amount}" } ] } }, { "app": "state", "state": "{ response['message'] = 'redeemed '||$asset_inp||' centUSD'; }" } ] }, { "if": "{ !$asset }", "messages": [ { "init": "{ $issue_amount = round($base_inp/$ratio); }", "app": "payment", "payload": { "asset": "{var['asset']}", "outputs": [ { "address": "{$addr}", "amount": "{$issue_amount}" } ] } }, { "app": "state", "state": "{ response['message'] = 'issued '||$issue_amount||' centUSD'; }" } ] } ] } } ]
Technical information
Fees:
1,913 bytes
(353 headers, 1560 payload)
Level:984717
Witnessed level:984706
Main chain index:983538
Latest included mc index:983536
Status:stable/confirmed/final