Transaction #913212

Hash b0040ae74f737d6a5c2e65f6853284a79f03dfd3dddb42f4ad9eafd0752fdced
Status Success
Timestamp 718 days ago - 5/29/2022, 1:23:54 AM UTC+0
Block 866467
Stamps Used 301
Burned Fee 0.01781065 TAU
From ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 4810
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature c831cbafc99acb18236203b6d1013a3b2658d5c77d0400954d8ec97af33835eeb4872cf417003630bfbac157f729f3cf482298a9d7bcb79e5596fb296aa29209
Stamps Supplied 845
Stamps per TAU 169

Kwargs

code import currency as tau I = importlib random.seed() balances = Hash(default_value=0) metadata = Hash() minted = Variable() burned = Variable() last_mint = Variable() max_supply = 50_000 initial_mint = 1262 @construct def seed(): last_mint.set(now) minted.set(initial_mint) burned.set(0) balances[ctx.caller] = initial_mint metadata['token_name'] = "KING Token" metadata['token_symbol'] = "KING" metadata['operator'] = ctx.caller @export def change_metadata(key: str, value: Any): assert ctx.caller == metadata['operator'], 'Not allowed' metadata[key] = value @export def balance_of(address: str): return balances[address] @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 @export def approve(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' balances[ctx.caller, to] += amount @export def transfer_from(amount: float, to: str, main_account: str): approved = balances[main_account, ctx.caller] assert approved >= amount, f'You approved {approved} but need {amount}' assert balances[main_account] >= amount, 'Not enough coins to send!' assert amount > 0, 'Cannot send negative balances!' balances[main_account, ctx.caller] -= amount balances[main_account] -= amount balances[to] += amount def transfer_internal(amount: float, to: str, main_account: str): assert balances[main_account] >= amount, 'Not enough coins to send!' assert amount > 0, 'Cannot send negative balances!' balances[main_account] -= amount balances[to] += amount @export def mint(): tau.transfer_from(amount=10, to=ctx.this, main_account=ctx.caller) if now < last_mint.get() + datetime.timedelta(seconds=random.randint(10, 30)): return if ctx.caller.startswith('con_'): return if minted.get() >= max_supply: return tau.transfer(amount=9, to=ctx.caller) counter = initial_mint for x in range(counter, minted.get() + 1): counter += 1 last_mint.set(now) minted.set(counter) balances[ctx.caller] += 1 return 'MINTED' @export def redeem(amount: float): transfer_internal(amount=amount, to='BURN_ADDRESS', main_account=ctx.caller) tau.transfer(amount=amount, to=ctx.caller) burned.set(burned.get() + amount) @export def payout(): amount = tau.balance_of(ctx.this) - (minted.get() - burned.get()) assert ctx.caller == metadata['operator'], 'Not allowed' tau.transfer(amount=amount, to=metadata['operator'])
name con_king_v2

State Changes

Contract con_king_v2
Variable last_mint
New Value 2022,5,29,1,23,55,0
 
Contract con_king_v2
Variable minted
New Value 1262
 
Contract con_king_v2
Variable burned
New Value 0
 
Contract con_king_v2
Variable balances
Key ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
New Value 1262
 
Contract con_king_v2
Variable metadata
Key token_name
New Value KING Token
 
Contract con_king_v2
Variable metadata
Key token_symbol
New Value KING
 
Contract con_king_v2
Variable metadata
Key operator
New Value ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
 
Contract con_king_v2
Variable __code__
New Value import currency as tau I = importlib random.seed() __balances = Hash(default_value=0, contract='con_king_v2', name='balances') __metadata = Hash(contract='con_king_v2', name='metadata') __minted = Variable(contract='con_king_v2', name='minted') __burned = Variable(contract='con_king_v2', name='burned') __last_mint = Variable(contract='con_king_v2', name='last_mint') max_supply = 50000 initial_mint = 1262 def ____(): __last_mint.set(now) __minted.set(initial_mint) __burned.set(0) __balances[ctx.caller] = initial_mint __metadata['token_name'] = 'KING Token' __metadata['token_symbol'] = 'KING' __metadata['operator'] = ctx.caller @__export('con_king_v2') def change_metadata(key: str, value: Any): assert ctx.caller == __metadata['operator'], 'Not allowed' __metadata[key] = value @__export('con_king_v2') def balance_of(address: str): return __balances[address] @__export('con_king_v2') 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 @__export('con_king_v2') def approve(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' __balances[ctx.caller, to] += amount @__export('con_king_v2') def transfer_from(amount: float, to: str, main_account: str): approved = __balances[main_account, ctx.caller] assert approved >= amount, f'You approved {approved} but need {amount}' assert __balances[main_account] >= amount, 'Not enough coins to send!' assert amount > 0, 'Cannot send negative balances!' __balances[main_account, ctx.caller] -= amount __balances[main_account] -= amount __balances[to] += amount def __transfer_internal(amount: float, to: str, main_account: str): assert __balances[main_account] >= amount, 'Not enough coins to send!' assert amount > 0, 'Cannot send negative balances!' __balances[main_account] -= amount __balances[to] += amount @__export('con_king_v2') def mint(): tau.transfer_from(amount=10, to=ctx.this, main_account=ctx.caller) if now < __last_mint.get() + datetime.timedelta(seconds=random.randint( 10, 30)): return if ctx.caller.startswith('con_'): return if __minted.get() >= max_supply: return tau.transfer(amount=9, to=ctx.caller) counter = initial_mint for x in range(counter, __minted.get() + 1): counter += 1 __last_mint.set(now) __minted.set(counter) __balances[ctx.caller] += 1 return 'MINTED' @__export('con_king_v2') def redeem(amount: float): __transfer_internal(amount=amount, to='BURN_ADDRESS', main_account=ctx. caller) tau.transfer(amount=amount, to=ctx.caller) __burned.set(__burned.get() + amount) @__export('con_king_v2') def payout(): amount = tau.balance_of(ctx.this) - (__minted.get() - __burned.get()) assert ctx.caller == __metadata['operator'], 'Not allowed' tau.transfer(amount=amount, to=__metadata['operator'])
 
Contract con_king_v2
Variable __compiled__
New Value e300000000000000000000000005000000400000007326010000640064016c005a0165025a0365046a0583000100650664006402640364048d035a0765066402640564068d025a0865096402640764068d025a0a65096402640864068d025a0b65096402640964068d025a0c640a5a0d640b5a0e640c640d84005a0f65106402830165116512640e9c02640f6410840483015a13651064028301651164119c0164126413840483015a146510640283016515651164149c0264156416840483015a166510640283016515651164149c0264176418840483015a1765106402830165156511651164199c03641a641b840483015a1865156511651164199c03641c641d84045a19651064028301641e641f840083015a1a651064028301651564209c0164216422840483015a1b65106402830164236424840083015a1c640153002925e9000000004eda0b636f6e5f6b696e675f7632da0862616c616e6365732903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65da086d65746164617461290272050000007206000000da066d696e746564da066275726e6564da096c6173745f6d696e746950c3000069ee040000630000000000000000000000000300000043000000734600000074006a0174028301010074036a0174048301010074056a016401830101007404740674076a083c006402740964033c006404740964053c0074076a08740964063c006400530029074e72010000007a0a4b494e4720546f6b656eda0a746f6b656e5f6e616d65da044b494e47da0c746f6b656e5f73796d626f6cda086f70657261746f72290ada0b5f5f6c6173745f6d696e74da03736574da036e6f77da085f5f6d696e746564da0c696e697469616c5f6d696e74da085f5f6275726e6564da0a5f5f62616c616e636573da03637478da0663616c6c6572da0a5f5f6d65746164617461a90072190000007219000000da00da045f5f5f5f0d000000730e00000000010a010a010a010a0108010801721b0000002902da036b6579da0576616c7565630200000000000000020000000300000043000000732200000074006a017402640119006b02731674036402830182017c0174027c003c006400530029034e720e0000007a0b4e6f7420616c6c6f7765642904721600000072170000007218000000da0e417373657274696f6e4572726f722902721c000000721d00000072190000007219000000721a000000da0f6368616e67655f6d6574616461746117000000730400000000021601721f0000002901da0761646472657373630100000000000000010000000200000043000000730800000074007c001900530029014e290172150000002901722000000072190000007219000000721a000000da0a62616c616e63655f6f661d0000007302000000000272210000002902da06616d6f756e74da02746f630200000000000000020000000400000043000000734c0000007c0064016b0473107400640283018201740174026a0319007c006b0573267400640383018201740174026a03050019007c00380003003c0074017c01050019007c00370003003c006400530029044e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a194e6f7420656e6f75676820636f696e7320746f2073656e64212904721e00000072150000007216000000721700000029027222000000722300000072190000007219000000721a000000da087472616e7366657222000000730800000000021001160112017224000000630200000000000000020000000400000043000000732a0000007c0064016b0473107400640283018201740174026a037c016602050019007c00370003003c006400530029034e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573212904721e00000072150000007216000000721700000029027222000000722300000072190000007219000000721a000000da07617070726f76652a0000007304000000000210017225000000290372220000007223000000da0c6d61696e5f6163636f756e74630300000000000000040000000500000043000000738800000074007c0274016a02660219007d037c037c006b05732a740364017c039b0064027c009b009d048301820174007c0219007c006b05733e74036403830182017c0064046b04734e740364058301820174007c0274016a026602050019007c00380003003c0074007c02050019007c00380003003c0074007c01050019007c00370003003c006400530029064e7a0d596f7520617070726f766564207a0a20627574206e656564207a194e6f7420656e6f75676820636f696e7320746f2073656e642172010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573212904721500000072160000007217000000721e0000002904722200000072230000007226000000da08617070726f76656472190000007219000000721a000000da0d7472616e736665725f66726f6d30000000730e00000000020e011c0114011001160110017228000000630300000000000000030000000400000043000000734800000074007c0219007c006b05731474016401830182017c0064026b047324740164038301820174007c02050019007c00380003003c0074007c01050019007c00370003003c006400530029044e7a194e6f7420656e6f75676820636f696e7320746f2073656e642172010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e6365732129027215000000721e000000290372220000007223000000722600000072190000007219000000721a000000da135f5f7472616e736665725f696e7465726e616c3b00000073080000000001140110011001722900000063000000000000000002000000060000004300000073ba00000074006a01640174026a0374026a0464028d030100740574066a07830074086a09740a6a0b64016403830264048d0117006b0072386400530074026a046a0c64058301724864005300740d6a078300740e6b0572586400530074006a0f640674026a0464078d02010074107d00783674117c00740d6a07830064081700830244005d207d017c00640837007d0074066a12740583010100740d6a127c008301010071805700741374026a04050019006408370003003c0064095300290a4ee90a0000002903722200000072230000007226000000e91e0000002901da077365636f6e6473da04636f6e5fe909000000290272220000007223000000e901000000da064d494e5445442914da0374617572280000007216000000da047468697372170000007211000000720f000000da03676574da086461746574696d65da0974696d6564656c7461da0672616e646f6dda0772616e64696e74da0a737461727473776974687212000000da0a6d61785f737570706c7972240000007213000000da0572616e6765721000000072150000002902da07636f756e746572da017872190000007219000000721a000000da046d696e74420000007320000000000214011001100104010c0104010c01040110010401180108010a010e011201723d00000029017222000000630100000000000000010000000500000043000000733600000074007c00640174016a0264028d03010074036a047c0074016a0264038d02010074056a0674056a0783007c001700830101006400530029044eda0c4255524e5f4144445245535329037222000000722300000072260000002902722200000072230000002908722900000072160000007217000000723100000072240000007214000000721000000072330000002901722200000072190000007219000000721a000000da0672656465656d560000007306000000000210021001723f000000630000000000000000010000000400000043000000734800000074006a0174026a03830174046a05830074066a058300180018007d0074026a077408640119006b027332740964028301820174006a0a7c0074086401190064038d0201006400530029044e720e0000007a0b4e6f7420616c6c6f776564290272220000007223000000290b723100000072210000007216000000723200000072120000007233000000721400000072170000007218000000721e00000072240000002901722200000072190000007219000000721a000000da067061796f75745e000000730600000000021c0116017240000000291dda0863757272656e63797231000000da09696d706f72746c6962da01497236000000da0473656564da044861736872150000007218000000da085661726961626c6572120000007214000000720f00000072390000007213000000721b000000da085f5f6578706f7274da03737472da03416e79721f0000007221000000da05666c6f61747224000000722500000072280000007229000000723d000000723f0000007240000000721900000072190000007219000000721a000000da083c6d6f64756c653e0100000073320000000801040108010e010c010c010c010c0104010403080a060112050601100406011207060112050601140a1207101406011007
 
Contract con_king_v2
Variable __owner__
New Value null
 
Contract con_king_v2
Variable __submitted__
New Value 2022,5,29,1,23,55,0
 
Contract con_king_v2
Variable __developer__
New Value ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
 
Contract currency
Variable balances
Key ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
New Value 102832.001238421402779107302450342727