Transaction #1221437

Hash a6d6907f211de734f8aa805019425f95923589ab74fda8f99523c7eab9fc3774
Status Success
Timestamp 515 days ago - 12/20/2022, 2:05:50 AM UTC+0
Block 1172180
Stamps Used 254
Burned Fee 0.01502959 TAU
From 19040eef9ad7e23c84f31cab6930d192bcc7029618d36edc62029c5136af633e 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 381
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature 4bca956e6cdc7219b0d8042140469bb603567fc19095af446baea799ce2c50b26b720b1687ee691362494d81118814e15a3de73b467f20e90a889fa117d7030a
Stamps Supplied 845
Stamps per TAU 169

Kwargs

code random.seed() I = importlib metadata = Hash() varStack = Variable() maxStack = Variable() gameStack = Variable() @construct def seed(): metadata['owner'] = ctx.caller metadata['operator'] = ctx.caller varStack.set(0.1) maxStack.set(0.0) gameStack.set(0.0) @export def rpsPlay(throw: str, stack: float): gameStack = ForeignHash(foreign_contract='con_spange', foreign_name='balances') maxStack = gameStack[ctx.this] * varStack.get() assert not ctx.caller.startswith('con_'), 'bad robot' assert throw == "r" or throw == "p" or throw == "s", 'r, p or s; to represent rock, paper or scissors.' assert stack > 0.0, 'stack must be some spange.' assert stack < maxStack, 'whoa big spender! less than ' + str(maxStack) I.import_module('con_spange').transfer_from( amount=stack, to=ctx.this, main_account=ctx.caller) play = rpsRound(throw, stack) return play def rpsRound(p1: str, stack: float): b1 = botThrow() if p1 == b1: I.import_module('con_spange').transfer( amount=stack*0.99, to=ctx.caller) result = 'Tie. bot = ' + b1 return result elif (b1 == 'r' and p1 == 's') or (b1 == 's' and p1 == 'p') or (b1 == 'p' and p1 == 'r'): result = 'Bot wins! bot = ' + b1 return result else: I.import_module('con_spange').transfer( amount=stack*2, to=ctx.caller) result = 'Human wins! bot = ' + b1 return result def botThrow(): x = random.randint(0, 2) if x == 0: b1 = 'r' elif x == 1: b1 = 'p' else: b1 = 's' return b1 @export def change_metadata(key: str, value: Any): assert ctx.caller == metadata['operator'], 'No' metadata[key] = value @export def top_up(amount: float): assert ctx.caller == metadata['operator'], 'No' assert amount > 0, 'No Zero' I.import_module('con_spange').transfer_from( amount=amount, to=ctx.this, main_account=ctx.caller) @export def tap_out(amount: float): assert ctx.caller == metadata['operator'], 'No' assert amount > 0, 'No Zero' I.import_module('con_spange').transfer( amount=amount, to=ctx.caller) @export def set_var(amount: float): assert ctx.caller == metadata['operator'], 'No' assert amount < 1.0, 'Less Than 1' varStack.set(amount)
name con_spange_game_tv2_7

State Changes

Contract con_spange_game_tv2_7
Variable metadata
Key owner
New Value 19040eef9ad7e23c84f31cab6930d192bcc7029618d36edc62029c5136af633e
 
Contract con_spange_game_tv2_7
Variable metadata
Key operator
New Value 19040eef9ad7e23c84f31cab6930d192bcc7029618d36edc62029c5136af633e
 
Contract con_spange_game_tv2_7
Variable varStack
New Value 0.1
 
Contract con_spange_game_tv2_7
Variable maxStack
New Value 0.0
 
Contract con_spange_game_tv2_7
Variable gameStack
New Value 0.0
 
Contract con_spange_game_tv2_7
Variable __code__
New Value random.seed() I = importlib __metadata = Hash(contract='con_spange_game_tv2_7', name='metadata') __varStack = Variable(contract='con_spange_game_tv2_7', name='varStack') __maxStack = Variable(contract='con_spange_game_tv2_7', name='maxStack') __gameStack = Variable(contract='con_spange_game_tv2_7', name='gameStack') def ____(): __metadata['owner'] = ctx.caller __metadata['operator'] = ctx.caller __varStack.set(decimal('0.1')) __maxStack.set(decimal('0.0')) __gameStack.set(decimal('0.0')) @__export('con_spange_game_tv2_7') def rpsPlay(throw: str, stack: float): __gameStack = ForeignHash(foreign_contract='con_spange', foreign_name= 'balances', contract='con_spange_game_tv2_7', name='gameStack') __maxStack = __gameStack[ctx.this] * __varStack.get() assert not ctx.caller.startswith('con_'), 'bad robot' assert throw == 'r' or throw == 'p' or throw == 's', 'r, p or s; to represent rock, paper or scissors.' assert stack > decimal('0.0'), 'stack must be some spange.' assert stack < __maxStack, 'whoa big spender! less than ' + str(__maxStack) I.import_module('con_spange').transfer_from(amount=stack, to=ctx.this, main_account=ctx.caller) play = __rpsRound(throw, stack) return play def __rpsRound(p1: str, stack: float): b1 = __botThrow() if p1 == b1: I.import_module('con_spange').transfer(amount=stack * decimal( '0.99'), to=ctx.caller) result = 'Tie. bot = ' + b1 return result elif b1 == 'r' and p1 == 's' or b1 == 's' and p1 == 'p' or b1 == 'p' and p1 == 'r': result = 'Bot wins! bot = ' + b1 return result else: I.import_module('con_spange').transfer(amount=stack * 2, to=ctx.caller) result = 'Human wins! bot = ' + b1 return result def __botThrow(): x = random.randint(0, 2) if x == 0: b1 = 'r' elif x == 1: b1 = 'p' else: b1 = 's' return b1 @__export('con_spange_game_tv2_7') def change_metadata(key: str, value: Any): assert ctx.caller == __metadata['operator'], 'No' __metadata[key] = value @__export('con_spange_game_tv2_7') def top_up(amount: float): assert ctx.caller == __metadata['operator'], 'No' assert amount > 0, 'No Zero' I.import_module('con_spange').transfer_from(amount=amount, to=ctx.this, main_account=ctx.caller) @__export('con_spange_game_tv2_7') def tap_out(amount: float): assert ctx.caller == __metadata['operator'], 'No' assert amount > 0, 'No Zero' I.import_module('con_spange').transfer(amount=amount, to=ctx.caller) @__export('con_spange_game_tv2_7') def set_var(amount: float): assert ctx.caller == __metadata['operator'], 'No' assert amount < decimal('1.0'), 'Less Than 1' __varStack.set(amount)
 
Contract con_spange_game_tv2_7
Variable __compiled__
New Value e3000000000000000000000000040000004000000073d200000065006a018300010065025a0365046400640164028d025a0565066400640364028d025a0765066400640464028d025a0865066400640564028d025a096406640784005a0a650b64008301650c650d64089c026409640a840483015a0e650c650d640b9c02640c640d84045a0f640e640f84005a10650b64008301650c651164109c0264116412840483015a12650b64008301650d64139c0164146415840483015a13650b64008301650d64139c0164166417840483015a14650b64008301650d64139c0164186419840483015a15641a5300291bda15636f6e5f7370616e67655f67616d655f7476325f37da086d657461646174612902da08636f6e7472616374da046e616d65da08766172537461636bda086d6178537461636bda0967616d65537461636b630000000000000000000000000300000043000000734200000074006a01740264013c0074006a01740264023c0074036a047405640383018301010074066a047405640483018301010074076a04740564048301830101006400530029054eda056f776e6572da086f70657261746f727a03302e317a03302e302908da03637478da0663616c6c6572da0a5f5f6d65746164617461da0a5f5f766172537461636bda03736574da07646563696d616cda0a5f5f6d6178537461636bda0b5f5f67616d65537461636ba90072120000007212000000da00da045f5f5f5f09000000730a00000000010a010a010e010e0172140000002902da057468726f77da05737461636b63020000000000000005000000060000004300000073ac0000007400640164026403640464058d047d027c0274016a02190074036a04830014007d0374016a056a06640683010c00733874076407830182017c0064086b0273587c0064096b0273587c00640a6b0273587407640b830182017c017408640c83016b04736c7407640d830182017c017c036b0073847407640e74097c038301170083018201740a6a0b640183016a0c7c0174016a0274016a05640f8d030100740d7c007c0183027d047c04530029104eda0a636f6e5f7370616e6765da0862616c616e636573720100000072070000002904da10666f726569676e5f636f6e7472616374da0c666f726569676e5f6e616d6572030000007204000000da04636f6e5f7a0962616420726f626f74da0172da0170da01737a30722c2070206f7220733b20746f20726570726573656e7420726f636b2c207061706572206f722073636973736f72732e7a03302e307a1a737461636b206d75737420626520736f6d65207370616e67652e7a1c77686f6120626967207370656e64657221206c657373207468616e202903da06616d6f756e74da02746fda0c6d61696e5f6163636f756e74290eda0b466f726569676e48617368720a000000da0474686973720d000000da03676574720b000000da0a73746172747377697468da0e417373657274696f6e4572726f72720f000000da03737472da0149da0d696d706f72745f6d6f64756c65da0d7472616e736665725f66726f6dda0a5f5f727073526f756e6429057215000000721600000072110000007210000000da04706c6179721200000072120000007213000000da07727073506c6179110000007316000000000204010c011201160120011401180110010a010a01722d0000002902da0270317216000000630200000000000000040000000400000043000000739e000000740083007d027c007c026b02723874016a02640183016a037c01740464028301140074056a0664038d02010064047c0217007d037c0353007c0264056b0272487c0064066b0273687c0264066b0272587c0064076b0273687c0264076b0272747c0064056b02727464087c0217007d037c03530074016a02640183016a037c016409140074056a0664038d020100640a7c0217007d037c03530064005300290b4e72170000007a04302e39392902721f00000072200000007a0b5469652e20626f74203d20721c000000721e000000721d0000007a10426f742077696e732120626f74203d20e9020000007a1248756d616e2077696e732120626f74203d202907da0a5f5f626f745468726f7772280000007229000000da087472616e73666572720f000000720a000000720b0000002904722e0000007216000000da026231da06726573756c74721200000072120000007213000000722b0000002000000073180000000001060108010e011001080104013001080104021a010801722b000000630000000000000000020000000300000043000000733000000074006a016401640283027d007c0064016b02721a64037d016e127c0064046b02722864057d016e0464067d017c01530029074ee900000000722f000000721c000000e901000000721d000000721e0000002902da0672616e646f6dda0772616e64696e742902da01787232000000721200000072120000007213000000723000000030000000730e00000000010c010801060108010602040172300000002902da036b6579da0576616c7565630200000000000000020000000300000043000000732200000074006a017402640119006b02731674036402830182017c0174027c003c006400530029034e7209000000da024e6f2904720a000000720b000000720c000000722600000029027239000000723a000000721200000072120000007213000000da0f6368616e67655f6d657461646174613b000000730400000000021601723c0000002901721f000000630100000000000000010000000500000043000000734400000074006a017402640119006b02731674036402830182017c0064036b047326740364048301820174046a05640583016a067c0074006a0774006a0164068d0301006400530029074e7209000000723b00000072340000007a074e6f205a65726f72170000002903721f000000722000000072210000002908720a000000720b000000720c000000722600000072280000007229000000722a00000072230000002901721f000000721200000072120000007213000000da06746f705f75704100000073080000000002160110011001723d000000630100000000000000010000000400000043000000734000000074006a017402640119006b02731674036402830182017c0064036b047326740364048301820174046a05640583016a067c0074006a0164068d0201006400530029074e7209000000723b00000072340000007a074e6f205a65726f72170000002902721f00000072200000002907720a000000720b000000720c00000072260000007228000000722900000072310000002901721f000000721200000072120000007213000000da077461705f6f7574490000007306000000000216011001723e000000630100000000000000010000000300000043000000733800000074006a017402640119006b02731674036402830182017c007404640383016b00732a740364048301820174056a067c00830101006400530029054e7209000000723b0000007a03312e307a0b4c657373205468616e20312907720a000000720b000000720c0000007226000000720f000000720d000000720e0000002901721f000000721200000072120000007213000000da077365745f766172500000007306000000000216011401723f0000004e29167236000000da0473656564da09696d706f72746c69627228000000da0448617368720c000000da085661726961626c65720d000000721000000072110000007214000000da085f5f6578706f72747227000000da05666c6f6174722d000000722b0000007230000000da03416e79723c000000723d000000723e000000723f0000007212000000721200000072120000007213000000da083c6d6f64756c653e010000007324000000080104010c010c010c010c0308080601120e1010080b0601120506011007060110060601
 
Contract con_spange_game_tv2_7
Variable __owner__
New Value null
 
Contract con_spange_game_tv2_7
Variable __submitted__
New Value 2022,12,20,2,5,51,0
 
Contract con_spange_game_tv2_7
Variable __developer__
New Value 19040eef9ad7e23c84f31cab6930d192bcc7029618d36edc62029c5136af633e
 
Contract currency
Variable balances
Key 19040eef9ad7e23c84f31cab6930d192bcc7029618d36edc62029c5136af633e
New Value 19.2539052934163885982922235379