Contract con_token_swap

Created On
213 days ago - 9/16/2020, 7:20:05 AM UTC+0


Contract Code
1 import currency
2 operator = Variable(contract='con_token_swap', name='operator')
3 seen_hashes = Hash(contract='con_token_swap', name='seen_hashes')
4
5
6 def (vk: str):
7 operator.set(vk)
8
9
10 @export('con_token_swap')
11 def disperse(amount: float, to: str, hash: str):
12 assert_owner()
13 assert seen_hashes[hash] is None, 'Already processed this hash!'
14 seen_hashes[hash] = True
15 currency.transfer(amount=amount, to=to)
16
17
18 @export('con_token_swap')
19 def withdraw(amount: float):
20 assert_owner()
21 currency.transfer(amount=amount, to=ctx.caller)
22
23
24 @export('con_token_swap')
25 def change_operator(new_operator: str):
26 assert_owner()
27 operator.set(new_operator)
28
29
30 def assert_owner():
31 assert ctx.caller == operator.get(), 'Only operator can call!'
32

Byte Code
e300000000000000000000000005000000400000007380000000640064016c005a0065016402640364048d025a0265036402640564048d025a04650564069c016407640884045a0665076402830165086505650564099c03640a640b840483015a096507640283016508640c9c01640d640e840483015a0a6507640283016505640f9c0164106411840483015a0b6412641384005a0c640153002914e9000000004eda0e636f6e5f746f6b656e5f73776170da086f70657261746f722902da08636f6e7472616374da046e616d65da0b7365656e5f6861736865732901da02766b630100000000000000010000000200000043000000730e00000074006a017c00830101006400530029014e2902da0a5f5f6f70657261746f72da0373657429017207000000a900720a000000da00da045f5f5f5f0600000073020000000001720c0000002903da06616d6f756e74da02746fda0468617368630300000000000000030000000400000043000000733400000074008300010074017c02190064006b08731a7402640183018201640274017c023c0074036a047c007c0164038d0201006400530029044e7a1c416c72656164792070726f6365737365642074686973206861736821542902720d000000720e0000002905da0e5f5f6173736572745f6f776e6572da0d5f5f7365656e5f686173686573da0e417373657274696f6e4572726f72da0863757272656e6379da087472616e736665722903720d000000720e000000720f000000720a000000720a000000720b000000da0864697370657273650a0000007308000000000206011401080172150000002901720d000000630100000000000000010000000400000043000000731a00000074008300010074016a027c0074036a0464018d0201006400530029024e2902720d000000720e0000002905721000000072130000007214000000da03637478da0663616c6c65722901720d000000720a000000720a000000720b000000da0877697468647261771200000073040000000002060172180000002901da0c6e65775f6f70657261746f72630100000000000000010000000200000043000000731400000074008300010074016a027c00830101006400530029014e290372100000007208000000720900000029017219000000720a000000720a000000720b000000da0f6368616e67655f6f70657261746f7218000000730400000000020601721a000000630000000000000000000000000200000043000000731a00000074006a0174026a0383006b02731674046401830182016400530029024e7a174f6e6c79206f70657261746f722063616e2063616c6c212905721600000072170000007208000000da036765747212000000720a000000720a000000720a000000720b00000072100000001e000000730200000000017210000000290d7213000000da085661726961626c657208000000da04486173687211000000da03737472720c000000da085f5f6578706f7274da05666c6f617472150000007218000000721a0000007210000000720a000000720a000000720a000000720b000000da083c6d6f64756c653e01000000731400000008010c010c030e04060114070601100506011005
Twitter @tauhq_com