Transaction #275433

Hash 663cc47853792c91accdb27758f9fa9b9b7eac824462a0cd9fa4f4a2c44294c7
Status Success
Timestamp 940 days ago - 10/21/2021, 11:23:45 AM UTC+0
Block 272259
Stamps Used 213
Burned Fee 0.03276923 TAU
From 9d8089896945a2372cd7ae2b34b9cb674fd4bd01df6d4b50ae14776cd39b2dea 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 182
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature 909718033ddff0e882328698d1f8b647899333635ab188f7faac2aec419a743fe7407572e2660d5ddded0d593706481f94acadb85c55e72ff46dd3bcdbc51a0a
Stamps Supplied 500
Stamps per TAU 65

Kwargs

code random.seed() # LST001 balances = Hash(default_value=0) # LST002 metadata = Hash() pot = Variable() @construct #<https://icons8.com/icon/Sra48NO05ILF/ghost def seed(): # LST001 - MINT SUPPLY to wallet that submits the contract balances[ctx.caller] = 1000000 # LST002 metadata['token_name'] = "SPOOKS" metadata['token_symbol'] = "BOO" metadata['operator'] = ctx.caller metadata['burn_address'] = 'SPOOKED' 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.05 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!' balances[ctx.caller] -= amount balances[to] += (amount * 0.75) balances[metadata['burn_address']] += (amount * 0.20) # Take 5% from the transfer and put it into the pot skim = calc_skim(amount) 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 * 0.75) balances[metadata['burn_address']] += (amount * 0.20) draw = draw_lotto() if draw: balances[to] += pot.get() pot.set(0)
name con_spooky

State Changes

Contract con_spooky
Variable balances
Key 9d8089896945a2372cd7ae2b34b9cb674fd4bd01df6d4b50ae14776cd39b2dea
New Value 1000000
 
Contract con_spooky
Variable metadata
Key token_name
New Value SPOOKS
 
Contract con_spooky
Variable metadata
Key token_symbol
New Value BOO
 
Contract con_spooky
Variable metadata
Key operator
New Value 9d8089896945a2372cd7ae2b34b9cb674fd4bd01df6d4b50ae14776cd39b2dea
 
Contract con_spooky
Variable metadata
Key burn_address
New Value SPOOKED
 
Contract con_spooky
Variable pot
New Value 0
 
Contract con_spooky
Variable __code__
New Value random.seed() __balances = Hash(default_value=0, contract='con_spooky', name='balances') __metadata = Hash(contract='con_spooky', name='metadata') __pot = Variable(contract='con_spooky', name='pot') def ____(): __balances[ctx.caller] = 1000000 __metadata['token_name'] = 'SPOOKS' __metadata['token_symbol'] = 'BOO' __metadata['operator'] = ctx.caller __metadata['burn_address'] = 'SPOOKED' __pot.set(0) @__export('con_spooky') 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.05') 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_spooky') def transfer(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' assert __balances[ctx.caller] >= amount, 'Not enough coins to send!' __balances[ctx.caller] -= amount __balances[to] += amount * decimal('0.75') __balances[__metadata['burn_address']] += amount * decimal('0.2') skim = __calc_skim(amount) draw = __draw_lotto() if draw: __balances[to] += __pot.get() __pot.set(0) @__export('con_spooky') def approve(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' __balances[ctx.caller, to] += amount @__export('con_spooky') 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 * decimal('0.75') __balances[__metadata['burn_address']] += amount * decimal('0.2') draw = __draw_lotto() if draw: __balances[to] += __pot.get() __pot.set(0)
 
Contract con_spooky
Variable __compiled__
New Value e3000000000000000000000000050000004000000073b200000065006a0183000100650264006401640264038d035a0365026401640464058d025a0465056401640664058d025a066407640884005a076508640183016509650a64099c02640a640b840483015a0b650c640c9c01640d640e84045a0d640f641084005a0e650864018301650c650964119c0264126413840483015a0f650864018301650c650964119c0264146415840483015a10650864018301650c6509650964169c0364176418840483015a1164195300291ae900000000da0a636f6e5f73706f6f6b79da0862616c616e6365732903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65da086d65746164617461290272050000007206000000da03706f74630000000000000000000000000300000043000000733a0000006401740074016a023c006402740364033c006404740364053c0074016a02740364063c006407740364083c0074046a0564098301010064005300290a4e6940420f00da0653504f4f4b53da0a746f6b656e5f6e616d65da03424f4fda0c746f6b656e5f73796d626f6cda086f70657261746f72da0753504f4f4b4544da0c6275726e5f6164647265737372010000002906da0a5f5f62616c616e636573da03637478da0663616c6c6572da0a5f5f6d65746164617461da055f5f706f74da03736574a90072160000007216000000da00da045f5f5f5f07000000730c00000000010a01080108010a01080172180000002902da036b6579da0576616c7565630200000000000000020000000300000043000000732200000074006a017402640119006b02731674036402830182017c0174027c003c006400530029034e720d0000007a1f4f6e6c79206f70657261746f722063616e20736574206d65746164617461212904721100000072120000007213000000da0e417373657274696f6e4572726f7229027219000000721a000000721600000072160000007217000000da0f6368616e67655f6d65746164617461100000007306000000000210010601721c0000002901da06616d6f756e7463010000000000000003000000030000004300000073260000007c0074006401830114007d0174016a0283007d0274016a037c027c011700830101007c01530029024e7a04302e30352904da07646563696d616c7214000000da0367657472150000002903721d000000da04736b696dda0170721600000072160000007217000000da0b5f5f63616c635f736b696d17000000730800000000010c0108010e017222000000630000000000000000010000000300000043000000732400000074006a016401640283027d007c0064016b02731c7c0064036b027220640453006405530029064e7201000000e963000000e90100000054462902da0672616e646f6dda0772616e64696e742901da0464726177721600000072160000007217000000da0c5f5f647261775f6c6f74746f1e000000730800000000010c011001040172280000002902721d000000da02746f63020000000000000004000000060000004300000073a00000007c0064016b0473107400640283018201740174026a0319007c006b0573267400640383018201740174026a03050019007c00380003003c0074017c01050019007c007404640483011400370003003c007401740564051900050019007c007404640683011400370003003c0074067c0083017d02740783007d037c03729c74017c010500190074086a098300370003003c0074086a0a6401830101006400530029074e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a194e6f7420656e6f75676820636f696e7320746f2073656e64217a04302e3735720f0000007a03302e32290b721b000000721000000072110000007212000000721e0000007213000000722200000072280000007214000000721f00000072150000002904721d000000722900000072200000007227000000721600000072160000007217000000da087472616e73666572250000007314000000000210011601120118011c010801060104011401722a000000630200000000000000020000000400000043000000732a0000007c0064016b0473107400640283018201740174026a037c016602050019007c00370003003c006400530029034e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573212904721b0000007210000000721100000072120000002902721d0000007229000000721600000072160000007217000000da07617070726f766533000000730400000000021001722b0000002903721d0000007229000000da0c6d61696e5f6163636f756e7463030000000000000005000000060000004300000073de0000007c0064016b047310740064028301820174017c0274026a03660219007c006b05733c740064036a0474017c0274026a03660219007c0083028301820174017c0219007c006b057350740064048301820174057c0083017d0374017c0274026a036602050019007c00380003003c0074017c02050019007c00380003003c0074017c01050019007c007406640583011400370003003c007401740764061900050019007c007406640783011400370003003c00740883007d047c0472da74017c010500190074096a0a8300370003003c0074096a0b6401830101006400530029084e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a494e6f7420656e6f75676820636f696e7320617070726f76656420746f2073656e642120596f752068617665207b7d20616e642061726520747279696e6720746f207370656e64207b7d7a194e6f7420656e6f75676820636f696e7320746f2073656e64217a04302e3735720f0000007a03302e32290c721b000000721000000072110000007212000000da06666f726d61747222000000721e000000721300000072280000007214000000721f00000072150000002905721d0000007229000000722c00000072200000007227000000721600000072160000007217000000da0d7472616e736665725f66726f6d39000000731c000000000210010c010c011401140108011601100118011c01060104011401722e0000004e29127225000000da0473656564da044861736872100000007213000000da085661726961626c6572140000007218000000da085f5f6578706f7274da03737472da03416e79721c000000da05666c6f617472220000007228000000722a000000722b000000722e0000007216000000721600000072160000007217000000da083c6d6f64756c653e01000000731c00000008010e010c010c030809060112060e0708070601120d060112050601
 
Contract con_spooky
Variable __owner__
New Value null
 
Contract con_spooky
Variable __submitted__
New Value 2021,10,21,11,23,45,0
 
Contract con_spooky
Variable __developer__
New Value 9d8089896945a2372cd7ae2b34b9cb674fd4bd01df6d4b50ae14776cd39b2dea
 
Contract currency
Variable balances
Key 9d8089896945a2372cd7ae2b34b9cb674fd4bd01df6d4b50ae14776cd39b2dea
New Value 196.734919083618158434368277126699