Transaction #743745

Hash a05064fe59da5e01cc2676f11c748e1713c9f362fc7742c5d35cc424fdd84082
Status Success
Timestamp 239 days ago - 2/9/2022, 9:40:43 AM UTC+0
Block 699362
Stamps Used 365
Burned Fee 0.02159763 TAU
From ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 826
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature 164858f0835ae184b2c24bc4f25ce1c35f495b8eb250cfbf0d22aa8d51760849e0c86b5bc6b3f4deda1e225b86a549d55f1ef957bff043ef0eb829ceba4af501
Stamps Supplied 845
Stamps per TAU 169

Kwargs

code # Controller Contract for PixelCity # This contract will get a rework at some point (long lists suck), and its not a problem. nothing is locked in here. import currency I = importlib pixelwhale_contract = Variable() pixelwhale_info_contract = Variable() plots = Hash(default_value=0) rewards = Hash(default_value=0) valid_build_nfts = Variable() valid_plot_nfts = Variable() in_use_building_nfts = Variable() @construct def seed(): pixelwhale_contract.set("con_pixel_whale_master_v1") pixelwhale_info_contract.set("con_pixel_whale_info_v1") valid_build_nfts.set([]) valid_plot_nfts.set([]) in_use_building_nfts.set([]) @export def connect_built_to_plot(plot_thing: str, build_thing: str): remove_non_build_owners() remove_non_plot_owners() assert build_thing not in in_use_building_nfts.get(), 'This building is already in use' assert plot_thing in valid_plot_nfts.get(), 'Not a valid PixelCity NFT!' assert build_thing in valid_build_nfts.get(), 'Not a valid PixelCity NFT!' thing_info_owners = ForeignHash(foreign_contract=pixelwhale_info_contract.get(), foreign_name='S') owner_plot = thing_info_owners[plot_thing, 'owner'] owner_build = thing_info_owners[build_thing, 'owner'] assert owner_plot == ctx.caller, "You are not the owner of this plot" assert owner_build == ctx.caller, "You are not the owner of this build" plots[plot_thing] = {"current_plot_owner":ctx.caller, "current_build_owner": ctx.caller, "built": build_thing} old_in_use_building_nfts = in_use_building_nfts.get() old_in_use_building_nfts.append(build_thing) in_use_building_nfts.set(old_in_use_building_nfts) def remove_non_plot_owners(): thing_info_owners = ForeignHash(foreign_contract=pixelwhale_info_contract.get(), foreign_name='S') old_in_use_building_nfts = in_use_building_nfts.get() for plot_thing in valid_plot_nfts.get(): if(plots[plot_thing] != 0): if thing_info_owners[plot_thing, 'owner'] != plots[plot_thing]["current_plot_owner"]: if(plots[plot_thing]["built"] in old_in_use_building_nfts): old_in_use_building_nfts.remove(plots[plot_thing]["built"]) plots[plot_thing] = {"current_plot_owner": "", "current_build_owner": "", "built": ""} in_use_building_nfts.set(old_in_use_building_nfts) def remove_non_build_owners(): thing_info_owners = ForeignHash(foreign_contract=pixelwhale_info_contract.get(), foreign_name='S') old_in_use_building_nfts = in_use_building_nfts.get() for plot_thing in valid_plot_nfts.get(): if(plots[plot_thing] != 0): if thing_info_owners[plots[plot_thing]["built"], 'owner'] != plots[plot_thing]["current_build_owner"]: old_plot = plots[plot_thing] if(old_plot["built"] in old_in_use_building_nfts): old_in_use_building_nfts.remove(old_plot["built"]) plots[plot_thing] = {"current_plot_owner":old_plot["current_plot_owner"], "current_build_owner": old_plot["current_build_owner"], "built": ""} in_use_building_nfts.set(old_in_use_building_nfts) @export def deposit_rewards(currency_amount:float): assert currency_amount > 0, "Cant deposit negative amounts" currency.transfer_from(amount=currency_amount, to=ctx.this, main_account=ctx.caller) for plot_thing in valid_plot_nfts.get(): if(plots[plot_thing] != 0): if(plots[plot_thing]["built"] != ""): rewards[plots[plot_thing]["current_build_owner"]] += currency_amount / (len(in_use_building_nfts.get())) @export def claim_rewards(): remove_non_build_owners() remove_non_plot_owners() amount_to_claim = rewards[ctx.caller] if(amount_to_claim > 0): rewards[ctx.caller] = 0 currency.transfer(amount=amount_to_claim, to=ctx.caller) @export def set_valid_plot_nfts(list_of_nfts: list): assert ctx.caller == "ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89", 'You are not allowed to do that' valid_plot_nfts.set(list_of_nfts) @export def set_valid_build_nfts(list_of_nfts: list): assert ctx.caller == "ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89", 'You are not allowed to do that' valid_build_nfts.set(list_of_nfts)
name con_pixelcity_master_1

State Changes

Contract con_pixelcity_master_1
Variable pixelwhale_contract
New Value con_pixel_whale_master_v1
 
Contract con_pixelcity_master_1
Variable pixelwhale_info_contract
New Value con_pixel_whale_info_v1
 
Contract con_pixelcity_master_1
Variable valid_build_nfts
New Value []
 
Contract con_pixelcity_master_1
Variable valid_plot_nfts
New Value []
 
Contract con_pixelcity_master_1
Variable in_use_building_nfts
New Value []
 
Contract con_pixelcity_master_1
Variable __code__
New Value import currency I = importlib __pixelwhale_contract = Variable(contract='con_pixelcity_master_1', name= 'pixelwhale_contract') __pixelwhale_info_contract = Variable(contract='con_pixelcity_master_1', name='pixelwhale_info_contract') __plots = Hash(default_value=0, contract='con_pixelcity_master_1', name='plots' ) __rewards = Hash(default_value=0, contract='con_pixelcity_master_1', name= 'rewards') __valid_build_nfts = Variable(contract='con_pixelcity_master_1', name= 'valid_build_nfts') __valid_plot_nfts = Variable(contract='con_pixelcity_master_1', name= 'valid_plot_nfts') __in_use_building_nfts = Variable(contract='con_pixelcity_master_1', name= 'in_use_building_nfts') def ____(): __pixelwhale_contract.set('con_pixel_whale_master_v1') __pixelwhale_info_contract.set('con_pixel_whale_info_v1') __valid_build_nfts.set([]) __valid_plot_nfts.set([]) __in_use_building_nfts.set([]) @__export('con_pixelcity_master_1') def connect_built_to_plot(plot_thing: str, build_thing: str): __remove_non_build_owners() __remove_non_plot_owners() assert build_thing not in __in_use_building_nfts.get( ), 'This building is already in use' assert plot_thing in __valid_plot_nfts.get(), 'Not a valid PixelCity NFT!' assert build_thing in __valid_build_nfts.get( ), 'Not a valid PixelCity NFT!' __thing_info_owners = ForeignHash(foreign_contract= __pixelwhale_info_contract.get(), foreign_name='S', contract= 'con_pixelcity_master_1', name='thing_info_owners') owner_plot = __thing_info_owners[plot_thing, 'owner'] owner_build = __thing_info_owners[build_thing, 'owner'] assert owner_plot == ctx.caller, 'You are not the owner of this plot' assert owner_build == ctx.caller, 'You are not the owner of this build' __plots[plot_thing] = {'current_plot_owner': ctx.caller, 'current_build_owner': ctx.caller, 'built': build_thing} old_in_use_building_nfts = __in_use_building_nfts.get() old_in_use_building_nfts.append(build_thing) __in_use_building_nfts.set(old_in_use_building_nfts) def __remove_non_plot_owners(): __thing_info_owners = ForeignHash(foreign_contract= __pixelwhale_info_contract.get(), foreign_name='S', contract= 'con_pixelcity_master_1', name='thing_info_owners') old_in_use_building_nfts = __in_use_building_nfts.get() for plot_thing in __valid_plot_nfts.get(): if __plots[plot_thing] != 0: if __thing_info_owners[plot_thing, 'owner'] != __plots[plot_thing][ 'current_plot_owner']: if __plots[plot_thing]['built'] in old_in_use_building_nfts: old_in_use_building_nfts.remove(__plots[plot_thing][ 'built']) __plots[plot_thing] = {'current_plot_owner': '', 'current_build_owner': '', 'built': ''} __in_use_building_nfts.set(old_in_use_building_nfts) def __remove_non_build_owners(): __thing_info_owners = ForeignHash(foreign_contract= __pixelwhale_info_contract.get(), foreign_name='S', contract= 'con_pixelcity_master_1', name='thing_info_owners') old_in_use_building_nfts = __in_use_building_nfts.get() for plot_thing in __valid_plot_nfts.get(): if __plots[plot_thing] != 0: if __thing_info_owners[__plots[plot_thing]['built'], 'owner' ] != __plots[plot_thing]['current_build_owner']: old_plot = __plots[plot_thing] if old_plot['built'] in old_in_use_building_nfts: old_in_use_building_nfts.remove(old_plot['built']) __plots[plot_thing] = {'current_plot_owner': old_plot[ 'current_plot_owner'], 'current_build_owner': old_plot[ 'current_build_owner'], 'built': ''} __in_use_building_nfts.set(old_in_use_building_nfts) @__export('con_pixelcity_master_1') def deposit_rewards(currency_amount: float): assert currency_amount > 0, 'Cant deposit negative amounts' currency.transfer_from(amount=currency_amount, to=ctx.this, main_account=ctx.caller) for plot_thing in __valid_plot_nfts.get(): if __plots[plot_thing] != 0: if __plots[plot_thing]['built'] != '': __rewards[__plots[plot_thing]['current_build_owner'] ] += currency_amount / len(__in_use_building_nfts.get()) @__export('con_pixelcity_master_1') def claim_rewards(): __remove_non_build_owners() __remove_non_plot_owners() amount_to_claim = __rewards[ctx.caller] if amount_to_claim > 0: __rewards[ctx.caller] = 0 currency.transfer(amount=amount_to_claim, to=ctx.caller) @__export('con_pixelcity_master_1') def set_valid_plot_nfts(list_of_nfts: list): assert ctx.caller == 'ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89', 'You are not allowed to do that' __valid_plot_nfts.set(list_of_nfts) @__export('con_pixelcity_master_1') def set_valid_build_nfts(list_of_nfts: list): assert ctx.caller == 'ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89', 'You are not allowed to do that' __valid_build_nfts.set(list_of_nfts)
 
Contract con_pixelcity_master_1
Variable __compiled__
New Value e3000000000000000000000000050000004000000073ea000000640064016c005a0065015a0265036402640364048d025a0465036402640564048d025a05650664006402640664078d035a07650664006402640864078d035a0865036402640964048d025a0965036402640a64048d025a0a65036402640b64048d025a0b640c640d84005a0c650d64028301650e650e640e9c02640f6410840483015a0f6411641284005a106413641484005a11650d64028301651264159c0164166417840483015a13650d6402830164186419840083015a14650d640283016515641a9c01641b641c840483015a16650d640283016515641a9c01641d641e840483015a1764015300291fe9000000004eda16636f6e5f706978656c636974795f6d61737465725f31da13706978656c7768616c655f636f6e74726163742902da08636f6e7472616374da046e616d65da18706978656c7768616c655f696e666f5f636f6e7472616374da05706c6f74732903da0d64656661756c745f76616c756572040000007205000000da0772657761726473da1076616c69645f6275696c645f6e667473da0f76616c69645f706c6f745f6e667473da14696e5f7573655f6275696c64696e675f6e667473630000000000000000000000000200000043000000733600000074006a0164018301010074026a0164028301010074036a0167008301010074046a0167008301010074056a016700830101006400530029034eda19636f6e5f706978656c5f7768616c655f6d61737465725f7631da17636f6e5f706978656c5f7768616c655f696e666f5f76312906da155f5f706978656c7768616c655f636f6e7472616374da03736574da1a5f5f706978656c7768616c655f696e666f5f636f6e7472616374da125f5f76616c69645f6275696c645f6e667473da115f5f76616c69645f706c6f745f6e667473da165f5f696e5f7573655f6275696c64696e675f6e667473a90072150000007215000000da00da045f5f5f5f13000000730a00000000010a010a010a010a0172170000002902da0a706c6f745f7468696e67da0b6275696c645f7468696e6763020000000000000006000000060000004300000073cc0000007400830001007401830001007c0174026a0383006b07732074046401830182017c0074056a0383006b06733474046402830182017c0174066a0383006b0673487404640283018201740774086a03830064036404640564068d047d027c027c006407660219007d037c027c016407660219007d047c0374096a0a6b02738674046408830182017c0474096a0a6b027398740464098301820174096a0a74096a0a7c01640a9c03740b7c003c0074026a0383007d057c056a0c7c018301010074026a0d7c058301010064005300290b4e7a1f54686973206275696c64696e6720697320616c726561647920696e207573657a1a4e6f7420612076616c696420506978656c43697479204e465421da01537202000000da117468696e675f696e666f5f6f776e6572732904da10666f726569676e5f636f6e7472616374da0c666f726569676e5f6e616d6572040000007205000000da056f776e65727a22596f7520617265206e6f7420746865206f776e6572206f66207468697320706c6f747a23596f7520617265206e6f7420746865206f776e6572206f662074686973206275696c642903da1263757272656e745f706c6f745f6f776e6572da1363757272656e745f6275696c645f6f776e6572da056275696c74290eda195f5f72656d6f76655f6e6f6e5f6275696c645f6f776e657273da185f5f72656d6f76655f6e6f6e5f706c6f745f6f776e6572737214000000da03676574da0e417373657274696f6e4572726f7272130000007212000000da0b466f726569676e486173687211000000da03637478da0663616c6c6572da075f5f706c6f7473da06617070656e647210000000290672180000007219000000da135f5f7468696e675f696e666f5f6f776e657273da0a6f776e65725f706c6f74da0b6f776e65725f6275696c64da186f6c645f696e5f7573655f6275696c64696e675f6e667473721500000072150000007216000000da15636f6e6e6563745f6275696c745f746f5f706c6f741b00000073260000000002060106010e01060114010e010601020108010a010c010c01120112010401100108010a01722f0000006300000000000000000300000006000000430000007392000000740074016a02830064016402640364048d047d0074036a0283007d01786674046a02830044005d5a7d0274057c02190064056b0372267c007c0264066602190074057c021900640719006b03722674057c021900640819007c016b0672707c016a0674057c0219006408190083010100640964096409640a9c0374057c023c007126570074036a077c018301010064005300290b4e721a0000007202000000721b0000002904721c000000721d000000720400000072050000007201000000721e000000721f000000722100000072160000002903721f000000722000000072210000002908722600000072110000007224000000721400000072130000007229000000da0672656d6f766572100000002903722b000000722e0000007218000000721500000072150000007216000000722300000032000000731c0000000001020108010a0108010e010c011001080110010a01080102011201722300000063000000000000000004000000060000004300000073a2000000740074016a02830064016402640364048d047d0074036a0283007d01787674046a02830044005d6a7d0274057c02190064056b0372267c0074057c0219006406190064076602190074057c021900640819006b03722674057c0219007d037c03640619007c016b0672787c016a067c0364061900830101007c03640919007c0364081900640a640b9c0374057c023c007126570074036a077c018301010064005300290c4e721a0000007202000000721b0000002904721c000000721d0000007204000000720500000072010000007221000000721e0000007220000000721f00000072160000002903721f000000722000000072210000002908722600000072110000007224000000721400000072130000007229000000723000000072100000002904722b000000722e0000007218000000da086f6c645f706c6f74721500000072150000007216000000722200000043000000731e0000000001020108010a0108010e010c0112010e0108010c010e0102010601140172220000002901da0f63757272656e63795f616d6f756e74630100000000000000020000000700000043000000737a0000007c0064016b047310740064028301820174016a027c0074036a0474036a0564038d030100785074066a07830044005d447d0174087c01190064016b03722e74087c0119006404190064056b03722e740974087c01190064061900050019007c00740a740b6a07830083011b00370003003c00712e57006400530029074e72010000007a1d43616e74206465706f736974206e6567617469766520616d6f756e74732903da06616d6f756e74da02746fda0c6d61696e5f6163636f756e74722100000072160000007220000000290c7225000000da0863757272656e6379da0d7472616e736665725f66726f6d7227000000da04746869737228000000721300000072240000007229000000da095f5f72657761726473da036c656e7214000000290272320000007218000000721500000072150000007216000000da0f6465706f7369745f72657761726473550000007310000000000210010a010a010e010c0110011001723b000000630000000000000000010000000400000043000000733c000000740083000100740183000100740274036a0419007d007c0064016b0472386401740274036a043c0074056a067c0074036a0464028d0201006400530029034e72010000002902723300000072340000002907722200000072230000007239000000722700000072280000007236000000da087472616e736665722901da0f616d6f756e745f746f5f636c61696d721500000072150000007216000000da0d636c61696d5f7265776172647361000000730c0000000002060106010a0108010a01723e0000002901da0c6c6973745f6f665f6e667473630100000000000000010000000200000043000000732000000074006a0164016b027312740264028301820174036a047c00830101006400530029034eda40666636313534346561393465616165623564663038656438363363346139333865393132396162613663656565356633316236363831626465646531316238397a1e596f7520617265206e6f7420616c6c6f77656420746f20646f20746861742905722700000072280000007225000000721300000072100000002901723f000000721500000072150000007216000000da137365745f76616c69645f706c6f745f6e6674736b0000007304000000000212017241000000630100000000000000010000000200000043000000732000000074006a0164016b027312740264028301820174036a047c00830101006400530029034e72400000007a1e596f7520617265206e6f7420616c6c6f77656420746f20646f20746861742905722700000072280000007225000000721200000072100000002901723f000000721500000072150000007216000000da147365745f76616c69645f6275696c645f6e66747371000000730400000000021201724200000029187236000000da09696d706f72746c6962da0149da085661726961626c65720f0000007211000000da0448617368722900000072390000007212000000721300000072140000007217000000da085f5f6578706f7274da03737472722f00000072230000007222000000da05666c6f6174723b000000723e000000da046c697374724100000072420000007215000000721500000072150000007216000000da083c6d6f64756c653e0100000073340000000801040104010801040108010e0206010801040108010401080104010803080806011216081108120601100b100a060110050601
 
Contract con_pixelcity_master_1
Variable __owner__
New Value null
 
Contract con_pixelcity_master_1
Variable __submitted__
New Value 2022,2,9,9,40,44,0
 
Contract con_pixelcity_master_1
Variable __developer__
New Value ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89
 
Contract currency
Variable balances
Key ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89
New Value 39.268379351727091527225277048313