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