Transaction #77598

Hash fe7ae00908e81fe21164c95fa06e2664956aa1b9f5c16139979f17cda9f9b1ca
Status Success
Timestamp 1094 days ago - 5/19/2021, 2:08:39 AM UTC+0
Block 77053
Stamps Used 205
Burned Fee 0.03153846 TAU
From 34f576553f24eda1bb08d04f8a3c02e2d0ca6fa83d627908180dd559f2700981 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 44
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature d29f9266d33bfed8c6f0ce5f970c2d5cffcde868bf96d13c5308c41483f32a74b8cb21dd219b34a2acd0b73a93d5006a0d0899f1b5284a3985b7e3d0982b5c01
Stamps Supplied 3250
Stamps per TAU 65

Kwargs

code random.seed() # LST001 balances = Hash(default_value=0) # LST002 metadata = Hash() pot = Variable() @construct def seed(supply=1_000_000_000): # LST001 - MINT SUPPLY to wallet that submits the contract balances[ctx.caller] = supply # LST002 metadata['token_name'] = "Kiss of Python" metadata['token_symbol'] = "KISS" metadata['operator'] = ctx.caller pot.set(0) # LST002 @export def change_metadata(key: str, value: Any): assert ctx.caller == metadata['operator'], 'Only operator can set metadata!' metadata[key] = value def calc_skim(amount: float): skim = amount * 0.02 p = pot.get() pot.set(p + skim) return skim def draw_lotto(): draw = random.randint(0, 99) if draw == 0 or draw == 1: # win! return True # lose return False # LST001 @export def transfer(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' assert balances[ctx.caller] >= amount, 'Not enough coins to send!' # Take 1% from the transfer and put it into the pot skim = calc_skim(amount) balances[ctx.caller] -= amount balances[to] += (amount - skim) draw = draw_lotto() if draw: balances[to] += pot.get() pot.set(0) # LST001 @export def approve(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' balances[ctx.caller, to] += amount # LST001 @export def transfer_from(amount: float, to: str, main_account: str): assert amount > 0, 'Cannot send negative balances!' assert balances[ main_account, ctx.caller] >= amount, 'Not enough coins approved to send! You have {} and are trying to spend {}' \ .format(balances[main_account, ctx.caller], amount) assert balances[main_account] >= amount, 'Not enough coins to send!' skim = calc_skim(amount) balances[main_account, ctx.caller] -= amount balances[main_account] -= amount balances[to] += (amount - skim) draw = draw_lotto() if draw: balances[to] += pot.get() pot.set(0)
name con_kiss_contract

State Changes

Contract con_kiss_contract
Variable balances
Key 34f576553f24eda1bb08d04f8a3c02e2d0ca6fa83d627908180dd559f2700981
New Value 1000000000
 
Contract con_kiss_contract
Variable metadata
Key token_name
New Value Kiss of Python
 
Contract con_kiss_contract
Variable metadata
Key token_symbol
New Value KISS
 
Contract con_kiss_contract
Variable metadata
Key operator
New Value 34f576553f24eda1bb08d04f8a3c02e2d0ca6fa83d627908180dd559f2700981
 
Contract con_kiss_contract
Variable pot
New Value 0
 
Contract con_kiss_contract
Variable __code__
New Value random.seed() __balances = Hash(default_value=0, contract='con_kiss_contract', name= 'balances') __metadata = Hash(contract='con_kiss_contract', name='metadata') __pot = Variable(contract='con_kiss_contract', name='pot') def ____(supply=1000000000): __balances[ctx.caller] = supply __metadata['token_name'] = 'Kiss of Python' __metadata['token_symbol'] = 'KISS' __metadata['operator'] = ctx.caller __pot.set(0) @__export('con_kiss_contract') def change_metadata(key: str, value: Any): assert ctx.caller == __metadata['operator' ], 'Only operator can set metadata!' __metadata[key] = value def __calc_skim(amount: float): skim = amount * decimal('0.02') p = __pot.get() __pot.set(p + skim) return skim def __draw_lotto(): draw = random.randint(0, 99) if draw == 0 or draw == 1: return True return False @__export('con_kiss_contract') def transfer(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' assert __balances[ctx.caller] >= amount, 'Not enough coins to send!' skim = __calc_skim(amount) __balances[ctx.caller] -= amount __balances[to] += amount - skim draw = __draw_lotto() if draw: __balances[to] += __pot.get() __pot.set(0) @__export('con_kiss_contract') def approve(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' __balances[ctx.caller, to] += amount @__export('con_kiss_contract') def transfer_from(amount: float, to: str, main_account: str): assert amount > 0, 'Cannot send negative balances!' assert __balances[main_account, ctx.caller ] >= amount, 'Not enough coins approved to send! You have {} and are trying to spend {}'.format( __balances[main_account, ctx.caller], amount) assert __balances[main_account] >= amount, 'Not enough coins to send!' skim = __calc_skim(amount) __balances[main_account, ctx.caller] -= amount __balances[main_account] -= amount __balances[to] += amount - skim draw = __draw_lotto() if draw: __balances[to] += __pot.get() __pot.set(0)
 
Contract con_kiss_contract
Variable __compiled__
New Value e3000000000000000000000000050000004000000073b400000065006a0183000100650264006401640264038d035a0365026401640464058d025a0465056401640664058d025a06641b6408640984015a076508640183016509650a640a9c02640b640c840483015a0b650c640d9c01640e640f84045a0d6410641184005a0e650864018301650c650964129c0264136414840483015a0f650864018301650c650964129c0264156416840483015a10650864018301650c6509650964179c0364186419840483015a11641a5300291ce900000000da11636f6e5f6b6973735f636f6e7472616374da0862616c616e6365732903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65da086d65746164617461290272050000007206000000da03706f74e900ca9a3b63010000000000000001000000030000004300000073320000007c00740074016a023c006401740364023c006403740364043c0074016a02740364053c0074046a056406830101006400530029074e7a0e4b697373206f6620507974686f6eda0a746f6b656e5f6e616d65da044b495353da0c746f6b656e5f73796d626f6cda086f70657261746f7272010000002906da0a5f5f62616c616e636573da03637478da0663616c6c6572da0a5f5f6d65746164617461da055f5f706f74da037365742901da06737570706c79a9007215000000da00da045f5f5f5f08000000730a00000000010a01080108010a0172170000002902da036b6579da0576616c7565630200000000000000020000000300000043000000732200000074006a017402640119006b02731674036402830182017c0174027c003c006400530029034e720d0000007a1f4f6e6c79206f70657261746f722063616e20736574206d65746164617461212904720f00000072100000007211000000da0e417373657274696f6e4572726f72290272180000007219000000721500000072150000007216000000da0f6368616e67655f6d65746164617461100000007306000000000210010601721b0000002901da06616d6f756e7463010000000000000003000000030000004300000073260000007c0074006401830114007d0174016a0283007d0274016a037c027c011700830101007c01530029024e7a04302e30322904da07646563696d616c7212000000da0367657472130000002903721c000000da04736b696dda0170721500000072150000007216000000da0b5f5f63616c635f736b696d17000000730800000000010c0108010e017221000000630000000000000000010000000300000043000000732400000074006a016401640283027d007c0064016b02731c7c0064036b027220640453006405530029064e7201000000e963000000e90100000054462902da0672616e646f6dda0772616e64696e742901da0464726177721500000072150000007216000000da0c5f5f647261775f6c6f74746f1e000000730800000000010c011001040172270000002902721c000000da02746f63020000000000000004000000050000004300000073800000007c0064016b0473107400640283018201740174026a0319007c006b057326740064038301820174047c0083017d02740174026a03050019007c00380003003c0074017c01050019007c007c021800370003003c00740583007d037c03727c74017c010500190074066a078300370003003c0074066a086401830101006400530029044e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a194e6f7420656e6f75676820636f696e7320746f2073656e64212909721a000000720e000000720f0000007210000000722100000072270000007212000000721e00000072130000002904721c0000007228000000721f0000007226000000721500000072150000007216000000da087472616e736665722500000073120000000002100116010801120114010601040114017229000000630200000000000000020000000400000043000000732a0000007c0064016b0473107400640283018201740174026a037c016602050019007c00370003003c006400530029034e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573212904721a000000720e000000720f00000072100000002902721c0000007228000000721500000072150000007216000000da07617070726f766532000000730400000000021001722a0000002903721c0000007228000000da0c6d61696e5f6163636f756e7463030000000000000005000000050000004300000073be0000007c0064016b047310740064028301820174017c0274026a03660219007c006b05733c740064036a0474017c0274026a03660219007c0083028301820174017c0219007c006b057350740064048301820174057c0083017d0374017c0274026a036602050019007c00380003003c0074017c02050019007c00380003003c0074017c01050019007c007c031800370003003c00740683007d047c0472ba74017c010500190074076a088300370003003c0074076a096401830101006400530029054e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a494e6f7420656e6f75676820636f696e7320617070726f76656420746f2073656e642120596f752068617665207b7d20616e642061726520747279696e6720746f207370656e64207b7d7a194e6f7420656e6f75676820636f696e7320746f2073656e6421290a721a000000720e000000720f0000007210000000da06666f726d6174722100000072270000007212000000721e00000072130000002905721c0000007228000000722b000000721f0000007226000000721500000072150000007216000000da0d7472616e736665725f66726f6d38000000731a000000000210010c010c01140114010801160110011401060104011401722d0000004e2901720900000029127224000000da0473656564da0448617368720e0000007211000000da085661726961626c6572120000007217000000da085f5f6578706f7274da03737472da03416e79721b000000da05666c6f6174722100000072270000007229000000722a000000722d0000007215000000721500000072150000007216000000da083c6d6f64756c653e01000000731e0000000801060108010c010c030a08060112060e0708070601120c060112050601
 
Contract con_kiss_contract
Variable __owner__
New Value null
 
Contract con_kiss_contract
Variable __submitted__
New Value 2021,5,19,2,8,37,0
 
Contract con_kiss_contract
Variable __developer__
New Value 34f576553f24eda1bb08d04f8a3c02e2d0ca6fa83d627908180dd559f2700981
 
Contract currency
Variable balances
Key 34f576553f24eda1bb08d04f8a3c02e2d0ca6fa83d627908180dd559f2700981
New Value 385.67692307769230604