1 |
import currency |
2 |
__balances = ForeignHash(foreign_contract='currency', foreign_name= |
3 |
'balances', contract='con_smack_that', name='balances') |
4 |
__settings = Hash(default_value=0, contract='con_smack_that', name='settings') |
5 |
random.seed() |
6 |
|
7 |
|
8 |
def ____(): |
9 |
__settings['odds'] = 20 |
10 |
__settings['cost'] = 10 |
11 |
|
12 |
|
13 |
@__export('con_smack_that') |
14 |
def smack(): |
15 |
currency.transfer_from(amount=__settings['cost'], to=ctx.this, |
16 |
main_account=ctx.caller) |
17 |
x = random.randint(1, __settings['odds']) |
18 |
if x == __settings['odds']: |
19 |
winbal = __balances[ctx.this] |
20 |
currency.transfer(amount=winbal, to=ctx.caller) |
21 |
return winbal |
22 |
|
e30000000000000000000000000600000040000000734a000000640064016c005a006501640264036404640364058d045a02650364006404640664078d035a0465056a06830001006408640984005a07650864048301640a640b840083015a0964015300290ce9000000004eda0863757272656e6379da0862616c616e636573da0e636f6e5f736d61636b5f746861742904da10666f726569676e5f636f6e7472616374da0c666f726569676e5f6e616d65da08636f6e7472616374da046e616d65da0873657474696e67732903da0d64656661756c745f76616c75657207000000720800000063000000000000000000000000030000004300000073140000006401740064023c006403740064043c006400530029054ee914000000da046f646473e90a000000da04636f73742901da0a5f5f73657474696e6773a90072100000007210000000da00da045f5f5f5f080000007304000000000108017212000000630000000000000000020000000500000043000000735600000074006a0174026401190074036a0474036a0564028d03010074066a07640374026404190083027d007c007402640419006b027252740874036a0419007d0174006a097c0174036a0564058d0201007c0153006400530029064e720e0000002903da06616d6f756e74da02746fda0c6d61696e5f6163636f756e74e901000000720c000000290272130000007214000000290a7202000000da0d7472616e736665725f66726f6d720f000000da03637478da0474686973da0663616c6c6572da0672616e646f6dda0772616e64696e74da0a5f5f62616c616e636573da087472616e736665722902da0178da0677696e62616c721000000072100000007211000000da05736d61636b0d000000730e00000000020e010a0110010c010a0110017221000000290a7202000000da0b466f726569676e48617368721d000000da0448617368720f000000721b000000da04736565647212000000da085f5f6578706f727472210000007210000000721000000072100000007211000000da083c6d6f64756c653e01000000730c000000080104010c010e0108030805