Transfers view
UTXO view
Obyte.org
Unit Legend
- not on main chain, not stable
- main chain, not stable
- bad unit
- not on main chain, stable/confirmed/final
- main chain, stable/confirmed/final
- not on main chain, selected
- main chain, selected
Close
Close
Unit ID
M+56VrPij4Bm7n9MYEL2JKNRflvTFMcPaXZFJUUqVB0=
Received
24.05.2024 17:27:41
Confirmation delay (full node)
23 minutes 54 seconds
Confirmation delay (light node)
33 minutes 32 seconds
Authors
265APJC3CKSPD5PB7YTCQYXE6JDODTK2
Children
fBVsTB7lRFK0f6KsGpvKS6idZcVJquNvjtVwXmc5Rwg=
Parents
5bBWCFwSwj+6IcMRO4U293sjUeSXN7+YIR2p/itMcOQ=
qe8X6y/4iSWsIgJ4+WpXOSEZrIZo+H0270mjSDxgcJ4=
Messages
Definition
Address:
WRZENMHDRKX4ROJI2QPG7PIL6VMDMVO7
Definition:
[ "autonomous agent", { "messages": { "cases": [ { "if": "{ $key = 'balance_'||trigger.address||'_'||trigger.data.asset; trigger.data.withdraw AND trigger.data.asset AND trigger.data.amount OR trigger.data.amount <= var[$key] }", "messages": [ { "app": "payment", "payload": { "asset": "{trigger.data.asset}", "outputs": [ { "address": "{trigger.address}", "amount": "{trigger.data.amount}" } ] } }, { "app": "state", "state": "{ var[$key] = var[$key] - trigger.data.amount; }" } ] }, { "if": "{ $order1 = trigger.data.order1.signed_message; $order2 = trigger.data.order2.signed_message; if (!$order1.sell_asset OR !$order2.sell_asset) return false; if ($order1.sell_asset != $order2.buy_asset OR $order1.buy_asset != $order2.sell_asset) return false; // to do check expiry $sell_key1 = 'balance_' || $order1.address || '_' || $order1.sell_asset; $sell_key2 = 'balance_' || $order2.address || '_' || $order2.sell_asset; $id1 = sha256($order1.address || $order1.sell_asset || $order1.buy_asset || $order1.sell_amount || $order1.price || trigger.data.order1.last_ball_unit); $id2 = sha256($order2.address || $order2.sell_asset || $order2.buy_asset || $order2.sell_amount || $order2.price || trigger.data.order2.last_ball_unit); if (var['executed_' || $id1] OR var['executed_' || $id2]) return false; if (!is_valid_signed_package(trigger.data.order1, $order1.address) OR !is_valid_signed_package(trigger.data.order2, $order2.address)) return false; $amount_left1 = var['amount_left_' || $id1] otherwise $order1.sell_amount; $amount_left2 = var['amount_left_' || $id2] otherwise $order2.sell_amount; if ($amount_left1 > var[$sell_key1] OR $amount_left2 > var[$sell_key2]) return false; $buy_amount1 = round($amount_left1 * $order1.price); if ($buy_amount1 > $amount_left2) // order1 is not the smaller one return false; $expected_buy_amount2 = round($buy_amount1 * $order2.price); if ($expected_buy_amount2 > $amount_left1) // user2 doesn't like the price, he gets less than expects return false; true }", "messages": [ { "app": "state", "state": "{ $buy_key1 = 'balance_' || $order1.address || '_' || $order1.buy_asset; $buy_key2 = 'balance_' || $order2.address || '_' || $order2.buy_asset; $base_key1 = 'balance_' || $order1.address || '_base'; $base_key2 = 'balance_' || $order2.address || '_base'; var[$sell_key1] = var[$sell_key1] - $amount_left1; var[$sell_key2] = var[$sell_key2] - $buy_amount1; var[$buy_key1] = var[$buy_key1] + $buy_amount1; var[$buy_key2] = var[$buy_key2] + $amount_left1; $fee = 1000; var[$base_key1] = var[$base_key1] - $fee; var[$base_key2] = var[$base_key2] - $fee; if (var[$base_key1] < 0 OR var[$base_key2] < 0) bounce('not enough balance for fees'); var['executed_' || $id1] = 1; $new_amount_left2 = $amount_left2 - $buy_amount1; if ($new_amount_left2) var['amount_left_' || $id2] = $new_amount_left2; else var['executed_' || $id2] = 1; // parsable response for transaction log response[$order1.address || '_' || $order1.sell_asset] = -$amount_left1; response[$order2.address || '_' || $order2.buy_asset] = $amount_left1; response[$order1.address || '_' || $order1.buy_asset] = $buy_amount1; response[$order2.address || '_' || $order2.sell_asset] = -$buy_amount1; }" } ] }, { "if": "{!trigger.data}", "messages": [ { "app": "state", "state": "{ $asset = trigger.output[[asset!=base]].asset; if ($asset == 'ambiguous') bounce('ambiguous asset'); if (trigger.output[[asset=base]] > 10000){ $base_key = 'balance_'||trigger.address||'_'||'base'; var[$base_key] = var[$base_key] + trigger.output[[asset=base]]; $response_base = trigger.output[[asset=base]] || ' bytes\ '; } if ($asset != 'none'){ $asset_key = 'balance_'||trigger.address||'_'||$asset; var[$asset_key] = var[$asset_key] + trigger.output[[asset=$asset]]; $response_asset = trigger.output[[asset=$asset]] || ' of ' || $asset || '\ '; } response['message'] = 'accepted coins:\ ' || ($response_base otherwise '') || ($response_asset otherwise ''); }" } ] } ] } } ]
Witnesses
2TO6NYBGX3NF5QS24MQLFR7KXYAMCIE5
4GDZSXHEFVFMHCUCSHZVXBVF5T2LJHMU
APABTE2IBKOIHLS2UNK6SAR4T5WRGH2J
DXYWHSZ72ZDNDZ7WYZXKWBBH425C6WZN
FAB6TH7IRAVHDLK2AAWY5YBE6CEBUACF
FOPUBEUPBC6YLIQDLKL6EW775BMV7YOH
GFK3RDAPQLLNCMQEVGGD2KCPZTLSG3HN
I2ADHGP4HL6J37NQAD73J7E5SKFIXJOT
JMFXY26FN76GWJJG7N36UI2LNONOGZJV
JPQKPRI5FMTQRJF4ZZMYZYDQVRD55OTC
TKT4UESIKTTRALRRLWS4SENSTJX6ODCW
UE25S4GRWZOLNXZKY4VWFHNJZWUSYCQC
Technical information
Fees:
5,133
bytes
(544 headers, 4589 payload)
Level:
11003902
Witnessed level:
11003892
Last ball unit:
ZKmI4iCInMj6q4/xLJ6bSpSefY+Pei1fVu5otNQ+1EI=
Main chain index:
10623735
Latest included mc index:
10623734
Status:
stable/confirmed/final