Contract con_simple_contract4


Contract Code


  
1 balances = Hash()
2 random.seed()
3
4 @construct
5 def seed():
6 values = random.randint(1, 100)
7 balances[ctx.caller] = values
8
9 @export
10 def get_balance(wallet_id: str):
11 return str(balances[wallet_id])
12
13 @export
14 def add_balance(to: str, amount: float):
15 balances[to] += amount
16
17 @export
18 def subtract_balance(to: str, amount: float):
19 balances[to] -= amount

Byte Code

e30000000000000000000000000400000040000000736600000065006400640164028d025a0165026a03830001006403640484005a04650564008301650664059c0164066407840483015a076505640083016506650864089c026409640a840483015a096505640083016506650864089c02640b640c840483015a0a640d5300290eda14636f6e5f73696d706c655f636f6e747261637434da0862616c616e6365732902da08636f6e7472616374da046e616d65630000000000000000010000000300000043000000731a00000074006a016401640283027d007c00740274036a043c006400530029034ee901000000e9640000002905da0672616e646f6dda0772616e64696e74da0a5f5f62616c616e636573da03637478da0663616c6c65722901da0676616c756573a900720d000000da00da045f5f5f5f05000000730400000000010c01720f0000002901da0977616c6c65745f6964630100000000000000010000000300000043000000730c000000740074017c0019008301530029014e2902da03737472720900000029017210000000720d000000720d000000720e000000da0b6765745f62616c616e63650a0000007302000000000272120000002902da02746fda06616d6f756e74630200000000000000020000000400000043000000731400000074007c00050019007c01370003003c006400530029014e29017209000000290272130000007214000000720d000000720d000000720e000000da0b6164645f62616c616e63650f000000730200000000027215000000630200000000000000020000000400000043000000731400000074007c00050019007c01380003003c006400530029014e29017209000000290272130000007214000000720d000000720d000000720e000000da1073756274726163745f62616c616e6365140000007302000000000272160000004e290bda044861736872090000007207000000da0473656564720f000000da085f5f6578706f727472110000007212000000da05666c6f617472150000007216000000720d000000720d000000720d000000720e000000da083c6d6f64756c653e0100000073100000000c010803080506011004060112040601