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
zGy23VxTCSfoc9HAG3uBK2mnfc58S3W1HpH3nCDjtv8=
Received
22.12.2020 19:10:44
Confirmation delay (full node)
5 minutes 34 seconds
Confirmation delay (light node)
7 minutes 36 seconds
Authors
DPYEPM34AUBLZFLCJKKGSJ3R34373IUA
Children
xo8s/LGAphp4oXWssmuRlZmufn67kgBArIKuxNKFUXU=
Parents
gUiQqkOiF0Sx/LUep1rKlTJ76BYM9X2at0WzOY3frNQ=
Messages
Definition
Address:
AIJNV5CNGKG4SRXKAL2TJKAOUFF34A4A
Definition:
[ "autonomous agent", { "bounce_fees": { "base": 10000 }, "init": "{ $type = trigger.data.type; if(!exists($type)){ bounce("'type' required"); } $owner = params.owner; $asset = params.asset; $goal = params.goal; $days = params.days; $unit = params.unit; $start_timestamp = params.timestamp; $balance = var['balance'] OTHERWISE 0; }", "messages": { "cases": [ { "if": "{$type == 'addReward'}", "init": "{ if($owner != trigger.address){ bounce("you are not admin"); } $unit_data = unit[$unit].messages[[.app='data']].payload; $amount = trigger.data.amount; if(exists($unit_data['reward_' || $amount]) OR exists(var['reward_' || $amount])){ bounce('reward already exists'); } }", "messages": [ { "app": "state", "state": "{ var['reward_' || $amount] = 1; response['result'] = 'new_reward:' || $amount; }" } ] }, { "if": "{$type == 'buy'}", "init": "{ $amount = trigger.output[[asset=$asset]]; if(!exists($amount)){ if(exists(var['O6H6ZIFI57X3PLTYHOCVYPP5A553CYFQ']['a2s_' || $asset])) { $name = var['O6H6ZIFI57X3PLTYHOCVYPP5A553CYFQ']['a2s_' || $asset]; } else { $name = $asset; } bounce("Donations can only occur in " || $name); } $unit_data = unit[$unit].messages[[.app='data']].payload; $unit_reward = $unit_data['reward_' || $amount]; $local_reward = var['reward_' || $amount]; $finish_timestamp = (86400 * $days) + $start_timestamp; if(timestamp > $finish_timestamp){ bounce("project finished"); } }", "messages": [ { "app": "state", "state": "{ if(!exists($unit_reward) AND !exists($local_reward)){ response['result'] = 'gratuitous donation'; } else { response['result'] = 'reward_amount'; } var['balance'] += $amount; var['amount_' || trigger.address] += $amount; response['amount'] = $amount; }" } ] }, { "if": "{$type == 'withdraw'}", "init": "{ if($owner != trigger.address){ bounce("you are not admin"); } if($balance < $goal){ bounce("goal not reached"); } $withdrawn = var['withdrawn'] OTHERWISE 0; if($balance - $withdrawn <= 0){ bounce('not enough money'); } }", "messages": [ { "app": "payment", "payload": { "asset": "{$asset}", "outputs": [ { "address": "{trigger.address}", "amount": "{$balance - $withdrawn}" } ] } }, { "app": "state", "state": "{ var['withdrawn'] += $balance - $withdrawn; }" } ] }, { "if": "{$type == 'refund'}", "init": "{ $finish_timestamp = (86400 * $days) + $start_timestamp; if(timestamp < $finish_timestamp){ bounce("project didn't finish"); } if($balance >= $goal){ bounce("goal achieved"); } $peer_amount = var['amount_' || trigger.address] OTHERWISE 0; if($peer_amount <= 0){ bounce("I do not have your money"); } }", "messages": [ { "app": "payment", "payload": { "asset": "{$asset}", "outputs": [ { "address": "{trigger.address}", "amount": "{$peer_amount}" } ] } }, { "app": "state", "state": "{ var['amount_' || trigger.address] = false; response['result'] = 'done'; }" } ] } ] } } ]
Witnesses
2FF7PSL7FYXVU5UIQHCVDTTPUOOG75GX
2GPBEZTAXKWEXMWCTGZALIZDNWS5B3V7
4H2AMKF6YO2IWJ5MYWJS3N7Y2YU2T4Z5
DFVODTYGTS3ILVOQ5MFKJIERH6LGKELP
ERMF7V2RLCPABMX5AMNGUQBAH4CD5TK4
F4KHJUCLJKY4JV7M5F754LAJX4EB7M4N
IOF6PTBDTLSTBS5NWHUSD7I2NHK3BQ2T
O4K4QILG6VPGTYLRAI2RGYRFJZ7N2Q2O
OPNUXBRSSQQGHKQNEPD2GLWQYEUY5XLD
PA4QK46276MJJD5DBOLIBMYKNNXMUVDP
RJDYXC4YQ4AZKFYTJVCR5GQJF5J6KPRI
WELOXP3EOA75JWNO6S5ZJHOO3EYFKPIR
Technical information
Fees:
5,238
bytes
(452 headers, 4786 payload)
Level:
1810409
Witnessed level:
1810402
Last ball unit:
M1fr4emL792TZ0YGgTiSNwTrkL4GJ2vbPp+sO9DY+PE=
Main chain index:
1802542
Latest included mc index:
1802541
Status:
stable/confirmed/final