Transaction #579

Hash 9158973203bddfded43c80427e06285d8cae7014313b05850f055192d2eefc89
Status Success
Timestamp 462 days ago - 2/6/2023, 11:16:10 PM UTC+0
Block 579
Stamps Used 359
Burned Fee 0.02124260 TAU
From ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d 
Contract Name submission
Function Name submit_contract

Additional Info
Nonce 19
Processor ffd7182fcfd0d84ca68845fb11bafad11abca2f9aca8754a6d9cad7baa39d28b
Signature 1759b1f8b759f99659d97d86f7f41bba0fbb992db990a47957b14800c8ec8dfe5c3699a66b89d91ac255d46a8a453056ae1f9e450b20714edcf80c277f9bbd0d
Stamps Supplied 6500
Stamps per TAU 169

Kwargs

code I = importlib metadata = Hash() multisig = Hash(default_value=0) balances = Hash(default_value=0) allowances = Hash(default_value=0) total_supply = Variable() swap_end_date = Variable() @construct def seed(): balances[ctx.submission_name] = 142487438 metadata['token_name'] = "NEB2" metadata['token_symbol'] = "NEB2" # TODO: Change metadata['operator'] = [ '6351a80d32cbb3c173e490b093a95b15bcf4f6190251863669202d7fe2257af3', 'ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d', 'c913e1c146f1426a8c0dc042e92ccc18a54dd612d878c84e433ecc9705d91ee5' ] # TODO: Change swap_end_date.set(now + datetime.timedelta(minutes=5)) total_supply.set(0) @export def change_metadata(key: str, value: Any): assert key != 'operator', 'Operators can not be changed' assert_caller_is_owner() metadata[key] = value @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 swap_end_date.get() - now @export def total_supply(): return int(total_supply.get()) def multisig_agrees(topic: str, amount: float): yes = 0 if multisig[metadata['operator'][0], topic] == amount: yes += 1 if multisig[metadata['operator'][1], topic] == amount: yes += 1 if multisig[metadata['operator'][2], topic] == amount: 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 allow_swap(address: str, amount: float): multisig[ctx.caller, f'swap-{address}'] = amount assert_caller_is_owner() @export def swap_neb(amount: float): assert amount > 0, 'Cannot swap negative balances!' if now > swap_end_date.get(): topic = f'swap-{ctx.signer}' assert multisig_agrees(topic, amount), 'Swap period ended' # TODO: Change I.import_module('con_nebula2').transfer_from( amount=amount, to='NEBULA_BURN_ADDRESS', main_account=ctx.caller ) swap_amount = amount * 0.1 balances[ctx.caller] += swap_amount total_supply.set(total_supply.get() + swap_amount) @export def allow_withdraw(token_contract: str, amount: float): multisig[ctx.caller, f'withdraw-{token_contract}'] = amount assert_caller_is_owner() @export def withdraw(token_contract: str, amount: float): 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_new_neb10

State Changes

Contract con_new_neb10
Variable balances
Key con_new_neb10
New Value 142487438
 
Contract con_new_neb10
Variable metadata
Key token_name
New Value NEB2
 
Contract con_new_neb10
Variable metadata
Key token_symbol
New Value NEB2
 
Contract con_new_neb10
Variable metadata
Key operator
New Value ["6351a80d32cbb3c173e490b093a95b15bcf4f6190251863669202d7fe2257af3","ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d","c913e1c146f1426a8c0dc042e92ccc18a54dd612d878c84e433ecc9705d91ee5"]
 
Contract con_new_neb10
Variable swap_end_date
New Value 2023,2,6,23,21,11,0
 
Contract con_new_neb10
Variable total_supply
New Value 0
 
Contract con_new_neb10
Variable __code__
New Value I = importlib __metadata = Hash(contract='con_new_neb10', name='metadata') __multisig = Hash(default_value=0, contract='con_new_neb10', name='multisig') __balances = Hash(default_value=0, contract='con_new_neb10', name='balances') __allowances = Hash(default_value=0, contract='con_new_neb10', name= 'allowances') __total_supply = Variable(contract='con_new_neb10', name='total_supply') __swap_end_date = Variable(contract='con_new_neb10', name='swap_end_date') def ____(): __balances[ctx.submission_name] = 142487438 __metadata['token_name'] = 'NEB2' __metadata['token_symbol'] = 'NEB2' __metadata['operator'] = [ '6351a80d32cbb3c173e490b093a95b15bcf4f6190251863669202d7fe2257af3', 'ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d', 'c913e1c146f1426a8c0dc042e92ccc18a54dd612d878c84e433ecc9705d91ee5'] __swap_end_date.set(now + datetime.timedelta(minutes=5)) __total_supply.set(0) @__export('con_new_neb10') def change_metadata(key: str, value: Any): assert key != 'operator', 'Operators can not be changed' __assert_caller_is_owner() __metadata[key] = value @__export('con_new_neb10') 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_new_neb10') def approve(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' __allowances[ctx.caller, to] += amount @__export('con_new_neb10') 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_new_neb10') def balance_of(address: str): return __balances[address] @__export('con_new_neb10') def time_until_swap_end(): return __swap_end_date.get() - now @__export('con_new_neb10') def total_supply(): return int(__total_supply.get()) def __multisig_agrees(topic: str, amount: float): yes = 0 if __multisig[__metadata['operator'][0], topic] == amount: yes += 1 if __multisig[__metadata['operator'][1], topic] == amount: yes += 1 if __multisig[__metadata['operator'][2], topic] == amount: 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_new_neb10') def allow_swap(address: str, amount: float): __multisig[ctx.caller, f'swap-{address}'] = amount __assert_caller_is_owner() @__export('con_new_neb10') def swap_neb(amount: float): assert amount > 0, 'Cannot swap negative balances!' if now > __swap_end_date.get(): topic = f'swap-{ctx.signer}' assert __multisig_agrees(topic, amount), 'Swap period ended' I.import_module('con_nebula2').transfer_from(amount=amount, to= 'NEBULA_BURN_ADDRESS', main_account=ctx.caller) swap_amount = amount * decimal('0.1') __balances[ctx.caller] += swap_amount __total_supply.set(__total_supply.get() + swap_amount) @__export('con_new_neb10') def allow_withdraw(token_contract: str, amount: float): __multisig[ctx.caller, f'withdraw-{token_contract}'] = amount __assert_caller_is_owner() @__export('con_new_neb10') def withdraw(token_contract: str, amount: float): 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_new_neb10
Variable __compiled__
New Value e30000000000000000000000000500000040000000736c01000065005a0165026400640164028d025a03650264036400640464058d035a04650264036400640664058d035a05650264036400640764058d035a0665076400640864028d025a0865076400640964028d025a09640a640b84005a0a650b64008301650c650d640c9c02640d640e840483015a0e650b64008301650f650c640f9c0264106411840483015a10650b64008301650f650c640f9c0264126413840483015a11650b64008301650f650c650c64149c0364156416840483015a12650b64008301650c64179c0164186419840483015a13650b64008301641a641b840083015a14650b64008301641c6408840083015a15650c650f641d9c02641e641f84045a16650b64008301650c650f64209c0264216422840483015a17650b64008301650f64239c0164246425840483015a18650b64008301650c650f64269c0264276428840483015a19650b64008301650c650f64269c026429642a840483015a1a642b642c84005a1b642d5300292eda0d636f6e5f6e65775f6e65623130da086d657461646174612902da08636f6e7472616374da046e616d65e900000000da086d756c74697369672903da0d64656661756c745f76616c756572030000007204000000da0862616c616e636573da0a616c6c6f77616e636573da0c746f74616c5f737570706c79da0d737761705f656e645f64617465630000000000000000000000000500000043000000734c0000006401740074016a023c006402740364033c006402740364043c006405640664076703740364083c0074046a05740674076a086409640a8d0117008301010074096a05640b8301010064005300290c4e698e2f7e08da044e454232da0a746f6b656e5f6e616d65da0c746f6b656e5f73796d626f6cda4036333531613830643332636262336331373365343930623039336139356231356263663466363139303235313836333636393230326437666532323537616633da4061653764313464366439623834343366383831626136323434373237623639623638313031306537383264346665343832646266623062366163613032643564da4063393133653163313436663134323661386330646330343265393263636331386135346464363132643837386338346534333365636339373035643931656535da086f70657261746f72e9050000002901da076d696e757465737205000000290ada0a5f5f62616c616e636573da03637478da0f7375626d697373696f6e5f6e616d65da0a5f5f6d65746164617461da0f5f5f737761705f656e645f64617465da03736574da036e6f77da086461746574696d65da0974696d6564656c7461da0e5f5f746f74616c5f737570706c79a900721f000000721f000000da00da045f5f5f5f0b000000731000000000010a0108010802020102010a01160172210000002902da036b6579da0576616c756563020000000000000002000000030000004300000073220000007c0064016b03731074006402830182017401830001007c0174027c003c006400530029034e72120000007a1c4f70657261746f72732063616e206e6f74206265206368616e6765642903da0e417373657274696f6e4572726f72da185f5f6173736572745f63616c6c65725f69735f6f776e65727218000000290272220000007223000000721f000000721f0000007220000000da0f6368616e67655f6d6574616461746117000000730600000000021001060172260000002902da06616d6f756e74da02746f630200000000000000020000000400000043000000734c0000007c0064016b0473107400640283018201740174026a0319007c006b0573267400640383018201740174026a03050019007c00380003003c0074017c01050019007c00370003003c006400530029044e72050000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a1a4e6f7420656e6f75676820746f6b656e7320746f2073656e64212904722400000072150000007216000000da0663616c6c6572290272270000007228000000721f000000721f0000007220000000da087472616e736665721e00000073080000000002100116011201722a000000630200000000000000020000000400000043000000732a0000007c0064016b0473107400640283018201740174026a037c016602050019007c00370003003c006400530029034e72050000007a1e43616e6e6f742073656e64206e656761746976652062616c616e6365732129047224000000da0c5f5f616c6c6f77616e63657372160000007229000000290272270000007228000000721f000000721f0000007220000000da07617070726f766526000000730400000000021001722c000000290372270000007228000000da0c6d61696e5f6163636f756e74630300000000000000040000000500000043000000738800000074007c0274016a02660219007d037c0064016b04731e74036402830182017c037c006b05733a740364037c039b0064047c009b009d048301820174047c0219007c006b05734e740364058301820174007c0274016a026602050019007c00380003003c0074047c02050019007c00380003003c0074047c01050019007c00370003003c006400530029064e72050000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a0d596f7520617070726f766564207a0a20627574206e656564207a1a4e6f7420656e6f75676820746f6b656e7320746f2073656e64212905722b0000007216000000722900000072240000007215000000290472270000007228000000722d000000da08617070726f766564721f000000721f0000007220000000da0d7472616e736665725f66726f6d2c000000730e00000000020e0110011c01140116011001722f0000002901da0761646472657373630100000000000000010000000200000043000000730800000074007c001900530029014e2901721500000029017230000000721f000000721f0000007220000000da0a62616c616e63655f6f6637000000730200000000027231000000630000000000000000000000000200000043000000730c00000074006a01830074021800530029014e29037219000000da03676574721b000000721f000000721f000000721f0000007220000000da1374696d655f756e74696c5f737761705f656e643c000000730200000000027233000000630000000000000000000000000200000043000000730c000000740074016a0283008301530029014e2903da03696e74721e0000007232000000721f000000721f000000721f0000007220000000720a00000041000000730200000000022902da05746f706963722700000063020000000000000003000000040000004300000073b000000064017d027400740164021900640119007c00660219007c016b0272247c02640337007d027400740164021900640319007c00660219007c016b0272447c02640337007d027400740164021900640419007c00660219007c016b0272647c02640337007d027c0264036b0472ac64017400740164021900640119007c0066023c0064017400740164021900640319007c0066023c0064017400740164021900640419007c0066023c00640553006406530029074e72050000007212000000e901000000e90200000054462902da0a5f5f6d756c74697369677218000000290372350000007227000000da03796573721f000000721f0000007220000000da115f5f6d756c74697369675f61677265657346000000731a0000000001040118010801180108011801080108011401140114010401723a000000290272300000007227000000630200000000000000020000000500000043000000731e0000007c01740074016a0264017c009b009d0266023c007403830001006400530029024e7a05737761702d29047238000000721600000072290000007225000000290272300000007227000000721f000000721f0000007220000000da0a616c6c6f775f7377617056000000730400000000021401723b0000002901722700000063010000000000000003000000050000004300000073860000007c0064016b0473107400640283018201740174026a0383006b04723a640374046a059b009d027d0174067c017c008302733a740064048301820174076a08640583016a097c00640674046a0a64078d0301007c00740b6408830114007d02740c74046a0a050019007c02370003003c00740d6a0e740d6a0383007c021700830101006400530029094e72050000007a1e43616e6e6f742073776170206e656761746976652062616c616e636573217a05737761702d7a115377617020706572696f6420656e646564da0b636f6e5f6e6562756c6132da134e4542554c415f4255524e5f41444452455353290372270000007228000000722d0000007a03302e31290f7224000000721b000000721900000072320000007216000000da067369676e6572723a000000da0149da0d696d706f72745f6d6f64756c65722f0000007229000000da07646563696d616c7215000000721e000000721a000000290372270000007235000000da0b737761705f616d6f756e74721f000000721f0000007220000000da08737761705f6e65625c0000007312000000000210010c010c0112010c010c010c01120172430000002902da0e746f6b656e5f636f6e74726163747227000000630200000000000000020000000500000043000000731e0000007c01740074016a0264017c009b009d0266023c007403830001006400530029024e7a0977697468647261772d29047238000000721600000072290000007225000000290272440000007227000000721f000000721f0000007220000000da0e616c6c6f775f7769746864726177690000007304000000000214017245000000630200000000000000020000000300000043000000731800000074006a017c0083016a027c0174036a04830201006400530029014e2905723f0000007240000000722a00000072160000007229000000290272440000007227000000721f000000721f0000007220000000da0877697468647261776f000000730200000000027246000000630000000000000000000000000300000043000000731a00000074006a017402640119006b06731674036402830182016400530029034e72120000007a1d4f6e6c792065786563757461626c65206279206f70657261746f72732129047216000000722900000072180000007224000000721f000000721f000000721f000000722000000072250000007400000073040000000001100172250000004e291cda09696d706f72746c6962723f000000da0448617368721800000072380000007215000000722b000000da085661726961626c65721e00000072190000007221000000da085f5f6578706f7274da03737472da03416e797226000000da05666c6f6174722a000000722c000000722f00000072310000007233000000720a000000723a000000723b0000007243000000724500000072460000007225000000721f000000721f000000721f0000007220000000da083c6d6f64756c653e01000000733c00000004010c010e010e01060108010c010c03080c0601120606011207060112050601140a06011004100510051010060112050601100c0601120506011204
 
Contract con_new_neb10
Variable __owner__
New Value null
 
Contract con_new_neb10
Variable __submitted__
New Value 2023,2,6,23,16,11,0
 
Contract con_new_neb10
Variable __developer__
New Value ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
 
Contract currency
Variable balances
Key ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
New Value 1607.354365489284457851650774034939