Unit ID
wifC8fIOJPrUoSaS7lvjJd7mXF5U1WSuDKdQg6SsOEY=
Received
05.10.2019 11:14:17
Confirmation delay (full node)
5 minutes 28 seconds
Confirmation delay (light node)
6 minutes 42 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ // // ========================================== // OBYTE STACK GAME from Whistling Frogs // ========================================== // Written by Crypto Girl on 21 September 2019 // ========================================== // Version: 0.5 - 4 October 2019 // ========================================== // Can be used with OBYTE STACK GAME BOT v0.5, Pairing code: // A/R1S1zX9R9KzN34IA5PCUbYbRB5WEDLEdVaNo/0s/[email protected]/bb-test#StackGame // =========================================== // The object of the game is to win the Stack. // Users make bids. Min bid is 100,000 bytes. // 1st bid initiates the Stack. // Each subsequent bid starts the 50 sec timer. // If more than 5 min has passed since the previous // bid, the (stack - commission) is shared equally // between the last bidder and the 1st bidder. // The new stack is initiated with the current bid. // A commission of 10,000 bytes is charged on each bid. // =========================================== // // setting game parameters $bot_address = '4H2FOFBP7ST6BLYWHZ3GUV5PHY626AM4'; $commission_payout_threshold = 50000; $fee = 10000; $seed_amnt = 10000; $min_bid_amnt = 100000; // setting game variables $bid_amnt = trigger.output[[asset=base]]; $bid_status = ($bid_amnt >= $min_bid_amnt) otherwise false; $game_finished = (trigger.initial_address == $bot_address) otherwise false; if ($bid_status == false AND $game_finished == false) bounce('Your bid is too small.'); $game_status = var['game_status'] otherwise 'not started'; $commission = var['commisson'] otherwise 0; $pay_commission = ($commission >= $commission_payout_threshold) otherwise false; }", "messages": [ { "if": "{$game_finished OR $pay_commission}", "app": "payment", "payload": { "cases": [ { "if": "{$game_finished AND (var['author'] == var['leader']) AND $pay_commission}", "payload": { "asset": "base", "outputs": [ { "address": "{ var['leader'] }", "amount": "{ var['stack_amnt'] }" }, { "address": "{ $bot_address }", "amount": "{ var['commission'] }" } ] } }, { "if": "{$game_finished AND (var['author'] == var['leader']) AND ($pay_commission == false)}", "payload": { "asset": "base", "outputs": [ { "address": "{ var['leader'] }", "amount": "{ var['stack_amnt'] }" } ] } }, { "if": "{$game_finished AND (var['author'] != var['leader']) AND $pay_commission}", "payload": { "asset": "base", "outputs": [ { "address": "{ var['author'] }", "amount": "{ var['stack_amnt'] / 2 }" }, { "address": "{ var['leader'] }", "amount": "{ var['stack_amnt'] / 2 }" }, { "address": "{ $bot_address }", "amount": "{ var['commission'] }" } ] } }, { "if": "{$game_finished AND (var['author'] != var['leader']) AND ($pay_commission == false)}", "payload": { "asset": "base", "outputs": [ { "address": "{ var['author'] }", "amount": "{ var['stack_amnt'] / 2 }" }, { "address": "{ var['leader'] }", "amount": "{ var['stack_amnt'] / 2 }" } ] } }, { "if": "{$pay_commission}", "payload": { "asset": "base", "outputs": [ { "address": "{ $bot_address }", "amount": "{ var['commission'] }" } ] } } ] } }, { "app": "state", "state": "{ // game not started if ($bid_status AND ($game_status == 'not started')) { var['stack_amnt'] = $bid_amnt - $fee; var['author'] = trigger.initial_address; var['leader'] = trigger.initial_address; var['game_status'] = 'running'; response['message'] = 'Thank you for playing'; } // game is running if ($bid_status AND ($game_status == 'running')) { var['stack_amnt'] += ($bid_amnt - $fee); var['leader'] = trigger.initial_address; response['message'] = 'Thank you for playing'; } // game is finished if ($game_finished) { var['commission'] = balance[base] - var['stack_amnt'] - $seed_amnt; var['game_status'] = 'not started'; var['stack_amnt'] = 0; var['author'] = ''; var['leader'] = ''; response['message'] = 'Game finished.'; } }" } ] } ]
Technical information
Fees:
4,060 bytes
(353 headers, 3707 payload)
Level:1092628
Witnessed level:1092620
Main chain index:1091389
Latest included mc index:1091388
Status:stable/confirmed/final