Unit ID
rAa9f/+8fd9HDlVpScZ/xn7bZiWe3OGScKeusf1htHc=
Received
14.03.2021 12:12:36
Confirmation delay (full node)
13 minutes 11 seconds
Confirmation delay (light node)
16 minutes 0 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $OSTABLE_DEP_ADDR = 'IPZULHNHOIZHTQYGUPXBJLLRAOCH5BBL'; $STABLE_ASSET = var[$OSTABLE_DEP_ADDR]['asset']; $OWNER_ADDR = 'QF3NOVWHY2ZBVZZ2QHCUW7IPYXKLGIGG'; $OSWAP_POOL = 'WGXHCMIBZRYHDHQPR253UTRPMEGDQDDY'; if(!$OWNER_ADDR) bounce('no owner'); $addDeposit = $id =>{ $deposits = var['deposits'] otherwise []; $deposits[] = $id; var['deposits'] = $deposits; }; $removeDeposit = $ind =>{ $deposits = var['deposits'] otherwise []; delete($deposits, $ind); var['deposits'] = $deposits; }; }", "messages": { "cases": [ { "if": "{(!trigger.data.action AND trigger.address == $OWNER_ADDR) OR var['index']}", "init": "{ $ind = var['index'] otherwise 0; $deposits = var['deposits']; $id = $deposits[$ind]; }", "messages": [ { "if": "{$id}", "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{$OSTABLE_DEP_ADDR}", "amount": 113 } ] } }, { "if": "{$id}", "app": "data", "payload": { "id": "{$id}" } }, { "if": "{!$id}", "app": "data", "payload": { "mint": 1 } }, { "if": "{!$id}", "app": "payment", "payload": { "asset": "{$STABLE_ASSET}", "outputs": [ { "address": "{$OSWAP_POOL}" } ] } }, { "app": "state", "state": "{ if($id) var['index'] = $ind + 1; else var['index'] = false; }" } ] }, { "if": "{trigger.address != $OWNER_ADDR}", "messages": [ { "app": "state", "state": "{ response['message'] = 'received'; }" } ] }, { "if": "{trigger.data.action == 'transfer' AND trigger.data.asset AND trigger.data.amount}", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "GV5YXIIRH3DH5FTEECW7IS2EQTAYJJ6S", "amount": 1 } ] } }, { "app": "data", "payload": { "transfer": 1, "to": "{$OWNER_ADDR}", "asset": "{trigger.data.asset}", "amount": "{trigger.data.amount}" } } ] }, { "if": "{trigger.data.action == 'add' and trigger.data.id}", "messages": [ { "app": "state", "state": "{ $addDeposit(trigger.data.id); }" } ] }, { "if": "{trigger.data.action == 'rm' and exists(trigger.data.index)}", "messages": [ { "app": "state", "state": "{ $removeDeposit(trigger.data.index); }" } ] }, { "if": "{trigger.data.action == 'withdraw'}", "messages": [ { "app": "payment", "payload": { "asset": "{trigger.data.asset otherwise 'base'}", "outputs": [ { "address": "{trigger.address}" } ] } } ] } ] } } ]
Technical information
Fees:
3,107 bytes
(451 headers, 2656 payload)
Level:7476716
Witnessed level:7476695
Main chain index:7163174
Latest included mc index:7163173
Status:stable/confirmed/final