Transaction #17603

Hash 0b7e9bb8c3315410cb1b7eb8e9968b74a84bb65c5d1fb83be8b4f528846088c4
Status Success
Timestamp 373 days ago - 10/16/2020, 7:05:44 AM UTC+0
Block 21548
Stamps Used 238
Burned Fee 0.06611111 TAU
From fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 45
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature 4a0722d140fd7efafdac8f00b7fb1c79805e83b432e69fccb51a1ebcef9c81f01cc02b728d89b56bd31098cbdb31c7e8834b027b8deb6046490e67ac5572ab08
Stamps Supplied 1800
Stamps per TAU 36

Kwargs

code import currency settings = Hash(default_value=0) random.seed() @construct def seed(): settings['pot_max'] = 20000 settings['min_bet'] = 3 settings['refund_per'] = 0.01 settings['refund_div'] = 10 settings['dev_contract'] = 'con_smackeroos_3' settings['operator'] = ctx.caller settings['list'] = ["pot_max", "refund_per", "refund_div", "dev_contract", "operator", "min_bet"] @export def smack(bet_amount: int): assert bet_amount >= settings['min_bet'], "bet must be greater than or equal to " + str(settings['min_bet']) # lock max bet to 8% of current pot bet = determine_cost(bet_amount) #assert False, type(bet) # Take bet currency.transfer_from(amount=bet, to=ctx.this, main_account=ctx.caller) # Get random number x = random.randint(0, 10) # WIN if x >= 6: win_amount = bet * 2 currency.transfer(amount=win_amount, to=ctx.caller) return {"bet": bet, "won": win_amount, "status": 1} # LOSE else: give_dev_token() check_overflow() return {"bet":bet, "status": 0} def determine_cost(bet_amount: int): max_bet = int(currency.balance_of(ctx.this) * 0.08 // 1) if bet_amount < max_bet: return bet_amount else: return max_bet def give_dev_token(): dev_contract = importlib.import_module(settings['dev_contract']) refund = dev_contract.balance_of(ctx.this) * (settings['refund_per'] / settings['refund_div']) dev_contract.transfer(refund, ctx.caller) def check_overflow(): overflow = currency.balance_of(ctx.this) - settings['pot_max'] if overflow > 0: currency.transfer(amount=overflow, to=settings['dev_contract']) @export def change_settings(setting: str, new_value: Any): assert_operator() assert setting in settings['list'], setting + ' is not a configurable setting.' settings[setting] = new_value @export def transfer(amount: float, to: str): assert_operator() currency.transfer(amount=amount, to=to) @export def transfer_dev_token(amount: float, to: str): assert_operator() dev_contract = importlib.import_module(settings['dev_contract']) dev_contract.transfer(amount=amount, to=to) def assert_operator(): assert ctx.caller == settings['operator'], "Only operator can call this method."
name con_smack_that_6

State Changes

Contract con_smack_that_6
Variable settings
Key pot_max
New Value 20000
 
Contract con_smack_that_6
Variable settings
Key min_bet
New Value 3
 
Contract con_smack_that_6
Variable settings
Key refund_per
New Value 0.01
 
Contract con_smack_that_6
Variable settings
Key refund_div
New Value 10
 
Contract con_smack_that_6
Variable settings
Key dev_contract
New Value con_smackeroos_3
 
Contract con_smack_that_6
Variable settings
Key operator
New Value fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1
 
Contract con_smack_that_6
Variable settings
Key list
New Value
 
Contract con_smack_that_6
Variable __code__
New Value import currency __settings = Hash(default_value=0, contract='con_smack_that_6', name='settings' ) random.seed() def ____(): __settings['pot_max'] = 20000 __settings['min_bet'] = 3 __settings['refund_per'] = decimal('0.01') __settings['refund_div'] = 10 __settings['dev_contract'] = 'con_smackeroos_3' __settings['operator'] = ctx.caller __settings['list'] = ['pot_max', 'refund_per', 'refund_div', 'dev_contract', 'operator', 'min_bet'] @__export('con_smack_that_6') def smack(bet_amount: int): assert bet_amount >= __settings['min_bet' ], 'bet must be greater than or equal to ' + str(__settings['min_bet']) bet = __determine_cost(bet_amount) currency.transfer_from(amount=bet, to=ctx.this, main_account=ctx.caller) x = random.randint(0, 10) if x >= 6: win_amount = bet * 2 currency.transfer(amount=win_amount, to=ctx.caller) return {'bet': bet, 'won': win_amount, 'status': 1} else: __give_dev_token() __check_overflow() return {'bet': bet, 'status': 0} def __determine_cost(bet_amount: int): max_bet = int(currency.balance_of(ctx.this) * decimal('0.08') // 1) if bet_amount < max_bet: return bet_amount else: return max_bet def __give_dev_token(): dev_contract = importlib.import_module(__settings['dev_contract']) refund = dev_contract.balance_of(ctx.this) * (__settings['refund_per'] / __settings['refund_div']) dev_contract.transfer(refund, ctx.caller) def __check_overflow(): overflow = currency.balance_of(ctx.this) - __settings['pot_max'] if overflow > 0: currency.transfer(amount=overflow, to=__settings['dev_contract']) @__export('con_smack_that_6') def change_settings(setting: str, new_value: Any): __assert_operator() assert setting in __settings['list' ], setting + ' is not a configurable setting.' __settings[setting] = new_value @__export('con_smack_that_6') def transfer(amount: float, to: str): __assert_operator() currency.transfer(amount=amount, to=to) @__export('con_smack_that_6') def transfer_dev_token(amount: float, to: str): __assert_operator() dev_contract = importlib.import_module(__settings['dev_contract']) dev_contract.transfer(amount=amount, to=to) def __assert_operator(): assert ctx.caller == __settings['operator' ], 'Only operator can call this method.'
 
Contract con_smack_that_6
Variable __compiled__
New Value e3000000000000000000000000050000004000000073ae000000640064016c005a00650164006402640364048d035a0265036a04830001006405640684005a05650664028301650764079c0164086409840483015a08650764079c01640a640b84045a09640c640d84005a0a640e640f84005a0b650664028301650c650d64109c0264116412840483015a0e650664028301650f650c64139c0264146415840483015a10650664028301650f650c64139c0264166417840483015a116418641984005a1264015300291ae9000000004eda10636f6e5f736d61636b5f746861745f36da0873657474696e67732903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65630000000000000000000000000600000043000000734e0000006401740064023c006403740064043c00740164058301740064063c006407740064083c0064097400640a3c0074026a037400640b3c00640264066408640a640b640467067400640c3c0064005300290d4e69204e0000da07706f745f6d6178e903000000da076d696e5f6265747a04302e3031da0a726566756e645f706572e90a000000da0a726566756e645f646976da10636f6e5f736d61636b65726f6f735f33da0c6465765f636f6e7472616374da086f70657261746f72da046c6973742904da0a5f5f73657474696e6773da07646563696d616cda03637478da0663616c6c6572a90072150000007215000000da00da045f5f5f5f0700000073100000000001080108010c01080108010a01060172170000002901da0a6265745f616d6f756e74630100000000000000040000000500000043000000738e0000007c007400640119006b057320740164027402740064011900830117008301820174037c0083017d0174046a057c0174066a0774066a0864038d03010074096a0a6404640583027d027c0264066b0572747c01640714007d0374046a0b7c0374066a0864088d0201007c017c036409640a9c035300740c83000100740d830001007c016404640b9c02530064005300290c4e72090000007a25626574206d7573742062652067726561746572207468616e206f7220657175616c20746f202903da06616d6f756e74da02746fda0c6d61696e5f6163636f756e747201000000720b000000e906000000e90200000029027219000000721a000000e9010000002903da03626574da03776f6eda067374617475732902721f0000007221000000290e7211000000da0e417373657274696f6e4572726f72da03737472da105f5f64657465726d696e655f636f7374da0863757272656e6379da0d7472616e736665725f66726f6d7213000000da04746869737214000000da0672616e646f6dda0772616e64696e74da087472616e73666572da105f5f676976655f6465765f746f6b656eda105f5f636865636b5f6f766572666c6f7729047218000000721f000000da0178da0a77696e5f616d6f756e74721500000072150000007216000000da05736d61636b12000000731800000000020e011201080114010c010801080110010c0206010601722f0000006301000000000000000200000004000000430000007330000000740074016a0274036a048301740564018301140064021a0083017d017c007c016b0072287c0053007c0153006400530029034e7a04302e3038721e0000002906da03696e747225000000da0a62616c616e63655f6f6672130000007227000000721200000029027218000000da076d61785f626574721500000072150000007216000000722400000023000000730800000000011c01080104027224000000630000000000000000020000000400000043000000733c00000074006a0174026401190083017d007c006a0374046a0583017402640219007402640319001b0014007d017c006a067c0174046a07830201006400530029044e720e000000720a000000720c0000002908da09696d706f72746c6962da0d696d706f72745f6d6f64756c657211000000723100000072130000007227000000722a00000072140000002902720e000000da06726566756e64721500000072150000007216000000722b0000002b000000730800000000010e0110010c01722b000000630000000000000000010000000400000043000000733200000074006a0174026a03830174046401190018007d007c0064026b04722e74006a057c0074046403190064048d0201006400530029054e72070000007201000000720e00000029027219000000721a000000290672250000007231000000721300000072270000007211000000722a0000002901da086f766572666c6f77721500000072150000007216000000722c000000320000007306000000000114010801722c0000002902da0773657474696e67da096e65775f76616c7565630200000000000000020000000300000043000000732a0000007400830001007c007401640119006b06731e74027c0064021700830182017c0174017c003c006400530029034e72100000007a1f206973206e6f74206120636f6e666967757261626c652073657474696e672e2903da115f5f6173736572745f6f70657261746f7272110000007222000000290272370000007238000000721500000072150000007216000000da0f6368616e67655f73657474696e6773380000007308000000000206010e010a01723a00000029027219000000721a000000630200000000000000020000000400000043000000731800000074008300010074016a027c007c0164018d0201006400530029024e29027219000000721a000000290372390000007225000000722a00000029027219000000721a000000721500000072150000007216000000722a00000040000000730400000000020601722a000000630200000000000000030000000400000043000000732600000074008300010074016a0274036401190083017d027c026a047c007c0164028d0201006400530029034e720e00000029027219000000721a00000029057239000000723300000072340000007211000000722a00000029037219000000721a000000720e000000721500000072150000007216000000da127472616e736665725f6465765f746f6b656e460000007306000000000206010e01723b000000630000000000000000000000000300000043000000731a00000074006a017402640119006b02731674036402830182016400530029034e720f0000007a234f6e6c79206f70657261746f722063616e2063616c6c2074686973206d6574686f642e29047213000000721400000072110000007222000000721500000072150000007215000000721600000072390000004d000000730400000000011001723900000029137225000000da044861736872110000007228000000da04736565647217000000da085f5f6578706f72747230000000722f0000007224000000722b000000722c0000007223000000da03416e79723a000000da05666c6f6174722a000000723b00000072390000007215000000721500000072150000007216000000da083c6d6f64756c653e01000000731e00000008010e020803080b060110100e0808070806060112070601120506011206
 
Contract con_smack_that_6
Variable __owner__
New Value null
 
Contract con_smack_that_6
Variable __submitted__
New Value 2020,10,15,23,5,53,0
 
Contract con_smack_that_6
Variable __developer__
New Value fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1
 
Contract currency
Variable balances
Key fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1
New Value 131.822222222222223300