Transaction #2365

Hash d72d558ca507fe42cc8bea2155dcd6d37434d365f233fbb5b32d9ee1cd7fac8c
Status Success
Timestamp 440 days ago - 2/10/2023, 4:36:13 PM UTC+0
Block 2365
Stamps Used 384
Burned Fee 0.02272189 TAU
From ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d 
Contract Name submission
Function Name submit_contract

Additional Info
Nonce 44
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature ff48e5990ac2ea387c7049bf6c3254e162b44a8314347e2edad0aa82384f31d1edbefc10c93b8c30944fbe3d3437a03eb3de97e5fe86fa7c6fe1793b626d2e04
Stamps Supplied 845
Stamps per TAU 169

Kwargs

code I = importlib multisig = Hash(default_value='') metadata = Hash(default_value='') balances = Hash(default_value=0) allowances = Hash(default_value=0) @construct def seed(): metadata['total_supply'] = 142_487_438 metadata['token_name'] = "Portal" metadata['token_symbol'] = "XPTL" metadata['v_token_con'] = "con_v_portal" metadata['v_lp_con'] = "con_v_portal_lp" metadata['swap_end_date'] = now + datetime.timedelta(days=30) metadata['operator'] = [ 'fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1', 'ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d', '889f923fb54a79deb11ee2850010488992222c92351d3024ea3a737b78fab0eb' ] balances[ctx.submission_name] = metadata['total_supply'] @export def transfer(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' assert balances[ctx.caller] >= amount, 'Not enough tokens to send!' balances[ctx.caller] -= amount balances[to] += amount @export def approve(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' allowances[ctx.caller, to] += amount @export def transfer_from(amount: float, to: str, main_account: str): approved = allowances[main_account, ctx.caller] assert amount > 0, 'Cannot send negative balances!' assert approved >= amount, f'You approved {approved} but need {amount}' assert balances[main_account] >= amount, 'Not enough tokens to send!' allowances[main_account, ctx.caller] -= amount balances[main_account] -= amount balances[to] += amount @export def balance_of(address: str): return balances[address] @export def time_until_swap_end(): return metadata['swap_end_date'] - now @export def total_supply(): return int(metadata['total_supply']) @export def set_multisig(topic: str, data: Any): multisig[ctx.caller, topic] = data assert_caller_is_owner() def multisig_agrees(topic: str, data: Any): yes = 0 if multisig[metadata['operator'][0], topic] == data: yes += 1 if multisig[metadata['operator'][1], topic] == data: yes += 1 if multisig[metadata['operator'][2], topic] == data: yes += 1 if yes > 1: multisig[metadata['operator'][0], topic] = 0 multisig[metadata['operator'][1], topic] = 0 multisig[metadata['operator'][2], topic] = 0 return True return False @export def change_metadata(key: str, value: Any): assert multisig_agrees(f'metadata-{key}', value), 'Not enough votes!' assert_caller_is_owner() metadata[key] = value if key == 'token_name': I.import_module(metadata['v_token_con']).change_token_name(value) I.import_module(metadata['v_lp_con']).change_token_name(value) elif key == 'token_symbol': I.import_module(metadata['v_token_con']).change_token_symbol(value) I.import_module(metadata['v_lp_con']).change_token_symbol(value) @export def swap_neb(amount: float): assert amount > 0, 'Cannot swap negative balances!' if now > metadata['swap_end_date']: assert multisig_agrees(f'swap-{ctx.signer}', amount), 'Swap period ended' I.import_module('con_nebula').transfer_from( amount=amount, to='NEBULA_BURN_ADDRESS', main_account=ctx.caller ) swap_amount = amount * 0.1 balances[ctx.caller] += swap_amount metadata['total_supply'] += swap_amount @export def withdraw(token_contract: str, amount: float): assert multisig_agrees(f'withdraw-{token_contract}', amount), 'Not enough votes!' assert_caller_is_owner() if token_contract == ctx.this: assert amount > 0, 'Cannot send negative balances!' assert balances[token_contract] >= amount, 'Not enough tokens to send!' balances[token_contract] -= amount balances[ctx.caller] += amount else: I.import_module(token_contract).transfer(amount, ctx.caller) def assert_caller_is_owner(): assert ctx.caller in metadata['operator'], 'Only executable by operators!'
name con_portal

State Changes

Contract con_portal
Variable metadata
Key total_supply
New Value 142487438
 
Contract con_portal
Variable metadata
Key token_name
New Value Portal
 
Contract con_portal
Variable metadata
Key token_symbol
New Value XPTL
 
Contract con_portal
Variable metadata
Key v_token_con
New Value con_v_portal
 
Contract con_portal
Variable metadata
Key v_lp_con
New Value con_v_portal_lp
 
Contract con_portal
Variable metadata
Key swap_end_date
New Value 2023,3,12,16,36,14,0
 
Contract con_portal
Variable metadata
Key operator
New Value ["fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1","ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d","889f923fb54a79deb11ee2850010488992222c92351d3024ea3a737b78fab0eb"]
 
Contract con_portal
Variable balances
Key con_portal
New Value 142487438
 
Contract con_portal
Variable __code__
New Value I = importlib __multisig = Hash(default_value='', contract='con_portal', name='multisig') __metadata = Hash(default_value='', contract='con_portal', name='metadata') __balances = Hash(default_value=0, contract='con_portal', name='balances') __allowances = Hash(default_value=0, contract='con_portal', name='allowances') def ____(): __metadata['total_supply'] = 142487438 __metadata['token_name'] = 'Portal' __metadata['token_symbol'] = 'XPTL' __metadata['v_token_con'] = 'con_v_portal' __metadata['v_lp_con'] = 'con_v_portal_lp' __metadata['swap_end_date'] = now + datetime.timedelta(days=30) __metadata['operator'] = [ 'fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1', 'ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d', '889f923fb54a79deb11ee2850010488992222c92351d3024ea3a737b78fab0eb'] __balances[ctx.submission_name] = __metadata['total_supply'] @__export('con_portal') def transfer(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' assert __balances[ctx.caller] >= amount, 'Not enough tokens to send!' __balances[ctx.caller] -= amount __balances[to] += amount @__export('con_portal') def approve(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' __allowances[ctx.caller, to] += amount @__export('con_portal') def transfer_from(amount: float, to: str, main_account: str): approved = __allowances[main_account, ctx.caller] assert amount > 0, 'Cannot send negative balances!' assert approved >= amount, f'You approved {approved} but need {amount}' assert __balances[main_account] >= amount, 'Not enough tokens to send!' __allowances[main_account, ctx.caller] -= amount __balances[main_account] -= amount __balances[to] += amount @__export('con_portal') def balance_of(address: str): return __balances[address] @__export('con_portal') def time_until_swap_end(): return __metadata['swap_end_date'] - now @__export('con_portal') def total_supply(): return int(__metadata['total_supply']) @__export('con_portal') def set_multisig(topic: str, data: Any): __multisig[ctx.caller, topic] = data __assert_caller_is_owner() def __multisig_agrees(topic: str, data: Any): yes = 0 if __multisig[__metadata['operator'][0], topic] == data: yes += 1 if __multisig[__metadata['operator'][1], topic] == data: yes += 1 if __multisig[__metadata['operator'][2], topic] == data: yes += 1 if yes > 1: __multisig[__metadata['operator'][0], topic] = 0 __multisig[__metadata['operator'][1], topic] = 0 __multisig[__metadata['operator'][2], topic] = 0 return True return False @__export('con_portal') def change_metadata(key: str, value: Any): assert __multisig_agrees(f'metadata-{key}', value), 'Not enough votes!' __assert_caller_is_owner() __metadata[key] = value if key == 'token_name': I.import_module(__metadata['v_token_con']).change_token_name(value) I.import_module(__metadata['v_lp_con']).change_token_name(value) elif key == 'token_symbol': I.import_module(__metadata['v_token_con']).change_token_symbol(value) I.import_module(__metadata['v_lp_con']).change_token_symbol(value) @__export('con_portal') def swap_neb(amount: float): assert amount > 0, 'Cannot swap negative balances!' if now > __metadata['swap_end_date']: assert __multisig_agrees(f'swap-{ctx.signer}', amount ), 'Swap period ended' I.import_module('con_nebula').transfer_from(amount=amount, to= 'NEBULA_BURN_ADDRESS', main_account=ctx.caller) swap_amount = amount * decimal('0.1') __balances[ctx.caller] += swap_amount __metadata['total_supply'] += swap_amount @__export('con_portal') def withdraw(token_contract: str, amount: float): assert __multisig_agrees(f'withdraw-{token_contract}', amount ), 'Not enough votes!' __assert_caller_is_owner() if token_contract == ctx.this: assert amount > 0, 'Cannot send negative balances!' assert __balances[token_contract ] >= amount, 'Not enough tokens to send!' __balances[token_contract] -= amount __balances[ctx.caller] += amount else: I.import_module(token_contract).transfer(amount, ctx.caller) def __assert_caller_is_owner(): assert ctx.caller in __metadata['operator' ], 'Only executable by operators!'
 
Contract con_portal
Variable __compiled__
New Value e30000000000000000000000000500000040000000733e01000065005a01650264006401640264038d035a03650264006401640464038d035a04650264056401640664038d035a05650264056401640764038d035a066408640984005a076508640183016509650a640a9c02640b640c840483015a0b6508640183016509650a640a9c02640d640e840483015a0c6508640183016509650a650a640f9c0364106411840483015a0d650864018301650a64129c0164136414840483015a0e65086401830164156416840083015a0f65086401830164176418840083015a10650864018301650a651164199c02641a641b840483015a12650a651164199c02641c641d84045a13650864018301650a6511641e9c02641f6420840483015a14650864018301650964219c0164226423840483015a15650864018301650a650964249c0264256426840483015a166427642884005a1764295300292ada00da0a636f6e5f706f7274616cda086d756c74697369672903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65da086d65746164617461e900000000da0862616c616e636573da0a616c6c6f77616e636573630000000000000000000000000400000043000000735c0000006401740064023c006403740064043c006405740064063c006407740064083c0064097400640a3c00740174026a03640b640c8d0117007400640d3c00640e640f64106703740064113c00740064021900740474056a063c006400530029124e698e2f7e08da0c746f74616c5f737570706c79da06506f7274616cda0a746f6b656e5f6e616d65da045850544cda0c746f6b656e5f73796d626f6cda0c636f6e5f765f706f7274616cda0b765f746f6b656e5f636f6eda0f636f6e5f765f706f7274616c5f6c70da08765f6c705f636f6ee91e0000002901da0464617973da0d737761705f656e645f64617465da4066636566653737343366613730633937616532643532393066643637333037306461346230323933646130393566306165386163656363663565363262366131da4061653764313464366439623834343366383831626136323434373237623639623638313031306537383264346665343832646266623062366163613032643564da4038383966393233666235346137396465623131656532383530303130343838393932323232633932333531643330323465613361373337623738666162306562da086f70657261746f722907da0a5f5f6d65746164617461da036e6f77da086461746574696d65da0974696d6564656c7461da0a5f5f62616c616e636573da03637478da0f7375626d697373696f6e5f6e616d65a900722200000072220000007201000000da045f5f5f5f0800000073140000000001080108010801080108011402020102010a0172230000002902da06616d6f756e74da02746f630200000000000000020000000400000043000000734c0000007c0064016b0473107400640283018201740174026a0319007c006b0573267400640383018201740174026a03050019007c00380003003c0074017c01050019007c00370003003c006400530029044e72080000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a1a4e6f7420656e6f75676820746f6b656e7320746f2073656e64212904da0e417373657274696f6e4572726f72721f0000007220000000da0663616c6c6572290272240000007225000000722200000072220000007201000000da087472616e7366657216000000730800000000021001160112017228000000630200000000000000020000000400000043000000732a0000007c0064016b0473107400640283018201740174026a037c016602050019007c00370003003c006400530029034e72080000007a1e43616e6e6f742073656e64206e656761746976652062616c616e6365732129047226000000da0c5f5f616c6c6f77616e63657372200000007227000000290272240000007225000000722200000072220000007201000000da07617070726f76651e000000730400000000021001722a000000290372240000007225000000da0c6d61696e5f6163636f756e74630300000000000000040000000500000043000000738800000074007c0274016a02660219007d037c0064016b04731e74036402830182017c037c006b05733a740364037c039b0064047c009b009d048301820174047c0219007c006b05734e740364058301820174007c0274016a026602050019007c00380003003c0074047c02050019007c00380003003c0074047c01050019007c00370003003c006400530029064e72080000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a0d596f7520617070726f766564207a0a20627574206e656564207a1a4e6f7420656e6f75676820746f6b656e7320746f2073656e642129057229000000722000000072270000007226000000721f000000290472240000007225000000722b000000da08617070726f766564722200000072220000007201000000da0d7472616e736665725f66726f6d24000000730e00000000020e0110011c01140116011001722d0000002901da0761646472657373630100000000000000010000000200000043000000730800000074007c001900530029014e2901721f0000002901722e000000722200000072220000007201000000da0a62616c616e63655f6f662f00000073020000000002722f000000630000000000000000000000000200000043000000730c00000074006401190074011800530029024e72160000002902721b000000721c0000007222000000722200000072220000007201000000da1374696d655f756e74696c5f737761705f656e6434000000730200000000027230000000630000000000000000000000000300000043000000730c00000074007401640119008301530029024e720b0000002902da03696e74721b0000007222000000722200000072220000007201000000720b0000003900000073020000000002720b0000002902da05746f706963da046461746163020000000000000002000000040000004300000073180000007c01740074016a027c0066023c007403830001006400530029014e2904da0a5f5f6d756c746973696772200000007227000000da185f5f6173736572745f63616c6c65725f69735f6f776e6572290272320000007233000000722200000072220000007201000000da0c7365745f6d756c74697369673e000000730400000000020e01723600000063020000000000000003000000040000004300000073b000000064017d027400740164021900640119007c00660219007c016b0272247c02640337007d027400740164021900640319007c00660219007c016b0272447c02640337007d027400740164021900640419007c00660219007c016b0272647c02640337007d027c0264036b0472ac64017400740164021900640119007c0066023c0064017400740164021900640319007c0066023c0064017400740164021900640419007c0066023c00640553006406530029074e7208000000721a000000e901000000e902000000544629027234000000721b000000290372320000007233000000da03796573722200000072220000007201000000da115f5f6d756c74697369675f61677265657344000000731a0000000001040118010801180108011801080108011401140114010401723a0000002902da036b6579da0576616c7565630200000000000000020000000300000043000000738c000000740064017c009b009d027c018302731874016402830182017402830001007c0174037c003c007c0064036b02725874046a0574036404190083016a067c018301010074046a0574036405190083016a067c01830101006e307c0064066b02728874046a0574036404190083016a077c018301010074046a0574036405190083016a077c01830101006400530029074e7a096d657461646174612d7a114e6f7420656e6f75676820766f74657321720d00000072110000007213000000720f0000002908723a00000072260000007235000000721b000000da0149da0d696d706f72745f6d6f64756c65da116368616e67655f746f6b656e5f6e616d65da136368616e67655f746f6b656e5f73796d626f6c2902723b000000723c000000722200000072220000007201000000da0f6368616e67655f6d6574616461746154000000731200000000021801060108010801140116010801140172410000002901722400000063010000000000000002000000050000004300000073800000007c0064016b047310740064028301820174017402640319006b0472367403640474046a059b009d027c0083027336740064058301820174066a07640683016a087c00640774046a0964088d0301007c00740a6409830114007d01740b74046a09050019007c01370003003c007402640a050019007c01370003003c0064005300290b4e72080000007a1e43616e6e6f742073776170206e656761746976652062616c616e6365732172160000007a05737761702d7a115377617020706572696f6420656e646564da0a636f6e5f6e6562756c61da134e4542554c415f4255524e5f41444452455353290372240000007225000000722b0000007a03302e31720b000000290c7226000000721c000000721b000000723a0000007220000000da067369676e6572723d000000723e000000722d0000007227000000da07646563696d616c721f00000029027224000000da0b737761705f616d6f756e74722200000072220000007201000000da08737761705f6e6562610000007312000000000210010c01140106010c010c010c01120172470000002902da0e746f6b656e5f636f6e747261637472240000006302000000000000000200000004000000430000007388000000740064017c009b009d027c018302731874016402830182017402830001007c0074036a046b0272707c0164036b047338740164048301820174057c0019007c016b05734c740164058301820174057c00050019007c01380003003c00740574036a06050019007c01370003003c006e1474076a087c0083016a097c0174036a06830201006400530029064e7a0977697468647261772d7a114e6f7420656e6f75676820766f7465732172080000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a1a4e6f7420656e6f75676820746f6b656e7320746f2073656e6421290a723a000000722600000072350000007220000000da0474686973721f0000007227000000723d000000723e0000007228000000290272480000007224000000722200000072220000007201000000da0877697468647261776e000000731400000000021201060106010a01100106010e0110011402724a000000630000000000000000000000000300000043000000731a00000074006a017402640119006b06731674036402830182016400530029034e721a0000007a1d4f6e6c792065786563757461626c65206279206f70657261746f727321290472200000007227000000721b0000007226000000722200000072220000007222000000720100000072350000007d00000073040000000001100172350000004e2918da09696d706f72746c6962723d000000da04486173687234000000721b000000721f00000072290000007223000000da085f5f6578706f7274da05666c6f6174da037374727228000000722a000000722d000000722f0000007230000000720b000000da03416e797236000000723a00000072410000007247000000724a00000072350000007222000000722200000072220000007201000000da083c6d6f64756c653e01000000733200000004010e010e010e010e03080e06011207060112050601140a06011004100510050601120510100601120c0601100c0601120e
 
Contract con_portal
Variable __owner__
New Value null
 
Contract con_portal
Variable __submitted__
New Value 2023,2,10,16,36,14,0
 
Contract con_portal
Variable __developer__
New Value ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
 
Contract currency
Variable balances
Key ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
New Value 8183.379149357085326063199428812349