Contract con_rocket_id_v1

Created On
93 days ago - 3/15/2021, 12:45:45 PM UTC+0


Contract Code
1 name_to_key = Hash(default_value=False, contract='con_rocket_id_v1', name
2 ='name_to_key')
3 key_to_name = Hash(default_value=False, contract='con_rocket_id_v1', name
4 ='key_to_name')
5 auth_codes = Hash(default_value=False, contract='con_rocket_id_v1', name=
6 'auth_codes')
7 Owner = Variable(contract='con_rocket_id_v1', name='Owner')
8
9
10 def ():
11 Owner.set(ctx.caller)
12
13
14 @export('con_rocket_id_v1')
15 def setName(name: str):
16 assert len(name) > 0 and len(name
17 ) < 20, 'Chosen name length must be more than 1 and less than 20 characters long.'
18 key = ctx.caller
19 previous_name = key_to_name[key]
20 name_taken = name_to_key[name]
21 assert name_taken is False, 'This name has been taken.'
22 if previous_name is not False:
23 name_to_key[previous_name] = False
24 key_to_name[key] = name
25 name_to_key[name] = key
26
27
28 @export('con_rocket_id_v1')
29 def auth(secret: str):
30 auth_codes[secret] = ctx.caller
31

Byte Code
e30000000000000000000000000500000040000000736e000000650064006401640264038d035a01650064006401640464038d035a02650064006401640564038d035a0365046401640664078d025a056408640984005a066507640183016508640a9c01640b640c840483015a096507640183016508640d9c01640e640f840483015a0a64105300291146da10636f6e5f726f636b65745f69645f7631da0b6e616d655f746f5f6b65792903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65da0b6b65795f746f5f6e616d65da0a617574685f636f646573da054f776e6572290272040000007205000000630000000000000000000000000200000043000000731000000074006a0174026a03830101006400530029014e2904da075f5f4f776e6572da03736574da03637478da0663616c6c6572a900720d000000720d000000da00da045f5f5f5f0a00000073020000000001720f00000029017205000000630100000000000000040000000300000043000000736a00000074007c00830164016b04721874007c00830164026b007320740164038301820174026a037d0174047c0119007d0274057c0019007d037c0364046b08734674016405830182017c0264046b097256640474057c023c007c0074047c013c007c0174057c003c006400530029064ee900000000e9140000007a4843686f73656e206e616d65206c656e677468206d757374206265206d6f7265207468616e203120616e64206c657373207468616e2032302063686172616374657273206c6f6e672e467a1954686973206e616d6520686173206265656e2074616b656e2e2906da036c656eda0e417373657274696f6e4572726f72720b000000720c000000da0d5f5f6b65795f746f5f6e616d65da0d5f5f6e616d655f746f5f6b657929047205000000da036b6579da0d70726576696f75735f6e616d65da0a6e616d655f74616b656e720d000000720d000000720e000000da077365744e616d650e0000007314000000000212010e01060108010801100108010801080172190000002901da06736563726574630100000000000000010000000300000043000000730e00000074006a0174027c003c006400530029014e2903720b000000720c000000da0c5f5f617574685f636f6465732901721a000000720d000000720d000000720e000000da04617574681c00000073020000000002721c0000004e290bda044861736872150000007214000000721b000000da085661726961626c657209000000720f000000da085f5f6578706f7274da037374727219000000721c000000720d000000720d000000720d000000720e000000da083c6d6f64756c653e0100000073160000000601080106010801060108010c0308040601100d0601
Twitter @tauhq_com