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
rfJNgb8VSkGfNsziLlvSzoZFWwcYKyt8KD5kr0jZie4=
Received
21.09.2021 19:27:06
Confirmation delay (full node)
2 minutes 32 seconds
Confirmation delay (light node)
4 minutes 56 seconds
Authors
T2I6RLGGJ25KSJZKRNZZH52VMEAQ3722
Children
7TDWmVgIfWbzORkLCo+eQMIhqAQXLEbicYA53CZPtQs=
ZmZxR+dVp5Xyxn8CYNJaL/cD7Nv2d4V60H4AEvV1CPM=
Parents
ITbx5iF8Pb5diAnkeTh94BcRugOqwnkY4SfPSIRsiF0=
Messages
Definition
Address:
VYZIVDL7RCM4ET6S3X3KKWZTMHWXLC56
Definition:
[ "autonomous agent", { "bounce_fees": { "base": 10000 }, "init": "{ $POOL_BASE_AA = "5DNICJLNOBPANH536Y7YVBN5ZDBLQ4LE"; $asset = trigger.output[[asset!="base"]].asset == "none" ? "base" : trigger.output[[asset!="base"]].asset; if (NOT trigger.data["_fwto"]) bounce("_fwto field is mandatory"); if (NOT is_valid_address(trigger.data["_fwto"])) bounce("_fwto field is not a valid address"); if (trigger.output[[asset!="base"]].asset == "ambiguous") bounce("AAs cannot handle payments with multiple assets"); if (NOT trigger.data["_opr"]) bounce("_opr field is mandatory"); if (NOT is_valid_amount(trigger.data["_opr"])) bounce("_opr must be a positive amount"); if (NOT trigger.data["_pl"]) bounce("_pl field is mandatory"); if (NOT is_aa(trigger.data["_pl"])) bounce("_pl is not a valid oswap pool"); $definition = definition[trigger.data["_pl"]][1]; if ($definition["base_aa"] != $POOL_BASE_AA) bounce("That pool version is unsupported"); $getAmount = ($outputAmount, $outputReserve, $inputReserve, $fee)=>{ $swapNoFee = 1e11 - $fee; $numerator = $outputAmount * $inputReserve * 1e11; $denominator = ($outputReserve - $outputAmount) * $swapNoFee; return ceil($numerator / $denominator, 0); }; $calculateNeededAmount = ()=>{ $asset0 = $definition["params"]["asset0"]; $asset1 = $definition["params"]["asset1"]; $fee = $definition["params"]["swap_fee"]; $reserve0 = balance[trigger.data["_pl"]][$asset0]; $reserve1 = balance[trigger.data["_pl"]][$asset1]; if ($asset == $asset0) return $getAmount(trigger.data["_opr"], $reserve1, $reserve0, $fee); return $getAmount(trigger.data["_opr"], $reserve0, $reserve1, $fee); }; $price = $calculateNeededAmount(); bounce($price); if ($price > trigger.output[[asset=$asset]].amount) bounce("Not enough amount"); $remaining = $asset=="base" ? trigger.output[[asset="base"]].amount - 5000 : trigger.output[[asset=$asset]].amount - $price; }", "messages": [ { "app": "payment", "payload": { "asset": "{$asset}", "outputs": [ { "address": "{trigger.initial_address}", "amount": "{$remaining}" }, { "address": "{trigger.data["_fwto"]}", "amount": "{$price}" } ] } }, { "app": "data", "payload": { "to": "{trigger.initial_address}" } } ] } ]
Witnesses
2FF7PSL7FYXVU5UIQHCVDTTPUOOG75GX
2GPBEZTAXKWEXMWCTGZALIZDNWS5B3V7
4H2AMKF6YO2IWJ5MYWJS3N7Y2YU2T4Z5
DFVODTYGTS3ILVOQ5MFKJIERH6LGKELP
ERMF7V2RLCPABMX5AMNGUQBAH4CD5TK4
F4KHJUCLJKY4JV7M5F754LAJX4EB7M4N
IOF6PTBDTLSTBS5NWHUSD7I2NHK3BQ2T
O4K4QILG6VPGTYLRAI2RGYRFJZ7N2Q2O
OPNUXBRSSQQGHKQNEPD2GLWQYEUY5XLD
PA4QK46276MJJD5DBOLIBMYKNNXMUVDP
RJDYXC4YQ4AZKFYTJVCR5GQJF5J6KPRI
WELOXP3EOA75JWNO6S5ZJHOO3EYFKPIR
Technical information
Fees:
3,307
bytes
(452 headers, 2855 payload)
Level:
2335521
Witnessed level:
2335512
Last ball unit:
E+RiiXRce3HXwGfuM4pmngl5SEZJLX8q7q+lH+RXuyQ=
Main chain index:
2323235
Latest included mc index:
2323234
Status:
stable/confirmed/final